code: def generate_decals_file(folder):
      # search for all .fbx and .xodr pair of files
      maps = []
      for root, _, filenames in os.walk(folder):
          files = fnmatch.filter(filenames, "*.xodr")
          for file_name in files:
              xodr = file_name[:-5]
              # check if exist the .fbx file
              if os.path.exists("%s/%s.fbx" % (root, xodr)):
                  maps.append(
                      [
                          os.path.relpath(root, folder),
                          xodr,
                          ["%s.fbx" % xodr],
                      ]
                  )
              else:
                  # check if exist the map by tiles
                  tiles = fnmatch.filter(filenames, "*_Tile_*.fbx")
                  if len(tiles) > 0:
                      maps.append(
                          [os.path.relpath(root, folder), xodr, tiles]
                      )
  
      if len(maps) > 0:
          # build all the maps in .json format
          json_decals = []
          for map_name in maps:
              name = map_name[1]
  
              # create the decals default config file
              json_decals.append(
                  {
                      "map_name": name,
                      "drip1": "10",
                      "drip3": "10",
                      "dirt1": "10",
                      "dirt3": "10",
                      "dirt4": "10",
                      "dirt5": "10",
                      "roadline1": "20",
                      "roadline5": "20",
                      "tiremark1": "20",
                      "tiremark3": "20",
                      "tarsnake1": "10",
                      "tarsnake3": "20",
                      "tarsnake4": "10",
                      "tarsnake5": "20",
                      "tarsnake11": "20",
                      "cracksbig1": "10",
                      "cracksbig3": "10",
                      "cracksbig5": "10",
                      "cracksbig8": "10",
                      "mud1": "10",
                      "mud5": "10",
                      "oilsplat1": "20",
                      "oilsplat2": "20",
                      "oilsplat3": "20",
                      "oilsplat4": "20",
                      "oilsplat5": "20",
                      "gum": "30",
                      "crack1": "10",
                      "crack3": "10",
                      "crack4": "10",
                      "crack5": "10",
                      "crack8": "10",
                      "decal_scale": {
                          "x_axis": "1.0",
                          "y_axis": "1.0",
                          "z_axis": "1.0",
                      },
                      "fixed_decal_offset": {
                          "x_axis": "15.0",
                          "y_axis": "15.0",
                          "z_axis": "0.0",
                      },
                      "decal_min_scale": "0.3",
                      "decal_max_scale": "0.7",
                      "decal_random_yaw": "360.0",
                      "random_offset": "50.0",
                  }
              )
  
          # build and write the .json
          f = open("%s/%s.json" % (folder, "roadpainter_decals"), "w")
          my_json = {"decals": json_decals}
          serialized = json.dumps(my_json, sort_keys=False, indent=3)
          f.write(serialized)
          f.close()
  
imports: from __future__ import print_function
  import errno
  import fnmatch
  import glob
  import json
  import os
  import shutil
  import subprocess
  import sys
  import argparse
  import threading
  import copy
  import carla
label_desc: Use image node_id 4 for calling a global function with example usage: generate_decals_file(folder) without return types