code: def __init__(self, name, data, fullname=None):
      self.name = name
      self._data = data = _coerce_resdef(data)
      self.fullname = fullname or name
      self.description = data.get("description", "")
      self.preserve_path = data.get("preserve-path")
      self.target_type = data.get("target-type")
      self.default_unpack = data.get("default-unpack", True)
      self.private = bool(data.get("private"))
      self.references = data.get("references", [])
      self.sources = self._init_sources(data.get("sources", []))
      self.target_path = _init_target_path(
          data.get("target-path"),
          data.get("path"),
          f"resource {self.resolving_name}",
      )
  
imports: import collections
  import copy
  import logging
  import operator
  import pprint
  from guild import util
label_desc: Use image node_id 1 to create a new ResourceDef object  with example: obj = ResourceDef(name, data, fullname)