Display how many of the direct statements have been converted.

        Also prints how many are considered 'degenerate' and not converted.
548872
def print_statement_coverage(self):
        """"""

        if not self.all_direct_stmts:
            self.get_all_direct_statements()
        if not self.degenerate_stmts:
            self.get_degenerate_statements()
        if not self.all_indirect_stmts:
            self.get_all_indirect_statements()

        logger.info('')
        logger.info("Total indirect statements: %d" %
                     len(self.all_indirect_stmts))
        logger.info("Converted indirect statements: %d" %
                     len(self.converted_indirect_stmts))
        logger.info(">> Unhandled indirect statements: %d" %
                     (len(self.all_indirect_stmts) -
                      len(self.converted_indirect_stmts)))
        logger.info('')
        logger.info("Total direct statements: %d" % len(self.all_direct_stmts))
        logger.info("Converted direct statements: %d" %
                    len(self.converted_direct_stmts))
        logger.info("Degenerate direct statements: %d" %
                    len(self.degenerate_stmts))
        logger.info(">> Unhandled direct statements: %d" %
                     (len(self.all_direct_stmts) -
                      len(self.converted_direct_stmts) -
                      len(self.degenerate_stmts)))

        logger.info('')
        logger.info("--- Unhandled direct statements ---------")
        for stmt in self.all_direct_stmts:
            if not (stmt in self.converted_direct_stmts or
                    stmt in self.degenerate_stmts):
                logger.info(stmt)
        logger.info('')
        logger.info("--- Unhandled indirect statements ---------")
        for stmt in self.all_indirect_stmts:
            if not (stmt in self.converted_indirect_stmts or
                    stmt in self.degenerate_stmts):
                logger.info(stmt)
297910
def _ask_how_many():
    
    batch = True
    invalid = True
    _option = ""

    try:
        while invalid:
            print("\nChoose a loading option:\n1. Select specific file(s)\n2. Load entire folder")
            _option = input("Option: ")
            # these are the only 2 valid options. if this is true, then stop prompting
            if _option in ["1", "2"]:
                invalid = False
        # indicate whether to leave batch on or turn off
        if _option == "1":
            batch = False
    except Exception:
        logger_directory.info("_askHowMany: Couldn't get a valid input from the user.")

    return batch
553337
def count(self):
        
        Statement = self.get_model('statement')

        session = self.Session()
        statement_count = session.query(Statement).count()
        session.close()
        return statement_count
446953
def monitor_counters(mc, output, counters, detailed, f):
    """"""
    # Print CSV header
    output.write("time,{}{}\n".format("x,y," if detailed else "",
                                      ",".join(counters)))

    system_info = mc.get_system_info()

    # Make an initial sample of the counters
    last_counter_values = sample_counters(mc, system_info)

    start_time = time.time()

    for _ in f():
        # Snapshot the change in counter values
        counter_values = sample_counters(mc, system_info)
        delta = deltas(last_counter_values, counter_values)
        last_counter_values = counter_values

        now = time.time() - start_time

        # Output the changes
        if detailed:
            for x, y in sorted(system_info):
                output.write("{:0.1f},{},{},{}\n".format(
                    now, x, y,
                    ",".join(str(getattr(delta[(x, y)], c))
                             for c in counters)))
        else:
            totals = [0 for _ in counters]
            for xy in sorted(system_info):
                for i, counter in enumerate(counters):
                    totals[i] += getattr(delta[xy], counter)
            output.write("{:0.1f},{}\n".format(
                now, ",".join(map(str, totals))))
387518
def _print_refs(self, fobj, refs, total, level=1, minsize=0, minpct=0.1):
        
        lrefs = list(refs)
        lrefs.sort(key=lambda x: x.size)
        lrefs.reverse()
        if level == 1:
            fobj.write('<table>\n')
        for ref in lrefs:
            if ref.size > minsize and (ref.size*100.0/total) > minpct:
                data = dict(level=level,
                            name=trunc(str(ref.name), 128),
                            size=pp(ref.size),
                            pct=ref.size*100.0/total)
                fobj.write(self.refrow % data)
                self._print_refs(fobj, ref.refs, total, level=level+1)
        if level == 1:
            fobj.write("</table>\n")
208125
public void displayState() {
        PrintWriter xout = context.get(Log.logKey).getWriter(Log.WriterKind.STDERR);
        xout.println("File Object History : " +  fileObjectHistory);
        xout.println("Open Type Names     : " +  openTypeNames);
        xout.println("Gen. Src Names      : " +  generatedSourceNames);
        xout.println("Gen. Cls Names      : " +  generatedClasses.keySet());
        xout.println("Agg. Gen. Src Names : " +  aggregateGeneratedSourceNames);
        xout.println("Agg. Gen. Cls Names : " +  aggregateGeneratedClassNames);
    }
558011
def count(self):
        
        if self._batch:
            raise CQLEngineException("Only inserts, updates, and deletes are available in batch mode")

        if self._result_cache is None:
            query = self._select_query()
            query.count = True
            result = self._execute(query)
            return result[0]['count']
        else:
            return len(self._result_cache)
