Returns the units of the measured value for the current mode. May return
        empty string
334254
def units(self):
        
        self._units, value = self.get_attr_string(self._units, 'units')
        return value
1337585
def read_units(self, fid):
        """"""
        lin = self.read_line(fid)                   
        while lin[0] != ':':
            parts = lin.split()
            if parts[0]=='mass':
                self.mass = float(parts[1])
            elif parts[0]=='length':
                self.length = float(parts[1])
            elif parts[0]=='angle':
                self.angle = parts[1]
            lin = self.read_line(fid)
        return lin
573821
def _get_em(length):
        '''
        
        '''
        m = CssParse.RE_UNIT.search(length)
        value = float(m.group(1))
        unit = m.group(2)

        if unit not in ('em', 'qem', 'rem'):
            return int(round(value/8))
        else:
            return int(round(value))
959952
def get_unit(item, text):
    """"""
    group_units = [1, 4, 6, 8, 10]
    group_operators = [3, 5, 7, 9]

    item_units = [item.group(i) for i in group_units if item.group(i)]

    if len(item_units) == 0:
        unit = l.NAMES['dimensionless']
    else:
        dimensions, slash = [], False
        for group in sorted(group_units + group_operators):
            if not item.group(group):
                continue
            if group in group_units:
                surface, power = parse_unit(item, group, slash)
                if clf.USE_CLF:
                    base = clf.disambiguate_unit(surface, text).name
                else:
                    base = l.UNITS[surface][0].name
                dimensions += [{'base': base, 'power': power}]
            elif not slash:
                slash = any(i in item.group(group) for i in [u'/', u' per '])

        unit = get_unit_from_dimensions(dimensions, text)

    logging.debug(u'\tUnit: %s', unit)
    logging.debug(u'\tEntity: %s', unit.entity)

    return unit
69355
def get(self, deviceId, measurementId):
        
        record = self.measurements.get(deviceId)
        if record is not None:
            measurement = record.get(measurementId)
            if measurement.recording:
                device = self.recordingDevices.get(deviceId)
                device.signalStop()
                return measurement, 200
            else:
                return measurement, 400
        return '', 400
237403
def get_units(self,*args,**kwargs):
        
        if len(args) == 1:
            return self.spike_times.get_label(args[0]).units
        return [self.spike_times.get_label(a).units for a in args]
1028796
def decimals(self):
        
        self._decimals, value = self.get_attr_int(self._decimals, 'decimals')
        return value
51989
private static TimeUnit getDurationUnits(Integer value)
   {
      TimeUnit result = null;

      if (value != null)
      {
         int index = value.intValue();
         if (index >= 0 && index < DURATION_UNITS.length)
         {
            result = DURATION_UNITS[index];
         }
      }

      if (result == null)
      {
         result = TimeUnit.DAYS;
      }

      return (result);
   }
938341
def mode(self):
        """"""
        mu = self.mean()
        sigma = self.std()
        ret_val = math.exp(mu - sigma**2)
        if math.isnan(ret_val):
            ret_val = float("inf")
        return ret_val
1250031
public String getUnit() {
    if (Measure_Type.featOkTst && ((Measure_Type)jcasType).casFeat_unit == null)
      jcasType.jcas.throwFeatMissing("unit", "ch.epfl.bbp.uima.types.Measure");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Measure_Type)jcasType).casFeatCode_unit);}
1098852
def extract_units(string_in):
    
    start = '('
    stop = ')'
    return string_in[string_in.index(start) + 1:string_in.index(stop)]
320734
function getRes(unit) {
      var measured,
          begin,
          count = 30,
          divisor = 1e3,
          ns = timer.ns,
          sample = [];

      // get average smallest measurable time
      while (count--) {
        if (unit == 'us') {
          divisor = 1e6;
          if (ns.stop) {
            ns.start();
            while (!(measured = ns.microseconds())) { }
          } else if (perfName) {
            divisor = 1e3;
            measured = Function('n', 'var r,s=n.' + perfName + '();while(!(r=n.' + perfName + '()-s)){};return r')(ns);
          } else {
            begin = ns();
            while (!(measured = ns() - begin)) { }
          }
        }
        else if (unit == 'ns') {
          divisor = 1e9;
          begin = ns.nanoTime();
          while (!(measured = ns.nanoTime() - begin)) { }
        }
        else {
          begin = new ns;
          while (!(measured = new ns - begin)) { }
        }
        // check for broken timers (nanoTime may have issues)
        // http://alivebutsleepy.srnet.cz/unreliable-system-nanotime/
        if (measured > 0) {
          sample.push(measured);
        } else {
          sample.push(Infinity);
          break;
        }
      }
      // convert to seconds
      return getMean(sample) / divisor;
    }
1120710
def _scale(self, mode):
        
        if mode in self._mode_scale:
            scale = self._mode_scale[mode]
        else:
            scale = 10**(-self.decimals)
            self._mode_scale[mode] = scale

        return scale
949071
def format_units(v, step=None, system="si", units=None):
    
    if v is None:
        return 0, ''

    for prefix, size in UnitSystems[system]:
        if condition(v, size, step):
            v2 = v / size
            if v2 - math.floor(v2) < 0.00000000001 and v > 1:
                v2 = float(math.floor(v2))
            if units:
                prefix = "%s%s" % (prefix, units)
            return v2, prefix

    if v - math.floor(v) < 0.00000000001 and v > 1:
        v = float(math.floor(v))
    if units:
        prefix = units
    else:
        prefix = ''
    return v, prefix
745312
public static final MeasurementSystem getMeasurementSystem(ULocale locale){
        UResourceBundle sysBundle = measurementTypeBundleForLocale(locale, MEASUREMENT_SYSTEM);

        switch (sysBundle.getInt()) {
        case 0: return MeasurementSystem.SI;
        case 1: return MeasurementSystem.US;
        case 2: return MeasurementSystem.UK;
        default:
            // return null if the object is null or is not an instance
            // of integer indicating an error
            return null;
        }
    }
1208241
def mw(self):
        """"""
        m = P_TAB[self.symbol].get('std_weight')
        mh = P_TAB['H'].get('std_weight')
        return m + mh * self.H_count
1255957
def get_number_of_atoms(self):
        
        strc = self.get_output_structure()
        if not strc:
            return None
        return Property(scalars=[Scalar(value=len(strc))], units="/unit cell")