class_docstr: For when you want to get (nested) fields by usual attribute access.
  
  Example usage:
  
  ```
  results = ...
  wrapped = UnnestingWrapper(results)
  wrapped.my_attr  # equivalent to `get_innermost(results, 'my_attr')
  
  # Use `_object` to get at the wrapped object.
  new_results = replace_innermost(wrapped._object, ...)
  ```
class_docstr_tok: ["For","when","you","want","to","get","(","nested",")","fields","by","usual","attribute","access",".","Example","usage",":","``","`","results","=","...","wrapped","=","UnnestingWrapper","(","results",")","wrapped.my_attr","#","equivalent","to","`","get_innermost","(","results",",","'my_attr","'",")","#","Use","`","_object","`","to","get","at","the","wrapped","object",".","new_results","=","replace_innermost","(","wrapped._object",",","...",")","``","`"]
docstr: Wraps objects so attribute access searches nested objects.
  
  Args:
    obj: The object to find nested objects in.
    innermost: Boolean. When `True`, attribute access uses `get_innermost`;
      otherwise uses `get_outermost`. Defaults to `True`.
docstr_tok: ["Wraps","objects","so","attribute","access","searches","nested","objects",".","Args",":","obj",":","The","object","to","find","nested","objects","in",".","innermost",":","Boolean",".","When","`","True","`",",","attribute","access","uses","`","get_innermost","`",";","otherwise","uses","`","get_outermost","`",".","Defaults","to","`","True","`","."]
code: def __init__(self, obj, innermost=True):
      """Wraps objects so attribute access searches nested objects.
  
      Args:
        obj: The object to find nested objects in.
        innermost: Boolean. When `True`, attribute access uses `get_innermost`;
          otherwise uses `get_outermost`. Defaults to `True`.
      """
      self._object = obj
      self._innermost = innermost
  
file_path: probability/tensorflow_probability/python/internal/unnest.py
imports: import collections
label_desc: Use image node_id 1 to create a new UnnestingWrapper object  with example: obj = UnnestingWrapper(obj, innermost)