Your IP : 216.73.216.224


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



���\�K�
@s"dZddlmZmZmZmZmZmZmZddl	m
Z
mZddlZddl
Z
ddlZeefZddddd	d
ddd
ddddg
ZGdd�de�ZGdd�dej�ZGdd�de�ZGdd	�d	ej�ZGdd�d�ZdS)z{Weak reference support for Python.

This module is an implementation of PEP 205:

http://www.python.org/dev/peps/pep-0205/
�)�getweakrefcount�getweakrefs�ref�proxy�CallableProxyType�	ProxyType�
ReferenceType)�WeakSet�_IterationGuardNrrrr�WeakKeyDictionaryrrr�
ProxyTypes�WeakValueDictionaryr	�
WeakMethod�finalizecs^eZdZdZdZddd�Z�fd	d
�Zdd�Zd
d�Ze	j
Z
�S)rz�
    A custom `weakref.ref` subclass which simulates a weak reference to
    a bound method, working around the lifetime problem of bound methods.
    �	_func_ref�
_meth_type�_alive�__weakref__Ncs�y|j}|j}Wn0tk
rHtdjt|���d�YnX��fdd�}tj|||�}t||�|_t|�|_	d|_
t|��|S)Nz)argument should be a bound method, not {}cs5��}|jr1d|_�dk	r1�|�dS)NF)r)�arg�self)�callback�self_wr��7/opt/rh/rh-python35/root/usr/lib64/python3.5/weakref.py�_cb2s
			zWeakMethod.__new__.<locals>._cbT)�__self__�__func__�AttributeError�	TypeError�format�typer�__new__rrr)�cls�methr�obj�funcrrr)rrrr!+s	

		zWeakMethod.__new__csGt�j�}|j�}|dks3|dkr7dS|j||�S)N)�super�__call__rr)rr$r%)�	__class__rrr'As
zWeakMethod.__call__cCsSt|t�rO|js#|jr-||kStj||�oN|j|jkSdS)NF)�
isinstancerrr�__eq__r)r�otherrrrr*Hs

"zWeakMethod.__eq__cCsSt|t�rO|js#|jr-||k	Stj||�pN|j|jkSdS)NT)r)rrr�__ne__r)rr+rrrr,Os

"zWeakMethod.__ne__)z	_func_refz
_meth_typez_alivez__weakref__)�__name__�
__module__�__qualname__�__doc__�	__slots__r!r'r*r,r�__hash__rr)r(rr#sc@seZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZeZ
dd�Zddd�Zdd�Zdd�ZeZdd�Zdd �Zd!d"�Zd#d$�Zdd%d&�Zd'd(�Zd)d*�ZdS)+r
z�Mapping class that references values weakly.

    Entries in the dictionary will be discarded when no strong
    reference to the value exists anymore
    cOs�|std��|^}}t|�dkrFtdt|���t|�dd�}||_g|_t�|_i|_}|j||�dS)NzGdescriptor '__init__' of 'WeakValueDictionary' object needs an argument�z$expected at most 1 arguments, got %dcSsE|�}|dk	rA|jr4|jj|j�n
|j|j=dS)N)�
_iterating�_pending_removals�append�key�data)�wr�selfrefrrrr�removels
		z,WeakValueDictionary.__init__.<locals>.remove)	r�lenr�_remover5�setr4r8�update)�args�kwrr;�drrr�__init__es		
zWeakValueDictionary.__init__cCs0|j}|j}x|r+||j�=qWdS)N)r5r8�pop)r�lrBrrr�_commit_removalszs			z$WeakValueDictionary._commit_removalscCs3|j|�}|dkr+t|��n|SdS)N)r8�KeyError)rr7�orrr�__getitem__�szWeakValueDictionary.__getitem__cCs!|jr|j�|j|=dS)N)r5rFr8)rr7rrr�__delitem__�s	
zWeakValueDictionary.__delitem__cCst|j�t|j�S)N)r<r8r5)rrrr�__len__�szWeakValueDictionary.__len__cCs7y|j|�}Wntk
r,dSYnX|dk	S)NF)r8rG)rr7rHrrr�__contains__�s

	z WeakValueDictionary.__contains__cCsd|jjt|�fS)Nz<%s at %#x>)r(r-�id)rrrr�__repr__�szWeakValueDictionary.__repr__cCs3|jr|j�t||j|�|j|<dS)N)r5rF�KeyedRefr=r8)rr7�valuerrr�__setitem__�s	
