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__/random.cpython-35.opt-1.pyc



���\�e�@s|dZddlmZddlmZmZddl	m
ZmZ
mZmZmZddl	mZmZmZmZddlmZddlm Z!m"Z#ddl$m%Z&d	d
ddd
ddddddddddddddddddgZ'd e
d!�ed"�Z(d"eZ)ed#�Z*d$ed%�Z+d&Z,d'e,Z-dd(l.Z.Gd)d	�d	e.j/�Z/Gd*d�de/�Z0d+d,�Z1d-d.d/�Z2e/�Z3e3j4Z4e3j5Z5e3j6Z6e3j7Z7e3j8Z8e3j9Z9e3j:Z:e3j;Z;e3j<Z<e3j=Z=e3j>Z>e3j?Z?e3j@Z@e3jAZAe3jBZBe3jCZCe3jDZDe3jEZEe3jFZFe3jGZGe3jHZHeId0krxe2�d(S)1a�Random variable generators.

    integers
    --------
           uniform within range

    sequences
    ---------
           pick random element
           pick random sample
           generate random permutation

    distributions on the real line:
    ------------------------------
           uniform
           triangular
           normal (Gaussian)
           lognormal
           negative exponential
           gamma
           beta
           pareto
           Weibull

    distributions on the circle (angles 0 to 2pi)
    ---------------------------------------------
           circular uniform
           von Mises

General notes on the underlying Mersenne Twister core generator:

* The period is 2**19937-1.
* It is one of the most extensively tested generators in existence.
* The random() method is implemented in C, executes in a single Python step,
  and is, therefore, threadsafe.

�)�warn)�
MethodType�BuiltinMethodType)�log�exp�pi�e�ceil)�sqrt�acos�cos�sin)�urandom)�Set�Sequence)�sha512�Random�seed�random�uniform�randint�choice�sample�	randrange�shuffle�
normalvariate�lognormvariate�expovariate�vonmisesvariate�gammavariate�
triangular�gauss�betavariate�
paretovariate�weibullvariate�getstate�setstate�getrandbits�SystemRandom�g�?g@g@g�?g@�5�NcseZdZdZdZddd�Zdd�fdd�Z�fd	d
�Z�fdd�Zd
d�Z	dd�Z
dd�Zddedd�Z
dd�Zede>eeedd�Zdd�Zddd�Zdd�Zd d!�Zd"d#dd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!�S)8ra�Random number generator base class used by bound module functions.

    Used to instantiate instances of Random to get generators that don't
    share state.

    Class Random can also be subclassed if you want to use a different basic
    generator of your own devising: in that case, override the following
    methods:  random(), seed(), getstate(), and setstate().
    Optionally, implement a getrandbits() method so that randrange()
    can cover arbitrarily large ranges.

    �NcCs|j|�d|_dS)zeInitialize an instance.

        Optional argument x controls seeding, as for Random.seed().
        N)r�
gauss_next)�self�x�r0�6/opt/rh/rh-python35/root/usr/lib64/python3.5/random.py�__init__Ts
zRandom.__init__r+c
s�|dkr_ytjtd�d�}Wn4tk
r^ddl}t|j�d�}YnX|dkr�t|tttf�r�t|t�r�|j	�}|t
|�j�7}tj|d�}t�j
|�d|_dS)a�Initialize internal state from hashable object.

        None or no argument seeds from current time or from an operating
        system specific randomness source if available.

        For version 2 (the default), all of the bits are used if *a* is a str,
        bytes, or bytearray.  For version 1, the hash() of *a* is used instead.

        If *a* is an int, all bits are used.

        Ni�	�bigr�r+)�int�
from_bytes�_urandom�NotImplementedError�time�
isinstance�str�bytes�	bytearray�encode�_sha512Zdigest�superrr-)r.�a�versionr9)�	__class__r0r1r]s

