create head line
518870
function makeHead(lLabel, lText, rLabel, rText) {
    if (!lText) {
        return "";
    }
    
    var fillSpace = 78, result = "<div class='line'>";
    
    fillSpace -= 2 + lLabel.length + 1 + lText.length;
    
    if (rText) {
        fillSpace -= 2 + rLabel.length + 2 + rText.length;
    }
    
    if (fillSpace < 0) {
        fillSpace = 0;
    }
    
    var span = new Span(4, 7, false);
    
    span.text = " " + lLabel + " ";
    
    result += span.toString();
    
    span.f = 7;
    span.b = 4;
    span.text = " " + lText + " ".repeat(fillSpace);
    
    result += span.toString();
    
    // result += makeSpan({f:4,b:7,text:" "+lLabel+" "}) + makeSpan({f:7,b:4,text:" "+lText+" ".repeat(fillSpace)});
    
    if (rText) {
        span.f = 4;
        span.b = 7;
        span.text = " " + rLabel + " ";
        
        result += span.toString();
        
        span.f = 7;
        span.b = 4;
        span.text = " " + rText + " ";
        
        result += span.toString();
        // result += makeSpan({f:4,b:7,text:" "+rLabel+" "}) + makeSpan({f:7,b:4,text:" "+rText+" "});
    }
    
    result += "</div>";
    
    return result;
}
453585
def newline(self):
        """"""
        self.write_str(self.eol)
        self.room = self.maxlinelen
1192972
public static LineString createDummyLine() {
        Coordinate[] c = new Coordinate[]{new Coordinate(0.0, 0.0), new Coordinate(1.0, 1.0), new Coordinate(1.0, 0.0)};
        LineString lineString = gf().createLineString(c);
        return lineString;
    }
1088732
def dashed_line(self, x1,y1,x2,y2, dash_length=1, space_length=1):
        """"""
        self._set_dash(dash_length, space_length)
        self.line(x1, y1, x2, y2)
        self._set_dash()
720803
function(callback) {
      createLine(linesPaths, destinationPath, width * numberOfColumns, height, false, quality)(callback);
    }
834242
def set_head(self, node):
    """"""
    for head in self.head:
      head.next.add(node)
    self.head[:] = []
    self.head.append(node)
957023
def p_ioport_head(self, p):
        ''
        p[0] = self.create_ioport(p[1], p[2], lineno=p.lineno(2))
        p.set_lineno(0, p.lineno(1))
1171965
def head(self, n=None, **kwargs):
        
        if n is None:
            n = options.display.max_rows
        return self._handle_delay_call('execute', self, head=n, **kwargs)
385854
def createHeadingPointer(self):
        ''''''
        self.headingTri = patches.RegularPolygon((0.0,0.80),3,0.05,color='k',zorder=4)
        self.axes.add_patch(self.headingTri)
        self.headingText = self.axes.text(0.0,0.675,'0',color='k',size=self.fontSize,horizontalalignment='center',verticalalignment='center',zorder=4)
1038934
def line(self, x0, y0, x1, y1):
        """"""
        # clean params
        x0, y0, x1, y1 = int(x0), int(y0), int(x1), int(y1)
        if y0 > y1:
            y0, y1, x0, x1 = y1, y0, x1, x0
        dx = x1 - x0
        if dx < 0:
            sx = -1
        else:
            sx = 1
        dx *= sx
        dy = y1 - y0

        # 'easy' cases
        if dy == 0:
            for x in range(x0, x1, sx):
                self.point(x, y0)
            return
        if dx == 0:
            for y in range(y0, y1):
                self.point(x0, y)
            self.point(x1, y1)
            return
        if dx == dy:
            for x in range(x0, x1, sx):
                self.point(x, y0)
                y0 += 1
            return

        # main loop
        self.point(x0, y0)
        e_acc = 0
        if dy > dx:  # vertical displacement
            e = (dx << 16) // dy
            for i in range(y0, y1 - 1):
                e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xFFFF
                if e_acc <= e_acc_temp:
                    x0 += sx
                w = 0xFF-(e_acc >> 8)
                self.point(x0, y0, intensity(self.color, w))
                y0 += 1
                self.point(x0 + sx, y0, intensity(self.color, (0xFF - w)))
            self.point(x1, y1)
            return

        # horizontal displacement
        e = (dy << 16) // dx
        for i in range(x0, x1 - sx, sx):
            e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xFFFF
            if e_acc <= e_acc_temp:
                y0 += 1
            w = 0xFF-(e_acc >> 8)
            self.point(x0, y0, intensity(self.color, w))
            x0 += sx
            self.point(x0, y0 + 1, intensity(self.color, (0xFF-w)))
        self.point(x1, y1)
