Write the SERAUXTREND chart BIFF record.
169182
def store_serauxtrend(reg_type, poly_order, equation, r_squared)  # :nodoc:
    record     = 0x104B     # Record identifier.
    length     = 0x001C     # Number of bytes to follow.
    # reg_type              # Regression type.
    # poly_order            # Polynomial order.
    # equation              # Display equation.
    # r_squared             # Display R-squared.
    # intercept             # Forced intercept.
    # forecast              # Forecast forward.
    # backcast              # Forecast backward.

    # TODO. When supported, intercept needs to be NAN if not used.
    # Also need to reverse doubles.
    intercept = ['FFFFFFFF0001FFFF'].pack('H*')
    forecast  = ['0000000000000000'].pack('H*')
    backcast  = ['0000000000000000'].pack('H*')

    header = [record, length].pack('vv')
    data  = [reg_type].pack('C')
    data += [poly_order].pack('C')
    data += intercept
    data += [equation].pack('C')
    data += [r_squared].pack('C')
    data += forecast
    data += backcast

    append(header, data)
  end
888725
def colored_formatter(record):
    """"""

    colours = {'info': ('blue', 'normal'),
               'debug': ('magenta', 'normal'),
               'warning': ('yellow', 'normal'),
               'print': ('green', 'normal'),
               'error': ('red', 'bold')}

    levelname = record.levelname.lower()

    if levelname == 'error':
        return

    if levelname.lower() in colours:
        levelname_color = colours[levelname][0]
        header = color_text('[{}]: '.format(levelname.upper()), levelname_color)

    message = '{0}'.format(record.msg)

    warning_category = re.match(r'^(\w+Warning:).*', message)
    if warning_category is not None:
        warning_category_colour = color_text(warning_category.groups()[0], 'cyan')
        message = message.replace(warning_category.groups()[0], warning_category_colour)

    sub_level = re.match(r'(\[.+\]:)(.*)', message)
    if sub_level is not None:
        sub_level_name = color_text(sub_level.groups()[0], 'red')
        message = '{}{}'.format(sub_level_name, ''.join(sub_level.groups()[1:]))

    # if len(message) > 79:
    #     tw = TextWrapper()
    #     tw.width = 79
    #     tw.subsequent_indent = ' ' * (len(record.levelname) + 2)
    #     tw.break_on_hyphens = False
    #     message = '\n'.join(tw.wrap(message))

    sys.__stdout__.write('{}{}\n'.format(header, message))
    sys.__stdout__.flush()

    return
1207143
private function _writeMarginLeft()
	{
		$record  = 0x0026;				   // Record identifier
		$length  = 0x0008;				   // Bytes to follow

		$margin  = $this->_phpSheet->getPageMargins()->getLeft();	 // Margin in inches

		$header	= pack("vv",  $record, $length);
		$data	  = pack("d",   $margin);
		if (self::getByteOrder()) { // if it's Big Endian
			$data = strrev($data);
		}

		$this->_append($header . $data);
	}
247254
private function _writeMarginTop()
	{
		$record  = 0x0028;				   // Record identifier
		$length  = 0x0008;				   // Bytes to follow

		$margin  = $this->_phpSheet->getPageMargins()->getTop();	 // Margin in inches

		$header	= pack("vv",  $record, $length);
		$data	  = pack("d",   $margin);
		if (self::getByteOrder()) { // if it's Big Endian
			$data = strrev($data);
		}

		$this->_append($header . $data);
	}
862668
private function _writeExternsheetBiff8()
	{
		$total_references = count($this->_parser->_references);
		$record   = 0x0017;                     // Record identifier
		$length   = 2 + 6 * $total_references;  // Number of bytes to follow

		$supbook_index = 0;           // FIXME: only using internal SUPBOOK record
		$header           = pack("vv",  $record, $length);
		$data             = pack('v', $total_references);
		for ($i = 0; $i < $total_references; ++$i) {
			$data .= $this->_parser->_references[$i];
		}
		return $this->writeData($header . $data);
	}
