code: def check_isolated_token(self, ds_str, tname, val=None):
      # The token name should be a property in parser
      tid = getattr(lexer, tname)
      # Lexing should produce a single token matching the specification
      self.assertEqual(
          list(lexer.lex(ds_str)),
          [lexer.Token(tid, tname, (0, len(ds_str)), val)],
      )
  
file_path: datashader/datashader/datashape/tests/test_lexer.py
imports: from __future__ import absolute_import, division, print_function
  import unittest
  from datashader import datashape
  from datashader.datashape import lexer
label_desc: Use image node_id 1 for calling the TestDataShapeLexer obj's underlying member method code with example usage: obj.check_isolated_token(ds_str, tname, val) without return types