class_docstr: SumoTrafficLight holds all the necessary data to define a traffic light in sumo:
  
      * connections (tlid, from_road, to_road, from_lane, to_lane, link_index).
      * phases (duration, state, min_dur, max_dur, nex, name).
      * parameters.
class_docstr_tok: ["SumoTrafficLight","holds","all","the","necessary","data","to","define","a","traffic","light","in","sumo",":","*","connections","(","tlid",",","from_road",",","to_road",",","from_lane",",","to_lane",",","link_index",")",".","*","phases","(","duration",",","state",",","min_dur",",","max_dur",",","nex",",","name",")",".","*","parameters","."]
code: def to_xml(self):
      info = {
          "id": self.id,
          "type": self.type,
          "programID": self.program_id,
          "offset": str(self.offset),
      }
  
      xml_tag = ET.Element("tlLogic", info)
      for phase in self.phases:
          ET.SubElement(
              xml_tag,
              "phase",
              {"state": phase.state, "duration": str(phase.duration)},
          )
      for parameter in sorted(self.parameters, key=lambda x: x[0]):
          ET.SubElement(
              xml_tag,
              "param",
              {
                  "key": "linkSignalID:" + str(parameter[0]),
                  "value": str(parameter[1]),
              },
          )
  
      return xml_tag
  
imports: import argparse
  import bisect
  import collections
  import logging
  import shutil
  import subprocess
  import tempfile
  import lxml.etree
  import glob
  import os
  import sys
  import carla
  import sumolib
label_desc: Use image node_id 8 for calling the SumoTrafficLight obj's underlying member method code with example usage: obj.to_xml() and returns: xml_tag