code: def decode_obj(cls, obj):
      # Decode nested objects first.
      if isinstance(obj, dict):
          obj = {key: cls.decode_obj(val) for (key, val) in obj.items()}
      elif isinstance(obj, list):
          obj = list(cls.decode_obj(val) for val in obj)
      # Check if we have a tagged object.
      if not isinstance(obj, dict) or len(obj) != 1:
          return obj
      obj_tag = next(iter(obj.keys()))
      if not obj_tag.startswith("!"):
          return obj
      if obj_tag not in json_tags:
          raise ValueError("Unknown tag", obj_tag)
      obj_cls = json_tags[obj_tag]
      return obj_cls.decode_json_obj(obj[obj_tag])
  
file_path: nltk/nltk/jsontags.py
imports: import json
label_desc: Use image node_id 2 for calling the JSONTaggedDecoder obj's underlying member method code with example usage: obj.decode_obj(cls, obj) and returns: obj_cls, obj, obj