docs: def _instantiate(class_, type_, __value, *args, **kwargs):
          """Instantiate the object if possible.
  
          Args:
              class_: The class to instantiate.
              type_: The the class is uninstantiable, attempt to cast to a base
                  type.
              __value: The value to return if the class and type are
                  uninstantiable.
              *args: The positional arguments to pass to the class.
              **kwargs: The keyword arguments to pass to the class.
  
          Returns:
              The class or base type instantiated using the arguments. If it is
              not possible to instantiate either, returns __value.
          """
          try:
              return class_(__value, *args, **kwargs)
          except TypeError:
              try:
                  return type_(__value, *args, **kwargs)
              except Exception:  # pylint: disable=broad-except
                  return __value