call the static method show_stat_wrapper for each process
775604
def _show_stat_wrapper_multi_Progress(count, last_count, start_time, max_count, speed_calc_cycles, 
                                      width, q, last_speed, prepend, show_stat_function, len_, 
                                      add_args, lock, info_line, no_move_up=False):
    
#         print(ESC_BOLD, end='')
#         sys.stdout.flush()
    for i in range(len_):
        _show_stat_wrapper_Progress(count[i], last_count[i], start_time[i], max_count[i], speed_calc_cycles, 
                                    width, q[i], last_speed[i], prepend[i], show_stat_function,
                                    add_args, i, lock[i])
    n = len_
    if info_line is not None:
        s = info_line.value.decode('utf-8')
        s = s.split('\n')
        n += len(s)
        for si in s:
            if width == 'auto':
                width = get_terminal_width()
            if len(si) > width:
                si = si[:width]
            print("{0:<{1}}".format(si, width))
    
    if no_move_up:
        n = 0
                                # this is only a hack to find the end
                                # of the message in a stream
                                # so ESC_HIDDEN+ESC_NO_CHAR_ATTR is a magic ending
    print(terminal.ESC_MOVE_LINE_UP(n) + terminal.ESC_MY_MAGIC_ENDING, end='')
    sys.stdout.flush()
928080
def _save_as_CALLGRIND(self, path):
        
            
        header = """version: 1\ncreator: %s\npid: %d\ncmd:  %s\npart: 1\n\nevents: Ticks""" % \
            ('yappi', os.getpid(), ' '.join(sys.argv))

        lines = [header]

        # add function definitions
        file_ids = ['']
        func_ids = ['']
        for func_stat in self:
            file_ids += [ 'fl=(%d) %s' % (func_stat.index, func_stat.module) ]
            func_ids += [ 'fn=(%d) %s %s:%s' % (func_stat.index, func_stat.name, func_stat.module, func_stat.lineno) ]

        lines += file_ids + func_ids

        # add stats for each function we have a record of
        for func_stat in self:
            func_stats = [ '',
                           'fl=(%d)' % func_stat.index,
                           'fn=(%d)' % func_stat.index]
            func_stats += [ '%s %s' % (func_stat.lineno, int(func_stat.tsub * 1e6)) ]

            # children functions stats
            for child in func_stat.children:
                func_stats += [ 'cfl=(%d)' % child.index,
                                'cfn=(%d)' % child.index,
                                'calls=%d 0' % child.ncall,
                                '0 %d' % int(child.ttot * 1e6)
                                ]
            lines += func_stats
            
        file = open(path, "w")
        try:
            file.write('\n'.join(lines))                
        finally:
            file.close()
16060
def register_stats_handler(app, server_name, prefix='/status/'):
    """"""
    if not prefix.endswith('/'):
        prefix += '/'
    handler = functools.partial(bottlestats, server_name)

    app.get(prefix, callback=handler)
    app.get(prefix + '<path:path>', callback=handler)
102350
def show_plot_methods(self):
        """"""
        print_func = PlotterInterface._print_func
        if print_func is None:
            print_func = six.print_
        s = "\n".join(
            "%s\n    %s" % t for t in six.iteritems(self._plot_methods))
        return print_func(s)
1176502
def get_build_output(self, process):
        

        while True:
            output = process.stdout.readline()
            if output == b'' and process.poll() is not None:
                if process.returncode > 0:
                    raise Exception("Compilation ended with an error"
                                    ".\nSTDERR\n%s\nSTDOUT\n%s" %
                                    (process.stderr.read(),
                                     process.stdout.read()))
                return
            if output:
                # Parse the output to get current and total tasks
                # This assumes the progress displayed by waf is in the form
                # [current/total]
                matches = re.search(r'\[\s*(\d+?)/(\d+)\].*',
                                    output.strip().decode('utf-8'))
                if matches is not None:
                    yield [int(matches.group(1)), int(matches.group(2))]
