对数据进行分组
@param  {Array} data 数据
@param  {String} dim 分组的字段
@return {Object}  分组的键值对映射
500521
function groupData(data, dim) {
    var groups = {};

    each(data, function (record) {
      var value = record[dim];
      if (value === undefined) {
        value = record[dim] = DEFAULT_Y;
      }
      if (!groups[value]) {
        groups[value] = [];
      }
      groups[value].push(record);
    });

    return groups;
  }
1344278
function cleanData({dataByTopic, dataByDate, data}) {
            if (!dataByTopic && !data) {
                throw new Error('Data needs to have a dataByTopic or data property. See more in http://eventbrite.github.io/britecharts/global.html#LineChartData__anchor');
            }

            // If dataByTopic or data are not present, we generate them
            if (!dataByTopic) {
                dataByTopic = d3Collection.nest()
                    .key(getVariableTopicName)
                    .entries(data)
                    .map(d => ({
                            topic: d.values[0]['name'],
                            topicName: d.key,
                            dates: d.values
                        })
                    );
            } else {
                data = dataByTopic.reduce((accum, topic) => {
                    topic.dates.forEach((date) => {
                        accum.push({
                            topicName: topic[topicNameLabel],
                            name: topic[topicLabel],
                            date: date[dateLabel],
                            value: date[valueLabel]
                        });
                    });

                    return accum;
                }, []);
            }

            // Nest data by date and format
            dataByDate = d3Collection.nest()
                .key(getDate)
                .entries(data)
                .map((d) => {
                    return {
                        date: new Date(d.key),
                        topics: d.values
                    }
                });

            const normalizedDataByTopic = dataByTopic.reduce((accum, topic) => {
                let {dates, ...restProps} = topic;

                let newDates = dates.map(d => ({
                       date: new Date(d[dateLabel]),
                       value: +d[valueLabel]
                }));

                accum.push({ dates: newDates, ...restProps });

                return accum;
            }, []);

            return {
                dataByTopic: normalizedDataByTopic,
                dataByDate
            };
        }
140582
function() {
                  var dim = this.dimensions();
                  var r = [];
                  for (var i = 1; i <= dim.cols; i++) {
                    r.push(this.col(i).sum() / dim.rows);
                  }
                  return $V(r);
                }
636023
function parseInputData(data) {
			var keyValRegExPattern = /[a-zA-Z]*:/g;
			var keys = data.match(keyValRegExPattern),
				values = data.split(keyValRegExPattern),
				parsedObject = {};

			// Pop the first blank one off the top
			values.shift();


			for(var i=values.length-1; i >=0; i--) {
				var value = values[i],
					key = keys[i];

				// Trim whitespace
				value = value.trim();

				// Trim any trailing commas
				if(value[value.length-1] === ",") {
					value = value.substring(0, value.length-1);
				}

				// Add to object and trim trailing : from key
				parsedObject[ key.substring(0,key.length-1) ] = value;
			}

			return parsedObject;

		}
460767
function forEach(data, callback) {
  if (data && isFunction(callback)) {
    if (Array.isArray(data) || isNumber(data.length) /* array-like */) {
        var length = data.length;

        var i = void 0;

        for (i = 0; i < length; i += 1) {
          if (callback.call(data, data[i], i, data) === false) {
            break;
          }
        }
      } else if (isObject(data)) {
      Object.keys(data).forEach(function (key) {
        callback.call(data, data[key], key, data);
      });
    }
  }

  return data;
}
484789
def get(self,dimlist):
        '''
        
        '''
        out=()
        for i,d in enumerate(dimlist):
            out+=(super(dimStr, self).get(d,None),)
         
        return out
268249
function (data) {
        var items = [];
        data.forEach(function (d, i) {
            if (d.includes('ITEM:') && d.length > 3) {
                var iid = data[i + 1];
                var item = {
                    item: {
                        id: Number(iid[1].trim()),
                        name: d[2].replace(/_/g, ' '),
                        price: d[3],
                        change: d[4]
                    }
                };
                items.push(item);
            }
        });
        return items;
    }
748677
function(data){
			var rows = this.calculateRowsNumber();
			var datas = [];
			for(var i = 0; i < data.length; i += rows){
				datas.push(data.slice(i, i+rows));
			}
			return datas;
		}
1113991
function(data) {
			data = data || {};
			var paramNames = Object.keys(data);
			var buf = [];
			for (var i=0; i < paramNames.length; i++) {
				var param = paramNames[i], value = data[param];
				buf.push(x_www_form_urlencode(param) + '=' + x_www_form_urlencode(value)); //$NON-NLS-0$
			}
			return buf.join('&'); //$NON-NLS-0$
		}
