
&]\c           @` s!  d  Z  d d l m Z m Z m Z d d l Z d d l m Z d d l Z d d l m	 Z	 d d l
 Z d d l m Z e e j  d k r e j j Z n	 d   Z e e j  d	 k r d d
 l
 m Z n d   Z d   Z e d  Z e e j  d k r
d   Z n	 d   Z e e j  d k r;d d l
 m Z n e e e d  Z e e j  d k rte j j j Z n e d  Z y d d l m Z Wn' e k
 rd e f d     YZ n Xe e j  d	 k rd d l
 m Z n7 d d l
 m  Z  m! Z! m" Z" e# e e e# e# e# d  Z d S(   s4   Functions copypasted from newer versions of numpy.

i    (   t   divisiont   print_functiont   absolute_importN(   t   WarningMessage(   t   wraps(   t   NumpyVersions	   1.7.0.devc      
   O` s   t  j d t   } t  j d  | | |   } t |  d k sY t d | j   n  | d j |  k	 r t d | j |  | d f   n  Wd QX| S(   s^  
        Fail unless the given callable throws the specified warning.

        This definition is copypasted from numpy 1.9.0.dev.
        The version in earlier numpy returns None.

        Parameters
        ----------
        warning_class : class
            The class defining the warning that `func` is expected to throw.
        func : callable
            The callable to test.
        *args : Arguments
            Arguments passed to `func`.
        **kwargs : Kwargs
            Keyword arguments passed to `func`.

        Returns
        -------
        The value returned by `func`.

        t   recordt   alwaysi    s!   No warning raised when calling %ss(   First warning for %s is not a %s( is %s)N(   t   warningst   catch_warningst   Truet   simplefiltert   lent   AssertionErrort   __name__t   category(   t   warning_classt   funct   argst   kwt   lt   result(    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   _assert_warns   s    #s   1.10.0(   t   broadcast_toc         C` sP   t  |   t  |  k	 rL | j d t  |    } | j rL | j |   qL n  | S(   Nt   type(   R   t   viewt   __array_finalize__(   t   original_arrayt	   new_array(    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   _maybe_view_as_subclass:   s
    	c      
   C` s   t  j |  r t |  n | f } t  j |  d t d | }  | r^ |  j r^ t d   n  t d   | D  r t d   n  t  j |  f d d d d	 g d
 d g d | d d j	 d } t
 |  |  } | r |  j j r t | j _ n  | S(   Nt   copyt   suboks/   cannot broadcast a non-scalar to a scalar arrayc         s` s   |  ] } | d  k  Vq d S(   i    N(    (   t   .0t   size(    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pys	   <genexpr>K   s    s4   all elements of broadcast shape must be non-negativet   flagst   multi_indext   refs_okt   zerosize_okt   op_flagst   readonlyt	   itershapet   ordert   Ci    (   t   npt   iterablet   tuplet   arrayt   Falset   shapet
   ValueErrort   anyt   nditert   itviewsR   R"   t	   writeableR
   (   R.   R0   R   R'   t	   broadcastR   (    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   _broadcast_toF   s    $c         C` s   t  |  | d | d t S(   NR   R'   (   R7   R
   (   R.   R0   R   (    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyR   V   s    s   1.11.0c         C` s   |  j  S(   N(   t   randint(   t   random_state(    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   get_randint[   s    c         ` s   t  j   f d  } | S(   Nc         ` s   t  |  t j |  j t j t j  j  }  t | t j |  j  t j t j  j   }   j |  d | d | } | j | d t S(   Nt   highR!   R   (   t   maxR+   t   iinfot   mint   int32R8   t   astypeR/   (   t   lowR;   R!   t   dtypet   integers(   R9   (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   randint_patcheda   s    --(   R+   R?   (   R9   RD   (    (   R9   s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyR:   `   s    s   1.9.0(   t   uniquec         C` s  t  j |   j   }  | p | } | p* | } |  j d k r | sK |  } nx |  f } | ry | t  j d t  j  f 7} n  | r | t  j d t  j  f 7} n  | r | t  j d t  j  f 7} n  | S| r |  j d | r d n d  } |  | } n |  j   |  } t  j	 t
 g | d | d  k f  }	 | sA| |	 } n | |	 f } | rh| | |	 f 7} n  | rt  j |	  d }
 t  j |  j d t  j } |
 | | <| | f 7} n  | rt  j	 t  j |	  |  j g f  } | t  j |  f 7} n  | S(   sP  
        Find the unique elements of an array.

        Returns the sorted unique elements of an array. There are three optional
        outputs in addition to the unique elements: the indices of the input array
        that give the unique values, the indices of the unique array that
        reconstruct the input array, and the number of times each unique value
        comes up in the input array.

        Parameters
        ----------
        ar : array_like
            Input array. This will be flattened if it is not already 1-D.
        return_index : bool, optional
            If True, also return the indices of `ar` that result in the unique
            array.
        return_inverse : bool, optional
            If True, also return the indices of the unique array that can be used
            to reconstruct `ar`.
        return_counts : bool, optional
            If True, also return the number of times each unique value comes up
            in `ar`.

            .. versionadded:: 1.9.0

        Returns
        -------
        unique : ndarray
            The sorted unique values.
        unique_indices : ndarray, optional
            The indices of the first occurrences of the unique values in the
            (flattened) original array. Only provided if `return_index` is True.
        unique_inverse : ndarray, optional
            The indices to reconstruct the (flattened) original array from the
            unique array. Only provided if `return_inverse` is True.
        unique_counts : ndarray, optional
            The number of times each of the unique values comes up in the
            original array. Only provided if `return_counts` is True.

            .. versionadded:: 1.9.0

        Notes
        -----
        Taken over from numpy 1.12.0-dev (c8408bf9c).  Omitted examples,
        see numpy documentation for those.

        i    t   kindt	   mergesortt	   quicksorti   iRB   (   R+   t
   asanyarrayt   flattenR!   t   emptyt   boolt   intpt   argsortt   sortt   concatenateR
   t   cumsumR0   t   nonzerot   diff(   t   art   return_indext   return_inverset   return_countst   optional_indicest   optional_returnst   rett   permt   auxt   flagt   iflagt   inv_idxt   idx(    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyRE   m   sD    0		
&
%s
   1.12.0.devc         C` s   t  j | d d d d } | j j d k rB | j t  j  } n  t |  t t f  ri t  j	 |   }  n  t |  t  j
  r | r | j | j d |  j  } q |  j | j k r t d   q n  t  j |  | d d S(	   s  
        Evaluate a polynomial specified by its roots at points x.

        This function is copypasted from numpy 1.12.0.dev.

        If `r` is of length `N`, this function returns the value

        .. math:: p(x) = \prod_{n=1}^{N} (x - r_n)

        The parameter `x` is converted to an array only if it is a tuple or a
        list, otherwise it is treated as a scalar. In either case, either `x`
        or its elements must support multiplication and addition both with
        themselves and with the elements of `r`.

        If `r` is a 1-D array, then `p(x)` will have the same shape as `x`.  If
        `r` is multidimensional, then the shape of the result depends on the
        value of `tensor`. If `tensor is ``True`` the shape will be r.shape[1:]
        + x.shape; that is, each polynomial is evaluated at every value of `x`.
        If `tensor` is ``False``, the shape will be r.shape[1:]; that is, each
        polynomial is evaluated only for the corresponding broadcast value of
        `x`. Note that scalars have shape (,).

        Parameters
        ----------
        x : array_like, compatible object
            If `x` is a list or tuple, it is converted to an ndarray, otherwise
            it is left unchanged and treated as a scalar. In either case, `x`
            or its elements must support addition and multiplication with with
            themselves and with the elements of `r`.
        r : array_like
            Array of roots. If `r` is multidimensional the first index is the
            root index, while the remaining indices enumerate multiple
            polynomials. For instance, in the two dimensional case the roots of
            each polynomial may be thought of as stored in the columns of `r`.
        tensor : boolean, optional
            If True, the shape of the roots array is extended with ones on the
            right, one for each dimension of `x`. Scalars have dimension 0 for
            this action. The result is that every column of coefficients in `r`
            is evaluated for every element of `x`. If False, `x` is broadcast
            over the columns of `r` for the evaluation.  This keyword is useful
            when `r` is multidimensional. The default value is True.

        Returns
        -------
        values : ndarray, compatible object
            The shape of the returned array is described above.

        See Also
        --------
        polyroots, polyfromroots, polyval

        Examples
        --------
        >>> from numpy.polynomial.polynomial import polyvalfromroots
        >>> polyvalfromroots(1, [1,2,3])
        0.0
        >>> a = np.arange(4).reshape(2,2)
        >>> a
        array([[0, 1],
               [2, 3]])
        >>> polyvalfromroots(a, [-1, 0, 1])
        array([[ -0.,   0.],
               [  6.,  24.]])
        >>> r = np.arange(-2, 2).reshape(2,2) # multidimensional coefficients
        >>> r # each column of r defines one polynomial
        array([[-2, -1],
               [ 0,  1]])
        >>> b = [-2, 1]
        >>> polyvalfromroots(b, r, tensor=True)
        array([[-0.,  3.],
               [ 3., 0.]])
        >>> polyvalfromroots(b, r, tensor=False)
        array([-0.,  0.])
        t   ndmini   R   i    s   ?bBhHiIlLqQpPs,   x.ndim must be < r.ndim when tensor == Falset   axis(   i   (   R+   R.   RB   t   charR@   t   doublet
   isinstanceR-   t   listt   asarrayt   ndarrayt   reshapeR0   t   ndimR1   t   prod(   t   xt   rt   tensor(    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   polyvalfromroots   s    K (   t   suppress_warningsRp   c           B` s   e  Z d  Z d d  Z d   Z e d d e d  Z e d d d  Z	 e d d d  Z
 d   Z d	   Z d
   Z d   Z RS(   s  
        Context manager and decorator doing much the same as
        ``warnings.catch_warnings``.

        However, it also provides a filter mechanism to work around
        https://bugs.python.org/issue4180.

        This bug causes Python before 3.4 to not reliably show warnings again
        after they have been ignored once (even within catch_warnings). It
        means that no "ignore" filter can be used easily, since following
        tests might need to see the warning. Additionally it allows easier
        specificity for testing warnings and can be nested.

        Parameters
        ----------
        forwarding_rule : str, optional
            One of "always", "once", "module", or "location". Analogous to
            the usual warnings module filter mode, it is useful to reduce
            noise mostly on the outmost level. Unsuppressed and unrecorded
            warnings will be forwarded based on this rule. Defaults to "always".
            "location" is equivalent to the warnings "default", match by exact
            location the warning warning originated from.

        Notes
        -----
        Filters added inside the context manager will be discarded again
        when leaving it. Upon entering all filters defined outside a
        context will be applied automatically.

        When a recording filter is added, matching warnings are stored in the
        ``log`` attribute as well as in the list returned by ``record``.

        If filters are added and the ``module`` keyword is given, the
        warning registry of this module will additionally be cleared when
        applying it, entering the context, or exiting it. This could cause
        warnings to appear a second time after leaving the context if they
        were configured to be printed once (default) and were already
        printed before the context was entered.

        Nesting this context manager will work as expected when the
        forwarding rule is "always" (default). Unfiltered and unrecorded
        warnings will be passed out and be matched by the outer level.
        On the outmost level they will be printed (or caught by another
        warnings context). The forwarding rule argument can modify this
        behaviour.

        Like ``catch_warnings`` this context manager is not threadsafe.

        Examples
        --------
        >>> with suppress_warnings() as sup:
        ...     sup.filter(DeprecationWarning, "Some text")
        ...     sup.filter(module=np.ma.core)
        ...     log = sup.record(FutureWarning, "Does this occur?")
        ...     command_giving_warnings()
        ...     # The FutureWarning was given once, the filtered warnings were
        ...     # ignored. All other warnings abide outside settings (may be
        ...     # printed/error)
        ...     assert_(len(log) == 1)
        ...     assert_(len(sup.log) == 1)  # also stored in log attribute

        Or as a decorator:

        >>> sup = suppress_warnings()
        >>> sup.filter(module=np.ma.core)  # module must match exact
        >>> @sup
        >>> def some_function():
        ...     # do something which causes a warning in np.ma.core
        ...     pass
        R   c         C` sF   t  |  _ g  |  _ | d d d d h k r9 t d   n  | |  _ d  S(   NR   t   modulet   oncet   locations   unsupported forwarding rule.(   R/   t   _enteredt   _suppressionsR1   t   _forwarding_rule(   t   selft   forwarding_rule(    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   __init__n  s
    		c         C` sT   t  t d  r t j   d  Sx0 |  j D]% } t  | d  r' | j j   q' q' Wd  S(   Nt   _filters_mutatedt   __warningregistry__(   t   hasattrR   Rz   t   _tmp_modulesR{   t   clear(   Rw   Rq   (    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   _clear_registriesx  s    
t    c         C` s   | r g  } n d  } |  j r | d  k rF t j d d | d | nR | j j d d  d } t j d d | d | d | |  j j |  |  j   |  j	 j
 | | t j | t j  | | f  n. |  j j
 | | t j | t j  | | f  | S(   NR   R   t   messaget   .s   \.t   $Rq   (   t   NoneRt   R   t   filterwarningsR   t   replaceR}   t   addR   t   _tmp_suppressionst   appendt   ret   compilet   IRu   (   Rw   R   R   Rq   R   t   module_regex(    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   _filter  s$    		
	(	%c      	   C` s&   |  j  d | d | d | d t  d S(   s  
            Add a new suppressing filter or apply it if the state is entered.

            Parameters
            ----------
            category : class, optional
                Warning class to filter
            message : string, optional
                Regular expression matching the warning message.
            module : module, optional
                Module to filter for. Note that the module (and its file)
                must match exactly and cannot be a submodule. This may make
                it unreliable for external modules.

            Notes
            -----
            When added within a context, filters are only added inside
            the context and will be forgotten when the context is exited.
            R   R   Rq   R   N(   R   R/   (   Rw   R   R   Rq   (    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   filter  s    c      	   C` s"   |  j  d | d | d | d t  S(   s  
            Append a new recording filter or apply it if the state is entered.

            All warnings matching will be appended to the ``log`` attribute.

            Parameters
            ----------
            category : class, optional
                Warning class to filter
            message : string, optional
                Regular expression matching the warning message.
            module : module, optional
                Module to filter for. Note that the module (and its file)
                must match exactly and cannot be a submodule. This may make
                it unreliable for external modules.

            Returns
            -------
            log : list
                A list which will be filled with all matched warnings.

            Notes
            -----
            When added within a context, filters are only added inside
            the context and will be forgotten when the context is exited.
            R   R   Rq   R   (   R   R
   (   Rw   R   R   Rq   (    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyR     s    c      	   C` s0  |  j  r t d   n  t j |  _ t j |  _ |  j t _ t |  _  g  |  _ t	   |  _
 t	   |  _ g  |  _ x |  j D] \ } } } } } | d  k	 r | 2n  | d  k r t j d d | d | qz | j j d d  d } t j d d | d | d | |  j
 j |  qz W|  j t _ |  j   |  S(	   Ns%   cannot enter suppress_warnings twice.R   R   R   R   s   \.R   Rq   (   Rt   t   RuntimeErrorR   t   showwarningt
   _orig_showt   filterst   _filtersR
   R   t   setR}   t
   _forwardedt   logRu   R   R   R   R   R   t   _showwarningR   (   Rw   t   catt   messt   _t   modR   R   (    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt	   __enter__  s0    				
c         G` s;   |  j  t _ |  j t _ |  j   t |  _ |  `  |  ` d  S(   N(   R   R   R   R   R   R   R/   Rt   (   Rw   t   exc_info(    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   __exit__  s    
	c         O` s;  | j  d d   } x|  j |  j d  d  d  D] \ } }	 }
 } } t | |  r0 |
 j | j d  d  k	 r0 | d  k r | d  k	 r t | | | | |  } |  j j	 |  | j	 |  n  d  S| j
 j |  r!| d  k	 rt | | | | |  } |  j j	 |  | j	 |  n  d  Sq0 q0 W|  j d k rp| d  k r_|  j | | | | | |  n |  j |  d  S|  j d k r| j | f } nK |  j d k r| j | | f } n' |  j d k r| j | | | f } n  | |  j k rd  S|  j j |  | d  k r*|  j | | | | | |  n |  j |  d  S(   Nt   use_warnmsgii    R   Rr   Rq   Rs   (   t   popR   Ru   R   t
   issubclasst   matchR   R   R   R   t   __file__t
   startswithRv   R   t   _orig_showmsgR   R   (   Rw   R   R   t   filenamet   linenoR   t   kwargsR   R   R   t   patternR   t   rect   msgt	   signature(    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyR     sL    0
c         ` s"   t        f d    } | S(   sk   
            Function decorator to apply certain suppressions to a whole
            function.
            c          ` s       |  |   SWd  QXd  S(   N(    (   R   R   (   R   Rw   (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   new_func3  s    (   R   (   Rw   R   R   (    (   R   Rw   s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   __call__.  s    N(   R   t
   __module__t   __doc__Ry   R   t   WarningR   R/   R   R   R   R   R   R   R   (    (    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyRp   '  s   F
		 		4(   t   cov(   R.   t   averaget   dotc         C` sm  | d k	 r- | t |  k r- t d   n  t j |   }  |  j d k rZ t d   n  | d k r~ t j |  t j  } nE t j |  } | j d k r t d   n  t j |  | t j  } t |  d d d | } | r| j	 d d k r| j
 } n  | j	 d d k r-t j g   j d d  S| d k	 rt | d	 t d d d | } | r}| j	 d d k r}| j
 } n  t j | | f d
 d } n  | d k r| d k rd } qd } n  d }	 | d k	 rt j | d t } t j | t j |  k  st d   n  | j d k r7t d   n  | j	 d | j	 d k r`t d   n  t | d k   rt d   n  | }	 n  | d k	 r5t j | d t } | j d k rt d   n  | j	 d | j	 d k rt d   n  t | d k   rt d   n  |	 d k r(| }	 q5|	 | 9}	 n  t | d
 d d |	 d t \ }
 } | d } |	 d k r| j	 d | } nJ | d k r| } n5 | d k r| | } n | | t |	 |  | } | d k rt j d t d d d } n  | |
 d d  d f 8} |	 d k r*| j
 } n | |	 j
 } t | | j    } | d t j |  9} | j   S(   s1  
        Estimate a covariance matrix, given data and weights.

        Covariance indicates the level to which two variables vary together.
        If we examine N-dimensional samples, :math:`X = [x_1, x_2, ... x_N]^T`,
        then the covariance matrix element :math:`C_{ij}` is the covariance of
        :math:`x_i` and :math:`x_j`. The element :math:`C_{ii}` is the variance
        of :math:`x_i`.

        See the notes for an outline of the algorithm.

        Parameters
        ----------
        m : array_like
            A 1-D or 2-D array containing multiple variables and observations.
            Each row of `m` represents a variable, and each column a single
            observation of all those variables. Also see `rowvar` below.
        y : array_like, optional
            An additional set of variables and observations. `y` has the same form
            as that of `m`.
        rowvar : bool, optional
            If `rowvar` is True (default), then each row represents a
            variable, with observations in the columns. Otherwise, the relationship
            is transposed: each column represents a variable, while the rows
            contain observations.
        bias : bool, optional
            Default normalization (False) is by ``(N - 1)``, where ``N`` is the
            number of observations given (unbiased estimate). If `bias` is True,
            then normalization is by ``N``. These values can be overridden by using
            the keyword ``ddof`` in numpy versions >= 1.5.
        ddof : int, optional
            If not ``None`` the default value implied by `bias` is overridden.
            Note that ``ddof=1`` will return the unbiased estimate, even if both
            `fweights` and `aweights` are specified, and ``ddof=0`` will return
            the simple average. See the notes for the details. The default value
            is ``None``.

            .. versionadded:: 1.5
        fweights : array_like, int, optional
            1-D array of integer freguency weights; the number of times each
            observation vector should be repeated.

            .. versionadded:: 1.10
        aweights : array_like, optional
            1-D array of observation vector weights. These relative weights are
            typically large for observations considered "important" and smaller for
            observations considered less "important". If ``ddof=0`` the array of
            weights can be used to assign probabilities to observation vectors.

            .. versionadded:: 1.10

        Returns
        -------
        out : ndarray
            The covariance matrix of the variables.

        See Also
        --------
        corrcoef : Normalized covariance matrix

        Notes
        -----
        Assume that the observations are in the columns of the observation
        array `m` and let ``f = fweights`` and ``a = aweights`` for brevity. The
        steps to compute the weighted covariance are as follows::

            >>> w = f * a
            >>> v1 = np.sum(w)
            >>> v2 = np.sum(w * a)
            >>> m -= np.sum(m * w, axis=1, keepdims=True) / v1
            >>> cov = np.dot(m * w, m.T) * v1 / (v1**2 - ddof * v2)

        Note that when ``a == 1``, the normalization factor
        ``v1 / (v1**2 - ddof * v2)`` goes over to ``1 / (np.sum(f) - ddof)``
        as it should.

        Examples
        --------
        Consider two variables, :math:`x_0` and :math:`x_1`, which
        correlate perfectly, but in opposite directions:

        >>> x = np.array([[0, 2], [1, 1], [2, 0]]).T
        >>> x
        array([[0, 1, 2],
               [2, 1, 0]])

        Note how :math:`x_0` increases while :math:`x_1` decreases. The covariance
        matrix shows this clearly:

        >>> np.cov(x)
        array([[ 1., -1.],
               [-1.,  1.]])

        Note that element :math:`C_{0,1}`, which shows the correlation between
        :math:`x_0` and :math:`x_1`, is negative.

        Further, note how `x` and `y` are combined:

        >>> x = [-2.1, -1,  4.3]
        >>> y = [3,  1.1,  0.12]
        >>> X = np.stack((x, y), axis=0)
        >>> print(np.cov(X))
        [[ 11.71        -4.286     ]
         [ -4.286        2.14413333]]
        >>> print(np.cov(x, y))
        [[ 11.71        -4.286     ]
         [ -4.286        2.14413333]]
        >>> print(np.cov(x))
        11.71

        s   ddof must be integeri   s   m has more than 2 dimensionss   y has more than 2 dimensionsRa   RB   i    i   R   Rb   s   fweights must be integers'   cannot handle multidimensional fweightss,   incompatible numbers of samples and fweightss   fweights cannot be negatives'   cannot handle multidimensional aweightss,   incompatible numbers of samples and aweightss   aweights cannot be negativet   weightst   returneds!   Degrees of freedom <= 0 for slicet
   stacklevelg        Ng      ?(   R   t   intR1   R+   Rg   Rj   t   result_typet   float64R.   R0   t   TRi   R/   RP   t   floatt   allt   aroundt	   TypeErrorR   R2   R   R
   t   sumR   t   warnt   RuntimeWarningR   t   conjt   squeeze(   t   mt   yt   rowvart   biast   ddoft   fweightst   aweightsRB   t   Xt   wt   avgt   w_sumt   factt   X_Tt   c(    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyR   ?  s    r				$
			($   R   t
   __future__R    R   R   R   R   R   t	   functoolsR   t   numpyR+   t   scipy._lib._versionR   t   __version__t   testingt   assert_warnsR   R   R   R7   R/   R:   RE   t
   polynomialRo   R
   t   numpy.testingRp   t   ImportErrort   objectR   R.   R   R   R   (    (    (    s7   lib/python2.7/site-packages/scipy/_lib/_numpy_compat.pyt   <module>   sD   	#				[Y 