code: def get_value(key, obj, default=missing):
      
      if isinstance(key, int):
          return _get_value_for_key(key, obj, default)
      return _get_value_for_keys(key.split('.'), obj, default)
docs: Helper for pulling a keyed value off various types of objects