type : PRINT_DOCUMENT, PRINT_PAGE_HEADER, PRINT_PAGE_FOOTER
182143
private PdfPTable buildPdfTable(int type) throws QueryException {

        List<Band> bands = new ArrayList<Band>();
        if (type == PRINT_PAGE_HEADER) {        	        	
        	bands.add(getReportLayout().getPageHeaderBand());
        } else if (type == PRINT_PAGE_FOOTER) {
        	bands.add(getReportLayout().getPageFooterBand());        
        } else {
        	bands = getReportLayout().getDocumentBands();
        }
        int totalRows = 0;
        int totalColumns = 0;
        for (Band band : bands) {
            totalRows += band.getRowCount();
            int cols = band.getColumnCount();
            if (cols > totalColumns) {
                totalColumns = cols;
            }
        }

        // no page header or no page footer
        if (totalColumns == 0) {
        	return null;
        }
        PdfPTable datatable = new PdfPTable(totalColumns);
                
        // !Important: when a cell is bigger than a page it won't show
        // we could use datatable.setSplitLate(false)and in this case we can see
        // some content but it is very ugly.
        
        headerwidths = new int[totalColumns]; // %

        int size = 100 / totalColumns;
        int totalWidth = 0;
        for (int i = 0; i < totalColumns; i++) {
            if (bean.getReportLayout().isUseSize()) {
                headerwidths[i] = bean.getReportLayout().getColumnsWidth().get(i);
            } else {
                headerwidths[i] = size;
            }
            totalWidth += headerwidths[i];
        }
        try {            
            if (bean.getReportLayout().isUseSize()) {
                float pixels = A4_PORTRAIT_PIXELS;
                if (bean.getReportLayout().getOrientation() == LANDSCAPE) {
                    pixels = A4_LANDSCAPE_PIXELS;
                }
                percentage = totalWidth * 100 / pixels;
                // do not allow to go outside an A4 frame
                if (percentage > 100) {
                    percentage = 100;
                }
                if (!ReportLayout.CUSTOM.equals(bean.getReportLayout().getPageFormat())) {
                	datatable.setWidthPercentage(percentage);
                }
                datatable.setWidths(headerwidths);
            } else {
                datatable.setWidthPercentage(100);
            }            
        } catch (DocumentException e) {
            throw new QueryException(e);
        }
        if (type == PRINT_DOCUMENT) {
        	writeHeader(datatable);
        }
        // this is used in correlation with sepSplitRows(true) which is the default inside PdfPTable;
        // by default splitLate is true and in case a subreport is bigger than a page, the subreport
        // will be written starting from next page, leaving first page empty
        datatable.setSplitLate(false);
        return datatable;
    }
653911
def pprint(object, stream=None, indent=1, width=80, depth=None):
    """"""
    printer = PrettyPrinter(
        stream=stream, indent=indent, width=width, depth=depth)
    printer.pprint(object)
598919
public void printHeader(PrintWriter pw)
   {
      pw.print(description);
      pw.print("-Min,");
      pw.print(description);
      pw.print("-Max,");
      pw.print(description);
      pw.print("-Total,");
      pw.print(description);
      pw.print("-Avg,");
      pw.print(description);
      pw.print("-Times");
   }
