code: def split_kwargs(kwargs, x1=None, x2=None):
      """Splitting `kwargs`.
  
      Specifically,
        1. if kwarg is a rng key, it will be split into two keys.
        2. else if it is a tuple of length two, the tuple will be split into two
           parts, one for kwargs1 and the other for kwargs2.
        3. else it is copied to kwargs1 and kwargs2.
  
      """
      kwargs1 = {}
      kwargs2 = {}
      for k, v in kwargs.items():
          if x2 is not None and k == "rng":
              key1, key2 = _read_keys(v, x1, x2)
              kwargs1[k] = key1
              kwargs2[k] = key2
          elif isinstance(v, tuple) and len(v) == 2:
              kwargs1[k] = v[0]
              kwargs2[k] = v[1]
          else:
              kwargs1[k] = kwargs2[k] = v
  
      return kwargs1, kwargs2
  
imports: from collections import namedtuple
  import functools
  import inspect
  import operator
  import types
  from typing import Any, Callable, Iterable, Optional, Sequence, Sized, TypeVar, Union
  import warnings
  import jax
  from jax import core
  from jax import random
  import jax.numpy
  from jax.tree_util import tree_all
  from jax.tree_util import tree_map
  import numpy
label_desc: Use image node_id 27 for calling a global function with example usage: split_kwargs(kwargs, x1, x2) and returns: kwargs1,  kwargs2