parameters: (self, import_name_always=False)
return_statement: return None
docstring: Returns None if there's on definition for a name.
  
          :param import_name_alway: Specifies if an import name is always a
              definition. Normally foo in `from foo import bar` is not a
              definition.
docstring_summary: Returns None if there's on definition for a name.
docstring_tokens: Returns None if there s on definition for a name .
function: def get_definition(self, import_name_always=False):
          """
          Returns None if there's on definition for a name.
  
          :param import_name_alway: Specifies if an import name is always a
              definition. Normally foo in `from foo import bar` is not a
              definition.
          """
          node = self.parent
          type_ = node.type
          if type_ in ('power', 'atom_expr'):
              # In `self.x = 3` self is not a definition, but x is.
              return None
  
          if type_ in ('funcdef', 'classdef'):
              if self == node.name:
                  return node
              return None
  
          if type_ == 'except_clause':
              # TODO in Python 2 this doesn't work correctly. See grammar file.
              #      I think we'll just let it be. Python 2 will be gone in a few
              #      years.
              if self.get_previous_sibling() == 'as':
                  return node.parent  # The try_stmt.
              return None
  
          while node is not None:
              if node.type == 'suite':
                  return None
              if node.type in _GET_DEFINITION_TYPES:
                  if self in node.get_defined_names():
                      return node
                  if import_name_always and node.type in _IMPORTS:
                      return node
                  return None
              node = node.parent
          return None
function_tokens: def get_definition ( self , import_name_always = False ) : node = self . parent type_ = node . type if type_ in ( 'power' , 'atom_expr' ) : # In `self.x = 3` self is not a definition, but x is. return None if type_ in ( 'funcdef' , 'classdef' ) : if self == node . name : return node return None if type_ == 'except_clause' : # TODO in Python 2 this doesn't work correctly. See grammar file. #      I think we'll just let it be. Python 2 will be gone in a few #      years. if self . get_previous_sibling ( ) == 'as' : return node . parent # The try_stmt. return None while node is not None : if node . type == 'suite' : return None if node . type in _GET_DEFINITION_TYPES : if self in node . get_defined_names ( ) : return node if import_name_always and node . type in _IMPORTS : return node return None node = node . parent return None