def getBindings(varList, startLevel=<NUM_LIT:0>):
varsToFind = set(varList)<EOL>bindings = {}<EOL>frame = inspect.currentframe()<EOL>try:<EOL><INDENT>for i in range(startLevel+<NUM_LIT:1>):<EOL><INDENT>frame = frame.f_back<EOL><DEDENT><DEDENT>except:<EOL><INDENT>raise Exception("<STR_LIT>".format(startLevel))<EOL><DEDENT>while frame:<EOL><INDENT>frameLocals = frame.f_locals<EOL>localKeys = set(varsToFind).intersection(frameLocals)<EOL>for v in localKeys:<EOL><INDENT>bindings[v]=frameLocals[v]<EOL><DEDENT>varsToFind -= localKeys<EOL>if not varsToFind:<EOL><INDENT>return (bindings,varsToFind)<EOL><DEDENT>frameGlobals = frame.f_globals<EOL>globalKeys = set(varsToFind).intersection(frameGlobals)<EOL>for v in globalKeys:<EOL><INDENT>bindings[v]=frameGlobals[v]<EOL><DEDENT>varsToFind -= localKeys<EOL>if not varsToFind:<EOL><INDENT>return (bindings,varsToFind)<EOL><DEDENT>frame = frame.f_back<EOL><DEDENT>return (bindings,varsToFind)<EOL>
Given a list of identifiers as strings, construct the dictonary of the identifiers as keys and the evaluated values of
    the ientifiers as the values. Ie something like {id:full_lookup(id) for id in identifiers}. full_lookup here is looking
    up the value of an identifier by looking at all the bindings at every level in the call stack.
    Return (bindings,unbound) where the bindings is the dictionary of found bindings and the set of unbound identifiers.