960618
function preview(print)
	{
		var autoOrigin = onePageCheckBox.checked || pageCountCheckBox.checked;
		var printScale = parseInt(pageScaleInput.value) / 100;
		
		if (isNaN(printScale))
		{
			printScale = 1;
			pageScaleInput.value = '100%';
		}
		
		// Workaround to match available paper size in actual print output
		printScale *= 0.75;

		var pf = graph.pageFormat || mxConstants.PAGE_FORMAT_A4_PORTRAIT;
		var scale = 1 / graph.pageScale;
		
		if (autoOrigin)
		{
    		var pageCount = (onePageCheckBox.checked) ? 1 : parseInt(pageCountInput.value);
			
			if (!isNaN(pageCount))
			{
				scale = mxUtils.getScaleForPageCount(pageCount, graph, pf);
			}
		}

		// Negative coordinates are cropped or shifted if page visible
		var gb = graph.getGraphBounds();
		var border = 0;
		var x0 = 0;
		var y0 = 0;

		// Applies print scale
		pf = mxRectangle.fromRectangle(pf);
		pf.width = Math.ceil(pf.width * printScale);
		pf.height = Math.ceil(pf.height * printScale);
		scale *= printScale;
		
		// Starts at first visible page
		if (!autoOrigin && graph.pageVisible)
		{
			var layout = graph.getPageLayout();
			x0 -= layout.x * pf.width;
			y0 -= layout.y * pf.height;
		}
		else
		{
			autoOrigin = true;
		}
		
		var preview = PrintDialog.createPrintPreview(graph, scale, pf, border, x0, y0, autoOrigin);
		preview.open();
	
		if (print)
		{
			PrintDialog.printPreview(preview);
		}
	}
914218
def _repr_html_(self, header=True):
        """"""
        name = adjust_name_for_printing(self.name) + "."
        names = self.parameter_names()
        desc = self._description_str
        iops = OrderedDict()
        for opname in self._index_operations:
            iop = []
            for p in self.parameters:
                iop.extend(p.get_property_string(opname))
            iops[opname] = iop

        format_spec = self._format_spec(name, names, desc, iops, False)
        to_print = []

        if header:
            to_print.append("<tr><th><b>" + '</b></th><th><b>'.join(format_spec).format(name=name, desc='value', **dict((name, name) for name in iops)) + "</b></th></tr>")

        format_spec = "<tr><td class=tg-left>" + format_spec[0] + '</td><td class=tg-right>' + format_spec[1] + '</td><td class=tg-center>' + '</td><td class=tg-center>'.join(format_spec[2:]) + "</td></tr>"
        for i in range(len(names)):
            to_print.append(format_spec.format(name=names[i], desc=desc[i], **dict((name, iops[name][i]) for name in iops)))

        style = """<style type="text/css">
.tg  {font-family:"Courier New", Courier, monospace !important;padding:2px 3px;word-break:normal;border-collapse:collapse;border-spacing:0;border-color:#DCDCDC;margin:0px auto;width:100%;}
.tg td{font-family:"Courier New", Courier, monospace !important;font-weight:bold;color:#444;background-color:#F7FDFA;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#DCDCDC;}
.tg th{font-family:"Courier New", Courier, monospace !important;font-weight:normal;color:#fff;background-color:#26ADE4;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#DCDCDC;}
.tg .tg-left{font-family:"Courier New", Courier, monospace !important;font-weight:normal;text-align:left;}
.tg .tg-center{font-family:"Courier New", Courier, monospace !important;font-weight:normal;text-align:center;}
.tg .tg-right{font-family:"Courier New", Courier, monospace !important;font-weight:normal;text-align:right;}
</style>"""
        return style + '\n' + '<table class="tg">' + '\n'.join(to_print) + '\n</table>'
345916
def pprint(to_be_printed):
    """"""
    try:
        import pprint as pp
        # generate an instance PrettyPrinter
        # pp.PrettyPrinter().pprint(to_be_printed)
        pp.pprint(to_be_printed)
    except ImportError:
        if isinstance(to_be_printed, dict):
            print('{')
            for k, v in to_be_printed.items():
                print("'" + k + "'" if isinstance(k, basestring) else k,
                      ': ',
                      "'" + v + "'" if isinstance(k, basestring) else v,
                      sep="")
            print('}')
        else:
            print('could not import pprint module, appling regular print')
            print(to_be_printed)
826022
def print_declarations(
        decls,
        detailed=True,
        recursive=True,
        writer=lambda x: sys.stdout.write(x + os.linesep),
        verbose=True):
    
    prn = decl_printer_t(0, detailed, recursive, writer, verbose=verbose)
    if not isinstance(decls, list):
        decls = [decls]
    for d in decls:
        prn.level = 0
        prn.instance = d
        algorithm.apply_visitor(prn, d)
