docs: def get_attr_from_dict(inspected_obj: Any, attr_name: str) -> Any:
      """Ensures we get descriptor object instead of its return value.
      """
      if inspect.isclass(inspected_obj):
          obj_list = [inspected_obj] + list(inspected_obj.__mro__)
      else:
          obj_list = [inspected_obj] + list(inspected_obj.__class__.__mro__)
      for obj in obj_list:
          if hasattr(obj, '__dict__') and attr_name in obj.__dict__:
              return obj.__dict__[attr_name]
      # This happens when user-defined __dir__ returns something that's not
      # in any __dict__. See test_override_dir.
      # Returns attr_name so that it's treated as a normal property.
      return attr_name