63ea9b2637ce8e478c854b68d8af7ca42e19abcf,iam/api-client/quickstart.py,,quickstart,#,18

Before Change



    // Get credentials
    credentials = service_account.Credentials.from_service_account_file(
        filename=os.environ["GOOGLE_APPLICATION_CREDENTIALS"],
        scopes=["https://www.googleapis.com/auth/cloud-platform"])

    // Create the Cloud IAM service object

After Change



    // Gets the project"s policy and prints all members with the "Log Writer" role.
    policy = get_policy(crm_service, project_id)
    binding = next(b for b in policy["bindings"] if b["role"] == role)
    print(f"Role: {(binding["role"])}")
    print("Members: ")
    for m in binding["members"]:
        print(f"[{m}]")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 63ea9b2637ce8e478c854b68d8af7ca42e19abcf
Time: 2020-09-22
Author: 35782177+melaniedejong@users.noreply.github.com
File Name: iam/api-client/quickstart.py
Class Name:
Method Name: quickstart


Project Name: nilmtk/nilmtk
Commit Name: b523b464d8cafe29e352981c1c6df941f205592a
Time: 2014-07-09
Author: jack-list@xlk.org.uk
File Name: nilmtk/metrics.py
Class Name:
Method Name: mean_normalized_error_power


Project Name: nilmtk/nilmtk
Commit Name: 51f56cd2f529cbf92c0492c34510c040ed1b77fd
Time: 2014-05-22
Author: jack-list@xlk.org.uk
File Name: nilmtk/elecmeter.py
Class Name: ElecMeter
Method Name: power_series