Registers given module or caller introspected module in the candidates modules for tracing.

    :param module: Module to register.
    :type module: ModuleType
    :return: Definition success.
    :rtype: bool

def register_module(module=None):
    """
    Registers given module or caller introspected module in the candidates modules for tracing.

    :param module: Module to register.
    :type module: ModuleType
    :return: Definition success.
    :rtype: bool
    """

    global REGISTERED_MODULES

    if module is None:
        # Note: inspect.getmodule() can return the wrong module if it has been imported with different relatives paths.
        module = sys.modules.get(inspect.currentframe().f_back.f_globals["__name__"])

    REGISTERED_MODULES.add(module)
    return True