def _to_gapic_image(image):
 if (image.content is not None):
  return image_annotator_pb2.Image(content=image.content)
 if (image.source is not None):
  return image_annotator_pb2.Image(source=image_annotator_pb2.ImageSource(gcs_image_uri=image.source))
 raise ValueError('No image content or source found.')

def _to_gapic_image ( image ) : if ( image . content is not None ) : return image_annotator_pb2 . Image ( content = image . content ) if ( image . source is not None ) : return image_annotator_pb2 . Image ( source = image_annotator_pb2 . ImageSource ( gcs_image_uri = image . source ) ) raise ValueError ( 'No image content or source found.' )
helper function to convert an image to a grpc image .