f877a9a1b2cb25bb045d5e513a412d4bd6f165fc,datalabeling/label_image_test.py,,test_label_image,#,90

Before Change


def test_label_image(capsys, annotation_spec_set, instruction, dataset):

    // Start labeling.
    response = label_image.label_image(
        dataset.name,
        instruction.name,
        annotation_spec_set.name
    )
    out, _ = capsys.readouterr()
    assert "Label_image operation name: " in out
    operation_name = response.operation.name

    // Cancels the labeling operation.
    response.cancel()
    assert response.cancelled() is True

    client = datalabeling.DataLabelingServiceClient()

    // If provided, use a provided test endpoint - this will prevent tests on
    // this snippet from triggering any action by a real human
    if "DATALABELING_ENDPOINT" in os.environ:
        opts = ClientOptions(api_endpoint=os.getenv("DATALABELING_ENDPOINT"))
        client = datalabeling.DataLabelingServiceClient(client_options=opts)

    client.transport._operations_client.cancel_operation(
            operation_name)

After Change


        return label_image.label_image(
            dataset.name, instruction.name, annotation_spec_set.name)

    response = run_sample()
    cleaner.append(response.operation.name)

    out, _ = capsys.readouterr()
    assert "Label_image operation name: " in out
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 22

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: f877a9a1b2cb25bb045d5e513a412d4bd6f165fc
Time: 2020-04-22
Author: tmatsuo@google.com
File Name: datalabeling/label_image_test.py
Class Name:
Method Name: test_label_image


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: f877a9a1b2cb25bb045d5e513a412d4bd6f165fc
Time: 2020-04-22
Author: tmatsuo@google.com
File Name: datalabeling/label_video_test.py
Class Name:
Method Name: test_label_video


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: f877a9a1b2cb25bb045d5e513a412d4bd6f165fc
Time: 2020-04-22
Author: tmatsuo@google.com
File Name: datalabeling/label_text_test.py
Class Name:
Method Name: test_label_text