class_docstr: Store summary metrics (eg. accuracy) during and after a run.
  
  You can manipulate this as if it's a Python dictionary but the keys
  get mangled. .strip() is called on them, so spaces at the beginning
  and end are removed.
class_docstr_tok: ["Store","summary","metrics","(","eg",".","accuracy",")","during","and","after","a","run",".","You","can","manipulate","this","as","if","it","'s","a","Python","dictionary","but","the","keys","get","mangled",".",".strip","(",")","is","called","on","them",",","so","spaces","at","the","beginning","and","end","are","removed","."]
docstr: Normalize, compress, and encode sub-objects for backend storage.
  
  value: Object to encode.
  path_from_root: `tuple` of key strings from the top-level summary to the
      current `value`.
  
  Returns:
      A new tree of dict's with large objects replaced with dictionaries
      with "_type" entries that say which type the original data was.
docstr_tok: ["Normalize",",","compress",",","and","encode","sub-objects","for","backend","storage",".","value",":","Object","to","encode",".","path_from_root",":","`","tuple","`","of","key","strings","from","the","top-level","summary","to","the","current","`","value","`",".","Returns",":","A","new","tree","of","dict","'s","with","large","objects","replaced","with","dictionaries","with","``","_type","''","entries","that","say","which","type","the","original","data","was","."]
code: def _encode(self, value, path_from_root):
      """Normalize, compress, and encode sub-objects for backend storage.
  
      value: Object to encode.
      path_from_root: `tuple` of key strings from the top-level summary to the
          current `value`.
  
      Returns:
          A new tree of dict's with large objects replaced with dictionaries
          with "_type" entries that say which type the original data was.
      """
  
      # Constructs a new `dict` tree in `json_value` that discards and/or
      # encodes objects that aren't JSON serializable.
  
      if isinstance(value, dict):
          json_value = {}
          for key, value in value.items():
              json_value[key] = self._encode(
                  value, path_from_root + (key,)
              )
          return json_value
      else:
          path = ".".join(path_from_root)
          friendly_value, converted = util.json_friendly(
              val_to_json(self._run, path, value, namespace="summary")
          )
          json_value, compressed = util.maybe_compress_summary(
              friendly_value, util.get_h5_typename(value)
          )
          if compressed:
              self.write_h5(path_from_root, friendly_value)
  
          return json_value
  
imports: import json
  import os
  import time
  from wandb_gql import gql
  import wandb
  from wandb import util
  from wandb.apis.internal import Api
  from wandb.sdk import lib
  from wandb.sdk.data_types.utils import val_to_json
label_desc: Use image node_id 10 for calling the Summary obj's underlying member method code with example usage: obj._encode(value, path_from_root) and returns: json_value, json_value