def METHOD_NAME(manifest, ground_truth, to_take=1000):
    import json
    import pathlib
    with open(ground_truth, 'r') as fin:
        original_continuations = json.loads(fin.read())
    sequence2length = [(k, v[0]) for k, v in original_continuations.items()]
    assert all(float(v) >= 6.0 for (_, v) in sequence2length)  # 6 seconds
    sequence2length.sort(key=lambda x: x[1])
    to_take_sequences = set(v[0] for v in sequence2length[:to_take])
    to_take_ids = []
    with open(manifest, 'r') as f:
        f.readline()
        for i, line in enumerate(f.readlines()):
            seq_id = line.split()[0]
            seq_id = pathlib.Path(seq_id).name.split('__')[0]
            if seq_id in to_take_sequences:
                to_take_ids.append(i)
    print(f'Took {len(to_take_ids)} ids')
    return set(to_take_ids)