Splits list of a=b pairs, if line doesn't have = then it just goes to keys.
<br> trim() is called for all result keys and values.
174191
public static Map<String, String> splitKeyValue(List<String> lst) {
        if (lst == null || lst.isEmpty()) return null;
        Map<String, String> rslt = null;
        for (String s : lst) {
            s = s.trim();
            if (s.isEmpty() || s.equals("=")) continue;
            int j = s.indexOf('=');
            if (j >= 0) {
                String k = s.substring(0, j).trim();
                String v = s.substring(j + 1).trim();
                if (k.isEmpty() && v.isEmpty()) continue;
                if (rslt == null) rslt = new LinkedHashMap<>();
                rslt.put(k, v);
            } else {
                if (rslt == null) rslt = new LinkedHashMap<>();
                rslt.put(s, null);
            }
        }
        return rslt;
    }
1207931
public static String[] getDataFromLine(final String line, final String seperator,
		final boolean trim)
	{
		final StringTokenizer tokenizer = new StringTokenizer(line, seperator);
		final List<String> data = new ArrayList<>();
		while (tokenizer.hasMoreElements())
		{
			final String string = tokenizer.nextToken();
			if (trim)
			{
				data.add(string.trim());
			}
			else
			{
				data.add(string);
			}

		}
		final String[] splittedLine = data.toArray(new String[0]);
		return splittedLine;
	}
360170
function parseConsecutiveLists(list, listType, trimTrailing) {
    // check if we caught 2 or more consecutive lists by mistake
    // we use the counterRgx, meaning if listType is UL we look for UL and vice versa
    var counterRxg = (listType === 'ul') ? /^ {0,2}\d+\.[ \t]/gm : /^ {0,2}[*+-][ \t]/gm,
      subLists = [],
      result = '';

    if (list.search(counterRxg) !== -1) {
      (function parseCL(txt) {
        var pos = txt.search(counterRxg);
        if (pos !== -1) {
          // slice
          result += '\n\n<' + listType + '>' + processListItems(txt.slice(0, pos), !!trimTrailing) + '</' + listType + '>\n\n';

          // invert counterType and listType
          listType = (listType === 'ul') ? 'ol' : 'ul';
          counterRxg = (listType === 'ul') ? /^ {0,2}\d+\.[ \t]/gm : /^ {0,2}[*+-][ \t]/gm;

          //recurse
          parseCL(txt.slice(pos));
        } else {
          result += '\n\n<' + listType + '>' + processListItems(txt, !!trimTrailing) + '</' + listType + '>\n\n';
        }
      })(list);
      for (var i = 0; i < subLists.length; ++i) {

      }
    } else {
      result = '\n\n<' + listType + '>' + processListItems(list, !!trimTrailing) + '</' + listType + '>\n\n';
    }

    return result;
  }
814662
def _splitit(self, line, isheader):
        

        line_wrapped = []
        for cell, width in zip(line, self._width):
            array = []
            for c in cell.split('\n'):
                array.extend(textwrap.wrap(unicode(c, 'utf'), width))
            line_wrapped.append(array)
        max_cell_lines = reduce(max, map(len, line_wrapped))
        for cell, valign in zip(line_wrapped, self._valign):
            if isheader:
                valign = "t"
            if valign == "m":
                missing = max_cell_lines - len(cell)
                cell[:0] = [""] * (missing / 2)
                cell.extend([""] * (missing / 2 + missing % 2))
            elif valign == "b":
                cell[:0] = [""] * (max_cell_lines - len(cell))
            else:
                cell.extend([""] * (max_cell_lines - len(cell)))
        return line_wrapped
1363544
public static List<String> split(final CharSequence value, final String separator) {
        return newArrayList(Splitter.on(separator).omitEmptyStrings().trimResults().split(value));
    }
84740
def trim_iterable(iterable, limit, *, split=None, prefix='', postfix=''):
    
    if split is None:
        sl = 0
        join = False
    else:
        sl = len(split)
        join = True
    result = []
    rl = 0
    for element in iterable:
        element = prefix + element + postfix
        el = len(element)
        if len(result) > 0:
            el += sl
        rl += el
        if rl <= limit:
            result.append(element)
        else:
            break
    if join:
        result = split.join(result)
    return result
665534
public static String[] split(String strings, String separator) {
		return split(strings, separator, DEFAULT_TRIM);
	}
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()
1363021
def _pairs(keys, *, start=1, sep=' AND '):
    '''
    
    '''
    return sep.join('{}=${}'.format(k, i) for i, k in enumerate(keys, start))
1282140
def trim(lines):
    
    trim_top = None
    trim_bottom = None
    _lines = lines[:]

    for (lineno, line) in enumerate(_lines):
        if hasattr(line, 'is_text_line') and line.is_text_line and not line.text.strip():
            trim_top = lineno
        else:
            break

    for (lineno, line) in enumerate(reversed(_lines)):
        if hasattr(line, 'is_text_line') and line.is_text_line and not line.text.strip():
            trim_bottom = lineno
        else:
            break

    if trim_top is not None:
        _lines = _lines[trim_top + 1:]

    if trim_bottom is not None:
        trim_bottom = len(_lines) - trim_bottom - 1
        _lines = _lines[:trim_bottom]

    return _lines
787940
public static List<String> splitToList(final String value) {
        if (!StringUtils.isEmpty(value)) {
            return COMMA_SPLITTER.splitToList(value);
        }
        return Collections.<String> emptyList();
    }
997634
def multi_split(s, split):
    # type: (S, Iterable[S]) -> List[S]
    """"""
    for r in split:
        s = s.replace(r, "|")
    return [i for i in s.split("|") if len(i) > 0]
726702
private static Pair keyValue(final String line) {

		final String[] parts = line.split("=", 2);

		if (parts.length == 2) {

			final String key   = parts[0].trim();
			final String value = parts[1].trim();

			return new Pair(key, value);
		}

		// ignore invalid lines
		return null;
	}
544470
public Separator trim(LineFormat.Trim trim) {
        return new Separator(separator, pattern, trim, skipEmpty, forNull, skipNull);
    }
13066
def split_list_by(lst, key):
  

  first, second = [], []
  for item in lst:
    if key(item):
      second.append(item)
    else:
      first.append(item)
  return (first, second)
167977
def split_lines(lines):
    
    container = []
    new_list = []
    for line in lines:
        if '>>>' in line:
            container.append(new_list)
            new_list = []
        else:
            new_list.append(line)
    container.append(new_list)
    return container
1128743
private String[] splitInTwo(String text)	{
	  Matcher matcher = LINE_SEPARATOR.matcher(text);
	  while (matcher.find()){
		  int start = matcher.start();
		  if (start > 0 && start < text.length())	{
			  String segment = text.substring(0, start);
			  if (segment.trim().length() > 0)
				  return new String[] {text.substring(0, start), text.substring(start)};
		  }
	  }
	  return new String[] {text};
  }