def _check_module(evaluator, module):
 def get_sys_path_powers(names):
  for name in names:
   power = name.parent.parent
   if tree.is_node(power, 'power', 'atom_expr'):
    c = power.children
    if (isinstance(c[0], tree.Name) and (c[0].value == 'sys') and tree.is_node(c[1], 'trailer')):
     n = c[1].children[1]
     if (isinstance(n, tree.Name) and (n.value == 'path')):
      (yield (name, power))
 sys_path = list(evaluator.sys_path)
 try:
  possible_names = module.used_names['path']
 except KeyError:
  pass
 else:
  for (name, power) in get_sys_path_powers(possible_names):
   stmt = name.get_definition()
   if (len(power.children) >= 4):
    sys_path.extend(_paths_from_list_modifications(module.path, *power.children[2:4]))
   elif (name.get_definition().type == 'expr_stmt'):
    sys_path.extend(_paths_from_assignment(evaluator, stmt))
 return sys_path

def _check_module ( evaluator , module ) : def get_sys_path_powers ( names ) : for name in names : power = name . parent . parent if tree . is_node ( power , 'power' , 'atom_expr' ) : c = power . children if ( isinstance ( c [ 0 ] , tree . Name ) and ( c [ 0 ] . value == 'sys' ) and tree . is_node ( c [ 1 ] , 'trailer' ) ) : n = c [ 1 ] . children [ 1 ] if ( isinstance ( n , tree . Name ) and ( n . value == 'path' ) ) : ( yield ( name , power ) ) sys_path = list ( evaluator . sys_path ) try : possible_names = module . used_names [ 'path' ] except KeyError : pass else : for ( name , power ) in get_sys_path_powers ( possible_names ) : stmt = name . get_definition ( ) if ( len ( power . children ) >= 4 ) : sys_path . extend ( _paths_from_list_modifications ( module . path , * power . children [ 2 : 4 ] ) ) elif ( name . get_definition ( ) . type == 'expr_stmt' ) : sys_path . extend ( _paths_from_assignment ( evaluator , stmt ) ) return sys_path
detect sys .