Split *predstr* and return the (lemma, pos, sense, suffix) components.

    Examples:
        >>> Pred.split_pred_string('_dog_n_1_rel')
        ('dog', 'n', '1', 'rel')
        >>> Pred.split_pred_string('quant_rel')
        ('quant', None, None, 'rel')
761518
def split_pred_string(predstr):
    
    predstr = predstr.strip('"\'')  # surrounding quotes don't matter
    rel_added = False
    if not predstr.lower().endswith('_rel'):
        logging.debug('Predicate does not end in "_rel": {}'
                      .format(predstr))
        rel_added = True
        predstr += '_rel'
    match = Pred.pred_re.search(predstr)
    if match is None:
        logging.debug('Unexpected predicate string: {}'.format(predstr))
        return (predstr, None, None, None)
    # _lemma_pos(_sense)?_end
    return (match.group('lemma'), match.group('pos'),
            match.group('sense'), None if rel_added else match.group('end'))
752898
def split_bel_stmt(stmt: str, line_num) -> tuple:
    """"""

    m = re.match(f"^(.*?\))\s+([a-zA-Z=\->\|:]+)\s+([\w(]+.*?)$", stmt, flags=0)
    if m:
        return (m.group(1), m.group(2), m.group(3))
    else:
        log.info(
            f"Could not parse bel statement into components at line number: {line_num} assertion: {stmt}"
        )
        return (stmt, None, None)
762273
def split(string, callback=None, sep=None):
    
    if callback is not None:
        return [callback(i) for i in string.split(sep)]
    else:
        return string.split(sep)
193281
def split(orig, sep=None):
    '''
    
    '''
    exp = re.compile(r'\s+' if sep is None else re.escape(sep))
    pos = 0
    length = len(orig)
    while True:
        match = exp.search(orig, pos)
        if not match:
            if pos < length or sep is not None:
                val = orig[pos:]
                if val:
                    # Only yield a value if the slice was not an empty string,
                    # because if it is then we've reached the end. This keeps
                    # us from yielding an extra blank value at the end.
                    yield val
            break
        if pos < match.start() or sep is not None:
            yield orig[pos:match.start()]
        pos = match.end()
127563
def split(self, start=None, end=None, datatype=None, **kwargs):
        
        if not self.interface.multi:
            if datatype == 'array':
                obj = self.array(**kwargs)
            elif datatype == 'dataframe':
                obj = self.dframe(**kwargs)
            elif datatype == 'columns':
                obj = self.columns(**kwargs)
            elif datatype is None:
                obj = self
            else:
                raise ValueError("%s datatype not support" % datatype)
            return [obj]
        return self.interface.split(self, start, end, datatype, **kwargs)
743312
def parse_raw_fact(raw_fact):
    
    def at_split(string):
        """
        Return everything in front of the (leftmost) '@'-symbol, if it was used.

        Args:
            string (str):  The string to be parsed.

        Returns:
            tuple: (front, back) representing the substrings before and after the
                most left ``@`` symbol. If no such symbol was present at all,
                ``back=None``. Both substrings have been trimmed of any leading
                and trailing whitespace.

        Note:
            If our string contains multiple ``@`` symbols, all but the most left
            one will be treated as part of the regular ``back`` string.
            This allows for usage of the symbol in descriptions, categories and tags.

            Also note that *no tags are extracted* any tags included will be considered
            part of the ``category`` string. We are likely to remove this parsing function
            in ``0.14.0`` in favour of a regex based solution so we will not spend
            time on tags for now
        """
        result = string.split('@', 1)
        length = len(result)
        if length == 1:
            front, back = result[0].strip(), None
        else:
            front, back = result
            front, back = front.strip(), back.strip()
        return (front, back)

    def comma_split(string):
        """
        Split string at the most left comma.

        Args:
            string (str): String to be processed. At this stage this should
                look something like ``<Category> and <tags>, <Description>


        Returns
            tuple: (category_and_tags, description). Both substrings have their
                leading/trailing whitespace removed.
                ``category_and_tags`` may include >=0 tags indicated by a leading ``#``.
                As we have used the most left ``,`` to separate both substrings that
                means that categories and tags can not contain any ``,`` but the
                description text may contain as many as wished.
        """

        result = string.split(',', 1)
        length = len(result)
        if length == 1:
            category, description = result[0].strip(), None
        else:
            category, description = tuple(result)
            category, description = category.strip(), description.strip()
        return (category.strip(), description)

    time_info, rest = time_helpers.extract_time_info(raw_fact)
    activity_name, back = at_split(rest)

    if back:
        category_name, description = comma_split(back)
    else:
        category_name, description = None, None

    return {
        'timeinfo': time_info,
        'category': category_name,
        'activity': activity_name,
        'description': description,
    }
319789
function splitNs(eventStr) {
        var dot = eventStr.indexOf(".");
        if (dot === -1) {
            return { eventName: eventStr };
        } else {
            return { eventName: eventStr.substring(0, dot), ns: eventStr.substring(dot) };
        }
    }