1222010
def hline(self, x, y, width, color):
        """"""
        self.rect(x, y, width, 1, color, fill=True)
1228795
def do_HEAD(self):
        """"""
        self.queue.put(self.headers.get("User-Agent"))
        self.send_response(six.moves.BaseHTTPServer.HTTPStatus.OK)
        self.send_header("Location", self.path)
        self.end_headers()
684458
function lineTop (){
    var l = line(chars.top
               , chars['top-left'] || chars.top
               , chars['top-right'] ||  chars.top
               , chars['top-mid']);
    if (l)
      ret += l + "\n";
  }
797773
def head(self, url, **kwargs):
        

        kwargs.setdefault('allow_redirects', True)
        return self.request('head', url, **kwargs)
786027
def head(draw=True, show=True, max_shape=256):
    """"""
    # inspired by http://graphicsrunner.blogspot.com/2009/01/volume-rendering-102-transfer-functions.html
    import ipyvolume as ipv
    from scipy.interpolate import interp1d

    # First part is a simpler version of setting up the transfer function. Interpolation with higher order
    # splines does not work well, the original must do sth different
    colors = [[0.91, 0.7, 0.61, 0.0], [0.91, 0.7, 0.61, 80.0], [1.0, 1.0, 0.85, 82.0], [1.0, 1.0, 0.85, 256]]
    x = np.array([k[-1] for k in colors])
    rgb = np.array([k[:3] for k in colors])
    N = 256
    xnew = np.linspace(0, 256, N)
    tf_data = np.zeros((N, 4))
    kind = 'linear'
    for channel in range(3):
        f = interp1d(x, rgb[:, channel], kind=kind)
        ynew = f(xnew)
        tf_data[:, channel] = ynew
    alphas = [[0, 0], [0, 40], [0.2, 60], [0.05, 63], [0, 80], [0.9, 82], [1.0, 256]]
    x = np.array([k[1] * 1.0 for k in alphas])
    y = np.array([k[0] * 1.0 for k in alphas])
    f = interp1d(x, y, kind=kind)
    ynew = f(xnew)
    tf_data[:, 3] = ynew
    tf = ipv.TransferFunction(rgba=tf_data.astype(np.float32))

    head_data = ipv.datasets.head.fetch().data
    if draw:
        vol = ipv.volshow(head_data, tf=tf, max_shape=max_shape)
        if show:
            ipv.show()
        return vol
    else:
        return head_data
800215
public Head createHead() {
        final Head head = new Head(getRoot(), "Head");
        getRoot().insert(head);
        return head;
    }
451489
public void transfromHeadline ()
  {
    if (m_nHeadlineDepth > 0)
      return;
    int nLevel = 0;
    final Line aLine = m_aLines;
    if (aLine.m_bIsEmpty)
      return;
    int nStart = aLine.m_nLeading;
    while (nStart < aLine.m_sValue.length () && aLine.m_sValue.charAt (nStart) == '#')
    {
      nLevel++;
      nStart++;
    }
    while (nStart < aLine.m_sValue.length () && aLine.m_sValue.charAt (nStart) == ' ')
      nStart++;
    if (nStart >= aLine.m_sValue.length ())
    {
      aLine.setEmpty ();
    }
    else
    {
      int nEnd = aLine.m_sValue.length () - aLine.m_nTrailing - 1;
      while (aLine.m_sValue.charAt (nEnd) == '#')
        nEnd--;
      while (aLine.m_sValue.charAt (nEnd) == ' ')
        nEnd--;
      aLine.m_sValue = aLine.m_sValue.substring (nStart, nEnd + 1);
      aLine.m_nLeading = aLine.m_nTrailing = 0;
    }
    m_nHeadlineDepth = Math.min (nLevel, 6);
  }