parameters: (self, line)
return_statement: return completed, possibilities[1]
docstring: !
      Returns an auto completed line and/or possibilities for completion.
      
      @param line: Given line so far.
      @return: Line completed as for as possible, and possible further completions.
docstring_summary: !
      Returns an auto completed line and/or possibilities for completion.
docstring_tokens: ! Returns an auto completed line and / or possibilities for completion .
function: def complete(self, line):
      """!
      Returns an auto completed line and/or possibilities for completion.
      
      @param line: Given line so far.
      @return: Line completed as for as possible, and possible further completions.
      """
      split_line = self.complete_sep.split(line)
      if split_line[-1]:
        possibilities = self.IP.complete(split_line[-1])
      else:
        completed = line
        possibilities = ['', []]
      if possibilities:
        def _commonPrefix(str1, str2):
          """!
          Reduction function. returns common prefix of two given strings.
          
          @param str1: First string.
          @param str2: Second string
          @return: Common prefix to both strings.
          """
          for i in range(len(str1)):
            if not str2.startswith(str1[:i+1]):
              return str1[:i]
          return str1
        if possibilities[1]:
          common_prefix = reduce(_commonPrefix, possibilities[1]) or line[-1]
          completed = line[:-len(split_line[-1])]+common_prefix
        else:
          completed = line
      else:
        completed = line
      return completed, possibilities[1]
function_tokens: def complete ( self , line ) : split_line = self . complete_sep . split ( line ) if split_line [ - 1 ] : possibilities = self . IP . complete ( split_line [ - 1 ] ) else : completed = line possibilities = [ '' , [ ] ] if possibilities : def _commonPrefix ( str1 , str2 ) : """!
          Reduction function. returns common prefix of two given strings.
          
          @param str1: First string.
          @param str2: Second string
          @return: Common prefix to both strings.
          """ for i in range ( len ( str1 ) ) : if not str2 . startswith ( str1 [ : i + 1 ] ) : return str1 [ : i ] return str1 if possibilities [ 1 ] : common_prefix = reduce ( _commonPrefix , possibilities [ 1 ] ) or line [ - 1 ] completed = line [ : - len ( split_line [ - 1 ] ) ] + common_prefix else : completed = line else : completed = line return completed , possibilities [ 1 ]