Converts the provided array into its equivalent representation
using cells.
@private
@param {MapTiles} arr -
@param {Array.<Array.<Cell>>} - The converted array.
432241
function generateContourGrid(arr) {
  // Generate grid for holding values.
  var contour_grid = new Array(arr.length - 1);
  for (var n = 0; n < contour_grid.length; n++) {
    contour_grid[n] = new Array(arr[0].length - 1);
  }
  var corners = [1.1, 1.2, 1.3, 1.4];
  // Specifies the resulting values for the above corner values. The index
  // of the objects in this array corresponds to the proper values for the
  // quadrant of the same index.
  var corner_values = [
    {1.1: 3, 1.2: 0, 1.3: 2, 1.4: 1},
    {1.1: 0, 1.2: 3, 1.3: 1, 1.4: 2},
    {1.1: 3, 1.2: 1, 1.3: 2, 1.4: 0},
    {1.1: 1, 1.2: 3, 1.3: 0, 1.4: 2}
  ];
  for (var i = 0; i < (arr.length - 1); i++) {
    for (var j = 0; j < (arr[0].length - 1); j++) {
      var cell = [arr[i][j], arr[i][j+1], arr[i+1][j+1], arr[i+1][j]];
      // Convert corner tiles to appropriate representation.
      cell.forEach(function(val, i, cell) {
        if (corners.indexOf(val) !== -1) {
          cell[i] = corner_values[i][val];
        }
      });

      contour_grid[i][j] = cell;
    }
  }
  return contour_grid;
}
144298
function flatten(arr) {
  if (!Array.isArray(arr)) {
    throw new Error('expected an array');
  }
  var result = [];
  var len = arr.length;
  for (var i = 0; i < len; i++) {
    var elem = arr[i];
    if (Array.isArray(elem)) {
      result.push.apply(result, flatten(elem));
    } else {
      result.push(elem);
    }
  }
  return result;
}
1337316
function Fixed2DArray(rows, cols, defaultValue) {
  if(rows <= 0 || cols <= 0){
    throw new Error('fixed-2d-array: Must have more then 0 rows and 0 columns.');
  }

  this._width = cols;
  this._height = rows;
  this._grid = [];

  for (var i = 0; i < rows; i++) {
    this._grid[i] = [];
    for (var j = 0; j < cols; j++) {
      this._grid[i][j] = defaultValue;
    }
  }
}
138357
function map(arr, fun, thisp) {
        var i,
            length = arr.length,
            result = [];
        for (i = 0; i < length; i += 1) {
            if (arr.hasOwnProperty(i)) {
                result[i] = fun.call(thisp, arr[i], i, arr);
            }
        }
        return result;
    }
51193
function buffer(arr) {
    if (!Array.isArray(arr)) {
        return;
    }

    var l = new List();
    arr.forEach(function(el) {
        l[syncMethodName("add")](el);
    });
    return convert[syncMethodName("asScalaBuffer")](l);
}
787063
def align(self, arr):
        
        if arr is None:
            return arr

        c_hdrs = self._get_col_hdrs()

        if self.show_col_hdr_in_cell:
            for hdr in c_hdrs:
                arr[hdr] = map(lambda col: ":".join([hdr, str(col)]), arr[hdr])

        if self.show_col_hdrs:
            widths = [max(len(str(col))
                      for col in arr[hdr].tolist() + [hdr]) for hdr in c_hdrs]
        else:
            widths = [max(len(str(col))
                      for col in arr[hdr].tolist()) for hdr in c_hdrs]

        # align column headers
        c_hdrs = map(lambda (c_hdr, width): c_hdr.ljust(width),
                     zip(c_hdrs, widths))

        # align data
        for n_row in range(len(arr)):
            arr[n_row] = tuple(map(lambda (col, width): col.ljust(width),
                                   zip(arr[n_row], widths)))

        return arr, c_hdrs, widths
