Join a locale specifier split in the format returned by split_locale.
550771
def join_locale(comps):
    '''
    
    '''
    loc = comps['language']
    if comps.get('territory'):
        loc += '_' + comps['territory']
    if comps.get('codeset'):
        loc += '.' + comps['codeset']
    if comps.get('modifier'):
        loc += '@' + comps['modifier']
    if comps.get('charmap'):
        loc += ' ' + comps['charmap']
    return loc
733999
def split(self, sep=TOKENS):
        
        if sep != TOKENS:
            return unicode.split(self, sep)
        if len(self) == 0:
            return []
        return [[[x.replace("&slash;", "/") for x in token.split("/")]
            for token in sentence.split(" ")]
                for sentence in unicode.split(self, "\n")]
78479
public static Locale fromString(final String locale) {
        final String[] data = Strings.split(locale, '_');
        if (data.length == 1) {
            return new Locale(data[0]);
        } else if (data.length == 2) {
            return new Locale(data[0], data[1]);
        } else if (data.length == 3) {
            return new Locale(data[0], data[1], data[2]);
        }
        throw new IllegalArgumentException("Invalid locale string: " + locale);
    }
850415
def _py2_and_3_joiner(sep, joinable):
    
    if ISPY3:
        sep = bytes(sep, DEFAULT_ENCODING)
    joined = sep.join(joinable)
    return joined.decode(DEFAULT_ENCODING) if ISPY3 else joined
1020564
private static String toLanguageTag(String locale) {
        if (locale == null) {
            return null;
        }
        // assume we are already a language tag
        if (!locale.contains("_")) {
            return locale;
        }

        // language can be missing, in which case we don't even bother
        if (locale.startsWith("_")) {
            return locale;
        }

        // Java 6 does "lang_country_variant". If country is missing, then "lang__variant". If no
        // variant, then just "lang_country".
        String [] parts = locale.split("_", 3);

        String lang = parts[0];
        String country = parts[1];
        String variant = parts.length == 3 ? parts[2] : "";

        return toLanguageTag(new Locale(lang, country, variant));
    }
452050
def split(string, separator_regexp=None, maxsplit=0):
    
    if not string:
        return []
    if separator_regexp is None:
        separator_regexp = _default_separator()
    if not separator_regexp:
        return string.split()
    return re.split(separator_regexp, string, maxsplit)
1205378
function split(str, separator) {
    separator = separator || '';
    if (_.isString(str)) {
        return str.split(separator);
    } else {
        return str;
    }
}
42222
def split(s, posix=True):
    
    if isinstance(s, six.binary_type):
        s = s.decode("utf-8")
    return shlex.split(s, posix=posix)
633627
def split_source(source_code):
    '''
    '''
    eol_chars = get_eol_chars(source_code)
    if eol_chars:
        return source_code.split(eol_chars)
    else:
        return [source_code]
157241
def splits(self):
        "  "
        result = []

        def collect(split):
            result.append(split)

            for item in split:
                if isinstance(item, (HSplit, VSplit)):
                    collect(item)

        collect(self.root)
        return result
923413
def _split(string, splitters):
    """"""
    part = ''
    for character in string:
        if character in splitters:
            yield part
            part = ''
        else:
            part += character
    yield part
705769
def _join(*args):
    
    return delimiter.join(filter(lambda s: s != '', map(lambda s: s.lstrip(delimiter), args)))
845220
def splitArgs(self, args):
        """"""
        try:
            return shlex.split(args)
        except ValueError as e:
            raise UsageError(e)
836375
def _split_keys_v2(joined):
    
    left, _, right = joined.rpartition('::')
    return _decode_v2(left), _decode_v2(right)
323767
def normalize_locale_code(locale: Union[Locale, str]) -> str:
    
    if not isinstance(locale, Locale):
        locale = Locale.parse(locale.replace('-', '_'))
    return str(locale)
834409
def norm_locale (loc):
    """"""
    loc = locale.normalize(loc)
    # split up the locale into its base components
    pos = loc.find('@')
    if pos >= 0:
        loc = loc[:pos]
    pos = loc.find('.')
    if pos >= 0:
        loc = loc[:pos]
    pos = loc.find('_')
    if pos >= 0:
        loc = loc[:pos]
    return loc
748124
def split(self, decl_string):
        """"""
        assert self.has_pattern(decl_string)
        return self.name(decl_string), self.args(decl_string)