human
Complete this python program:
def get_stack_at_position(grammar, code_lines, module_node, pos):
assistant
#Here is the Python program you requested.

    """Returns the possible node names (e.g. import_from, xor_test or yield_stmt).
    """
    class EndMarkerReached(Exception, ):
        pass
    def tokenize_without_endmarker(code):
        tokens = tokenize.source_tokens(code, use_exact_op_types=True)
        for token_ in tokens:
            if (token_.string == safeword):
                raise EndMarkerReached()
            else:
                (yield token_)
    code = _get_code_for_stack(code_lines, module_node, pos)
    safeword = 'ZZZ_USER_WANTS_TO_COMPLETE_HERE_WITH_JEDI'
    code = (code + safeword)
    p = Parser(grammar, error_recovery=True)
    try:
        p.parse(tokens=tokenize_without_endmarker(code))
    except EndMarkerReached:
        return Stack(p.pgen_parser.stack)
    raise SystemError("This    really    shouldn't    happen.    There's    a    bug    in    Jedi.")