def namedModule(name):
    topLevel = __import__(name)
    packages = name.split(".")[1:]
    m = topLevel
    for p in packages:
        m = getattr(m, p)
    return m
Test that getattr raises an attributeerror if we give it garbage.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/python/reflect.py/namedModule--crossover with--dataset/ETHPy150Open soundcloud/soundcloud-python/soundcloud/tests/test_client.py/test_method_dispatching_invalid_method