Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
elif isinstance(pointer_data, Units):
if pointer_data.units == 'BYTES':
return [pointer_data.value, None]
else:
raise ValueError(
'Expected as image pointer units but found (%s)'
% pointer_data.units)
elif isinstance(pointer_data, six.string_types):
return [0, pointer_data]
elif isinstance(pointer_data, list):
if len(pointer_data) == 1:
return [0, pointer_data]
else:
if isinstance(pointer_data[1], six.integer_types):
return [(pointer_data[1] - 1) * record_bytes, pointer_data[0]]
elif isinstance(pointer_data[1], Units):
if pointer_data[1].units == 'BYTES':
return [pointer_data[1].value, pointer_data[0]]
else:
raise ValueError(
'Expected as image pointer units but found (%s)'
% pointer_data.units)
else:
raise ValueError('Unsupported pointer type')
record_bytes
Record multiplier value
Returns
-------
object_location : array
Returns an array like::
[start_byte, filename]
[start_byte, None]
[0, filename]
"""
if isinstance(pointer_data, six.integer_types):
return [(pointer_data - 1) * record_bytes, None]
elif isinstance(pointer_data, Units):
if pointer_data.units == 'BYTES':
return [pointer_data.value, None]
else:
raise ValueError(
'Expected as image pointer units but found (%s)'
% pointer_data.units)
elif isinstance(pointer_data, six.string_types):
return [0, pointer_data]
elif isinstance(pointer_data, list):
if len(pointer_data) == 1:
return [0, pointer_data]
else:
if isinstance(pointer_data[1], six.integer_types):
return [(pointer_data[1] - 1) * record_bytes, pointer_data[0]]
elif isinstance(pointer_data[1], Units):
if pointer_data[1].units == 'BYTES':