725148
def each_run_stat
      return enum_for(__method__) unless block_given?

      @doc.xpath('/nmaprun/runstats/finished').each do |run_stat|
        yield RunStat.new(
          Time.at(run_stat['time'].to_i),
          run_stat['elapsed'],
          run_stat['summary'],
          run_stat['exit']
        )
      end

      return self
    end
613332
def _file_stat(self, mode, infostr, stat):
        
        action_str = mode.upper()
        info_str = infostr

        if stat == 'OK':
            self.action_st_panel.SetBackgroundColour('#00FF00')
        else:  # ERR
            self.action_st_panel.SetBackgroundColour('#FF0000')
        self.action_st.SetLabel(action_str)
        if info_str is None:
            info_str = 'Undefined File'
        self.info_st.SetLabel(info_str)
        if self.info_st.IsEllipsized():
            self.info_st.SetToolTip(wx.ToolTip(info_str))

        self.log.append({'stat': stat,
                         'logstr':
                             "[{ts}] {acts:<10s} : {infs}".format(ts=time.strftime(
                                 "%Y/%m/%d-%H:%M:%S", time.localtime()),
                                 acts=action_str,
                                 infs=info_str)})
572031
function _fnProcessingDisplay ( oSettings, bShow )
		{
			if ( oSettings.oFeatures.bProcessing )
			{
				var an = oSettings.aanFeatures.r;
				for ( var i=0, iLen=an.length ; i<iLen ; i++ )
				{
					an[i].style.visibility = bShow ? "visible" : "hidden";
				}
			}
		
			$(oSettings.oInstance).trigger('processing', [oSettings, bShow]);
		}
1090152
def output(self):
        
        def decorator(outputMethod):
            return MethodicalOutput(machine=self, method=outputMethod)
        return decorator
903050
def export(self, input_stats=None):
        
        # threads = []
        input_stats = input_stats or {}

        for e in self._exports:
            logger.debug("Export stats using the %s module" % e)
            thread = threading.Thread(target=self._exports[e].update,
                                      args=(input_stats,))
            # threads.append(thread)
            thread.start()
34200
def method_wrapper(m):
    """"""

    if m.is_simple:
        def simple_method(self):
            """TODO: no docstring!"""
            return apply_transform(
                self.__service__, m.output_transform,
                grpc_call(self.__service__, m, unwrap(self)))

        return simple_method

    elif m.input_transform is not None:
        def transform_method(self, *args, **kwargs):
            """TODO: no docstring!"""
            request = m.input_transform(self, *args, **kwargs)
            return apply_transform(
                self.__service__, m.output_transform,
                grpc_call(self.__service__, m, request))

        return transform_method

    elif m.static:
        def static_method(cls, *args, **kwargs):
            """TODO: no docstring!"""
            request = make_static_request(m, *args, **kwargs)
            return apply_transform(
                cls.__stub__(__server__), m.output_transform,
                grpc_call(cls.__stub__(__server__), m, request))

        return static_method

    else:
        def request_method(self, *args, **kwargs):
            """TODO: no docstring!"""
            request = make_request(self, m, *args, **kwargs)
            return apply_transform(
                self.__service__, m.output_transform,
                grpc_call(self.__service__, m, request))

        return request_method
530131
def process_and_show(self):
        
        for name, klass in sorted(self.classes.items()):
            logger.debug('Processing class: %s', name)
            if not isinstance(klass, DvClass):
                klass = DvClass(klass, self.vma)
            klass.process()
            klass.show_source()
604434
def decorate_method(cls, func):
        
        func_args = [arg for arg in function_arguments(func) if arg != 'self']
        method_return_types = \
            Endpoint._parse_function_return_types_from_doc(func.__doc__)
        name = '%s.%s' % (cls.path, func.__name__)

        @wraps(func)
        def method_decorator(self, *args, **kwargs):
            for i in range(len(args)):
                kwargs[func_args[i]] = args[i]

            api_call = self.connection._pre_process_call(
                name, endpoint_params=kwargs)
            try:
                data = func(**kwargs)
            except RestException as e:
                api_call.error = e
                raise e

            except Exception as e:
                call_queue = self.connection._call_queue.get(
                    self.connection._get_thread_id(), [])
                if api_call in call_queue:
                    call_queue.remove(api_call)
                e = RestException(original_error=e,
                                  stack=traceback.format_exc())
                log.error('ApiCall Exception: %s' % e, exc_info=True)
                raise e
            return self.connection._post_process_call(
                api_call, data, method_return_types)

        method_decorator.rest_method = True
        return method_decorator
