Your IP : 216.73.216.134


Current Path : /opt/rh/rh-python35/root/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/rh/rh-python35/root/lib64/python3.5/__pycache__/pickle.cpython-35.opt-1.pyc



���\���@s�dZddlmZddlmZddlmZmZmZddlm	Z	ddl
Z
ddl
mZddlm
Z
mZddlZddlZddlZddlZd	d
ddd
ddddg	ZeefZdZdddddddgZdZdZGdd	�d	e�ZGdd
�d
e�ZGdd�de�ZGdd�de�Zydd l m!Z!Wne"k
r�dZ!YnXd!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Z<d;Z=d<Z>d=Z?d>Z@d?ZAd@ZBdAZCdBZDdCZEdDZFdEZGdFZHdGZIdHZJdIZKdJZLdKZMdLZNdMZOdNZPdOZQdPZRdQZSdRZTdSZUdTZVdUZWdVZXdWZYeIeSeTeUgZZdXZ[dYZ\dZZ]d[Z^d\Z_d]Z`d^Zad_Zbd`ZcdaZddbZedcZfejgddde�eh�D��Gdfdg�dg�ZiGdhdi�di�Zjdjdk�Zkdldm�Zldndo�Zmdpdq�ZnGdrds�ds�ZoGdtdu�du�Zpddvdwdxdy�Zqddvdwdzd{�Zrdvdwd|d}d~dd�d��Zsdvdwd|d}d~dd�d��ZtyDdd�lumZmZmZmvZvmwZwmxZxmyZymzZzm{Z{WnBe"k
r�eoepf\ZvZweqeresetf\ZxZyZzZ{YnXd�d��Z|e}d�kr�ddl~Z~e~jd�d��Z�e�j�d�d�e~j�d��d�d�d�d��e�j�d�d�d�d�d�d��e�j�d�d�d�d�d��e�j��Z�e�j�rse|�nPe�j�r�e�j��n9ddl�Z�x*e�j�D]Z�eze��Z�e�j�e��q�WdS)�a�Create portable serialized representations of Python objects.

See module copyreg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.

Classes:

    Pickler
    Unpickler

Functions:

    dump(object, file)
    dumps(object) -> string
    load(file) -> object
    loads(string) -> object

Misc variables:

    __version__
    format_version
    compatible_formats

�)�FunctionType)�dispatch_table)�_extension_registry�_inverted_registry�_extension_cache)�isliceN)�maxsize)�pack�unpack�PickleError�
PicklingError�UnpicklingError�Pickler�	Unpickler�dump�dumps�load�loadsz4.0z1.0z1.1z1.2z1.3z2.0z3.0��c@seZdZdZdS)rz6A common base class for the other pickling exceptions.N)�__name__�
__module__�__qualname__�__doc__�rr�6/opt/rh/rh-python35/root/usr/lib64/python3.5/pickle.pyr?sc@seZdZdZdS)rz]This exception is raised when an unpicklable object is passed to the
    dump() method.

    N)rrrrrrrrrCsc@seZdZdZdS)r
aThis exception is raised when there is a problem unpickling an object,
    such as a security violation.

    Note that other exceptions may also be raised during unpickling, including
    (but not necessarily limited to) AttributeError, EOFError, ImportError,
    and IndexError.

    N)rrrrrrrrr
Jsc@seZdZdd�ZdS)�_StopcCs
||_dS)N)�value)�selfrrrr�__init__Xsz_Stop.__init__N)rrrrrrrrrWsr)�PyStringMap�(�.�0�1�2�F�I�J�K�L�M�N�P�Q�R�S�T�U�V�X�a�b�c�d�}�e�g�h�i�j�l�]�o�p�q�r�s�t�)�u�GsI01
sI00
s�s�s�s�s�s�s�s�s�s�s�s��B�Cs�s�s�s�s�s�s�s�s�s�cCs(g|]}tjd|�r|�qS)z[A-Z][A-Z0-9_]+$)�re�match)�.0�xrrr�
<listcomp>�s	rPc@sUeZdZdZdd�Zdd�Zdd�Zd	d
d�Zdd
�ZdS)�_Framer�@icCs||_d|_dS)N)�
file_write�
current_frame)rrSrrrr�s	z_Framer.__init__cCstj�|_dS)N)�io�BytesIOrT)rrrr�
start_framing�sz_Framer.start_framingcCs;|jr7|jj�dkr7|jdd�d|_dS)Nr�forceT)rT�tell�commit_frame)rrrr�end_framing�sz_Framer.end_framingFcCs�|jr�|j}|j�|jks-|r�|j��C}t|�}|j}|t�|td|��||�WdQRX|jd�|j	�dS)Nz<Qr)
rTrY�_FRAME_SIZE_TARGET�	getbuffer�lenrS�FRAMEr	�seek�truncate)rrX�f�data�n�writerrrrZ�s			

z_Framer.commit_framecCs*|jr|jj|�S|j|�SdS)N)rTrerS)rrcrrrre�s	z
_Framer.writeNi)	rrrr\rrWr[rZrerrrrrQ�s
rQc@sCeZdZddd�Zdd�Zdd�Zdd	�ZdS)
�	_UnframerNcCs||_||_d|_dS)N)�	file_read�
file_readlinerT)rrgrhZ	file_tellrrrr�s		z_Unframer.__init__cCsw|jrf|jj|�}|rD|dkrDd|_|j|�St|�|krbtd��|S|j|�SdS)Nrz$pickle exhausted before end of frame)rT�readrgr^r
)rrdrcrrrri�s		
	z_Unframer.readcCs_|jrQ|jj�}|s1d|_|j�S|ddkrMtd��|S|j�SdS)N�s
rz$pickle exhausted before end of frame����
)rT�readlinerhr
)rrcrrrrm�s		
	z_Unframer.readlinecCsI|jr*|jj�dkr*td��tj|j|��|_dS)N�z4beginning of a new frame before end of current frame)rTrir
