code: def parse_args_to_kwargs(
      args: List[str], params: List[inspect.Parameter]
  ) -> Dict[str, Any]:
      """
      deserialize a list of CLI arguments destined for a bindings function into
      a dictionary of keyword arguments.
      various formats are supported:
      - positional arguments
      - keyword arguments
      - json values
      - positional values coming afetr keyword arguments
      """
      kwargs: Dict[str, Any] = {}
      params_d: Dict[str, inspect.Parameter] = {
          p.name: p for p in params
      }
  
      for idx, arg in enumerate(args):
          key: str = ""
          value: Any = None
          if "=" in arg:
              key, value = arg.split("=", 1)
          else:
              key = params[idx].name
              value = arg
          param = params_d.get(key)
          if not param:
              raise ValueError(f"Unknown argument {key}")
          value = parse_param_value(param, value)
          if key in kwargs:
              raise ValueError(f"Argument {key} specified twice")
          kwargs[key] = value
  
      assert len(kwargs) <= len(params), "too many arguments"
      return kwargs
  
imports: import argparse
  import collections
  import inspect
  import json
  import re
  import shlex
  import shutil
  import subprocess
  import sys
  from argparse import Namespace
  from collections.abc import Sequence
  from typing import Any, Dict, List, OrderedDict, Tuple
  from urllib import parse
  from termcolor import colored
  import determined.cli.render
  from determined import cli
  from determined.cli import errors
  from determined.common.api import authentication, bindings
  from determined.common.api import errors
  from determined.common.api import request
  from determined.common.declarative_argparse import Arg, Cmd
label_desc: Use image node_id 10 for calling a global function with example usage: parse_args_to_kwargs(args, params) and returns: kwargs