Skip to content

Commit 0aa5220

Browse files
committed
Rename safe module to safe_search.
1 parent 4b54e1c commit 0aa5220

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

docs/vision-safe-search.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Vision Safe Search
44
Safe Search Annotation
55
~~~~~~~~~~~~~~~~~~~~~~
66

7-
.. automodule:: google.cloud.vision.safe
7+
.. automodule:: google.cloud.vision.safe_search
88
:members:
99
:undoc-members:
1010
:show-inheritance:

system_tests/vision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def tearDown(self):
355355
value.delete()
356356

357357
def _assert_safe_search(self, safe_search):
358-
from google.cloud.vision.safe import SafeSearchAnnotation
358+
from google.cloud.vision.safe_search import SafeSearchAnnotation
359359

360360
self.assertIsInstance(safe_search, SafeSearchAnnotation)
361361
self._assert_likelihood(safe_search.adult)

vision/google/cloud/vision/annotations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from google.cloud.vision.color import ImagePropertiesAnnotation
2020
from google.cloud.vision.entity import EntityAnnotation
2121
from google.cloud.vision.face import Face
22-
from google.cloud.vision.safe import SafeSearchAnnotation
22+
from google.cloud.vision.safe_search import SafeSearchAnnotation
2323

2424

2525
_FACE_ANNOTATIONS = 'faceAnnotations'
@@ -61,7 +61,7 @@ class Annotations(object):
6161
6262
:type safe_searches: list
6363
:param safe_searches:
64-
List of :class:`~google.cloud.vision.safe.SafeSearchAnnotation`
64+
List of :class:`~google.cloud.vision.safe_search.SafeSearchAnnotation`
6565
6666
:type texts: list
6767
:param texts: List of
@@ -179,7 +179,7 @@ def _make_safe_search_from_pb(safe_search):
179179
image_annotator_pb2.SafeSearchAnnotation`
180180
:param safe_search: Protobuf instance of ``SafeSearchAnnotation``.
181181
182-
:rtype: :class: `~google.cloud.vision.safe.SafeSearchAnnotation`
182+
:rtype: :class: `~google.cloud.vision.safe_search.SafeSearchAnnotation`
183183
:returns: Instance of ``SafeSearchAnnotation``.
184184
"""
185185
return SafeSearchAnnotation.from_pb(safe_search)
@@ -195,7 +195,7 @@ def _entity_from_response_type(feature_type, results):
195195
196196
or one of
197197
198-
:class:`~google.cloud.vision.safe.SafeSearchAnnotation`,
198+
:class:`~google.cloud.vision.safe_search.SafeSearchAnnotation`,
199199
:class:`~google.cloud.vision.color.ImagePropertiesAnnotation`.
200200
"""
201201
detected_objects = []
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def from_api_repr(cls, response):
5151
:param response: Dictionary response from Vision API with safe search
5252
data.
5353
54-
:rtype: :class:`~google.cloud.vision.safe.SafeSearchAnnotation`
54+
:rtype: :class:`~google.cloud.vision.safe_search.SafeSearchAnnotation`
5555
:returns: Instance of ``SafeSearchAnnotation``.
5656
"""
5757
adult_likelihood = Likelihood[response['adult']]
@@ -70,7 +70,7 @@ def from_pb(cls, image):
7070
SafeSearchAnnotation`
7171
:param image: Protobuf response from Vision API with safe search data.
7272
73-
:rtype: :class:`~google.cloud.vision.safe.SafeSearchAnnotation`
73+
:rtype: :class:`~google.cloud.vision.safe_search.SafeSearchAnnotation`
7474
:returns: Instance of ``SafeSearchAnnotation``.
7575
"""
7676
values = [image.adult, image.spoof, image.medical, image.violence]

vision/unit_tests/test_annotations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_ctor(self):
6868

6969
def test_from_pb(self):
7070
from google.cloud.vision.likelihood import Likelihood
71-
from google.cloud.vision.safe import SafeSearchAnnotation
71+
from google.cloud.vision.safe_search import SafeSearchAnnotation
7272
from google.cloud.grpc.vision.v1 import image_annotator_pb2
7373

7474
image_response = image_annotator_pb2.AnnotateImageResponse()

vision/unit_tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def test_text_detection_from_source(self):
410410

411411
def test_safe_search_detection_from_source(self):
412412
from google.cloud.vision.likelihood import Likelihood
413-
from google.cloud.vision.safe import SafeSearchAnnotation
413+
from google.cloud.vision.safe_search import SafeSearchAnnotation
414414
from unit_tests._fixtures import SAFE_SEARCH_DETECTION_RESPONSE
415415

416416
RETURNED = SAFE_SEARCH_DETECTION_RESPONSE
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class TestSafeSearchAnnotation(unittest.TestCase):
1919
@staticmethod
2020
def _get_target_class():
21-
from google.cloud.vision.safe import SafeSearchAnnotation
21+
from google.cloud.vision.safe_search import SafeSearchAnnotation
2222
return SafeSearchAnnotation
2323

2424
def test_safe_search_annotation(self):

0 commit comments

Comments
 (0)