Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def read_binary(self, file):
"""Read binary segments descriptions from a DAF/PCK file.
Binary segments live in ``.bpc`` files and predict how a body
like a planet or moon will be oriented on a given date.
"""
file.seek(0)
if file.read(7) != b'DAF/PCK':
raise ValueError('file must start with the bytes "DAF/PCK"')
pck = PCK(DAF(file))
self._binary_files.append(pck)
for segment in pck.segments:
self._segment_map[segment.body] = segment