code: def main(arguments):
      debugger = (
          "pdb"
          if arguments["--pdb"]
          else "ipdb"
          if arguments["--ipdb"]
          else None
      )
      redo_file = os.path.join(
          os.path.dirname(__file__), "fuzz-redo.pickle"
      )
  
      if arguments["--logging"]:
          root = logging.getLogger()
          root.setLevel(logging.DEBUG)
  
          ch = logging.StreamHandler(sys.stdout)
          ch.setLevel(logging.DEBUG)
          root.addHandler(ch)
  
      grammar = parso.load_grammar()
      parso.python.diff.DEBUG_DIFF_PARSER = True
      if arguments["redo"]:
          with open(redo_file, "rb") as f:
              file_tests_obj = pickle.load(f)
          only_last = arguments["--only-last"] and int(
              arguments["--only-last"]
          )
          file_tests_obj.redo(
              grammar,
              debugger,
              only_last=only_last,
              print_code=arguments["--print-code"],
          )
      elif arguments["random"]:
          # A random file is used to do diff parser checks if no file is given.
          # This helps us to find errors in a lot of different files.
          file_paths = list(
              find_python_files_in_tree(arguments["<path>"] or ".")
          )
          max_tries = int(arguments["--maxtries"])
          tries = 0
          try:
              while tries < max_tries:
                  path = random.choice(file_paths)
                  print("Checking %s: %s tries" % (path, tries))
                  now_tries = min(1000, max_tries - tries)
                  file_tests_obj = FileTests(
                      path, now_tries, int(arguments["--changes"])
                  )
                  file_tests_obj.run(grammar, debugger)
                  tries += now_tries
          except Exception:
              with open(redo_file, "wb") as f:
                  pickle.dump(file_tests_obj, f)
              raise
      else:
          raise NotImplementedError("Command is not implemented")
  
imports: from __future__ import print_function
  import logging
  import sys
  import os
  import random
  import pickle
  import parso
  from parso.utils import split_lines
  from test.test_diff_parser import _check_error_leaves_nodes
label_desc: Use image node_id 4 for calling a global function with example usage: main(arguments) without return types