code: def _as_key_indices(keys, key_names):
      if keys is None:
          return keys
  
      key_indices = []
      for key in keys:
          if isinstance(key, numbers.Integral):
              key_index = key
              if key_index < 0:
                  key_index += len(key_names)
              if key_index < 0 or len(key_names) <= key_index:
                  raise IndexError(
                      "index {} is out of bounds for keys with size {}".format(
                          key, len(key_names)
                      )
                  )
          else:
              try:
                  key_index = key_names.index(key)
              except ValueError:
                  raise KeyError("{} does not exists".format(key))
          key_indices.append(key_index)
      return tuple(key_indices)
  
imports: import numbers
  import numpy
  import six
  from chainer.dataset.tabular import tabular_dataset
label_desc: Use image node_id 2 for calling a global function with example usage: _as_key_indices(keys, key_names) and returns: tuple, keys