rUrVrg)r�
frame_sizerrr�
load_frame�s	z_Unframer.load_frame)rrrrrirmrprrrrrf�s

rfcCs�x�|jd�D]p}|dkr:tdj||���y|}t||�}Wqtk
rtdj||���YqXqW||fS)N�.z<locals>z&Can't get local attribute {!r} on {!r}z Can't get attribute {!r} on {!r})�split�AttributeError�format�getattr)�obj�nameZsubpath�parentrrr�
_getattributes	
	rycCs�t|dd�}|dk	r"|Sxtttjj��D]]\}}|dks8|dkr_q8y!t||�d|kr|SWq8tk
r�Yq8Xq8WdS)z$Find the module an object belong to.rN�__main__r)ru�list�sys�modules�itemsryrs)rvrw�module_name�modulerrr�whichmodules"
	r�cCs�|dkrdS|j�d?d}|j|dddd�}|dkr�|dkr�|d
d	kr�|dd@dkr�|dd�}|S)a�Encode a long to a two's complement little-endian binary string.
    Note that 0 is a special case, returning an empty string, to save a
    byte in the LONG1 pickling context.

    >>> encode_long(0)
    b''
    >>> encode_long(255)
    b'\xff\x00'
    >>> encode_long(32767)
    b'\xff\x7f'
    >>> encode_long(-256)
    b'\x00\xff'
    >>> encode_long(-32768)
    b'\x00\x80'
    >>> encode_long(-128)
    b'\x80'
    >>> encode_long(127)
    b'\x7f'
    >>>
    rrnrrj�	byteorder�little�signedT���Nrk���rk)�
bit_length�to_bytes)rO�nbytes�resultrrr�encode_long#s$r�cCstj|dddd�S)a\Decode a long from a two's complement little-endian binary string.

    >>> decode_long(b'')
    0
    >>> decode_long(b"\xff\x00")
    255
    >>> decode_long(b"\xff\x7f")
    32767
    >>> decode_long(b"\x00\xff")
    -256
    >>> decode_long(b"\x00\x80")
    -32768
    >>> decode_long(b"\x80")
    -128
    >>> decode_long(b"\x7f")
    127
    r�r�r�T)�int�
from_bytes)rcrrr�decode_longAsr�c@seZdZddddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zddd�Z	dd�Z
dd�Zdddddd�ZiZ
dd�Zee
ed�<dd�Zee
e<dd�Zee
e<dd�Zee
e<d d!�Zee
e<d"d#�Zee
e<d$d%�Zee
e<d&d'�Zee
e<d(Zd)d*�Zd+d,�Z e e
e!<e"dk	r�e e
e"<d-d.�Z#d/d0�Z$e$e
e%<d1d2�Z&e&e
e'<dd3d4�Z(d5d6�Z)e(e
e*<e)e
e<dS)7�_PicklerN�fix_importsTcCs�|dkrt}|dkr't}n,d|ko>tknsStdt��y|j|_Wntk
r�td��YnXt|j�|_|jj|_i|_	t
|�|_|dk|_d|_
|o�|dk|_dS)a�This takes a binary file for writing a pickle data stream.

        The optional *protocol* argument tells the pickler to use the
        given protocol; supported protocols are 0, 1, 2, 3 and 4.  The
        default protocol is 3; a backward-incompatible protocol designed
        for Python 3.

        Specifying a negative protocol version selects the highest
        protocol version supported.  The higher the protocol used, the
        more recent the version of Python needed to read the pickle
        produced.

        The *file* argument must have a write() method that accepts a
        single bytes argument. It can thus be a file object opened for
        binary writing, an io.BytesIO instance, or any other custom
        object that meets this interface.

        If *fix_imports* is True and *protocol* is less than 3, pickle
        will try to map the new Python 3 names to the old module names
        used in Python 2, so that the pickle data stream is readable
        with Python 2.
        Nrzpickle protocol must be <= %dz"file must have a 'write' attributerjr)�DEFAULT_PROTOCOL�HIGHEST_PROTOCOL�
ValueErrorre�_file_writers�	TypeErrorrQ�framer�memor��proto�bin�fastr�)r�file�protocolr�rrrrZs"	
		z_Pickler.__init__cCs|jj�dS)aClears the pickler's "memo".

        The memo is the data structure that remembers which objects the
        pickler has already seen, so that shared or recursive objects
        are pickled by reference and not by value.  This method is
        useful when re-using picklers.
        N)r��clear)rrrr�
clear_memo�sz_Pickler.clear_memocCs�t|d�s(td|jjf��|jdkrT|jttd|j��|jdkrp|jj	�|j
|�|jt�|jj�dS)z7Write a pickled representation of obj to the open file.r�z2Pickler.__init__() was not called by %s.__init__()r�z<BrN)
�hasattrr�	__class__rr�re�PROTOr	r�rW�save�STOPr[)rrvrrrr�s


z
_Pickler.dumpcCsO|jr
dSt|j�}|j|j|��||f|jt|�<dS)zStore an object in the memo.N)r�r^r�re�put�id)rrv�idxrrr�memoize�s
	z_Pickler.memoizecCsl|jdkrtS|jrM|dkr9ttd|�Sttd|�Sntt|�jd�dSdS)Nr�z<Bz<I�asciis
)	r��MEMOIZEr��BINPUTr	�LONG_BINPUT�PUT�repr�encode)rr�rrrr��s	z_Pickler.putcCsR|jr7|dkr&ttd|�Sttd|�Stt|�jd�dS)Nr�z<Bz<Ir�s
)r��BINGETr	�LONG_BINGET�GETr�r�)r�irrr�get�s
	z_Pickler.getcCs;|jj�|j|�}|dk	r?|r?|j|�dS|jjt|��}|dk	r�|j|j|d��dSt|�}|j	j|�}|dk	r�|||�dSt
