class_docstr: JSON encoder for dataset attributes.
class_docstr_tok: ["JSON","encoder","for","dataset","attributes","."]
docstr: Return a json-serializable object for *obj*.
  
  In order to facilitate decoding, elements in dictionaries, lists/tuples and multi-dimensional arrays are
  encoded recursively.
docstr_tok: ["Return","a","json-serializable","object","for","*","obj","*",".","In","order","to","facilitate","decoding",",","elements","in","dictionaries",",","lists\/tuples","and","multi-dimensional","arrays","are","encoded","recursively","."]
code: def default(self, obj):
      """Return a json-serializable object for *obj*.
  
      In order to facilitate decoding, elements in dictionaries, lists/tuples and multi-dimensional arrays are
      encoded recursively.
      """
      if isinstance(obj, dict):
          serialized = {}
          for key, val in obj.items():
              serialized[key] = self.default(val)
          return serialized
      elif isinstance(obj, (list, tuple, np.ndarray)):
          return [self.default(item) for item in obj]
      return self._encode(obj)
  
imports: from __future__ import annotations
  import datetime
  import json
  import logging
  from collections import OrderedDict
  import numpy
  import xarray
  from satpy.writers.utils import flatten_dict
label_desc: Use image node_id 1 for calling the AttributeEncoder obj's underlying member method code with example usage: obj.default(obj) and returns: self, serialized, unknown