code: def _init_resource_source(self, data):
      if isinstance(data, dict):
          return self._resource_source_for_data(data)
      if isinstance(data, str):
          return self._source_for_type(
              self.default_source_type, data, {}
          )
      raise ResourceFormatError(
          f"invalid source for resource '{self.fullname}': {data!r}"
      )
  
imports: import collections
  import copy
  import logging
  import operator
  import pprint
  from guild import util
label_desc: Use image node_id 5 for calling the ResourceDef obj's underlying member method code with example usage: obj._init_resource_source(data) and returns: self, self