code: def convert_all(
      json_files, csv_file, include=None, ignore=None, add_filename=True
  ):
      with open(csv_file, "w") as f_csv:
          print("Writing to %s" % csv_file)
          writer = csv.writer(
              f_csv,
              delimiter=",",
              quotechar='"',
              quoting=csv.QUOTE_NONNUMERIC,
          )
          header = None
  
          for f_json in json_files:
              d = convert(f_json, include, ignore)
  
              if add_filename:
                  if JSON_FILENAME in d:
                      print(
                          "Error appending json filename to the CSV: `%s` name is already used."
                          % JSON_FILENAME
                      )
                      sys.exit()
                  else:
                      d[JSON_FILENAME] = f_json
  
              if not header:
                  header = sorted(d.keys())
                  if not len(header):
                      print(
                          "Error: no descriptors found to be written."
                      )
                      sys.exit()
                  writer.writerow(header)
  
              try:
                  if len(d.keys()) != len(header):
                      raise Exception()
                  raw = [d[h] for h in header]
              except Exception:
                  print("Error: Incompatible descriptor layouts")
                  print("Layout difference:")
                  print(
                      list(
                          set(header).symmetric_difference(
                              set(d.keys())
                          )
                      )
                  )
                  sys.exit()
  
              writer.writerow(raw)
  
      # TODO: Currently, the same descriptor layout is required for all
      #       input files (after filtering)
      # Make alternative version that
      # - gathers a list of all descriptors found in input files
      # - creates a CSV based on such a list, so that files with
      #   different descriptor layouts can be merged into the same CSV
  
      return
  
imports: import sys, json, csv
  from fnmatch import fnmatch
  from argparse import ArgumentParser
label_desc: Use image node_id 4 for calling a global function with example usage: convert_all(json_files, csv_file, include, ignore, add_filename) without return types