class_docstr: argparse action to cast potential inputs to `peer-ports` argument
class_docstr_tok: ["argparse","action","to","cast","potential","inputs","to","`","peer-ports","`","argument"]
docstr: call the CastPeerPorts
  
  
  .. # noqa: DAR401
  :param parser: the parser
  :param args: args to initialize the values
  :param values: the values to add to the parser
  :param option_string: inherited, not used
docstr_tok: ["call","the","CastPeerPorts","..","#","noqa",":","DAR401",":","param","parser",":","the","parser",":","param","args",":","args","to","initialize","the","values",":","param","values",":","the","values","to","add","to","the","parser",":","param","option_string",":","inherited",",","not","used"]
code: def __call__(self, parser, args, values, option_string=None):
      """
      call the CastPeerPorts
  
  
      .. # noqa: DAR401
      :param parser: the parser
      :param args: args to initialize the values
      :param values: the values to add to the parser
      :param option_string: inherited, not used
      """
      import json
  
      d = {0: []}
      for value in values:
          if isinstance(value, str):
              value = json.loads(value)
          if isinstance(value, dict):
              for k, vlist in value.items():
                  d[k] = []
                  for v in vlist:
                      d[k].append(_port_to_int(v))
          elif isinstance(value, int):
              d[0].append(value)
          else:
              d[0] = [_port_to_int(port) for port in value]
      setattr(args, self.dest, d)
  
imports: import argparse
  import os
  from typing import Tuple
  from jina.enums import ProtocolType
  from jina.logging.predefined import default_logger
label_desc: Use image node_id 1 for calling the CastPeerPorts obj's underlying member method code with example usage: obj.__call__(parser, args, values, option_string) without return types