Prints data distribution based on report from NameNode
774488
public static void logDataDistribution(DatanodeInfo[] report) {
    if (LOG.isInfoEnabled()) {
      double avgRemaining = computeAvgRemaining(Arrays.asList(report));
      StringBuilder msg = new StringBuilder("Data distribution report: avgRemaining "
          + avgRemaining);
      for (DatanodeInfo node : report) {
        msg.append("\n").append(node.getName());
        msg.append(" remaining ").append(getRemaining(node));
        msg.append(" raw ").append(node.getRemaining()).append(" / ").append(node.getCapacity());
      }
      LOG.info(msg);
    }
  }
230929
def printArray(self, node, printState: PrintState):
        
        if (
            self.nameMapper[node["name"]] not in printState.definedVars
            and self.nameMapper[node["name"]] not in printState.globalVars
        ):
            printState.definedVars += [self.nameMapper[node["name"]]]
            assert int(node["count"]) > 0
            printState.definedVars += [node["name"]]

            varType = ""
            if node["type"].upper() == "INTEGER":
                varType = "int"
            elif node["type"].upper() in ("DOUBLE", "REAL"):
                varType = "float"
            elif node["type"].upper() == "CHARACTER":
                varType = "str"
            elif node["isDevTypeVar"]:
                varType = node["type"].lower() + "()"

            assert varType != ""

            self.pyStrings.append(f"{node['name']} = Array({varType}, [")
            for i in range(0, int(node["count"])):
                loBound = node["low" + str(i + 1)]
                upBound = node["up" + str(i + 1)]
                dimensions = f"({loBound}, {upBound})"
                if i < int(node["count"]) - 1:
                    self.pyStrings.append(f"{dimensions}, ")
                else:
                    self.pyStrings.append(f"{dimensions}")
            self.pyStrings.append("])")

            if node["isDevTypeVar"]:
                self.pyStrings.append(printState.sep)
                # This may require updating later when we have to deal with the
                # multi-dimensional derived type arrays
                upBound = node["up1"]
                self.pyStrings.append(
                    f"for z in range(1, {upBound}+1):" + printState.sep
                )
                self.pyStrings.append(
                    f"    obj = {node['type']}()" + printState.sep
                )
                self.pyStrings.append(
                    f"    {node['name']}.set_(z, obj)" + printState.sep
                )
953927
function printNodeOptions (log = debug) {
  if (!log.enabled) {
    return
  }

  if (process.env.NODE_OPTIONS) {
    log('NODE_OPTIONS=%s', process.env.NODE_OPTIONS)
  } else {
    log('NODE_OPTIONS is not set')
  }
}
192974
def touch(self, name, data):
            
            b_OK        = True
            str_here    = self.cwd()
            # print("here!")
            # print(self.snode_current)
            # print(self.snode_current.d_nodes)
            l_path = name.split('/')
            if len(l_path) > 1:
                self.cd('/'.join(l_path[0:-1]))
            name = l_path[-1]
            self.snode_current.d_data[name] = data
            # print(self.snode_current)
            self.cd(str_here)
            return b_OK
962747
function printReports(filePath, results) {

  let errorCount = 0;
  let warningCount = 0;

  const table = createTable();

  Object.entries(results).forEach(function([ name, reports ]) {

    reports.forEach(function(report) {

      const {
        category,
        id,
        message,
        name: reportName
      } = report;

      table.push(tableEntry({
        category,
        id,
        message,
        name: reportName || name
      }));

      if (category === 'error') {
        errorCount++;
      } else {
        warningCount++;
      }
    });
  });

  const problemCount = warningCount + errorCount;

  if (problemCount) {
    console.log();
    console.log(underline(path.resolve(filePath)));
    console.log(table.toString());
  }

  return {
    errorCount,
    warningCount
  };
}
1077626
def printed_out(self, name):
        
        out = ''
        out += '|\n'
        if self._id_variable:
            subs = '[{}]'.format(self._id_variable)
        else:
            subs = ''
        out += '|---{}{}\n'.format(name, subs)
        if self._description:
            out += '|   |   {}\n'.format(self._description)
        for name, action in self._actions.items():
            out += action.printed_out(name)
        return out
810578
void printDotNodesAtLevel(PrintStream os, int levelToPrint, boolean detail, PrintMojo.PrintTreeOptions treeOptions) {
    if (getDepth() == levelToPrint) {
      printDotNode(os, detail, treeOptions);
      return;
    }

    assert (getDepth() < levelToPrint);

    if (leftChild != null) {
      leftChild.printDotNodesAtLevel(os, levelToPrint, detail, treeOptions);
    }
    if (rightChild != null) {
      rightChild.printDotNodesAtLevel(os, levelToPrint, detail, treeOptions);
    }
  }
