code: def _as_key_indices(keys, key_names):
      key_names = _as_tuple(key_names)
      keys = _bool_to_indices(_as_tuple(keys), len(key_names))
  
      for key in keys:
          if isinstance(key, numbers.Integral):
              key_index = key
              if key_index < 0:
                  key_index += len(key_names)
              if key_index not in range(0, len(key_names)):
                  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))
          yield key_index
  
imports: import numbers
  import numpy
  import six
  import chainer
label_desc: Use image node_id 4 for calling a global function with example usage: _as_key_indices(keys, key_names) without return types