Converts Arrays in the query to comma
        separaters lists for proper API handling.
356580
def _normalize_query(self, query):
        

        for k, v in query.items():
            if isinstance(v, list):
                query[k] = ','.join([str(e) for e in v])
318356
def _parse_fields(self, query):
        
        field_args = {
            k: v
            for k, v in query.items() if k.startswith('fields[')
        }

        fields = {}

        for k, v in field_args.items():
            fields[k[7:-1]] = v.split(',')

        return fields
956205
function parseQuery(str) {
    var i, ps, p, n, k, v, l;
    var pairs = [];

    if (typeof(str) === 'undefined' || str === null || str === '') {
      return pairs;
    }

    if (str.indexOf('?') === 0) {
      str = str.substring(1);
    }

    ps = str.toString().split(re.query_separator);

    for (i = 0, l = ps.length; i < l; i++) {
      p = ps[i];
      n = p.indexOf('=');

      if (n !== 0) {
        k = decode(p.substring(0, n));
        v = decode(p.substring(n + 1));
        pairs.push(n === -1 ? [p, null] : [k, v]);
      }

    }
    return pairs;
  }
160748
def _format_list_objects(result):
    """"""

    all_keys = set()
    for item in result:
        all_keys = all_keys.union(item.keys())

    all_keys = sorted(all_keys)
    table = Table(all_keys)

    for item in result:
        values = []
        for key in all_keys:
            value = iter_to_table(item.get(key))
            values.append(value)

        table.add_row(values)

    return table
849757
public static String[] toArray(List<String> list) {
        String[] ret = new String[list.size()];
        for (int i = 0; i < ret.length; i++)
            ret[i] = list.get(i);
        return ret;
    }
452464
public static String arrayToList(String[] array, String delimiter) {
	if (ArrayUtil.isEmpty(array)) return "";
	StringBuilder sb = new StringBuilder(array[0]);

	if (delimiter.length() == 1) {
	    char c = delimiter.charAt(0);
	    for (int i = 1; i < array.length; i++) {
		sb.append(c);
		sb.append(array[i]);
	    }
	}
	else {
	    for (int i = 1; i < array.length; i++) {
		sb.append(delimiter);
		sb.append(array[i]);
	    }
	}

	return sb.toString();
    }
917327
def extract_key_values(array_value, separators=(';', ',', ':'), **kwargs):
    
    items_sep, fields_sep, keys_sep = separators
    return items_sep.join(fields_sep.join(keys_sep.join(x) for x in sorted(it.items()))
                          for it in array_value)
1212795
function parseQueryString(query) {
  const result = {};

  _.each(query.replace(/\+/g, ' ').split('&'), (key) => {
    const index = key.indexOf('=');
    let val = '';

    if (index >= 0) {
      val = decodeURIComponent(key.slice(index + 1));
      key = key.slice(0, index);
    }
    if (!key) return;

    key = decodeURIComponent(key);

    // brackets notation for array value
    if (key.slice(-2) === '[]') {
      key = key.slice(0, -2);
      val = [val];
    }

    // if there are multiple values per key, concatenate
    result[key] = _.has(result, key) ? [].concat(result[key], val) : val;
  });

  return result;
}
18058
def comma_separated_pairs(value):
    """"""
    pairs = value.split(",")
    results = {}
    for pair in pairs:
        key, pair_value = pair.split('=')
        results[key] = pair_value
    return results
898239
public static Array listToArrayTrim(String list, String delimiter, int[] info) {
	if (delimiter.length() == 1) return listToArrayTrim(list, delimiter.charAt(0), info);
	if (list.length() == 0) return new ArrayImpl();
	char[] del = delimiter.toCharArray();
	char c;

	// remove at start
	outer: while (list.length() > 0) {
	    c = list.charAt(0);
	    for (int i = 0; i < del.length; i++) {
		if (c == del[i]) {
		    info[0]++;
		    list = list.substring(1);
		    continue outer;
		}
	    }
	    break;
	}

	int len;
	outer: while (list.length() > 0) {
	    c = list.charAt(list.length() - 1);
	    for (int i = 0; i < del.length; i++) {
		if (c == del[i]) {
		    info[1]++;
		    len = list.length();
		    list = list.substring(0, len - 1 < 0 ? 0 : len - 1);
		    continue outer;
		}
	    }
	    break;
	}
	return listToArray(list, delimiter);
    }
1064364
public function toArray()
	{
		$list = parent::toArray();

		$list[$this->_prefix . 'salutation'] = $this->getSalutation();
		$list[$this->_prefix . 'company'] = $this->getCompany();
		$list[$this->_prefix . 'vatid'] = $this->getVatID();
		$list[$this->_prefix . 'title'] = $this->getTitle();
		$list[$this->_prefix . 'firstname'] = $this->getFirstname();
		$list[$this->_prefix . 'lastname'] = $this->getLastname();
		$list[$this->_prefix . 'address1'] = $this->getAddress1();
		$list[$this->_prefix . 'address2'] = $this->getAddress2();
		$list[$this->_prefix . 'address3'] = $this->getAddress3();
		$list[$this->_prefix . 'postal'] = $this->getPostal();
		$list[$this->_prefix . 'city'] = $this->getCity();
		$list[$this->_prefix . 'state'] = $this->getState();
		$list[$this->_prefix . 'countryid'] = $this->getCountryId();
		$list[$this->_prefix . 'languageid'] = $this->getLanguageId();
		$list[$this->_prefix . 'telephone'] = $this->getTelephone();
		$list[$this->_prefix . 'telefax'] = $this->getTelefax();
		$list[$this->_prefix . 'email'] = $this->getEmail();
		$list[$this->_prefix . 'website'] = $this->getWebsite();
		$list[$this->_prefix . 'flag'] = $this->getFlag();

		return $list;
	}
452141
function (source) {
            if (!Array.isArray(source)) {
                source = [source];
            }
            if (!source || !source.length) {
                throw new QueryError("No source specified for the query");
            }
            return " " + source.map(
                    function (s) {
                        return this.__tableRef(s);
                    }, this).join(this._static.COMMA_SEPARATOR);
        }
82278
private String _serializeArray(Array array, Set<Object> done) throws ConverterException {
	return _serializeList(array.toList(), done);
    }
1338010
def getquerylist(self, sep='&', encoding='utf-8', errors='strict'):
        
        if not self.query:
            return []
        elif isinstance(sep, type(self.query)):
            qsl = self.query.split(sep)
        elif isinstance(sep, bytes):
            qsl = self.query.split(sep.decode('ascii'))
        else:
            qsl = self.query.split(sep.encode('ascii'))
        items = []
        for parts in [qs.partition(self.EQ) for qs in qsl if qs]:
            name = uridecode(parts[0], encoding, errors)
            if parts[1]:
                value = uridecode(parts[2], encoding, errors)
            else:
                value = None
            items.append((name, value))
        return items
152005
function listToArray ( list, opts ) {
	const length = list.getLength();
	const data = [];
	for ( let i = 0; i < length; i++ ) {
		const value = getJsonValueFromSassValue(list.getValue(i), opts);
		data.push(value);
	}
	return data;
}
1207106
function (query) {
        return _.isString(query) ? query.split(AMPERSAND).map(QueryParam.parseSingle) : [];
    }
421376
def comma_list(cls, string):
        ''''''
        items = string.split(',')
        items = list([item.strip() for item in items])
        return items