code: def delete_resource(self, resource):
          
          with self.lock:
              self.resources.remove(resource)
          self.destroy_resource(resource.object)
          del resource
docs: Deletes the resource from the pool and destroys the associated
          resource. Not usually needed by users of the pool, but called
          internally when BadResource is raised.
  
          :param resource: the resource to remove
          :type resource: Resource