|dt�j|�}|dk	r�||�}n�yt|t�}	Wnt
k
rd}	YnX|	r7|j|�dSt
|dd�}|dk	rg||j�}nCt
|dd�}|dk	r�|�}ntd|j|f��t|t�r�|j||�dSt|t�s�td|��t|�}
d|
kod	kns$td
|��|j|d|�dS)NrrF�
__reduce_ex__�
__reduce__zCan't pickle %r object: %rz%s must return string or tupler��z3Tuple returned by %s must have two to five elementsrv)r�rZ�
persistent_id�	save_persr�r�r�re�type�dispatchrur�
issubclassr��save_globalr�rr�
isinstance�str�tupler^�save_reduce)rrv�save_persistent_id�pidrO�trb�reduce�rvZissc�lrrrr��sT





z
_Pickler.savecCsdS)Nr)rrvrrrr�
sz_Pickler.persistent_idcCsT|jr,|j|dd�|jt�n$|jtt|�jd�d�dS)Nr�Fr�s
)r�r�re�	BINPERSID�PERSIDr�r�)rr�rrrr�s	z_Pickler.save_perscCset|t�std��t|�s3td��|j}|j}t|dd�}	|jdkr|	dkr|\}
}}t|
d�s�tdj	|	���|dk	r�|
|j
k	r�td	j	|	���||
�||�||�|t�n�|jd
kr�|	dkr�|d}
t|
d�s@td
��|dk	rg|
|j
k	rgtd��|dd�}||
�||�|t�n||�||�|t
�|dk	rt|�|jkr|t|j|jt|�d��n
|j|�|dk	r(|j|�|dk	rA|j|�|dk	ra||�|t�dS)Nz'args from save_reduce() must be a tuplez(func from save_reduce() must be callabler�r�
__newobj_ex__�__new__z#args[0] from {} args has no __new__z(args[0] from {} args has the wrong classr��
__newobj__rz+args[0] from __newobj__ args has no __new__z0args[0] from __newobj__ args has the wrong classrj)r�r�r�callabler�rerur�r�rtr��	NEWOBJ_EX�NEWOBJ�REDUCEr�r��POPr�r��_batch_appends�_batch_setitems�BUILD)r�func�args�stateZ	listitemsZ	dictitemsrvr�reZ	func_name�cls�kwargsrrrr�sZ				




		





+



z_Pickler.save_reducecCs|jt�dS)N)re�NONE)rrvrrr�	save_nonevsz_Pickler.save_nonecCsH|jdkr+|j|r!tnt�n|j|r=tnt�dS)Nr�)r�re�NEWTRUE�NEWFALSE�TRUE�FALSE)rrvrrr�	save_boolzsz_Pickler.save_boolcCsA|jr�|dkri|dkr?|jttd|��dS|dkri|jttd|��dSd
|ko�dknr�|jttd|��dS|jd	krt|�}t|�}|d
kr�|jt	td|�|�n|jt
td|�|�dS|jtt|�j
d�d�dS)Nrr�z<Bi��z<Hli���z<ir�r�r�sL
i�)r�re�BININT1r	�BININT2�BININTr�r�r^�LONG1�LONG4�LONGr�r�)rrv�encodedrdrrr�	save_long�s&	!z_Pickler.save_longcCsN|jr&|jttd|��n$|jtt|�jd�d�dS)Nz>dr�s
)r�re�BINFLOATr	�FLOATr�r�)rrvrrr�
save_float�s	z_Pickler.save_floatcCs�|jdkrZ|s.|jtfd|�n(|jtjt|d�dfd|�dSt|�}|dkr�|jtt	d|�|�nZ|dkr�|jdkr�|jt
t	d|�|�n|jtt	d	|�|�|j|�dS)
Nrrv�latin1r�z<Bl��rz<Qz<I)
r�r��bytes�codecsr�r�r^re�SHORT_BINBYTESr	�	BINBYTES8�BINBYTESr�)rrvrdrrr�
save_bytes�s!!z_Pickler.save_bytescCs|jr�|jdd�}t|�}|dkrc|jdkrc|jttd|�|�q|dkr�|jdkr�|jttd|�|�q|jttd|�|�nB|j	d	d
�}|j	dd�}|jt
|jd
�d�|j|�dS)Nzutf-8�
surrogatepassr�rz<Bl��z<Qz<I�\z\u005c�
z\u000azraw-unicode-escapes
)r�r�r^r�re�SHORT_BINUNICODEr	�BINUNICODE8�
BINUNICODE�replace�UNICODEr�)rrvr�rdrrr�save_str�s	!!!z_Pickler.save_strcCs�|s4|jr|jt�n|jtt�dSt|�}|j}|j}|dkr�|jdkr�x|D]}||�qtWt	|�|kr�|j
|t	|�d�}|jt||�n|jt|�|j
|�dS|j}|t�x|D]}||�qWt	|�|kr�|j
|t	|�d�}|jrh|t|�n|t|d|�dS|t�|j
|�dS)Nrr�rrj)r�re�EMPTY_TUPLE�MARK�TUPLEr^r�r�r�r�r�r��_tuplesize2coder��POP_MARK)rrvrdr�r��elementr�rerrr�
save_tuple�s:			

	

	
z_Pickler.save_tuplecCsH|jr|jt�n|jtt�|j|�|j|�dS)N)r�re�
EMPTY_LISTr�LISTr�r�)rrvrrr�	save_list�s
	
z_Pickler.save_listi�cCs�|j}|j}|jsDx"|D]}||�|t�q"WdSt|�}x�tt||j��}t|�}|dkr�|t	�x|D]}||�q�W|t
�n|r�||d�|t�||jkrSdSqSWdS)Nrjr)r�rer��APPEND�iterr{r�
_BATCHSIZEr^r�APPENDS)rr~r�rerO�it�tmprdrrrr�s*			





z_Pickler._batch_appendscCsN|jr|jt�n|jtt�|j|�|j|j��dS)N)r�re�
EMPTY_DICTr�DICTr�r�r~)rrvrrr�	save_dict#s
	
