parameters: (self, filters)
return_statement: return list(names)
docstring: Searches names that are defined in a scope (the different
          ``filters``), until a name fits.
docstring_summary: Searches names that are defined in a scope (the different
          ``filters``), until a name fits.
docstring_tokens: Searches names that are defined in a scope ( the different filters ) until a name fits .
function: def filter_name(self, filters):
          """
          Searches names that are defined in a scope (the different
          ``filters``), until a name fits.
          """
          names = []
          if self._context.predefined_names and isinstance(self._name, tree.Name):
              node = self._name
              while node is not None and not is_scope(node):
                  node = node.parent
                  if node.type in ("if_stmt", "for_stmt", "comp_for"):
                      try:
                          name_dict = self._context.predefined_names[node]
                          types = name_dict[self._string_name]
                      except KeyError:
                          continue
                      else:
                          self._found_predefined_types = types
                          break
  
          for filter in filters:
              names = filter.get(self._string_name)
              if names:
                  if len(names) == 1:
                      n, = names
                      if isinstance(n, TreeNameDefinition):
                          # Something somewhere went terribly wrong. This
                          # typically happens when using goto on an import in an
                          # __init__ file. I think we need a better solution, but
                          # it's kind of hard, because for Jedi it's not clear
                          # that that name has not been defined, yet.
                          if n.tree_name == self._name:
                              if self._name.get_definition().type == 'import_from':
                                  continue
                  break
  
          debug.dbg('finder.filter_name %s in (%s): %s@%s',
                    self._string_name, self._context, names, self._position)
          return list(names)
function_tokens: def filter_name ( self , filters ) : names = [ ] if self . _context . predefined_names and isinstance ( self . _name , tree . Name ) : node = self . _name while node is not None and not is_scope ( node ) : node = node . parent if node . type in ( "if_stmt" , "for_stmt" , "comp_for" ) : try : name_dict = self . _context . predefined_names [ node ] types = name_dict [ self . _string_name ] except KeyError : continue else : self . _found_predefined_types = types break for filter in filters : names = filter . get ( self . _string_name ) if names : if len ( names ) == 1 : n , = names if isinstance ( n , TreeNameDefinition ) : # Something somewhere went terribly wrong. This # typically happens when using goto on an import in an # __init__ file. I think we need a better solution, but # it's kind of hard, because for Jedi it's not clear # that that name has not been defined, yet. if n . tree_name == self . _name : if self . _name . get_definition ( ) . type == 'import_from' : continue break debug . dbg ( 'finder.filter_name %s in (%s): %s@%s' , self . _string_name , self . _context , names , self . _position ) return list ( names )