zRandom.seedcs|jt�j�|jfS)z9Return internal state; can be passed to setstate() later.)�VERSIONr@r%r-)r.)rCr0r1r%}szRandom.getstatecs�|d}|dkr;|\}}|_t�j|�n�|dkr�|\}}|_ytdd�|D��}Wn.tk
r�}zt|�WYdd}~XnXt�j|�ntd||jf��dS)z:Restore internal state from object returned by getstate().rr,r+css|]}|dVqdS)r+� Nlr0)�.0r/r0r0r1�	<genexpr>�sz"Random.setstate.<locals>.<genexpr>Nz?state with version %s passed to Random.setstate() of version %s)r-r@r&�tuple�
ValueError�	TypeErrorrD)r.�staterBZ
internalstater)rCr0r1r&�s
zRandom.setstatecCs
|j�S)N)r%)r.r0r0r1�__getstate__�szRandom.__getstate__cCs|j|�dS)N)r&)r.rKr0r0r1�__setstate__�szRandom.__setstate__cCs|jf|j�fS)N)rCr%)r.r0r0r1�
__reduce__�szRandom.__reduce__�c
Csp||�}||kr$td��|dkrU|dkrI|j|�Std��||�}||krytd��||}|dkr�|dkr�||j|�S|dkr�td|||f��||�}||kr�td��|dkr||d|}	n-|dkr7||d|}	ntd	��|	dkr[td��|||j|	�S)
z�Choose a random item from range(start, stop[, step]).

        This fixes the problem with randint() which includes the
        endpoint; in Python this is usually not what you want.

        z!non-integer arg 1 for randrange()Nrzempty range for randrange()z non-integer stop for randrange()rOz'empty range for randrange() (%d,%d, %d)z non-integer step for randrange()zzero step for randrange())rI�
_randbelow)
r.�start�stop�step�_intZistartZistop�widthZistep�nr0r0r1r�s4


zRandom.randrangecCs|j||d�S)zJReturn random integer in range [a, b], including both end points.
        rO)r)r.rA�br0r0r1r�szRandom.randintc
Cs�|j}|j}||�|ks6||�|krq|j�}	||	�}
x|
|krl||	�}
qQW|
S||kr�td�||�|�S||}|||}|�}
x|
|kr�|�}
q�W||
|�|S)zCReturn a random int in the range [0,n).  Raises ValueError if n==0.z�Underlying random() generator does not supply 
enough bits to choose from a population range this large.
To remove the range limitation, add a getrandbits() method.)rr'�
bit_length�_warn)
r.rVr5�maxsize�typeZMethodZ
BuiltinMethodrr'�k�rZrem�limitr0r0r1rP�s"		$

	
zRandom._randbelowcCsBy|jt|��}Wntk
r9td��YnX||S)z2Choose a random element from a non-empty sequence.z$Cannot choose from an empty sequence)rP�lenrI�
IndexError)r.�seq�ir0r0r1r�s

