def _process_key(self, key: str, index: int, error_type: Type[Exception]):
    if key.startswith('next_'):
        if (not self._rollout.continuous):
            raise error_type('Access to next element is not supported for non-continuous rollouts!')
        key = key[5:]
        index += 1
    if ((key not in self._rollout.data_names) and ((key + 's') not in self._rollout.data_names) and (key != 'done')):
        raise error_type(f'No such rollout data field: {key}')
    return (key, index)
def _process_key(self, key: str, index: int, error_type: Type[Exception]):
    if key.startswith('next_'):
        if (not self._rollout.continuous):
            raise error_type('Access to next element is not supported for non-continuous rollouts!')
        key = key[5:]
        index += 1
    if ((key not in self._rollout.data_names) and ((key + 's') not in self._rollout.data_names) and (key != 'done')):
        raise error_type(f'No such rollout data field: {key}')
    return (key, index)