from typing import Callable
from typing import Any
from typing import Optional
import inspect
from typing import NoReturn


def _has_return_value_from_type_annotation(
    method: Callable[..., Any]) -> Optional[bool]:
  """Examines the type annotation to determine if method returns.

  Args:
    method: method to check.

  Returns:
    bool: True if the method has a return value, False otherwise.
    None: If it's not possible to tell (no return value type annotation).
  """
  type_annotations = inspect.getfullargspec(method).annotations
  if "return" not in type_annotations:
    return None
  return type_annotations["return"] not in [None, NoReturn]