646012c26db9335f69216c5d8656090c4211f323,storage/cloud-client/bucket_lock_test.py,,bucket,#,40

Before Change


def bucket():
    Creates a test bucket and deletes it upon completion.
    client = storage.Client()
    bucket_name = "bucket-lock-" + str(int(time.time()))
    bucket = client.create_bucket(bucket_name)
    yield bucket
    bucket.delete(force=True)

After Change


def bucket():
    Yields a bucket that is deleted after the test completes.
    bucket = None
    while bucket is None or bucket.exists():
        bucket_name = "bucket-lock-{}".format(uuid.uuid4())
        bucket = storage.Client().bucket(bucket_name)
    bucket.create()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 646012c26db9335f69216c5d8656090c4211f323
Time: 2020-03-05
Author: crwilcox@google.com
File Name: storage/cloud-client/bucket_lock_test.py
Class Name:
Method Name: bucket


Project Name: brightmart/text_classification
Commit Name: 75982d3d634fb358be6c4fea6fd8dd705db13d9e
Time: 2018-11-21
Author: brightmart@hotmail.com
File Name: a00_Bert/train_bert_multi-label.py
Class Name:
Method Name: main


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 6c7f63e58534ff60c524324a1cf8628c838df772
Time: 2020-03-05
Author: crwilcox@google.com
File Name: storage/cloud-client/iam_test.py
Class Name:
Method Name: bucket