code: def _source_for_type(self, type, val, data):
      data = coerce_source_data(data)
      if type == "file":
          return ResourceSource(self, f"file:{val}", **data)
      if type == "url":
          return ResourceSource(self, val, **data)
      if type == "module":
          return ResourceSource(self, f"module:{val}", **data)
      if type == "config":
          return ResourceSource(self, f"config:{val}", **data)
      raise AssertionError(type, val, data)
  
imports: import collections
  import copy
  import logging
  import operator
  import pprint
  from guild import util
label_desc: Use image node_id 7 for calling the ResourceDef obj's underlying member method code with example usage: obj._source_for_type(type, val, data) and returns: ResourceSource, ResourceSource, ResourceSource, ResourceSource