z_Pickler.save_dictc	Cs$|j}|j}|jsTx2|D]*\}}||�||�|t�q"WdSt|�}x�tt||j��}t|�}|dkr�|t	�x(|D] \}}||�||�q�W|t
�n4|r	|d\}}||�||�|t�||jkrcdSqcWdS)Nrjr)r�rer��SETITEMr
r{rrr^r�SETITEMS)	rr~r�re�k�vr
rrdrrrr�0s2			







z_Pickler._batch_setitemscCs�|j}|j}|jdkrD|jtt|�fd|�dS|t�|j|�t|�}xvtt	||j
��}t|�}|dkr�|t�x|D]}||�q�W|t
�||j
krjdSqjWdS)Nrrvr)r�rer�r��setr{�	EMPTY_SETr�r
rrr^r�ADDITEMS)rrvr�rer
Zbatchrd�itemrrr�save_setOs$		




z_Pickler.save_setcCs�|j}|j}|jdkrD|jtt|�fd|�dS|t�x|D]}||�qUWt|�|jkr�|t	|j
|jt|�d��dS|t�|j|�dS)Nrrvr)
r�rer�r��	frozensetr{rr�r�rr��	FROZENSETr�)rrvr�rerrrr�save_frozensetgs		

(
z_Pickler.save_frozensetc
Cs|j}|j}|dkr0t|dd�}|dkrE|j}t||�}y6t|dd�tj|}t||�\}}Wn4t	t
tfk
r�td|||f��Yn&X||k	r�td|||f��|j
dkrwtj||f�}	|	rw|	dkr6|ttd|	��n=|	d	kr\|ttd
|	��n|ttd|	��dS|jd�d}
||kr�|
}|j
d
kr�|j|�|j|�|t�n ||k	r�|jt||
f�n�|j
dkr5|tt|d�dt|d�d�n�|jr�tj}tj}||f|kr{|||f\}}n||kr�||}y0|tt|d�dt|d�d�Wn.tk
r�td|||j
f��YnX|j|�dS)Nr�levelrz(Can't pickle %r: it's not found as %s.%sz2Can't pickle %r: it's not the same object as %s.%sr�r�z<Bi��z<Hz<irqrrzutf-8s
r�z?can't pickle global identifier '%s.%s' using pickle protocol %i) rer�rurr��
__import__r|r}ry�ImportError�KeyErrorrsrr�rr��EXT1r	�EXT2�EXT4�
rpartitionr��STACK_GLOBALr��GLOBALr�r��_compat_pickleZREVERSE_NAME_MAPPINGZREVERSE_IMPORT_MAPPING�UnicodeEncodeErrorr�)
rrvrwrer�rr�Zobj2rx�codeZlastnameZr_name_mappingZr_import_mappingrrrr�~sn			



,			
-
z_Pickler.save_globalcCs�|td�kr(|jtdd|�S|tt�krS|jttfd|�S|td�kr{|jtdd|�S|j|�S)Nrv.)N).)r�r��NotImplementedr�)rrvrrr�	save_type�sz_Pickler.save_type)+rrrrr�rr�r�r�r�r�r�r�r�r�r�r��boolr�r�r��floatr�r�r�r�rr�rr{rr�r�dictr r�rrrrr�r,rrrrrr�XsV)
	B]




1
	
	



B	
r�c@s"eZdZdddddddd�Zd	d
�Zdd�Zd
d�ZiZdd�Zeee	d<dd�Z
e
eed<dd�Zeee
d<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<d d!�Zeeed<d"d#�Zeeed<d$d%�Zeeed<d&d'�Zeeed<d(d)�Z e ee!d<d*d+�Z"e"ee#d<d,d-�Z$e$ee%d<d.d/�Z&e&ee'd<d0d1�Z(d2d3�Z)e)ee*d<d4d5�Z+e+ee,d<d6d7�Z-e-ee.d<d8d9�Z/e/ee0d<d:d;�Z1e1ee2d<d<d=�Z3e3ee4d<d>d?�Z5e5ee6d<d@dA�Z7e7ee8d<dBdC�Z9e9ee:d<dDdE�Z;e;ee<d<dFdG�Z=e=ee>d<dHdI�Z?e?ee@d<dJdK�ZAeAeeBd<dLdM�ZCeCeeDd<dNdO�ZEeEeeFd<dPdQ�ZGeGeeHd<dRdS�ZIeIeeJd<dTdU�ZKeKeeLd<dVdW�ZMeMeeNd<dXdY�ZOeOeePd<dZd[�ZQeQeeRd<d\d]�ZSd^d_�ZTeTeeUd<d`da�ZVeVeeWd<dbdc�ZXeXeeYd<ddde�ZZeZee[d<dfdg�Z\e\ee]d<dhdi�Z^e^ee_d<djdk�Z`e`eead<dldm�Zbebeecd<dndo�Zdedeeed<dpdq�Zfdrds�Zgdtdu�Zheheeid<dvdw�Zjejeekd<dxdy�Zleleemd<dzd{�Zneneeod<d|d}�Zpepeeqd<d~d�Zrereesd<d�d��Zteteeud<d�d��Zveveewd<d�d��Zxexeeyd<d�d��Zzezee{d<d�d��Z|e|ee}d<d�d��Z~e~eed<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�S)��
_Unpicklerr�T�encoding�ASCII�errors�strictcCsI|j|_|j|_i|_||_||_d|_||_dS)a�This takes a binary file for reading a pickle data stream.

        The protocol version of the pickle is detected automatically, so
        no proto argument is needed.

        The argument *file* must have two methods, a read() method that
        takes an integer argument, and a readline() method that requires
        no arguments.  Both methods should return bytes.  Thus *file*
        can be a binary file object opened for reading, an io.BytesIO
        object, or any other custom object that meets this interface.

        The file-like object must have two methods, a read() method
        that takes an integer argument, and a readline() method that
        requires no arguments.  Both methods should return bytes.
        Thus file-like object can be a binary file object opened for
        reading, a BytesIO object, or any other custom object that
        meets this interface.

        Optional keyword arguments are *fix_imports*, *encoding* and
        *errors*, which are used to control compatiblity support for
        pickle stream generated by Python 2.  If *fix_imports* is True,
        pickle will try to map the old Python 2 names to the new names
        used in Python 3.  The *encoding* and *errors* tell pickle how
        to decode 8-bit string instances pickled by Python 2; these
        default to 'ASCII' and 'strict', respectively. *encoding* can be
        'bytes' to read theses 8-bit string instances as bytes objects.
        rN)	rm�_file_readlineri�
