docs: def _index(*args, **kwargs):
      """Implementation of list searching.
  
      :param of: Element to search for
      :param where: Predicate to search for
      :param in_: List to search in
      :param start: Start index for the lookup
      :param step: Counter step (i.e. in/decrement) for each iteration
  
      :return: Pair of ``(list, index)``,
               where ``list`` is the list we searched in
               and ``index`` is the index of the first element found, or -1
      """
      start = kwargs.pop('start', 0)
      step = kwargs.pop('step', 1)
  
      if len(args) == 2:
          elem, list_ = args
          ensure_sequence(list_)
          predicate = lambda item: item == elem
      else:
          ensure_keyword_args(kwargs,
                              mandatory=('in_',), optional=('of', 'where'))
          if 'of' in kwargs and 'where' in kwargs:
              raise TypeError(
                  "either an item or predicate must be supplied, not both")
          if not ('of' in kwargs or 'where' in kwargs):
              raise TypeError("an item or predicate must be supplied")
  
          list_ = ensure_sequence(kwargs['in_'])
          if 'where' in kwargs:
              predicate = ensure_callable(kwargs['where'])
          else:
              elem = kwargs['of']
              predicate = lambda item: item == elem
  
      len_ = len(list_)
      start = max(0, min(len_ - 1, start))
  
      i = start
      while 0 <= i < len_:
          if predicate(list_[i]):
              return list_, i
          i += step
      else:
          return list_, -1