File: //opt/alt/python35/lib64/python3.5/__pycache__/profile.cpython-35.pyc
��YfV  �               @   s�   d  Z  d d l Z d d l Z d d l Z d d l Z d d l m Z d d d g Z Gd d �  d � Z d d	 d
 d � Z	 d d	 d d � Z
 Gd d �  d � Z d
 d �  Z e
 d k r� e �  d S)z Class for profiling Python code.�    N)�OptionParser�run�runctx�Profilec               @   sF   e  Z d  Z d Z d d �  Z d d �  Z d d �  Z d d	 �  Z d
 S)�_Utilsz�Support class for utility functions which are shared by
    profile.py and cProfile.py modules.
    Not supposed to be used directly.
    c             C   s
   | |  _  d  S)N)�profiler)�selfr   � r	   �,/opt/alt/python35/lib64/python3.5/profile.py�__init__1   s    z_Utils.__init__c             C   sQ   |  j  �  } z* y | j | � Wn t k
 r4 Yn XWd  |  j | | | � Xd  S)N)r   r   �
SystemExit�_show)r   �	statement�filename�sort�profr	   r	   r
   r   4   s    
	z
_Utils.runc             C   sW   |  j  �  } z0 y | j | | | � Wn t k
 r: Yn XWd  |  j | | | � Xd  S)N)r   r   r   r
   )r   r   �globals�localsr   r   r   r	   r	   r
   r   =   s    
	z
_Utils.runctxc             C   s-   | d  k	 r | j  | � n
 | j | � d  S)N)�
dump_stats�print_stats)r   r   r   r   r	   r	   r
   r
   F   s    z_Utils._showN)�__name__�
__module__�__qualname__�__doc__r   r   r   r
   r	   r	   r	   r
   r   +   s
   		r   �   c             C   s   t  t � j |  | | � S)a  Run statement under profiler optionally saving results in filename
    This function takes a single argument that can be passed to the
    "exec" statement, and an optional file name.  In all cases this
    routine attempts to "exec" its first argument and gather profiling
    statistics from the execution. If no file name is present, then this
    function automatically prints a simple profiling report, sorted by the
    standard name string (file/line/function-name) that is presented in
    each line.
    )r   r   r   )r   r   r   r	   r	   r
   r   R   s    c             C   s   t  t � j |  | | | | � S)z�Run statement under profiler, supplying your own globals and locals,
    optionally saving results in filename.
    statement and filename have the same semantics as profile.run
    )r   r   r   )r   r   r   r   r   r	   r	   r
   r   _   s    c               @   st  e  Z d  Z d Z d Z d d d d � Z d d �  Z d d	 �  Z d
 d �  Z d d
 �  Z	 d d �  Z
 d d �  Z d d �  Z d d �  Z
 d e d e
 d e
 d e d e
 d e
 i Z d d �  Z Gd d �  d � Z Gd  d! �  d! � Z d"