code: def _get_value(obj, key):
      
      if isinstance(obj, (list, tuple)):
          for item in obj:
              v = _find_value(key, item)
              if v is not None:
                  return v
          return None
      if isinstance(obj, dict):
          return obj.get(key)
      if obj is not None:
          return getattr(obj, key, None)
docs: Get a value for 'key' from 'obj', if possible