def _retrieve_obj(name, context):
    """ Filter function for completion. """
    if '(' in name:
        raise ValueError()
    try:
        obj = eval(name, context.shell.user_ns)
    except AttributeError:
        obj = eval(name, context.user_ns)
    return obj