853617
function writeEntryValues() {
            svg.select('.legend-group')
                .selectAll('g.legend-line')
                .selectAll('g.legend-entry')
              .append('text')
                .classed('legend-entry-value', true)
                .text(getFormattedQuantity)
                .attr('x', chartWidth - valueReservedSpace)
                .style('font-size', `${textSize}px`)
                .style('letter-spacing', `${numberLetterSpacing}px`)
                .style('text-anchor', 'end')
                .style('startOffset', '100%');
        }
437282
def discands(record):
    """"""
    import pyfits
    pyraf.iraf.images()
    pyraf.iraf.images.tv()
    display = pyraf.iraf.images.tv.display
    
    width=128
    
    cands = record['cands']
    exps=   record['fileId']
    comments= record['comments']

    ### load some header info from the mophead file
    headers={}
    for exp in exps:
        f = pyfits.open(exp+".fits")
        headers[exp]={}
        for key in ['MJDATE', 'NAXIS1', 'NAXIS2', 'EXPTIME', 'FILTER']:
            headers[exp][key]=f[0].header[key]
        headers[exp]['MJD-OBSC']=headers[exp]['MJDATE']+headers[exp]['EXPTIME']/2.0/3600.0/24.0
        f.close()

    import math,os
    real=0
    cand_total=len(cands)
    if cand_total > 100 :
        sys.stderr.write("Too many candidates (%d) skipping this chip...\n" % ( cand_total))
	return -1
    for cand in cands:
        cand_total=cand_total-1
        x2=[]
        y2=[]
        y1=[]
        x1=[]
        for i in range(len(exps)):
	    #print exps[i]
            fileId=exps[i]
            x2.append(int(min(math.floor(cand[i]['x'])+width,headers[fileId]['NAXIS1'])))
            y2.append(int(min(math.floor(cand[i]['y'])+width,headers[fileId]['NAXIS2'])))
            x1.append(int(max(math.floor(cand[i]['x'])-width,1)))
            y1.append(int(max(math.floor(cand[i]['y'])-width,1)))
	#print exps
	#print x1,x2
	#print y1,y2
        x_1 = min(x1)
        y_1 = min(y1)
        x_2 = max(x2)
        y_2 = max(y2)
	ans='f'
	fake=True
	xshifts=[]
	yshifts=[]
	first_pass=True
	show_coords=True
	ans='j'
	while ( first_pass or ans == 'f' or ans == 'c') : 
	  first_pass=False
	  if ans=='c':
	    if show_coords: 
	       show_coords=False
            else:
	       show_coords=True
	  if ans=='f':
	    if fake:
	       fake=False
	    else:
	       fake=True
          for i in range(len(exps)):
            xshift=cand[i]['x']-cand[i]['x_0']
            yshift=cand[i]['y']-cand[i]['y_0']
	    allmark=open('all.coo','w')
	    for j in range(len(exps)):
	      if j==i :
	         continue
              allmark.write('%f %f\n' % ( cand[j]['x_0']+xshift, cand[j]['y_0']+yshift))
	    allmark.close()
            tvmark=open('tv.coo','w')
            tvmark.write('%f %f %d\n' % ( cand[i]['x'], cand[i]['y'], cand_total))
            x1=max(x_1 + xshift,1)
            y1=max(y_1 + yshift,1)
            x2=min(x_2 + xshift,headers[exps[i]]['NAXIS1'])
            y2=min(y_2 + yshift,headers[exps[i]]['NAXIS2'])
            cutout = "[%d:%d,%d:%d]" % (x1,x2,y1,y2)
	    if not fake:
	       if exps[i][0:2]=='fk' :
	         fileId=exps[i][2:]
	       else:
                 fileId=exps[i]
            else:
               fileId=exps[i]
