l1 distance between t1 and t2.

  Args:
    t1: A tensor.
    t2: A tensor that is the same size as t1.
    name: Optional name for this op.
  Returns:
    The l1 distance between t1 and t2.
173458
def l1_distance(t1, t2, name=None):
  
  with tf.name_scope(name, 'l1_distance', [t1, t2]) as scope:
    t1 = tf.convert_to_tensor(t1, name='t1')
    t2 = tf.convert_to_tensor(t2, name='t2')
    sub = tf.subtract(t1, t2)
    reduction_dim = _last_index(sub, 1)
    return tf.reduce_sum(tf.abs(sub), reduction_dim, name=scope)
878594
public static <T1, T2> Pair<T1, T2> of(T1 first, T2 second) {
        return new Pair<>(first, second);
    }
721015
def _jit_pairwise_distances(pos1, pos2):
        
        n1 = pos1.shape[0]
        n2 = pos2.shape[0]
        D = np.empty((n1, n2))

        for i in range(n1):
            for j in range(n2):
                D[i, j] = np.sqrt(((pos1[i] - pos2[j])**2).sum())
        return D
478545
public static VTensor combine(VTensor t1, VTensor t2) {
        checkSameDims(t1, t2);
        checkSameAlgebra(t1, t2);
        
        int[] dims3 = IntArrays.insertEntry(t1.getDims(), 0, 2);
        VTensor y = new VTensor(t1.s, dims3);
        y.addTensor(t1, 0, 0);
        y.addTensor(t2, 0, 1);
        return y;
    }
249794
def _dist(self, x1, x2):
        """"""
        return self.tspace._dist(x1.tensor, x2.tensor)
389982
def closest(self, dt1, dt2):
        
        dt1 = self.__class__(dt1.hour, dt1.minute, dt1.second, dt1.microsecond)
        dt2 = self.__class__(dt2.hour, dt2.minute, dt2.second, dt2.microsecond)

        if self.diff(dt1).in_seconds() < self.diff(dt2).in_seconds():
            return dt1

        return dt2
398822
def points_distance(x1, y1, x2, y2)
      Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
    end
711384
def _distance(coord1, coord2):
    
    xdist = coord1[0] - coord2[0]
    ydist = coord1[1] - coord2[1]
    return sqrt(xdist*xdist + ydist*ydist)
337143
def _similarity_distance(s1, s2, ignore):
    '''
    
    '''
    g = 0.0
    try:
        g_ = cosine(_flat_sum_array(_get_wv(s1, ignore)), _flat_sum_array(_get_wv(s2, ignore)))
        if is_digit(g_): g = g_
    except: pass

    u = _nearby_levenshtein_distance(s1, s2)
    logging.debug("g: %s, u: %s" % (g, u))
    if u >= 0.99:
        r = 1.0
    elif u > 0.9:
        r = _similarity_smooth(g, 0.05, u, 0.05)
    elif u > 0.8:
        r = _similarity_smooth(g, 0.1, u, 0.2)
    elif u > 0.4:
        r = _similarity_smooth(g, 0.2, u, 0.15)
    elif u > 0.2:
        r = _similarity_smooth(g, 0.3, u, 0.1)
    else:
        r = _similarity_smooth(g, 0.4, u, 0)

    if r < 0: r = abs(r)
    r = min(r, 1.0)
    return float("%.3f" % r)
772585
def get_v_distance(self, latlonalt1, latlonalt2):
        ''''''
        (lat1, lon1, alt1) = latlonalt1
        (lat2, lon2, alt2) = latlonalt2
        return alt2 - alt1
1221416
def step_size(self, t0, t1=None):
    '''
    
    '''
    tb0 = self.to_bucket( t0 )
    if t1:
      tb1 = self.to_bucket( t1, steps=1 ) # NOTE: "end" of second bucket
    else:
      tb1 = self.to_bucket( t0, steps=1 )

    # Calculate the difference in days, then multiply by simple scalar
    days = (self.from_bucket(tb1, native=True) - self.from_bucket(tb0, native=True)).days
    return days * SIMPLE_TIMES['d']
75233
function interpolatePairs( _ps, t1, t2 ) {
  var pn = [];
  for (var i=0; i<_ps.length; i++) {
    var next = (i==_ps.length-1) ? 0 : i+1;
    pn.push( new Pair( _ps[i].interpolate( t1 ) ).to( _ps[next].interpolate( 1-t2 ) ) );
  }
  return pn;
}
94898
def get_minimum(self):
        '''
        
        '''
        return (self._min_value_t1, self._min_value_t2,
                self._min_value,    self._min_value_data)
128822
public static Double getDistanceBetweenCoordinates(Tuple2<Double, Double> point1, Tuple2<Double, Double> point2) {
        // sqrt( (x2-x1)^2 + (y2-y2)^2 )
        Double xDiff = point1._1() - point2._1();
        Double yDiff = point1._2() - point2._2();
        return Math.sqrt(xDiff * xDiff + yDiff * yDiff);
    }
253305
def distance_between_pts(a=(0.0, 0.0), b=(0.0, 0.0)):
    '''
    '''
    assert isinstance(a, tuple)
    assert isinstance(b, tuple)
    l_pt = len(a)
    assert l_pt > 1
    assert l_pt == len(b)
    for i in a:
        assert isinstance(i, float)
    for i in b:
        assert isinstance(i, float)

    return sqrt(sum([(b[i] - a[i])**2 for i in range(l_pt)]))
36761
public synchronized List<PType> narrowest(List<PType> t1, List<PType> t2)
	{
		return allSubTypes(t1, t2, false) == Result.Yes ? t1 : t2;
	}
1369516
def distance_between(self, place_1, place_2, unit='km'):
        
        pickled_place_1 = self._pickle(place_1)
        pickled_place_2 = self._pickle(place_2)
        try:
            return self.redis.geodist(
                self.key, pickled_place_1, pickled_place_2, unit=unit
            )
        except TypeError:
            return None