Returns a module name for a callable or `None` if no name can be found.

def name_for_callable(func):
  """Returns a module name for a callable or `None` if no name can be found."""
  if isinstance(func, functools.partial):
    return name_for_callable(func.func)

  try:
    name = func.__name__
  except AttributeError:
    return None

  if name == "<lambda>":
    return None
  else:
    return to_snake_case(name)