_file_readr�r1r3r�r�)rr�r�r1r3rrrr�s				z_Unpickler.__init__cCst|d�s(td|jjf��t|j|j�|_|jj|_|jj	|_	t
�|_g|_|jj
|_
d|_|j}|j}y5x.|d�}|s�t�||d|�q�WWn,tk
r}z|jSWYdd}~XnXdS)z�Read a pickled object representation from the open file.

        Return the reconstituted object hierarchy specified in the file.
        r6z4Unpickler.__init__() was not called by %s.__init__()rrjN)r�r
r�rrfr6r5�	_unframerrirm�object�mark�stack�appendr�r��EOFErrorrr)rrir��keyZstopinstrrrr�s(				z_Unpickler.loadcCsG|j}|j}t|�d}x|||k	rB|d}q%W|S)Nrj)r:r9r^)rr:r9rrrr�markers		z_Unpickler.markercCstd��dS)Nz%unsupported persistent id encountered)r
)rr�rrr�persistent_load"sz_Unpickler.persistent_loadcCsL|jd�d}d|ko*tkns?td|��||_dS)Nrjrzunsupported pickle protocol: %d)rir�r�r�)rr�rrr�
load_proto'sz_Unpickler.load_protorcCsNtd|jd��\}|tjkr:td|��|jj|�dS)Nz<Q�zframe size > sys.maxsize: %d)r
rir|rr�r7rp)rrorrrrp.sz_Unpickler.load_framecCs9|j�dd�jd�}|j|j|��dS)Nrjr�rk)rm�decoder;r?)rr�rrr�load_persid5sz_Unpickler.load_persidcCs)|jj�}|j|j|��dS)N)r:�popr;r?)rr�rrr�load_binpersid:sz_Unpickler.load_binpersidcCs|jd�dS)N)r;)rrrr�	load_none?sz_Unpickler.load_nonecCs|jd�dS)NF)r;)rrrr�
load_falseCsz_Unpickler.load_falsecCs|jd�dS)NT)r;)rrrr�	load_trueGsz_Unpickler.load_truecCsj|j�}|tdd�kr+d}n.|tdd�krJd}nt|d�}|j|�dS)NrjFTr)rmr�r�r�r;)rrc�valrrr�load_intKs		z_Unpickler.load_intcCs'|jtd|jd��d�dS)Nz<irr)r;r
ri)rrrr�load_binintVsz_Unpickler.load_binintcCs|j|jd�d�dS)Nrjr)r;ri)rrrr�load_binint1Zsz_Unpickler.load_binint1cCs'|jtd|jd��d�dS)Nz<Hr�r)r;r
ri)rrrr�load_binint2^sz_Unpickler.load_binint2cCsV|j�dd�}|r<|ddkr<|dd�}|jt|d��dS)Nrjr*rrkrk�Lrk)rmr;r�)rrIrrr�	load_longbsz_Unpickler.load_longcCs9|jd�d}|j|�}|jt|��dS)Nrjr)rir;r�)rrdrcrrr�
load_long1isz_Unpickler.load_long1cCsYtd|jd��\}|dkr3td��|j|�}|jt|��dS)Nz<irrz#LONG pickle has negative byte count)r
rir
r;r�)rrdrcrrr�
load_long4os
z_Unpickler.load_long4cCs'|jt|j�dd���dS)Nrjrk)r;r.rm)rrrr�
load_floatxsz_Unpickler.load_floatcCs'|jtd|jd��d�dS)Nz>drAr)r;r
ri)rrrr�
load_binfloat|sz_Unpickler.load_binfloatcCs-|jdkr|S|j|j|j�SdS)Nr�)r1rBr3)rrrrr�_decode_string�sz_Unpickler._decode_stringcCs�|j�dd�}t|�dkr_|d|dkr_|ddkr_|dd�}ntd��|j|jtj|�d��dS)	Nrjr�rs"'z)the STRING opcode argument must be quotedrkrkrk)rmr^r
r;rTr��
escape_decode)rrcrrr�load_string�s
6z_Unpickler.load_stringcCs\td|jd��\}|dkr3td��|j|�}|j|j|��dS)Nz<irrz(BINSTRING pickle has negative byte count)r
rir
r;rT)rr^rcrrr�load_binstring�s
z_Unpickler.load_binstringcCsQtd|jd��\}|tkr7tdt��|j|j|��dS)Nz<Irz2BINBYTES exceeds system's maximum size of %d bytes)r
rirr
r;)rr^rrr�
load_binbytes�s

z_Unpickler.load_binbytescCs*|jt|j�dd�d��dS)Nrjzraw-unicode-escaperk)r;r�rm)rrrr�load_unicode�sz_Unpickler.load_unicodecCs]td|jd��\}|tkr7tdt��|jt|j|�dd��dS)Nz<Irz4BINUNICODE exceeds system's maximum size of %d byteszutf-8r�)r
rirr
r;r�)rr^rrr�load_binunicode�s

z_Unpickler.load_binunicodecCs]td|jd��\}|tkr7tdt��|jt|j|�dd��dS)Nz<QrAz5BINUNICODE8 exceeds system's maximum size of %d byteszutf-8r�)r
rirr
r;r�)rr^rrr�load_binunicode8�s

z_Unpickler.load_binunicode8cCsQtd|jd��\}|tkr7tdt��|j|j|��dS)Nz<QrAz3BINBYTES8 exceeds system's maximum size of %d bytes)r
rirr
r;)rr^rrr�load_binbytes8�s

