Only split if variable is a string
494675
def shlex_split(s, **kwargs):
    '''
    
    '''
    if isinstance(s, six.string_types):
        # On PY2, shlex.split will fail with unicode types if there are
        # non-ascii characters in the string. So, we need to make sure we
        # invoke it with a str type, and then decode the resulting string back
        # to unicode to return it.
        return salt.utils.data.decode(
            shlex.split(salt.utils.stringutils.to_str(s), **kwargs)
        )
    else:
        return s
306577
def _variable_parts(self, line, codeline):
        """"""
        var_subs = []
        # codeline has pattern and then has the outputs in different versions
        if codeline:
            var_subs = self._find_variable(codeline.pattern, line)
        else:
            # make variable part of the line string without all the other stuff
            line_str = self._strip_datetime(self._strip_counters(line))
            var_subs = [line_str.strip()]
        return var_subs
394620
function split(path) {
    var res = [];
    var level = 0;
    var key = '';

    for (var i = 0; i < path.length; i++) {
      var c = path.substr(i, 1);

      if (level === 0 && (c === '.' || c === '[')) {
        if (c === '[') {
          level++;
          i++;
          c = path.substr(i, 1);
        }

        if (key) { // the first value could be a string
          res.push(key);
        }
        key = '';
        continue;
      }

      if (c === ']') {
        level--;
        key = key.slice(0, -1);
        continue;
      }

      key += c;
    }

    res.push(key);

    return res;
  }
610079
function split (str) {
  if (str.indexOf(':') >= 0) {
    var parts = str.split(':')
    var m = parts.shift()
    parts = parts.join(':').split(FIELD_REGEX)
    parts.unshift(m)
    return parts
  } else {
    return str.split(FIELD_REGEX)
  }
}
649047
def _str_to_list(value, separator):
    """"""
    value_list = [item.strip() for item in value.split(separator)]
    value_list_sanitized = builtins.list(filter(None, value_list))
    if len(value_list_sanitized) > 0:
        return value_list_sanitized
    else:
        raise ValueError('Invalid list variable.')
901207
function parseVariableDeclarations(string, syntax, options) {
  string = ignoreBlock.removeIgnoredBlocks(string);
  var parser = getParserForSyntax(syntax, options);
  if (parser) {
    return parser.parseVariableDeclarations(string);
  }
  return [];
}
864744
function parseString(opts) {
    var obj = new Obj();

    opts.split(' ').forEach(function (item) {
        var data = splitByColon(item);
        obj[data.key] = data.val;
    });

    return obj;
}
1326982
function splitOne(str, sep) {
  let index = str.indexOf(sep);
  return index < 0 ? null : [str.slice(0, index), str.slice(index + sep.length)];
}
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()
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
102070
def split_prefix(var, prefix)

      if prefix.nil?
        m = VAR_PREFIX_REGEX.match(var.to_s)
        prefix = m[1]
        var = m[2]
      end

      [ var, prefix ]
    end
606407
static function str_split($string, $split_length = 1) {
    if ($split_length < 1) {
      return FALSE;
    }
    preg_match_all('/.{1,' . $split_length . '}/u', $string, $matches);
    return $matches[0];
  }
1348855
def is_string(val):
    """"""
    try:
        basestring
    except NameError:
        return isinstance(val, str)
    return isinstance(val, basestring)
330820
def split(self):
        """"""
        key = '%s/split' % self.key
        return self._server.query(key, method=self._server._session.put)
1099687
function(str, delimiter){

	var retlist = null;

	if( ! us.isUndefined(str) ){
	    if( us.isUndefined(delimiter) ){
		delimiter = /\s+/;
	    }
	    
	    retlist = str.split(delimiter);
	}

	return retlist;
    }
1261134
def split_get_last(str_to_split, character, index = 0)
      arrtmp = str_to_split.split(character)
      if index == -1
        arrtmp
      else
        index = index == 0 ? arrtmp.length - 1 : index
        strtmp = arrtmp[index]
        strtmp
      end
    end
615715
function (delimiter, string, limit) {

            if (arguments.length < 2 ||
                typeof delimiter === "undefined" ||
                typeof string === "undefined"
            ) {
                return null;
            }

            if (delimiter === "" ||
                delimiter === false ||
                delimiter === null
            ) {
                return false;
            }

            if (delimiter === true) {
                delimiter = "1";
            }

            // Here we go...
            delimiter += "";
            string += "";

            var splited = string.split(delimiter);

            if (typeof limit === "undefined") {
                return splited;
            }

            // Support for limit
            if (limit === 0) {
                limit = 1;
            }

            // Positive limit
            if (limit > 0) {
                if (limit >= splited.length) {
                    return splited;
                }

                return splited.slice(0, limit - 1)
                    .concat([splited.slice(limit - 1)
                        .join(delimiter)
                    ]);
            }

            // Negative limit
            if (-limit >= splited.length) {
                return [];
            }

            splited.splice(splited.length + limit);

            return splited;
        }