+
    i                         ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
 ^ RIHtHt ^ RIHtHtHt ^ RIHt ] P&                  ! ]4      t ! R	 R
]4      tR tR# )    N)IOBase)ProtocolError)ReadTimeoutError)ScalarTypesparsers)XMLParseErrorset_socket_timeout)IncompleteReadErrorr   ResponseStreamingError)first_non_none_responsec                      a  ] tR t^'t o RtRtR tR tR tR t	RR lt
R	 tR
 tR tR tR tR t]t]R3R lt]3R ltR tR tR tRtV tR# )StreamingBodyaI  Wrapper class for an http response body.

This provides a few additional conveniences that do not exist
in the urllib3 model:

    * Set the timeout on the socket (i.e read() timeouts)
    * Auto validation of content length, if the amount of bytes
      we read does not match the content length, an exception
      is raised.

i   c                ,    Wn         W n        ^ V n        R# )r   N)_raw_stream_content_length_amount_read)self
raw_streamcontent_lengths   &&&3/usr/lib/python3/dist-packages/botocore/response.py__init__StreamingBody.__init__6   s    %-    c                    R # N r   s   &r   __del__StreamingBody.__del__;   s     	r   c                ~     \        V P                  V4       R#   \         d    \        P	                  R4       h i ; i)z&Set the timeout seconds on the socket.zaCannot access the socket object of a streaming response. It's possible the interface has changed.N)r	   r   AttributeErrorlogger	exception)r   timeouts   &&r   r	    StreamingBody.set_socket_timeoutA   s>    	t//9 	; 	s    "<c                \     V P                   P                  4       #   \         d     R # i ; i)F)r   readabler!   r   s   &r   r'   StreamingBody.readableV   s.    	##,,.. 		s    ++Nc                P    V P                   P                  V4      pT ;P                  \        T4      ,          un        Te   T'       g   T^ 8  d   T P                  4        T#   \         d   p\        TP                  TR7      hRp?i\
         d   p\        TR7      hRp?ii ; i)zXRead at most amt bytes from the stream.

If the amt argument is omitted, read all data.
endpoint_urlerrorNr,   )
r   readURLLib3ReadTimeoutErrorr   urlURLLib3ProtocolErrorr   r   len_verify_content_length)r   amtchunkes   &&  r   r.   StreamingBody.read\   s    
	2$$))#.E 	SZ';uq '') ' 	@"Q??# 	2(q11	2s)   A$ $B%/BB%B%B  B%c                F    V P                   P                  V4      pT ;P                  T,          un        T^ 8X  d!   \        T4      ^ 8  d   T P                  4        T#   \         d   p\        TP                  TR7      hRp?i\
         d   p\        TR7      hRp?ii ; i)zcRead bytes into a pre-allocated, writable bytes-like object b, and return the number of bytes read.r*   Nr-   )
r   readintor/   r   r0   r1   r   r   r2   r3   )r   bamount_readr6   s   &&  r   r9   StreamingBody.readintop   s    	2**33A6K 	[(!A
 '') ' 	@"Q??# 	2(q11	2s)   A B *BB B BB c                6    V P                   P                  4       # r   )r   	readlinesr   s   &r   r>   StreamingBody.readlines   s    ))++r   c                8    V P                  V P                  4      # )z:Return an iterator to yield 1k chunks from the raw stream.)iter_chunks_DEFAULT_CHUNK_SIZEr   s   &r   __iter__StreamingBody.__iter__   s     8 899r   c                `    V P                  V P                  4      pV'       d   V# \        4       h)z-Return the next 1k chunk from the raw stream.)r.   rB   StopIteration)r   current_chunks   & r   __next__StreamingBody.__next__   s'    		$":":;  or   c                    V P                   # r   )r   r   s   &r   	__enter__StreamingBody.__enter__   s    r   c                :    V P                   P                  4        R # r   r   close)r   typevalue	tracebacks   &&&&r   __exit__StreamingBody.__exit__   s     r   Fc              #    "   RpV P                  V4       FI  pW4,           P                  R4      pVRR  F  pVP                  V4      ^ ,          x  K  	  VR,          pKK  	  V'       d   VP                  V4      ^ ,          x  R# R# 5i)zReturn an iterator to yield lines from the raw stream.

This is achieved by reading chunk of bytes (of size chunk_size) at a
time from the raw stream, and then yielding lines from there.
r   TN)rA   
splitlines)r   
chunk_sizekeependspendingr5   lineslines   &&&    r   
iter_linesStreamingBody.iter_lines   s      %%j1E_006Ecr
ooh/22 #BiG	 2
 $$X.q11 s   A(B	+B	c              #  L   "    V P                  V4      pVR8X  d   R# Vx  K!  5i)zLReturn an iterator to yield chunks of chunk_size bytes from the raw
stream.
r   N)r.   )r   rX   rG   s   && r   rA   StreamingBody.iter_chunks   s)       IIj1M#s   "$c                    V P                   eQ   V P                  \        V P                   4      8w  d+   \        V P                  \        V P                   4      R7      hR # R # )N)actual_bytesexpected_bytes)r   r   intr
   r   s   &r   r3   $StreamingBody._verify_content_length   s\     +0A0AS  F
 1
 &!.."4#7#78 1
+r   c                6    V P                   P                  4       # r   )r   tellr   s   &r   rg   StreamingBody.tell   s    $$&&r   c                :    V P                   P                  4        R# )z*Close the underlying http response stream.NrN   r   s   &r   rO   StreamingBody.close   s     r   )r   r   r   r   )__name__
__module____qualname____firstlineno____doc__rB   r   r   r	   r'   r.   r9   r>   rC   rH   rK   rS   nextr]   rA   r3   rg   rO   __static_attributes____classdictcell__)__classdict__s   @r   r   r   '   sx     
 
*( ,: ! D$7% 2 &9  
'! !r   r   c                    V P                   P                  pR VP                  RVP                  /pVR,          R8  d   VP                  VR&   MQV P
                  '       d1   \        VP                  VR ,          P                  R4      4      VR&   MVP                  VR&   \        P                  ! V4      pWP                  W0P                  4      3# )headersstatus_codei,  bodyzcontent-length)service_modelresolved_protocolru   rv   contenthas_streaming_outputr   rawgetr   create_parserparseoutput_shape)operation_modelhttp_responseprotocolresponse_dictparsers   &&   r   get_responser      s    ,,>>H=((}00M ]#s* - 5 5f		-	-	- -}Y7;;<LM!
f !. 5 5f""8,F,,33  r   )loggingior   urllib3.exceptionsr   r1   r   r/   botocorer   r   botocore.compatr   r	   botocore.exceptionsr
   r   botocore.hooksr   	getLoggerrk   r"   r   r   r   r   r   <module>r      sP      D J 
 3			8	$Y!F Y!xr   