z_Unpickler.load_binbytes8cCs<|jd�d}|j|�}|j|j|��dS)Nrjr)rir;rT)rr^rcrrr�load_short_binstring�sz_Unpickler.load_short_binstringcCs-|jd�d}|j|j|��dS)Nrjr)rir;)rr^rrr�load_short_binbytes�sz_Unpickler.load_short_binbytescCs9|jd�d}|jt|j|�dd��dS)Nrjrzutf-8r�)rir;r�)rr^rrr�load_short_binunicode�sz _Unpickler.load_short_binunicodecCs=|j�}t|j|dd��g|j|d�<dS)Nrj)r>r�r:)rrrrr�
load_tuple�sz_Unpickler.load_tuplecCs|jf�dS)N)r;)rrrr�load_empty_tuple�sz_Unpickler.load_empty_tuplecCs|jdf|jd<dS)Nrjrkrk)r:)rrrr�load_tuple1�sz_Unpickler.load_tuple1cCs.|jd|jdfg|jdd�<dS)Nr�rjr�rkr�)r:)rrrr�load_tuple2�sz_Unpickler.load_tuple2cCs8|jd|jd|jdfg|jdd�<dS)Nrr�rj���r�rkrd)r:)rrrr�load_tuple3�sz_Unpickler.load_tuple3cCs|jg�dS)N)r;)rrrr�load_empty_list�sz_Unpickler.load_empty_listcCs|ji�dS)N)r;)rrrr�load_empty_dictionary�sz _Unpickler.load_empty_dictionarycCs|jt��dS)N)r;r)rrrr�load_empty_set�sz_Unpickler.load_empty_setcCs=|j�}t|j|dd��g|j|d�<dS)Nrj)r>rr:)rrrrr�load_frozenset�sz_Unpickler.load_frozensetcCs7|j�}|j|dd�g|j|d�<dS)Nrj)r>r:)rrrrr�	load_list�sz_Unpickler.load_listcsh|j�}|j|dd���fdd�tdt��d�D�}|g|j|d�<dS)Nrjcs%i|]}�|d�|�qS)rjr)rNr�)r~rr�
<dictcomp>�s	z(_Unpickler.load_dict.<locals>.<dictcomp>rr�)r>r:�ranger^)rr�dr)r~r�	load_dict�s
z_Unpickler.load_dictcCs�t|j|dd��}|j|d�=|sRt|t�sRt|d�r�y||�}Wq�tk
r�}z1td|jt|�ftj	�d��WYdd}~Xq�Xn|j
|�}|j|�dS)NrjZ__getinitargs__zin constructor for %s: %sr�)r�r:r�r�r�r�rr�r|�exc_infor�r;)r�klassrr�r�errrrr�_instantiates<z_Unpickler._instantiatecCsj|j�dd�jd�}|j�dd�jd�}|j||�}|j||j��dS)Nrjr�rkrk)rmrB�
find_classrrr>)rr�rwrprrr�	load_instsz_Unpickler.load_instcCs6|j�}|jj|d�}|j||�dS)Nrj)r>r:rDrr)rrrprrr�load_objsz_Unpickler.load_objcCsA|jj�}|jj�}|j||�}|j|�dS)N)r:rDr�r;)rr�r�rvrrr�load_newobj$sz_Unpickler.load_newobjcCsS|jj�}|jj�}|jj�}|j|||�}|j|�dS)N)r:rDr�r;)rr�r�r�rvrrr�load_newobj_ex+s
z_Unpickler.load_newobj_excCsa|j�dd�jd�}|j�dd�jd�}|j||�}|j|�dS)Nrjzutf-8rkrk)rmrBrsr;)rr�rwrprrr�load_global3sz_Unpickler.load_globalcCsk|jj�}|jj�}t|�tk	sBt|�tk	rNtd��|j|j||��dS)NzSTACK_GLOBAL requires str)r:rDr�r�r
r;rs)rrwr�rrr�load_stack_global:s
$z_Unpickler.load_stack_globalcCs$|jd�d}|j|�dS)Nrjr)ri�
get_extension)rr*rrr�	load_ext1Bsz_Unpickler.load_ext1cCs,td|jd��\}|j|�dS)Nz<Hr�)r
rirz)rr*rrr�	load_ext2Gsz_Unpickler.load_ext2cCs,td|jd��\}|j|�dS)Nz<ir)r
rirz)rr*rrr�	load_ext4Lsz_Unpickler.load_ext4cCs�g}tj||�}||k	r5|j|�dStj|�}|sr|dkrbtd��td|��|j|�}|t|<|j|�dS)NrzEXT specifies code <= 0zunregistered extension code %d)rr�r;rr
r�rs)rr*Znilrvr=rrrrzQs

z_Unpickler.get_extensioncCs�|jdkre|jre||ftjkrItj||f\}}n|tjkretj|}t|dd�|jdkr�ttj||�dSt	tj||�SdS)Nrrrr)
r�r�r(ZNAME_MAPPINGZIMPORT_MAPPINGrryr|r}ru)rr�rwrrrrsas
z_Unpickler.find_classc	Csh|j}|j�}|d}y||�}Wn(ttj��t||��YnX||d<dS)Nrjrkrk)r:rD�printr|ro)rr:r�r�rrrr�load_reducens	

