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_ids(path, delimiter=None, timestamptype=None):
f = open(path)
ids = {}
for line in f:
s = line.rstrip().split(delimiter)
ids[timestamptype(s[-1])] = None
if len(line) == 4:
if s[-2] not in ['+', '-']:
ids[timestamptype(s[-2])] = None
f.flush()
f.close()
ids = compact_timeslot(ids.keys())
return ids