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