z_Unpickler.load_reducecCs|jd=dS)Nrjrk)r:)rrrr�load_pop{sz_Unpickler.load_popcCs |j�}|j|d�=dS)N)r>r:)rrrrr�
load_pop_marksz_Unpickler.load_pop_markcCs|j|jd�dS)Nrjrk)r;r:)rrrr�load_dup�sz_Unpickler.load_dupcCs4t|j�dd��}|j|j|�dS)Nrjrk)r�rmr;r�)rr�rrr�load_get�sz_Unpickler.load_getcCs+|jd�d}|j|j|�dS)Nrjr)rir;r�)rr�rrr�load_binget�sz_Unpickler.load_bingetcCs3td|jd��\}|j|j|�dS)Nz<Ir)r
rir;r�)rr�rrr�load_long_binget�sz_Unpickler.load_long_bingetcCsLt|j�dd��}|dkr4td��|jd|j|<dS)Nrjrznegative PUT argumentrkrk)r�rmr�r:r�)rr�rrr�load_put�sz_Unpickler.load_putcCsC|jd�d}|dkr+td��|jd|j|<dS)Nrjrznegative BINPUT argumentrk)rir�r:r�)rr�rrr�load_binput�sz_Unpickler.load_binputcCsKtd|jd��\}|tkr3td��|jd|j|<dS)Nz<Irznegative LONG_BINPUT argumentrjrk)r
rirr�r:r�)rr�rrr�load_long_binput�sz_Unpickler.load_long_binputcCs$|j}|jd|t|�<dS)Nrjrk)r�r:r^)rr�rrr�load_memoize�s	z_Unpickler.load_memoizecCs0|j}|j�}|d}|j|�dS)Nrjrk)r:rDr;)rr:rr{rrr�load_append�s	
z_Unpickler.load_appendcCs�|j}|j�}||d}||dd�}t|t�rV|j|�n$|j}x|D]}||�qfW||d�=dS)Nrj)r:r>r�r{�extendr;)rr:r9Zlist_objr~r;rrrr�load_appends�s		
z_Unpickler.load_appendscCs9|j}|j�}|j�}|d}|||<dS)Nrjrk)r:rD)rr:rr=r/rrr�load_setitem�s
	
