<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register(self, resource=None, **meta):
 """ Add resource to the API. :param resource: Resource class for registration :param **meta: Redefine Meta options for the resource :return adrest.views.Resource: Generated resource. """

        if resource is None:
            def wrapper(resource):
                return self.register(resource, **meta)
            return wrapper

        # Must be instance of ResourceView
        if not issubclass(resource, ResourceView):
            raise AssertionError("%s not subclass of ResourceView" % resource)

        # Cannot be abstract
        if resource._meta.abstract:
            raise AssertionError("Attempt register of abstract resource: %s."
                                 % resource)

        # Fabric of resources
        meta = dict(self.meta, **meta)
        meta['name'] = meta.get('name', resource._meta.name)
        options = type('Meta', tuple(), meta)

        params = dict(api=self, Meta=options, **meta)

        params['__module__'] = '%s.%s' % (
            self.prefix, self.str_version.replace('.', '_'))

        params['__doc__'] = resource.__doc__

        new_resource = type(
            '%s%s' % (resource.__name__, len(self.resources)),
            (resource,), params)

        if self.resources.get(new_resource._meta.url_name):
            logger.warning(
                "A resource '%r' is replacing the existing record for '%s'",
                new_resource, self.resources.get(new_resource._meta.url_name))

        self.resources[new_resource._meta.url_name] = new_resource

        return resource