Joins adjacent Str elements found in the element list 'x'.
426265
def _join_strings(x):
    """"""
    for i in range(len(x)-1):  # Process successive pairs of elements
        if x[i]['t'] == 'Str' and x[i+1]['t'] == 'Str':
            x[i]['c'] += x[i+1]['c']
            del x[i+1]  # In-place deletion of element from list
            return None  # Forces processing to repeat
    return True
378794
@Nonnull
    public static String join(@Nonnull Iterable<String> elements, @Nonnull String delimiter) {
        StringBuilder result = new StringBuilder();
        Iterator<String> it = elements.iterator();
        while (it.hasNext()) {
            String element = it.next();
            result.append(element);
            if (it.hasNext()) {
                result.append(delimiter);
            }
        }
        return result.toString();
    }
977123
def merge_partial_elements(element_list):
    
    outs = dict()  # output data structure
    for element in element_list:
        if element['py_expr'] != "None":  # for
            name = element['py_name']
            if name not in outs:
                # Use 'expr' for Vensim models, and 'eqn' for Xmile (This makes the Vensim equation prettier.)
                eqn = element['expr'] if 'expr' in element else element['eqn']

                outs[name] = {
                    'py_name': element['py_name'],
                    'real_name': element['real_name'],
                    'doc': element['doc'],
                    'py_expr': [element['py_expr']],  # in a list
                    'unit': element['unit'],
                    'subs': [element['subs']],
                    'lims': element['lims'],
                    'eqn': eqn,
                    'kind': element['kind'],
                    'arguments': element['arguments']
                }

            else:
                outs[name]['doc'] = outs[name]['doc'] or element['doc']
                outs[name]['unit'] = outs[name]['unit'] or element['unit']
                outs[name]['lims'] = outs[name]['lims'] or element['lims']
                outs[name]['eqn'] = outs[name]['eqn'] or element['eqn']
                outs[name]['py_expr'] += [element['py_expr']]
                outs[name]['subs'] += [element['subs']]
                outs[name]['arguments'] = element['arguments']

    return list(outs.values())
557265
def join(self, name, args, arg_separator=None):
        """"""
        if None is arg_separator:
            arg_separator = ', '
        args = [_f for _f in args if _f]

        if not args:
            args_str = ' '
        elif len(args) == 1:
            args_str = ' ' + args[0] + ' '
        else:
            args_str = ' ' + arg_separator.join(args) + ' '

        return ''.join([name, self.__begin, args_str, self.__end])
1127419
function subArrayJoin(a, separator, from, to) {
    return a.slice(from, to + 1).join(separator);
}
625686
function join(data, separators, def_separator) {
	var undefined, buf, separator, 
	    def_separator = init(def_separator, ",");
	
	foreach(data).each(function(value) {
		if(buf === undefined) {
			buf = value;
			return;
		}
		separator = separators.shift();
		buf += init(separator, def_separator) + value;
	});
	return buf;
}
1180326
public static String join(List<String> list, String delim) {

		StringBuilder sb = new StringBuilder();

		String loopDelim = "";

		for (String s : list) {

			sb.append(loopDelim);
			sb.append(s);

			loopDelim = delim;
		}

		return sb.toString();
	}
808887
def nested_join(array, o_str= '{', c_str= '}'):
    '''
        
    '''
    result = ''
    for x in array :
        if type(x) == type([])  :
            result  +=o_str+ nested_join(x)+ c_str
        else                    :
            result  +=x
    return result
1254392
def concat_list(listA, listB, delim=' '):
    

    # Lists must be of equal length.
    if len(listA) != len(listB):
        raise IndexError('Input lists are not parallel.')

    # Concatenate lists.
    listC = []
    for i in xrange(len(listA)):
        app = listA[i] + delim + listB[i]
        listC.append(app)

    return listC
706561
public static String joinStrings(List<String> strings, boolean fixCase, char withChar) {
        if (strings == null || strings.size() == 0) {
            return "";
        }
        StringBuilder result = null;
        for (String s : strings) {
            if (fixCase) {
                s = fixCase(s);
            }
            if (result == null) {
                result = new StringBuilder(s);
            } else {
                result.append(withChar);
                result.append(s);
            }
        }
        return result.toString();
    }
557638
def join(C, *args, **kwargs):
        """"""
        u = C('/'.join([str(arg).strip('/') for arg in args]), **kwargs)
        return u
254204
public static String join(String separator, Collection<String> stringsToJoin) {
        StringBuilder builder = new StringBuilder();
        // Check if there is at least 1 element then use do/while to avoid trailing separator
        int index = stringsToJoin.size();
        for (String str : stringsToJoin) {
            index--;
            if (str != null) {
                builder.append(str);
                if (index > 0) {
                    builder.append(separator);
                }
            }
        }
        return builder.toString();
    }
660976
function join(separator, itemList) {
    var result = "";
    for (var i = 0; i < itemList.length; i++) {
        if (i > 0) {
            result += separator;
        }
        result += itemList[i];
    }
    return result;
}
519609
def join_and(value):
    
    # convert numbers to strings
    value = [str(item) for item in value]

    if len(value) == 1:
        return value[0]
    if len(value) == 2:
        return "%s and %s" % (value[0], value[1])

    # join all but the last element
    all_but_last = ", ".join(value[:-1])
    return "%s and %s" % (all_but_last, value[-1])
912891
public static String joinP(String delimiter, int... values) {
        StringBuilder builder = new StringBuilder(values.length + (delimiter.length() * values.length));
        boolean first = true;
        for (int i : values) {
            if (first) {
                first = false;
            } else {
                builder.append(delimiter);
            }
            builder.append(Integer.toString(i));
        }
        return builder.toString();
    }
571782
public static String join(List<String> parts, String separator) {
		Iterator<String> it = parts.iterator();
		StringBuilder builder = new StringBuilder();
		while (it.hasNext()) {
			String part = it.next();
			builder.append(part);
			if (it.hasNext()) {
				builder.append(separator);
			}
		}
		return builder.toString();
	}
512653
def insert(self, i, x):
        """"""
        if not isinstance(x, str):
            raise TypeError(
                'Members of this object must be strings. '
                'You supplied \"%s\"' % type(x))
        list.insert(self, i, x)