Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ref_start, _, _ = self.ref_indices[ref_id]
self._io.seek(ref_start)
except KeyError:
raise KeyError('Reference is not found in header')
ref_start = self._io.tell()
if not idx:
assert ref_start == self.ref_indices[ref_id].start_offset, 'ref not properly aligned'
n_bins = unpack_int32L(self._io.read(4))[0]
bins = self.get_bins(n_bins, ref_id, idx)
self._last_pos = self._io.tell()
if idx:
return bai.RefIdx(ref_start, self._last_pos, n_bins)
else:
return RefCsi(bins, ref_id)