class_docstr: Helper class to promote private subclass docstring to public counterpart.
  
  Example:
  
  ```python
  class TransformedDistribution(Distribution):
    @AppendDocstring(
      additional_note='A special note!',
      kwargs_dict={'foo': 'An extra arg.'})
    def _prob(self, y, foo=None):
      pass
  ```
  
  In this case, the `AppendDocstring` decorator appends the `additional_note` to
  the docstring of `prob` (not `_prob`) and adds a new `kwargs`
  section with each dictionary item as a bullet-point.
  
  For a more detailed example, see `TransformedDistribution`.
class_docstr_tok: ["Helper","class","to","promote","private","subclass","docstring","to","public","counterpart",".","Example",":","``","`","python","class","TransformedDistribution","(","Distribution",")",":","@","AppendDocstring","(","additional_note=","'","A","special","note","!","'",",","kwargs_dict=","{","'foo","'",":","'An","extra","arg",".","'","}",")","def","_prob","(","self",",","y",",","foo=None",")",":","pass","``","`","In","this","case",",","the","`","AppendDocstring","`","decorator","appends","the","`","additional_note","`","to","the","docstring","of","`","prob","`","(","not","`","_prob","`",")","and","adds","a","new","`","kwargs","`","section","with","each","dictionary","item","as","a","bullet-point",".","For","a","more","detailed","example",",","see","`","TransformedDistribution","`","."]
docstr: Initializes the AppendDocstring object.
  
  Args:
    additional_note: Python string added as additional docstring to public
      version of function.
    kwargs_dict: Python string/string dictionary representing specific kwargs
      expanded from the **kwargs input.
  
  Raises:
    ValueError: if kwargs_dict.key contains whitespace.
    ValueError: if kwargs_dict.value contains newlines.
docstr_tok: ["Initializes","the","AppendDocstring","object",".","Args",":","additional_note",":","Python","string","added","as","additional","docstring","to","public","version","of","function",".","kwargs_dict",":","Python","string\/string","dictionary","representing","specific","kwargs","expanded","from","the","*","*","kwargs","input",".","Raises",":","ValueError",":","if","kwargs_dict.key","contains","whitespace",".","ValueError",":","if","kwargs_dict.value","contains","newlines","."]
code: def __init__(self, additional_note="", kwargs_dict=None):
      """Initializes the AppendDocstring object.
  
      Args:
        additional_note: Python string added as additional docstring to public
          version of function.
        kwargs_dict: Python string/string dictionary representing specific kwargs
          expanded from the **kwargs input.
  
      Raises:
        ValueError: if kwargs_dict.key contains whitespace.
        ValueError: if kwargs_dict.value contains newlines.
      """
      self._additional_note = additional_note
      if kwargs_dict:
          bullets = []
          for key in sorted(kwargs_dict.keys()):
              value = kwargs_dict[key]
              if any(x.isspace() for x in key):
                  raise ValueError(
                      "Parameter name '%s' contains whitespace." % key
                  )
              value = value.lstrip()
              if "\n" in value:
                  raise ValueError(
                      "Parameter description for '%s' contains newlines."
                      % key
                  )
              bullets.append("*  `%s`: %s" % (key, value))
          self._additional_note += (
              "\n\n##### `kwargs`:\n\n" + "\n".join(bullets)
          )
  
imports: import functools
  import hashlib
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 1 to create a new AppendDocstring object from inherited base classes: object with example: obj = AppendDocstring(additional_note, kwargs_dict)