def is_same_module_or_submodule(orig, incoming):
    """
    Returns true if the incoming module is the same module as the original, 
    or is a submodule of the original module
    """
    if incoming is None:
        return False
    if orig == incoming:
        return True
    if incoming.__name__.startswith(orig.__name__):
        return True
    return False