def _module_internal_namespace_or_emtpy_string(cls):
    """
    Best-effort method for getting the module-internal namespace in which a
    class is defined -- i.e. the namespace _inside_ the module.
    """
    try:
        qualname = cls.__qualname__
    except AttributeError:
        return ''
    return '.'.join(qualname.split('.')[:-1])
