
Xc           @` s  d  d l  m Z m Z m Z d  d l Z d  d l m Z m Z m	 Z	 m
 Z
 m Z m Z m Z m Z m Z d  d l m Z d  d l m Z d  d l Z d  d l Z d e f d     YZ d e f d	     YZ d
 e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ e d k r|e   n  d S(   i    (   t   divisiont   absolute_importt   print_functionN(	   t   TestCaset   run_module_suitet   assert_t   assert_raisest   assert_equalt   assert_warnst   assert_array_equalt   assert_array_almost_equalt   suppress_warnings(   t   random(   t   asbytest   TestSeedc           B` s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C` sT   t  j j d  } t | j d  d  t  j j d  } t | j d  d  d  S(   Ni    i  i  I    i  (   t   npR   t   RandomStateR   t   randint(   t   selft   s(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_scalar   s    c         C` s   t  j j t d   } t | j d  d  t  j j t  j d   } t | j d  d  t  j j d g  } t | j d  d  t  j j d g  } t | j d  d  d  S(   Ni
   i  i  i    i  I    i	  (   R   R   R   t   rangeR   R   t   arange(   R   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt
   test_array   s    c         C` s0   t  t t j j d  t  t t j j d  d  S(   Ng      i(   R   t	   TypeErrorR   R   R   t
   ValueError(   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_invalid_scalar   s    c         C` s   t  t t j j d g  t  t t j j d g  t  t t j j d g  t  t t j j d d d g  t  t t j j d d d g  d  S(   Ng      iI       i   i   i(   R   R   R   R   R   R   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_invalid_array$   s
    (   t   __name__t
   __module__R   R   R   R   (    (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR      s   		
	t   TestBinomialc           B` s   e  Z d    Z d   Z RS(   c         C` sh   t  j d d d } xL d d d g D]; } t t j d |  d k  t t j | |  |  q% Wd  S(   Ni   t   dtypet   inti    g      ?i   (   R   t   zerosR   R   t   binomialR	   (   R   R!   t   p(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_n_zero.   s    c         C` s   t  t t j d t j  d  S(   Ni   (   R   R   R   R"   R   t   nan(   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_p_is_nan7   s    (   R   R   R$   R&   (    (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR   -   s   		t   TestMultinomialc           B` s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C` s   t  j d d d g  d  S(   Nid   g?g?(   R   t   multinomial(   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt
   test_basic=   s    c         C` s#   t  j d d d d d d g  d  S(   Nid   g?g?g        (   R   R(   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_zero_probability@   s    c         C` sw   t  d t j d d  k o& d k  n  t j d d d  } t  t j d | k   t  t j | d k    d  S(   Niii   (   R   R   R   R   t   all(   R   t   x(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_int_negative_intervalC   s    ,c         C` s+  d d g } t  t j j d | t j d   j d  t  t j j d | t j d   j d  t  t j j d | t j d   j d  t  t j j d | d d g  j d  t  t j j d | d  j d	  t  t j j d | t j d
   j d  t t t j j d | t j	 d   d  S(   Ng      ?i   i   (   i   i   (   i   i   (   i   i   (   i   i   i   (   i   i   (   i   i   i   (   i   i   (   i   i   i   (
   R   R   R   R(   t   uint32t   shapet   arrayR   R   t   float(   R   R#   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt	   test_sizeI   s    +++("$(   R   R   R)   R*   R-   R2   (    (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR'   <   s   			t   TestSetStatec           B` s>   e  Z d    Z d   Z d   Z d   Z d   Z d   Z RS(   c         C` s4   d |  _  t j |  j   |  _ |  j j   |  _ d  S(   NiI(   t   seedR   R   t   prngt	   get_statet   state(   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   setUpY   s    	c         C` sT   |  j  j d  } |  j  j |  j  |  j  j d  } t t j | | k   d  S(   Ni   (   R5   t   tomaxintt	   set_stateR7   R   R   R+   (   R   t   oldt   new(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR)   ^   s    c         C` sZ   |  j  j d d  } |  j  j |  j  |  j  j d d  } t t j | | k   d  S(   Nt   sizei   (   R5   t   standard_normalR:   R7   R   R   R+   (   R   R;   R<   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_gaussian_resetd   s    c         C` ss   |  j  j   |  j  j   } |  j  j d d  } |  j  j |  |  j  j d d  } t t j | | k   d  S(   NR=   i   (   R5   R>   R6   R:   R   R   R+   (   R   R7   R;   R<   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt    test_gaussian_reset_in_media_resk   s    c         C` s   |  j  d  } |  j j d d  } |  j j |  |  j j d d  } |  j j |  j   |  j j d d  } t t j | | k   t t j | | k   d  S(   NiR=   i   (   R7   R5   R>   R:   R   R   R+   (   R   t	   old_statet   x1t   x2t   x3(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_backwards_compatibilityv   s    c         C` s   |  j  j d d  d  S(   Ng      ?(   R5   t   negative_binomial(   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_negative_binomial   s    (   R   R   R8   R)   R?   R@   RE   RG   (    (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR3   X   s   					t   TestRandintc        	   B` s   e  Z e j j Z e j e j e j e j	 e j
 e j e j e j e j g	 Z d    Z d   Z d   Z d   Z d   Z d   Z RS(   c         C` s    t  t |  j d d t j d  S(   Ni   R   (   R   R   t   rfuncR   R1   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_unsupported_type   s    c         C` s   x |  j  D] } | t j k r% d n t j |  j } | t j k rL d n t j |  j d } t t |  j | d | d | t t |  j | | d d | t t |  j | | d | t t |  j d d d | q
 Wd  S(   Ni    i   i   R   (	   t   itypeR   t   bool_t   iinfot   mint   maxR   R   RI   (   R   t   dtt   lbndt   ubnd(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_bounds_checking   s    '+  c      	   C` s  x |  j  D] } | t j k r% d n t j |  j } | t j k rL d n t j |  j d } | d } t |  j | | d d d d | |  | } t |  j | | d d d d | |  | | d } t |  j | | d d d d | |  q
 Wd  S(   Ni    i   i   R=   i  R   (   RK   R   RL   RM   RN   RO   R   RI   (   R   RP   RQ   RR   t   tgt(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_rng_zero_and_extremes   s    '+
))c      	   C` s   t  j j   xy |  j d D]j } xa d d d g D]P } |  j d | d d	 d | } t | j   | k   t | j   d k  q1 Wq W|  j d d d d
 d t  j } t | j   d k   t | j   d k  d  S(   Ni   i   i   i   i   R=   R   i    i   i   (	   R   R   R4   RK   RI   R   RO   RN   t   bool(   R   RP   RR   t   vals(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_in_bounds_fuzz   s    !c         C` s  d d  l  } i	 d d 6d d 6d d 6d d	 6d
 d 6d d 6d d 6d d 6d
 d 6} x |  j d D] } t j j d  t j d k r |  j d d d d d | } n$ |  j d d d d d | j   } | j	 | j
 t j   j   } t | t j |  j | k  q_ Wt j j d  |  j d d d d d t j j
 t j  } | j	 |  j   } t | t j t j  j | k  d  S(   Ni    t    7dd3170d7aa461d201a65f8bcf3944b0RV   t    1b7741b80964bb190c50d541dca1cac1t   int16t    4dc9fcc2b395577ebb51793e58ed1a05t   int32t    17db902806f448331b5a758d7d2ee672t   int64t    27dd30c4e08a797063dffac2490b0be6t   int8t   uint16R.   t   uint64t   uint8i   i  t   littlei   R=   i  R   i   (   t   hashlibRK   R   R   R4   t   syst	   byteorderRI   t   byteswapt   md5t   viewRa   t	   hexdigestR   R   t   nameRV   (   R   Rf   RT   RP   t   valt   res(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_repeatability   s*    

!$!$-c         C` sW  x |  j  D] } | t j k r% d n t j |  j } | t j k rL d n t j |  j d } |  j | | d | } |  j | j t j |   q
 Wx t j	 t j
 t j f D] } | t j	 k r d n t j |  j } | t j	 k r d n t j |  j d } |  j | | d | } |  j t | d   |  j t |  |  q Wd  S(   Ni    i   i   R   (   RK   R   RL   RM   RN   RO   RI   t   assertEqualR   RV   R    t   longt   assertFalset   hasattrt   type(   R   RP   RQ   RR   t   sample(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_respect_dtype_singleton   s    '+ '+(   R   R   R   R   R   RI   RL   Ra   Rd   R[   Rb   R]   R.   R_   Rc   RK   RJ   RS   RU   RX   Rp   Rw   (    (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyRH      s   						!t   TestRandomDistc           B` sc  e  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   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   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&   Z' d'   Z( d(   Z) d)   Z* d*   Z+ d+   Z, d,   Z- d-   Z. d.   Z/ d/   Z0 d0   Z1 d1   Z2 d2   Z3 d3   Z4 d4   Z5 d5   Z6 d6   Z7 d7   Z8 d8   Z9 d9   Z: d:   Z; d;   Z< d<   Z= d=   Z> d>   Z? d?   Z@ d@   ZA dA   ZB dB   ZC RS(C   c         C` s   d |  _  d  S(   NiI(   R4   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR8      s    c         C` si   t  j j |  j  t  j j d d  } t  j d d g d d g d d g g  } t | | d	 d
 d  S(   Ni   i   g_\*?g?g<p?g,o?gH?gZ?t   decimali   (   R   R   R4   t   randR0   R
   (   R   t   actualt   desired(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt	   test_rand   s    	c         C` si   t  j j |  j  t  j j d d  } t  j d d g d d g d d g g  } t | | d	 d
 d  S(   Ni   i   g!<Oq?g4u,?g3?gLI/DͿg@? @gHS\@Ry   i   (   R   R   R4   t   randnR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt
   test_randn   s    	c         C` si   t  j j |  j  t  j j d d d d } t  j d d g d d g d	 d
 g g  } t | |  d  S(   Niic   R=   i   i   i   ii)   ii(   i   i   (   R   R   R4   R   R0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_randint   s    	c      
   C` s   t  j j |  j  t   G } | j t  } t  j j d d d d } t t |  d k  Wd  QXt  j	 d d g d d	 g d
 d g g  } t
 | |  d  S(   Niic   R=   i   i   i   i   ii)   ii(   i   i   (   R   R   R4   R   t   recordt   DeprecationWarningt   random_integersR   t   lenR0   R	   (   R   t   supt   wR{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_random_integers  s    	c         C` s   t    Y } | j t  } t j j t j d  j t j d  j  } t t	 |  d k  Wd  QXt j d  j } t
 | |  d  S(   Nt   li   (   R   R   R   R   R   R   RM   RO   R   R   R   (   R   R   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_random_integers_max_int  s    c      
   C` sz   t  j   h t  j d t  t t t j j t j d  j	  t t t j j t j d  j	 t j d  j	  Wd  QXd  S(   Nt   errorR   (
   t   warningst   catch_warningst   simplefilterR   R   R   R   R   RM   RO   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_random_integers_deprecated   s    		c         C` sf   t  j j |  j  t  j j d  } t  j d d g d d g d d g g  } t | | d	 d
 d  S(   Ni   i   g_\*?g?g<p?g,o?gH?gZ?Ry   i   (   i   i   (   R   R   R4   t   random_sampleR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_random_sample.  s    	c         C` sT   t  j j |  j  t  j j d d  } t  j d d d d g  } t | |  d  S(   Ni   i   i   (   R   R   R4   t   choiceR0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_choice_uniform_replace6  s    c         C` sf   t  j j |  j  t  j j d d d d d d d g } t  j d d d d g  } t | |  d  S(   Ni   R#   g?g?i   i   (   R   R   R4   R   R0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_choice_nonuniform_replace<  s    'c         C` sW   t  j j |  j  t  j j d d d t } t  j d d d g  } t | |  d  S(   Ni   i   t   replacei    i   (   R   R   R4   R   t   FalseR0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_choice_uniform_noreplaceB  s    c      
   C` si   t  j j |  j  t  j j d d d t d d d d d g } t  j d d d	 g  } t | |  d  S(
   Ni   i   R   R#   g?g333333?g      ?i   i   (   R   R   R4   R   R   R0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt    test_choice_nonuniform_noreplaceH  s
    c         C` s`   t  j j |  j  t  j j d d d d g d  } t  j d d d d g  } t | |  d  S(   Nt   at   bt   ct   di   (   R   R   R4   R   R0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_choice_nonintegerO  s    !c         C` sj  t  j j } t t | d d  t t | d d  t t | d d g d d g g d  t t | g  d  t t | d d d d g d d d d g d d g g t t | d d g d d d	 d	 d
 g t t | d d g d d d d g t t | d d g d d d	 d	 g t t | d d d g d d t t t | d d d g d d t d d d d g d  S(   Nii   g      @i   i   i   R#   g      ?g?g?g?gR   i    (   R   R   R   R   R   R   (   R   Rv   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_choice_exceptionsU  s    %(%%"c      	   C` s  d d g } t  t j t j j d d t   t  t j t j j d d t   t  t j t j j d d t d |   t  t j t j j d d t d |   t  t j t j j d d g d t   t  t j j d  g d t d  k  t j d d g  } t j	 d d t
 } | | d <t  t j j | d t | k  t   } t  t j t j j d | d t   t  t j t j j d | d t   t  t j t j j d | d t d |   t  t j t j j d | d t d |   t  t j t j j d d g | d t   t  t j j d  g | d t j d k  t j d d g  } t j	 d d t
 } | | d <t  t j j | | d t j   | k  d } d d d d d
 d g } t  t j j d | d t j |  t  t j j d | d t j |  t  t j j d | d t d | j |  t  t j j d | d t d | j |  t  t j j t j d  | d t j |  d  S(   Ng?g?i   R   R#   i   R   i    i   g?g?i   (   i   i   (   R   R   t   isscalarR   R   t   TrueR   t   NoneR0   t   emptyt   objectt   tuplet   ndimt   itemR/   R   (   R   R#   R   t   arrR   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_choice_return_shaped  s:    %%+++%
"	))///+
+%%++c         C` sB   t  j j |  j  t  j j d  } t d  } t | |  d  S(   Ni
   s
   Ui+Wf(   R   R   R4   t   bytesR   R   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt
   test_bytes  s    c         C` s   x d   d   d   d   d   d   d   d   d	   d
   g
 D] } t  j j |  j  | d d d d d d d d d d g
  } t  j j |  | } | d d d d d d d d d d g
  } t | |  qC Wd  S(   Nc         S` s   t  j g   S(   N(   R   R0   (   R,   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   <lambda>  s    c         S` s   |  S(   N(    (   R,   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    c         S` s   t  j |   j t  j  S(   N(   R   t   asarrayt   astypeRa   (   R,   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    c         S` s   t  j |   j t  j  S(   N(   R   R   R   t   float32(   R,   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    c         S` s   t  j |   j t  j  S(   N(   R   R   R   t	   complex64(   R,   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    c         S` s   t  j |   j t  S(   N(   R   R   R   R   (   R,   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    c         S` s   g  |  D] } | | f ^ q S(   N(    (   R,   t   i(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    c         S` s&   t  j g  |  D] } | | g ^ q  S(   N(   R   R   (   R,   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    c         S` s   t  j |  |  g  j S(   N(   R   t   vstackt   T(   R,   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    c         S` sD   t  j g  |  D] } | | f ^ q d t d f d t  j d f g  S(   NR   i   R   (   R   R   R   R]   (   R,   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s   "i   i   i   i   i   i   i   i   i	   i    (   R   R   R4   t   shuffleR	   (   R   t   convt   alistR{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_shuffle  s     	**c         C` s  t  j j t  j t d  d  d d d  } t  j j t  j d  d d d  } | j   } | j   } x t d  D] } t  j j |  t	 t
 | j | j  t
 | j | j   t  j j |  t	 t
 | j | j  t
 | j | j   qz Wd  S(	   Ni   i   i   i   i   ii2   (   i   i   (   R   t   mat   masked_valuest   reshapeR   R   t   copyR   R   R   t   sortedt   datat   mask(   R   R   R   t   a_origt   b_origR   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_shuffle_masked  s    /&,c         C` so   t  j j |  j  t  j j d d d d } t  j d d g d d	 g d
 d g g  } t | | d d d  S(   Ng?g?R=   i   i   gAKč?ghA?g ҇o>gάXf+q?gS1$?g'8zX ?Ry   i   (   i   i   (   R   R   R4   t   betaR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt	   test_beta  s    		c         C` si   t  j j |  j  t  j j d d d d } t  j d d g d d	 g d
 d g g  } t | |  d  S(   NgZd;Y@gv/?R=   i   i   i%   i+   i*   i0   i.   i-   (   i   i   (   R   R   R4   R"   R0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_binomial  s    	c         C` sl   t  j j |  j  t  j j d d d } t  j d d g d d g d	 d
 g g  } t | | d d d  S(   Ni2   R=   i   i   g+Q]uO@g+Q@gY7`ZqP@ge(fG@gvtR@gEIȋR@Ry   i   (   i   i   (   R   R   R4   t	   chisquareR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_chisquare  s    	c         C` s   t  j j |  j  t  j d d g  } t  j j j | d d } t  j d d g d d	 g g d
 d g d d g g d d g d d g g g  } t | | d d d  S(   NgI<I@gEZC@R=   i   i   gi{s?gn,	A?g]^?gpDB?gȧ#y?gr?g1U?gѨUC?g^,%?gB?gډOoX;?gM`!O?Ry   i   (   i   i   (   R   R   R4   R0   t   mtrandt	   dirichletR
   (   R   t   alphaR{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_dirichlet  s    		c         C` s  t  j d d g  } t t  j j | t  j d   j d  t t  j j | t  j d   j d  t t  j j | t  j d   j d  t t  j j | d d g  j d  t t  j j | d	  j d
  t t  j j | t  j d   j d  t t t  j j | t  j	 d   d  S(   NgI<I@gEZC@i   i   (   i   i   (   i   i   (   i   i   (   i   i   i   (   i   i   (   i   i   i   (   i   i   (   i   i   i   (
   R   R0   R   R   R   R.   R/   R   R   R1   (   R   R#   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_dirichlet_size  s    (((%(c         C` sl   t  j j |  j  t  j j d d d } t  j d d g d d g d	 d
 g g  } t | | d d d  S(   Ng8EGr?R=   i   i   gNU?gbI0?gVU\@g:3@gU?g"qo?Ry   i   (   i   i   (   R   R   R4   t   exponentialR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_exponential  s    	c         C` s9   t  t j j d d  d  t t t j j d d d  S(   Nt   scalei    g       (   R   R   R   R   R   R   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_exponential_0  s    c         C` so   t  j j |  j  t  j j d d d d } t  j d d g d d	 g d
 d g g  } t | | d d d  S(   Ni   iM   R=   i   i   g7?g`j?g6"+?gܳ2>?gc>+Y?g_}S?Ry   i   (   i   i   (   R   R   R4   t   fR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_f  s    	c         C` so   t  j j |  j  t  j j d d d d } t  j d d g d d g d	 d
 g g  } t | | d d d  S(   Ni   i   R=   i   gԏGM8@gȌ<@g	":@gv#)@gZQ?@gr[@@Ry   i   (   i   i   (   R   R   R4   t   gammaR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt
   test_gamma  s    	c         C` sE   t  t j j d d d d  d  t t t j j d d d d d  S(   NR/   i    R   g       (   R   R   R   R   R   R   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_gamma_0   s    "c         C` sf   t  j j |  j  t  j j d d d
 } t  j d d g d d g d d	 g g  } t | |  d  S(   Ng_c97ݚ?R=   i   i   i   i   i   i   i   (   i   i   (   R   R   R4   t	   geometricR0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_geometric  s    	c         C` su   t  j j |  j  t  j j d d d d d d  } t  j d d	 g d
 d g d d g g  } t | | d d d  S(   Nt   locg_c97ݚ?R   g       @R=   i   i   gؕ?gs0 ?g#0g(xg-KD?gůp`@Ry   i   (   i   i   (   R   R   R4   t   gumbelR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_gumbel  s    !	c         C` s9   t  t j j d d  d  t t t j j d d d  S(   NR   i    g       (   R   R   R   R   R   R   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_gumbel_0  s    c         C` s  t  j j |  j  t  j j d d d d d } t  j d d g d d g d d g g  } t | |  t  j j d	 d
 d d d } t  j d d d d g  } t | |  t  j j d d
 d d d } t  j d d d d g  } t | |  t  j j d
 d	 d d d } t  j d
 d
 d
 d
 g  } t | |  t  j j d
 d d d d } t  j d
 d
 d
 d
 g  } t | |  d  S(   Ng333333$@g      @i   R=   i   i   i
   i	   i   i    i   i   i   (   i   i   (   R   R   R4   t   hypergeometricR0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_hypergeometric  s$    	c         C` su   t  j j |  j  t  j j d d d d d d  } t  j d d	 g d
 d g d d g g  } t | | d d d  S(   NR   g_c97ݚ?R   g       @R=   i   i   g bO?g¸?gpJm	@g{K*t	@g:^w-gY~o?Ry   i   (   i   i   (   R   R   R4   t   laplaceR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_laplace2  s    !	c         C` s9   t  t j j d d  d  t t t j j d d d  S(   NR   i    g       (   R   R   R   R   R   R   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_laplace_0:  s    c         C` su   t  j j |  j  t  j j d d d d d d  } t  j d d	 g d
 d g d d g g  } t | | d d d  S(   NR   g_c97ݚ?R   g       @R=   i   i   g#K-z?gJ?g92@gر[@g#+^˿g-@Ry   i   (   i   i   (   R   R   R4   t   logisticR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_logistic>  s    !	c         C` s<   t  t j j d d  d k  t t t j j d d d  S(   NR   i    i   g       (   i    i   (   R   R   R   R   R   R   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR   F  s    c         C` su   t  j j |  j  t  j j d d d d d d  } t  j d d	 g d
 d g d d g g  } t | | d d d  S(   Nt   meang_c97ݚ?t   sigmag       @R=   i   i   gɁ0@go,+4FB@g)ʭ6@g5?gnxNnP@g)U@Ry   i   (   i   i   (   R   R   R4   t	   lognormalR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_lognormalJ  s    !	c         C` s9   t  t j j d d  d  t t t j j d d d  S(   NR   i    i   g       (   R   R   R   R   R   R   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_lognormal_0R  s    c         C` si   t  j j |  j  t  j j d d d d  } t  j d d g d d g d d g g  } t | |  d  S(	   NR#   gƀ@?R=   i   i   i   i   (   i   i   (   R   R   R4   t	   logseriesR0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_logseriesV  s    	c      
   C` s   t  j j |  j  t  j j d d g d d d } t  j d d d	 d d d g d	 d d
 d d d g g d d d d d d g d d d d d d g g d d d d	 d d g d d d d d d g g g  } t | |  d  S(   Ni   i   g      @i   R=   i   i   i   i   i   i    gUUUUUU?(   i   i   (   R   R   R4   R(   R0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_multinomial^  s    "!c         C` s.  t  j j |  j  d } d d g d d g g } d } t  j j | | |  } t  j d d g d	 d g g d
 d g d d g g d d g d d g g g  } t | | d d t  j j | |  } t  j d d g  } t | | d d d d g } d d g d d g g } t t t  j j | |  d  S(   Ng_c97ݚ?i
   i   i    i   i   gO7?g      $@gڰgHlUg.fgHX3,gS?Ry   i   g:kg|=(   g_c97ݚ?i
   (   i   i   g8   ?g8   ?(   R   R   R4   t   multivariate_normalR0   R
   R   t   RuntimeWarning(   R   R   t   covR=   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_multivariate_normali  s$    		c         C` so   t  j j |  j  t  j j d d d d d d  } t  j d d	 g d
 d g d d g g  } t | |  d  S(   Nt   nid   R#   g|Pk?R=   i   i   iP  iI  i|  ic  i  i  (   i   i   (   R   R   R4   RF   R0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyRG     s    !	c         C` sD  t  j j |  j  t  j j d d d d d d  } t  j d d g d	 d
 g d d g g  } t | | d d t  j j d d d d d d  } t  j d d g d d g d d g g  } t | | d d t  j j |  j  t  j j d d d d d d   } t  j d d g d d g d d g g  } t | | d d d  S(!   Nt   dfi   t   noncR=   i   i   gG7@g! ܴ*@g1}z9?@g+驸0@g26E_r#@gI!1@Ry   i   g      ?g?g?gTD?g?T?g+qnl?g~|D?g밬?i    g{01#@gprs'@g~;$@g"dI@g*@g}',@(   i   i   (   i   i   (   i   i   (   R   R   R4   t   noncentral_chisquareR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_noncentral_chisquare  s"    !	!	!	c      
   C` s{   t  j j |  j  t  j j d d d d d d d d  } t  j d	 d
 g d d g d d g g  } t | | d d d  S(   Nt   dfnumi   t   dfdeni   R   i   R=   i   g^~?g/+c?g".@g@g7?gE?Ry   i   (   i   i   (   R   R   R4   t   noncentral_fR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_noncentral_f  s    		c         C` su   t  j j |  j  t  j j d d d d d d  } t  j d d	 g d
 d g d d g g  } t | | d d d  S(   NR   g_c97ݚ?R   g       @R=   i   i   g&&n@gOG_@g~w@gtw]տgm&5@g$>@Ry   i   (   i   i   (   R   R   R4   t   normalR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_normal  s    !	c         C` s9   t  t j j d d  d  t t t j j d d d  S(   NR   i    g       (   R   R   R   R   R   R   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_normal_0  s    c         C` su   t  j j |  j  t  j j d d d d  } t  j d d g d d	 g d
 d g g  } t  j j | | d d d  S(   NR   g_c97ݚ?R=   i   i   gWI@gԨy@gy]0Ag1~\Aga@gY
7At   nulpi   (   i   i   (   R   R   R4   t   paretoR0   t   testingt   assert_array_almost_equal_nulp(   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_pareto  s    		c         C` si   t  j j |  j  t  j j d d d d  } t  j d d g d d g d d g g  } t | |  d  S(	   Nt   lamg_c97ݚ?R=   i   i   i    i   (   i   i   (   R   R   R4   t   poissonR0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_poisson  s    	c         C` s   t  j d  j } d } t t t  j j |  t t t  j j | g d  t t t  j j |  t t t  j j | g d  d  S(   NR   ii
   (   R   RM   RO   R   R   R   R   (   R   t   lambigt   lamneg(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_poisson_exceptions  s    c         C` so   t  j j |  j  t  j j d d d d  } t  j d d g d d	 g d
 d g g  } t | | d d d  S(   NR   g_c97ݚ?R=   i   i   g;'?gܴw*?g5?gFG?g D]?g$`?Ry   i   (   i   i   (   R   R   R4   t   powerR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt
   test_power  s    	c         C` so   t  j j |  j  t  j j d d d d  } t  j d d g d d	 g d
 d g g  } t | | d d d  S(   NR   i
   R=   i   i   g"u+@gN$MB*@g7v8B4@g55@ge&@g~ӣZ1@Ry   i   (   i   i   (   R   R   R4   t   rayleighR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_rayleigh  s    	c         C` s9   t  t j j d d  d  t t t j j d d d  S(   NR   i    g       (   R   R   R   R  R   R   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_rayleigh_0  s    c         C` si   t  j j |  j  t  j j d d  } t  j d d g d d g d d	 g g  } t | | d
 d d  S(   NR=   i   i   gMoDL?g6([9grF=?gM'	- gVgVA:Qy?Ry   i   (   i   i   (   R   R   R4   t   standard_cauchyR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_standard_cauchy  s    	c         C` si   t  j j |  j  t  j j d d  } t  j d d g d d g d d	 g g  } t | | d
 d d  S(   NR=   i   i   g܁?gc!z?g&N"@gNI@gF>?g~ME?Ry   i   (   i   i   (   R   R   R4   t   standard_exponentialR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_standard_exponential  s    	c         C` so   t  j j |  j  t  j j d d d d  } t  j d d g d d g d	 d
 g g  } t | | d d d  S(   NR/   i   R=   i   g)@gľ@gd],q@gPk{@g9B#1@gv @Ry   i   (   i   i   (   R   R   R4   t   standard_gammaR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_standard_gamma  s    	c         C` s9   t  t j j d d  d  t t t j j d d d  S(   NR/   i    g       (   R   R   R   R  R   R   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_standard_gamma_0  s    c         C` si   t  j j |  j  t  j j d d  } t  j d d g d d g d d	 g g  } t | | d
 d d  S(   NR=   i   i   g!<Oq?g4u,?g3?gLI/DͿg@? @gHS\@Ry   i   (   i   i   (   R   R   R4   R>   R0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_standard_normal  s    	c         C` so   t  j j |  j  t  j j d d d d  } t  j d d g d d	 g d
 d g g  } t | | d d d  S(   NR   i
   R=   i   i   g\VH?ghU%gH$M?gLgVqdzǿg㖀?Ry   i   (   i   i   (   R   R   R4   t
   standard_tR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_standard_t  s    	c      
   C` s{   t  j j |  j  t  j j d d d d d d d d  } t  j d
 d g d d g d d g g  } t | | d d d  S(   Nt   leftg{Gz@t   modeg(\u$@t   rightgףp=
W4@R=   i   i   g:}\)@ghرTj(@gǨL30@g6ڜA0@g6sh&@g<,@Ry   i   (   i   i   (   R   R   R4   t
   triangularR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_triangular  s    		c         C` su   t  j j |  j  t  j j d d d d d d  } t  j d d	 g d
 d g d d g g  } t | | d d d  S(   Nt   lowgGz?t   highgGz%@R=   i   i   g>#H@gu@g#@g}d]#@gN@gw)* @Ry   i   (   i   i   (   R   R   R4   t   uniformR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_uniform  s    !	c         C` s   t  j d  j } t  j d  j } t  j j } t t | t  j d  t t | d t  j  t t | | |  t t | t  j g d g  t t | d g t  j g  t  j j d t  j	 | d  d | d  d  S(   NR1   i    R  i   R  g ؅W4vC(
   R   t   finfoRN   RO   R   R  R   t   OverflowErrort   inft	   nextafter(   R   t   fmint   fmaxt   func(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_uniform_range_bounds$  s    c         C` su   t  j j |  j  t  j j d d d d d d  } t  j d d	 g d
 d g d d g g  } t | | d d d  S(   Nt   mugGz?t   kappagp=
ף?R=   i   i   gLZI@g'N"@gkr?gk=m@gډ?g^=\?Ry   i   (   i   i   (   R   R   R4   t   vonmisesR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_vonmises4  s    !	c         C` sW   t  j j |  j  t  j j d d d d d d  } t  j j t  j |  j    d  S(	   NR#  g        R$  gg5_PG>R=   i
   i   i@B (   R   R   R4   R%  R   R   t   isfiniteR+   (   R   t   r(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_vonmises_small<  s    !c         C` su   t  j j |  j  t  j j d d d d d d  } t  j d d	 g d
 d g d d g g  } t | | d d d  S(   NR   gGz?R   gp=
ף?R=   i   i   gZ@g-g@g8
m?gVP"?g`V?gx^&3?Ry   i   (   i   i   (   R   R   R4   t   waldR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt	   test_waldB  s    !	c         C` so   t  j j |  j  t  j j d d d d  } t  j d d g d d	 g d
 d g g  } t | | d d d  S(   NR   gGz?R=   i   i   g@6?g]A?g(1ڥR?gU?g2_u?g^}-Q?Ry   i   (   i   i   (   R   R   R4   t   weibullR0   R
   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_weibullJ  s    	c         C` s9   t  t j j d d  d  t t t j j d d d  S(   NR   i    g       (   R   R   R   R,  R   R   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_weibull_0R  s    c         C` si   t  j j |  j  t  j j d d d d
  } t  j d d g d d g d d	 g g  } t | |  d  S(   NR   gGz?R=   i   i   iB   i   i   i   (   i   i   (   R   R   R4   t   zipfR0   R	   (   R   R{   R|   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt	   test_zipfV  s    	(D   R   R   R8   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   R   R   R   R   R   R   R   R   R   R   R   RG   R   R   R   R   R   R   R  R  R  R  R	  R  R  R  R  R  R  R  R"  R&  R)  R+  R-  R.  R0  (    (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyRx      s   															$																																																						t   TestBroadcastc           B` s  e  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   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   Z d   Z d   Z d   Z d   Z d   Z  RS(   c         C` s   d |  _  d  S(   Ni[(   R4   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR8   b  s    c         C` s   t  j j |  j  d  S(   N(   R   R   R4   (   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   setSeede  s    c         C` s   d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d d |  j   | | | d  } t | | d d d  S(	   Ni    i   gl?g_x?g=*BN?i   Ry   i   (   R   R   R  R0   R2  R
   (   R   R  R  R  R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR  k  s    			

c         C` s   d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d d	 t t | | d |  |  j   | | | d  } t | | d d	 t t | | | d  d  S(
   Ni    i   ig-r@gYl@g-`w?i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R   R   t	   bad_scaleR   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR   {  s    				

c         C` s  d g } d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d	 d
 t t | | d |  t t | | d |  |  j   | | | d  } t | | d	 d
 t t | | | d  t t | | | d  d  S(   Ni   i   iignQVf?gVKB?gv`k?i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R   R   t   bad_at   bad_bR   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s$    					

c         C` s{   d g } d g } t  j j } t  j d d d g  } |  j   | | d  } t | | d d t t | | d  d  S(	   Ni   ig.UgZ?gi Prq?gEK?i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R   R3  R   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    			
c         C` s{   d g } d g } t  j j } t  j d d d g  } |  j   | | d  } t | | d d t t | | d  d  S(	   Ni   ig.UgZ?gi Prq?gEK?i   Ry   i   (   R   R   R  R0   R2  R
   R   R   (   R   R/   t	   bad_shapet	   std_gammaR|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR    s    			
c         C` s  d g } d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d	 d
 t t | | d |  t t | | d |  |  j   | | | d  } t | | d	 d
 t t | | | d  t t | | | d  d  S(   Ni   i   iig.UgZ?gi Prq?gEK?i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R/   R   R6  R3  R   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s$    					

c         C` s  d g } d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d	 d
 t t | | d |  t t | | d |  |  j   | | | d  } t | | d	 d
 t t | | | d  t t | | | d  d  S(   Ni   i   iigbyʜ?go?gT7@i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R   R   t	   bad_dfnumt	   bad_dfdenR   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s$    					

c   
      C` s  d g } d g } d g } d g } d g } d g } t  j j } t  j d d d	 g  } |  j   | | d | |  }	 t |	 | d
 d t t | | d | |  t t | | d | |  t t | | d | |  |  j   | | | d |  }	 t |	 | d
 d t t | | | d |  t t | | | d |  t t | | | d |  |  j   | | | | d  }	 t |	 | d
 d t t | | | | d  t t | | | | d  t t | | | | d  d  S(   Ni   i   i   i    iigr^G"@g/*@gц!@Ry   i   (   R   R   R   R0   R2  R
   R   R   (
   R   R   R   R   R8  R9  t   bad_nonct   nonc_fR|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s8    							


c         C` s{   d g } d g } t  j j } t  j d d d g  } |  j   | | d  } t | | d d t t | | d  d  S(	   Ni   ig~}N??g$F?g'rS?i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R   t   bad_dfR   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    			
c         C` s  d g } d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d	 d
 t t | | d |  t t | | d |  |  j   | | | d  } t | | d	 d
 t t | | | d  t t | | | d  d  S(   Ni   i   iig w "@g2WR@gRY@i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R   R   R<  R:  t   nonc_chiR|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s$    					

c         C` s{   d g } d g } t  j j } t  j d d d g  } |  j   | | d  } t | | d d t t | | d  d  S(	   Ni   igT@g~Fl@gƚtp?i   Ry   i   (   R   R   R  R0   R2  R
   R   R   (   R   R   R<  t   tR|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR  .  s    			
c         C` s   d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d d	 t t | | d |  |  j   | | | d  } t | | d d	 t t | | | d  d  S(
   Ni   i   igW!@gOBg}?i   Ry   i   (   R   R   R%  R0   R2  R
   R   R   (   R   R#  R$  t	   bad_kappaR%  R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR&  ;  s    				

c         C` s{   d g } d g } t  j j } t  j d d d g  } |  j   | | d  } t | | d d t t | | d  d  S(	   Ni   ig&8??geFX?gՋː?i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R   R4  R   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR   N  s    			
c         C` s{   d g } d g } t  j j } t  j d d d g  } |  j   | | d  } t | | d d t t | | d  d  S(	   Ni   ig.UgZ?gi Prq?gEK?i   Ry   i   (   R   R   R,  R0   R2  R
   R   R   (   R   R   R4  R,  R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR-  [  s    			
c         C` s{   d g } d g } t  j j } t  j d d d g  } |  j   | | d  } t | | d d t t | | d  d  S(	   Ni   igl?g_x?g=*BN?i   Ry   i   (   R   R   R  R0   R2  R
   R   R   (   R   R   R4  R  R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR  h  s    			
c         C` s   d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d d	 t t | | d |  |  j   | | | d  } t | | d d	 t t | | | d  d  S(
   Ni    i   ig:BKc?g3k?g~q?i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R   R   R3  R   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR   u  s    				

c         C` s   d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d d	 t t | | d |  |  j   | | | d  } t | | d d	 t t | | | d  d  S(
   Ni    i   ig'Zy?gdSO=?g3L1?i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R   R   R3  R   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    				

c         C` s   d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d d	 t t | | d |  |  j   | | | d  } t | | d d	 t t | | | d  d  S(
   Ni    i   igy?gJR?g
~&?i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R   R   R3  R   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    				

c         C` s   d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d d	 t t | | d |  |  j   | | | d  } t | | d d	 t t | | | d  d  S(
   Ni    i   igH"@gܮ @gvv	:@i   Ry   i   (   R   R   R   R0   R2  R
   R   R   (   R   R   R   t	   bad_sigmaR   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    				

c         C` s{   d g } d g } t  j j } t  j d d d g  } |  j   | | d  } t | | d d t t | | d  d  S(	   Ni   igݱlo?g/ӂ?gz~R?i   Ry   i   (   R   R   R  R0   R2  R
   R   R   (   R   R   R3  R  R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR    s    			
c         C` s  d g } d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | | d	 d
 t t | | d |  t t | | d |  |  j   | | | d  } t | | d	 d
 t t | | | d  t t | | | d  d  S(   Ng      ?i   i    ig@m e?g`I߿?g|2?i   Ry   i   (   R   R   R*  R0   R2  R
   R   R   (   R   R   R   t   bad_meanR3  R*  R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR+    s$    					

c         C` s  d g } d g } d g } d g } d g } | d \ } } t  j j } t  j d d d g  }	 |  j   | | d | |  }
 t |
 |	 d d	 t t | | d | |  t t | | d | |  t t | | d | |  |  j   | | | d |  }
 t |
 |	 d d	 t t | | | d |  t t | | | d |  t t | | | d |  |  j   | | | | d  }
 t |
 |	 d d	 t t | | | | d  t t | | | | d  t t | | | | d  d  S(
   Ni   i   i   i   g,P;bD @g%G @g,~S @Ry   i   (   R   R   R  R0   R2  R
   R   R   (   R   R  R  R  t   bad_left_onet   bad_mode_onet   bad_left_twot   bad_mode_twoR  R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR    s8    						


c   	      C` s3  d g } d g } d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | |  t t | | d |  t t | | d |  t t | | d |  |  j   | | | d  } t | |  t t | | | d  t t | | | d  t t | | | d  d  S(   Ni   g      ?ig      ?i   (   R   R   R"   R0   R2  R	   R   R   (	   R   R   R#   t   bad_nt	   bad_p_onet	   bad_p_twot   binomR|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s&    					

c   	      C` s3  d g } d g } d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d |  } t | |  t t | | d |  t t | | d |  t t | | d |  |  j   | | | d  } t | |  t t | | | d  t t | | | d  t t | | | d  d  S(   Ni   g      ?ig      ?i    i   (   R   R   RF   R0   R2  R	   R   R   (	   R   R   R#   RF  RG  RH  t	   neg_binomR|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyRG     s&    					

c         C` s   t  j j   j } d g } d g } | d g } t  j j } t  j d d d g  } |  j   | | d  } t | |  t t	 | | d  t t	 | | d  d  S(   Ni   ii   i    i   (
   R   R   R   t   poisson_lam_maxR   R0   R2  R	   R   R   (   R   t   max_lamR   t   bad_lam_onet   bad_lam_twoR   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR   3  s    		
c         C` su   d g } d g } t  j j } t  j d d d g  } |  j   | | d  } t | |  t t | | d  d  S(   Ni   i    i   i   (   R   R   R/  R0   R2  R	   R   R   (   R   R   R4  R/  R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR0  B  s    		
c         C` s   d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d  } t | |  t t | | d  t t | | d  d  S(   Ng      ?ig      ?i   i   (   R   R   R   R0   R2  R	   R   R   (   R   R#   RG  RH  t   geomR|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR   M  s    			
c         C` s&  d g } d g } d g } d g } d g } d g } d g } t  j j } t  j d d d g  }	 |  j   | | d | |  }
 t |
 |	  t t | | d | |  t t | | d | |  t t | | d | |  t t | | d | |  |  j   | | | d |  }
 t |
 |	  t t | | | d |  t t | | | d |  t t | | | d |  t t | | | d |  |  j   | | | | d  }
 t |
 |	  t t | | | | d  t t | | | | d  t t | | | | d  t t | | | | d  d  S(   Ni   i   iii    i   i   (   R   R   R   R0   R2  R	   R   R   (   R   t   ngoodt   nbadt   nsamplet	   bad_ngoodt   bad_nbadt   bad_nsample_onet   bad_nsample_twot	   hypergeomR|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR   Z  s<    							


c         C` s   d g } d g } d g } t  j j } t  j d d d g  } |  j   | | d  } t | |  t t | | d  t t | | d  d  S(   Ng      ?i   ii   i   (   R   R   R   R0   R2  R	   R   R   (   R   R#   RG  RH  R   R|   R{   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR   }  s    			
(!   R   R   R8   R2  R  R   R   R   R  R   R   R   R   R   R  R&  R   R-  R  R   R   R   R   R  R+  R  R   RG   R   R0  R   R   R   (    (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR1  _  s>   										!														!						#t
   TestThreadc           B` s5   e  Z d    Z d   Z d   Z d   Z d   Z RS(   c         C` s   t  d  |  _ d  S(   Ni   (   R   t   seeds(   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR8     s    c   
      C` sX  d d l  m } t j t |  j  f |  } t j t |  j  f |  } g  t |  j |  D]3 \ } } | d | d t j j |  | f  ^ qa } g  | D] }	 |	 j	   ^ q g  | D] }	 |	 j
   ^ q x9 t |  j |  D]% \ } } | t j j |  |  q Wt j   j j d k rGt j d k rGt | |  n t | |  d  S(   Ni    (   t   Threadt   targett   argsi   t   win32(   t	   threadingRZ  R   R   R   RY  t   zipR   R   t   startt   joint   intpR   t   itemsizeRg   t   platformR
   R	   (
   R   t   functiont   szRZ  t   out1t   out2R   t   oR>  R,   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   check_function  s    I'c         C` s    d   } |  j  | d d d  S(   Nc         S` s   |  j  d d  | d <d  S(   NR=   i'  .(   R   (   R7   t   out(    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt
   gen_random  s    Rf  i'  (   i'  (   Rj  (   R   Rl  (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    	c         C` s    d   } |  j  | d d d  S(   Nc         S` s#   |  j  d t j d   | d <d  S(   NR   id   i  .(   id   i  (   R   R   t   ones(   R7   Rk  (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyRl    s    Rf  id   i  (   id   i  (   Rj  (   R   Rl  (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_exp  s    	c         C` s    d   } |  j  | d d d  S(   Nc         S` s'   |  j  d d g d d d | d <d  S(	   Ni
   i   g      @i   R=   i'  .gUUUUUU?(   R(   (   R7   Rk  (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyRl    s    Rf  i'  i   (   i'  i   (   Rj  (   R   Rl  (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR     s    	(   R   R   R8   Rj  R   Rn  R   (    (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyRX    s
   				t   TestSingleEltArrayInputc           B` s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C` sL   t  j d g  |  _ t  j d g  |  _ t  j d g  |  _ d |  _ d  S(   Ni   i   i   i   (   i   (   R   R0   t   argOnet   argTwot   argThreet   tgtShape(   R   (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyR8     s    c         C` s   t  j j t  j j t  j j t  j j t  j j t  j j t  j j t  j j	 t  j j
 t  j j t  j j t  j j f } t  j j t  j j f } xZ | D]R } | | k r | t  j d g   } n | |  j  } |  j | j |  j  q Wd  S(   Ng      ?(   R   R   R   R  R   R  R   R,  R  R  R   R/  R   R   R0   Rp  Rq   R/   Rs  (   R   t   funcst	   probfuncsR!  Rk  (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_one_arg_funcs  s    c         C` s[  t  j j t  j j t  j j t  j j t  j j t  j j t  j j t  j j	 t  j j
 t  j j t  j j t  j j t  j j t  j j f } t  j j t  j j f } x | D] } | | k r t  j d g  } n	 |  j } | |  j |  } |  j | j |  j  | |  j d |  } |  j | j |  j  | |  j | d  } |  j | j |  j  q Wd  S(   Ng      ?i    (   R   R   R  R   R   R   R   R   R%  R   R   R   R   R*  R"   RF   R0   Rq  Rp  Rq   R/   Rs  (   R   Rt  Ru  R!  Rq  Rk  (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_two_arg_funcs  s$    	c         C` s   t  j j t  j j t  j j g } x | D] } | |  j |  j |  j  } |  j | j	 |  j
  | |  j d |  j |  j  } |  j | j	 |  j
  | |  j |  j d |  j  } |  j | j	 |  j
  q( Wd  S(   Ni    (   R   R   R   R  R   Rp  Rq  Rr  Rq   R/   Rs  (   R   Rt  R!  Rk  (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   test_three_arg_funcs  s    (   R   R   R8   Rv  Rw  Rx  (    (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyRo    s   			-t   __main__(   t
   __future__R    R   R   t   numpyR   t   numpy.testingR   R   R   R   R   R   R	   R
   R   R   t   numpy.compatR   Rg   R   R   R   R'   R3   RH   Rx   R1  RX  Ro  R   (    (    (    s=   /tmp/pip-build-2Vcwy8/numpy/numpy/random/tests/test_random.pyt   <module>   s*   @0_  z  -+U