#	    sys.stdout.write("---> ",fileId+cutout,xshift,yshift
            try:
                junk=display(fileId+cutout,i+1,Stdout=1)
            except:
                sys.stderr.write("ERROR\n")
            tvmark.close()
	    if show_coords:
              pyraf.iraf.images.tv.tvmark(i+1,'all.coo',mark='circle',radii=10,color=205)
              pyraf.iraf.images.tv.tvmark(i+1,'tv.coo',mark='circle',radii=8,color=204,label='yes',nxoffset=10)
            os.unlink('tv.coo')
	    os.unlink('all.coo')
        ### ask if this is a real candidate, take action.
          ans='j'
          while ans not in ('y', 'n', 'q', 's', 'f', 'c'):
            ans=raw_input("[%d] (y,n,s,q,c,f) : " % ( cand_total))
        if ans=='y':
	    if os.access("cands.REAL",os.W_OK):
                f=open("cands.REAL","a")
 	    else:
                f=open("cands.REAL","w")
	        for comment in comments:
		    f.write(comment)
            cols=['x','y','x_0','y_0','flux','size','max_int','elon']
            #for col in cols:
            #    f.write("%s\t" % col)
            f.write("\n")
            for ii in range(len(exps)):
                for col in cols:
                    f.write("%8.2f\t" % cand[ii][col])
                f.write("\n")
            f.close()
            real=real+1
        if ans=='q':
            return -2
	if ans=='s':
	    return -1
    return real
661680
def record(self, i=0):
        """"""
        f = self.__getFileObj(self.dbf)
        if not self.numRecords:
            self.__dbfHeader()
        i = self.__restrictIndex(i)
        recSize = self.__recordFmt()[1]
        f.seek(0)
        f.seek(self.__dbfHeaderLength() + (i * recSize))
        return self.__record()
827411
def write(self, fout_xlsx=None, fout_txt=None, verbose=False):
        """"""
        sortby = self._get_fncsortnt(self.objgrpd.grprobj.gosubdag.prt_attr['flds'])
        kws_sort = {'sortby' if verbose else 'section_sortby': sortby}
        sortobj = Sorter(self.objgrpd.grprobj, **kws_sort)
        # KWS: hdrgo_prt=True section_prt=None top_n=None use_sections=True
        # RET: {sortobj, sections, hdrgo_prt} or {sortobj flat hdrgo_prt}
        desc2nts = sortobj.get_desc2nts_fnc(
            hdrgo_prt=verbose,
            section_prt=True,
            top_n=None,
            use_sections=True)
        # print('FFFF', desc2nts['flds'])
        # Write user GO IDs in sections
        objgowr = WrXlsxSortedGos("init", sortobj, self.objgrpd.ver_list)
        if fout_xlsx is not None:
            kws_xlsx = {'shade_hdrgos':verbose}
            if not verbose:
                kws_xlsx['prt_flds'] = [f for f in desc2nts['flds'] if f not in self.excl_flds]
            objgowr.wr_xlsx_nts(fout_xlsx, desc2nts, **kws_xlsx)
            fout_desc = '{BASE}_desc.txt'.format(BASE=os.path.splitext(fout_xlsx)[0])
            self._wr_ver_n_key(fout_desc, verbose)
        if fout_txt is not None:
            self._wr_txt_nts(fout_txt, desc2nts, objgowr, verbose)
        if fout_xlsx is None and fout_txt is None:
            self._prt_ver_n_key(sys.stdout, verbose)
            prtfmt = self._get_prtfmt(objgowr, verbose)
            summary_dct = objgowr.prt_txt_desc2nts(sys.stdout, desc2nts, prtfmt)
            self._prt_ver_n_key(sys.stdout, verbose)
            if summary_dct:
                print("\n{N} GO IDs in {S} sections".format(
                    N=desc2nts['num_items'], S=desc2nts['num_sections']))
