
p7]c           @   s  d  Z  d d l Z d d l Z d d l Z d d l j j Z d d l	 j
 Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l Z d e f d     YZ d	 e f d
     YZ d   Z d e j f d     YZ d e j f d     YZ d S(   se  
This module implements maximum likelihood-based estimation (MLE) of
Gaussian models for finite-dimensional observations made on
infinite-dimensional processes.

The ProcessMLE class supports regression analyses on grouped data,
where the observations within a group are dependent (they are made on
the same underlying process).  The main application is repeated
measures regression for temporal (longitudinal) data, in which the
repeated measures occur at arbitrary real-valued time points.

The mean structure is specified as a linear model.  The covariance
parameters depend on covariates via a link function.
iN(   t   string_types(   t   minimize(   t   summary2(   t   approx_fprimet   ProcessCovariancec           B   s    e  Z d  Z d   Z d   Z RS(   s  
    A covariance model for a process indexed by a real parameter.

    An implementation of this class is based on a positive definite
    correlation function h that maps real numbers to the interval [0,
    1], such as the Gaussian (squared exponential) correlation
    function :math:`\exp(-x^2)`.  It also depends on a positive
    scaling function `s` and a positive smoothness function `u`.
    c         C   s
   t   d S(   s  
        Returns the covariance matrix for given time values.

        Parameters
        ----------
        time : array-like
            The time points for the observations.  If len(time) = p,
            a pxp covariance matrix is returned.
        sc : array-like
            The scaling parameters for the observations.
        sm : array-like
            The smoothness parameters for the observation.  See class
            docstring for details.
        N(   t   NotImplementedError(   t   selft   timet   sct   sm(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   get_cov)   s    c         C   s
   t   d S(   s  
        The Jacobian of the covariance respect to the parameters.

        See get_cov for parameters.

        Returns
        -------
        jsc : list-like
            jsc[i] is the derivative of the covariance matrix
            with respect to the i^th scaling parameter.
        jsm : list-like
            jsm[i] is the derivative of the covariance matrix
            with respect to the i^th smoothness parameter.
        N(   R   (   R   R   R   R	   (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   jac:   s    (   t   __name__t
   __module__t   __doc__R
   R   (    (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR      s   		t   GaussianCovariancec           B   s    e  Z d  Z d   Z d   Z RS(   s  
    An implementation of ProcessCovariance using the Gaussian kernel.

    This class represents a parametric covariance model for a Gaussian
    process as described in the work of Paciorek et al. cited below.

    Following Paciorek et al [1]_, the covariance between observations with
    index `i` and `j` is given by:

    .. math::

      s[i] \cdot s[j] \cdot h(|time[i] - time[j]| / \sqrt{(u[i] + u[j]) /
      2}) \cdot \frac{u[i]^{1/4}u[j]^{1/4}}{\sqrt{(u[i] + u[j])/2}}

    The ProcessMLE class allows linear models with this covariance
    structure to be fit using maximum likelihood (ML), which is
    equivalent to generalized least squares (GLS) in this setting.

    The mean and covariance parameters of the model are fit jointly.
    The mean, scaling, and smoothing parameters can be linked to
    covariates.  The mean parameters are linked linearly, and the
    scaling and smoothing parameters use an exponential link to
    preserve positivity.

    The reference of Paciorek et al. below provides more details.
    Note that here we only implement the 1-dimensional version of
    their approach.

    References
    ----------
    .. [1] Paciorek, C. J. and Schervish, M. J. (2006). Spatial modeling using
        a new class of nonstationary covariance functions. Environmetrics,
        17:483–506.
        https://papers.nips.cc/paper/2350-nonstationary-covariance-functions-for-gaussian-process-regression.pdf
    c         C   s   t  j j | |  } t  j j | |  d } | | | } t  j | d  t  j |  } | t  j | |  d 9} | t  j | |  9} | S(   Ni   g      ?(   t   npt   subtractt   outert   addt   expt   sqrt(   R   R   R   R	   t   dat   dst   qmatt   cm(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR
   q   s    !c         C   s  t  j j | |  } t  j j | |  d } t  j |  } | | } | | } t |  }	 t  j | d  }
 t  j | |  d } |
 | | } | | d } t  j |	 |	 f  } t  j |	 |	 f  } t  j | |  } g  } x1t |  D]#\ } } | d 9} | | d  d   f c d 7<| d  d   | f c d 7<d | | } d |
 | | } | | |
 | | } |
 | } d | d | | d } | d 9} | | | d  d   f <| | d  d   | f <d | | d | | | f <| | | | } | | 9} | j	 |  q Wg  } x t
 d t |   D] } t  j |	 |	 f  } | | d  d   f | | | d  d   f <| d  d   | f c | d  d   | f | 7<| j	 |  q6W| | f S(   Ni   g      ?i    g      ?g      g      ?(   R   R   R   R   R   t   lenR   t   zerost	   enumeratet   appendt   range(   R   R   R   R	   R   R   t   sdst   daaR   t   pt   eqmt   sm4t   cmxt   dq0t   dit   fit   scct   jsmt   it   _t   dbottomt   dtopt   bt   ct   vt   jsc(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR   }   sJ    





*0(   R   R   R   R
   R   (    (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR   L   s   #	c   	      C   s~   t  |   | j d | j d | j d | j d t  |  t  |  g } t |  t |  k rz d d } t |   n  d  S(   Ni    s.   The leading dimensions of all array arguments s   must be equal.(   R   t   shapet   mint   maxt
   ValueError(	   t   endogt   exogt
   exog_scalet   exog_smootht
   exog_noiseR   t   groupsR0   t   msg(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   _check_args   s    	



	t
   ProcessMLEc           B   s   e  Z d  Z d d  Z d   Z e d d d   Z d   Z d   Z	 d   Z
 d   Z d   Z d d d d	  Z d
   Z d d  Z RS(   sF  
    Fit a Gaussian mean/variance regression model.

    This class fits a one-dimensional Gaussian process model with
    parameterized mean and covariance structures to grouped data.  For
    each group, there is an independent realization of a latent
    Gaussian process indexed by an observed real-valued time
    variable..  The data consist of the Gaussian process observed at a
    finite number of `time` values.

    The process mean and variance can be lined to covariates.  The
    mean structure is linear in the covariates.  The covariance
    structure is non-stationary, and is defined parametrically through
    'scaling', and 'smoothing' parameters.  The covariance of the
    process between two observations in the same group is a function
    of the distance between the time values of the two observations.
    The scaling and smoothing parameters can be linked to covariates.

    The observed data are modeled as the sum of the Gaussian process
    realization and independent white noise.  The standard deviation
    of the white noise can be linked to covariates.

    The data should be provided in 'long form', with a group label to
    indicate which observations belong to the same group.
    Observations in different groups are always independent.

    Parameters
    ----------
    endog : array-like
        The dependent variable.
    exog : array-like
        The design matrix for the mean structure
    exog_scale : array-like
        The design matrix for the scaling structure
    exog_smooth : array-like
        The design matrix for the smoothness structure
    exog_noise : array-like
        The design matrix for the white noise structure. The
        linear predictor is the log of the white noise standard
        deviation.
    time : array-like (1-dimensional)
        The univariate index values, used to calculate distances
        between observations in the same group, which determines
        their correlations.
    groups : array-like (1-dimensional)
        The group values.
    cov : a ProcessCovariance instance
        Defaults to GaussianCovariance.
    c	         K   so  t  t |   j | | d | d | d | d | d | |	 g  }
 t | d  ra t | j  }
 n* g  t | j d  D] } d | ^ qu }
 t | d  r |
 t | j  7}
 n. |
 g  t | j d  D] } d	 | ^ q 7}
 t | d  r|
 t | j  7}
 n. |
 g  t | j d  D] } d
 | ^ q7}
 t | d  rV|
 t | j  7}
 n. |
 g  t | j d  D] } d | ^ qm7}
 |
 |  j _	 | d  k rt   } n  | |  _ t | | | | | | |  t j d    } x+ t |  D] \ } } | | j |  qW| |  _ t |  _ |  j j d |  _ |  j j d |  _ |  j j d |  _ |  j j d |  _ d  S(   NR8   R9   R:   R   R;   t   columnsi   s   Mean%ds   Scale%ds   Smooth%ds   Noise%dc           S   s   g  S(   N(    (    (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   <lambda>$  t    (   t   superR>   t   __init__t   hasattrt   listR?   R   R2   t   datat   param_namest   NoneR   t   covR=   t   collectionst   defaultdictR   R   t
   _groups_ixt   Falset   verboseR7   t   k_exogR8   t   k_scaleR9   t   k_smoothR:   t   k_noise(   R   R6   R7   R8   R9   R:   R   R;   RI   t   kwargst   xnamest   jt	   groups_ixR*   t   g(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyRC      sJ    *...	
		c         C   s   |  j  j } d } | | | |  j !} | |  j 7} | | | |  j !} | |  j 7} | | | |  j !} | |  j 7} | | | |  j !} | | | | f S(   Ni    (   RF   RG   RO   RP   RQ   RR   (   R   RT   t   qt
   mean_namest   scale_namest   smooth_namest   noise_names(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   _split_param_names1  s    c         O   sY  d | k r | d } n t  d   d | k r> | d } n t  d   d | k rc | d }	 n t  d   d | k r | d }
 n t  d   d	 | k r | d	 } n t  d
   | d  k	 r t j d  n  | d  k	 r t j d  n  t |
 t  rt j | |
  }
 n  t | t  r;t j | |  } n  t j	 | |  } | j
 } | j } t j |  } t j	 | |  } | j
 } | j } t j |  } t j	 |	 |  } | j
 } | j } t j |  } t t |   j | d | d d  d | d | d | d |
 d	 | } | | j _ | | j _ | | j _ | j | | | | j _ | S(   Nt   scale_formulas$   scale_formula is a required argumentt   smooth_formulas%   smooth_formula is a required argumentt   noise_formulas$   noise_formula is a required argumentR   s   time is a required argumentR;   s   groups is a required arguments   'subset' is ignoreds   'drop_cols' is ignoredRF   t   subsetR8   R9   R:   (   R5   RH   t   warningst   warnt
   isinstanceR    R   t   asarrayt   patsyt   dmatrixt   design_infot   column_namesRB   R>   t   from_formulaRF   t   scale_design_infot   smooth_design_infot   noise_design_infot
   exog_namesRG   (   t   clst   formulaRF   Ra   t	   drop_colst   argsRS   R^   R_   R`   R   R;   R8   Rk   RZ   R9   Rl   R[   R:   Rm   R\   t   mod(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyRj   =  sb    								c   	      C   s   |  j  j d } | d | !} |  j j d } | | | | !} |  j j d } | | | | | | !} | | | | } | | | | f S(   s@   
        Split the packed parameter vector into blocks.
        i   i    (   R7   R2   R8   R9   (	   R   t   zt   pmt   mnpart   pvt   scpart   pst   smpart   nopar(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   unpack  s    c         C   su   t  j |  j |  j  } | j   } |  j j d |  j j d } | |  j j d 7} t	 j
 | j t	 j |  f  S(   Ni   (   R	   t   OLSR6   R7   t   fitR8   R2   R9   R:   R   t   concatenatet   paramsR   (   R   t   modelt   resultt   m(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt
   _get_start  s
    c         C   sy  |  j  |  \ } } } } |  j t j |  j |  } t j t j |  j |   } t j t j |  j |   } t j t j |  j |   }	 d }
 x |  j	 j
   D] \ } } |  j j |  j | | | | |  } | j d d | j d d  c |	 | d 7<| | } |
 d t j j |  d 8}
 |
 d t j | t j j | |   8}
 q W|  j rud |
 f GHn  |
 S(   s  
        Calculate the log-likelihood function for the model.

        Parameters
        ----------
        params : array-like
            The packed parameters for the model.

        Returns
        -------
        The log-likelihood value at the given parameter point.

        Notes
        -----
        The mean, scaling, and smoothing parameters are packed into
        a vector.  Use `unpack` to access the component vectors.
        g        Ni    i   i   g      ?s   L=(   R|   R6   R   t   dotR7   R   R8   R9   R:   RL   t   itemsRI   R
   R   t   flatR2   t   linalgt   slogdett   solveRN   (   R   R   Rv   Rx   Rz   R{   t   residR   R	   t   not   llR+   t   ixR   t   re(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   loglike  s    '/
-	c   &      C   s  |  j  |  \ } } } } t |  t |  t |  } } } |  j t j |  j |  }	 t j t j |  j |   }
 t j t j |  j |   } t j t j |  j	 |   } t j
 t |  t |  t |  t |   } x|  j j   D]\ } } |
 | } | | } | | } |	 | } |  j | } |  j | d d  f } |  j | d d  f } |  j | d d  f } |  j	 | d d  f } |  j j | | |  } | j d d | j d d  c | | d 7<t j j |  } |  j j | | |  \ } } t j j | |  } | d | c !t j | j |  7+t j | |  } t j j | |  } d t j j | | j  } | d d  d f | }  x t |  D] \ }! } t j | |! |  }" | | | | c !|" |  |! d d  f 7+| | | | c !d t j | |! |  |  |! d d  f 8+qW| d d  d f | }# x t |  D] \ }! } t j | |! |  }" | | | | | | c !|" |# |! d d  f 7+| | | | | | c !d t j | |! |  |# |! d d  f 8+qpW| d d  d f d | }$ | | | | c t j | j d d | j d d  |$  8)t j | t j | |   }% | | | | c t j |% j d d |% j d d  |$  7)q W|  j rd t j t j | |   f GHn  | S(   s  
        Calculate the score function for the model.

        Parameters
        ----------
        params : array-like
            The packed parameters for the model.

        Returns
        -------
        The score vector at the given parameter point.

        Notes
        -----
        The mean, scaling, and smoothing parameters are packed into
        a vector.  Use `unpack` to access the component vectors.
        Ni    i   i   g      ?s   |G|=(   R|   R   R6   R   R   R7   R   R8   R9   R:   R   RL   R   R   RI   R
   R   R2   R   t   invR   R   t   TR   RH   R   t   sumRN   R   (&   R   R   Rv   Rx   Rz   R{   Ru   Rw   Ry   R   R   R	   R   t   scoreR+   R   t   sc_it   sm_it   no_it   resid_it   time_it   exog_it   exog_scale_it   exog_smooth_it   exog_noise_iR   t   cmit   jacvt   jacst   dcrt   rxt   qmt   scxR*   t   jqt   smxt   snot   bm(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR     sX    &3



/"+D33?C	$c         C   s   t  | |  j  } | S(   N(   R   R   (   R   R   t   hess(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   hessian7  s    c            s~  d | k r | d   _  n  i  } d | k r; | d } n  | d k rV   j   } n  t | t  rq | g } n | d k r d d g } n  xVt |  D]H\ } } | d k r   f d   } n d } | d k	 rt j |  r | | d <q| | t |  | d <n  t	   f d   d | d	 | d
 | d | }	 |	 j
 sd }
 | d k	 r~|
 d t j t j |	 j d   7}
 n  | t |  d k  r|
 d | | d 7}
 n  t j |
  n  t j |	 j  j   r |	 j } q q W  j |	 j  } y t j j |  } Wn t k
 r'd } n Xd d d     Y} |   } |	 j | _ | | _ |	 | _ d | _ t   |  } | S(   s  
        Fit a grouped Gaussian process regression using MLE.

        Parameters
        ----------
        start_params : array-like
            Optional starting values.
        method : string or array of strings
            Method or sequence of methods for scipy optimize.
        maxiter : int
            The maximum number of iterations in the optimization.

        Returns
        -------
        An instance of ProcessMLEResults.
        RN   t
   minim_optst   powellt   bfgsc            s     j  |   S(   N(   R   (   t   x(   R   (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR   a  s    t   maxiterc            s     j  |   S(   N(   R   (   R   (   R   (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR@   m  RA   t   methodt   x0R   t   optionss   Fitting did not converges   , |gradient|=%.6fi   i   s   , trying %s next...t   rsltc           B   s   e  Z RS(    (   R   R   (    (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR     s   N(   R   (    (   RN   RH   R   Rd   t   strR   R   t   isscalarR   R   t   successR   R   R   Rb   Rc   t   isfiniteR   t   allR   R   R   t	   ExceptionR   t   normalized_cov_paramst   optim_retvalst   scalet   ProcessMLEResults(   R   t   start_paramsR   R   RS   R   RU   t   methR   t   fR<   R   t
   cov_paramsR   t   r(    (   R   sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR~   <  s^    		*
				c   
      C   s   t  |  j d  s9 t j | |  } t j | |  } nf t j |  j j |  } t j |  j j |  }	 t j t j | |   } t j t j |	 |   } |  j	 j
 | | |  S(   s*  
        Returns a Gaussian process covariance matrix.

        Parameters
        ----------
        time : array-like
            The time points at which the fitted covariance matrix is
            calculated.
        scale_params : array-like
            The regression parameters for the scaling part
            of the covariance structure.
        smooth_params : array-like
            The regression parameters for the smoothing part
            of the covariance structure.
        scale_data : Dataframe
            The data used to determine the scale parameter,
            must have len(time) rows.
        smooth_data: Dataframe
            The data used to determine the smoothness parameter,
            must have len(time) rows.

        Returns
        -------
        A covariance matrix.

        Notes
        -----
        If the model was fit using formulas, `scale` and `smooth` should
        be Dataframes, containing all variables that were present in the
        respective scaling and smoothing formulas used to fit the model.
        Otherwise, `scale` and `smooth` should contain data arrays whose
        columns align with the fitted scaling and smoothing parameters.

        The covariance is only for the Gaussian process and does not include
        the white noise variance.
        Rk   (   RD   RF   R   R   Rf   Rg   Rk   Rl   R   RI   R
   (
   R   R   t   scale_paramst   smooth_paramst
   scale_datat   smooth_datat   scat   smoR   R	   (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt
   covariance  s    'c         O   s   | d k r |  j } n- t |  j d  rE t j |  j j |  } n  t |  | j d k ru | d | j d !} n  t	 j
 | |  S(   so  
        Obtain predictions of the mean structure.

        Parameters
        ----------
        params : array-like
            The model parameters, may be truncated to include only mean
            parameters.
        exog : array-like
            The design matrix for the mean structure.  If not provided,
            the model's design matrix is used.
        Rh   i   i    N(   RH   R7   RD   RF   Rf   Rg   Rh   R   R2   R   R   (   R   R   R7   Rr   RS   (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   predict  s    N(   R   R   R   RH   RC   R]   t   classmethodRj   R|   R   R   R   R   R~   R   R   (    (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR>      s   1
9	J			2	X	U	2R   c           B   sM   e  Z d  Z d   Z d e d  Z d   Z d   Z d d d d d  Z	 RS(   s?   
    Results class for Gaussian process regression models.
    c         C   s   t  t |   j | |  | j | j  } | d |  _ | d |  _ | d |  _ | d |  _ | j	 j
 d t | j  |  _ |  j j j
 d |  _ |  j j j
 d |  _ |  j j j
 d |  _ |  j j j
 d |  _ d  S(   Ni    i   i   i   (   RB   R   RC   R|   R   t   mean_paramsR   R   t	   no_paramsR6   R2   R   t   df_residR   R7   RO   R8   RP   R9   RQ   R:   RR   (   R   R   t   mlefitt   pa(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyRC     s    
 c         O   s`   | s t  j d  n  t |  d k s: t |  d k rJ t  j d  n  |  j j |  j |  S(   Ns'   'transform=False' is ignored in predicti    s$   extra arguments ignored in 'predict'(   Rb   Rc   R   R   R   R   (   R   R7   t	   transformRr   RS   (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR     s
    $c         C   s"   |  j  j | |  j |  j | |  S(   s  
        Returns a fitted covariance matrix.

        Parameters
        ----------
        time : array-like
            The time points at which the fitted covariance
            matrix is calculated.
        scale : array-like
            The data used to determine the scale parameter,
            must have len(time) rows.
        smooth: array-like
            The data used to determine the smoothness parameter,
            must have len(time) rows.

        Returns
        -------
        A covariance matrix.

        Notes
        -----
        If the model was fit using formulas, `scale` and `smooth` should
        be Dataframes, containing all variables that were present in the
        respective scaling and smoothing formulas used to fit the model.
        Otherwise, `scale` and `smooth` should be data arrays whose
        columns align with the fitted scaling and smoothing parameters.
        (   R   R   R   R   (   R   R   R   t   smooth(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR     s    c   
      C   s   |  j  j | } t |  d k rA d t |  } t |   n  |  j  j | d  d   f } |  j  j | d  d   f } |  j  j   \ } } } } t j	 | d | } t j	 | d | } |  j  j
 | }	 |  j  j |	 |  j |  j | |  S(   Ni    s   Group '%s' does not existR?   (   R   RL   R   R   R5   R8   R9   R]   t   pdt	   DataFrameR   R   R   R   (
   R   t   groupR   R<   R   R   R+   RZ   R[   R   (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   covariance_group  s    g?c   	      C   s  t  j   } d g |  j d g |  j d g |  j d g |  j | d <|  j | d <y& t j t j	 |  j
     | d <Wn t k
 r t j | d <n Xd d	 l m } | j | d | d
 <d | j t j | j   | d <| j d | d  } | j | | d | d | d <| j | | d | d d | d <|  j j j | _ t j   } | d  k rvd } n  | j |  | j |  | S(   Nt   Meant   Scalet   Smootht   SDt   Typet   coefs   std erri(   t   normt   tvaluesi   s   P>|t|i   s   [%.3fs   %.3f]s#   Gaussian process regression results(   R   R   RO   RP   RQ   RR   R   R   R   t   diagR   R   t   nant   scipy.stats.distributionsR   R   t   sft   absR   t   ppfR   RF   RG   t   indexR   t   SummaryRH   t	   add_titlet   add_df(	   R   t   ynamet   xnamet   titlet   alphat   dfR   R   t   summ(    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   summary7  s(    >&#!%	N(
   R   R   R   RC   RH   t   TrueR   R   R   R   (    (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyR     s   	
	 	(   R   t   numpyR   t   pandasR   Rf   t   statsmodels.base.modelt   baseR   t   statsmodels.apit   apiR	   RJ   t   statsmodels.compat.pythonR    t   scipy.optimizeR   t   statsmodels.iolibR   t   statsmodels.tools.numdiffR   Rb   t   objectR   R   R=   t   LikelihoodModelR>   t   GenericLikelihoodModelResultsR   (    (    (    sH   lib/python2.7/site-packages/statsmodels/regression/process_regression.pyt   <module>   s$   ._	  "