from typing import Optional
from typing import Set
import inspect


def get_base_cls(obj: type) -> Optional[Set[type]]:
  """Get a set of base classes of given `obj`.

  Parameters:

  - `obj`: The python class to find its base classes.

  Returns:

  - A set of base classes or `None`.
  """
  if inspect.isclass(obj):
    return set(obj.__bases__)
  return None