Make the interpolation
166413
def _interpolate(self, xs, ys):
        """"""
        x = []
        y = []
        for i in range(len(ys)):
            if ys[i] is not None:
                x.append(xs[i])
                y.append(ys[i])

        interpolate = INTERPOLATIONS[self.interpolate]

        return list(
            interpolate(
                x, y, self.interpolation_precision,
                **self.interpolation_parameters
            )
        )
817655
def log_interp(x, xp, *args, **kwargs):
    """"""
    return log_interpolate_1d(x, xp, *args, **kwargs)
21535
def interpolate_2d(values, method='pad', axis=0, limit=None, fill_value=None,
                   dtype=None):
    

    transf = (lambda x: x) if axis == 0 else (lambda x: x.T)

    # reshape a 1 dim if needed
    ndim = values.ndim
    if values.ndim == 1:
        if axis != 0:  # pragma: no cover
            raise AssertionError("cannot interpolate on a ndim == 1 with "
                                 "axis != 0")
        values = values.reshape(tuple((1,) + values.shape))

    if fill_value is None:
        mask = None
    else:  # todo create faster fill func without masking
        mask = mask_missing(transf(values), fill_value)

    method = clean_fill_method(method)
    if method == 'pad':
        values = transf(pad_2d(
            transf(values), limit=limit, mask=mask, dtype=dtype))
    else:
        values = transf(backfill_2d(
            transf(values), limit=limit, mask=mask, dtype=dtype))

    # reshape back
    if ndim == 1:
        values = values[0]

    return values
54061
def interpolate_at_i(self, i, unit=None):
        
        if isinstance(self.call.i._value, float):
            if self.call.i._value==i:
                return self._to_unit(self._value, unit)
            else:
                return None

        # we can't call i._value here because that may point to a string, and
        # we want this to resolve the array
        i_value = self.call.i.get_value(linebreak=False, sort_by_indep=False)
        if len(i_value) != len(self._value):
            raise ValueError("length mismatch with independent-variable")

        sort_inds = i_value.argsort()
        indep_value = i_value[sort_inds]
        this_value = self._value[sort_inds]
        return self._to_unit(np.interp(i, indep_value, this_value, left=np.nan, right=np.nan), unit)
757770
public static void interpolate(RectF out, RectF start, RectF end, float factor) {
        out.left = interpolate(start.left, end.left, factor);
        out.top = interpolate(start.top, end.top, factor);
        out.right = interpolate(start.right, end.right, factor);
        out.bottom = interpolate(start.bottom, end.bottom, factor);
    }
180082
def interpolate(self):
        
        self.latitude = self._interp(self.lat_tiepoint)
        self.longitude = self._interp(self.lon_tiepoint)

        return self.latitude, self.longitude
