Averages out values passed as a comma-separated
            list, disregarding the zero-valued entries.
434025
def _averageFromList(self, param):
        
        _result = 0.0
        _count = 0

        for _param in param.split(','):
            if _param != '' and float(_param) != 0.0:
                _result = _result + float(_param)
                _count  += 1

        if _count >= 1:
            _result = _result / _count
        return _result
734705
def without(self, *values):
        
        if self._clean.isDict():
            newlist = {}
            for i, k in enumerate(self.obj):
                # if k not in values:  # use indexof to check identity
                if _(values).indexOf(k) is -1:
                    newlist.set(k, self.obj[k])
        else:
            newlist = []
            for i, v in enumerate(self.obj):
                # if v not in values:  # use indexof to check identity
                if _(values).indexOf(v) is -1:
                    newlist.append(v)

        return self._wrap(newlist)
853904
public static double[] averageSmooth( double[] values, int lookAhead ) throws Exception {
        int size = values.length;
        double[] newValues = new double[values.length];
        for( int i = 0; i < lookAhead; i++ ) {
            newValues[i] = values[i];
        }
        for( int i = lookAhead; i < size - lookAhead; i++ ) {
            double sum = 0.0;
            int k = 0;
            for( int l = -lookAhead; l <= lookAhead; l++ ) {
                double value = values[i + l];
                if (!isNovalue(value)) {
                    sum = sum + value;
                    k++;
                }
            }
            newValues[i] = sum / k;
        }
        for( int i = size - lookAhead; i < size; i++ ) {
            newValues[i] = values[i];
        }
        return newValues;
    }
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
626360
def scrub(value, scrub_text=_keep_whitespace, scrub_number=_scrub_number):
    
    return _scrub(value, set(), [], scrub_text=scrub_text, scrub_number=scrub_number)
780079
function averageValues(categorical, numeric) {
  const sumMap = {};
  const [uniques, counts] = uniqueValues(categorical);
  for (let i = 0; i < uniques.length; ++i) {
    sumMap[uniques[i]] = {
      sum: 0,
      count: counts[i],
    };
  }
  for (let j = 0; j < numeric.length; ++j) {
    sumMap[categorical[j]].sum += parseFloat(numeric[j]);
  }
  const u = [];
  const a = [];
  Object.keys(sumMap).forEach((uniqueKey) => {
    u.push(uniqueKey);
    a.push(sumMap[uniqueKey].sum / sumMap[uniqueKey].count);
  });
  return [u, a];
}
1237676
def splitValues(textStr):
    
    vals = textStr.split(",")
    nums = []
    for v in vals:
        nums.append(float(v))
    return nums
1104889
def _sanitize_values(arr):
    

    if hasattr(arr, 'values'):
        arr = arr.values
    else:

        # scalar
        if is_scalar(arr):
            arr = [arr]

        # ndarray
        if isinstance(arr, np.ndarray):
            pass

        elif is_list_like(arr) and len(arr) > 0:
            arr = maybe_convert_platform(arr)

        else:
            arr = np.asarray(arr)

    return arr
850452
def summarize_ranges(array):
    
    res = []
    if len(array) == 1:
        return [str(array[0])]
    i = 0
    while i < len(array):
        num = array[i]
        while i + 1 < len(array) and array[i + 1] - array[i] == 1:
            i += 1
        if array[i] != num:
            res.append((num, array[i]))
        else:
            res.append((num, num))
        i += 1
    return res
1180890
def delist(values):
    """"""
    assert isinstance(values, list)

    if not values:
        return None
    elif len(values) == 1:
        return values[0]

    return values
233996
def format_value(value):
    
    if isinstance(value, list):
        value = ", ".join([v.strip() for v in value])
    return value
385232
def lmean (inlist):
    
    sum = 0
    for item in inlist:
        sum = sum + item
    return sum/float(len(inlist))
328708
def csvtolist(inputstr):
    
    reader = csv.reader([inputstr], skipinitialspace=True)
    output = []
    for r in reader:
        output += r
    return output
787940
public static List<String> splitToList(final String value) {
        if (!StringUtils.isEmpty(value)) {
            return COMMA_SPLITTER.splitToList(value);
        }
        return Collections.<String> emptyList();
    }
493011
def _accumulate(data_list, no_concat=()):
    
    acc = Accumulator()
    for data in data_list:
        for name, val in data.items():
            acc.add(name, val)
    out = {name: acc[name] for name in acc.names if name not in no_concat}

    # Some variables should not be concatenated but should be kept as lists.
    # This is when there can be several arrays of variable length (NumPy
    # doesn't support ragged arrays).
    out.update({name: acc.get(name) for name in no_concat})
    return out
274693
def medianscore(inlist):
    

    newlist = copy.deepcopy(inlist)
    newlist.sort()
    if len(newlist) % 2 == 0:   # if even number of scores, average middle 2
        index = len(newlist) / 2  # integer division correct
        median = float(newlist[index] + newlist[index - 1]) / 2
    else:
        index = len(newlist) / 2  # int divsion gives mid value when count from 0
        median = newlist[index]
    return median
148239
def de_blank(val):
    """"""
    ret = list(val)
    if type(val) == list:
        for idx, item in enumerate(val):
            if item.strip() == '':
                ret.remove(item)
            else:
                ret[idx] = item.strip()
    return ret