Set white point part of cHRM chunk
771463
def set_white_point(self, white_point, point2=None):
        """"""
        if isinstance(white_point, float) and isinstance(point2, float):
            white_point = (white_point, point2)
        self.white_point = white_point
751985
public void setWhiteSpace(CSSProperty.WhiteSpace value)
    {
        splitws = (value == ElementBox.WHITESPACE_NORMAL || value == ElementBox.WHITESPACE_PRE_WRAP || value== ElementBox.WHITESPACE_PRE_LINE);
        collapsews = (value == ElementBox.WHITESPACE_NORMAL || value == ElementBox.WHITESPACE_NOWRAP || value == ElementBox.WHITESPACE_PRE_LINE);
        linews = (value == ElementBox.WHITESPACE_NORMAL || value == ElementBox.WHITESPACE_NOWRAP);
        //When this is the original box, apply the whitespace. For the copied boxes, the whitespace has been already applied (they contain
        //a copy of the original, already processed content). 
        if (!splitted)
            applyWhiteSpace();
        //recompute widths (possibly different wrapping)
        computeLineLengths();
        minwidth = computeMinimalWidth();
        maxwidth = computeMaximalWidth();
    }
664561
synchronized void closeChunk( NewChunk chk) {
    final int cidx = chk._cidx - _chunkOff;
    if( cidx >= _espc.length ) {
      int newlen = Math.max(_espc.length * 2, cidx + 1);
      _espc = Arrays.copyOf(_espc,newlen);
    }
    if(_chunkTypes.length < _espc.length)
      _chunkTypes = Arrays.copyOf(_chunkTypes,_espc.length);
    _espc[cidx] = chk._len;
    _chunkTypes[cidx] = chk.type();
    _naCnt += chk._naCnt;
    _strCnt += chk._strCnt;
    for( int i=0; i<_timCnt.length; i++ ) _timCnt[i] += chk._timCnt[i];
    _totalCnt += chk._len;
  }
375825
private void drawLegend(boolean withBytePlot, boolean withEntropy,
			boolean withPEStructure) {
		int number = 0;
		if (withBytePlot) {
			writeLegendTitle(number++, "BytePlot (left)", Color.lightGray);
			drawLegendEntry(number++, "0xFF", colorMap.get(MAX_BYTE));
			drawLegendEntry(number++, "0x00", colorMap.get(MIN_BYTE));
			drawLegendEntry(number++, "visible ASCII",
					colorMap.get(VISIBLE_ASCII));
			drawLegendEntry(number++, "invisible ASCII",
					colorMap.get(INVISIBLE_ASCII));
			drawLegendEntry(number++, "non-ASCII", colorMap.get(NON_ASCII));
			if (visOverlay != null) {
				drawLegendEntry(number++, "Read Chunks",
						colorMap.get(VISOVERLAY));
			}
		}
		if (withEntropy) {
			String entropyTitle = "Entropy ";
			if (withPEStructure) {
				entropyTitle += "(middle)";
			} else {
				entropyTitle += "(right)";
			}
			writeLegendTitle(number++, entropyTitle, Color.lightGray);
			drawLegendEntry(number++, "0.2 (repetition)",
					getColorForEntropy(0.2));
			drawLegendEntry(number++, "0.5 (code)", getColorForEntropy(0.5));
			drawLegendEntry(number++, "0.8 (packed)", getColorForEntropy(0.8));
			if (visOverlay != null) {
				drawLegendEntry(number++, "Read Chunks",
						colorMap.get(VISOVERLAY), true);
			}
		}
		if (withPEStructure) {
			writeLegendTitle(number++, "PE Structure (right)", Color.lightGray);
			drawLegendEntry(number++, "MSDOS Header",
					colorMap.get(MSDOS_HEADER));
			drawLegendEntry(number++, "COFF File Header",
					colorMap.get(COFF_FILE_HEADER));
			drawLegendEntry(number++, "Optional Header",
					colorMap.get(OPTIONAL_HEADER));
			drawLegendEntry(number++, "Section Table",
					colorMap.get(SECTION_TABLE));
			SectionTable table = data.getSectionTable();
			for (SectionHeader header : table.getSectionHeaders()) {
				Color sectionColor = getSectionColor(header);
				drawLegendEntry(number++, header.getName(), sectionColor);
				sectionColor = variate(sectionColor);
			}
			for (DataDirectoryKey special : specials) {
				if (specialsAvailability.get(special)) {
					drawLegendEntry(number++, getSpecialsDescription(special),
							getSpecialsColor(special), true);
				}
			}
			for (Map.Entry<String, Color> entry : resTypeColors.entrySet()) {
				drawLegendEntry(number++, entry.getKey(), entry.getValue(),
						true);
			}
			if (epAvailable) {
				drawLegendEntry(number++, "Entry Point",
						colorMap.get(ENTRY_POINT), true);
			}
			if (overlayAvailable) {
				drawLegendEntry(number++, "Overlay", colorMap.get(OVERLAY));
			}
			if (visOverlay != null) {
				drawLegendEntry(number++, "Read Chunks",
						colorMap.get(VISOVERLAY), true);
			}
		}
		// drawLegendCrossEntry(number, "Anomalies", anomalyColor);
	}
