class_docstr: Argument parser for torchserve and torchserve-export commands
  TODO : Add readme url
class_docstr_tok: ["Argument","parser","for","torchserve","and","torchserve-export","commands","TODO",":","Add","readme","url"]
docstr: ArgParser for backend worker. Takes the socket name and socket type.
  :return:
docstr_tok: ["ArgParser","for","backend","worker",".","Takes","the","socket","name","and","socket","type",".",":","return",":"]
code: def model_service_worker_args():
      """
      ArgParser for backend worker. Takes the socket name and socket type.
      :return:
      """
      parser = argparse.ArgumentParser(
          prog="model-server-worker", description="Model Server Worker"
      )
      parser.add_argument(
          "--sock-type",
          required=True,
          dest="sock_type",
          type=str,
          choices=["unix", "tcp"],
          help="Socket type the model service worker would use. The options are\n"
          "unix: The model worker expects to unix domain-socket\n"
          "tcp: The model worker expects a host-name and port-number",
      )
  
      parser.add_argument(
          "--sock-name",
          required=False,
          dest="sock_name",
          type=str,
          help="If 'sock-type' is 'unix', sock-name is expected to be a string. "
          'Eg: --sock-name "test_sock"',
      )
  
      parser.add_argument(
          "--host",
          type=str,
          help="If 'sock-type' is 'tcp' this is expected to have a host IP address",
      )
  
      parser.add_argument(
          "--port",
          type=str,
          help="If 'sock-type' is 'tcp' this is expected to have the host port to bind on",
      )
  
      parser.add_argument(
          "--metrics-config",
          dest="metrics_config",
          type=str,
          help="Metrics configuration file",
      )
  
      return parser
  
imports: import argparse
label_desc: Use image node_id 2 for calling the ArgParser obj's underlying member method code with example usage: obj.model_service_worker_args() and returns: parser