def filter_after_position(names, position):
 if (position is None):
  return names
 names_new = []
 for n in names:
  if (((n.start_pos[0] is not None) and (n.start_pos < position)) or isinstance(n.get_definition(), (tree.CompFor, tree.Lambda))):
   names_new.append(n)
 return names_new

def filter_after_position ( names , position ) : if ( position is None ) : return names names_new = [ ] for n in names : if ( ( ( n . start_pos [ 0 ] is not None ) and ( n . start_pos < position ) ) or isinstance ( n . get_definition ( ) , ( tree . CompFor , tree . Lambda ) ) ) : names_new . append ( n ) return names_new
removes all names after a certain position .