def _get_index_by_id(self, id):
    try:
        return next((i for (i, v) in enumerate(self['id']) if v.startswith(id)))
    except StopIteration:
        raise KeyError('Frame with id {} not found.'.format(id))
def _get_index_by_id(self, id):
    try:
        return next((i for (i, v) in enumerate(self['id']) if v.startswith(id)))
    except StopIteration:
        raise KeyError('Frame with id {} not found.'.format(id))