505381
def pprint(self, imports=None, prefix="\n    ",unknown_value='<?>',
               qualify=False, separator=""):
        
        r = Parameterized.pprint(self,imports,prefix,
                                 unknown_value=unknown_value,
                                 qualify=qualify,separator=separator)
        classname=self.__class__.__name__
        return r.replace(".%s("%classname,".%s.instance("%classname)
572806
def printer(self):
        """"""
        for key in self.statediag:
            if key.trans is not None and len(key.trans) > 0:
                print '****** ' + repr(key.id) + '(' + repr(key.type)\
                      + ' on sym ' + repr(key.sym) + ') ******'
                print key.trans
1356460
function ClassProperty(node, print) {
  print.list(node.decorators, { separator: "" });

  if (node["static"]) this.push("static ");
  print.plain(node.key);
  print.plain(node.typeAnnotation);
  if (node.value) {
    this.space();
    this.push("=");
    this.space();
    print.plain(node.value);
  }
  this.semicolon();
}
1302777
public boolean printHeadingFootingData(PrintWriter out, int iPrintOptions)
    {
        boolean bIsBreak = false;
        int iNumCols = this.getSFieldCount();
        for (int iIndex = 0; iIndex < iNumCols; iIndex++)
        {
            ScreenField sField = this.getSField(iIndex);
            boolean bPrintControl = this.isPrintableControl(sField, iPrintOptions);
//x            if (!(sField instanceof ReportBreakScreen))
//x                bPrintControl = false;
            if (sField == this.getReportHeading())
                bPrintControl = false;
            if (sField == this.getReportFooting())
                bPrintControl = false;
            if (sField == this.getReportDetail())
            	bPrintControl = false;
            if ((iPrintOptions & HtmlConstants.HEADING_SCREEN) != 0)
                if ((sField.getDisplayFieldDesc() & HtmlConstants.HEADING_SCREEN) == 0)
                    bPrintControl = false;
            if ((iPrintOptions & HtmlConstants.FOOTING_SCREEN) != 0)
                if ((sField.getDisplayFieldDesc() & HtmlConstants.FOOTING_SCREEN) == 0)
                    bPrintControl = false;
            if (bPrintControl)
            {
                sField.printData(out, iPrintOptions);
                if (!bIsBreak)
                {
                	if (sField instanceof ReportBreakScreen)
                		bIsBreak = ((ReportBreakScreen)sField).isLastBreak();
                	else
                		bIsBreak = true;	// Always assume a break if this is not a break screen
                }
            }
        }
        return bIsBreak;
    }
899182
def p_print_list_tab(p):
    
    p[0] = make_sentence('PRINT_TAB',
                         make_typecast(TYPE.ubyte, p[2], p.lineno(1)))
360212
def page(content, pagecallback=prompt):
    
    width = getwidth()
    height = getheight()
    pagenum = 1

    try:
        try:
            line = content.next().rstrip("\r\n")
        except AttributeError:
            # Python 3 compatibility
            line = content.__next__().rstrip("\r\n")
    except StopIteration:
        pagecallback(pagenum)
        return

    while True:     # page cycle
        linesleft = height-1 # leave the last line for the prompt callback
        while linesleft:
            linelist = [line[i:i+width] for i in range(0, len(line), width)]
            if not linelist:
                linelist = ['']
            lines2print = min(len(linelist), linesleft)
            for i in range(lines2print):
                if WINDOWS and len(line) == width:
                    # avoid extra blank line by skipping linefeed print
                    echo(linelist[i])
                else:
                    print((linelist[i]))
            linesleft -= lines2print
            linelist = linelist[lines2print:]

            if linelist: # prepare symbols left on the line for the next iteration
                line = ''.join(linelist)
                continue
            else:
                try:
                    try:
                        line = content.next().rstrip("\r\n")
                    except AttributeError:
                        # Python 3 compatibility
                        line = content.__next__().rstrip("\r\n")
                except StopIteration:
                    pagecallback(pagenum)
                    return
        if pagecallback(pagenum) == False:
            return
        pagenum += 1
