code: def fmt(files: List[str], reformat: bool) -> Errors:
      errors = []
  
      for file in files:
          with open(file) as f:
              text = f.read()
          jobj = json.loads(text)
          # Apply the same linting that `python -mjson.tool` would apply.
          fixed = json.dumps(jobj, sort_keys=False, indent=4) + "\n"
          if fixed != text:
              if reformat:
                  with open(file, "w") as f:
                      f.write(fixed)
              else:
                  doc = os.path.relpath(file, os.path.dirname(__file__))
                  errors.append((f"<{doc}>", "would reformat"))
  
      return errors
  
imports: import argparse
  import json
  import os
  import re
  import sys
  from typing import Callable, List, Optional, Tuple, TypeVar, Union
label_desc: Use image node_id 18 for calling a global function with example usage: fmt(files, reformat) and returns: errors