Print current topics
357168
def what():
    """"""

    if not self.isactive():
        lib.echo("No topic")
        sys.exit(lib.USER_ERROR)

    lib.echo(os.environ.get("BE_TOPICS", "This is a bug"))
828337
def print_settings(settings, depth=0):
    """"""
    # handle the case where a single setting is passed
    if isinstance(settings, Setting):
        settings = [settings]
    for setting in settings:
        cur = setting.currentValue
        print(
            "%s* %s (%s, value: %s, type: %s)"
            % (
                " " * depth,
                setting.title,
                setting.target,
                click.style(cur, bold=True),
                setting.type,
            )
        )
        for opt in setting.candidate:
            if not opt.isAvailable:
                logging.debug("Unavailable setting %s", opt)
                continue
            click.echo(
                click.style(
                    "%s  - %s (%s)" % (" " * depth, opt.title, opt.value),
                    bold=opt.value == cur,
                )
            )
672588
def print_progress(self, i, current_params):
        
        for split in range(1,11):
            if i == (round(self.iterations/10*split)-1):
                post = -self.full_neg_posterior(current_params)
                approx = self.create_normal_logq(current_params)
                diff = post - approx
                if not self.quiet_progress:
                    print(str(split) + "0% done : ELBO is " + str(diff) + ", p(y,z) is " + str(post) + ", q(z) is " + str(approx))
1108802
def print_status(self, indent="", recurse=False):
        """"""
        print ("%s%30s : %15s : %20s" %
               (indent, "Linkname", "Link Status", "Jobs Status"))
        for link in self._links.values():
            if hasattr(link, 'check_status'):
                status_vect = link.check_status(
                    stream=sys.stdout, no_wait=True, do_print=False)
            else:
                status_vect = None
            key = JobDetails.make_fullkey(link.full_linkname)
            link_status = JOB_STATUS_STRINGS[link.check_job_status(key)]
            if status_vect is None:
                jobs_status = JOB_STATUS_STRINGS[link.check_jobs_status()]
            else:
                jobs_status = status_vect
            print ("%s%30s : %15s : %20s" %
                   (indent, link.linkname, link_status, jobs_status))
            if hasattr(link, 'print_status') and recurse:
                print ("----------   %30s    -----------" % link.linkname)
                link.print_status(indent + "  ", recurse=True)
                print ("------------------------------------------------")
266779
def PrintStats(self):
    """"""
    self.BuildStats()
    self.PrintSummaryTable()
    self.PrintSourceTypeTable()
    self.PrintOSTable()
    self.PrintLabelTable()
