From 1435af31e239f84ba784735f571be159c16b42d2 Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Thu, 17 Nov 2016 17:48:53 -0800 Subject: [PATCH 01/12] added snippets for vision alpha --- vision/api/label/snippets.py | 93 ++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 vision/api/label/snippets.py diff --git a/vision/api/label/snippets.py b/vision/api/label/snippets.py new file mode 100644 index 00000000000..7fcf8f42a7e --- /dev/null +++ b/vision/api/label/snippets.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# Copyright 2015 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import argparse +import base64 +import httplib2 +import json + +from googleapiclient import discovery +from oauth2client.client import GoogleCredentials + +DISCOVERY_URL = ('https://vision.googleapis.com/$discovery/rest?' + 'labels=TRUSTED_TESTER&version=v1') + +def get_service(): + """Get vision service using discovery.""" + credentials = GoogleCredentials.get_application_default() + scoped_credentials = credentials.create_scoped( + ['https://www.googleapis.com/auth/cloud-platform']) + http = httplib2.Http() + scoped_credentials.authorize(http) + return discovery.build('vision', 'v1', + http=http, + discoveryServiceUrl=DISCOVERY_URL) + +def crop_hint(photo_file): + """Run a crop hint request on the image.""" + + service = get_service() + + with open(photo_file, 'rb') as image: + image_content = base64.b64encode(image.read()) + service_request = service.images().annotate(body={ + 'requests': [{ + 'image': { + 'content': image_content.decode('UTF-8') + }, + 'features': [{ + 'type': 'CROP_HINTS' + }] + }] + }) + + response = service_request.execute() + print json.dumps(response) + + +def web_annotation(photo_file): + """Run a web annotation request on the image.""" + + service = get_service() + + with open(photo_file, 'rb') as image: + image_content = base64.b64encode(image.read()) + service_request = service.images().annotate(body={ + 'requests': [{ + 'image': { + 'content': image_content.decode('UTF-8') + }, + 'features': [{ + 'type': 'WEB_ANNOTATION', + 'maxResults': 10 + }] + }] + }) + + response = service_request.execute() + print json.dumps(response) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('command', choices=['crop_hint','web_annotation']) + parser.add_argument('image_file', help='The image you\'d like to process.') + args = parser.parse_args() + + if args.command == 'crop_hint': + crop_hint(args.image_file) + elif args.command == 'web_annotation': + web_annotation(args.image_file) From 5380db3705683fcb5cca067401f64a8b5da0be43 Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Thu, 17 Nov 2016 17:56:42 -0800 Subject: [PATCH 02/12] added snippets tests --- vision/api/label/snippets_test.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 vision/api/label/snippets_test.py diff --git a/vision/api/label/snippets_test.py b/vision/api/label/snippets_test.py new file mode 100644 index 00000000000..56fb56761d9 --- /dev/null +++ b/vision/api/label/snippets_test.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# Copyright 2015 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import snippets + +def test_crop_hint(capsys): + result = snippets.crop_hint('resources/cat.jpg') + crop_hints = result['responses'] + assert len(crop_hints) == 1 From 4824f706794ebf4424d7c0d662f289ceee03f24c Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Thu, 17 Nov 2016 18:07:47 -0800 Subject: [PATCH 03/12] maded changes to code to make testing easier --- vision/api/label/snippets.py | 10 ++++++---- vision/api/label/snippets_test.py | 7 +++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/vision/api/label/snippets.py b/vision/api/label/snippets.py index 7fcf8f42a7e..74be1818188 100644 --- a/vision/api/label/snippets.py +++ b/vision/api/label/snippets.py @@ -55,7 +55,7 @@ def crop_hint(photo_file): }) response = service_request.execute() - print json.dumps(response) + return response def web_annotation(photo_file): @@ -78,7 +78,7 @@ def web_annotation(photo_file): }) response = service_request.execute() - print json.dumps(response) + return response if __name__ == '__main__': @@ -88,6 +88,8 @@ def web_annotation(photo_file): args = parser.parse_args() if args.command == 'crop_hint': - crop_hint(args.image_file) + response = crop_hint(args.image_file) + print(json.dumps(response, indent=2)) elif args.command == 'web_annotation': - web_annotation(args.image_file) + response = web_annotation(args.image_file) + print(json.dumps(response, indent=2)) diff --git a/vision/api/label/snippets_test.py b/vision/api/label/snippets_test.py index 56fb56761d9..859357d55c7 100644 --- a/vision/api/label/snippets_test.py +++ b/vision/api/label/snippets_test.py @@ -16,7 +16,6 @@ import snippets -def test_crop_hint(capsys): - result = snippets.crop_hint('resources/cat.jpg') - crop_hints = result['responses'] - assert len(crop_hints) == 1 +def test_crop_hint(resource): + result = snippets.crop_hint(resource('cat.jpg')) + print(result) From 5bc89266306b46593b312d7364a00469ae7b91ba Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Thu, 17 Nov 2016 18:11:25 -0800 Subject: [PATCH 04/12] added first test --- vision/api/label/snippets_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vision/api/label/snippets_test.py b/vision/api/label/snippets_test.py index 859357d55c7..ba9808cc5e4 100644 --- a/vision/api/label/snippets_test.py +++ b/vision/api/label/snippets_test.py @@ -16,6 +16,6 @@ import snippets -def test_crop_hint(resource): +def test_crop_hint_response_count(resource): result = snippets.crop_hint(resource('cat.jpg')) - print(result) + assert len(result['responses']) == 1 From b7b5c3df9329c095e2267d2333bdc294cb0b7bea Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Thu, 17 Nov 2016 20:19:28 -0800 Subject: [PATCH 05/12] fixed lint errors --- vision/api/label/snippets.py | 4 +++- vision/api/label/snippets_test.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/vision/api/label/snippets.py b/vision/api/label/snippets.py index 74be1818188..e4b3227c2c0 100644 --- a/vision/api/label/snippets.py +++ b/vision/api/label/snippets.py @@ -25,6 +25,7 @@ DISCOVERY_URL = ('https://vision.googleapis.com/$discovery/rest?' 'labels=TRUSTED_TESTER&version=v1') + def get_service(): """Get vision service using discovery.""" credentials = GoogleCredentials.get_application_default() @@ -36,6 +37,7 @@ def get_service(): http=http, discoveryServiceUrl=DISCOVERY_URL) + def crop_hint(photo_file): """Run a crop hint request on the image.""" @@ -83,7 +85,7 @@ def web_annotation(photo_file): if __name__ == '__main__': parser = argparse.ArgumentParser() - parser.add_argument('command', choices=['crop_hint','web_annotation']) + parser.add_argument('command', choices=['crop_hint', 'web_annotation']) parser.add_argument('image_file', help='The image you\'d like to process.') args = parser.parse_args() diff --git a/vision/api/label/snippets_test.py b/vision/api/label/snippets_test.py index ba9808cc5e4..9ab8d5af64a 100644 --- a/vision/api/label/snippets_test.py +++ b/vision/api/label/snippets_test.py @@ -16,6 +16,7 @@ import snippets + def test_crop_hint_response_count(resource): result = snippets.crop_hint(resource('cat.jpg')) assert len(result['responses']) == 1 From a1e67d4f8d70ecae50e35ef131c6415d83fb7496 Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Thu, 17 Nov 2016 21:24:47 -0800 Subject: [PATCH 06/12] added tests --- vision/api/label/snippets_test.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/vision/api/label/snippets_test.py b/vision/api/label/snippets_test.py index 9ab8d5af64a..3bb52279b5e 100644 --- a/vision/api/label/snippets_test.py +++ b/vision/api/label/snippets_test.py @@ -20,3 +20,22 @@ def test_crop_hint_response_count(resource): result = snippets.crop_hint(resource('cat.jpg')) assert len(result['responses']) == 1 + + +def test_crop_hint_response_dim(resource): + result = snippets.crop_hint(resource('cat.jpg')) + crop_hint = result['responses'][0] + crop_hint_annotation = crop_hint['cropHintsAnnotation']['cropHints'][0] + confidence = crop_hint_annotation['confidence'] + + assert confidence > 0.5 + assert confidence < 0.9 + +def test_web_annotations(resource): + result = snippets.web_annotation(resource('cat.jpg')) + web_annotation = result['responses'][0]['webAnnotation'] + web_entities = web_annotation['webEntities'] + + assert len(web_entities) == 10 + assert web_entities[0]['entityId'] == '/m/012cc2' + assert web_entities[0]['description'] == 'Russian Blue' From 929571217e617726b2207682d56f9631d0280d31 Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Fri, 18 Nov 2016 21:13:00 -0800 Subject: [PATCH 07/12] updated license and photo path variable --- vision/api/label/snippets.py | 19 ++++++++++--------- vision/api/label/snippets_test.py | 5 +++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/vision/api/label/snippets.py b/vision/api/label/snippets.py index e4b3227c2c0..e495a291cbe 100644 --- a/vision/api/label/snippets.py +++ b/vision/api/label/snippets.py @@ -1,11 +1,12 @@ #!/usr/bin/env python -# Copyright 2015 Google Inc. All Rights Reserved. + +# Copyright 2016 Google, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -38,12 +39,12 @@ def get_service(): discoveryServiceUrl=DISCOVERY_URL) -def crop_hint(photo_file): +def crop_hint(photo_path): """Run a crop hint request on the image.""" service = get_service() - with open(photo_file, 'rb') as image: + with open(photo_path, 'rb') as image: image_content = base64.b64encode(image.read()) service_request = service.images().annotate(body={ 'requests': [{ @@ -60,12 +61,12 @@ def crop_hint(photo_file): return response -def web_annotation(photo_file): +def web_annotation(photo_path): """Run a web annotation request on the image.""" service = get_service() - with open(photo_file, 'rb') as image: + with open(photo_path, 'rb') as image: image_content = base64.b64encode(image.read()) service_request = service.images().annotate(body={ 'requests': [{ @@ -86,12 +87,12 @@ def web_annotation(photo_file): if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('command', choices=['crop_hint', 'web_annotation']) - parser.add_argument('image_file', help='The image you\'d like to process.') + parser.add_argument('image_path', help='The image you\'d like to process.') args = parser.parse_args() if args.command == 'crop_hint': - response = crop_hint(args.image_file) + response = crop_hint(args.image_path) print(json.dumps(response, indent=2)) elif args.command == 'web_annotation': - response = web_annotation(args.image_file) + response = web_annotation(args.image_path) print(json.dumps(response, indent=2)) diff --git a/vision/api/label/snippets_test.py b/vision/api/label/snippets_test.py index 3bb52279b5e..40a302c003a 100644 --- a/vision/api/label/snippets_test.py +++ b/vision/api/label/snippets_test.py @@ -1,11 +1,12 @@ #!/usr/bin/env python -# Copyright 2015 Google Inc. All Rights Reserved. + +# Copyright 2016 Google, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, From 7621dbf760de87ad504bc788a894251457925d5d Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Fri, 18 Nov 2016 21:13:53 -0800 Subject: [PATCH 08/12] added two lines --- vision/api/label/snippets_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/vision/api/label/snippets_test.py b/vision/api/label/snippets_test.py index 40a302c003a..12f348eae59 100644 --- a/vision/api/label/snippets_test.py +++ b/vision/api/label/snippets_test.py @@ -32,6 +32,7 @@ def test_crop_hint_response_dim(resource): assert confidence > 0.5 assert confidence < 0.9 + def test_web_annotations(resource): result = snippets.web_annotation(resource('cat.jpg')) web_annotation = result['responses'][0]['webAnnotation'] From bf0c1445e7aaffd755838fb644199deb2e47754e Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Mon, 21 Nov 2016 13:38:15 -0800 Subject: [PATCH 09/12] fixed PR comments --- vision/api/label/snippets.py | 87 ++++++++++++++++--------------- vision/api/label/snippets_test.py | 3 +- 2 files changed, 46 insertions(+), 44 deletions(-) diff --git a/vision/api/label/snippets.py b/vision/api/label/snippets.py index e495a291cbe..e56b18c4bd5 100644 --- a/vision/api/label/snippets.py +++ b/vision/api/label/snippets.py @@ -1,12 +1,11 @@ #!/usr/bin/env python - -# Copyright 2016 Google, Inc +# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -17,15 +16,16 @@ import argparse import base64 -import httplib2 import json from googleapiclient import discovery +import httplib2 from oauth2client.client import GoogleCredentials -DISCOVERY_URL = ('https://vision.googleapis.com/$discovery/rest?' - 'labels=TRUSTED_TESTER&version=v1') - +DISCOVERY_URL = ( + 'https://vision.googleapis.com/$discovery/rest?' + 'labels=TRUSTED_TESTER&version=v1' +) def get_service(): """Get vision service using discovery.""" @@ -34,65 +34,68 @@ def get_service(): ['https://www.googleapis.com/auth/cloud-platform']) http = httplib2.Http() scoped_credentials.authorize(http) - return discovery.build('vision', 'v1', - http=http, - discoveryServiceUrl=DISCOVERY_URL) - + return discovery.build( + 'vision', 'v1', + http=http, + discoveryServiceUrl=DISCOVERY_URL + ) -def crop_hint(photo_path): +def crop_hint(photo_file): """Run a crop hint request on the image.""" service = get_service() - with open(photo_path, 'rb') as image: + with open(photo_file, 'rb') as image: image_content = base64.b64encode(image.read()) - service_request = service.images().annotate(body={ - 'requests': [{ - 'image': { - 'content': image_content.decode('UTF-8') - }, - 'features': [{ - 'type': 'CROP_HINTS' - }] + + service_request = service.images().annotate(body={ + 'requests': [{ + 'image': { + 'content': image_content.decode('UTF-8') + }, + 'features': [{ + 'type': 'CROP_HINTS' }] - }) + }] + }) - response = service_request.execute() - return response + response = service_request.execute() + return response -def web_annotation(photo_path): +def web_annotation(photo_file): """Run a web annotation request on the image.""" service = get_service() - with open(photo_path, 'rb') as image: + with open(photo_file, 'rb') as image: image_content = base64.b64encode(image.read()) - service_request = service.images().annotate(body={ - 'requests': [{ - 'image': { - 'content': image_content.decode('UTF-8') - }, - 'features': [{ - 'type': 'WEB_ANNOTATION', - 'maxResults': 10 - }] + + service_request = service.images().annotate(body={ + 'requests': [{ + 'image': { + 'content': image_content.decode('UTF-8') + }, + 'features': [{ + 'type': 'WEB_ANNOTATION', + 'maxResults': 10 }] - }) + }] + }) - response = service_request.execute() - return response + response = service_request.execute() + return response if __name__ == '__main__': parser = argparse.ArgumentParser() - parser.add_argument('command', choices=['crop_hint', 'web_annotation']) - parser.add_argument('image_path', help='The image you\'d like to process.') + parser.add_argument('command', choices=['crop_hint','web_annotation']) + parser.add_argument('image_file', help='The image you\'d like to process.') args = parser.parse_args() if args.command == 'crop_hint': - response = crop_hint(args.image_path) + response = crop_hint(args.image_file) print(json.dumps(response, indent=2)) elif args.command == 'web_annotation': - response = web_annotation(args.image_path) + response = web_annotation(args.image_file) print(json.dumps(response, indent=2)) diff --git a/vision/api/label/snippets_test.py b/vision/api/label/snippets_test.py index 12f348eae59..cffd6343f09 100644 --- a/vision/api/label/snippets_test.py +++ b/vision/api/label/snippets_test.py @@ -29,8 +29,7 @@ def test_crop_hint_response_dim(resource): crop_hint_annotation = crop_hint['cropHintsAnnotation']['cropHints'][0] confidence = crop_hint_annotation['confidence'] - assert confidence > 0.5 - assert confidence < 0.9 + assert 0.5 < confidence < 0.9 def test_web_annotations(resource): From fcce66e0153cbbb1902fd6e48a65ef38c7ef68d1 Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Mon, 21 Nov 2016 13:55:38 -0800 Subject: [PATCH 10/12] using capsys to capture output for tests --- vision/api/label/snippets.py | 8 +++----- vision/api/label/snippets_test.py | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/vision/api/label/snippets.py b/vision/api/label/snippets.py index e56b18c4bd5..08713132f48 100644 --- a/vision/api/label/snippets.py +++ b/vision/api/label/snippets.py @@ -60,7 +60,7 @@ def crop_hint(photo_file): }) response = service_request.execute() - return response + print(json.dumps(response, indent=2)) def web_annotation(photo_file): @@ -70,7 +70,7 @@ def web_annotation(photo_file): with open(photo_file, 'rb') as image: image_content = base64.b64encode(image.read()) - + service_request = service.images().annotate(body={ 'requests': [{ 'image': { @@ -84,7 +84,7 @@ def web_annotation(photo_file): }) response = service_request.execute() - return response + print(json.dumps(response, indent=2)) if __name__ == '__main__': @@ -95,7 +95,5 @@ def web_annotation(photo_file): if args.command == 'crop_hint': response = crop_hint(args.image_file) - print(json.dumps(response, indent=2)) elif args.command == 'web_annotation': response = web_annotation(args.image_file) - print(json.dumps(response, indent=2)) diff --git a/vision/api/label/snippets_test.py b/vision/api/label/snippets_test.py index cffd6343f09..f11465605fe 100644 --- a/vision/api/label/snippets_test.py +++ b/vision/api/label/snippets_test.py @@ -15,16 +15,21 @@ # limitations under the License. +import json import snippets -def test_crop_hint_response_count(resource): - result = snippets.crop_hint(resource('cat.jpg')) +def test_crop_hint_response_count(capsys, resource): + snippets.crop_hint(resource('cat.jpg')) + stdout, _ = capsys.readouterr() + result = json.loads(stdout) assert len(result['responses']) == 1 -def test_crop_hint_response_dim(resource): - result = snippets.crop_hint(resource('cat.jpg')) +def test_crop_hint_response_dim(capsys, resource): + snippets.crop_hint(resource('cat.jpg')) + stdout, _ = capsys.readouterr() + result = json.loads(stdout) crop_hint = result['responses'][0] crop_hint_annotation = crop_hint['cropHintsAnnotation']['cropHints'][0] confidence = crop_hint_annotation['confidence'] @@ -32,8 +37,10 @@ def test_crop_hint_response_dim(resource): assert 0.5 < confidence < 0.9 -def test_web_annotations(resource): - result = snippets.web_annotation(resource('cat.jpg')) +def test_web_annotations(capsys, resource): + snippets.web_annotation(resource('cat.jpg')) + stdout, _ = capsys.readouterr() + result = json.loads(stdout) web_annotation = result['responses'][0]['webAnnotation'] web_entities = web_annotation['webEntities'] From f051cf82676e1adc8b280a1aa45a6c36235d668a Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Mon, 21 Nov 2016 17:35:15 -0800 Subject: [PATCH 11/12] fixed tests --- vision/api/label/snippets.py | 4 +++- vision/api/label/snippets_test.py | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/vision/api/label/snippets.py b/vision/api/label/snippets.py index 08713132f48..82b1ebbccd1 100644 --- a/vision/api/label/snippets.py +++ b/vision/api/label/snippets.py @@ -27,6 +27,7 @@ 'labels=TRUSTED_TESTER&version=v1' ) + def get_service(): """Get vision service using discovery.""" credentials = GoogleCredentials.get_application_default() @@ -40,6 +41,7 @@ def get_service(): discoveryServiceUrl=DISCOVERY_URL ) + def crop_hint(photo_file): """Run a crop hint request on the image.""" @@ -89,7 +91,7 @@ def web_annotation(photo_file): if __name__ == '__main__': parser = argparse.ArgumentParser() - parser.add_argument('command', choices=['crop_hint','web_annotation']) + parser.add_argument('command', choices=['crop_hint', 'web_annotation']) parser.add_argument('image_file', help='The image you\'d like to process.') args = parser.parse_args() diff --git a/vision/api/label/snippets_test.py b/vision/api/label/snippets_test.py index f11465605fe..f1a8c38552f 100644 --- a/vision/api/label/snippets_test.py +++ b/vision/api/label/snippets_test.py @@ -16,6 +16,7 @@ import json + import snippets @@ -45,5 +46,13 @@ def test_web_annotations(capsys, resource): web_entities = web_annotation['webEntities'] assert len(web_entities) == 10 - assert web_entities[0]['entityId'] == '/m/012cc2' - assert web_entities[0]['description'] == 'Russian Blue' + russian_blue = False + + for entity in web_entities: + entity_id = entity['entityId'] + desc = entity['description'] + + if entity_id == '/m/012cc2' and desc == 'Russian Blue': + russian_blue = True + + assert russian_blue is True From a82581341cbfb9781129868ff96dd12c4f37e205 Mon Sep 17 00:00:00 2001 From: Puneith Kaul Date: Mon, 21 Nov 2016 21:21:54 -0800 Subject: [PATCH 12/12] removed whitespace in blank line --- vision/api/label/snippets_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vision/api/label/snippets_test.py b/vision/api/label/snippets_test.py index f1a8c38552f..efa7f4e44fc 100644 --- a/vision/api/label/snippets_test.py +++ b/vision/api/label/snippets_test.py @@ -51,7 +51,7 @@ def test_web_annotations(capsys, resource): for entity in web_entities: entity_id = entity['entityId'] desc = entity['description'] - + if entity_id == '/m/012cc2' and desc == 'Russian Blue': russian_blue = True