code: def get_clip_config_for_path(
      config: NestClippingConfig, path: Path
  ) -> NestClippingConfig:
      """Returns the config for a subtree from the leaf defined by the path."""
      # Start with an empty config.
      path_map = []
      for map_path, max_abs_value in config.path_map:
          if _is_prefix(map_path, path):
              return NestClippingConfig(path_map=(((), max_abs_value),))
          if _is_prefix(path, map_path):
              path_map.append((map_path[len(path) :], max_abs_value))
      return NestClippingConfig(path_map=tuple(path_map))
  
imports: import dataclasses
  from typing import Any, Optional, Tuple, Union
  from acme import types
  from acme.utils import tree_utils
  import chex
  import jax
  import jax.numpy
  import numpy
  import tree
label_desc: Use image node_id 10 for calling a global function with example usage: get_clip_config_for_path(config, path) and returns: NestClippingConfig, NestClippingConfig