1347136
def main(arguments=None):   # suppress(unused-function)
    """"""
    result = _parse_arguments(arguments)
    linter_funcs = _ordered(linter_functions_from_filters,
                            result.whitelist,
                            result.blacklist)
    global_options = vars(result)
    tool_options = tool_options_from_global(global_options, len(result.files))
    any_would_run = _any_would_run(_run_lint_on_file_exceptions,
                                   result.files,
                                   result.stamp_file_path,
                                   result.log_technical_terms_to,
                                   linter_funcs,
                                   tool_options,
                                   result.fix_what_you_can)

    if any_would_run:
        for linter_function in linter_funcs.values():
            if linter_function.before_all:
                linter_function.before_all(global_options, tool_options)

        use_multiprocessing = _should_use_multiprocessing(len(result.files))
    else:
        use_multiprocessing = False

    if use_multiprocessing:
        mapper = parmap.map
    else:
        # suppress(E731)
        mapper = lambda f, i, *a: [f(*((x, ) + a)) for x in i]

    errors = list(itertools.chain(*mapper(_run_lint_on_file_stamped,
                                          result.files,
                                          result.stamp_file_path,
                                          result.log_technical_terms_to,
                                          linter_funcs,
                                          tool_options,
                                          result.fix_what_you_can)))

    for error in sorted(errors):
        _report_lint_error(error.failure, os.path.relpath(error.absolute_path))

    if any_would_run:
        for linter_funcs in linter_funcs.values():
            if linter_funcs.after_all:
                linter_funcs.after_all(global_options, tool_options)

    return len(errors)
928812
public static void callProc(Object instance, Class<?> type, String methodName, Class<?>[] types, Object... args) {
		try {
			final Method method = type.getDeclaredMethod(methodName, types);
			method.setAccessible(true);
			method.invoke(instance, args);
		} catch (Exception exception) {
			throw new Error(exception);
		}
	}
616249
def stats_printer(stats_queue):
  """"""
  proc_stats = [ProcessStats(i) for i in range(FLAGS.parallel)]
  print_time = start_time = time.time()
  width = 107

  running = True
  while running:
    print_time += 10

    while time.time() < print_time:
      try:
        s = stats_queue.get(True, print_time - time.time())
        if s is None:  # Signal to print and exit NOW!
          running = False
          break
        proc_stats[s.proc_id] = s
      except queue.Empty:
        pass

    replay_stats = ReplayStats()
    for s in proc_stats:
      replay_stats.merge(s.replay_stats)

    print((" Summary %0d secs " % (print_time - start_time)).center(width, "="))
    print(replay_stats)
    print(" Process stats ".center(width, "-"))
    print("\n".join(str(s) for s in proc_stats))
    print("=" * width)
753578
def show_processing(message=""):
    

    def show_processingDecorator(object):
        """
        Shows processing behavior.

        :param object: Object to decorate.
        :type object: object
        :return: Object.
        :rtype: object
        """

        @functools.wraps(object)
        def show_processingWrapper(*args, **kwargs):
            """
            Shows processing behavior.

            :param \*args: Arguments.
            :type \*args: \*
            :param \*\*kwargs: Keywords arguments.
            :type \*\*kwargs: \*\*
            """

            RuntimeGlobals.engine.start_processing(message, warning=False)
            try:
                return object(*args, **kwargs)
            finally:
                RuntimeGlobals.engine.stop_processing(warning=False)

        return show_processingWrapper

    return show_processingDecorator