75314
def write_outro (self):
        """"""
        self.writeln(u"<br/>")
        self.write(_("That's it.")+" ")
        if self.stats.number >= 0:
            self.write(_n("%d link checked.", "%d links checked.",
                       self.stats.number) % self.stats.number)
            self.write(u" ")
        self.write(_n("%d warning found", "%d warnings found",
             self.stats.warnings_printed) % self.stats.warnings_printed)
        if self.stats.warnings != self.stats.warnings_printed:
            self.write(_(" (%d ignored or duplicates not printed)") %
                (self.stats.warnings - self.stats.warnings_printed))
        self.write(u". ")
        self.write(_n("%d error found", "%d errors found",
             self.stats.errors_printed) % self.stats.errors_printed)
        if self.stats.errors != self.stats.errors_printed:
            self.write(_(" (%d duplicates not printed)") %
                (self.stats.errors - self.stats.errors_printed))
        self.writeln(u".")
        self.writeln(u"<br/>")
        num = self.stats.internal_errors
        if num:
            self.write(_n("There was %(num)d internal error.",
                "There were %(num)d internal errors.", num) % {"num": num})
            self.writeln(u"<br/>")
        self.stoptime = time.time()
        duration = self.stoptime - self.starttime
        self.writeln(_("Stopped checking at %(time)s (%(duration)s)") %
             {"time": strformat.strtime(self.stoptime),
              "duration": strformat.strduration_long(duration)})
        self.writeln(u'</blockquote><br/><hr><small>'+
                     configuration.HtmlAppInfo+u"<br/>")
        self.writeln(_("Get the newest version at %s") %
           (u'<a href="'+configuration.Url+u'" target="_top">'+
            configuration.Url+u"</a>.<br/>"))
        self.writeln(_("Write comments and bugs to %s") %
           (u'<a href="'+configuration.SupportUrl+u'">'+
            configuration.SupportUrl+u"</a>.<br/>"))
        self.writeln(_("Support this project at %s") %
           (u'<a href="'+configuration.DonateUrl+u'">'+
            configuration.DonateUrl+u"</a>."))
        self.writeln(u"</small></body></html>")
1037275
def write(self, buf):
        
        buf = align_buf(buf, self._sample_width)
        buf = normalize_audio_buffer(buf, self.volume_percentage)
        return self._sink.write(buf)
832218
function (e) {
		var chart = this.chart;

		// Record the start position
		chart.mouseIsDown = e.type;
		chart.cancelClick = false;
		chart.mouseDownX = this.mouseDownX = e.chartX;
		chart.mouseDownY = this.mouseDownY = e.chartY;
	}
610565
public CharTrie rewrite(BiFunction<TrieNode, Map<Character, TrieNode>, TreeMap<Character, Long>> fn) {
    CharTrie result = new CharTrieIndex();
    rewriteSubtree(root(), result.root(), fn);
    return result.recomputeCursorDetails();
  }
1105338
def __shxRecord(self, offset, length):
         """"""
         f = self.__getFileObj(self.shx)
         f.write(pack(">i", offset // 2))
         f.write(pack(">i", length))
1222878
private void writePhysicalRecord(ByteBuffer data, Record record) {
    writeBuffer.putInt(generateCrc(data.array(), data.position(), record.getBytes(),
        record.getType()));
    writeBuffer.putShort((short) record.getBytes());
    writeBuffer.put(record.getType().value());
    int oldLimit = data.limit();
    data.limit(data.position() + record.getBytes());
    writeBuffer.put(data);
    data.limit(oldLimit);
  }
653754
def format(self, record):
        """"""
        format_orig = self._fmt
        self._fmt = self.get_level_fmt(record.levelno)
        record.prefix = self.prefix
        record.plugin_id = self.plugin_id
        result = logging.Formatter.format(self, record)
        self._fmt = format_orig
        return result
1337152
def write_bar_chart(params)   # :nodoc:
      if ptrue?(params[:primary_axes])
        series = get_primary_axes_series
      else
        series = get_secondary_axes_series
      end
      return if series.empty?

      subtype = @subtype
      subtype = 'percentStacked' if subtype == 'percent_stacked'

      # Set a default overlap for stacked charts.
      if @subtype =~ /stacked/
        @series_overlap_1 = 100 unless @series_overlap_1
      end

      @writer.tag_elements('c:barChart') do
        # Write the c:barDir element.
        write_bar_dir
        # Write the c:grouping element.
        write_grouping(subtype)
        # Write the c:ser elements.
        series.each {|s| write_ser(s)}

        # write the c:marker element.
        write_marker_value

        if ptrue?(params[:primary_axes])
          # Write the c:gapWidth element.
          write_gap_width(@series_gap_1)
          # Write the c:overlap element.
          write_overlap(@series_overlap_1)
        else
          # Write the c:gapWidth element.
          write_gap_width(@series_gap_2)
          # Write the c:overlap element.
          write_overlap(@series_overlap_2)
        end

        # write the c:overlap element.
        write_overlap(@series_overlap)

        # Write the c:axId elements
        write_axis_ids(params)
      end
    end