406127
def count(self):
        
        count = 0
        operation = self._get_operation()
        kwargs = self.kwargs.copy()
        kwargs['select'] = 'COUNT'
        limit = kwargs.get('limit', None)
        while True:
            result = operation(self.model.get_table_name(), **kwargs)
            count += result['Count']
            if limit is not None:
                limit -= result['Count']

            last_evaluated_key = result.get('LastEvaluatedKey', None)
            if not self._prepare_next_fetch(kwargs, last_evaluated_key, limit):
                break
        return count
758685
def show(self):
        
        off = 0
        for n, i in enumerate(self.get_instructions()):
            print("{:8d} (0x{:08x}) {:04x} {:30} {}".format(n, off, i.get_op_value(), i.get_name(), i.get_output(self.idx)))
            off += i.get_length()
443448
def decrement_display_ref_count(self, amount: int=1):
        """"""
        assert not self._closed
        self.__display_ref_count -= amount
        for display_data_channel in self.display_data_channels:
            display_data_channel.decrement_display_ref_count(amount)
393347
def display_all(self):
        
        print( ("total elapse %0.6f seconds, last elapse %0.6f seconds, "
                "took %s times measurement") % (
                    self.total_elapse, self.elapse, len(self.records)))
880608
def _PrintEventLabelsCounter(
      self, event_labels_counter, session_identifier=None):
    
    if not event_labels_counter:
      return

    title = 'Event tags generated per label'
    if session_identifier:
      title = '{0:s}: {1:s}'.format(title, session_identifier)

    table_view = views.ViewsFactory.GetTableView(
        self._views_format_type,
        column_names=['Label', 'Number of event tags'], title=title)

    for key, value in sorted(event_labels_counter.items()):
      if key == 'total':
        continue
      table_view.AddRow([key, value])

    try:
      total = event_labels_counter['total']
    except KeyError:
      total = 'N/A'

    table_view.AddRow(['Total', total])

    table_view.Write(self._output_writer)
1246510
@Deprecated
    public String printInvocations(Object ... mocks) {
        String out = "";
        List<Invocation> invocations = AllInvocationsFinder.find(asList(mocks));
        out += line("********************************");
        out += line("*** Mockito interactions log ***");
        out += line("********************************");
        for(Invocation i:invocations) {
            out += line(i.toString());
            out += line(" invoked: " + i.getLocation());
            if (i.stubInfo() != null) {
                out += line(" stubbed: " + i.stubInfo().stubbedAt().toString());
            }
        }

        invocations = unusedStubsFinder.find(asList(mocks));
        if (invocations.isEmpty()) {
            return print(out);
        }
        out += line("********************************");
        out += line("***       Unused stubs       ***");
        out += line("********************************");

        for(Invocation i:invocations) {
            out += line(i.toString());
            out += line(" stubbed: " + i.getLocation());
        }
        return print(out);
    }
708996
def printStats(self):
        
        printDebug("----------------")
        printDebug("Parents......: %d" % len(self.parents()))
        printDebug("Children.....: %d" % len(self.children()))
        printDebug("Ancestors....: %d" % len(self.ancestors()))
        printDebug("Descendants..: %d" % len(self.descendants()))
        printDebug("----------------")
590985
private static String printStatements(Context context, Iterable<JCStatement> statements) {
    StringWriter writer = new StringWriter();
    try {
      pretty(context, writer).printStats(com.sun.tools.javac.util.List.from(statements));
    } catch (IOException e) {
      throw new AssertionError("StringWriter cannot throw IOExceptions");
    }
    return writer.toString();
  }
580854
function deduceSize(deducables, index, isPercentageBased, table) {
        if (index < 0 || index >= deducables.length - 1) {
          return "";
        }

        var current = deducables[index];

        if (current) {
          current = {
            value: current,
            delta: 0
          };
        } else {
          var reversedUpToIndex = deducables.slice(0, index).reverse();
          for (var i = 0; i < reversedUpToIndex.length; i++) {
            if (reversedUpToIndex[i]) {
              current = {
                value: reversedUpToIndex[i],
                delta: i + 1
              };
            }
          }
        }

        var next = deducables[index + 1];

        if (next) {
          next = {
            value: next,
            delta: 1
          };
        } else {
          var rest = deducables.slice(index + 1);
          for (var j = 0; j < rest.length; j++) {
            if (rest[j]) {
              next = {
                value: rest[j],
                delta: j + 1
              };
            }
          }
        }

        var extras = next.delta - current.delta;
        var pixelWidth = Math.abs(next.value - current.value) / extras;
        return isPercentageBased ? pixelWidth / getComputedStyleSize(table, 'width') * 100 : pixelWidth;
      }
812497
def getRejectionReasons(self,dd):
        
        keys = dd.keys()
        reasons = []
        if not('checkbox' in keys ) or not(dd['checkbox']):
            return 0
        if 'selected' in keys:
            reasons += dd['selected']
        if 'other' in keys and dd['checkbox_other']:
            reasons.append(dd['other'])
        if len(reasons) < 1:
            return "Yes, unknow"
        return ', '.join(reasons)