<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _relation_module(role, interface):
 """ Return module for relation based on its role and interface, or None. Prefers new location (reactive/relations) over old (hooks/relations). """

    _append_path(hookenv.charm_dir())
    _append_path(os.path.join(hookenv.charm_dir(), 'hooks'))
    base_module = 'relations.{}.{}'.format(interface, role)
    for module in ('reactive.{}'.format(base_module), base_module):
        if module in sys.modules:
            break
        try:
            importlib.import_module(module)
            break
        except ImportError:
            continue
    else:
        hookenv.log('Unable to find implementation for relation: '
                    '{} of {}'.format(role, interface), hookenv.ERROR)
        return None
    return sys.modules[module]