code: def parse_resources(self, resources):
          
  
          self.resources = {}
          resource_factory = ResourceFactory()
          for res_id, res_value in resources.items():
              r = resource_factory.create_resource(res_id, res_value)
              if r:
                  if r.resource_type in self.resources:
                      self.resources[r.resource_type].append(r)
                  else:
                      self.resources[r.resource_type] = [r]
docs: Parses and sets resources in the model using a factory.