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