1321093
def show_tree(nickname, server, org_vm, reference_direction='snia'):
    
    scoping_result_role = "Dependent" if reference_direction == 'snia' \
        else "Antecedent"
    profiles = server.profiles

    reg_profiles = {}
    for profile in profiles:
        reg_profiles[profile.path.to_wbem_uri(format="canonical")] = profile

    # defines element to subelement
    tree_dict = defaultdict(list)

    for profile in profiles:
        paths = server.conn.AssociatorNames(
            profile.path,
            AssocClass='CIM_ElementConformsToProfile',
            ResultClass="CIM_RegisteredProfile",
            ResultRole="ManagedElement")
        if paths:
            print('%s: associators ELEMENTCONFORMSTO %s' %
                  (nickname, profile.path.to_wbem_uri(format="canonical")))
            for path in paths:
                print("  %s" % path)
        profile.path.host = None
        profile_path_str = profile.path.to_wbem_uri(format="canonical")
        for path in paths:
            tree_dict[profile_path_str].append(
                path.to_wbem_uri(format="canonical"))

        # Go down one level on the profile side, to the scoping profile
        referenced_profile_paths = server.conn.AssociatorNames(
            ObjectName=profile.path,
            AssocClass="CIM_ReferencedProfile",
            ResultRole=scoping_result_role)
        if referenced_profile_paths:
            print('%s AssocNames CIM_ReferencedProfile %s' %
                  (nickname, profile.path.to_wbem_uri(format="canonical")))

            for path in referenced_profile_paths:
                print("  %s" % path.to_wbem_uri(format="canonical"))

            for path in referenced_profile_paths:
                path.host = None
            tree_dict[profile_path_str].append(
                path.to_wbem_uri(format="canonical"))

    for key, values in tree_dict.items():
        print('%s\n  %s' % (key, "\n  ".join(values)))

    name_dict = {}
    for key, values in tree_dict.items():
        prof = reg_profiles[key]
        pn = profile_name(org_vm, prof)
        pvalues = []
        for value in values:
            profx = reg_profiles[value]
            pvalues.append(profile_name(org_vm, profx))
        name_dict[pn] = pvalues
    for key, values in name_dict.items():
        print('%s\n  %s' % (key, "\n  ".join(values)))
1115083
def printSummary(self):
        
        print("Ontologies:")
        for ontology in self.getOntologys():
            print(
                "",
                ontology.getOntologyPrefix(),
                ontology.getName(),
                ontology.getDataUrl(),
                sep="\t")
        print("ReferenceSets:")
        for referenceSet in self.getReferenceSets():
            print(
                "", referenceSet.getLocalId(), referenceSet.getId(),
                referenceSet.getDescription(), referenceSet.getDataUrl(),
                sep="\t")
            for reference in referenceSet.getReferences():
                print(
                    "\t", reference.getLocalId(), reference.getId(),
                    sep="\t")
        print("Datasets:")
        for dataset in self.getDatasets():
            print(
                "", dataset.getLocalId(), dataset.getId(),
                dataset.getDescription(), sep="\t")
            print("\tReadGroupSets:")
            for readGroupSet in dataset.getReadGroupSets():
                print(
                    "\t", readGroupSet.getLocalId(),
                    readGroupSet.getReferenceSet().getLocalId(),
                    readGroupSet.getId(),
                    readGroupSet.getDataUrl(), sep="\t")
                for readGroup in readGroupSet.getReadGroups():
                    print(
                        "\t\t", readGroup.getId(), readGroup.getLocalId(),
                        sep="\t")
            print("\tVariantSets:")
            for variantSet in dataset.getVariantSets():
                print(
                    "\t", variantSet.getLocalId(),
                    variantSet.getReferenceSet().getLocalId(),
                    variantSet.getId(),
                    sep="\t")
                if variantSet.getNumVariantAnnotationSets() > 0:
                    print("\t\tVariantAnnotationSets:")
                    for vas in variantSet.getVariantAnnotationSets():
                        print(
                            "\t\t", vas.getLocalId(),
                            vas.getAnnotationType(),
                            vas.getOntology().getName(), sep="\t")
            print("\tFeatureSets:")
            for featureSet in dataset.getFeatureSets():
                print(
                    "\t", featureSet.getLocalId(),
                    featureSet.getReferenceSet().getLocalId(),
                    featureSet.getOntology().getName(),
                    featureSet.getId(),
                    sep="\t")
            print("\tContinuousSets:")
            for continuousSet in dataset.getContinuousSets():
                print(
                    "\t", continuousSet.getLocalId(),
                    continuousSet.getReferenceSet().getLocalId(),
                    continuousSet.getId(),
                    sep="\t")
            print("\tPhenotypeAssociationSets:")
            for phenotypeAssociationSet in \
                    dataset.getPhenotypeAssociationSets():
                print(
                    "\t", phenotypeAssociationSet.getLocalId(),
                    phenotypeAssociationSet.getParentContainer().getId(),
                    sep="\t")
                # TODO -  please improve this listing
            print("\tRnaQuantificationSets:")
            for rna_quantification_set in dataset.getRnaQuantificationSets():
                print(
                    "\t", rna_quantification_set.getLocalId(),
                    rna_quantification_set.getId(), sep="\t")
                for quant in rna_quantification_set.getRnaQuantifications():
                        print(
                            "\t\t", quant.getLocalId(),
                            quant._description,
                            ",".join(quant._readGroupIds),
                            ",".join(quant._featureSetIds), sep="\t")