zWeakValueDictionary.__setitem__cCsLt�}x<|jj�D]+\}}|�}|dk	r|||<qW|S)N)r
r8�items)r�newr7r9rHrrr�copy�s		zWeakValueDictionary.copycCshddlm}|j�}xE|jj�D]4\}}|�}|dk	r,|||||�<q,W|S)Nr)�deepcopy)rTrUr(r8rR)r�memorUrSr7r9rHrrr�__deepcopy__�s	z WeakValueDictionary.__deepcopy__NcCsKy|j|}Wntk
r)|SYnX|�}|dkrC|S|SdS)N)r8rG)rr7�defaultr9rHrrr�get�s
		zWeakValueDictionary.getc
csXt|��Ex=|jj�D],\}}|�}|dk	r||fVqWWdQRXdS)N)r
r8rR)r�kr9�vrrrrR�s

	zWeakValueDictionary.itemsc
csLt|��9x1|jj�D] \}}|�dk	r|VqWWdQRXdS)N)r
r8rR)rrZr9rrr�keys�s
zWeakValueDictionary.keysc	cs*t|��|jj�EdHWdQRXdS)a�Return an iterator that yields the weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        N)r
r8�values)rrrr�
itervaluerefs�s

z!WeakValueDictionary.itervaluerefsc
csLt|��9x1|jj�D] }|�}|dk	r|VqWWdQRXdS)N)r
r8r])rr9r$rrrr]�s

	zWeakValueDictionary.valuescCsR|jr|j�x8|jj�\}}|�}|dk	r||fSqWdS)N)r5rFr8�popitem)rr7r9rHrrrr_�s	
	zWeakValueDictionary.popitemcGsu|jr|j�y|jj|��}Wn#tk
rQ|rJ|dS�YnX|dkrmt|��n|SdS)Nr)r5rFr8rDrG)rr7r@rHrrrrD�s	

zWeakValueDictionary.popcCsdy|j|}WnEtk
rX|jr4|j�t||j|�|j|<|SYnX|�SdS)N)r8rGr5rFrOr=)rr7rXr9rrr�
setdefault�s
	
	zWeakValueDictionary.setdefaultcOs�|std��|^}}t|�dkrFtdt|���|rV|dnd}|jro|j�|j}|dk	r�t|d�s�ti�|�}x3|j�D]%\}}t||j	|�||<q�Wt|�r�|j
|�dS)NzEdescriptor 'update' of 'WeakValueDictionary' object needs an argumentr3z$expected at most 1 arguments, got %drrR)rr<r5rFr8�hasattrr rRrOr=r?)r@�kwargsr�dictrBr7rHrrrr?s 	
	zWeakValueDictionary.updatecCst|jj��S)a~Return a list of weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        )�listr8r])rrrr�	valuerefss
