Read key definitions from a key scope.
439490
private void readScope(final Element scope, final Map<String, KeyDef> keyDefs) {
        final List<Element> maps = new ArrayList<>();
        maps.add(scope);
        for (final Element child: getChildElements(scope)) {
            collectMaps(child, maps);
        }
        for (final Element map: maps) {
            readMap(map, keyDefs);
        }
    }
1263284
def without_global_scope(self, scope):
        
        if isinstance(scope, basestring):
            del self._scopes[scope]

            return self

        keys = []
        for key, value in self._scopes.items():
            if scope == value.__class__ or isinstance(scope, value.__class__):
                keys.append(key)

        for key in keys:
            del self._scopes[key]

        return self
1049265
def defines_to_dict(defines):
    """"""
    if defines is None:
        return None
    result = {}
    for define in defines:
        kv = define.split('=', 1)
        if len(kv) == 1:
            result[define.strip()] = 1
        else:
            result[kv[0].strip()] = kv[1].strip()
    return result
240759
def read_keys
      self.class.keys.inject Hash.new do |hash, key|
        hash[key.name] = proxy_reader(key.name) if readable?(key.name)
        hash
      end
    end
1074351
private static function readKeys(): void
    {
        static::$keys = [];

        foreach (ini_get_all() as $key => $value) {
            static::$keys[$key] = $value['access'] === 1 /* user */ || $value['access'] === 7 /* all */;
        }
    }
1346112
function(key, context) {
        var first, keys, subkey;
        if (typeof context === "undefined" || context === null) {
            context = this;
        }
        if (key.indexOf(".") > -1) {
            keys = key.split(".");
            first = keys.shift();
            subkey = keys.join(".");
            return this._attr_get(keys.join("."), context[first]);
        } else {
            return context[key];
        }
    }
1259841
def read_raw(self, key):
        
        data = None
        if key is not None:
            data = self.db.read(key.strip())
        else:
            self.tcex.log.warning(u'The key field was None.')
        return data
949260
def read_sections():
    """"""
    config = configparser.ConfigParser()
    config.read(('requirements.ini', 'setup.cfg', 'tox.ini'))
    return [
        (
            name,
            {
                key: parse_value(key, config[name][key])
                for key in config[name]
            }
        )
        for name in config.sections()
        if 'requirements' in name
    ]
779370
def read_length_and_key(fp):
    
    length = read_fmt('I', fp)[0]
    key = fp.read(length or 4)
    if length == 0 and key not in _TERMS:
        logger.debug('Unknown term: %r' % (key))
        _TERMS.add(key)
    return key
836091
def _read_bks_key(cls, data, pos, store_type):
        """"""
        key_type = b1.unpack_from(data, pos)[0]; pos += 1
        key_format, pos = BksKeyStore._read_utf(data, pos, kind="key format")
        key_algorithm, pos = BksKeyStore._read_utf(data, pos, kind="key algorithm")
        key_enc, pos = BksKeyStore._read_data(data, pos)

        entry = BksKeyEntry(key_type, key_format, key_algorithm, key_enc, store_type=store_type)
        return entry, pos
74973
def read_probes(self, key):
        
        assert key in list(self._PROBES.keys())

        if key == 'output':
            value = self._output

        return value
61958
def reads(s):
    
    _dict = PyVDF.__UseDict
    _len = len
    _whitespace = frozenset('\t ')
    _newline = frozenset('\n\r')

    _quote_match = PyVDF.__RE_Token_Quoted.match
    _unquote_match = PyVDF.__RE_Token_UnQuoted.match
    _max_length = PyVDF.__MaxTokenLength

    ci = 0
    line = 0
    grabKey = 1

    data = _dict()
    tree = data

    keys = deque()
    keyApp = keys.append
    keyPop = keys.pop

    try:
      while 1:

        while s[ci] in _whitespace:
          ci += 1

        char = s[ci]

        if char == '"':
          ci += 1
          string = _quote_match(s[ci:ci + _max_length]).group()[:-1]
          ci += _len(string)

          if grabKey:
            k = string
            grabKey = 0
          else:
            tree[k] = string
            grabKey = 1

        elif char == '\n':
          line += 1

        # elif char == '\r':
        #   if s[ci + 1] == '\n':
        #     ci += 1
        #   line += 1

        elif char == '{':
          if grabKey:
            raise Exception(PyVDF.__ERR_BlockNoKey.format(line, k))
          else:
            keyApp(k)
            tree[k] = _dict()
            tree = tree[k]
            grabKey = 1

        elif char == '}':
          if grabKey:
            keyPop()
            tree = data
            for key in keys:
              tree = tree[key]
          else:
            raise Exception(PyVDF.__ERR_CompanionBrace.format(line, k))

        elif char == '/' and s[ci + 1] == '/':
          ci += 1
          line += 1
          while 1:
            ci += 1
            if s[ci] in _newline:
              break

        elif char == '[':
          while 1:
            ci += 1
            if s[ci] == ']':
              break

        else:
          string = _unquote_match(s[ci:ci + _max_length]).group()
          ci += _len(string)

          if grabKey:
            k = string
            grabKey = 0
          else:
            tree[k] = string
            grabKey = 1
          continue

        ci += 1

    except IndexError:
      if _len(keys) == 0:
        return data
      raise Exception(PyVDF.__ERR_EODArray)
    except AttributeError:
      raise Exception(PyVDF.__ERR_BadToken.format(line, _max_length))
432554
def _parseKeyNames(lib):
    
    _keyNames = {}
    for attr in dir(lib): # from the modules variables
        if attr[:6] == 'TCODK_': # get the K_* constants
            _keyNames[getattr(lib, attr)] = attr[6:] # and make CODE=NAME pairs
    return _keyNames
1351369
def get(cls, scope=None):
        """"""
        if scope is None:
            scope = cls.default
        if isinstance(scope, string_types) and scope in cls._keywords:
            return getattr(cls, scope)
        return scope
425987
def read_val(self, key:str) -> Union[List[float],Tuple[List[float],List[float]]]:
        ""
        val = [pg[key] for pg in self.opt.param_groups[::2]]
        if is_tuple(val[0]): val = [o[0] for o in val], [o[1] for o in val]
        return val
769648
function scopeEval(source, scope) {
  var keys = [];
  var values = [];
  for (var key in scope) {
    if (scope.hasOwnProperty(key)) {
      keys.push(key);
      values.push(scope[key]);
    }
  }
  keys.push(source);
  return Function.apply(null, keys).apply(null, values);
}
1010314
def _determine_keys(dictionary):
    """"""
    optional = {}
    defaults = {}
    mandatory = {}
    types = {}
    for key, value in dictionary.items():
        if isinstance(key, Optional):
            optional[key.value] = parse_schema(value)
            if isinstance(value, BaseSchema) and\
                    value.default is not UNSPECIFIED:
                defaults[key.value] = (value.default, value.null_values)
            continue  # pragma: nocover

        if type(key) is type:
            types[key] = parse_schema(value)
            continue

        mandatory[key] = parse_schema(value)
    return mandatory, optional, types, defaults