def METHOD_NAME(request, bucket_id):
    # Do nothing if current request does not involve a collection.
    subpath = request.matchdict.get("subpath")
    if not (subpath and subpath.rstrip("/").startswith("collections/")):
        return
    collection_id = subpath.split("/")[1]
    collection_uri = instance_uri(request, "collection", bucket_id=bucket_id, id=collection_id)
    # Do not intent to create multiple times per request (e.g. in batch).
    already_created = request.bound_data.setdefault("collections", {})
    if collection_uri in already_created:
        return
    # Do nothing if current request will already create the collection.
    collection_put = request.method.lower() == "put" and request.path.endswith(collection_id)
    if collection_put:
        return
    collection = resource_create_object(
        request=request, resource_cls=Collection, uri=collection_uri
    )
    already_created[collection_uri] = collection