246171
def normalize(self, decl_string, arg_separator=None):
        """"""
        if not self.has_pattern(decl_string):
            return decl_string
        name, args = self.split(decl_string)
        for i, arg in enumerate(args):
            args[i] = self.normalize(arg)
        return self.join(name, args, arg_separator)
286012
def paren_split(sep,string):
    
    if len(sep) != 1: raise Exception("Separation string must be one character long")
    retlist = []
    level = 0
    blevel = 0
    left = 0
    for i in range(len(string)):
        if string[i] == "(": level += 1
        elif string[i] == ")": level -= 1
        elif string[i] == "[": blevel += 1
        elif string[i] == "]": blevel -= 1
        elif string[i] == sep and level == 0 and blevel == 0:
            retlist.append(string[left:i])
            left = i+1
    retlist.append(string[left:])
    return retlist
488139
def parse_substring(allele, pred, max_len=None):
    
    result = ""
    pos = 0
    if max_len is None:
        max_len = len(allele)
    else:
        max_len = min(max_len, len(allele))
    while pos < max_len and pred(allele[pos]):
        result += allele[pos]
        pos += 1
    return result, allele[pos:]
1237676
def splitValues(textStr):
    
    vals = textStr.split(",")
    nums = []
    for v in vals:
        nums.append(float(v))
    return nums
949443
def split(self, delimiter=None):
        
        result = []
        strings = self.strings[:]
        current = None

        while strings:
            is_literal, value = strings[0]
            parts = value.split(delimiter, 1)
            if len(parts) > 1:
                value1, value2 = parts
                strings[0] = (is_literal, value2)
                out = EscapedString(value1, is_literal)
                push = True
            else:
                strings = strings[1:]
                out = EscapedString(value, is_literal)
                push = False

            if current is None:
                current = out
            else:
                current = current + out
            if push:
                result.append(current)
                current = None

        if current:
            result.append(current)
        return result
1205378
function split(str, separator) {
    separator = separator || '';
    if (_.isString(str)) {
        return str.split(separator);
    } else {
        return str;
    }
}
1092981
def slice(string, separator="-", start=None, end=None):
    
    # split by wildcards/keywords first
    # AR-{sampleType}-{parentId}{alpha:3a2d}
    segments = filter(None, re.split('(\{.+?\})', string))
    # ['AR-', '{sampleType}', '-', '{parentId}', '{alpha:3a2d}']
    if separator:
        # Keep track of singleton separators as empties
        # We need to do this to prevent duplicates later, when splitting
        segments = map(lambda seg: seg!=separator and seg or "", segments)
        # ['AR-', '{sampleType}', '', '{parentId}', '{alpha:3a2d}']
        # Split each segment at the given separator
        segments = map(lambda seg: split(seg, separator), segments)
        # [['AR', ''], ['{sampleType}'], [''], ['{parentId}'], ['{alpha:3a2d}']]
        # Flatten the list
        segments = list(itertools.chain.from_iterable(segments))
        # ['AR', '', '{sampleType}', '', '{parentId}', '{alpha:3a2d}']
        # And replace empties with separator
        segments = map(lambda seg: seg!="" and seg or separator, segments)
        # ['AR', '-', '{sampleType}', '-', '{parentId}', '{alpha:3a2d}']

    # Get the start and end positions from the segments without separator
    cleaned_segments = filter(lambda seg: seg!=separator, segments)
    start_pos = to_int(start, 0)
    # Note "end" is not a position, but the number of elements to join!
    end_pos = to_int(end, len(cleaned_segments) - start_pos) + start_pos - 1

    # Map the positions against the segments with separator
    start = segments.index(cleaned_segments[start_pos])
    end = segments.index(cleaned_segments[end_pos]) + 1

    # Return all segments joined
    sliced_parts = segments[start:end]
    return "".join(sliced_parts)
1301519
def split_qs(string, delimiter='&'):
    """"""

    open_list = '[<{('
    close_list = ']>})'
    quote_chars = '"\''

    level = index = last_index = 0
    quoted = False
    result = []

    for index, letter in enumerate(string):
        if letter in quote_chars:
            if not quoted:
                quoted = True
                level += 1
            else:
                quoted = False
                level -= 1
        elif letter in open_list:
            level += 1
        elif letter in close_list:
                level -= 1
        elif letter == delimiter and level == 0:
            # Split here
            element = string[last_index: index]
            if element:
                result.append(element)
            last_index = index + 1

    if index:
        element = string[last_index: index + 1]
        if element:
            result.append(element)

    return result
731851
def splitvalue(attr):
    """"""
    global _valueprog
    if _valueprog is None:
        import re
        _valueprog = re.compile('^([^=]*)=(.*)$')

    match = _valueprog.match(attr)
    if match: return match.group(1, 2)
    return attr, None
1129071
def split_comma_argument(comma_sep_str):
    """"""
    terms = []
    for term in comma_sep_str.split(','):
        if term:
            terms.append(term)
    return terms