code: def main():
      """Start function"""
      argparser = argparse.ArgumentParser(description=__doc__)
      argparser.add_argument(
          "--host",
          metavar="H",
          default="127.0.0.1",
          help="IP of the host server (default: 127.0.0.1)",
      )
      argparser.add_argument(
          "-p",
          "--port",
          metavar="P",
          default=2000,
          type=int,
          help="TCP port to listen to (default: 2000)",
      )
      argparser.add_argument(
          "--sun",
          default=None,
          type=str,
          help="Sun position presets ["
          + " | ".join([i for i in SUN_PRESETS])
          + "]",
      )
      argparser.add_argument(
          "--weather",
          default=None,
          type=str,
          help="Weather condition presets ["
          + " | ".join([i for i in WEATHER_PRESETS])
          + "]",
      )
      argparser.add_argument(
          "--altitude",
          "-alt",
          metavar="A",
          default=None,
          type=float,
          help="Sun altitude [-90.0, 90.0]",
      )
      argparser.add_argument(
          "--azimuth",
          "-azm",
          metavar="A",
          default=None,
          type=float,
          help="Sun azimuth [0.0, 360.0]",
      )
      argparser.add_argument(
          "--clouds",
          "-c",
          metavar="C",
          default=None,
          type=float,
          help="Clouds amount [0.0, 100.0]",
      )
      argparser.add_argument(
          "--rain",
          "-r",
          metavar="R",
          default=None,
          type=float,
          help="Rain amount [0.0, 100.0]",
      )
      argparser.add_argument(
          "--puddles",
          "-pd",
          metavar="Pd",
          default=None,
          type=float,
          help="Puddles amount [0.0, 100.0]",
      )
      argparser.add_argument(
          "--wind",
          "-w",
          metavar="W",
          default=None,
          type=float,
          help="Wind intensity [0.0, 100.0]",
      )
      argparser.add_argument(
          "--fog",
          "-f",
          metavar="F",
          default=None,
          type=float,
          help="Fog intensity [0.0, 100.0]",
      )
      argparser.add_argument(
          "--fogdist",
          "-fd",
          metavar="Fd",
          default=None,
          type=float,
          help="Fog Distance [0.0, 100.0)",
      )
      argparser.add_argument(
          "--fogfalloff",
          "-fo",
          metavar="Fo",
          default=None,
          type=float,
          help="Fog Falloff [0.0, inf)",
      )
      argparser.add_argument(
          "--wetness",
          "-wet",
          metavar="Wet",
          default=None,
          type=float,
          help="Wetness intensity [0.0, 100.0]",
      )
      argparser.add_argument(
          "--scatteringintensity",
          "-si",
          metavar="si",
          default=None,
          type=float,
          help="Scattering intensity [0.0, inf]",
      )
      argparser.add_argument(
          "--rayleighscatteringscale",
          "-rss",
          metavar="rss",
          default=None,
          type=float,
          help="Rayleigh scattering scale [0.0, 2.0]",
      )
      argparser.add_argument(
          "--miescatteringscale",
          "-mss",
          metavar="mss",
          default=None,
          type=float,
          help="Mie scattering scale [0.0, 5.0]",
      )
      argparser.add_argument(
          "--dust_storm",
          "-ds",
          metavar="ds",
          default=None,
          type=float,
          help="Dust storm strength [0.0, 100.0]",
      )
      argparser.add_argument(
          "--cars",
          metavar="Cars",
          default=None,
          type=str,
          nargs="+",
          help="Light Cars ["
          + " | ".join([i for i in CAR_LIGHTS])
          + "]",
      )
      argparser.add_argument(
          "--lights",
          "-l",
          metavar="Lights",
          default=None,
          type=str,
          nargs="+",
          help="Street Lights []",
      )
      argparser.add_argument(
          "--lightgroup",
          "-lg",
          metavar="LightGroup",
          default=None,
          type=str,
          help="Light Group ["
          + " | ".join([i for i in LIGHT_GROUP])
          + "]",
      )
      args = argparser.parse_args()
  
      # since all the arguments are None by default
      # (except for the first 2, host and port)
      # we can check if all the arguments have been provided
      arg_values = [v for _, v in args.__dict__.items()][2:]
      if all(i is (None and False) for i in arg_values):
          argparser.error("No arguments provided.")
  
      client = carla.Client(args.host, args.port)
      client.set_timeout(2.0)
      world = client.get_world()
  
      weather = world.get_weather()
  
      # apply presets
      apply_sun_presets(args, weather)
      apply_weather_presets(args, weather)
  
      # apply weather values individually
      apply_weather_values(args, weather)
  
      world.set_weather(weather)
  
      # apply car light changes
      apply_lights_to_cars(args, world)
  
      apply_lights_manager(args, world.get_lightmanager())
  
      world.wait_for_tick()
  
file_path: carla/PythonAPI/util/environment.py
imports: import glob
  import os
  import sys
  import argparse
  import carla
label_desc: Use image node_id 6 for calling a global function with example usage: main() without return types