def METHOD_NAME(annotation: Any) -> Any:
  """Resolves annotation type against a MB SDK type.
  Use this for Optional, Union, Forward References
  Args:
      annotation: Annotation to resolve
  Returns:
      Direct annotation
  """
  # handle forward reference string
  # if this is an Ai Platform resource noun
  if inspect.isclass(annotation):
    if issubclass(annotation, aiplatform.base.VertexAiResourceNoun):
      return annotation
  # if this is a union of all typed datasets annotation
  if annotation is dataset_annotation:
    # return the catch all Dataset class
    return aiplatform.datasets.dataset._Dataset
  # handle forward references
  resolved_annotation = get_forward_reference(annotation)
  if resolved_annotation:
    return resolved_annotation
  # handle optional types
  if getattr(annotation, '__origin__', None) is Union:
    # assume optional type
    # TODO check for optional type
    resolved_annotation = get_forward_reference(annotation.__args__[0])
    if resolved_annotation:
      return resolved_annotation
    else:
      return annotation.__args__[0]
  if annotation is inspect._empty:
    return None
  return annotation