277096
def print_result(overview, *names):
    
    if names:
        for name in names:
            toprint = overview
            for part in name.split('/'):
                toprint = toprint[part]
            print(json.dumps(toprint, indent=4, separators=(',', ': ')))
    else:
        print(json.dumps(overview, indent=4, separators=(',', ': ')))
985433
def printProfile(self, reset=False):
    
    print "Profiling information for {}".format(type(self).__name__)
    totalTime = 0.000001
    for region in self.network.regions.values():
      timer = region.getComputeTimer()
      totalTime += timer.getElapsed()

    # Sort the region names
    regionNames = list(self.network.regions.keys())
    regionNames.sort()

    count = 1
    profileInfo = []
    L2Time = 0.0
    L4Time = 0.0
    for regionName in regionNames:
      region = self.network.regions[regionName]
      timer = region.getComputeTimer()
      count = max(timer.getStartCount(), count)
      profileInfo.append([region.name,
                          timer.getStartCount(),
                          timer.getElapsed(),
                          100.0 * timer.getElapsed() / totalTime,
                          timer.getElapsed() / max(timer.getStartCount(), 1)])
      if "L2Column" in regionName:
        L2Time += timer.getElapsed()
      elif "L4Column" in regionName:
        L4Time += timer.getElapsed()

    profileInfo.append(
      ["Total time", "", totalTime, "100.0", totalTime / count])
    print tabulate(profileInfo, headers=["Region", "Count",
                                         "Elapsed", "Pct of total",
                                         "Secs/iteration"],
                   tablefmt="grid", floatfmt="6.3f")
    print
    print "Total time in L2 =", L2Time
    print "Total time in L4 =", L4Time

    if reset:
      self.resetProfile()
496912
private void printDeliverables() {
        final List<Map.Entry<String, String>> pairs = readProjectFile().deliverables.stream()
                .filter(deliverable -> deliverable.id != null)
                .map(deliverable -> new AbstractMap.SimpleEntry<String, String>(deliverable.id, deliverable.name))
                .collect(Collectors.toList());
        final int length = pairs.stream()
                .map(p -> p.getKey())
                .map(String::length)
                .reduce(Integer::max)
                .orElse(0);
        for (Map.Entry<String, String> pair : pairs) {
            System.out.println(Strings.padEnd(pair.getKey(), length, ' ')
                    + (pair.getValue() != null ? ("  " + pair.getValue()) : ""));
        }
    }
363310
def _printInstances(self, hrlinetop=True):
        
        if not self.currentEntity:  # ==> ontology level
            return
        x = self.currentEntity['object']
        if self.currentEntity['type'] == 'class':
            if hrlinetop:
                self._print("----------------")
            self._print("INSTANCES: [%d]" % len(x.instances, "IMPORTANT"))
            for i in x.instances:
                self._print(i.qname)
            self._print("----------------")
        return
1203518
def on_print(self, node):    # ('dest', 'values', 'nl')
        
        dest = self.run(node.dest) or self.writer
        end = ''
        if node.nl:
            end = '\n'
        out = [self.run(tnode) for tnode in node.values]
        if out and len(self.error) == 0:
            self._printer(*out, file=dest, end=end)
902780
void printUsageInfo() {
        StringBuilder usage = new StringBuilder();
        usage.append("  System Properties: \n");
        usage.append("    -DselionHome=<folderPath>: \n");
        usage.append("       Path of SeLion home directory. Defaults to <user.home>/.selion2/ \n");
        usage.append("    -D[property]=[value]: \n");
        usage.append("       Any other System Property you wish to pass to the JVM \n");

        System.out.print(usage.toString());
    }
96196
public void printStartRecordGridData(PrintWriter out, int iPrintOptions)
    {
        out.println(Utility.startTag(XMLTags.DETAIL));
        out.println(Utility.startTag(XMLTags.FILE));
    }
1075666
def _print_details(extra=None):
    """"""
    def print_node_handler(name, node, depth):
        """Standard printer for a node."""
        line = "{0}{1} {2} ({3}:{4})".format(depth,
                                             (" " * depth),
                                             name,
                                             node.line,
                                             node.col)
        if extra is not None:
            line += " [{0}]".format(extra(node))

        sys.stdout.write(line + "\n")

    return print_node_handler