<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resource_filename_mod_dist(module_name, dist):
 """ Given a module name and a distribution, attempt to resolve the actual path to the module. """


    try:
        return pkg_resources.resource_filename(
            dist.as_requirement(), join(*module_name.split('.')))
    except pkg_resources.DistributionNotFound:
        logger.warning(
            "distribution '%s' not found, falling back to resolution using "
            "module_name '%s'", dist, module_name,
        )
        return pkg_resources.resource_filename(module_name, '')