def get_stack_at_position(grammar, code_lines, module, pos):
 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, pos)
 safeword = 'ZZZ_USER_WANTS_TO_COMPLETE_HERE_WITH_JEDI'
 code = (code + safeword)
 p = parser.ParserWithRecovery(grammar, code, start_parsing=False)
 try:
  p.parse(tokenizer=tokenize_without_endmarker(code))
 except EndMarkerReached:
  return Stack(p.stack)
 raise SystemError("This really shouldn't happen. There's a bug in Jedi.")

def get_stack_at_position ( grammar , code_lines , module , pos ) : 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 , pos ) safeword = 'ZZZ_USER_WANTS_TO_COMPLETE_HERE_WITH_JEDI' code = ( code + safeword ) p = parser . ParserWithRecovery ( grammar , code , start_parsing = False ) try : p . parse ( tokenizer = tokenize_without_endmarker ( code ) ) except EndMarkerReached : return Stack ( p . stack ) raise SystemError ( "This really shouldn't happen. There's a bug in Jedi." )
returns the possible node names .