Split a string into a list of tuples of the form (key, modifier_fn,
    explode) where modifier_fn is a function that applies the appropriate
    modification to the variable.
429091
def _split_basic(string):
    
    tuples = []
    for word in string.split(','):
        # Attempt to split on colon
        parts = word.split(':', 2)
        key, modifier_fn, explode = parts[0], _identity, False
        if len(parts) > 1:
            modifier_fn = functools.partial(
                _truncate, num_chars=int(parts[1]))
        if word[len(word) - 1] == '*':
            key = word[:len(word) - 1]
            explode = True
        tuples.append((key, modifier_fn, explode))
    return tuples
814304
def ver_str_to_tuple(ver_str):
    """"""
    out = []
    for x in ver_str.split("."):
        try:
            x = int(x)
        except ValueError:
            pass
        out.append(x)
    return tuple(out)
419031
def destringize(self, string):
        

        # todo: assert -- starting with (, ending with )
        # (prefix,read_tuple_id,segments_t,suffix)=(text).split("__")
        # segments=segments_t.split("),(")
        m = read_tuple_destr_pattern.match(string)
        if not m:
            smbl.messages.error(
                "'{}' is not a valid read name with respect to the RNF specification".format(string),
                program="RNFtools", subprogram="RNF format", exception=ValueError
            )
        groups = m.groups()
        # todo: check number of groups
        self.prefix = groups[0]
        read_tuple_id = groups[1]
        self.read_tuple_id = int(read_tuple_id, 16)
        self.segments = []
        segments_str = groups[2:-1]
        for b_str in segments_str:
            if b_str is not None:
                if b_str[0] == ",":
                    b_str = b_str[1:]
                b = rnftools.rnfformat.Segment()
                b.destringize(b_str)
                self.segments.append(b)
        self.suffix = groups[-1]
766275
def parse_keys(string,
                with_spaces = False,
                with_tabs = False,
                with_newlines = False,
                modifiers = None):
    ""

    keys = []
    if not modifiers:
        modifiers = []
    index = 0
    while index < len(string):

        c = string[index]
        index += 1
        # check if one of CTRL, SHIFT, ALT has been pressed
        if c in MODIFIERS.keys():
            modifier = MODIFIERS[c]
            # remember that we are currently modified
            modifiers.append(modifier)
            # hold down the modifier key
            keys.append(VirtualKeyAction(modifier, up = False))
            if DEBUG:
                print("MODS+", modifiers)
            continue

        # Apply modifiers over a bunch of characters (not just one!)
        elif c == "(":
            # find the end of the bracketed text
            end_pos = string.find(")", index)
            if end_pos == -1:
                raise KeySequenceError('`)` not found')
            keys.extend(
                parse_keys(string[index:end_pos], modifiers = modifiers))
            index = end_pos + 1

        # Escape or named key
        elif c == "{":
            # We start searching from index + 1 to account for the case {}}
            end_pos = string.find("}", index + 1)
            if end_pos == -1:
                raise KeySequenceError('`}` not found')

            code = string[index:end_pos]
            index = end_pos + 1
            keys.extend(handle_code(code))

        # unmatched ")"
        elif c == ')':
            raise KeySequenceError('`)` should be preceeded by `(`')

        # unmatched "}"
        elif c == '}':
            raise KeySequenceError('`}` should be preceeded by `{`')

        # so it is a normal character
        else:
            # don't output white space unless flags to output have been set
            if (c == ' ' and not with_spaces or
                c == '\t' and not with_tabs or
                c == '\n' and not with_newlines):
                continue

            # output nuewline
            if c in ('~', '\n'):
                keys.append(VirtualKeyAction(CODES["ENTER"]))

            # safest are the virtual keys - so if our key is a virtual key
            # use a VirtualKeyAction
            #if ord(c) in CODE_NAMES:
            #    keys.append(VirtualKeyAction(ord(c)))

            elif modifiers:
                keys.append(EscapedKeyAction(c))

            else:
                keys.append(KeyAction(c))

        # as we have handled the text - release the modifiers
        while modifiers:
            if DEBUG:
                print("MODS-", modifiers)
            keys.append(VirtualKeyAction(modifiers.pop(), down = False))

    # just in case there were any modifiers left pressed - release them
    while modifiers:
        keys.append(VirtualKeyAction(modifiers.pop(), down = False))

    return keys
1247934
function splitByDot(str) {
    var result = [];
    var s = "";

    for (var i = 0; i < str.length; i++) {
        if (str[i] == "\\" && str[i+1] == ".") {
            i++;
            s += ".";
            continue;
        }

        if (str[i] == ".") {
            result.push(s);
            s = "";
            continue;
        }

        s += str[i];
    }

    if (s) {
        result.push(s);
    }

    return result;
}
44630
def split_pks(cols):
  """"""
  pks = []
  others = []
  for name, col in cols.items():
    if col["is_primary_key"] == "t":
      pks.append(name)
    else:
      others.append(name)

  return (tuple(pks), tuple(others))
1022541
public static Tuple<String, String> split(String strColumn, String pattern, String valueName) {
        String name = "split_" + random();
        if (valueName == null) {
            return new Tuple(name, "def " + name + " = doc['" + strColumn + "'].value.split('" + pattern + "')" );
        } else {
            return new Tuple(name, strColumn + "; def " + name + " = " + valueName + ".split('" + pattern + "')");
        }

    }
935897
def make_slice_strings(cls, slice_key):
        
        start = slice_key.start
        size = slice_key.stop - start
        return (str(start), str(size))
1089025
def _tuple_from_str(bbox):
        
        return tuple([float(s) for s in bbox.replace(',', ' ').split() if s])
1082459
public static List<String> split(String string, String delimiter) {
        return split(string, delimiter, true);
    }
637521
public static Tuple<String, String> split(String strColumn, String pattern, int index, String valueName) {
        String name = "split_" + random();
        String script = "";
        if (valueName == null) {
            script = "def " + name + " = doc['" + strColumn + "'].value.split('" + pattern + "')[" + index + "]";

        } else {
            script = "; def " + name + " = " + valueName + ".split('" + pattern + "')[" + index + "]";
        }
        return new Tuple<>(name, script);
    }
1234453
def separate_string(string):
    
    string_list = regex.split(r'<(?![!=])', regex.sub(r'>', '<', string))
    return string_list[::2], string_list[1::2]
773492
def parse_arg(f, kwd, offset=0):
    
    vnames = describe(f)
    return tuple([kwd[k] for k in vnames[offset:]])
403194
function(string, options) {
      options = options || {};
      var separator = options.separator || '_';
      var split = options.split || /(?=[A-Z])/;

      return string.split(split).join(separator);
    }
923413
def _split(string, splitters):
    """"""
    part = ''
    for character in string:
        if character in splitters:
            yield part
            part = ''
        else:
            part += character
    yield part
59017
function slice(source, keys){
    var result = {};

    if (!keys)
      return extend(result, source);

    for (var i = 0, key; key = keys[i++];)
      if (key in source)
        result[key] = source[key];

    return result;
  }
44639
def expand_region(tuple_of_s, a, b, start=0, stop=None):
    ''''''
    return tuple(expand_slice(s, a, b, start=start, stop=stop)
                 for s in tuple_of_s)