def create_bucket(request, bucket_id):
 bucket_put = ((request.method.lower() == 'put') and request.path.endswith('buckets/default'))
 if bucket_put:
  return
 already_created = request.bound_data.setdefault('buckets', {})
 if (bucket_id in already_created):
  return
 bucket_uri = instance_uri(request, 'bucket', id=bucket_id)
 bucket = resource_create_object(request=request, resource_cls=Bucket, uri=bucket_uri)
 already_created[bucket_id] = bucket

def create_bucket ( request , bucket_id ) : bucket_put = ( ( request . method . lower ( ) == 'put' ) and request . path . endswith ( 'buckets/default' ) ) if bucket_put : return already_created = request . bound_data . setdefault ( 'buckets' , { } ) if ( bucket_id in already_created ) : return bucket_uri = instance_uri ( request , 'bucket' , id = bucket_id ) bucket = resource_create_object ( request = request , resource_cls = Bucket , uri = bucket_uri ) already_created [ bucket_id ] = bucket
create a bucket if it doesnt exists .