docs: def acquire(self, _filter=None, default=None):
          """
          acquire(_filter=None, default=None)
  
          Claims a resource from the pool for manual use. Resources are
          created as needed when all members of the pool are claimed or
          the pool is empty. Most of the time you will want to use
          :meth:`transaction`.
  
          :param _filter: a filter that can be used to select a member
              of the pool
          :type _filter: callable
          :param default: a value that will be used instead of calling
              :meth:`create_resource` if a new resource needs to be created
          :rtype: Resource
          """
          if not _filter:
              def _filter(obj):
                  return True
          elif not callable(_filter):
              raise TypeError("_filter is not a callable")
  
          resource = None
          with self.lock:
              for e in self.resources:
                  if not e.claimed and _filter(e.object):
                      resource = e
                      break
              if resource is None:
                  if default is not None:
                      resource = Resource(default, self)
                  else:
                      resource = Resource(self.create_resource(), self)
                  self.resources.append(resource)
              resource.claimed = True
          return resource