def is_defined_in_module(o, module):
    """
    Checks if an object is defined in a given module and not imported.

    Args:
        o (Type): Object to check
        module (ModuleType): Module

    Returns:
        bool
    """
    return o.__module__ == module.__name__