// NewLine builds a new Line from a slice of Tags.
340536
func NewLine(tags core.TagSlice) (*Line, error) {
	line := new(Line)

	// set defaults
	line.ExtrusionDirection = core.Point{X: 0.0, Y: 0.0, Z: 1.0}

	line.InitBaseEntityParser()
	line.Update(map[int]core.TypeParser{
		39:  core.NewFloatTypeParserToVar(&line.Thickness),
		10:  core.NewFloatTypeParserToVar(&line.Start.X),
		20:  core.NewFloatTypeParserToVar(&line.Start.Y),
		30:  core.NewFloatTypeParserToVar(&line.Start.Z),
		11:  core.NewFloatTypeParserToVar(&line.End.X),
		21:  core.NewFloatTypeParserToVar(&line.End.Y),
		31:  core.NewFloatTypeParserToVar(&line.End.Z),
		210: core.NewFloatTypeParserToVar(&line.ExtrusionDirection.X),
		220: core.NewFloatTypeParserToVar(&line.ExtrusionDirection.Y),
		230: core.NewFloatTypeParserToVar(&line.ExtrusionDirection.Z),
	})

	err := line.Parse(tags)
	return line, err
}
643511
func newPipeline(input, retry, output chan *utils.Message) *pipeline {
	return &pipeline{
		input:  input,
		retry:  retry,
		output: output,
	}
}
431926
func indentLines(str string, indent string) string {
	if indent == "" {
		return str
	}

	var indented []string

	lines := strings.Split(str, "\n")
	for i, line := range lines {
		if (i == (len(lines) - 1)) && (line == "") {
			// input string ends with a new line
			indented = append(indented, line)
		} else {
			indented = append(indented, indent+line)
		}
	}

	return strings.Join(indented, "\n")
}
334816
func NewPartInlineFromBytes(raw []byte, filename string, contentID string) *Message {
	return newPartFromBytes(raw, mime.TypeByExtension(filepath.Ext(filename)), "inline; filename=\""+filename+"\"", contentID)
}
163348
func NewLineString(coordinates Coordinates) *LineString {
	if coordinates == nil {
		coordinates = make(Coordinates, 0, INIT_GEOM_CAP)
	}
	return &LineString{Type: "LineString", Coordinates: coordinates}
}
530647
func (l *line) Add(word string) bool {
	newLine := line{
		wrap:  l.wrap,
		words: append(l.words, word),
	}
	if newLine.Len() <= l.wrap || len(l.words) == 0 {
		l.words = newLine.words
		return true
	}
	return false
}
524951
func (s *Statement) Line() *Statement {
	t := token{
		typ:     layoutToken,
		content: "\n",
	}
	*s = append(*s, t)
	return s
}
1262675
func (diffSection *DiffSection) Line(lineType DiffLineType, idx int) *DiffLine {
	var (
		difference    = 0
		addCount      = 0
		delCount      = 0
		matchDiffLine *DiffLine
	)

LOOP:
	for _, diffLine := range diffSection.Lines {
		switch diffLine.Type {
		case DIFF_LINE_ADD:
			addCount++
		case DIFF_LINE_DEL:
			delCount++
		default:
			if matchDiffLine != nil {
				break LOOP
			}
			difference = diffLine.RightIdx - diffLine.LeftIdx
			addCount = 0
			delCount = 0
		}

		switch lineType {
		case DIFF_LINE_DEL:
			if diffLine.RightIdx == 0 && diffLine.LeftIdx == idx-difference {
				matchDiffLine = diffLine
			}
		case DIFF_LINE_ADD:
			if diffLine.LeftIdx == 0 && diffLine.RightIdx == idx+difference {
				matchDiffLine = diffLine
			}
		}
	}

	if addCount == delCount {
		return matchDiffLine
	}
	return nil
}
253328
func NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) InlineKeyboardMarkup {
	var keyboard [][]InlineKeyboardButton

	keyboard = append(keyboard, rows...)

	return InlineKeyboardMarkup{
		InlineKeyboard: keyboard,
	}
}
93896
func NewPoint(tags core.TagSlice) (*Point, error) {
	point := new(Point)

	// set defaults
	point.ExtrusionDirection = core.Point{X: 0.0, Y: 0.0, Z: 1.0}

	point.InitBaseEntityParser()
	point.Update(map[int]core.TypeParser{

		10:  core.NewFloatTypeParserToVar(&point.Location.X),
		20:  core.NewFloatTypeParserToVar(&point.Location.Y),
		30:  core.NewFloatTypeParserToVar(&point.Location.Z),
		39:  core.NewFloatTypeParserToVar(&point.Thickness),
		50:  core.NewFloatTypeParserToVar(&point.XAxisAngle),
		210: core.NewFloatTypeParserToVar(&point.ExtrusionDirection.X),
		220: core.NewFloatTypeParserToVar(&point.ExtrusionDirection.Y),
		230: core.NewFloatTypeParserToVar(&point.ExtrusionDirection.Z),
	})

	err := point.Parse(tags)
	return point, err
}
102691
func NewPolyline(tags core.TagSlice) (*Polyline, error) {
	polyline := new(Polyline)

	// set defaults
	polyline.Vertices = make(VertexSlice, 0)
	polyline.ExtrusionDirection = core.Point{X: 0.0, Y: 0.0, Z: 1.0}

	polyline.InitBaseEntityParser()
	polyline.Update(map[int]core.TypeParser{
		30: core.NewFloatTypeParserToVar(&polyline.Elevation),
		39: core.NewFloatTypeParserToVar(&polyline.Thickness),
		40: core.NewFloatTypeParserToVar(&polyline.DefaultStartWidth),
		41: core.NewFloatTypeParserToVar(&polyline.DefaultEndWidth),
		70: core.NewIntTypeParser(func(flags int) {
			polyline.Closed = flags&closedPolylineBit != 0
			polyline.CurveFitVerticesAdded = flags&curveFitVerticesAddedBit != 0
			polyline.SplineFitVerticesAdded = flags&splineFitVerticesAddedBit != 0
			polyline.Is3dPolyline = flags&is3dPolylineBit != 0
			polyline.Is3dPolygonMesh = flags&is3dPolygonMeshBit != 0
			polyline.PolygonMeshClosedNDir = flags&closedNDirectionBit != 0
			polyline.IsPolyfaceMesh = flags&polyfaceMeshBit != 0
			polyline.LineTypeParentAround = flags&lineTypePatternBit != 0
		}),
		71: core.NewIntTypeParserToVar(&polyline.VertexCountM),
		72: core.NewIntTypeParserToVar(&polyline.VertexCountN),
		73: core.NewIntTypeParserToVar(&polyline.SmoothDensityM),
		74: core.NewIntTypeParserToVar(&polyline.SmoothDensityN),
		75: core.NewIntTypeParser(func(value int) {
			polyline.SmoothSurface = SmoothSurfaceType(value)
		}),
		210: core.NewFloatTypeParserToVar(&polyline.ExtrusionDirection.X),
		220: core.NewFloatTypeParserToVar(&polyline.ExtrusionDirection.Y),
		230: core.NewFloatTypeParserToVar(&polyline.ExtrusionDirection.Z),
	})

	err := polyline.Parse(tags)
	return polyline, err
}
1322662
func (builder *Builder) PreviousLine(n uint) *Builder {
	return builder.With(PreviousLine(n))
}
410260
func NewLine(a, b *Point) *Line {
	return &Line{*a.Clone(), *b.Clone()}
}
202883
func (w *Writer) CreateInline() (*InlineWriter, error) {
	var h message.Header
	h.Set("Content-Type", "multipart/alternative")

	mw, err := w.mw.CreatePart(h)
	if err != nil {
		return nil, err
	}
	return &InlineWriter{mw}, nil
}
556949
func scanUnixLine(data []byte, atEOF bool) (advance int, token []byte, err error) {
	advance, token, err = bufio.ScanLines(data, atEOF)
	if advance == 0 {
		// If we reached the end of a line without a newline, then
		// just return as it is. Otherwise the Scanner will keep trying
		// to scan, blocking forever.
		return
	}

	return advance, append(token, '\n'), err
}
53307
func NewLabels(labels ...*Label) error {
	_, err := x.Insert(labels)
	return err
}
830774
func writeLine(buf *bytes.Buffer, words ...string) {
	buf.WriteString(strings.Join(words, " ") + "\n")
}