zWeakValueDictionary.valuerefs)r-r.r/r0rCrFrIrJrKrLrNrQrT�__copy__rWrYrRr\�__iter__r^r]r_rDr`r?rerrrrr
Ys.	

	cs:eZdZdZdZdd�Z�fdd�Z�S)rOa[Specialized reference that includes a key corresponding to the value.

    This is used in the WeakValueDictionary to avoid having to create
    a function object for each key stored in the mapping.  A shared
    callback object can use the 'key' attribute of a KeyedRef instead
    of getting a reference to the key from an enclosing scope.

    r7cCs"tj|||�}||_|S)N)rr!r7)r �obrr7rrrrr!1s	zKeyedRef.__new__cst�j||�dS)N)r&rC)rrhrr7)r(rrrC6szKeyedRef.__init__)zkey)r-r.r/r0r1r!rCrr)r(rrO%srOc@seZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZeZ
dd�Zddd�Zdd�Zdd�Zdd�ZeZdd �Zd!d"�Zd#d$�Zd%d&�Zdd'd(�Zdd)d*�ZdS)+ra� Mapping class that references keys weakly.

    Entries in the dictionary will be discarded when there is no
    longer a strong reference to the key. This can be used to
    associate additional data with an object owned by other parts of
    an application without adding attributes to those objects. This
    can be especially useful with objects that override attribute
    accesses.
    NcCsbi|_t|�dd�}||_g|_t�|_d|_|dk	r^|j|�dS)NcSs?|�}|dk	r;|jr1|jj|�n
|j|=dS)N)r4r5r6r8)rZr:rrrrr;Gs
		z*WeakKeyDictionary.__init__.<locals>.removeF)r8rr=r5r>r4�
_dirty_lenr?)rrcr;rrrrCEs				zWeakKeyDictionary.__init__cCsI|j}|j}x0|rDy||j�=Wqtk
r@YqXqWdS)N)r5r8rDrG)rrErBrrrrFVs			
z"WeakKeyDictionary._commit_removalscs5|j��fdd�|jD�|_d|_dS)Ncs"g|]}|�kr|�qSrr)�.0rZ)rBrr�
<listcomp>es	z5WeakKeyDictionary._scrub_removals.<locals>.<listcomp>F)r8r5ri)rr)rBr�_scrub_removalscs	z!WeakKeyDictionary._scrub_removalscCsd|_|jt|�=dS)NT)rir8r)rr7rrrrJhs	zWeakKeyDictionary.__delitem__cCs|jt|�S)N)r8r)rr7rrrrIlszWeakKeyDictionary.__getitem__cCs6|jr|jr|j�t|j�t|j�S)N)rir5rlr<r8)rrrrrKos
zWeakKeyDictionary.__len__cCsd|jjt|�fS)Nz<%s at %#x>)r(r-rM)rrrrrNvszWeakKeyDictionary.__repr__cCs||jt||j�<dS)N)r8rr=)rr7rPrrrrQyszWeakKeyDictionary.__setitem__cCsLt�}x<|jj�D]+\}}|�}|dk	r|||<qW|S)N)rr8rR)rrSr7rPrHrrrrT|s		zWeakKeyDictionary.copycCshddlm}|j�}xE|jj�D]4\}}|�}|dk	r,|||�||<q,W|S)Nr)rU)rTrUr(r8rR)rrVrUrSr7rPrHrrrrW�s	zWeakKeyDictionary.__deepcopy__cCs|jjt|�|�S)N)r8rYr)rr7rXrrrrY�szWeakKeyDictionary.getcCs6yt|�}Wntk
r(dSYnX||jkS)NF)rrr8)rr7r9rrrrL�s

	zWeakKeyDictionary.__contains__c
csXt|��Ex=|jj�D],\}}|�}|dk	r||fVqWWdQRXdS)N)r
r8rR)rr9rPr7rrrrR�s

	zWeakKeyDictionary.itemsc
csFt|��3x+|jD] }|�}|dk	r|VqWWdQRXdS)N)r
r8)rr9r$rrrr\�s

	zWeakKeyDictionary.keysc
csLt|��9x1|jj�D] \}}|�dk	r|VqWWdQRXdS)N)r
r8rR)rr9rPrrrr]�s
zWeakKeyDictionary.valuescCs
t|j�S)azReturn a list of weak references to the keys.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the keys around longer than needed.

        )rdr8)rrrr�keyrefs�s
zWeakKeyDictionary.keyrefscCsHd|_x8|jj�\}}|�}|dk	r||fSqWdS)NT)rir8r_)rr7rPrHrrrr_�s		zWeakKeyDictionary.popitemcGs"d|_|jjt|�|�S)NT)rir8rDr)rr7r@rrrrD�s	zWeakKeyDictionary.popcCs|jjt||j�|�S)N)r8r`rr=)rr7rXrrrr`�szWeakKeyDictionary.setdefaultcKs�|j}|dk	rit|d�s6ti�|�}x0|j�D]"\}}||t||j�<qCWt|�r�|j|�dS)NrR)r8rar rRrr=r<r?)rrcrbrBr7rPrrrr?�s	zWeakKeyDictionary.update)r-r.r/r0rCrFrlrJrIrKrNrQrTrfrWrYrLrRr\rgr]rmr_rDr`r?rrrrr:s.	
	c@s�eZdZdZfZiZdZej�Z	dZ