1337793
function arrayMin(data) {
	var i = data.length,
		min = data[0];

	while (i--) {
		if (data[i] < min) {
			min = data[i];
		}
	}
	return min;
}
611876
function parseData(data)
{
    var tmp_data = {};
    if (nlib.isString(data)) {
        if (data.match(/\.json/i) && grunt.file.exists(data)) {
          tmp_data = grunt.file.readJSON(data);
        } else if (data.match(/\.ya?ml/i) && grunt.file.exists(data)) {
          tmp_data = grunt.file.readYAML(data);
        } else {
            tmp_data = data;
        }
    } else if (nlib.isObject(data) || nlib.isArray(data)) {
        for (var i in data) {
            if (nlib.isString(data[i])) {
                var parsed = parseData(data[i]);
                if (nlib.isString(parsed)) {
                    tmp_data[i] = parsed;
                } else {
                    tmp_data = merge(tmp_data, parsed);
                }
            } else {
                tmp_data = merge(tmp_data, data[i]);
            }
        }
    }
    return tmp_data;
}
58761
function transform( data ) {
	var rows = data.rows;
	var out;
	var i;
	out = new Array( rows.length );
	for ( i = 0; i < rows.length; i++ ) {
		out[ i ] = rows[ i ].key[ 1 ];
	}
	return out;
}
1122032
function onData(data) {

		data = data.toString("ascii");
		bufferedData += data;

		if (debug) console.log("Server: " + util.inspect(data));

		if (checkResp === true) {

			if (bufferedData.substr(0, 3) === "+OK") {

				checkResp = false;
				response = true;

			} else if (bufferedData.substr(0, 4) === "-ERR") {

				checkResp = false;
				response = false;

			// The following is only used for SASL
			} else if (multiline === false) {

				checkResp = false;
				response = true;

			}
		}

		if (checkResp === false) {

			if (multiline === true && (response === false || bufferedData.substr(bufferedData.length-5) === "\r\n.\r\n")) {

				// Make a copy to avoid race conditions
				var responseCopy = response;
				var bufferedDataCopy = bufferedData;

				response = null;
				checkResp = true;
				multiline = false;
				bufferedData = "";

				callback(responseCopy, bufferedDataCopy);

			} else if (multiline === false) {

				// Make a copy to avoid race conditions
				var responseCopy = response;
				var bufferedDataCopy = bufferedData;

				response = null;
				checkResp = true;
				multiline = false;
				bufferedData = "";

				callback(responseCopy, bufferedDataCopy);

			}
		} 
	}
690687
function (data) {
                        // convert {0: "Jan", 1: "Feb", ...} to ["Jan", "Feb", ...]
                        return (Object.keys(data) || []).reduce(
                            function (rslt, el) {
                                rslt.push(data[el]);
                                return rslt;
                            },
                            []
                        );
                    }
926536
function getComponentData(data) {
    const component = findComponent(data.id);
    component.template = pathTrimStart(path.join(data.path, `${data.id}.html`));
    return component;
}
1316063
function(data) {
        var leftData = this.formatInput(data),
            rightData = this.getTargets(leftData),
            me = this;

        $.each(leftData, function(index, value) {
            me.$leftListBody.append([
                '<li class="biz-transfer-list-content-item">',
                '<input type="checkbox" data-id="' + value.id + '" title="' + value.title + '" ' + (value.chosen ? 'disabled' : '') + '/></li>'
            ].join(''));
        });

        $.each(rightData, function(index, value) {
            me.$rightListBody.append(['<li class="biz-transfer-list-content-item">',
                '<input type="checkbox" data-id="' + value.id + '" title="' + value.title + '" /></li>'
            ].join(''));
        });

        this.$main.find(':checkbox').bizCheckbox({
            theme: this.options.theme
        });
    }
222018
function (data, clamp) {
        zrUtil.isArray(data) && (data = data[0]);
        clamp == null && (clamp = true);

        var dayInfo = this.getDateInfo(data);
        var range = this._rangeInfo;
        var date = dayInfo.formatedDate;

        // if not in range return [NaN, NaN]
        if (clamp && !(
            dayInfo.time >= range.start.time
            && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY
        )) {
            return [NaN, NaN];
        }

        var week = dayInfo.day;
        var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;

        if (this._orient === 'vertical') {
            return [
                this._rect.x + week * this._sw + this._sw / 2,
                this._rect.y + nthWeek * this._sh + this._sh / 2
            ];

        }

        return [
            this._rect.x + nthWeek * this._sw + this._sw / 2,
            this._rect.y + week * this._sh + this._sh / 2
        ];

    }