Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load_metadata(filename):
"""Load cluster metadata from a CSV file.
Return (field_name, dictionary).
"""
return _read_tsv(filename)
def _load(path):
path = str(path)
if path.endswith('.npy'):
return np.load(path)
elif path.endswith(('.csv', '.tsv')):
return _read_tsv(path)[1] # the function returns a tuple (field, data)
elif path.endswith('.bin'):
# TODO: configurable dtype
return np.fromfile(path, np.int16)