Returns a list of count powers of logbase (from logbase**lower).
185073
def PowersOf(logbase, count, lower=0, include_zero=True):
    """"""
    if not include_zero:
        return [logbase ** i for i in range(lower, count+lower)]
    else:
        return [0] + [logbase ** i for i in range(lower, count+lower)]
590368
def _get_loggers():
    """"""
    from .. import loader
    modules = loader.get_package_modules('logger')
    return list(loader.get_plugins(modules, [_Logger]))
1326663
def get_log_entries(self):
        
        if self.retrieved:
            raise errors.IllegalState('List has already been retrieved.')
        self.retrieved = True
        return objects.LogEntryList(self._results, runtime=self._runtime)
517015
function log_level_plus(logLevel) {
  let index = log_levels.indexOf(logLevel)
  if (index < 0) {
    return []
  } else {
    return log_levels.slice(index, log_levels.length)
  }
}
217590
def get_power_all(self):
        """"""
        power_dict = {}
        for device in self.get_device_names().keys():
            power_dict[device] = self.get_power_single(device)
        return power_dict
783194
def lhs(self):
        """"""
        lhs = self._lhs
        i = 0
        while lhs is None:
            i -= 1
            lhs = self._prev_lhs[i]
        return lhs
418316
def getEmptyCells(self):
        """"""
        return [(x, y)
                for x in self.__size_range
                for y in self.__size_range if self.getCell(x, y) == 0]
1091229
def sorted_bases(bases):
    '''
    '''
    ret = []

    for base in bases:
        # lst = [super(base), super(super(base)), ..., highest_base]
        lst = _bases(base)

        if not ret:
            ret = lst
        elif not any(b in ret for b in lst):
            ret += lst
        else:
            buf = []
            for b in lst:
                if b in ret:
                    if buf:
                        ret = graft(ret, buf, ret.index(b))
                        buf = []
                else:
                    buf.append(b)
            if buf:
                ret += buf

    return ret
253718
def get_branches(aliases):
    """"""

    ignore = ['pow', 'log10', 'sqrt', 'max']
    branches = []
    for k, v in aliases.items():

        tokens = re.sub('[\(\)\+\*\/\,\=\<\>\&\!\-\|]', ' ', v).split()

        for t in tokens:

            if bool(re.search(r'^\d', t)) or len(t) <= 3:
                continue

            if bool(re.search(r'[a-zA-Z]', t)) and t not in ignore:
                branches += [t]

    return list(set(branches))
51224
def get_parent_log_nodes(self):
        
        parent_log_nodes = []
        for node in self._my_map['parentNodes']:
            parent_log_nodes.append(LogNode(
                node._my_map,
                runtime=self._runtime,
                proxy=self._proxy,
                lookup_session=self._lookup_session))
        return LogNodeList(parent_log_nodes)
82413
def _compute_logP_from_ll(self):
        
        log = math.log
        logP = []
        for i in range(self.width):
            D = {}
            for L in ACGT:
                ''' if   ll = log(p/b) then
                       2^ll = p/b
                  and    ll = log(p) - log(b)
                  so log(p) = ll + log(b)'''
                #Pij = pow(2.0, self.ll[i][letter]) * self.background[letter]
                D[L] = self.ll[i][L] + log(self.background[L])/log(2.)
            logP.append(D)
        self.logP = logP
409545
def extract_logs(self, fname, prg):
        
        op = []
        with open(fname, 'r') as f:
            for line in f:
                if prg in line:
                    op.append(line)
        return op
145971
def lower_items(self):
        """"""
        return (
            (lowerkey, keyval[1])
            for (lowerkey, keyval)
            in list(self._store.items())
        )
1025017
def power_level(self, val):
        """"""
        if val in [0, 1, 2, 3]:
            self.pdx.PowerLevel = val
        elif type(val) is str:
            if val.lower() == "high":
                self.pdx.PowerLevel = 0
            elif val.lower() == "highlow":
                self.pdx.PowerLevel = 1
            elif val.lower() == "lowhigh":
                self.pdx.PowerLevel = 2
            elif val.lower() == "low":
                self.pdx.PowerLevel = 3
        else:
            raise ValueError("Not a valid power level")
1170399
def GetRunlevelsNonLSB(states):
  """"""
  if not states:
    return set()
  convert_table = {
      "0": "0",
      "1": "1",
      "2": "2",
      "3": "3",
      "4": "4",
      "5": "5",
      "6": "6",
      # SysV, Gentoo, Solaris, HP-UX all allow an alpha variant
      # for single user. https://en.wikipedia.org/wiki/Runlevel
      "S": "1",
      "s": "1"
  }
  _LogInvalidRunLevels(states, convert_table)
  return set([convert_table[s] for s in states.split() if s in convert_table])
740565
def _check_loglevel(level='info'):
    '''
    
    '''
    try:
        level = level.lower()
        if level == 'quiet':
            return None
        else:
            return LOG_LEVELS[level]
    except (AttributeError, KeyError):
        log.error(
            'Invalid output_loglevel \'%s\'. Valid levels are: %s. Falling '
            'back to \'info\'.',
            level, ', '.join(sorted(LOG_LEVELS, reverse=True))
        )
        return LOG_LEVELS['info']
1321910
def sampled_logs(self, logs_limit=-1):
        
        logs_count = len(self.logs)
        if logs_limit == -1 or logs_count <= logs_limit:
            return self.logs
        elif logs_limit == 0:
            return []
        elif logs_limit == 1:
            return [self.logs[-1]]
        else:
            def get_sampled_log(idx):
                # always include the first and last element of `self.logs`
                return self.logs[idx * (logs_count - 1) // (logs_limit - 1)]
            return [get_sampled_log(i) for i in range(logs_limit)]