91648
function mergeSort(arr) {

  /* merges two sorted arrays into one sorted array */
  function merge(a, b) {

    /* result set */
    var c = [];

    /* as long as there are elements in the arrays to be merged */
    while (a.length > 0 || b.length > 0) {

      /* are there elements to be merged, if yes, compare them and merge */
      var n = a.length > 0 && b.length > 0 ? a[0] < b[0] ? a.shift() : b.shift() : b.length > 0 ? b.shift() : a.length > 0 ? a.shift() : null;

      /* always push the smaller one onto the result set */
      if (n !== null) {
        c.push(n);
      }
    }
    return c;
  }

  /* this mergeSort implementation cuts the array in half, wich should be fine with randomized arrays, but introduces the risk of a worst-case scenario */
  median = Math.floor(arr.length / 2);
  var part1 = arr.slice(0, median); /* for some reason it doesn't work if inserted directly in the return statement (tried so with firefox) */
  var part2 = arr.slice(median - arr.length);
  return arr.length <= 1 ? arr : merge(mergeSort(part1), /* first half */
  mergeSort(part2) /* second half */
  );
}
1000901
function Set(arr) {
  Object.defineProperty(this, '__arr__', {value: []});

  if (arr) {
    arr.forEach(function (el) { this.push(el); }, this);
  }
}
1012880
function map(arr, fn) {
		for (var arr2 = [], a = 0, aa = arr.length; a < aa; ++a) { arr2[a] = fn(arr[a]); }
		return arr2;
	}
164962
function arrayClone(arr) {
        var clone = new Array(arr.length);

        this._forEach(arr, function (el, i) {
            clone[i] = el;
        });

        return clone;
    }
62745
function (arr) {
		var res = [];
		for (var i = 0; i < arr.length; i++) {
			res[i] = this._v(arr[i]);
		}
		return res;
	}
241112
public void mulRow(int i, double[] arr, int offset)
    {
        int n = cols;
        for (int j=0;j<n;j++)
        {
            mul(i, j, arr[j+offset]);
        }
    }
385143
public static Matrix toMatrix(INDArray arr) {
        if (!arr.isMatrix()) {
            throw new IllegalArgumentException("passed in array must be a matrix");
        }

        // if arr is a view - we have to dup anyway
        if (arr.isView()) {
            return Matrices.dense(arr.rows(), arr.columns(), arr.dup('f').data().asDouble());
        } else // if not a view - we must ensure data is F ordered
            return Matrices.dense(arr.rows(), arr.columns(),
                            arr.ordering() == 'f' ? arr.data().asDouble() : arr.dup('f').data().asDouble());
    }
1364177
function (arr) {
        if (!_.isArray(arr)) {
            return;
        }

        var obj = {},
            key,
            val,
            i,
            ii;

        for (i = 0, ii = arr.length; i < ii; i += 2) {
            key = arr[i];
            val = arr[i + 1];

            if (_.has(obj, key)) {
                !_.isArray(obj[key]) && (obj[key] = [obj[key]]);
                obj[key].push(val);
            }
            else {
                obj[key] = val;
            }
        }

        return obj;
    }
1025950
function clone(arr) {
              	var newArr = [];
              	for (var i=0; i<arr.length; i++) {
              		newArr.push(arr[i]);
              	}
              	return newArr;
              }
191602
function(cells, opt) {

        return joint.util.toArray(cells).reduce(function(memo, cell) {
            if (cell.isLink()) return memo;
            var rect = cell.getBBox(opt);
            var angle = cell.angle();
            if (angle) rect = rect.bbox(angle);
            if (memo) {
                return memo.union(rect);
            } else {
                return rect;
            }
        }, null);
    }
567062
function arrayToList(array) {
  if(isArray(array)) {
    return List.fromArray(array)
  }
  else if(isFunction(array)) {
    return function(x) {
      const g = array(x)

      if(!isArray(g)) {
        throw new TypeError('arrayToList: Array returning function required')
      }

      return List.fromArray(g)
    }
  }

  throw new TypeError('arrayToList: Array or Array returning function required')
}