165791
private void preparePrint(final AbstractPrint _print) throws EFapsException {
        for (final Select select : _print.getSelection().getAllSelects()) {
            for (final AbstractElement<?> element : select.getElements()) {
                if (element instanceof AbstractDataElement) {
                    ((AbstractDataElement<?>) element).append2SQLSelect(sqlSelect);
                }
            }
        }
        if (sqlSelect.getColumns().size() > 0) {
            for (final Select select : _print.getSelection().getAllSelects()) {
                for (final AbstractElement<?> element : select.getElements()) {
                    if (element instanceof AbstractDataElement) {
                        ((AbstractDataElement<?>) element).append2SQLWhere(sqlSelect.getWhere());
                    }
                }
            }
            if (_print instanceof ObjectPrint) {
                addWhere4ObjectPrint((ObjectPrint) _print);
            } else if (_print instanceof ListPrint) {
                addWhere4ListPrint((ListPrint) _print);
            } else {
                addTypeCriteria((QueryPrint) _print);
                addWhere4QueryPrint((QueryPrint) _print);
            }
            addCompanyCriteria(_print);
        }
    }
267124
def _printClassRange(self, hrlinetop=True, print_inferred=False):
        
        if not self.currentEntity:  # ==> ontology level
            return
        x = self.currentEntity['object']
        if self.currentEntity['type'] == 'class':
            if hrlinetop:
                self._print("----------------")
            self._print("RANGE OF:", "IMPORTANT")
            self._print("[%d] Explicitly declared" % len(x.range_of), "IMPORTANT")
            for i in x.range_of:
                if i.domains:
                    domains = ",".join([y.qname if hasattr(y, "qname") else str(y)
                                        for y in i.domains])
                else:
                    domains = "owl:Thing"
                print(Style.DIM + domains + Style.RESET_ALL + " => " + Fore.MAGENTA + i.qname +
                      Style.RESET_ALL + " => " + Fore.GREEN + x.qname + Style.RESET_ALL)

            # inferred stuff
            if print_inferred:
                for _dict in x.range_of_inferred:
                    _class = list(_dict.items())[0][0]
                    _propslist = list(_dict.items())[0][1]
                    if _class.id != x.id and len(_propslist):  # print only inferred properties
                        self._print("[%d] Inherited from [%s]" % (len(_propslist), _class.qname),
                                    "IMPORTANT")
                        for i in _propslist:
                            if i.domains:
                                domains = ",".join(
                                    [y.qname if hasattr(y, "qname") else str(y) for y in i.domains])
                            else:
                                domains = "owl:Thing"
                            print(Style.DIM + domains + Style.RESET_ALL + " => " + Fore.MAGENTA +
                                  i.qname + Style.RESET_ALL + " => " + Fore.GREEN + x.qname + Style.RESET_ALL)

            self._print("----------------")
        return
689154
def _print_header(self):
        """"""
        header = " Iter  Dir  "
        if self.constraints is not None:
            header += '  SC CC'
        header += "         Function"
        if self.convergence_condition is not None:
            header += self.convergence_condition.get_header()
        header += "    Time"
        self._screen("-"*(len(header)), newline=True)
        self._screen(header, newline=True)
        self._screen("-"*(len(header)), newline=True)
1358939
def print_header(self):
        """"""
        lines_to_print = []
        lines_to_print.append('##fileformat='+self.fileformat)
        if self.filedate:
            lines_to_print.append('##fileformat='+self.fileformat)
            
        for filt in self.filter_dict:
            lines_to_print.append(self.filter_dict[filt])
        for form in self.format_dict:
            lines_to_print.append(self.format_dict[form])
        for info in self.info_dict:
            lines_to_print.append(self.info_dict[info])
        for contig in self.contig_dict:
            lines_to_print.append(self.contig_dict[contig])
        for alt in self.alt_dict:
            lines_to_print.append(self.alt_dict[alt])
        for other in self.other_dict:
            lines_to_print.append(self.other_dict[other])
        lines_to_print.append('#'+ '\t'.join(self.header))
        return lines_to_print