def add_resource(self, transaction, parent_resource, lp):
        method = getattr(parent_resource, "render_POST", None)
        try:
            resource = method(request=transaction.request)
        except NotImplementedError:
            transaction.response.code = defines.Codes.METHOD_NOT_ALLOWED.number
            return transaction
        if isinstance(resource, Resource):
            pass
        elif isinstance(resource, tuple) and len(resource) == 2:
            resource, callback = resource
            resource = self._handle_separate(transaction, callback)
            if not isinstance(resource, Resource):  # pragma: no cover
                transaction.response.code = defines.Codes.INTERNAL_SERVER_ERROR.number
                return transaction
        else:  # pragma: no cover
            # Handle error
            transaction.response.code = defines.Codes.INTERNAL_SERVER_ERROR.number
            return transaction

        resource.path = lp

        if resource.etag is not None:
            transaction.response.etag = resource.etag

        transaction.response.location_path = resource.path

        if resource.location_query is not None and len(resource.location_query) > 0:
            transaction.response.location_query = resource.location_query

        transaction.response.code = defines.Codes.CREATED.number
        transaction.response.payload = None
        resource.changed = True
        transaction.resource = resource

        self._parent.root[resource.path] = resource

        return transaction
Split this way for unit testing
dataset/ETHPy150Open Tanganelli/CoAPthon/coapthon/layers/resourcelayer.py/ResourceLayer.add_resource--crossover with--dataset/ETHPy150Open istresearch/scrapy-cluster/redis-monitor/plugins/base_monitor.py/BaseMonitor._get_current_time