Return array of possible drill diameters in imperial.
14138
def get_drill_bits_d_imperial():
    """"""
    step_32nd = np.arange(0.03125, 0.25, 0.03125)
    step_8th = np.arange(0.25, 1.0, 0.125)
    step_4th = np.arange(1.0, 2.0, 0.25)
    maximum = [2.0]

    return np.concatenate((step_32nd,
                           step_8th,
                           step_4th,
                           maximum)) * u.inch
1109987
def LengthMeters(self):
    """"""
    assert(len(self._points) > 0)
    length = 0
    for i in range(0, len(self._points) - 1):
      length += self._points[i].GetDistanceMeters(self._points[i+1])
    return length
805500
def ND_all_available():
    
    ND_all_available = []
    for i in range(len(pipedb['NDinch'])):
        if pipedb.iloc[i, 4] == 1:
            ND_all_available.append((pipedb['NDinch'][i]))
    return ND_all_available * u.inch
958897
def get_discrete_dims(self):
        
        discrete_dims = []
        for i in range(self.dimensionality):
            if self.space_expanded[i].type == 'discrete':
                discrete_dims += [i]
        return discrete_dims
225099
def other_ind(self):
        """"""
        return np.full(self.n_min, self.size - 1, dtype=np.int)
870980
def micro_indices(self):
        """"""
        return tuple(sorted(idx for part in self.partition for idx in part))
535289
def get_dimension(self):
        """"""
        return int(round(float(self.strokes**2)/2 + float(self.strokes)/2))
273379
def getInstIdFromIndices(self, *indices):
        """"""
        try:
            return self._idxToIdCache[indices]
        except TypeError:
            cacheable = False
        except KeyError:
            cacheable = True
        idx = 0
        instId = ()
        parentIndices = []
        for impliedFlag, modName, symName in self._indexNames:
            if idx >= len(indices):
                break
            mibObj, = mibBuilder.importSymbols(modName, symName)
            syntax = mibObj.syntax.clone(indices[idx])
            instId += self.valueToOid(syntax, impliedFlag, parentIndices)
            parentIndices.append(syntax)
            idx += 1
        if cacheable:
            self._idxToIdCache[indices] = instId
        return instId
80842
public int[] getDims() {
        int[] dims = new int[size()];
        for (int i = 0; i < size(); i++) {
            dims[i] = get(i).getNumStates();
        }
        return dims;
    }
867556
def _idx_to_bits(self, i):
    """"""
    bits = bin(i)[2:].zfill(self.nb_hyperplanes)  # Pad the bits str with 0
    return [-1.0 if b == "0" else 1.0 for b in bits]
1201966
def avail_sizes(conn=None):
    '''
    
    '''
    if not conn:
        conn = get_conn()
    raw_sizes = conn.list_sizes('all')  # get *all* the machine types!
    sizes = []
    for size in raw_sizes:
        zone = size.extra['zone']
        size.extra['zone'] = {}
        size.extra['zone'].update(zone.__dict__)
        mtype = {}
        mtype.update(size.__dict__)
        sizes.append(mtype)
    return sizes
1048885
def get_chunks(Array, Chunksize):
    """"""
    for i in range(0, len(Array), Chunksize):
        yield Array[i:i + Chunksize]
706760
def get_dimensions_units(names):
    """"""
    dimensions_uni = {}

    for name in names:

        key = get_key_from_dimensions(names[name].dimensions)
        dimensions_uni[key] = names[name]
        plain_dimensions = [{'base': name, 'power': 1}]
        key = get_key_from_dimensions(plain_dimensions)
        dimensions_uni[key] = names[name]

        if not names[name].dimensions:
            names[name].dimensions = plain_dimensions

        names[name].dimensions = [{'base': names[i['base']].name,
                                   'power': i['power']} for i in
                                  names[name].dimensions]

    return dimensions_uni
1110039
def get_axis_grid(self, ind):
        
        ng = self.dim
        num_pts = ng[ind]
        lengths = self.structure.lattice.abc
        return [i / num_pts * lengths[ind] for i in range(num_pts)]
316524
def get_mems(self, type):
        """"""
        ret = ()
        for m in self.mems:
            if m.type == type:
                ret += (m,)

        return ret
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)
282025
def array_size(x, axis):
  """"""
  axis_shape = x.shape if axis is None else tuple(x.shape[a] for a in axis)
  return max(numpy.prod(axis_shape), 1)