# Path: starterpyth/log.py
# RED = '31'
# 
# GREEN = '32'
# 
# Path: starterpyth/log.py
# def display(text, color=None, bold=False, newline=True):
#     if not isinstance(text, text_type):
#         text = text.decode('utf-8')
#     if bold and color:
#         text = u("\033[1;{0}m{1}\033[0m").format(color, text)
#     text = u("\033[{0}m{1}\033[0m").format(color, text)
#     if newline:
#         text += u('\n')
#     end = u('')
#     if __encode_stdout:
#         text = text.encode('utf-8')
#         end = b('')
#     print_(text, end=end)


from six import u, BytesIO
from starterpyth.log import RED, GREEN
from starterpyth.log import display
from distutils.core import Command
import os.path
import pdb
import token
import tokenize
    import cProfile as profile
    import profile
                import pstats

    def __init__(self, dist=None):
        Command.__init__(self, dist=dist)
        self.output = None
        self.input = None
        self.call = None
        self.debug = 0

    def initialize_options(self):
        self.output = None
        self.input = None
        self.call = None
        self.debug = 0

    def finalize_options(self):
        pass

    def run(self):
        if self.input:
            try:
                # noinspection PyUnresolvedReferences
            except ImportError:
                display('Module pstats not found.', color=RED)
                return
            if not os.path.isfile(self.input):
                display(u('File %s not found' % self.input), color=RED)
                return
            stats = pstats.Stats(self.input)
            stats.print_stats()
        elif not self.call:

# Path: starterpyth/log.py
# RED = '31'
# 
# GREEN = '32'
# 
# Path: starterpyth/log.py
# def display(text, color=None, bold=False, newline=True):
#     if not isinstance(text, text_type):
#         text = text.decode('utf-8')
#     if bold and color:
#         text = u("\033[1;{0}m{1}\033[0m").format(color, text)
#     text = u("\033[{0}m{1}\033[0m").format(color, text)
#     if newline:
#         text += u('\n')
#     end = u('')
#     if __encode_stdout:
#         text = text.encode('utf-8')
#         end = b('')
#     print_(text, end=end)


# Path: starterpyth/commands/profiling.py
from six import u, BytesIO
from starterpyth.log import RED, GREEN
from starterpyth.log import display
from distutils.core import Command
import os.path
import pdb
import token
import tokenize
    import cProfile as profile
    import profile
                import pstats


    def __init__(self, dist=None):
        Command.__init__(self, dist=dist)
        self.output = None
        self.input = None
        self.call = None
        self.debug = 0

    def initialize_options(self):
        self.output = None
        self.input = None
        self.call = None
        self.debug = 0

    def finalize_options(self):
        pass

    def run(self):
        if self.input:
            try:
                # noinspection PyUnresolvedReferences
            except ImportError:
                display('Module pstats not found.', color=RED)
                return
            if not os.path.isfile(self.input):
                display(u('File %s not found' % self.input), color=RED)
                return
            stats = pstats.Stats(self.input)
            stats.print_stats()
        elif not self.call:

            display('Please provide a function to profile with --call \'module.function\'', color=RED)