code: def _pack_kwargs(
      *args: Any, **kwargs: Any
  ) -> Tuple[Tuple[Any, ...], Tuple[str, ...]]:
      """
      Turn argument list into separate key list and value list (unpack_kwargs does the opposite).
  
      Inspiration: https://github.com/facebookresearch/fairscale/blob/eeb6684/fairscale/internal/containers.py#L70
      Usage::
  
          kwarg_keys, flat_args = pack_kwargs(1, 2, a=3, b=4)
          assert kwarg_keys == ("a", "b")
          assert flat_args == (1, 2, 3, 4)
          args, kwargs = unpack_kwargs(kwarg_keys, flat_args)
          assert args == (1, 2)
          assert kwargs == {"a": 3, "b": 4}
      Returns:
          Tuple[Tuple[Any, ...], Tuple[str, ...]]: The first tuple element gives
          gives both positional args and kwarg values, where the positional args
          proceed kwarg values and kwarg values are ordered consistently with the
          kwarg keys. The second tuple element gives the kwarg keys.
          The second tuple element's length is at most the first tuple element's length.
      """
      kwarg_keys: List[str] = []
      flat_args: List[Any] = list(args)
      for k, v in kwargs.items():
          kwarg_keys.append(k)
          flat_args.append(v)
  
      return tuple(flat_args), tuple(kwarg_keys)
  
imports: import dataclasses
  import traceback
  from typing import Any, Callable, Container, Dict, List, Optional, OrderedDict, Tuple, TypeVar, overload
  import torch
  import torch.distributed
  from torch import nn
  from torch.nn.parallel._functions import _get_stream
  from torch.nn.parallel.scatter_gather import _is_namedtuple
  from torch.nn.utils.rnn import PackedSequence
label_desc: Use image node_id 1 for calling a global function with example usage: _pack_kwargs() and returns: tuple,  tuple