dZGdd�d�Zdd�Z
ddd	�Zd
d�Zdd
�Zedd��Zedd��Zejdd��Zdd�Zedd��Zedd��ZdS)raClass for finalization of weakrefable objects

    finalize(obj, func, *args, **kwargs) returns a callable finalizer
    object which will be called when obj is garbage collected. The
    first time the finalizer is called it evaluates func(*arg, **kwargs)
    and returns the result. After this the finalizer is dead, and
    calling it just returns None.

    When the program exits any remaining finalizers for which the
    atexit attribute is true will be run in reverse order of creation.
    By default atexit is true.
    Fc@seZdZdZdS)	zfinalize._Info�weakrefr%r@rb�atexit�indexN)zweakrefzfunczargszkwargszatexitzindex)r-r.r/r1rrrr�_Info�srqcOs�|js.ddl}|j|j�dt_|j�}t||�|_||_||_	|pgd|_
d|_t|j�|_
||j|<dt_dS)NrT)�_registered_with_atexitro�register�	_exitfuncrrqrrnr%r@rb�next�_index_iterrp�	_registry�_dirty)rr$r%r@rbro�inforrrrC�s					
zfinalize.__init__NcCsE|jj|d�}|rA|jrA|j|j|jp=i�SdS)zZIf alive then mark as dead and return func(*args, **kwargs);
        otherwise return NoneN)rwrD�	_shutdownr%r@rb)r�_ryrrrr'szfinalize.__call__cCsh|jj|�}|o!|j�}|dk	rd|jj|d�rd||j|j|jp`ifSdS)z^If alive then mark as dead and return (obj, func, args, kwargs);
        otherwise return NoneN)rwrYrnrDr%r@rb)rryr$rrr�detach	s!zfinalize.detachcCsS|jj|�}|o!|j�}|dk	rO||j|j|jpKifSdS)zMIf alive then return (obj, func, args, kwargs);
        otherwise return NoneN)rwrYrnr%r@rb)rryr$rrr�peeksz
finalize.peekcCs
||jkS)zWhether finalizer is alive)rw)rrrr�aliveszfinalize.alivecCs%|jj|�}t|�o$|jS)z*Whether finalizer should be called at exit)rwrY�boolro)rryrrrroszfinalize.atexitcCs+|jj|�}|r't|�|_dS)N)rwrYrro)rrPryrrrro$scCs�|jj|�}|o!|j�}|dkrMdt|�jt|�fSdt|�jt|�t|�jt|�fSdS)Nz<%s object at %#x; dead>z!<%s object at %#x; for %r at %#x>)rwrYrnr r-rM)rryr$rrrrN*szfinalize.__repr__cCsCdd�|jj�D�}|jddd��dd�|D�S)NcSs+g|]!\}}|jr||f�qSr)ro)rj�f�irrrrk6s	z-finalize._select_for_exit.<locals>.<listcomp>r7cSs|djS)Nr3)rp)�itemrrr�<lambda>7sz+finalize._select_for_exit.<locals>.<lambda>cSsg|]\}}|�qSrr)rjr�r�rrrrk8s	)rwrR�sort)r"�Lrrr�_select_for_exit3szfinalize._select_for_exitcCs�d}z�|jr�ddl}|j�r:d}|j�d}x�|dksXtjrm|j�}dt_|stP|j�}y|�Wn%tk
r�t	j
t	j��YnX||jksCt�qCWWddt_
|r�|j�XdS)NFrT)rw�gc�	isenabled�disablerrxr�rD�	Exception�sys�
excepthook�exc_info�AssertionErrorrz�enable)r"�reenable_gcr��pendingr�rrrrt:s.	
	
	zfinalize._exitfunc)r-r.r/r0r1rwrz�	itertools�countrvrxrrrqrCr'r|r}�propertyr~ro�setterrN�classmethodr�rtrrrrr�s$	)r0�_weakrefrrrrrrr�_weakrefsetr	r
�collectionsr�r�r�__all__r�MutableMappingr
rOrrrrrr�<module>s4			6��

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.