code: def to_java_creator(scala_src):
      class_name = get_class_name(scala_src)
      scala_params = get_parameters(scala_src)
  
      def format_creator_param_list(scala_params):
          mapping = {
              "inputShape": 8 * " " + "inputShape: JList[Int] = null"
          }
          result = []
          for name, value, t in scala_params:
              if name in mapping:
                  result.append(mapping[name])
              else:
                  result.append(
                      8 * " "
                      + """%s: %s%s"""
                      % (name, t, " = " + value if value else "")
                  )
          return append_semi(result)
  
      def format_init_list(scala_params):
          mapping = {"inputShape": """toScalaShape(inputShape)"""}
          result = []
          for name, value, t in scala_params:
              if name in mapping:
                  result.append(mapping[name])
              else:
                  result.append(name)
          return append_semi([12 * " " + i for i in result])
  
      result = []
      formated_creator_param_list = format_creator_param_list(
          scala_params
      )
      formated_init_list = format_init_list(scala_params)
      result.append(
          """
      def create%s(\n%s): %s[T] = {
      %s(\n%s)
      }
      """
          % (
              class_name,
              formated_creator_param_list,
              class_name,
              4 * " " + class_name,
              formated_init_list,
          )
      )
      return "\n".join(result)
  
file_path: analytics-zoo/pyzoo/dev/auto_gen.py
imports: import re
label_desc: Use image node_id 11 for calling a global function with example usage: to_java_creator(scala_src) and returns: str, append_semi, append_semi