original_docstring: 
  		Gets the SuperToken that best matches the given token.
  		
  		The parentSuperToken is necessary in the case that a new SuperToken is created. In this
  		case, both the new SuperToken and its parent will be carried in the newSuperToken signal
  		which will be emitted.
  		
  		Having the parent super token also allows us to reduce the search space when finding the
  		matched SuperToken.
  		
  		:param token: The token to find a SuperToken match with.
  		:type token: Token
  		:param parentSuperToken: The parent of the SuperToken that will be matched with the token.
  		:type parentSuperToken: SuperToken
  		:param detecting: If the function is called while detecting the backend. Default is False.
  		:type detecting: bool
  		:return: The SuperToken that gets matched to the provided token.
  		:rtype: SuperToken
  		
docstring: Gets the SuperToken that best matches the given token.
  The parentSuperToken is necessary in the case that a new SuperToken is created. In this
  case, both the new SuperToken and its parent will be carried in the newSuperToken signal
  which will be emitted.
  
  Having the parent super token also allows us to reduce the search space when finding the
  matched SuperToken.
docstring_tokens: Gets the SuperToken that best matches the given token . The parentSuperToken is necessary in the case that a new SuperToken is created . In this case both the new SuperToken and its parent will be carried in the newSuperToken signal which will be emitted . Having the parent super token also allows us to reduce the search space when finding the matched SuperToken .
code: def matchToSuperToken(self, token: Token, parentSuperToken: SuperToken, detecting=False) -> SuperToken:
  		"""
  		Gets the SuperToken that best matches the given token.
  		
  		The parentSuperToken is necessary in the case that a new SuperToken is created. In this
  		case, both the new SuperToken and its parent will be carried in the newSuperToken signal
  		which will be emitted.
  		
  		Having the parent super token also allows us to reduce the search space when finding the
  		matched SuperToken.
  		
  		:param token: The token to find a SuperToken match with.
  		:type token: Token
  		:param parentSuperToken: The parent of the SuperToken that will be matched with the token.
  		:type parentSuperToken: SuperToken
  		:param detecting: If the function is called while detecting the backend. Default is False.
  		:type detecting: bool
  		:return: The SuperToken that gets matched to the provided token.
  		:rtype: SuperToken
  		"""
  		if token.isDialog:
  			parentSuperToken = None
  		
  		# determine if the new token matches any super tokens and how well it matches if it does.
  		bestMatch = 0
  		bestDecision = Token.Match.NO.value
  		selectedSuperToken = None
  		potentialMatches = self._childMapping[parentSuperToken]
  		
  		for superToken in potentialMatches:
  			
  			if self._lastSuperTokenIterations[superToken] == self._iteration:
  				continue
  			
  			decision, matchVal = superToken.shouldContain(token)
  			bestDecision = min(bestDecision, decision.value)
  			
  			if decision == Token.Match.NO:
  				continue
  			
  			elif decision == Token.Match.EXACT:
  				return superToken
  			
  			elif decision == Token.Match.CLOSE:
  				# in the case that multiple SuperTokens closely match the token,
  				# we'll use the SuperToken that has the higher match.
  				if matchVal > bestMatch:
  					bestMatch = matchVal
  					selectedSuperToken = superToken
  
  		# At this point, we know the token will be used in the TGUIM.
  		token.registerAsAccepted()
  
  		# No match was found
  		if selectedSuperToken is None:
  			newSuperToken = SuperToken(token, parentSuperToken)
  
  			self._childMapping[parentSuperToken].append(newSuperToken)
  			self._childMapping[newSuperToken] = []
  			if not detecting:  # this statement is satisfyingly clean
  				self.newSuperToken.emit(newSuperToken, parentSuperToken)
  			return newSuperToken
  		
  		# a close match was found
  		else:
  			selectedSuperToken.addToken(token)
  			return selectedSuperToken
code_tokens: def matchToSuperToken ( self , token : Token , parentSuperToken : SuperToken , detecting = False ) -> SuperToken : if token . isDialog : parentSuperToken = None bestMatch = 0 bestDecision = Token . Match . NO . value selectedSuperToken = None potentialMatches = self . _childMapping [ parentSuperToken ] for superToken in potentialMatches : if self . _lastSuperTokenIterations [ superToken ] == self . _iteration : continue decision , matchVal = superToken . shouldContain ( token ) bestDecision = min ( bestDecision , decision . value ) if decision == Token . Match . NO : continue elif decision == Token . Match . EXACT : return superToken elif decision == Token . Match . CLOSE : if matchVal > bestMatch : bestMatch = matchVal selectedSuperToken = superToken token . registerAsAccepted ( ) if selectedSuperToken is None : newSuperToken = SuperToken ( token , parentSuperToken ) self . _childMapping [ parentSuperToken ] . append ( newSuperToken ) self . _childMapping [ newSuperToken ] = [ ] if not detecting : self . newSuperToken . emit ( newSuperToken , parentSuperToken ) return newSuperToken else : selectedSuperToken . addToken ( token ) return selectedSuperToken
short_docstring: Gets the SuperToken that best matches the given token.
short_docstring_tokens: Gets the SuperToken that best matches the given token .
comment: """
  		Gets the SuperToken that best matches the given token.
  		
  		The parentSuperToken is necessary in the case that a new SuperToken is created. In this
  		case, both the new SuperToken and its parent will be carried in the newSuperToken signal
  		which will be emitted.
  		
  		Having the parent super token also allows us to reduce the search space when finding the
  		matched SuperToken.
  		
  		:param token: The token to find a SuperToken match with.
  		:type token: Token
  		:param parentSuperToken: The parent of the SuperToken that will be matched with the token.
  		:type parentSuperToken: SuperToken
  		:param detecting: If the function is called while detecting the backend. Default is False.
  		:type detecting: bool
  		:return: The SuperToken that gets matched to the provided token.
  		:rtype: SuperToken
  		"""$SEP$# determine if the new token matches any super tokens and how well it matches if it does.$SEP$# in the case that multiple SuperTokens closely match the token,$SEP$# we'll use the SuperToken that has the higher match.$SEP$# At this point, we know the token will be used in the TGUIM.$SEP$# No match was found$SEP$# this statement is satisfyingly clean$SEP$# a close match was found