Created
January 19, 2017 21:01
-
-
Save daspecster/a59f15324f9d353343fc137b3c451bda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# non-ternary; fails coverage | |
def _make_image_properties_from_pb(image_properties): | |
"""Create ``ImageProperties`` object from a protobuf response. | |
:type image_properties: :class:`~google.cloud.grpc.vision.v1.\ | |
image_annotator_pb2.ImagePropertiesAnnotation` | |
:param image_properties: Protobuf instance of | |
``ImagePropertiesAnnotation``. | |
:rtype: list | |
:returns: List of ``ImageProperties``. | |
""" | |
properties = ImagePropertiesAnnotation.from_pb(image_properties) | |
if properties is not None: | |
return [properties] | |
# ternary; passes coverage | |
def _make_image_properties_from_pb(image_properties): | |
"""Create ``ImageProperties`` object from a protobuf response. | |
:type image_properties: :class:`~google.cloud.grpc.vision.v1.\ | |
image_annotator_pb2.ImagePropertiesAnnotation` | |
:param image_properties: Protobuf instance of | |
``ImagePropertiesAnnotation``. | |
:rtype: list | |
:returns: List of ``ImageProperties``. | |
""" | |
properties = ImagePropertiesAnnotation.from_pb(image_properties) | |
return [properties] if properties else None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment