parameters: (self, grp_cls, tokens)
return_statement: return grp
docstring: Replace tokens by an instance of *grp_cls*.
docstring_summary: Replace tokens by an instance of *grp_cls*.
docstring_tokens: Replace tokens by an instance of * grp_cls * .
function: def group_tokens(self, grp_cls, tokens):
          """Replace tokens by an instance of *grp_cls*."""
          idx = self.token_index(tokens[0])
          for t in tokens:
              self.tokens.remove(t)
          grp = grp_cls(tokens)
          self.tokens.insert(idx, grp)
          return grp
function_tokens: def group_tokens ( self , grp_cls , tokens ) : idx = self . token_index ( tokens [ 0 ] ) for t in tokens : self . tokens . remove ( t ) grp = grp_cls ( tokens ) self . tokens . insert ( idx , grp ) return grp