
    Eh6                     :    d dl mZ d dlmZ d dlZ G d de      Zy)    )absolute_import)protobuf_helpersNc                   &    e Zd ZdZdddddZd Zy)VisionHelpersa!  A set of convenience methods to make the Vision GAPIC easier to use.

    This class should be considered abstract; it is used as a superclass
    in a multiple-inheritance construction alongside the applicable GAPIC.
    See the :class:`~google.cloud.vision_v1.ImageAnnotatorClient`.
    N )retrytimeoutmetadatac                h   t        |t        j                        st        j                  |d      }t        |t        j                        st        |d      rT|j                         }t        j                  |di        t        j                  |d|       t        j                  |d      }t        j                  |dd      }|rQt        |d      5 }t        j                  |d|j                                t        j                  |dd       ddd       t        |t        j                        s&t        j                  |d	| j                                n-t        |j                        d
k(  r| j                         |_        | j                  |g|||      }	|	j                  d
   S # 1 sw Y   xY w)a  Run image detection and annotation for an image.

        Example:
            >>> from google.cloud.vision_v1 import ImageAnnotatorClient
            >>> client = ImageAnnotatorClient()
            >>> request = {
            ...     'image': {
            ...         'source': {'image_uri': 'https://foo.com/image.jpg'},
            ...     },
            ... }
            >>> response = client.annotate_image(request)

        Args:
            request (:class:`~.vision_v1.AnnotateImageRequest`)
            retry (google.api_core.retry.Retry): Designation of what errors, if any,
                should be retried.
            timeout (float): The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            :class:`~.vision_v1.AnnotateImageResponse` The API response.
        imagereadzimage.contentzsource.filenameN)defaultrbzimage.sourcefeaturesr   )requestsr   r	   r
   )
isinstanceprotoMessageprotobufgethasattrr   setopen
setdefault_get_all_featureslenr   batch_annotate_images	responses)
selfrequestr   r	   r
   r   	img_bytesfilenameimg_filers
             /home/developers/rajanand/mypropertyqr-fmb-refixing-v2/venv/lib/python3.12/site-packages/google/cloud/vision_helpers/__init__.pyannotate_imagezVisionHelpers.annotate_image   sW   0 '5==1LL'2EeU]]35&) %

ILL'26LL/9E$LL':E $<</@$Oh- D Wox}}O WndCD '5==1T5K5K5MN!!"a'#557G&&YeWx ' 
 {{1~D Ds   =F((F1c                 d    | j                   j                  D cg c]  }|dk7  s	d|i c}S c c}w )zmReturn a list of all features.

        Returns:
            list: A list of all available features.
        r   type_)FeatureType)r   features     r%   r   zVisionHelpers._get_all_featuresQ   s.     37,,2C2CTwwRS|'"TTTs   
--)__name__
__module____qualname____doc__r&   r   r       r%   r   r      s     04TB 2hUr0   r   )
__future__r   google.api_corer   r   r   objectr   r   r0   r%   <module>r4      s     ' 8 BUF BUr0   