62756
function interpolate (args) {
  var substr = this.match(rtplVars)
  var result = this
  var vars
  var argv

  if (isObject(args)) {
   argv = args
 } else if (Array.isArray(args)) {
   argv = argv = args
  } else if (arguments.length) {
   argv = [].slice.call(arguments)
  }

  if (substr == undefined || !Array.isArray(argv) && !isObject(argv)) {
   return this.toString()
  }

  vars = substr.map(function (str) {
   return str.replace(/(^[$#]\{)|(\}$)/g, '')
  })

  if (isObject(argv) || Array.isArray(argv)) {
   for (var i = 0, len = substr.length; i < len; i++) {
     result = result.replace(substr[i], argv[vars[i]])
   }
  }

  return result
}
870430
function interpolation2(prefix, v0, i0, v1, suffix) {
    var different = bindingUpdated2(v0, v1);
    return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + suffix : NO_CHANGE;
}
317725
def build_interpolators(self):
        """"""
        self.phi_continuous = []
        for xi, phii in zip(self.ace.x, self.ace.x_transforms):
            self.phi_continuous.append(interp1d(xi, phii))
        self.inverse_theta_continuous = interp1d(self.ace.y_transform, self.ace.y)
1070431
function interpolation8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
    var different = bindingUpdated4(v0, v1, v2, v3);
    different = bindingUpdated4(v4, v5, v6, v7) || different;
    return different ?
        prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 +
            stringify$1(v4) + i4 + stringify$1(v5) + i5 + stringify$1(v6) + i6 + stringify$1(v7) + suffix :
        NO_CHANGE;
}
1352684
def spline_interpolate(x1, y1, x2):
    
    sp = Spline(x1, y1)
    return sp(x2)
1300088
def _interpolate_line(xorig, yorig, xclick, yclick):
    """"""
    candidates = []
    # The closest point may be a vertex.
    for x, y in zip(xorig, yorig):
        candidates.append((np.hypot(xclick - x, yclick - y), (x, y)))
    # Or it may be a projection on a segment.
    for (x0, x1), (y0, y1) in zip(zip(xorig, xorig[1:]), zip(yorig, yorig[1:])):
        vec1 = np.array([x1 - x0, y1 - y0])
        vec1 /= np.linalg.norm(vec1)
        vec2 = np.array([xclick - x0, yclick - y0])
        dist_along = vec1.dot(vec2)
        x, y = np.array([x0, y0]) + dist_along * vec1
        # Drop if out of the segment.
        if (x - x0) * (x - x1) > 0 or (y - y0) * (y - y1) > 0:
            continue
        candidates.append((np.hypot(xclick - x, yclick - y), (x, y)))
    _, (x, y) = min(candidates)
    return x, y
1334376
def interpolate_single(start, end, coefficient, how='linear'):
    
    return INTERP_SINGLE_DICT[how](start, end, coefficient)
504725
private List<Float> interpolateBetween(float min, float max, int steps) {

        float delta = (max - min) / (steps + 1);
        List<Float> result = new ArrayList<Float>();
        float num = min;

        for (int i = 0; i < steps; i++) {
            num += delta;
            result.add(new Float(num));
        }
        return result;
    }
364993
def interpolate(self, date, method=None, order=None):
        

        if not self.start <= date <= self.stop:
            raise ValueError("Date '%s' not in range" % date)

        prev_idx = 0
        ephem = self

        # Binary search of the orbit step just before the desired date
        while True:
            idx = len(ephem)
            if idx == 1:
                break
            k = idx // 2

            if date > ephem[k].date:
                prev_idx += k
                ephem = ephem[k:]
            else:
                ephem = ephem[:k]

        method = method if method is not None else self.method
        order = order if order is not None else self.order

        if method == self.LINEAR:

            y0 = self[prev_idx]
            y1 = self[prev_idx + 1]

            result = y0[:] + (y1[:] - y0[:]) * (date.mjd - y0.date.mjd) / (y1.date.mjd - y0.date.mjd)

        elif method == self.LAGRANGE:

            stop = prev_idx + 1 + order // 2 + order % 2
            start = prev_idx - order // 2 + 1
            if stop >= len(self):
                start -= stop - len(self)
            elif start < 0:
                stop -= start
                start = 0

            # selection of the subset of data, of length 'order' around the desired value
            subset = self[start:stop]
            date_subset = np.array([x.date.mjd for x in subset])

            result = np.zeros(6)

            # Everything is on wikipedia
            #        k
            # L(x) = Σ y_j * l_j(x)
            #        j=0
            #
            # l_j(x) = Π (x - x_m) / (x_j - x_m)
            #     0 <= m <= k
            #        m != j
            for j in range(order):
                # This mask is here to enforce the m != j in the lagrange polynomials
                mask = date_subset != date_subset[j]
                l_j = (date.mjd - date_subset[mask]) / (date_subset[j] - date_subset[mask])
                result = result + l_j.prod() * subset[j]

        else:
            raise ValueError("Unkown interpolation method", method)

        orb = ephem[0]

        return orb.__class__(date, result, orb.form, orb.frame, orb.propagator)
509517
private static int interpolate(
        double y_minus, // = f(-1)
        double y_0, // = f(0)
        double y_plus, // = f(+1)
        double[] result // xe, ye, root1, root2
    ) {

        double a = 0.5 * (y_plus + y_minus) - y_0;
        double b = 0.5 * (y_plus - y_minus);

        double xe = -b / (2.0 * a);
        double ye = (a * xe + b) * xe + y_0;
        double dis = b * b - 4 * a * y_0;

        double root1 = Double.NaN;
        double root2 = Double.NaN;
        int count = 0;

        if (dis >= 0) {
            double dx = 0.5 * Math.sqrt(dis) / Math.abs(a);
            if (Math.abs(xe - dx) <= 1.0) {
                root1 = xe - dx;
                count++;
            }
            if (Math.abs(xe + dx) <= 1.0) {
                root2 = xe + dx;
                count++;
            }
        }

        result[0] = xe;
        result[1] = ye;
        result[2] = root1;
        result[3] = root2;

        return count;

    }
677715
function interpolate(str, context) {
  const opts = { ...context.options };

  let val = opts.apiurl + str.replace(/:([\w_]+)/g, (m, key) => {
    opts.params = union(opts.params, key);
    let val = get(opts, key);
    if (val !== void 0) {
      return val;
    }
    return key;
  });

  if (opts.method.toLowerCase() === 'get' && opts.paged !== false) {
    const obj = url.parse(val);
    const query = obj.query ? qs.parse(obj.query) : {};
    const noquery = omit(obj, ['query', 'search']);
    noquery.query = noquery.search = qs.stringify(Object.assign({ per_page: 100 }, opts.query, query));
    val = url.format(noquery);
  }

  val += /\?/.test(val) ? '&' : '?';
  val += (new Date()).getTime();
  return val;
}