
    "iw                        S SK rS SKrS SKJr  S SKJr  S SKJr  S SK	J
r
  S SKJrJrJrJr   S SKJr   S S
KJr  \R,                  " \5      rS rS rS rS rS rS r\" \" \S5      5       S$S j5       r\" \" \S5      5       S$S j5       r  S$S jr! S$S jr" S$S jr# S$S jr$\" \" \S5      5          S%S j5       r     S%S jr%    S%S jr&\" \" \S5      5       S$S j5       r' S$S jr( S$S jr)S r*\" \" \S5      5       S$S  j5       r+ S$S! jr, S$S" jr-g! \ a    S SKJr  S#S	 jr Nf = f! \ a    S r GNf = f)&    N)partial)ClientError)utils)is_append_mode)ProgressCallbackInvoker
S3TransferTransferConfigcreate_transfer_manager)with_current_contextwrapsc                     S nU$ )Nc                 0   ^  [        T 5      U 4S j5       nU$ )Nc                     > T" U 0 UD6$ N )argskwargsfuncs     N/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/boto3/s3/inject.pywrapper8with_current_context.<locals>.decorator.<locals>.wrapper#   s    T,V,,    r   )r   r   s   ` r   	decorator'with_current_context.<locals>.decorator"   s     4[- - Nr   r   )hookr   s     r   r   r   !   s    	 r   )register_feature_idc                     g r   r   )
feature_ids    r   r   r   0   s    r   c                    [         R                  " U S[        5        [         R                  " U S[        5        [         R                  " U S[        5        [         R                  " U S[
        5        [         R                  " U S[        5        g Nupload_filedownload_filecopyupload_fileobjdownload_fileobj)r   inject_attributer"   r#   r$   r%   r&   class_attributesr   s     r   inject_s3_transfer_methodsr*   7   sf    	+]KH	+_mL	+VT:	+-=~N	,.>r   c                 T   [         R                  " U S[        5        [         R                  " U S[        5        [         R                  " U S[        5        [         R                  " U S[
        5        [         R                  " U S[        5        [         R                  " U S[        5        g )Nloadr"   r#   r$   r%   r&   )r   r'   bucket_loadbucket_upload_filebucket_download_filebucket_copybucket_upload_fileobjbucket_download_fileobjr(   s     r   inject_bucket_methodsr3   A   s    	+V[A	+]<NO	/+? 
+V[A	*,A 
,.Er   c                    [         R                  " U S[        5        [         R                  " U S[        5        [         R                  " U S[        5        [         R                  " U S[
        5        [         R                  " U S[        5        g r!   )r   r'   object_upload_fileobject_download_fileobject_copyobject_upload_fileobjobject_download_fileobjr(   s     r   inject_object_methodsr:   P   sq    	+]<NO	/+? 
+V[A	*,A 
,.Er   c                 <    [         R                  " U S[        5        g )Nr,   )r   r'   object_summary_loadr(   s     r   inject_object_summary_methodsr=   ^   s    	+V5HIr   c                 `   0 U R                   l         U R                   R                  R                  5       nUS    H(  nUS   U R                  :X  d  M  X@R                   l          g   g! [
         a:  nUR                  R                  S0 5      R                  S5      S:X  d  e  SnAgSnAff = f)zQ
Calls s3.Client.list_buckets() to update the attributes of the Bucket
resource.
BucketsNameErrorCodeAccessDeniedN)metadataclientlist_bucketsnamer   responseget)selfr   r   rI   bucket_dataes         r   r-   r-   b   s     DIIN99##002#I.K6"dii/!,		 /  zz~~gr*..v6.H Is#   =A) A) &A) )
B-30B((B-c                     U R                   R                  R                  U R                  U R                  S9nSU;   a  UR                  S5      US'   X0R                   l        g)zU
Calls s3.Client.head_object to update the attributes of the ObjectSummary
resource.
)BucketKeyContentLengthSizeN)rD   rF   head_objectbucket_namekeypoprE   )rK   r   r   rI   s       r   r<   r<   {   sX    
 yy++TXX , H ("#<<8IINr   S3_TRANSFERc           	      t    [        X5       nUR                  UUUUUS9sSSS5        $ ! , (       d  f       g= f)a  Upload a file to an S3 object.

Usage::

    import boto3
    s3 = boto3.client('s3')
    s3.upload_file('/tmp/hello.txt', 'amzn-s3-demo-bucket', 'hello.txt')

Similar behavior as S3Transfer's upload_file() method, except that
argument names are capitalized. Detailed examples can be found at
:ref:`S3Transfer's Usage <ref_s3transfer_usage>`.

:type Filename: str
:param Filename: The path to the file to upload.

:type Bucket: str
:param Bucket: The name of the bucket to upload to.

:type Key: str
:param Key: The name of the key to upload to.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed upload arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the upload.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    transfer.
)filenamebucketrU   
extra_argscallbackN)r   r"   )rK   FilenamerO   rP   	ExtraArgsCallbackConfigtransfers           r   r"   r"      s=    L 
D	!X##  $ 
 
"	!	!   )
7c           	      t    [        X5       nUR                  UUUUUS9sSSS5        $ ! , (       d  f       g= f)a  Download an S3 object to a file.

Usage::

    import boto3
    s3 = boto3.client('s3')
    s3.download_file('amzn-s3-demo-bucket', 'hello.txt', '/tmp/hello.txt')

Similar behavior as S3Transfer's download_file() method,
except that parameters are capitalized. Detailed examples can be found at
:ref:`S3Transfer's Usage <ref_s3transfer_usage>`.

:type Bucket: str
:param Bucket: The name of the bucket to download from.

:type Key: str
:param Key: The name of the key to download from.

:type Filename: str
:param Filename: The path to the file to download to.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed download arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the download.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    transfer.
)rZ   rU   rY   r[   r\   N)r   r#   )rK   rO   rP   r]   r^   r_   r`   ra   s           r   r#   r#      s=    L 
D	!X%%  & 
 
"	!	!rb   c           	      f    U R                   R                  R                  UU R                  UUUUS9$ )a  Upload a file to an S3 object.

Usage::

    import boto3
    s3 = boto3.resource('s3')
    s3.Bucket('amzn-s3-demo-bucket').upload_file('/tmp/hello.txt', 'hello.txt')

Similar behavior as S3Transfer's upload_file() method,
except that parameters are capitalized. Detailed examples can be found at
:ref:`S3Transfer's Usage <ref_s3transfer_usage>`.

:type Filename: str
:param Filename: The path to the file to upload.

:type Key: str
:param Key: The name of the key to upload to.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed upload arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the upload.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    transfer.
r]   rO   rP   r^   r_   r`   )rD   rF   r"   rH   )rK   r]   rP   r^   r_   r`   s         r   r.   r.      s=    D 99''yy (  r   c           	      f    U R                   R                  R                  U R                  UUUUUS9$ )a  Download an S3 object to a file.

Usage::

    import boto3
    s3 = boto3.resource('s3')
    s3.Bucket('amzn-s3-demo-bucket').download_file('hello.txt', '/tmp/hello.txt')

Similar behavior as S3Transfer's download_file() method,
except that parameters are capitalized. Detailed examples can be found at
:ref:`S3Transfer's Usage <ref_s3transfer_usage>`.

:type Key: str
:param Key: The name of the key to download from.

:type Filename: str
:param Filename: The path to the file to download to.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed download arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the download.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    transfer.
rO   rP   r]   r^   r_   r`   )rD   rF   r#   rH   )rK   rP   r]   r^   r_   r`   s         r   r/   r/     s=    D 99))yy *  r   c           	      z    U R                   R                  R                  UU R                  U R                  UUUS9$ )a  Upload a file to an S3 object.

Usage::

    import boto3
    s3 = boto3.resource('s3')
    s3.Object('amzn-s3-demo-bucket', 'hello.txt').upload_file('/tmp/hello.txt')

Similar behavior as S3Transfer's upload_file() method,
except that parameters are capitalized. Detailed examples can be found at
:ref:`S3Transfer's Usage <ref_s3transfer_usage>`.

:type Filename: str
:param Filename: The path to the file to upload.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed upload arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the upload.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    transfer.
re   )rD   rF   r"   rT   rU   rK   r]   r^   r_   r`   s        r   r5   r5   @  sB    > 99''HH (  r   c           	      z    U R                   R                  R                  U R                  U R                  UUUUS9$ )a  Download an S3 object to a file.

Usage::

    import boto3
    s3 = boto3.resource('s3')
    s3.Object('amzn-s3-demo-bucket', 'hello.txt').download_file('/tmp/hello.txt')

Similar behavior as S3Transfer's download_file() method,
except that parameters are capitalized. Detailed examples can be found at
:ref:`S3Transfer's Usage <ref_s3transfer_usage>`.

:type Filename: str
:param Filename: The path to the file to download to.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed download arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the download.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    transfer.
rg   )rD   rF   r#   rT   rU   ri   s        r   r6   r6   i  sB    > 99))HH *  r   c           
         SnUb  [        U5      /nUn	U	c
  [        5       n	[        R                  " U	5      n
SU
l        [        X
5       nUR                  UUUUUUS9nUR                  5       sSSS5        $ ! , (       d  f       g= f)a  Copy an object from one S3 location to another.

This is a managed transfer which will perform a multipart copy in
multiple threads if necessary.

Usage::

    import boto3
    s3 = boto3.resource('s3')
    copy_source = {
        'Bucket': 'amzn-s3-demo-bucket1',
        'Key': 'mykey'
    }
    s3.meta.client.copy(copy_source, 'amzn-s3-demo-bucket2', 'otherkey')

:type CopySource: dict
:param CopySource: The name of the source bucket, key name of the
    source object, and optional version ID of the source object. The
    dictionary format is:
    ``{'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}``. Note
    that the ``VersionId`` key is optional and may be omitted.

:type Bucket: str
:param Bucket: The name of the bucket to copy to

:type Key: str
:param Key: The name of the key to copy to

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed copy arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_COPY_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the copy.

:type SourceClient: botocore or boto3 Client
:param SourceClient: The client to be used for operations that
    may happen at the source object. For example, this client is
    used for the head_object that determines the size of the copy.
    If no client is provided, the current client is used as the
    client for the source object.  The current client still
    requires IAM permissions to access both buckets.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    copy.
Nclassic)copy_sourcerZ   rU   r[   subscriberssource_client)r   r	   python_copyr$   preferred_transfer_clientr
   result)rK   
CopySourcerO   rP   r^   r_   SourceClientr`   rn   config
new_configmanagerfutures                r   r$   r$     s    x K.x89F~! !!&)J+4J(	 	2g" #&  
 }} 
3	2	2s   	$A77
Bc           
      h    U R                   R                  R                  UU R                  UUUUUS9$ )a  Copy an object from one S3 location to an object in this bucket.

This is a managed transfer which will perform a multipart copy in
multiple threads if necessary.

Usage::

    import boto3
    s3 = boto3.resource('s3')
    copy_source = {
        'Bucket': 'amzn-s3-demo-bucket1',
        'Key': 'mykey'
    }
    bucket = s3.Bucket('amzn-s3-demo-bucket2')
    bucket.copy(copy_source, 'otherkey')

:type CopySource: dict
:param CopySource: The name of the source bucket, key name of the
    source object, and optional version ID of the source object. The
    dictionary format is:
    ``{'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}``. Note
    that the ``VersionId`` key is optional and may be omitted.

:type Key: str
:param Key: The name of the key to copy to

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed copy arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_COPY_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the copy.

:type SourceClient: botocore or boto3 Client
:param SourceClient: The client to be used for operations that
    may happen at the source object. For example, this client is
    used for the head_object that determines the size of the copy.
    If no client is provided, the current client is used as the
    client for the source object.  The current client still
    requires IAM permissions to access both buckets.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    copy.
rs   rO   rP   r^   r_   rt   r`   )rD   rF   r$   rH   )rK   rs   rP   r^   r_   rt   r`   s          r   r0   r0     s@    p 99  yy! !  r   c           
      |    U R                   R                  R                  UU R                  U R                  UUUUS9$ )aL  Copy an object from one S3 location to this object.

This is a managed transfer which will perform a multipart copy in
multiple threads if necessary.

Usage::

    import boto3
    s3 = boto3.resource('s3')
    copy_source = {
        'Bucket': 'amzn-s3-demo-bucket1',
        'Key': 'mykey'
    }
    bucket = s3.Bucket('amzn-s3-demo-bucket2')
    obj = bucket.Object('otherkey')
    obj.copy(copy_source)

:type CopySource: dict
:param CopySource: The name of the source bucket, key name of the
    source object, and optional version ID of the source object. The
    dictionary format is:
    ``{'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}``. Note
    that the ``VersionId`` key is optional and may be omitted.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed copy arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_COPY_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the copy.

:type SourceClient: botocore or boto3 Client
:param SourceClient: The client to be used for operations that
    may happen at the source object. For example, this client is
    used for the head_object that determines the size of the copy.
    If no client is provided, the current client is used as the
    client for the source object.  The current client still
    requires IAM permissions to access both buckets.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    copy.
rz   )rD   rF   r$   rT   rU   )rK   rs   r^   r_   rt   r`   s         r   r7   r7   )  sF    j 99  HH! !  r   c           	         [        US5      (       d  [        S5      eSnUb  [        U5      /nUnUc
  [        5       n[	        X5       n	U	R                  UUUUUS9n
U
R                  5       sSSS5        $ ! , (       d  f       g= f)aW  Upload a file-like object to S3.

The file-like object must be in binary mode.

This is a managed transfer which will perform a multipart upload in
multiple threads if necessary.

Usage::

    import boto3
    s3 = boto3.client('s3')

    with open('filename', 'rb') as data:
        s3.upload_fileobj(data, 'amzn-s3-demo-bucket', 'mykey')

:type Fileobj: a file-like object
:param Fileobj: A file-like object to upload. At a minimum, it must
    implement the `read` method, and must return bytes.

:type Bucket: str
:param Bucket: The name of the bucket to upload to.

:type Key: str
:param Key: The name of the key to upload to.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed upload arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the upload.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    upload.
readzFileobj must implement readN)fileobjrZ   rU   r[   rn   )hasattr
ValueErrorr   r	   r
   uploadrr   )rK   FileobjrO   rP   r^   r_   r`   rn   ru   rw   rx   s              r   r%   r%   i  s    T 7F##677K.x89F~!	 	.' #   
 }} 
/	.	.s   #A55
Bc           	      f    U R                   R                  R                  UU R                  UUUUS9$ )a6  Upload a file-like object to this bucket.

The file-like object must be in binary mode.

This is a managed transfer which will perform a multipart upload in
multiple threads if necessary.

Usage::

    import boto3
    s3 = boto3.resource('s3')
    bucket = s3.Bucket('amzn-s3-demo-bucket')

    with open('filename', 'rb') as data:
        bucket.upload_fileobj(data, 'mykey')

:type Fileobj: a file-like object
:param Fileobj: A file-like object to upload. At a minimum, it must
    implement the `read` method, and must return bytes.

:type Key: str
:param Key: The name of the key to upload to.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed upload arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the upload.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    upload.
r   rO   rP   r^   r_   r`   )rD   rF   r%   rH   )rK   r   rP   r^   r_   r`   s         r   r1   r1     s=    N 99**yy +  r   c           	      z    U R                   R                  R                  UU R                  U R                  UUUS9$ )a  Upload a file-like object to this object.

The file-like object must be in binary mode.

This is a managed transfer which will perform a multipart upload in
multiple threads if necessary.

Usage::

    import boto3
    s3 = boto3.resource('s3')
    bucket = s3.Bucket('amzn-s3-demo-bucket')
    obj = bucket.Object('mykey')

    with open('filename', 'rb') as data:
        obj.upload_fileobj(data)

:type Fileobj: a file-like object
:param Fileobj: A file-like object to upload. At a minimum, it must
    implement the `read` method, and must return bytes.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed upload arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the upload.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    upload.
r   )rD   rF   r%   rT   rU   rK   r   r^   r_   r`   s        r   r8   r8     sC    J 99**HH +  r   c                 ^    [        U5      (       a  SU l        [        R                  S5        gg)a@  Set `TransferConfig.use_threads` to `False` if file-like
    object is in append mode.

:type config: boto3.s3.transfer.TransferConfig
:param config: The transfer configuration to be used when performing the
    download.

:type fileobj: A file-like object
:param fileobj: A file-like object to inspect for append mode.
FzA single thread will be used because the provided file object is in append mode. Writes may always be appended to the end of the file regardless of seek position, so a single thread must be used to ensure sequential writes.N)r   use_threadsloggerwarning)ru   r~   s     r    disable_threading_if_append_moder   	  s-     g"0	
 r   c           	      N   [        US5      (       d  [        S5      eSnUb  [        U5      /nUnUc
  [        5       n[        R
                  " U5      n	[        X5        [        X	5       n
U
R                  UUUUUS9nUR                  5       sSSS5        $ ! , (       d  f       g= f)a  Download an object from S3 to a file-like object.

The file-like object must be in binary mode.

This is a managed transfer which will perform a multipart download in
multiple threads if necessary.

Usage::

    import boto3
    s3 = boto3.client('s3')

    with open('filename', 'wb') as data:
        s3.download_fileobj('amzn-s3-demo-bucket', 'mykey', data)

:type Bucket: str
:param Bucket: The name of the bucket to download from.

:type Key: str
:param Key: The name of the key to download from.

:type Fileobj: a file-like object
:param Fileobj: A file-like object to download into. At a minimum, it must
    implement the `write` method and must accept bytes.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed download arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the download.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    download.
writezFileobj must implement writeN)rZ   rU   r~   r[   rn   )
r   r   r   r	   rp   r$   r   r
   downloadrr   )rK   rO   rP   r   r^   r_   r`   rn   ru   rv   rw   rx   s               r   r&   r&     s    T 7G$$788K.x89F~!!!&)J$Z9	 	2g!! # " 
 }} 
3	2	2s   )#B
B$c           	      f    U R                   R                  R                  U R                  UUUUUS9$ )a^  Download an object from this bucket to a file-like-object.

The file-like object must be in binary mode.

This is a managed transfer which will perform a multipart download in
multiple threads if necessary.

Usage::

    import boto3
    s3 = boto3.resource('s3')
    bucket = s3.Bucket('amzn-s3-demo-bucket')

    with open('filename', 'wb') as data:
        bucket.download_fileobj('mykey', data)

:type Fileobj: a file-like object
:param Fileobj: A file-like object to download into. At a minimum, it must
    implement the `write` method and must accept bytes.

:type Key: str
:param Key: The name of the key to download from.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed download arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the download.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    download.
rO   rP   r   r^   r_   r`   )rD   rF   r&   rH   )rK   rP   r   r^   r_   r`   s         r   r2   r2   a  s=    N 99,,yy -  r   c           	      z    U R                   R                  R                  U R                  U R                  UUUUS9$ )a*  Download this object from S3 to a file-like object.

The file-like object must be in binary mode.

This is a managed transfer which will perform a multipart download in
multiple threads if necessary.

Usage::

    import boto3
    s3 = boto3.resource('s3')
    bucket = s3.Bucket('amzn-s3-demo-bucket')
    obj = bucket.Object('mykey')

    with open('filename', 'wb') as data:
        obj.download_fileobj(data)

:type Fileobj: a file-like object
:param Fileobj: A file-like object to download into. At a minimum, it must
    implement the `write` method and must accept bytes.

:type ExtraArgs: dict
:param ExtraArgs: Extra arguments that may be passed to the
    client operation. For allowed download arguments see
    :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS`.

:type Callback: function
:param Callback: A method which takes a number of bytes transferred to
    be periodically called during the download.

:type Config: boto3.s3.transfer.TransferConfig
:param Config: The transfer configuration to be used when performing the
    download.
r   )rD   rF   r&   rT   rU   r   s        r   r9   r9     sC    J 99,,HH -  r   r   )NNN)NNNN).r$   rp   logging	functoolsr   botocore.exceptionsr   boto3r   boto3.compatr   boto3.s3.transferr   r   r	   r
   botocore.contextr   ImportErrorr   botocore.useragentr   	getLogger__name__r   r*   r3   r:   r=   r-   r<   r"   r#   r.   r/   r5   r6   r0   r7   r%   r1   r8   r   r&   r2   r9   r   r   r   <module>r      s      +  ' 56 
		8	$J2
 g1=ABGK,
 C,
^ g1=ABGK,
 C,
` @D)Z @D)Z ;?&T ;?&R g1=AB P CPn @L =@ g1=ABFJ< C<@ ?C.d :>,^
* g1=ABFJ? C?F ?C.d :>,i     s"   D  D7  D43D47	EE