260140
private void setSizeAndPreviousInUseOfInUseChunk(int p, int s) {
    head(p, s | PINUSE_BIT | CINUSE_BIT);
    setFoot(p, s);
    occupied += s;
  }
21201
public void setCropArea(int x, int y, int width, int height) {

        m_cropX = x;
        m_cropY = y;
        m_cropWidth = width;
        m_cropHeight = height;
    }
1145304
private void addCoord(World world, BlockPos pos, int size)
	{
		getAffectedChunks(world, pos.getX(), pos.getZ(), size).forEach(c -> addCoord(c, pos));
	}
68762
def setImembPtr(self): 
        """"""
        jseg = 0
        for sec in list(self.secs.values()):
            hSec = sec['hObj']
            for iseg, seg in enumerate(hSec):
                self.imembPtr.pset(jseg, seg._ref_i_membrane_)  # notice the underscore at the end (in nA)
                jseg += 1
1321886
private final String getChunk(String s, int slength, int marker)
    {
        StringBuilder chunk = new StringBuilder();
        char c = s.charAt(marker);
        chunk.append(c);
        marker++;
        if (isDigit(c))
        {
            while (marker < slength)
            {
                c = s.charAt(marker);
                if (!isDigit(c))
                    break;
                chunk.append(c);
                marker++;
            }
        } else
        {
            while (marker < slength)
            {
                c = s.charAt(marker);
                if (isDigit(c))
                    break;
                chunk.append(c);
                marker++;
            }
        }
        return chunk.toString();
    }
308776
private void scribbleWhiteSpace(WsByteBuffer buffer, int start, int stop) {
        if (buffer.hasArray()) {
            // buffer has a backing array so directly update that
            final byte[] data = buffer.array();
            final int offset = buffer.arrayOffset();
            int myStart = start + offset;
            int myStop = stop + offset;
            for (int i = myStart; i < myStop; i++) {
                data[i] = BNFHeaders.SPACE;
            }
        } else {
            // overlay whitespace into the buffer
            byte[] localWhitespace = whitespace;
            if (null == localWhitespace) {
                localWhitespace = getWhiteSpace();
            }
            buffer.position(start);
            int len = stop - start;
            while (len > 0) {
                if (localWhitespace.length >= len) {
                    buffer.put(localWhitespace, 0, len);
                    break; // out of while
                }
                int partial = localWhitespace.length;
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Scribbling " + partial + " bytes of whitespace");
                }
                buffer.put(localWhitespace, 0, partial);
                len -= partial;
            }
        }
    }
501599
function (poly, fill) {
            var context = this.backBufferContext2D;

            if (context.globalAlpha < 1 / 255) {
                // Fast path: don't draw fully transparent
                return;
            }

            this.translate(poly.pos.x, poly.pos.y);
            context.beginPath();
            context.moveTo(poly.points[0].x, poly.points[0].y);
            var point;
            for (var i = 1; i < poly.points.length; i++) {
                point = poly.points[i];
                context.lineTo(point.x, point.y);
            }
            context.lineTo(poly.points[0].x, poly.points[0].y);
            context[fill === true ? "fill" : "stroke"]();
            context.closePath();
            this.translate(-poly.pos.x, -poly.pos.y);
        }
296473
function clippingRectangleRounded($x1, $y1, $w, $h, $rTL, $rTR, $rBR, $rBL)
    {
        $this->save();

        // start: top edge, left end
        $this->addContent(sprintf("\n%.3F %.3F m ", $x1, $y1 - $rTL + $h));

        // line: bottom edge, left end
        $this->addContent(sprintf("\n%.3F %.3F l ", $x1, $y1 + $rBL));

        // curve: bottom-left corner
        $this->ellipse($x1 + $rBL, $y1 + $rBL, $rBL, 0, 0, 8, 180, 270, false, false, false, true);

        // line: right edge, bottom end
        $this->addContent(sprintf("\n%.3F %.3F l ", $x1 + $w - $rBR, $y1));

        // curve: bottom-right corner
        $this->ellipse($x1 + $w - $rBR, $y1 + $rBR, $rBR, 0, 0, 8, 270, 360, false, false, false, true);

        // line: right edge, top end
        $this->addContent(sprintf("\n%.3F %.3F l ", $x1 + $w, $y1 + $h - $rTR));

        // curve: bottom-right corner
        $this->ellipse($x1 + $w - $rTR, $y1 + $h - $rTR, $rTR, 0, 0, 8, 0, 90, false, false, false, true);

        // line: bottom edge, right end
        $this->addContent(sprintf("\n%.3F %.3F l ", $x1 + $rTL, $y1 + $h));

        // curve: top-right corner
        $this->ellipse($x1 + $rTL, $y1 + $h - $rTL, $rTL, 0, 0, 8, 90, 180, false, false, false, true);

        // line: top edge, left end
        $this->addContent(sprintf("\n%.3F %.3F l ", $x1 + $rBL, $y1));

        // Close & clip
        $this->addContent(" W n");
    }
