code: def complexTypeConverter(name, value, cache):
      """
      Type conversion for complex types
  
      Args:
          name:
          value:
          cache:
  
      Returns:
          _java_obj:
      """
      cache[name] = value
      try:
          if isinstance(value, list):
              java_value = []
              for v in value:
                  if hasattr(v, "_transfer_params_to_java"):
                      v._transfer_params_to_java()
                  java_value.append(v._java_obj)
              return java_value
          if hasattr(value, "_transfer_params_to_java"):
              value._transfer_params_to_java()
          if hasattr(value, "_java_obj"):
              return value._java_obj
          else:
              return value._to_java()
      except Py4JError as e:
          return value
  
label_desc: Use image node_id 2 for calling a global function with example usage: complexTypeConverter(name, value, cache) and returns: java_value, value, value, value