916685
def _print mode, text, opts, caler, bind, cfg
      log_ = opts&NOLOG==0
      print_ = opts&NOPRINT==0
      str = cfg.fmt.dup
      str.gsub! "%mode", @highlight[mode]
      if bind
        text = bind.report text
      elsif !text.is String
        text = text.inspect
      elsif cfg.detect_comments and text =~ /\A[ \t]*#[ \t]+\S/
        text = "\n" + @c.green(text.gsub(/^([ \t]*#[ \t])?/, cfg.precede_comments).chop)
      end
      out = cfg.out
      if cfg._time or cfg.path_format
        now = Time.now
        if cfg._time
          time = now.strftime cfg.tf[0]
          time << ".#{cfg.tf[1]%[now.usec/1000]}" if cfg.tf[1]
          str.gsub! "%time", time
        end
        out = now.strftime cfg.out if cfg.path_format
      end
      if caler
        caler.sub!(/block (?:\((\d+) levels\) )?in/) {"{#{$1||1}}"}
        str.gsub! "%caller", caler.sub(String::SIMPLE_CALLER_RE, cfg.cf)
      end
      str.gsub! "%text", text
      str << "\n" if opts&INLINE==0
      log_str = cfg.color_out ? str : @c.clean(str)
      RMTools.write out, log_str if log_
      Kernel::print str if print_
    end
328005
def print(self, *args, **kwargs):
        '''
        
        '''
        if self._last_args and self._last_args.verbose:
            print(*args, **kwargs)
297191
def Print(self):
        """"""
        for hypo, prob in sorted(self.Items()):
            print(hypo, prob)
1128296
def view(self):
        
        print(self.format(remove='bnode',
                          sort=True,
                          pretty=True,
                          compress=True,
                          output='json',
                          add_ids=True))
123818
def list(self, cur_p=''):
        '''
        
        '''

        if cur_p == '':
            current_page_number = 1
        else:
            current_page_number = int(cur_p)

        current_page_number = 1 if current_page_number < 1 else current_page_number

        pager_num = int(MLog.total_number() / CMS_CFG['list_num'])
        kwd = {
            'pager': '',
            'title': '',
            'current_page': current_page_number,
        }

        if self.is_p:
            self.render('admin/log_ajax/user_list.html',
                        kwd=kwd,
                        user_list=MLog.query_all_user(),
                        no_user_list=MLog.query_all(current_page_num=current_page_number),
                        format_date=tools.format_date,
                        userinfo=self.userinfo)
        else:
            self.render('misc/log/user_list.html',
                        kwd=kwd,
                        user_list=MLog.query_all_user(),
                        no_user_list=MLog.query_all(current_page_num=current_page_number),
                        format_date=tools.format_date,
                        userinfo=self.userinfo)
77671
static void printMyTimeLine(){
    long [] s = TimeLine.snapshot();
    System.err.println("===================================<TIMELINE>==============================================");
    for(int i = 0; i < TimeLine.length(); ++i) {
      long lo = TimeLine.l0(s, i),hi = TimeLine.l8(s, i);
      int port = (int)((lo >> 8) & 0xFFFF);
      String op = TimeLine.send_recv(s,i) == 0?"SEND":"RECV";
      if(!TimeLine.isEmpty(s, i) && (lo & 0xFF) == UDP.udp.exec.ordinal())
        System.err.println(TimeLine.ms(s, i) + ": " + op + " " + (((TimeLine.ns(s, i) & 4) != 0)?"TCP":"UDP")  +  TimeLine.inet(s, i) + ":" + port + " | " + UDP.printx16(lo, hi));
    }
    System.err.println("===========================================================================================");
  }
1073055
def list(self, cur_p=''):
        '''
        
        '''
        if cur_p == '':
            current_page_number = 1
        else:
            current_page_number = int(cur_p)

        current_page_number = 1 if current_page_number < 1 else current_page_number

        pager_num = int(MReply.total_number() / CMS_CFG['list_num'])

        kwd = {'pager': '',
               'current_page': current_page_number,
               'title': '单页列表'}
        self.render('admin/reply_ajax/reply_list.html',
                    kwd=kwd,
                    view_all=MReply.query_all(),
                    infos=MReply.query_pager(current_page_num=current_page_number),
                    userinfo=self.userinfo
                    )
451407
def user_recent(self):
        '''
        
        '''
        kwd = {
            'pager': '',
            'title': ''
        }
        self.render('user/info_list/user_recent.html',
                    kwd=kwd,
                    user_name=self.get_current_user(),
                    userinfo=self.userinfo)
891550
def print_ldamodel_doc_topics(doc_topic_distrib, doc_labels, n_top=3, val_labels=DEFAULT_TOPIC_NAME_FMT):
    """"""
    print_ldamodel_distribution(doc_topic_distrib, row_labels=doc_labels, val_labels=val_labels,
                                top_n=n_top)
696855
private void printUsage() {

        String WINDOWS_SAMPLE_PATH = "C:\\temp\\newRepository";
        String UNIX_SAMPLE_PATH = "/tmp/newRepository";

        Calendar calendar = Calendar.getInstance();
        DateFormat df1 = new SimpleDateFormat(getLocalizedString("CWTRA0001I"));
        DateFormat df2 = new SimpleDateFormat(getLocalizedString("CWTRA0003I"));
        DateFormat df3 = new SimpleDateFormat(getLocalizedString("CWTRA0002I"));

        //sample to display   -startDate 1/30/09
        calendar.set(2009, 0, 30);
        Date date = calendar.getTime();
        String fStartDate1 = df1.format(date);

        //sample to display -startDate "1/30/09 04:00:00:100 CST"
        calendar.set(2009, 0, 30, 4, 0, 0);
        calendar.set(Calendar.MILLISECOND, 100);
        date = calendar.getTime();
        String fStartDate2 = df2.format(date);

        //sample to display  -stopDate 5/28/09
        calendar.set(2009, 4, 28);
        date = calendar.getTime();
        String fStopDate1 = df1.format(date);

        //sample to display -stopDate "6/28/09 14:32:9:763 CDT"
        calendar.set(2009, 4, 28, 14, 32, 9);
        calendar.set(Calendar.MILLISECOND, 100);
        date = calendar.getTime();
        String fStopDate2 = df2.format(date);

        //sample to display begin range "April 27,2010 1:30 A.M. CDT"
        calendar.set(2010, 3, 27, 1, 30, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        date = calendar.getTime();
        String fBeginDate3 = df3.format(date);
        //display -startDate "04/27/10 01:30:00:000 CDT"
        String fStartDate3 = df2.format(date);

        //sample to display begin range" April 27,2010 1:35 A.M. CDT"
        calendar.set(2010, 3, 27, 1, 35, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        date = calendar.getTime();
        String fEndDate3 = df3.format(date);
        //display -stopDate "04/27/10 01:35:00:000 CDT"
        String fStopDate3 = df2.format(date);

        String uDesc = getLocalizedString("CWTRA0031I");
        String uUsage = getLocalizedString("CWTRA0033I");
        StringBuilder uOptions = new StringBuilder(300);
        uOptions.append(getLocalizedString("CWTRA0034I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0035I") + "\n\n" + getLocalizedString("CWTRA0036I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0037I") + "\n\n"
                        + getLocalizedParmString("CWTRA0038I", new Object[] { getLocalizedString("CWTRA0074I"), getLocalizedString("CWTRA0075I") }));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedParmString("CWTRA0039I", new Object[] { fStartDate1, fStartDate2 }));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0040I") + "\n\n"
                        + getLocalizedParmString("CWTRA0041I", new Object[] { getLocalizedString("CWTRA0074I"), getLocalizedString("CWTRA0075I") }));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedParmString("CWTRA0042I", new Object[] { fStopDate1, fStopDate2 }));
        uOptions.append("\n\n");
        uOptions.append("-level ").append(levelString).append("\n\n").append(getLocalizedString("CWTRA0044I"));
        uOptions.append("\n\n");
        uOptions.append("-minLevel ").append(levelString).append("\n\n").append(getLocalizedString("CWTRA0046I"));
        uOptions.append("\n\n");
        uOptions.append("-maxLevel ").append(levelString).append("\n\n").append(getLocalizedString("CWTRA0048I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0049I") + "\n\n" + getLocalizedString("CWTRA0050I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0053I") + "\n\n" + getLocalizedString("CWTRA0052I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0055I") + "\n\n" + getLocalizedString("CWTRA0056I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0057I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0058I") + "\n\n" + getLocalizedString("CWTRA0059I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0060I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0061I") + "\n\n" + getLocalizedString("CWTRA0062I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0065I") + "\n\n" + getLocalizedString("CWTRA0066I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0067I") + "\n\n" + getLocalizedString("CWTRA0068I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("CWTRA0069I") + "\n\n" + getLocalizedString("CWTRA0070I"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("LVM_HELP_LATESTINSTANCE") + "\n\n" + getLocalizedString("LVM_HELP_LATESTINSTANCE_DESCR"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("LVM_HELP_MESSAGE") + "\n\n" + getLocalizedString("LVM_HELP_MESSAGE_DESCR"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("LVM_HELP_EXTENSIONS") + "\n\n" + getLocalizedString("LVM_HELP_EXTENSIONS_DESCR"));
        uOptions.append("\n\n");
        uOptions.append(getLocalizedString("LVM_HELP_ENCODING") + "\n\n" + getLocalizedString("LVM_HELP_ENCODING_DESCR"));

        System.out.println(uDesc + "\n\n");
        System.out.println(uUsage + "\n\n");
        System.out.println(uOptions + "\n\n");
        System.out.println(getLocalizedString("LVM_HELP_SAMPLES_INTRO") + "\n\n");
        System.out.println(getLocalizedString("LVM_HELP_SAMPLE1") + "\n\n");
        System.out.println(getLocalizedString("LVM_HELP_SAMPLE4") + "\n\n");
        System.out.println(getLocalizedParmString("LVM_HELP_SAMPLE2", new Object[] { fBeginDate3, fEndDate3, fStartDate3, fStopDate3 }) + "\n\n");

        if (File.separator.equals("/")) {
            System.out.println(getLocalizedParmString("LVM_HELP_SAMPLE3", new Object[] { fBeginDate3, UNIX_SAMPLE_PATH, fStartDate3 }));
        } else {
            System.out.println(getLocalizedParmString("LVM_HELP_SAMPLE3", new Object[] { fBeginDate3, WINDOWS_SAMPLE_PATH, fStartDate3 }));
        }

    }
19218
static function printTopReportsList()
    {
        $debug = eZDebug::instance();
        $reportNames = array_keys( $debug->topReportsList );
        foreach ( $reportNames as $reportName )
        {
            echo $debug->topReportsList[$reportName];
        }
    }
735622
def broadcast_dollar_sys_topics(self):
        

        # Update stats
        uptime = datetime.now() - self._stats[STAT_START_TIME]
        client_connected = self._stats[STAT_CLIENTS_CONNECTED]
        client_disconnected = self._stats[STAT_CLIENTS_DISCONNECTED]
        inflight_in = 0
        inflight_out = 0
        messages_stored = 0
        for session in self.context.sessions:
            inflight_in += session.inflight_in_count
            inflight_out += session.inflight_out_count
            messages_stored += session.retained_messages_count
        messages_stored += len(self.context.retained_messages)
        subscriptions_count = 0
        for topic in self.context.subscriptions:
            subscriptions_count += len(self.context.subscriptions[topic])

        # Broadcast updates
        tasks = deque()
        tasks.append(self.schedule_broadcast_sys_topic('load/bytes/received', int_to_bytes_str(self._stats[STAT_BYTES_RECEIVED])))
        tasks.append(self.schedule_broadcast_sys_topic('load/bytes/sent', int_to_bytes_str(self._stats[STAT_BYTES_SENT])))
        tasks.append(self.schedule_broadcast_sys_topic('messages/received', int_to_bytes_str(self._stats[STAT_MSG_RECEIVED])))
        tasks.append(self.schedule_broadcast_sys_topic('messages/sent', int_to_bytes_str(self._stats[STAT_MSG_SENT])))
        tasks.append(self.schedule_broadcast_sys_topic('time', str(datetime.now()).encode('utf-8')))
        tasks.append(self.schedule_broadcast_sys_topic('uptime', int_to_bytes_str(int(uptime.total_seconds()))))
        tasks.append(self.schedule_broadcast_sys_topic('uptime/formated', str(uptime).encode('utf-8')))
        tasks.append(self.schedule_broadcast_sys_topic('clients/connected', int_to_bytes_str(client_connected)))
        tasks.append(self.schedule_broadcast_sys_topic('clients/disconnected', int_to_bytes_str(client_disconnected)))
        tasks.append(self.schedule_broadcast_sys_topic('clients/maximum', int_to_bytes_str(self._stats[STAT_CLIENTS_MAXIMUM])))
        tasks.append(self.schedule_broadcast_sys_topic('clients/total', int_to_bytes_str(client_connected + client_disconnected)))
        tasks.append(self.schedule_broadcast_sys_topic('messages/inflight', int_to_bytes_str(inflight_in + inflight_out)))
        tasks.append(self.schedule_broadcast_sys_topic('messages/inflight/in', int_to_bytes_str(inflight_in)))
        tasks.append(self.schedule_broadcast_sys_topic('messages/inflight/out', int_to_bytes_str(inflight_out)))
        tasks.append(self.schedule_broadcast_sys_topic('messages/inflight/stored', int_to_bytes_str(messages_stored)))
        tasks.append(self.schedule_broadcast_sys_topic('messages/publish/received', int_to_bytes_str(self._stats[STAT_PUBLISH_RECEIVED])))
        tasks.append(self.schedule_broadcast_sys_topic('messages/publish/sent', int_to_bytes_str(self._stats[STAT_PUBLISH_SENT])))
        tasks.append(self.schedule_broadcast_sys_topic('messages/retained/count', int_to_bytes_str(len(self.context.retained_messages))))
        tasks.append(self.schedule_broadcast_sys_topic('messages/subscriptions/count', int_to_bytes_str(subscriptions_count)))

        # Wait until broadcasting tasks end
        while tasks and tasks[0].done():
            tasks.popleft()
        # Reschedule
        sys_interval = int(self.context.config['sys_interval'])
        self.context.logger.debug("Broadcasting $SYS topics")
        self.sys_handle = self.context.loop.call_later(sys_interval, self.broadcast_dollar_sys_topics)