import types
from typing import Any


def get_obj_from_module(module: types.ModuleType, obj_name: str) -> Any:
  """Traverses the object name and returns the last (rightmost) python object."""
  if obj_name == '':
    return module
  obj = module
  for part in obj_name.replace('/', '.').split("."):
    obj = getattr(obj, part)
  return obj