def find_related_module(app, related_name):
    """Given an application name and a module name, tries to find that
    module in the application."""

    try:
        app_path = importlib.import_module(app).__path__
    except ImportError as exc:
        warn('Autodiscover: Error importing %s.%s: %r' % (
            app, related_name, exc,
        ))
        return
    except AttributeError:
        return

    try:
        imp.find_module(related_name, app_path)
    except __HOLE__:
        return

    return importlib.import_module('{0}.{1}'.format(app, related_name))
dataset/ETHPy150Open celery/django-celery/djcelery/loaders.py/find_related_module