z_Unpickler.load_setitemcCsq|j}|j�}||d}x:t|dt|�d�D]}||d|||<q@W||d�=dS)Nrjr�)r:r>rlr^)rr:r9r/r�rrr�
load_setitems�s	#z_Unpickler.load_setitemscCs�|j}|j�}||d}||dd�}t|t�rV|j|�n$|j}x|D]}||�qfW||d�=dS)Nrj)r:r>r�r�update�add)rr:r9Zset_objr~r�rrrr�
load_additems�s		
z_Unpickler.load_additemsc
Cs|j}|j�}|d}t|dd�}|dk	rK||�dSd}t|t�r~t|�dkr~|\}}|r�|j}tj}xI|j	�D];\}}	t
|�tkr�|	|||�<q�|	||<q�W|rx*|j	�D]\}}	t|||	�q�WdS)Nrj�__setstate__r�rk)
r:rDrur�r�r^�__dict__r|�internr~r�r��setattr)
rr:r�Zinst�setstateZ	slotstateZ	inst_dictr�rrrrr�
load_build�s(	

!		z_Unpickler.load_buildcCs|j|j�dS)N)r;r9)rrrr�	load_mark�sz_Unpickler.load_markcCs|jj�}t|��dS)N)r:rDr)rrrrr�	load_stopsz_Unpickler.load_stopN)�rrrrrr>r?r�r@r�rpr_rCr�rEr�rFr�rGr�rHr�rJ�INTrKr�rLr�rMr�rOr�rPr�rQr�rRr�rSr�rTrV�STRINGrW�	BINSTRINGrXr�rYr�rZr�r[r�r\r�r]�SHORT_BINSTRINGr^r�r_r�r`rrar�rb�TUPLE1rc�TUPLE2re�TUPLE3rfrrgrrhrrirrjrrnrrrrt�INSTru�OBJrvr�rwr�rxr'ryr&r{r"r|r#r}r$rzrsrr�r�r�r�rr��DUPr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r	r�rr�rr�rr�rr�r�r�rr�r�rrrrr0�s	$%		
r0r�TcCs t||d|�j|�dS)Nr�)r�r)rvr�r�r�rrr�_dump
sr�cCs8tj�}t||d|�j|�|j�}|S)Nr�)rUrVr�r�getvalue)rvr�r�rb�resrrr�_dumps
sr�r1r2r3r4cCs"t|d|d|d|�j�S)Nr�r1r3)r0r)r�r�r1r3rrr�_loadsr�cCsLt|t�rtd��tj|�}t|d|d|d|�j�S)Nz%Can't load pickle from unicode stringr�r1r3)r�r�r�rUrVr0r)�sr�r1r3r�rrr�_loadss
r�)	rrr
rrrrrrcCsddl}|j�S)Nr)�doctestZtestmod)r�rrr�_test1sr�rzZdescriptionz$display contents of the pickle files�pickle_filer�Zbr�nargs�*�helpzthe pickle filez-tz--test�action�
store_truezrun self-test suitez-vz)run verbosely; only affects self-test run)�r�typesr�copyregrrrr�	itertoolsrr|rZstructr	r
rLrUr�r(�__all__r��	bytearrayZbytes_typesZformat_versionZcompatible_formatsr�r��	Exceptionrrr
rZorg.python.corer r rr�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r	r�r'rrrr�r�r�r�rrr�r�r�r�rrr�rr�r�r�r�r�r"r#r$r�r�r�r�r�r�r�rr�r�r�r�r�rrrr�r&r�r_r��dirrQrfryr�r�r�r�r0r�r�r�r��_picklerrrrrrr�r�argparse�ArgumentParser�parser�add_argumentZFileType�
parse_argsr�Ztestr�Z
print_help�pprintrbrvrrrr�<module>s"	

$*
��y��=D
#		
	




Rosenblum TV: Video training, virtual workshops, classes, tutorials
logologologologo
  • About
  • What We Do
  • Our Clients
  • Case Studies
    • The BBC
    • CBS News
    • New York Times Television
    • Spectrum News
    • The Newark Star-Ledger
    • The United Nations
    • McGraw/Hill
    • Oyster Yachts
    • Scottish Environmental Protection Agency
  • The Power of Storytelling
  • Why iPhones?
  • Michael on Media
  • Books
  • Contact
  • About
  • What We Do
  • Our Clients
  • Case Studies
    • The BBC
    • CBS News
    • New York Times Television
    • Spectrum News
    • The Newark Star-Ledger
    • The United Nations
    • McGraw/Hill
    • Oyster Yachts
    • Scottish Environmental Protection Agency
  • The Power of Storytelling
  • Why iPhones?
  • Michael on Media
  • Books
  • Contact

RE-INVENTING THE TELEVISION NEWS BUSINESS*

A revolution in video storytelling

Creating entirely new & cost-effective production methods

From the world leaders in video production training and the creators of Character Driven Storytelling™

*and every other business that uses video

WHAT WE DO

Over the past 35 years, we have designed, built or restructured some of the most powerful news and journalism companies in the world.

We replace the traditional TV news ‘crew’ with one highly trained journalist, working alone with nothing but an iPhone.

No more TV news ‘crews’, no editors and no field producers.

This is television news done the way newspaper journalism is done – one reporter with their electronic pad and pencil.

In doing this, we can cut the cost of production by as much as 75% while increasing ratings and audience engagement.

In the place of conventional TV news ‘packages’ – ie, reporter stand up, interview, b-roll, man on the street, we marry great journalism with Netflix and Hollywood storytelling.

It’s a combination that works.

We have taken most of our clients to #1 in their respective markets.

And it’s not just for news. Any company, any profit, any NGO and anyone else who is online needs to tell their story in compelling yet cost-effective video. We can teach you to do that. Either in person or virtually.

EXAMPLES OF WHAT WE CAN TEACH YOUR STAFF TO PRODUCE

ITAY HOD

Itay Hod, MMJ with KPIX/CBS in San Francisco, took the 5-Day Intensive Video Storytelling Bootcamp in 2018.

Because he works alone, with only an iPhone, he was able to embed himself with a homeless family.

Here’s the story he produced in a one-day turn.

KIET DO

Kiet Do, an MMJ with KPIX/CBS in San Francisco, took the 5-Day Intensive Video Storytelling Bootcamp in 2021.

Here is a story he produced, all on his own, with only an iPhone and in a one-day turn.

TAYLOR SCHAUB

Taylor Schaub, an MMJ with Spectrum News 1 in LA, took the 5-Day Intensive Video Storytelling Bootcamp in 2023.

Here is a story he turned in only one day, using only an iPhone. It was the first video story he ever did and it was nominated for an Emmy.

THE BOOTCAMP

How do we convert stations and whole networks to working in this way?

Since 1988, we have run intensive 5-Day Video Storytelling Bootcamps

We have done these all over the world.

These are hands-on bootcamps, and participants learn an entirely new way of creating TV news stories.

-We shoot at a 3:1 ratio or lower, so turnaround times are fast.

-We go directly from camera to timelilne and edit – no written scripts.  We work in the medium of pictures and sound.

-We are entirely character-driven.

-We are driven by pictures and real events.

-We are focused almost entirely on ’the viewer experience’.

Since 1988, more than 70,000 journalists around the world have taken our bootcamps, either in person on virtualy.

Case Studies

CBS Case Study Logos
CBS News

We have started to work with CBS News, bringing our ideas of character-driven storytelling to one of the most successful and biggest networks in the United States. Since beginning to work with them ratings have climbed and more importantly, audience engagement is through the ceiling.

Learn More
NYT Case Study Logos
New York Times Television

We started New York Times Television in 1990 and it was the first paper to be brought into the world of TV. It quickly became one of the most successful non-fiction production companies in the United States. The series and documentaries we produced won many awards including multiple Emmys.

Learn More
BBC Case Study Logos
The BBC

We have been working with the BBC since the year 2000 helping to convert their national news network to our visual storytelling technique. Most recently we have trained teams from their sports, documentaries, and comedy divisions to make character-driven stories using only smartphones.

Learn More
Spectrum Case Study Logos
Spectrum News

For the past five years we have worked with Spectrum News to introduce and train their journalists on visual, character driven storytelling using smartphones helping to create a different kind of local news for their network of 24-Hour News Stations across the United States.

Learn More
UN Case Study Logos
The United Nations

In 2006, we were approached by the United Nations. Rather than rely on news outlets, it would be much easier to train the field operatives to produce their own stories. We spent two years working with the UN, training more than 100 of their staff in bootcamps in Geneva and Nairobi.

Learn More
Star Ledger Case Study Logos
The Newark Star-Ledger

We trained 50 print reporters at the paper to shoot and tell their own stories, in conjunction with their print work. We built a TV newsroom in their existing print newsroom – you could not ask for a better set and they began to live stream their stories in conjunction with their print work.

Learn More
Mcgraw Hill Case Study Logos
Mcgraw Hill

We spent two years with McGraw Hill, training more than 150 of their staffers, making them completely video literate. McGraw/Hill media properties we transit included Business Week, Aviation Week, (what was the name of the architecture magazine), and JD Power and Associates.

Learn More
VOA Case Study Logos
Voice of America

In 1990, we were approached by The Voice of America, the official broadcasting agency for the United States Government. When we met with VOA, they were only a short wave radio broadcaster, but working with them, we took them into television, launching VOA-TV.

Learn More
Oyster Case Study Logos
Oyster Yachts

British based Oyster Yachts makes some of the finest yachts in the world. Like every other company, they had to find a way to feed the never-ending video demands of social media – sites like Instagram and TikTok. We trained the Oyster staff to tell their own stories, using only iPhones.

Learn More
SEPA Case Study Logos
Scottish Environmental Protection Agency

We were approached by SEPA, the Scottish Environmental Protection Agency because they had to continually find a way to ‘feed the media beast’. The result was that SEPA was able to tell their own stories, whenever they wanted, and at almost no additional cost.

Learn More
Image 11-11-22 at 6.25 PM

Michael on Media

Michael Rosenblum has been writing about the media since 1988. His work and ideas have appeared in The Guardian, The Huffington Post, Ilkeston Life and many other publications.

He has been blogging regularly for the past 35 years on this subject. Having taught media studies at Columbia University, NYU and now the University of Oxford, he is considered an expert on this subject.

Continue reading this post or look back at previous posts.

Read More

Do You Have Questions About Learning Video Skills?

If you would like to know more about our courses contact us and one of our training advisors will be happy to call you.

Contact Us

Copyright 2024. All rights reserved.