def filter_definition_names(names, origin, position=None):
 if (not names):
  return []
 stmt = names[0].get_definition()
 scope = stmt.get_parent_scope()
 if (not (isinstance(scope, er.FunctionExecution) and isinstance(scope.base, er.LambdaWrapper))):
  names = filter_after_position(names, position)
 names = [name for name in names if name.is_definition()]
 for name in list(names):
  if (name.value.startswith('__') and (not name.value.endswith('__'))):
   if filter_private_variable(scope, origin):
    names.remove(name)
 return names

def filter_definition_names ( names , origin , position = None ) : if ( not names ) : return [ ] stmt = names [ 0 ] . get_definition ( ) scope = stmt . get_parent_scope ( ) if ( not ( isinstance ( scope , er . FunctionExecution ) and isinstance ( scope . base , er . LambdaWrapper ) ) ) : names = filter_after_position ( names , position ) names = [ name for name in names if name . is_definition ( ) ] for name in list ( names ) : if ( name . value . startswith ( '__' ) and ( not name . value . endswith ( '__' ) ) ) : if filter_private_variable ( scope , origin ) : names . remove ( name ) return names
filter names that are actual definitions in a scope .