code: def _get(structure, key, default):
      try:
          if hasattr(structure, "__getitem__"):
              return structure[key]
  
          return getattr(structure, key)
  
      except (IndexError, KeyError):
          return default
  
file_path: catboost/contrib/python/pyrsistent/py2/pyrsistent/_transformations.py
imports: import re
  import six
label_desc: Use image node_id 10 for calling a global function with example usage: _get(structure, key, default) and returns: getattr, structure, default