def _resolve(name):
    """Resolve a dotted name to a global object."""
    name = name.split('.')
    used = name.pop(0)
    found = __import__(used)
    for n in name:
        used = used + '.' + n
        try:
            found = getattr(found, n)
        except __HOLE__:
            __import__(used)
            found = getattr(found, n)
    return found
dataset/ETHPy150Open rspivak/cynic/cynic/server.py/_resolve