code: def _get_keys_and_values(structure, key_spec):
      if callable(key_spec):
          # Support predicates as callable objects in the path
          arity = _get_arity(key_spec)
          if arity == 1:
              # Unary predicates are called with the "key" of the path
              # - eg a key in a mapping, an index in a sequence.
              return [
                  (k, v) for k, v in _items(structure) if key_spec(k)
              ]
          elif arity == 2:
              # Binary predicates are called with the key and the corresponding
              # value.
              return [
                  (k, v) for k, v in _items(structure) if key_spec(k, v)
              ]
          else:
              # Other arities are an error.
              raise ValueError(
                  "callable in transform path must take 1 or 2 arguments"
              )
  
      # Non-callables are used as-is as a key.
      return [(key_spec, _get(structure, key_spec, _EMPTY_SENTINEL))]
  
file_path: catboost/contrib/python/pyrsistent/py2/pyrsistent/_transformations.py
imports: import re
  import six
label_desc: Use image node_id 11 for calling a global function with example usage: _get_keys_and_values(structure, key_spec) and returns: list, unknown, unknown