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
    service = googleapiclient.discovery.build(
        "iam", "v1", credentials=credentials)

    // Call the Cloud IAM Roles API
    // If using pylint, disable weak-typing warnings
    // pylint: disable=no-member
    response = service.roles().list().execute()
    roles = response["roles"]

    // Process the response
    for role in roles:

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}]")

    // Removes the member from the "Log Writer" role.
    modify_policy_remove_member(crm_service, project_id, role, member)


def initialize_service():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

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: ANSSI-FR/SecuML
Commit Name: 39efccc696a1c20745a52cc50935cdc24f92230d
Time: 2019-05-09
Author: anael.beaugnon@ssi.gouv.fr
File Name: secuml/core/classif/classifiers/__init__.py
Class Name: Classifier
Method Name: _predict_streaming


Project Name: ellisdg/3DUnetCNN
Commit Name: 8215a34d3203f45254b06a63271fe8010d351e6f
Time: 2017-02-20
Author: david.ellis@unmc.edu
File Name: UnetTraining.py
Class Name:
Method Name: get_training_weights