Split the JSDoc tag text (everything following the @) at the first
    whitespace.  Returns a tuple of (tagname, body).
492444
def split_tag(section):
    
    splitval = re.split('\s+', section, 1)
    tag, body = len(splitval) > 1 and splitval or (splitval[0], '')
    return tag.strip(), body.strip()
322117
def split_code_at_show(text):
    

    parts = []
    is_doctest = contains_doctest(text)

    part = []
    for line in text.split("\n"):
        if (not is_doctest and line.strip() == 'plt.show()') or \
               (is_doctest and line.strip() == '>>> plt.show()'):
            part.append(line)
            parts.append("\n".join(part))
            part = []
        else:
            part.append(line)
    if "\n".join(part).strip():
        parts.append("\n".join(part))
    return parts
622233
def split(self, maxsplit=None, dequote=True):
        

        class Word(object):
            """
            A None-or-str object which can always be appended to.
            Similar to a defaultdict but with only a single value.
            """

            def __init__(self):
                self.value = None

            @property
            def valid(self):
                return self.value is not None

            def append(self, s):
                if self.value is None:
                    self.value = s
                else:
                    self.value += s

        num_splits = 0
        word = Word()
        while True:
            ch = self.stream.read(1)
            if not ch:
                # EOF
                if word.valid:
                    yield word.value

                return

            if (not self.escaped and
                    self.envs is not None and
                    ch == '$' and
                    self.quotes != self.SQUOTE):
                while True:
                    # Substitute environment variable
                    braced = False
                    varname = ''
                    while True:
                        ch = self.stream.read(1)
                        if varname == '' and ch == '{':
                            braced = True
                            continue

                        if not ch:
                            # EOF
                            break

                        if braced and ch == '}':
                            break

                        if not ch.isalnum() and ch != '_':
                            break

                        varname += ch

                    try:
                        word.append(self.envs[varname])
                    except KeyError:
                        pass

                    # Check whether there is another envvar
                    if ch != '$':
                        break

                if braced and ch == '}':
                    continue

                # ch now holds the next character

            # Figure out what our quoting/escaping state will be
            # after this character
            is_escaped = self.escaped
            ch_unless_consumed = self._update_quoting_state(ch)

            if dequote:
                # If we just processed a quote or escape character,
                # and were asked to dequote the string, consume it now
                ch = ch_unless_consumed

            # If word-splitting has been requested, check whether we are
            # at a whitespace character
            may_split = maxsplit != 0 and (maxsplit is None or
                                           num_splits < maxsplit)
            at_split = may_split and (self.quotes is None and
                                      not is_escaped and
                                      ch.isspace())
            if at_split:
                # It is time to yield a word
                if word.valid:
                    num_splits += 1
                    yield word.value

                word = Word()
            else:
                word.append(ch)
1165132
def parse_split(cls, header: bytes, body: bytes) -> 'MessageContent':
        
        header_lines = cls._find_lines(header)
        body_lines = cls._find_lines(body)
        header_view = memoryview(header)
        body_view = memoryview(body)
        return cls._parse_split([header_view, body_view], header, body,
                                header_view, body_view,
                                header_lines, body_lines)
267143
function splitSpaceList(source) {
	var segments = [];
	var matcher = new RegExp("\"([^\"]*)\"|'([^']*)'|(\\S+)", "g");
	var match;
	while (match = matcher.exec(source)) {
		if (match[1] != null) {
			segments.push(match[1]);
		} else if (match[2] != null) {
			segments.push(match[2]);
		} else {
			segments.push(match[3]);
		}
	}
	return segments;
}
1340700
def split_tokens(self):
        """"""
        if not self._split_tokens_calculated:
            # split into items (whitespace split)
            self._split_tokens = self._line_str.split()
            self._split_tokens_calculated = True

        return self._split_tokens
