Print a formatted summary of the current solve state.
13196
def dump(self):
        """"""
        from rez.utils.formatting import columnise

        rows = []
        for i, phase in enumerate(self.phase_stack):
            rows.append((self._depth_label(i), phase.status, str(phase)))

        print "status: %s (%s)" % (self.status.name, self.status.description)
        print "initial request: %s" % str(self.request_list)
        print
        print "solve stack:"
        print '\n'.join(columnise(rows))

        if self.failed_phase_list:
            rows = []
            for i, phase in enumerate(self.failed_phase_list):
                rows.append(("#%d" % i, phase.status, str(phase)))
            print
            print "previous failures:"
            print '\n'.join(columnise(rows))
281374
def print_status(self):
        """"""
        s = []
        s.append('=== State Machines: ===\n')
        for stm_id in Driver._stms_by_id:
            stm = Driver._stms_by_id[stm_id]
            s.append('    - {} in state {}\n'.format(stm.id, stm.state))
        s.append('=== Events in Queue: ===\n')
        for event in self._event_queue.queue:
            if event is not None:
                s.append('    - {} for {} with args:{} kwargs:{}\n'.format(
                    event['id'], event['stm'].id,
                    event['args'], event['kwargs']))
        s.append('=== Active Timers: {} ===\n'.format(len(self._timer_queue)))
        for timer in self._timer_queue:
            s.append('    - {} for {} with timeout {}\n'.format(
                timer['id'], timer['stm'].id, timer['timeout']))
        s.append('=== ================ ===\n')
        return ''.join(s)
656816
def print_usage():
    

    print('Usage: ' + os.path.basename(sys.argv[0]) + ' [options] dimacs-file')
    print('Options:')
    print('        -h, --help       Show this message')
    print('        -m, --model      Print model')
    print('        -s, --solver     SAT solver to use')
    print('                         Available values: g3, g4, m22, mgh (default = g4)')
    print('        -v, --verbose    Be verbose')
1010855
def _charSummary(self, char_count, block_count=None):
        
        if not self._display['omit_summary']:
            if block_count is None:
                print('Total code points:', char_count)
            else:
                print('Total {0} code point{1} in {2} block{3}'.format(
                    char_count,
                    's' if char_count != 1 else '',
                    block_count,
                    's' if block_count != 1 else ''
                ))
556290
def as_dict_summary(self, print_subelectrodes=True):
        
        chg_comp = self.fully_charged_entry.composition
        dischg_comp = self.fully_discharged_entry.composition

        ion = self.working_ion
        d = {"average_voltage": self.get_average_voltage(),
             "max_voltage": self.max_voltage,
             "min_voltage": self.min_voltage,
             "max_delta_volume": self.max_delta_volume,
             "max_voltage_step": self.max_voltage_step,
             "capacity_grav": self.get_capacity_grav(),
             "capacity_vol": self.get_capacity_vol(),
             "energy_grav": self.get_specific_energy(),
             "energy_vol": self.get_energy_density(),
             "working_ion": self._working_ion.symbol,
             "nsteps": self.num_steps,
             "framework": self._vpairs[0].framework.to_data_dict,
             "formula_charge": chg_comp.reduced_formula,
             "id_charge": self.fully_charged_entry.entry_id,
             "formula_discharge": dischg_comp.reduced_formula,
             "id_discharge": self.fully_discharged_entry.entry_id,
             "fracA_charge": chg_comp.get_atomic_fraction(ion),
             "fracA_discharge": dischg_comp.get_atomic_fraction(ion),
             "max_instability": self.get_max_instability(),
             "min_instability": self.get_min_instability(),
             "material_ids" : [itr_ent.entry_id for itr_ent in self._entries],
             "stable_material_ids" : [itr_ent.entry_id for itr_ent in self.get_stable_entries()],
             "unstable_material_ids": [itr_ent.entry_id for itr_ent in self.get_unstable_entries()],
             }

        if all(['decomposition_energy' in itr_ent.data for itr_ent in self._entries]):
            d.update({"stability_charge": self.fully_charged_entry.data['decomposition_energy'],
                 "stability_discharge": self.fully_discharged_entry.data['decomposition_energy'],
                 "stability_data":{itr_ent.entry_id: itr_ent.data['decomposition_energy'] for itr_ent in self._entries},
                 })

        if all(['muO2' in itr_ent.data for itr_ent in self._entries]):
            d.update({"muO2_data" : {itr_ent.entry_id: itr_ent.data['muO2'] for itr_ent in self._entries}})

        if print_subelectrodes:
            f_dict = lambda c: c.as_dict_summary(print_subelectrodes=False)
            d["adj_pairs"] = list(map(f_dict,
                                 self.get_sub_electrodes(adjacent_only=True)))
            d["all_pairs"] = list(map(f_dict,
                                 self.get_sub_electrodes(adjacent_only=False)))
        return d
1247710
def summary(self, recurse=False):
        
        six.print_('Table summary:', self.name())
        six.print_('Shape:', self.ncols(), 'columns by', self.nrows(), 'rows')
        six.print_('Info:', self.info())
        tkeys = self.getkeywords()
        if (len(tkeys) > 0):
            six.print_('Table keywords:', tkeys)
        columns = self.colnames()
        if (len(columns) > 0):
            six.print_('Columns:', columns)
            for column in columns:
                ckeys = self.getcolkeywords(column)
                if (len(ckeys) > 0):
                    six.print_(column, 'keywords:', ckeys)
        if (recurse):
            for key, value in tkeys.items():
                tabname = _remove_prefix(value)
                six.print_('Summarizing subtable:', tabname)
                lt = table(tabname)
                if (not lt.summary(recurse)):
                    break
        return True