z
Random.choicecCs�|dkrk|j}x�ttdt|���D]3}||d�}||||||<||<q1Wn`t}xWttdt|���D]:}||�|d�}||||||<||<q�WdS)z�Shuffle list x in place, and return None.

        Optional argument random is a 0-argument function returning a
        random float in [0.0, 1.0); if it is the default None, the
        standard random.random will be used.

        NrO)rP�reversed�ranger_r5)r.r/r�	randbelowrb�jrTr0r0r1rs		"$"zRandom.shufflecCs�t|t�rt|�}t|t�s6td��|j}t|�}d|kob|knsstd��dg|}d}|dkr�|dtt	|dd��7}||krt
|�}x�t|�D]:}|||�}	||	||<|||d	||	<q�Wnlt�}
|
j
}xWt|�D]I}||�}	x|	|
krh||�}	qMW||	�||	||<q8W|S)
a=Chooses k unique random elements from a population sequence or set.

        Returns a new list containing elements from the population while
        leaving the original population unchanged.  The resulting list is
        in selection order so that all sub-slices will also be valid random
        samples.  This allows raffle winners (the sample) to be partitioned
        into grand prize and second place winners (the subslices).

        Members of the population need not be hashable or unique.  If the
        population contains repeats, then each occurrence is a possible
        selection in the sample.

        To choose a sample in a range of integers, use range as an argument.
        This is especially fast and space efficient for sampling from a
        large population:   sample(range(10000000), 60)
        z>Population must be a sequence or set.  For dicts, use list(d).rzSample larger than populationN��r)r,rO)r:�_SetrH�	_SequencerJrPr_rI�_ceil�_log�listrd�set�add)r.Z
populationr\rerV�resultZsetsizeZpoolrbrfZselectedZselected_addr0r0r1rs6	
!		
z
Random.samplecCs||||j�S)zHGet a random number in the range [a, b) or [a, b] depending on rounding.)r)r.rArWr0r0r1rVszRandom.uniformgg�?cCs�|j�}y(|dkr!dn||||}Wntk
rL|SYnX||krzd|}d|}||}}|||||dS)z�Triangular distribution.

        Continuous distribution bounded by given lower and upper limits,
        and having a given mode value in-between.

        http://en.wikipedia.org/wiki/Triangular_distribution

        Ng�?g�?)r�ZeroDivisionError)r.ZlowZhigh�mode�u�cr0r0r1r \s	(
	


zRandom.triangularcCsf|j}xN|�}d|�}t|d|}||d}|t|�krPqW|||S)z\Normal distribution.

        mu is the mean, and sigma is the standard deviation.

        g�?g�?g@)r�
NV_MAGICCONSTrl)r.�mu�sigmar�u1�u2�zZzzr0r0r1rrs
		
zRandom.normalvariatecCst|j||��S)z�Log normal distribution.

        If you take the natural logarithm of this distribution, you'll get a
        normal distribution with mean mu and standard deviation sigma.
        mu can have any value, and sigma must be greater than zero.

        )�_expr)r.rvrwr0r0r1r�szRandom.lognormvariatecCstd|j��|S)a^Exponential distribution.

        lambd is 1.0 divided by the desired mean.  It should be
        nonzero.  (The parameter would be called "lambda", but that is
        a reserved word in Python.)  Returned values range from 0 to
        positive infinity if lambd is positive, and from negative
        infinity to 0 if lambd is negative.

        g�?)rlr)r.Zlambdr0r0r1r�szRandom.expovariatecCs|j}|dkr t|�Sd|}|td||�}xc|�}tt|�}|||}|�}	|	d||ks�|	d|t|�krEPqEWd|}
|
|d|
|}|�}|dkr�|t|�t}
n|t|�t}
|
S)aFCircular data distribution.

        mu is the mean angle, expressed in radians between 0 and 2*pi, and
        kappa is the concentration parameter, which must be greater than or
        equal to zero.  If kappa is equal to zero, this distribution reduces
        to a uniform random angle over the range 0 to 2*pi.

        g���ư>g�?g�?)r�TWOPI�_sqrt�_cos�_pir{�_acos)r.rvZkappar�sr]rxrz�dry�q�fZu3Zthetar0r0r1r�s&	
		.
	zRandom.vonmisesvariatecCs|dks|dkr$td��|j}|dkrtd|d�}|t}||}x�|�}d|ko�dkns�qdd|�}t|d|�|}	|t|	�}
|||}|||	|
}|td|dks|t|�krd|
|SqdWn�|dkrZ|�}
x|
dkrJ|�}
q2Wt|
�|Sx�|�}
t|t}||
}|dkr�|d|}
nt|||�}
|�}|dkr�||
|dkr�Pq]|t|
�kr]Pq]W|
|SdS)	aZGamma distribution.  Not the gamma function!

        Conditions on the parameters are alpha > 0 and beta > 0.

        The probability distribution function is:

                    x ** (alpha - 1) * math.exp(-x / beta)
          pdf(x) =  --------------------------------------
                      math.gamma(alpha) * beta ** alpha

        gz*gammavariate: alpha and beta must be > 0.0g�?g@gH�����z>g�P���?g@N)rIrr}�LOG4rlr{�
SG_MAGICCONST�_e)r.�alpha�betarZainvZbbbZcccrxry�vr/rzr]rsrW�pr0r0r1r�sJ	

	
*	
	
	zRandom.gammavariatecCs�|j}|j}d|_|dkrt|�t}tdtd|���}t|�|}t|�||_|||S)z�Gaussian distribution.

        mu is the mean, and sigma is the standard deviation.  This is
        slightly faster than the normalvariate() function.

        Not thread-safe without a lock around calls.

        Ng@g�?g�)rr-r|r}rlr~�_sin)r.rvrwrrzZx2piZg2radr0r0r1r!"s			
zRandom.gausscCs>|j|d�}|dkr"dS|||j|d�SdS)z�Beta distribution.

        Conditions on the parameters are alpha > 0 and beta > 0.
        Returned values range between 0 and 1.

        g�?rgN)r)r.r�r��yr0r0r1r"Ws
zRandom.betavariatecCs d|j�}d|d|S)z3Pareto distribution.  alpha is the shape parameter.g�?)r)r.r�rsr0r0r1r#iszRandom.paretovariatecCs'd|j�}|t|�d|S)zfWeibull distribution.

        alpha is the scale parameter and beta is the shape parameter.

        g�?)rrl)r.r�r�rsr0r0r1r$rszRandom.weibullvariate)"�__name__�
__module__�__qualname__�__doc__rDr2rr%r&rLrMrNr5rr�BPFr[�_MethodType�_BuiltinMethodTyperPrrrrr rrrrrr!r"r#r$r0r0)rCr1rDs6	 ,
>0H5	c@sPeZdZdZdd�Zdd�Zdd�Zdd	�ZeZZ	d
S)r(z�Alternate random number generator using sources provided
    by the operating system (such as /dev/urandom on Unix or
    CryptGenRandom on Windows).

     Not available on all systems (see os.urandom() for details).
    cCstjtd�d�d?tS)z3Get the next random number in the range [0.0, 1.0).�r3r,)r5r6r7�	RECIP_BPF)r.r0r0r1r�szSystemRandom.randomcCsl|dkrtd��|t|�kr6td��|dd}tjt|�d�}||d|?S)z:getrandbits(k) -> x.  Generates an int with k random bits.rz(number of bits must be greater than zeroz#number of bits should be an integerr��r3)rIr5rJr6r7)r.r\Znumbytesr/r0r0r1r'�szSystemRandom.getrandbitscOsdS)z<Stub method.  Not used for a system random number generator.Nr0)r.�args�kwdsr0r0r1r�szSystemRandom.seedcOstd��dS)zAMethod should not be called for a system random number generator.z*System entropy source does not have state.N)r8)r.r�r�r0r0r1�_notimplemented�szSystemRandom._notimplementedN)
r�r�r�r�rr'rr�r%r&r0r0r0r1r(s
cCsddl}t|d|j�d}d}d}d
}|j�}xVt|�D]H}	||�}
||
7}||
|
}t|
|�}t|
|�}qPW|j�}tt||d�ddd�||}t||||�}
td	||
||f�dS)Nr�timesgg _�Br,zsec,�end� z"avg %g, stddev %g, min %g, max %g
g _��)r9�printr�rd�min�max�roundr})rV�funcr�r9ZtotalZsqsumZsmallestZlargestZt0rbr/Zt1ZavgZstddevr0r0r1�_test_generator�s&
 
r�i�cCst|tf�t|td�t|td�t|td
�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�dS)N���?�{�G�z�?皙�����?�@��?��������?�4@�i@�@)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r��UUUUUU�?)r�r�r�)	r�rrrrrr!r"r )�Nr0r0r1�_test�s r��__main__)Jr��warningsrrY�typesrr�rr�Zmathrrlrr{rrrr�r	rkr
r}rr�rr~r
r��osrr7�_collections_abcrrirrjZhashlibrr?�__all__rur|r�r�r�r�Z_randomrr(r�r�Z_instrrrr rrrrrrrrrrr!r"r#r$r%r&r'r�r0r0r0r1�<module>%sd("		
��=!																						

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.