Return dots per inch corresponding to *density* value.
196797
def _dpi(self, density):
        
        if self._density_units == 1:
            dpi = density
        elif self._density_units == 2:
            dpi = int(round(density * 2.54))
        else:
            dpi = 72
        return dpi
743844
def density(self):
        
        r = float(self.sp_index.npoints) / float(self.sp_index.length)
        return r
43558
def _pdf(self, x, dist, cache):
        """"""
        output = evaluation.evaluate_density(dist, numpy.arccosh(x), cache=cache)
        output /= numpy.where(x != 1, numpy.sqrt(x*x-1), numpy.inf)
        return output
787346
def density_angle(rho0: Density, rho1: Density) -> bk.BKTensor:
    """"""
    return fubini_study_angle(rho0.vec, rho1.vec)
1329795
function cm2feetInches (cm) {
  const totalInches = (cm * 0.393701);
  let feet = Math.floor(totalInches / 12);
  let inches = Math.round(totalInches - (feet * 12));
  if (inches === 12) {
    feet += 1;
    inches = 0;
  }
  return { feet, inches };
}
493866
def dot_v3(v, w):
    """"""

    return sum([x * y for x, y in zip(v, w)])
602835
def pp(i, base=1024):
    
    degree = 0
    pattern = "%4d     %s"
    while i > base:
        pattern = "%7.2f %s"
        i = i / float(base)
        degree += 1
    scales = ['B', 'KB', 'MB', 'GB', 'TB', 'EB']
    return pattern % (i, scales[degree])
787529
def get_dotstr(self):
        """"""
        dotobj = self.gosubdagplot.get_pydot_graph() # pydot.Dot
        dotstr = dotobj.create_dot()
        return dotstr
830195
def _density(self, logd, dur, slope):
        
        if self.sklearn_kde:
            #TODO: fix preprocessing
            pts = np.array([(logd - self.mean_logdepth)/self.std_logdepth,
                            (dur - self.mean_dur)/self.std_dur,
                            (slope - self.mean_slope)/self.std_slope])
            return self.kde.score_samples(pts)
        else:
            return self.kde(np.array([logd, dur, slope]))
679008
def to_dense(self):
        """"""
        if hasattr(self._X_train, 'todense'):
            self._X_train = self._X_train.todense()
            self._X_test = self._X_test.todense()
462625
def dpi(self):
        
        def int_dpi(dpi):
            """
            Return an integer dots-per-inch value corresponding to *dpi*. If
            *dpi* is |None|, a non-numeric type, less than 1 or greater than
            2048, 72 is returned.
            """
            try:
                int_dpi = int(round(float(dpi)))
                if int_dpi < 1 or int_dpi > 2048:
                    int_dpi = 72
            except (TypeError, ValueError):
                int_dpi = 72
            return int_dpi

        def normalize_pil_dpi(pil_dpi):
            """
            Return a (horz_dpi, vert_dpi) 2-tuple corresponding to *pil_dpi*,
            the value for the 'dpi' key in the ``info`` dict of a PIL image.
            If the 'dpi' key is not present or contains an invalid value,
            ``(72, 72)`` is returned.
            """
            if isinstance(pil_dpi, tuple):
                return (int_dpi(pil_dpi[0]), int_dpi(pil_dpi[1]))
            return (72, 72)

        return normalize_pil_dpi(self._pil_props[2])
1000204
def width(poly):
    """"""
    num = len(poly) - 1
    if abs(poly[num][2] - poly[0][2]) < abs(poly[1][2] - poly[0][2]):
        return dist(poly[num], poly[0])
    elif abs(poly[num][2] - poly[0][2]) > abs(poly[1][2] - poly[0][2]):
        return dist(poly[1], poly[0])
    else: return max(dist(poly[num], poly[0]), dist(poly[1], poly[0]))
365365
def approximate_column(self, i):
        

        """
        return np.dot(self._C_k, self._R_k[:, i])
286141
def itemsize_bits(self):
        """"""
        if self.dtype is not None:
            return self.dtype.itemsize * 8
        else:
            return sum(x[1] for x in self.format)
76351
public static int dpToPx(Context context, float dp) {
    DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
    return (int) ((dp * displayMetrics.density) + 0.5);
  }
74803
def _pdf(self, xloc, dist, base, cache):
        """"""
        return evaluation.evaluate_density(
            dist, base**xloc, cache=cache)*base**xloc*numpy.log(base)
1119665
def density(self, *args):
        
        M = self.mass(*args) * MSUN
        V = 4./3 * np.pi * (self.radius(*args) * RSUN)**3
        return  M/V