1317823
public void setvBucketCheckpoints(Map<Short, Long> vbchkpnts) {
    int oldSize = (vBucketCheckpoints.size()) * 10;
    int newSize = (vbchkpnts.size()) * 10;
    totalbody += newSize - oldSize;
    vBucketCheckpoints = vbchkpnts;
  }
328178
function highlightDataPoints(dataPoint) {
            cleanDataPointHighlights();

            const nodes = paths.nodes()
            const nodesById = nodes.reduce((acc, node) => {
                acc[node.id] = node

                return acc;
            }, {});

            // Group corresponding path node with its topic, and
            // sorting the topics based on the order of the colors,
            // so that the order always stays constant
            const topicsWithNode = dataPoint.topics
                .map(topic => ({
                    topic,
                    node: nodesById[topic.name]
                }))
                .filter(({topic}) => !!topic)
                .sort((a, b) => topicColorMap[a.topic.name] < topicColorMap[b.topic.name])

            dataPoint.topics = topicsWithNode.map(({topic}) => topic);

            dataPoint.topics.forEach((d, index) => {
                let marker = verticalMarkerContainer
                  .append('g')
                    .classed('circle-container', true)
                      .append('circle')
                        .classed('data-point-highlighter', true)
                        .attr('cx', highlightCircleSize)
                        .attr('cy', 0)
                        .attr('r', highlightCircleRadius)
                        .style('stroke-width', () => (
                            shouldShowAllDataPoints ? highlightCircleStrokeAll : highlightCircleStroke
                        ))
                        .style('stroke', topicColorMap[d.name])
                        .style('cursor', 'pointer')
                        .on('click', function () {
                            addGlowFilter(this);
                            handleHighlightClick(this, d);
                        })
                        .on('mouseout', function () {
                            removeFilter(this);
                        });

                const path = topicsWithNode[index].node;
                const x = xScale(new Date(dataPoint.topics[index].date));
                const y = getPathYFromX(x, path, d.name);

                marker.attr('transform', `translate( ${(-highlightCircleSize)}, ${y} )` );
            });
        }
1151286
def show_colored_chunks(chunks, defcolor = nil, defattr = nil, wid = 999, pcol = 0)
      return unless visible?
      ww = 0
      chunks.each_with_color do |text, color, attrib|

        ## 2013-03-08 - 19:11 take care of scrolling by means of pcol
        if pcol > 0
          if pcol > text.length 
            # ignore entire chunk and reduce pcol
            pcol -= text.length
            next
          else
            # print portion of chunk and zero pcol
            text = text[pcol..-1]
            pcol = 0
          end
        end
        oldw = ww
        ww += text.length
        if ww > wid
          # if we are exceeding the width then by howmuch
          rem = wid - oldw
          if rem > 0
            # take only as much as we are allowed
            text = text[0,rem]
          else
            break
          end
        end

        color ||= defcolor
        attrib ||= defattr

        cc, bg = ColorMap.get_colors_for_pair color
        #$log.debug "XXX: CHUNK window #{text}, cp #{color} ,  attrib #{attrib}. #{cc}, #{bg} " 
        color_set(color,nil) if color
        wattron(attrib) if attrib
        #print(text)
        waddnstr(text.to_s, @width) # changed 2014-04-22 - 11:59  to reduce a function
        wattroff(attrib) if attrib
      end
    end
823106
function setImageLuminanceColorScale( $imageObject, $filterData, $sourceMimeData, $destinationMimeData,
                                          $colorScale )
    {
        $white = ImageColorAllocate( $imageObject, 255, 255, 255 );
        $black = ImageColorAllocate( $imageObject, 0, 0, 0 );

        $rmod = $colorScale[0];
        $gmod = $colorScale[1];
        $bmod = $colorScale[2];

        $width = ImageSX( $imageObject );
        $height = ImageSY( $imageObject );
        for ( $y = 0; $y < $height; ++$y )
        {
            for ( $x = 0; $x < $width; ++$x )
            {
                $rgb = ImageColorAt( $imageObject, $x, $y );

                $r = ( $rgb >> 16 ) & 0xff;
                $g = ( $rgb >> 8 ) & 0x0ff;
                $b = ( $rgb ) & 0x0ff;

                $luminance = ( $r * 0.3 ) + ( $g * 0.59 ) + ( $b * 0.11 );

                $r = $luminance * $rmod;
                $g = $luminance * $gmod;
                $b = $luminance * $bmod;

                $color = ImageColorAllocate( $imageObject, $r, $g, $b );

                ImageSetPixel( $imageObject, $x, $y, $color );
            }
        }
        return $imageObject;
    }
1034066
def set_points(self, pt1, pt2):
        """"""
        (x1, y1) = pt1.as_tuple()
        (x2, y2) = pt2.as_tuple()
        self.left = min(x1, x2)
        self.top = min(y1, y2)
        self.right = max(x1, x2)
        self.bottom = max(y1, y2)