512343
private void split() throws IOException {
        hasSplit = true;
        IntegerBuffer before = new IntegerBuffer();
        IntegerBuffer after = new IntegerBuffer();

        int current;
        boolean ready = false;
        boolean stillNeedToSeeDoctype = true;
        while (!ready && (current = original.read()) != -1) {
            if (Character.isWhitespace((char) current)) {
                before.append(current);
            } else if (current == '<') {
                // could be XML declaration, comment, PI, DOCTYPE
                // or the first element
                int[] elementOrDeclOr = readUntilCloseCharIsReached();
                if (elementOrDeclOr.length > 0) {
                    if (elementOrDeclOr[0] == '?') {
                        // XML declaration or PI
                        before.append('<');
                        before.append(elementOrDeclOr);
                    } else if (elementOrDeclOr[0] != '!') {
                        // first element
                        after.append('<');
                        after.append(elementOrDeclOr);
                        stillNeedToSeeDoctype = false;
                        ready = true;
                    } else {
                        // comment or doctype
                        IntegerBuffer b =
                            new IntegerBuffer(elementOrDeclOr.length);
                        b.append(elementOrDeclOr);
                        if (b.indexOf(DOCTYPE_INTS) == -1) {
                            after.append('<');
                            after.append(elementOrDeclOr);
                        } else {
                            // swallow old declaration
                            stillNeedToSeeDoctype = false;
                        }
                        ready = true;
                    }
                } else {
                    after.append('<');
                    stillNeedToSeeDoctype = false;
                    ready = true;
                }
            } else {
                after.append(current);
                stillNeedToSeeDoctype = false;
                ready = true;
            }
        }

        // need to eliminate original DOCTYPE if it exists
        while (stillNeedToSeeDoctype && (current = original.read()) != -1) {
            if (Character.isWhitespace((char) current)) {
                after.append(current);
            } else if (current == '<') {
                int[] elementOrDeclOr = readUntilCloseCharIsReached();
                if (elementOrDeclOr.length > 0) {
                    if (elementOrDeclOr[0] == '?') {
                        // PI
                        after.append('<');
                        after.append(elementOrDeclOr);
                    } else if (elementOrDeclOr[0] != '!') {
                        // first element
                        after.append('<');
                        after.append(elementOrDeclOr);
                        stillNeedToSeeDoctype = false;
                    } else {
                        // comment or doctype
                        IntegerBuffer b =
                            new IntegerBuffer(elementOrDeclOr.length);
                        b.append(elementOrDeclOr);
                        if (b.indexOf(DOCTYPE_INTS) == -1) {
                            after.append('<');
                            after.append(elementOrDeclOr);
                        } else {
                            // swallow old declaration
                            stillNeedToSeeDoctype = false;
                        }
                    }
                } else {
                    after.append('<');
                    stillNeedToSeeDoctype = false;
                }
            } else {
                after.append(current);
                stillNeedToSeeDoctype = false;
            }
        }

        beforeDoctype = before.size() > 0
            ? new IntBufferReadable(before) : null;
        afterDoctype = after.size() > 0
            ? new IntBufferReadable(after) : null;
    }
1280653
def _subspan(self, s, span, nextspan):
        """"""
        text = s[span[0]:span[1]]
        lowertext = text.lower()

        # Skip if only a single character or a split sequence
        if span[1] - span[0] < 2 or text in self.SPLIT or text in self.SPLIT_END_WORD or text in self.SPLIT_START_WORD or lowertext in self.NO_SPLIT:
            return [span]

        # Skip if it looks like URL
        if text.startswith('http://') or text.startswith('ftp://') or text.startswith('www.'):
            return [span]

        # Split full stop at end of final token (allow certain characters to follow) unless ellipsis
        if self.split_last_stop and nextspan is None and text not in self.NO_SPLIT_STOP and not text[-3:] == '...':
            if text[-1] == '.':
                return self._split_span(span, -1)
            ind = text.rfind('.')
            if ind > -1 and all(t in '\'‘’"“”)]}' for t in text[ind + 1:]):
                return self._split_span(span, ind, 1)

        # Split off certain sequences at the end of a word
        for spl in self.SPLIT_END_WORD:
            if text.endswith(spl) and len(text) > len(spl) and text[-len(spl) - 1].isalpha():
                return self._split_span(span, -len(spl), 0)

        # Split off certain sequences at the start of a word
        for spl in self.SPLIT_START_WORD:
            if text.startswith(spl) and len(text) > len(spl) and text[-len(spl) - 1].isalpha():
                return self._split_span(span, len(spl), 0)

        # Split around certain sequences
        for spl in self.SPLIT:
            ind = text.find(spl)
            if ind > -1:
                return self._split_span(span, ind, len(spl))

        # Split around certain sequences unless followed by a digit
        for spl in self.SPLIT_NO_DIGIT:
            ind = text.rfind(spl)
            if ind > -1 and (len(text) <= ind + len(spl) or not text[ind + len(spl)].isdigit()):
                return self._split_span(span, ind, len(spl))

        # Characters to split around, but with exceptions
        for i, char in enumerate(text):
            if char == '-':
                before = lowertext[:i]
                after = lowertext[i+1:]
                # By default we split on hyphens
                split = True
                if before in self.NO_SPLIT_PREFIX or after in self.NO_SPLIT_SUFFIX:
                    split = False  # Don't split if prefix or suffix in list
                elif not before.strip(self.NO_SPLIT_CHARS) or not after.strip(self.NO_SPLIT_CHARS):
                    split = False  # Don't split if prefix or suffix entirely consist of certain characters
                if split:
                    return self._split_span(span, i, 1)

        # Split contraction words
        for contraction in self.CONTRACTIONS:
            if lowertext == contraction[0]:
                return self._split_span(span, contraction[1])
        return [span]
