code: def add_params_to_parser(parser, params):
      assert isinstance(parser, ArgumentParser)
      assert isinstance(params, dict)
  
      def get_type_details(v):
          for t in (int, float, str):
              try:
                  _value = t(v)
                  return t, _value
              except ValueError:
                  continue
  
      # AJB temporary protection from ui problems sending empty dicts
      params.pop("", None)
  
      for param, value in params.items():
          _type, type_value = get_type_details(value)
          parser.add_argument(
              "--%s" % param, type=_type, default=type_value
          )
      return parser
  
file_path: clearml/clearml/binding/args.py
imports: import sys
  import warnings
  from copy import copy
  from six import PY2
  from argparse import ArgumentParser, Namespace
label_desc: Use image node_id 6 for calling a global function with example usage: add_params_to_parser(parser, params) and returns: parser, t,  _value