Splits a string in the format "a,b,c,d,e,f" into
    ['a', 'b', 'c', 'd', 'e', 'f', ]
545569
def list_from_env(key, default=""):
    
    try:
        val = os.environ.get(key, default)
        return val.split(',')
    except (KeyError, ValueError):
        return []
876997
public static String[] split(String string, char delimiter) {
        int delimeterCount = 0;
        int start = 0;
        int end;
        while ((end = string.indexOf(delimiter, start)) != -1) {
            delimeterCount++;
            start = end + 1;
        }

        String[] result = new String[delimeterCount + 1];
        start = 0;
        for (int i = 0; i < delimeterCount; i++) {
            end = string.indexOf(delimiter, start);
            result[i] = string.substring(start, end);
            start = end + 1;
        }
        result[delimeterCount] = string.substring(start, string.length());
        return result;
    }
1129071
def split_comma_argument(comma_sep_str):
    """"""
    terms = []
    for term in comma_sep_str.split(','):
        if term:
            terms.append(term)
    return terms
181858
public static String[] split(String input, char delimiter) {
        return split(input, String.valueOf(delimiter));
    }
1234453
def separate_string(string):
    
    string_list = regex.split(r'<(?![!=])', regex.sub(r'>', '<', string))
    return string_list[::2], string_list[1::2]
735508
def split_string(x: str, n: int) -> List[str]:
    
    # https://stackoverflow.com/questions/9475241/split-string-every-nth-character  # noqa
    return [x[i:i+n] for i in range(0, len(x), n)]
197325
def p_string_list(self, t):
        """"""

        if len(t) == 4:
            t[0] = t[1]
            t[0].append(t[3])
        elif t[1]:
            t[0] = [t[1]]
        else:
            t[0] = []
644321
def split(self, s):
        
        parts = []
        b = 0
        while 1:
            m = self.splitp.match(s, b)
            if m is None:
                break
            b, e = m.span()
            parts.append(s[b:e])
            b = e + 1
        return parts
526126
def split_elements(value):
    """"""
    l = [v.strip() for v in value.split(',')]
    if len(l) == 1:
        l = value.split()
    return l
686010
def split(self):
        """"""

        split_index = []
        parts = []

        pattern = self.pattern.decode('latin-1') if self.is_bytes else self.pattern

        i = util.StringIter(pattern)
        iter(i)
        for c in i:
            if self.extend and c in EXT_TYPES and self.parse_extend(c, i):
                continue

            if c == '|':
                split_index.append(i.index - 1)
            elif c == '\\':
                index = i.index
                try:
                    self._references(i)
                except StopIteration:
                    i.rewind(i.index - index)
            elif c == '[':
                index = i.index
                try:
                    self._sequence(i)
                except StopIteration:
                    i.rewind(i.index - index)

        start = -1
        for split in split_index:
            p = pattern[start + 1:split]
            parts.append(p.encode('latin-1') if self.is_bytes else p)
            start = split

        if start < len(pattern):
            p = pattern[start + 1:]
            parts.append(p.encode('latin-1') if self.is_bytes else p)

        return tuple(parts)
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
1082459
public static List<String> split(String string, String delimiter) {
        return split(string, delimiter, true);
    }
270983
def reduce_multiline(string):
    
    string = str(string)
    return " ".join([item.strip()
                     for item in string.split("\n")
                     if item.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
739742
private function splitString($string)
    {
        $result = array();
        for ($i = 0; $i < mb_strlen($string, "UTF-8"); ++$i) {
            $result[] = mb_substr($string, $i, 1, "UTF-8");
        }
        return $result;
    }
50893
public static List<String> split(String str, String separatorChars)
  {
    final String[] array = StringUtils.split(str, separatorChars);

    return Arrays.asList(array);
  }
219348
def string_to_list(string, sep=",", filter_empty=False):
    """"""
    return [value.strip() for value in string.split(sep)
            if (not filter_empty or value)]