fcaf37ca034fecabeda10af7e5fe3c92760c2b48,iot/api-client/manager/manager.py,,open_registry,#Any#Any#Any#Any#Any#Any#,249

Before Change


    registry_parent = "projects/{}/locations/{}".format(
            project_id,
            cloud_region)
    body = {
        "eventNotificationConfig": {
            "pubsubTopicName": pubsub_topic
        },
        "id": registry_id
    }
    request = client.projects().locations().registries().create(
        parent=registry_parent, body=body)

    try:
        response = request.execute()
        print("Created registry", registry_id)
        print(response)
    except HttpError as e:
        if e.resp.status == 409:
            // Device registry already exists
            print(
                    "Registry", registry_id,
                    "already exists - looking it up instead.")
            topic_name = "{}/registries/{}".format(
                    registry_parent, registry_id)
            request = client.projects().locations().registries(
                    ).get(name=topic_name)
            request.execute()


def patch_es256_auth(
        service_account_json, api_key, project_id, cloud_region, registry_id,
        device_id, public_key_file):
    Patch the device to add an ES256 public key to the device.

After Change


        service_account_json, api_key, project_id, cloud_region,
        pubsub_topic, registry_id)

    if (response is ""):
        // Device registry already exists
        print(
            "Registry {} already exists - looking it up instead.".format(
                registry_id))
        response = get_registry(
            service_account_json, api_key, project_id, cloud_region,
            registry_id)

    print("Registry {} opened: ".format(response.get("name")))
    print(response)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: fcaf37ca034fecabeda10af7e5fe3c92760c2b48
Time: 2017-09-12
Author: gguuss@gmail.com
File Name: iot/api-client/manager/manager.py
Class Name:
Method Name: open_registry


Project Name: pymc-devs/pymc3
Commit Name: e3fd56b08ed5c4d7247a147c3fab7c0fe59e9a0e
Time: 2019-02-16
Author: luciano.paz.neuro@gmail.com
File Name: pymc3/distributions/mixture.py
Class Name: Mixture
Method Name: comp_dists


Project Name: home-assistant/home-assistant
Commit Name: 9f54bcc21b1744f2850a35e54903f3581d14badb
Time: 2015-12-23
Author: marhje52@kth.se
File Name: homeassistant/components/mysensors.py
Class Name:
Method Name: setup