import types
from typing import Sequence
from typing import Tuple


def get_public_symbols(
    root_module: types.ModuleType) -> Sequence[Tuple[str, types.FunctionType]]:
  """Returns `(symbol_name, symbol)` for all symbols of `root_module`."""
  fns = []
  for name in getattr(root_module, "__all__"):
    o = getattr(root_module, name)
    fns.append((name, o))
  return fns