'Loads a resource from a model, creating a new
:py:class:`~boto3.resources.base.ServiceResource` subclass
with the correct properties and methods, named based on the service
and resource name, e.g. EC2.Instance.
:type resource_name: string
:param resource_name: Name of the resource to look up. For services,
this should match the ``service_name``.
:type single_resource_json_definition: dict
:param single_resource_json_definition:
The loaded json of a single service resource or resource
definition.
:type service_context: :py:class:`~boto3.utils.ServiceContext`
:param service_context: Context about the AWS service
:rtype: Subclass of :py:class:`~boto3.resources.base.ServiceResource`
:return: The service or resource class.'

def load_from_definition(self, resource_name, single_resource_json_definition, service_context):

    logger.debug('Loading    %s:%s', service_context.service_name, resource_name)
    resource_model = ResourceModel(resource_name, single_resource_json_definition, service_context.resource_json_definitions)
    shape = None
    if resource_model.shape:
        shape = service_context.service_model.shape_for(resource_model.shape)
    resource_model.load_rename_map(shape)
    meta = ResourceMeta(service_context.service_name, resource_model=resource_model)
    attrs = {'meta': meta}
    self._load_identifiers(attrs=attrs, meta=meta, resource_name=resource_name, resource_model=resource_model)
    self._load_actions(attrs=attrs, resource_name=resource_name, resource_model=resource_model, service_context=service_context)
    self._load_attributes(attrs=attrs, meta=meta, resource_name=resource_name, resource_model=resource_model, service_context=service_context)
    self._load_collections(attrs=attrs, resource_model=resource_model, service_context=service_context)
    self._load_has_relations(attrs=attrs, resource_name=resource_name, resource_model=resource_model, service_context=service_context)
    self._load_waiters(attrs=attrs, resource_name=resource_name, resource_model=resource_model, service_context=service_context)
    cls_name = resource_name
    if (service_context.service_name == resource_name):
        cls_name = 'ServiceResource'
    cls_name = ((service_context.service_name + '.') + cls_name)
    base_classes = [ServiceResource]
    if (self._emitter is not None):
        self._emitter.emit(('creating-resource-class.%s' % cls_name), class_attributes=attrs, base_classes=base_classes, service_context=service_context)
    return type(str(cls_name), tuple(base_classes), attrs)
