def __repr__(self):
        str_start = time.strftime('%m/%d/%Y %H:%M:%S',
                                  time.localtime(self.start))
        str_end = time.strftime('%m/%d/%Y %H:%M:%S',
                                time.localtime(self.end))
        self._stream_flush()

        time_info = 'Title: {}\n'\
                    '  Started: {}\n'\
                    '  Finished: {}\n'\
                    '  Total time elapsed: '.format(self.title,
                                                    str_start,
                                                    str_end)\
                    + self._get_time(self.total_time)
        if self.monitor:
            try:
                cpu_total = self.process.cpu_percent()
                mem_total = self.process.memory_percent()
            except __HOLE__:  # old version of psutil
                cpu_total = self.process.get_cpu_percent()
                mem_total = self.process.get_memory_percent()

            cpu_mem_info = '  CPU %: {:.2f}\n'\
                           '  Memory %: {:.2f}'.format(cpu_total, mem_total)

            return time_info + '\n' + cpu_mem_info
        else:
            return time_info
dataset/ETHPy150Open rasbt/pyprind/pyprind/prog_class.py/Prog.__repr__