Helper function that pushes the provided slices onto the slices array.
@param {Array.<Slice>} slices An array of slices to be added.
979981
function(slices) {
      this.haveTopLevelSlicesBeenBuilt = false;
      slices.forEach(function(slice) {
        slice.parentContainer = this.parentContainer_;
        this.slices.push(slice);
      }, this);
    }
1336598
function(token) {
      if (Array.isArray(token)) {
        var tokens = /**@type {!Array.<number>}*/(token);
        while (tokens.length)
          this.tokens.push(tokens.pop());
      } else {
        this.tokens.push(token);
      }
    }
93109
def slices_overlap(slice_a, slice_b):
    """"""
    assert slice_a.step is None
    assert slice_b.step is None

    return max(slice_a.start, slice_b.start) \
        < min(slice_a.stop, slice_b.stop)
1332042
function() {
      this.haveTopLevelSlicesBeenBuilt = true;
      this.createSubSlicesImpl_();
      if (this.parentContainer.timeSlices)
        this.addCpuTimeToSubslices_(this.parentContainer.timeSlices);
      this.slices.forEach(function(slice) {
        var selfTime = slice.duration;
        for (var i = 0; i < slice.subSlices.length; i++)
          selfTime -= slice.subSlices[i].duration;
        slice.selfTime = selfTime;

        if (slice.cpuDuration === undefined)
          return;

        var cpuSelfTime = slice.cpuDuration;
        for (var i = 0; i < slice.subSlices.length; i++) {
          if (slice.subSlices[i].cpuDuration !== undefined)
            cpuSelfTime -= slice.subSlices[i].cpuDuration;
        }
        slice.cpuSelfTime = cpuSelfTime;
      });
    }
871034
function slice(args, begin, end) {
  return Array.prototype.slice.call(args, begin, end);
}
645135
function findNextLen(targetLen, arr, offsets) {
    offsets.shift();
    for (var i = offsets[4]; (i < arr.length) && (arr[i].length <= targetLen); ++i) {
        /* empty*/
    }
    //console.log("pushing " + i);
    offsets.push(i);
}
702377
function(slice, flowEvents) {
      var fromOtherInputs = false;

      slice.iterateEntireHierarchy(function(subsequentSlice) {
        if (fromOtherInputs)
          return;

        subsequentSlice.inFlowEvents.forEach(function(inflow) {
          if (fromOtherInputs)
            return;

          if (inflow.category.indexOf('input') > -1) {
            if (flowEvents.indexOf(inflow) === -1)
              fromOtherInputs = true;
          }
        }, this);
      }, this);

      return fromOtherInputs;
    }
1291537
function(a) {
            if ( $.isFunction(a) ) {
                a.apply(this, Array.prototype.slice.call(arguments, 1));
            }
        }
849680
function() {
      var i, il, elements = [].slice.call(arguments)

      for (i = 0, il = elements.length; i < il; i++)
        this.members.push(elements[i])

      return this
    }
1107860
function(arr, func) {
	
	if (arr.map) { return arr.map(func); }
	
	var i, l,
		r = [];
	
	for (i=0, l=arr.length; i<l; i++) {
		r.push(func(arr[i]));
	}
	return r;
}
818125
function forEach(nodes, fn) {
  if (nodes && nodes.length) {
    Array.prototype.slice.call(nodes).forEach(fn);
  }
}
140599
function () {
    // If this function was not given any arguments, we have nothing to do
    // here.
    if (arguments.length > 0) {
      // Convert `arguments` to an array
      var args = Array.prototype.slice.call(arguments, 0)
      Array.prototype.push.apply(passed_args, args)
    }
    self._iterate_stack(++index, req, passed_args, not_handled_fn)
  }
949573
def add_slices(self, dashboard_id):
        """"""
        data = json.loads(request.form.get('data'))
        session = db.session()
        Slice = models.Slice  # noqa
        dash = (
            session.query(models.Dashboard).filter_by(id=dashboard_id).first())
        check_ownership(dash, raise_if_false=True)
        new_slices = session.query(Slice).filter(
            Slice.id.in_(data['slice_ids']))
        dash.slices += new_slices
        session.merge(dash)
        session.commit()
        session.close()
        return 'SLICES ADDED'
1297509
function(_items) {
        var list = new List();
        if(_items) list.push.apply(list, _items);
        return list;
      }
129274
function(array, json) {
        var i;
        if (typeof json === 'object' && typeof json.length === 'number') {
            for (i = 0; i < json.length; ++i) {
                array.push(json[i]);
            }
        } else {
            array.push(json);
        }
    }
1292364
function(amount) {
      for (var sI = 0; sI < this.slices.length; sI++) {
        var slice = this.slices[sI];
        slice.start = (slice.start + amount);
        // Shift all nested subSlices recursively.
        var shiftSubSlices = function(subSlices) {
          if (subSlices === undefined || subSlices.length === 0)
            return;
          for (var sJ = 0; sJ < subSlices.length; sJ++) {
            subSlices[sJ].start += amount;
            shiftSubSlices(subSlices[sJ].subSlices);
          }
        };
        shiftSubSlices(slice.subSlices);
      }
    }
578465
function _mergeArrayInPlace(a,b)
{
  if ( !b || b.length === 0 )
    return;

  b.forEach(function(val) {
    if ( a.indexOf(val) === -1 )
      a.push(val);
  });
}