code: def _case_verify_and_canonicalize_args(
      pred_fn_pairs, exclusive, name, allow_python_preds
  ):
      """Verifies input arguments for the case function.
  
      Args:
        pred_fn_pairs: Dict or list of pairs of a boolean scalar tensor, and a
          callable which returns a list of tensors.
        exclusive: True iff at most one predicate is allowed to evaluate to `True`.
        name: A name for the case operation.
        allow_python_preds: if true, pred_fn_pairs may contain Python bools in
          addition to boolean Tensors
      Raises:
        TypeError: If `pred_fn_pairs` is not a list/dictionary.
        TypeError: If `pred_fn_pairs` is a list but does not contain 2-tuples.
        TypeError: If `fns[i]` is not callable for any i, or `default` is not
                   callable.
      Returns:
        a tuple <list of scalar bool tensors, list of callables>.
      """
      del name
      if not isinstance(pred_fn_pairs, (list, tuple, dict)):
          raise TypeError("fns must be a list, tuple, or dict")
  
      if isinstance(pred_fn_pairs, collections.OrderedDict):
          pred_fn_pairs = pred_fn_pairs.items()
      elif isinstance(pred_fn_pairs, dict):
          # No name to sort on in eager mode. Use dictionary traversal order,
          # which is nondeterministic in versions of Python < 3.6
          if not exclusive:
              raise ValueError(
                  "Unordered dictionaries are not supported for the "
                  "`pred_fn_pairs` argument when `exclusive=False` and "
                  "eager mode is enabled."
              )
          pred_fn_pairs = list(pred_fn_pairs.items())
      for pred_fn_pair in pred_fn_pairs:
          if (
              not isinstance(pred_fn_pair, tuple)
              or len(pred_fn_pair) != 2
          ):
              raise TypeError(
                  "Each entry in pred_fn_pairs must be a 2-tuple"
              )
          pred, fn = pred_fn_pair
  
          if ops.is_tensor(pred):
              if pred.dtype != dtype.bool:
                  raise TypeError(
                      "pred must be Tensor of type bool: %s" % pred.name
                  )
          elif not allow_python_preds:
              raise TypeError("pred must be a Tensor, got: %s" % pred)
          elif not isinstance(pred, bool):
              raise TypeError(
                  "pred must be a Tensor or bool, got: %s" % pred
              )
  
          if not callable(fn):
              raise TypeError(
                  "fn for pred %s must be callable." % pred.name
              )
  
      predicates, actions = zip(*pred_fn_pairs)
      return predicates, actions
  
file_path: probability/tensorflow_probability/python/internal/backend/numpy/control_flow.py
imports: import collections
  import functools
  import numpy
  from tensorflow_probability.python.internal.backend.numpy import _utils
  from tensorflow_probability.python.internal.backend.numpy import dtype
  from tensorflow_probability.python.internal.backend.numpy import nest
  from tensorflow_probability.python.internal.backend.numpy import ops
label_desc: Use image node_id 7 for calling a global function with example usage: _case_verify_and_canonicalize_args(pred_fn_pairs, exclusive, name, allow_python_preds) and returns: predicates,  actions