@interactive
def _pull(keys):
    user_ns = globals()
    if isinstance(keys, (list,tuple, set)):
        for key in keys:
            if key not in user_ns:
                raise NameError("name '%s' is not defined"%key)
        return list(map(user_ns.get, keys))
    else:
        if keys not in user_ns:
            raise NameError("name '%s' is not defined"%keys)
        return user_ns.get(keys)
helper method for implementing `client.pull` via `client.apply`
dataset/ETHPy150Open ipython/ipython-py3k/IPython/parallel/util.py/_pull