Get level from vera.
503011
def level(self):
        """"""
        # Used for dimmers, curtains
        # Have seen formats of 10, 0.0 and "0%"!
        level = self.get_value('level')
        try:
            return int(float(level))
        except (TypeError, ValueError):
            pass
        try:
            return int(level.strip('%'))
        except (TypeError, AttributeError, ValueError):
            pass
        return 0
387072
def getLevelInt(levelName):
    
    assert isinstance(levelName, str) and levelName in getLevelNames(), \
        "Bad debug level name"
    return  getLevelNames().index(levelName)+1
1024044
def convert_level(self, record):
        """"""
        level = record.levelno
        if level >= logging.CRITICAL:
            return levels.CRITICAL
        if level >= logging.ERROR:
            return levels.ERROR
        if level >= logging.WARNING:
            return levels.WARNING
        if level >= logging.INFO:
            return levels.INFO
        return levels.DEBUG
475312
public function get_level($id, $array = array(), $i = 0) {
        if ($array[$id]['parent_id']==0 || empty($array[$array[$id]['parent_id']]) || $array[$id]['parent_id']==$id){
            return  $i;
        }else{
            $i++;
            return self::get_level($array[$id]['parent_id'],$array,$i);
        }
    }
808908
function getLevel(base, index) {
  var level = (0, _bigInteger2.default)('0');
  var current = index;
  var parent = void 0;
  while (current.gt(zero)) {
    parent = current.prev().divide(base);
    level = level.next();
    current = parent;
  }

  return level;
}
234017
function getLevel(nameOrValue) {
  if (typeof nameOrValue === 'string') {
    return LEVELS_BY_NAME.get(nameOrValue) || Level.ALL;
  }
  if (typeof nameOrValue !== 'number') {
    throw new TypeError('not a string or number');
  }
  for (let level of ALL_LEVELS) {
    if (nameOrValue >= level.value) {
      return level;
    }
  }
  return Level.ALL;
}
1146682
def set_level(self, val):
        """"""
        if val == 0:
            self.off()
        elif val == 255:
            self.on()
        else:
            setlevel = 255
            if val < 1:
                setlevel = val * 255
            elif val <= 0xff:
                setlevel = val
            change = setlevel - self._value
            increment = 255 / self._steps
            steps = round(abs(change) / increment)
            print('Steps: ', steps)
            if change > 0:
                method = self.brighten
                self._value += round(steps * increment)
                self._value = min(255, self._value)
            else:
                method = self.dim
                self._value -= round(steps * increment)
                self._value = max(0, self._value)
            # pylint: disable=unused-variable
            for step in range(0, steps):
                method(True)
            self._update_subscribers(self._value)
590091
def number(v):
    """"""
    if nodesetp(v):
        v = string(v)
    try:
        return float(v)
    except ValueError:
        return float('NaN')
550074
function getThreshold(fromStep, toStep, now)
{
	let threshold

	// Allows custom thresholds when moving
	// from a specific step to a specific step.
	if (fromStep && (fromStep.id || fromStep.unit)) {
		threshold = toStep[`threshold_for_${fromStep.id || fromStep.unit}`]
	}

	// If no custom threshold is set for this transition
	// then use the usual threshold for the next step.
	if (threshold === undefined) {
		threshold = toStep.threshold
	}

	// Convert threshold to a number.
	if (typeof threshold === 'function') {
		threshold = threshold(now)
	}

	// Throw if no threshold is found.
	if (fromStep && typeof threshold !== 'number') {
		// Babel transforms `typeof` into some "branches"
		// so istanbul will show this as "branch not covered".
		/* istanbul ignore next */
		const type = typeof threshold
		throw new Error(`Each step of a gradation must have a threshold defined except for the first one. Got "${threshold}", ${type}. Step: ${JSON.stringify(toStep)}`)
	}

	return threshold
}
353671
def get_level():
    
    handler, logger = find_handler(logging.getLogger(), match_stream_handler)
    return handler.level if handler else DEFAULT_LOG_LEVEL
485659
def getLastRabaId(self, cls) :
		""""""
		self.loadedRabaClasses[cls.__name__] = cls
		sql = 'SELECT MAX(raba_id) from %s LIMIT 1' % (cls.__name__)
		cur = self.execute(sql)
		res = cur.fetchone()
		try :
			return int(res[0])+1
		except TypeError:
			return  0
301225
function getDepth(node) {
  var level = 1; // level: 0
  while (node.parent) {
    level += 1;
    node = node.parent;
  }
  return level;
}
1297370
public int getLevel() {
    if (ListItem_Type.featOkTst && ((ListItem_Type)jcasType).casFeat_level == null)
      jcasType.jcas.throwFeatMissing("level", "de.julielab.jules.types.ListItem");
    return jcasType.ll_cas.ll_getIntValue(addr, ((ListItem_Type)jcasType).casFeatCode_level);}
634999
def get_val(source, extract=None, transform=None):
  """"""
  if extract is None:
    raw_value = source
  else:
    raw_value = extract(source)

  if transform is None:
    return raw_value
  else:
    return transform(raw_value)
892522
function (objectPath) {
            var levels = objectPath.split('.');
            var currentValue = values;

            if (levels.length > 0) {
              for (var i = 0; i < levels.length; i++) {
                currentValue = currentValue[levels[i]];
              }

              return currentValue
            }

            return undefined
          }
64497
def get_max_dim(self, obj):
        """"""

        try:
            iter(obj)

        except TypeError:
            return 0

        try:
            for o in obj:
                iter(o)
                break

        except TypeError:
            return 1

        return 2
380926
def get_threshold(self):
        """"""

        if self.threshold.startswith('+'):
            if self.threshold[1:].isdigit():
                self._threshold = int(self.threshold[1:])
                self._upper = True
        elif self.threshold.startswith('-'):
            if self.threshold[1:].isdigit():
                self._threshold = int(self.threshold[1:])
                self._upper = False
        else:
            if self.threshold.isdigit():
                self._threshold = int(self.threshold)
                self._upper = True
        if not hasattr(self, '_threshold'):
            raise ValueError('Invalid threshold')