// Split converts NFC to NFD
175674
func Split(c rune) (l, m, t rune) {
	t = (c - 0xAC00) % 28
	m = ((c - 0xAC00 - t) % 588) / 28
	l = (c - 0xAC00) / 588

	l += LEAD_BASE
	m += MEDIAL_BASE
	if t != 0 {
		t += TAIL_BASE - 1
	}

	return
}
990874
func Split(sep, str cty.Value) (cty.Value, error) {
	return SplitFunc.Call([]cty.Value{sep, str})
}
292874
func splitPort(port string) (local, remote string) {
	parts := strings.Split(port, ":")
	if len(parts) == 2 {
		return parts[0], parts[1]
	}

	return parts[0], parts[0]
}
961613
func (cs Set) Split() (domain, target, ref string) {
	switch p := strings.SplitN(string(cs), "/", 3); len(p) {
	case 1:
		return p[0], "", ""
	case 2:
		return p[0], p[1], ""
	default:
		return p[0], p[1], p[2]
	}
}
530237
func (tableNode *routingTableNode) Split() {
	prefixLen := tableNode.KBucket().prefix.Size

	if prefixLen == maxPrefixLength {
		return
	}

	for i := 0; i < 2; i++ {
		tableNode.SetChild(i, newRoutingTableNode(newBitmapFrom(
			tableNode.KBucket().prefix, prefixLen+1)))
	}

	tableNode.Lock()
	tableNode.children[1].bucket.prefix.Set(prefixLen)
	tableNode.Unlock()

	for e := range tableNode.KBucket().nodes.Iter() {
		nd := e.Value.(*node)
		tableNode.Child(nd.id.Bit(prefixLen)).KBucket().nodes.PushBack(nd)
	}

	for e := range tableNode.KBucket().candidates.Iter() {
		nd := e.Value.(*node)
		tableNode.Child(nd.id.Bit(prefixLen)).KBucket().candidates.PushBack(nd)
	}

	for i := 0; i < 2; i++ {
		tableNode.Child(i).KBucket().UpdateTimestamp()
	}
}
186562
func (qt *quadtreeNode) split() {
	if qt.hasNodes {
		return
	}
	qt.hasNodes = true

	nextLevel := qt.Level + 1
	subWidth := aabbWidth(qt.Bounds) / 2
	subHeight := aabbHeight(qt.Bounds) / 2
	x := qt.Bounds.Min.X
	y := qt.Bounds.Min.Y

	//top right node (0)
	qt.Nodes[0] = qt.Tree.newNode(aabbRect(x+subWidth, y, subWidth, subHeight), nextLevel)

	//top left node (1)
	qt.Nodes[1] = qt.Tree.newNode(aabbRect(x, y, subWidth, subHeight), nextLevel)

	//bottom left node (2)
	qt.Nodes[2] = qt.Tree.newNode(aabbRect(x, y+subHeight, subWidth, subHeight), nextLevel)

	//bottom right node (3)
	qt.Nodes[3] = qt.Tree.newNode(aabbRect(x+subWidth, y+subHeight, subWidth, subHeight), nextLevel)
}
1337649
func SplitLevel(errIn error, level rfc2119.Level) (levelErrors LevelErrors, errOut error) {
	merr, ok := errIn.(*multierror.Error)
	if !ok {
		return levelErrors, errIn
	}
	for _, err := range merr.Errors {
		e, ok := err.(*Error)
		if ok && e.Err.Level < level {
			fmt.Println(e)
			levelErrors.Warnings = append(levelErrors.Warnings, e)
			continue
		}
		levelErrors.Error = multierror.Append(levelErrors.Error, err)
	}
	return levelErrors, nil
}
989130
func splitMessage(msg string, splitLen int) (msgs []string) {
	// This is quite short ;-)
	if splitLen < 13 {
		splitLen = defaultSplit
	}
	for len(msg) > splitLen {
		idx := indexFragment(msg[:splitLen-3])
		if idx < 0 {
			idx = splitLen - 3
		}
		msgs = append(msgs, msg[:idx]+"...")
		msg = msg[idx:]
	}
	return append(msgs, msg)
}
948316
func splitTags(tags string) (string, options) {
	res := strings.Split(tags, ",")
	return res[0], res[1:]
}
348410
func (m *PolicyDB) tagSplit(tag string, k *string, v *string) error {
	l := len(tag)
	if l < 3 {
		return fmt.Errorf("Invalid tag: invalid length '%s'", tag)
	}

	if tag[0] == '=' {
		return fmt.Errorf("Invalid tag: missing key '%s'", tag)
	}

	for i := 0; i < l; i++ {
		if tag[i] == '=' {
			if i+1 >= l {
				return fmt.Errorf("Invalid tag: missing value '%s'", tag)
			}
			*k = tag[:i]
			*v = tag[i+1:]
			return nil
		}
	}

	return fmt.Errorf("Invalid tag: missing equal symbol '%s'", tag)
}
89770
func (c Context) Split(s string, sep string) []string {
	return strings.Split(s, sep)
}
1138857
func SplitChildren(node *parser.Node, value string) []*parser.Node {
	var split []*parser.Node
	var children []*parser.Node
	for _, child := range node.Children {
		if child.Value == value {
			split = append(split, child)
		} else {
			children = append(children, child)
		}
	}
	node.Children = children
	return split
}
808117
func string_splitlines(fnname string, recv Value, args Tuple, kwargs []Tuple) (Value, error) {
	var keepends bool
	if err := UnpackPositionalArgs(fnname, args, kwargs, 0, &keepends); err != nil {
		return nil, err
	}
	s := string(recv.(String))
	var lines []string
	// TODO(adonovan): handle CRLF correctly.
	if keepends {
		lines = strings.SplitAfter(s, "\n")
	} else {
		lines = strings.Split(s, "\n")
	}
	if strings.HasSuffix(s, "\n") {
		lines = lines[:len(lines)-1]
	}
	list := make([]Value, len(lines))
	for i, x := range lines {
		list[i] = String(x)
	}
	return NewList(list), nil
}
99886
func splitBulk(s string) []string {
	f := func(c rune) bool {
		return c == '\n' || c == ','
	}
	split := strings.FieldsFunc(s, f)
	for i, s := range split {
		split[i] = strings.TrimSpace(s)
	}
	return split
}
927401
func splitStr(path, sep string, n int) []string {
	splits := strings.SplitN(path, sep, n)
	// Add empty strings if we found elements less than nr
	for i := n - len(splits); i > 0; i-- {
		splits = append(splits, "")
	}
	return splits
}
1022275
func (rs *RowSplitter) Split(result [][][]sqltypes.Value, rows [][]sqltypes.Value) error {
	for _, row := range rows {
		k, err := rs.KeyResolver.keyspaceID(row)
		if err != nil {
			return err
		}
		for i, kr := range rs.KeyRanges {
			if key.KeyRangeContains(kr, k) {
				result[i] = append(result[i], row)
				break
			}
		}
	}
	return nil
}
377177
func Splitlines(s string) []string {
	s = strings.Replace(s, "\r", "\n", -1)
	s = strings.Replace(s, "\r\n", "\n", -1)
	return MapS(trimnewlines, FilterS(nonempty, strings.Split(s, "\n")))
}