Create a JuiceBox from a list of header lines.

    @param lines: a list of lines.
181306
def parseJuiceHeaders(lines):
    
    b = JuiceBox()
    bodylen = 0
    key = None
    for L in lines:
        if L[0] == ' ':
            # continuation
            assert key is not None
            b[key] += '\r\n'+L[1:]
            continue
        parts = L.split(': ', 1)
        if len(parts) != 2:
            raise MalformedJuiceBox("Wrong number of parts: %r" % (L,))
        key, value = parts
        key = normalizeKey(key)
        b[key] = value
    return int(b.pop(LENGTH, 0)), b
477594
public Block split(final Line line)
    {
        final Block block = new Block();

        block.lines = this.lines;
        block.lineTail = line;
        this.lines = line.next;
        line.next = null;
        if (this.lines == null)
        {
            this.lineTail = null;
        }
        else
        {
            this.lines.previous = null;
        }

        if (this.blocks == null)
        {
            this.blocks = this.blockTail = block;
        }
        else
        {
            this.blockTail.next = block;
            this.blockTail = block;
        }

        return block;
    }
1094085
public static function fromHeaderLines(array $lines)
    {
        $bag = new static;

        foreach ($lines as $line)
        {
            preg_match('/^([^:]++)(?|(?:[:][ ]?+)(.*+)|())/', $line, $matches);
            array_shift($matches);

            list($name, $value) = $matches;

            $bag->add($name, $value);
        }

        return $bag;
    }
1368778
private String getLines(SlotsLines lines) {
    StringBuilder builder = new StringBuilder();
    for (MiniCapability cap : lines.getLinesType()) {
      String icon = cap.getIcon();
      String version = cap.getVersion();
      builder.append("<p>");
      if (version != null) {
        builder.append("v:").append(version);
      }
      for (TestSlot s : lines.getLine(cap)) {
        builder.append(getSingleSlotHtml(s, icon));
      }
      builder.append("</p>");
    }
    return builder.toString();
  }
984511
def read_from_list_with_ids(self, lines):
        
        self.log(u"Reading text fragments from list with ids")
        self._create_text_fragments([(line[0], [line[1]]) for line in lines])
580484
@Override
	public void addHeadLine(final String type, final String aLine) {
		ArrayList<String> lines = headers.get(type);

		if (lines == null) {
			lines = new ArrayList<>();
			headers.put(type, lines);
		}

		lines.add(aLine);
	}
278267
def buffer_put_lines(buf, lines):
    
    if any(isinstance(x, str) for x in lines):
        lines = [str(x) for x in lines]
    buf.write('\n'.join(lines))
891723
@Pure
	protected String lines(String prefix, String... lines) {
		final String delimiter = getCodeConfig().getLineDelimiter();
		final StringBuilder buffer = new StringBuilder();
		for (final String line : lines) {
			buffer.append(prefix);
			buffer.append(line);
			buffer.append(delimiter);
		}
		return buffer.toString();
	}
1157506
def _populate_lines(self, block, terminal, styles, default_esc_seq):
        '''
        '''
        for line in block:
            if hasattr(line, 'populate'):
                line = line.populate(terminal, styles, default_esc_seq)
            else:
                line = default_esc_seq + line
            yield line
1122273
private void createLine( int index0 , int index1 , List<Point2D_I32> contour , LineGeneral2D_F64 line )
	{
		if( index1 < 0 )
			System.out.println("SHIT");
		Point2D_I32 p0 = contour.get(index0);
		Point2D_I32 p1 = contour.get(index1);

//		System.out.println("createLine "+p0+" "+p1);

		work.a.set(p0.x, p0.y);
		work.b.set(p1.x, p1.y);

		UtilLine2D_F64.convert(work,line);

		// ensure A*A + B*B = 1
		line.normalize();
	}
255024
public CsvWriter write(String[]... lines) throws IORuntimeException {
		if (ArrayUtil.isNotEmpty(lines)) {
			for (final String[] values : lines) {
				appendLine(values);
			}
			flush();
		}
		return this;
	}
16070
def create_from_mesh_and_lines(cls, mesh, lines):
        '''
        

        '''
        mesh_with_lines = mesh.copy()
        mesh_with_lines.add_lines(lines)
        return mesh_with_lines
656214
def parse(self, lines, root):
    

    lst = IgnoreList(root)
    lst.parse(lines)
    self.append(lst)
1314590
def _combine_lines(self, lines):
        
        lines = filter(None, map(lambda x: x.strip(), lines))
        return '[' + ','.join(lines) + ']'
100682
def head(self, lines=10):
        
        self.seek(0)

        for i in range(lines):
            if not self.seek_line_forward():
                break
    
        end_pos = self.file.tell()
        
        self.seek(0)
        data = self.file.read(end_pos - 1)

        if data:
            return self.splitlines(data)
        else:
            return []
832617
public static String flatten(List lines, String sep) {
    return flatten(lines.toArray(new Object[lines.size()]), sep);
  }
228297
public static List<String> linesFrom(InputStream is) {
        ArrayList<String> lines = new ArrayList<String>();
        for (String line : new LineReader(is)) {
            if (line.length() > 0 && !line.startsWith("#"))
                lines.add(line);
        }
        return lines;
    }