code: def dict_info(trait):
      try:
          trait_base = trait._value_trait
      except AttributeError:
          trait_base = trait._trait
      try:
          traits = trait._per_key_traits
      except AttributeError:
          traits = trait._traits
  
      if traits is None and (
          trait_base is None or isinstance(trait_base, Any)
      ):
          value_string = "elements of any type"
      else:
          parts = []
          if traits:
              parts.append(
                  "the following types: %r"
                  % {k: v.info() for k, v in traits}
              )
          if trait_base:
              parts.append("values that are: %s" % trait_base.info())
          value_string = "elements with " + ", and ".join(parts)
  
      return "{} with {}".format(trait.info(), value_string)
  
file_path: pythreejs/docs/sphinxext/autodoc_traits.py
imports: from collections import OrderedDict
  from traitlets import TraitType, Undefined, Container, Dict, Any, HasTraits
  from sphinx.ext.autodoc import ClassDocumenter, AttributeDocumenter
label_desc: Use image node_id 1 for calling a global function with example usage: dict_info(trait) and returns: str