1124264
def split_namespace(self, tag):
        
        """
        matchobj = self.__regex['xml_ns'].search(tag)
        return matchobj.groups() if matchobj else ('', tag)
1067258
public int doAfterBody() throws JspException
    {
        if (bodyContent != null) {
            String value = bodyContent.getString();
            bodyContent.clearBody();
            if (value.length() > 0)
                _text = value;
        }
        return SKIP_BODY;
    }
396608
static String[] splitName(String name) {
        logger.trace("splitting name for {}", name);

        Matcher m = ARR_ELEMENT_NAME.matcher(name);
        if (m.matches()) {
            return new String[]{ m.group(1), m.group(2), Boolean.TRUE.toString() };
        } else if ((m = OBJ_ELEMENT_NAME.matcher(name)).matches()) {
            return new String[]{ m.group(1), m.group(2), Boolean.FALSE.toString() };
        } else {
            return new String[]{ "", name, Boolean.FALSE.toString() };
        }
    }
1053123
def split(self, s):
        """"""

        normalized = "".join(map(lambda c: " " if c.isspace() else c, s))

        string = False
        quote = False
        v = []
        for col, char in enumerate(normalized.rstrip(), 1):
            if char == '\\':
                quote = True
            if char == '"' and not quote:
                if string:
                    v[-1] = (v[-1][0], v[-1][1] + '"')
                string = not string

            if char.isspace() and not string:
                v.append((col, ""))
            else:
                if len(v) == 0:
                    v.append((col, char))
                else:
                    col, part = v[-1]
                    v[-1] = (col, part + char)

            if char != '\\' and quote:
                quote = False

        return [t_p for t_p in v if t_p[1] != ""]
701944
def parse_tag(text)
      match = text.scan(/%([-:\w]+)([-:\w.#\@]*)(.+)?/)[0]
      raise SyntaxError.new(Error.message(:invalid_tag, text)) unless match

      tag_name, attributes, rest = match

      if !attributes.empty? && (attributes =~ /[.#](\.|#|\z)/)
        raise SyntaxError.new(Error.message(:illegal_element))
      end

      new_attributes_hash = old_attributes_hash = last_line = nil
      object_ref = :nil
      attributes_hashes = {}
      while rest && !rest.empty?
        case rest[0]
        when ?{
          break if old_attributes_hash
          old_attributes_hash, rest, last_line = parse_old_attributes(rest)
          attributes_hashes[:old] = old_attributes_hash
        when ?(
          break if new_attributes_hash
          new_attributes_hash, rest, last_line = parse_new_attributes(rest)
          attributes_hashes[:new] = new_attributes_hash
        when ?[
          break unless object_ref == :nil
          object_ref, rest = balance(rest, ?[, ?])
        else; break
        end
      end

      if rest && !rest.empty?
        nuke_whitespace, action, value = rest.scan(/(<>|><|[><])?([=\/\~&!])?(.*)?/)[0]
        if nuke_whitespace
          nuke_outer_whitespace = nuke_whitespace.include? '>'
          nuke_inner_whitespace = nuke_whitespace.include? '<'
        end
      end

      if @options.remove_whitespace
        nuke_outer_whitespace = true
        nuke_inner_whitespace = true
      end

      if value.nil?
        value = ''
      else
        value.strip!
      end
      [tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
       nuke_inner_whitespace, action, value, last_line || @line.index + 1]
    end
1168610
def split(text: str) -> List[str]:
    
    return [word for word in SEPARATOR.split(text) if word.strip(' \t')]
517180
def collapse_whitespace(text):
    
    if text is None:
        return None
    if hasattr(text, 'xpath'):
        text = text.xpath('string()')
    text = re.sub('\s+', ' ', text)
    return text.strip()
734736
def split(self, text):
        '''
        
        '''
        # nesting character -> count
        counters = {"'": False, '(': 0}

        def reverse(char):

            def wrapped():
                counters[char] = not counters[char]
            return wrapped

        def increase(char):

            def wrapped():
                counters[char] += 1
            return wrapped

        def decrease(char):

            def wrapped():
                counters[char] -= 1
            return wrapped

        def is_top_level():
            return all([not x for x in counters.values()])

        def fail():
            raise BadSyntax('Syntax error processing line: %s' %\
                            self._last_line)


        temp = ""
        # end of field flag indicates that we expect next character to be
        # either whitespace of split
        eof_flag = False

        def append_char(temp, char):
            if eof_flag:
                fail()
            temp += char
            return temp

        # dictionary char -> handler
        nesters = {"'": reverse("'"), "(": increase('('), ")": decrease('(')}
        # chars to split on
        split = (',', )
        # chars to swallow
        consume = (' ', '\n')

        result = list()

        self.log("spliting: %s", text)

        for char in text:
            if char in nesters:
                nesters[char]()
                temp = append_char(temp, char)
            elif not is_top_level():
                temp = append_char(temp, char)
            elif char in consume:
                if len(temp) > 0:
                    eof_flag = True
                continue
            elif char in split:
                result.append(temp)
                temp = ""
                eof_flag = False
            else:
                temp = append_char(temp, char)
        if len(temp) > 0:
            result.append(temp)

        if not is_top_level():
            fail()
        self.log('Split returns %r', result)
        return result
1195745
function splitTag(editor, node, cursor) {
	const open = getText(editor, node.open);
	const m = open.match(/(\s*\/)?>$/);
	const start = node.open.end.translate([0, m ? -m[0].length : 0]);
	editor.setTextInBufferRange(new Range(start, node.open.end), `></${node.name}>`);

	if (cursor) {
		cursor.setBufferPosition(start.translate([0, 1]));
	}
}