code: def test_whitespace(self):
      expected_idval = [
          (lexer.COLON, None),
          (lexer.STRING, "a"),
          (lexer.INTEGER, 12345),
          (lexer.RARROW, None),
          (lexer.EQUAL, None),
          (lexer.ASTERISK, None),
          (lexer.NAME_OTHER, "_b"),
      ]
      # With minimal whitespace
      toks = list(lexer.lex(':"a"12345->=*_b'))
      self.assertEqual(
          [(tok.id, tok.val) for tok in toks], expected_idval
      )
      # With spaces
      toks = list(lexer.lex(' : "a" 12345 -> = * _b '))
      self.assertEqual(
          [(tok.id, tok.val) for tok in toks], expected_idval
      )
      # With tabs
      toks = list(lexer.lex('\t:\t"a"\t12345\t->\t=\t*\t_b\t'))
      self.assertEqual(
          [(tok.id, tok.val) for tok in toks], expected_idval
      )
      # With newlines
      toks = list(lexer.lex('\n:\n"a"\n12345\n->\n=\n*\n_b\n'))
      self.assertEqual(
          [(tok.id, tok.val) for tok in toks], expected_idval
      )
      # With spaces, tabs, newlines and comments
      toks = list(
          lexer.lex(
              "# comment\n"
              + ": # X\n"
              + ' "a" # "b"\t\n'
              + "\t12345\n\n"
              + "->\n"
              + "=\n"
              + "*\n"
              + "_b # comment\n"
              + " \t # end"
          )
      )
      self.assertEqual(
          [(tok.id, tok.val) for tok in toks], expected_idval
      )
  
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 7 for calling the TestDataShapeLexer obj's underlying member method code with example usage: obj.test_whitespace() without return types