code: def nested_distributions_from_specs(specs, parameters):
      """Builds a nest of distributions from a nest of specs.
  
      Args:
        specs: A nest of distribution specs.
        parameters: A nest of distribution kwargs.
  
      Returns:
        Nest of distribution instances with the same structure as the given specs.
      """
      return nest.map_structure_up_to(
          specs,
          lambda spec, parameters: spec.build_distribution(
              **parameters
          ),
          specs,
          parameters,
      )
  
file_path: agents/tf_agents/specs/distribution_spec.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow_probability
  from tensorflow.python.util import nest
label_desc: Use image node_id 2 for calling a global function with example usage: nested_distributions_from_specs(specs, parameters) and returns: nest