class_docstr: Testing `tabnanny.process_tokens()`.
class_docstr_tok: ["Testing","`","tabnanny.process_tokens","(",")","`","."]
docstr: A python source code with whitespace related sampled problems.
docstr_tok: ["A","python","source","code","with","whitespace","related","sampled","problems","."]
code: def test_with_errored_codes_samples(self):
      """A python source code with whitespace related sampled problems."""
  
      # "tab_space_errored_1": executes block under type == tokenize.INDENT
      #                        at `tabnanny.process_tokens()`.
      # "tab space_errored_2": executes block under
      #                        `check_equal and type not in JUNK` condition at
      #                        `tabnanny.process_tokens()`.
  
      for key in ["tab_space_errored_1", "tab_space_errored_2"]:
          with self.subTest(key=key):
              with TemporaryPyFile(SOURCE_CODES[key]) as file_path:
                  with open(file_path) as f:
                      tokens = tokenize.generate_tokens(f.readline)
                      with self.assertRaises(tabnanny.NannyNag):
                          tabnanny.process_tokens(tokens)
  
imports: from unittest import TestCase, mock
  import errno
  import os
  import tabnanny
  import tokenize
  import tempfile
  import textwrap
  from test.support import captured_stderr, captured_stdout, script_helper, findfile
  from test.support.os_helper import unlink
label_desc: Use image node_id 2 for calling the TestProcessTokens obj's underlying member method code with example usage: obj.test_with_errored_codes_samples() without return types