837521
def show_help(self):
        """"""
        print("Sorry, not well understood.")
        print("- use", str(self.yes_input), "to answer 'YES'")
        print("- use", str(self.no_input), "to answer 'NO'")
294753
def show(self):
        
        print("StringBlock(stringsCount=0x%x, "
              "stringsOffset=0x%x, "
              "stylesCount=0x%x, "
              "stylesOffset=0x%x, "
              "flags=0x%x"
              ")" % (self.stringCount,
                     self.stringsOffset,
                     self.styleCount,
                     self.stylesOffset,
                     self.flags))

        if self.stringCount > 0:
            print()
            print("String Table: ")
            for i, s in enumerate(self):
                print("{:08d} {}".format(i, repr(s)))

        if self.styleCount > 0:
            print()
            print("Styles Table: ")
            for i in range(self.styleCount):
                print("{:08d} {}".format(i, repr(self.getStyle(i))))
1374061
def print_solution(solution):
    
    total_cost = 0
    for solution in solution.routes():
        cost = solution.length()
        total_cost = total_cost + cost
        print('{}: {}'.format(solution, cost))
        #print('xxx')
    print('Total cost: {}'.format(total_cost))
1200277
def print_stat(x, message=None):
    
    if message is None:
        message = x.op.name
    lst = [tf.shape(x), tf.reduce_mean(x)]
    if x.dtype.is_floating:
        lst.append(rms(x))
    return tf.Print(x, lst + [x], summarize=20,
                    message=message, name='print_' + x.op.name)
450628
def info(text, *args, **kwargs):
    ''''''
    text = text.format(*args, **kwargs)
    print(' '.join((purple('>>>'), text)))
    sys.stdout.flush()
1176214
def Print(self):
        """"""
        for val, prob in sorted(self.d.iteritems()):
            print(val, prob)
62002
public synchronized void printStatistics() {
        // quickly memoize and update counters, get the time, record update time, etc...
        long nowSuccesses = incrementCount.get();
        long nowFailures = failureCount.get();
        long prevSuccesss = lastPeriod.getAndSet(nowSuccesses);
        long endTime = System.currentTimeMillis();
        long startTime = lastStatsReportTS;
        lastStatsReportTS = endTime;

        // do math with as much safety as possible
        long invocationsCompleted = Math.max(nowSuccesses - prevSuccesss, 0);
        long periodDurationMs = Math.max(endTime - startTime, 1);
        long cumulativeDurationMs = Math.max(endTime - benchmarkStartTS, 1);
        long periodThroughput = (long) (invocationsCompleted / (periodDurationMs / 1000.0));
        long cumulativeThroughput = (long) (nowSuccesses / (cumulativeDurationMs / 1000.0));
        long time = (long) (Math.round(endTime - benchmarkStartTS) / 1000.0);

        // print out periodic report
        System.out.printf("%02d:%02d:%02d ", time / 3600, (time / 60) % 60, time % 60);
        System.out.printf("Period Throughput %10d/s, ", periodThroughput);
        System.out.printf("Cumulative Throughput %10d/s, ", cumulativeThroughput);
        System.out.printf("Total Failures %10d", nowFailures);
        System.out.printf("\n");
    }
134173
def printComputeEnd(self, output, learn=False):
    
    if self.verbosity >= 3:
      print "----- computeEnd summary: "
      print "numBurstingCols: %s, " % (self.activeState['t'].min(axis=1).sum()),
      print "curPredScore2: %s, " % (self._internalStats['curPredictionScore2']),
      print "curFalsePosScore: %s, " % (self._internalStats['curFalsePositiveScore']),
      print "1-curFalseNegScore: %s, " % (1-self._internalStats['curFalseNegativeScore']),
      print "numPredictedCells[t-1]: %s" % (self.predictedState['t-1'].sum()),
      print "numSegments: ",self.getNumSegments()

      print "----- activeState (%d on) ------" \
              % (self.activeState['t'].sum())
      self.printActiveIndices(self.activeState['t'])
      if self.verbosity >= 5:
        self.printState(self.activeState['t'])

      print "----- predictedState (%d on)-----" \
              % (self.predictedState['t'].sum())
      self.printActiveIndices(self.predictedState['t'])
      if self.verbosity >= 5:
        self.printState(self.predictedState['t'])

      print "----- cell confidence -----"
      self.printActiveIndices(self.confidence['t'], andValues=True)
      if self.verbosity >= 5:
        self.printConfidence(self.confidence['t'])

      print "----- confidence[t-1] for currently active cells -----"
      cc = self.confidence['t-1'] * self.activeState['t']
      self.printActiveIndices(cc, andValues=True)

      if self.verbosity == 4:
        print "Cells, predicted segments only:"
        self.printCells(predictedOnly=True)
      elif self.verbosity >= 5:
        print "Cells, all segments:"
        self.printCells(predictedOnly=False)
      print
665091
def nsummary(self,prn=None, lfilter=None):
        """"""
        for i, p in enumerate(self.res):
            if lfilter is not None:
                if not lfilter(p):
                    continue
            print(conf.color_theme.id(i,fmt="%04i"), end = " ")
            if prn is None:
                print(self._elt2sum(p))
            else:
                print(prn(p))
708435
def _print_breakdown(cls, savedir, fname, data):
        """"""
        if not os.path.exists(savedir):
            os.makedirs(savedir)

        with open(os.path.join(savedir, fname), 'w') as fout:
            fout.write(data)
1263545
def summary_str(self) -> str:
        """"""
        return '{}\n'.format(self) + '\n'.join(
            '{}: {}'.format(label, value)
            for label, value in self._describe_list()
        )