docs: def convert_index_to_keys(d, item):
      # use a separate function rather than a method inside the class IndexDict
      '''
      Convert ``item`` in various types (int, tuple/list, slice, or a normal key)
      to a single key or a list of keys.
      '''
  
      keys = force_list(d.keys())
      # use KeyError for compatibility of normal use
  
      # Warning: int item will be interpreted as the index rather than key!!
      if isinstance(item, int):
          item = _int_to_key(keys, item)
          single = True
  
      elif isinstance(item, (tuple, list)):
          item2 = []
          for i in item:
              i = _int_to_key(keys, i)
              item2.append(i)
          item = item2
          single = False
  
      elif isinstance(item, slice):
          start, stop, step = item.start, item.stop, item.step
          # None is not interpreted as a key
          if not isinstance(start, (NoneType, int)):
              try:
                  start = keys.index(start)
              except ValueError:
                  raise KeyError('%s is not in the list of keys' % (start,))
          if not isinstance(stop, (NoneType, int)):
              try:
                  stop = keys.index(stop)
              except ValueError:
                  raise KeyError('%s is not in the list of keys' % (stop,))
          item = keys[start:stop:step]
          single = False
  
      else:  # other types, treated as a single key
          IndexDict_check_key_type(item)
          single = True
  
      return item, single