Populate the ``595`` MARC key.

    Also populates the `595_H` MARC key through side effects.
761868
def _private_notes2marc(self, key, value):
    
    def _is_from_hal(value):
        return value.get('source') == 'HAL'

    if not _is_from_hal(value):
        return {
            '9': value.get('source'),
            'a': value.get('value'),
        }

    self.setdefault('595_H', []).append({'a': value.get('value')})
542738
def RegisterTextKey(cls, key, frameid):
        
        def getter(id3, key):
            return list(id3[frameid])

        def setter(id3, key, value):
            try:
                frame = id3[frameid]
            except KeyError:
                id3.add(mutagen.id3.Frames[frameid](encoding=3, text=value))
            else:
                frame.encoding = 3
                frame.text = value

        def deleter(id3, key):
            del(id3[frameid])

        cls.RegisterKey(key, getter, setter, deleter)
165099
def add_key(self, key, metadata=""):
        
        data = {
            'key': key,
            'metadata': metadata
        }

        return self.post('createKey', data)
148692
def append_lookup_key(model, lookup_key):
    ""
    pieces = lookup_key.split('__', 1)

    fields = append_translated(model, (pieces[0],))

    if len(pieces) > 1:
        # Check if we are doing a lookup to a related trans model
        fields_to_trans_models = get_fields_to_translatable_models(model)
        if pieces[0] in fields_to_trans_models:
            transmodel = fields_to_trans_models[pieces[0]]
            rest = append_lookup_key(transmodel, pieces[1])
            fields = set('__'.join(pr) for pr in itertools.product(fields, rest))
        else:
            fields = set('%s__%s' % (f, pieces[1]) for f in fields)
    return fields
1354340
def create_keys_in():
    
    keys = Group(
        Optional(Suppress("("))
        + value
        + Optional(Suppress(",") + value)
        + Optional(Suppress(")"))
    )
    return (Suppress(upkey("keys") + upkey("in")) + delimitedList(keys)).setResultsName(
        "keys_in"
    )
44760
private void populateCurrentKeyValue() throws IOException, InterruptedException {
    currentKey = delegateReader.getCurrentKey();
    currentValue = delegateReader.getCurrentValue();
    ++recordsRead;
  }
1263759
def pymux_key_to_prompt_toolkit_key_sequence(key):
    
    # Make the c- and m- prefixes case insensitive.
    if key.lower().startswith('m-c-'):
        key = 'M-C-' + key[4:]
    elif key.lower().startswith('c-'):
        key = 'C-' + key[2:]
    elif key.lower().startswith('m-'):
        key = 'M-' + key[2:]

    # Lookup key.
    try:
        return PYMUX_TO_PROMPT_TOOLKIT_KEYS[key]
    except KeyError:
        if len(key) == 1:
            return (key, )
        else:
            raise ValueError('Unknown key: %r' % (key, ))
835664
private void maybeMarkCurrentKeyAsUsed(DeterministicKey key) {
        // It's OK for currentKeys to be empty here: it means we're a married wallet and the key may be a part of a
        // rotating chain.
        for (Map.Entry<KeyChain.KeyPurpose, DeterministicKey> entry : currentKeys.entrySet()) {
            if (entry.getValue() != null && entry.getValue().equals(key)) {
                log.info("Marking key as used: {}", key);
                currentKeys.put(entry.getKey(), freshKey(entry.getKey()));
                return;
            }
        }
    }
485031
def addsshkey(self, title, key):
        
        data = {'title': title, 'key': key}

        request = requests.post(
            self.keys_url, headers=self.headers, data=data,
            verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 201:
            return True
        else:
            return False
777991
def gen_key(self, *values):
        """"""
        key = md5()
        KeyGen._recursive_convert(values, key)
        return key.hexdigest()
348748
def populate_keys_tree(self):
        
        for group in HOTKEYS:
            parent = self.store.append(None, [None, group['label'], None, None])
            for item in group['keys']:
                if item['key'] == "show-hide" or item['key'] == "show-focus":
                    accel = self.settings.keybindingsGlobal.get_string(item['key'])
                else:
                    accel = self.settings.keybindingsLocal.get_string(item['key'])
                gsettings_path = item['key']
                keycode, mask = Gtk.accelerator_parse(accel)
                keylabel = Gtk.accelerator_get_label(keycode, mask)
                self.store.append(parent, [gsettings_path, item['label'], keylabel, accel])
        self.get_widget('treeview-keys').expand_all()
630729
def _set_20_bytes_key(self, data):
        
        if data.startswith(b'h:'):
            new = binascii.unhexlify(data[2:])
        else:
            new = data
        if len(new) == 20:
            self.key = new[:16]
            self.uid = new[16:]
        else:
            raise yubico_exception.InputError('HMAC key must be exactly 20 bytes')
672753
def _gen_keys_from_multicol_key(key_multicol, n_keys):
    """"""
    keys = [('{}{:03}of{:03}')
            .format(key_multicol, i+1, n_keys) for i in range(n_keys)]
    return keys
378496
def format_key_from_backend(self, key):
        """"""
        if not self.prefix:
            return key
        if not key.startswith(self.prefix):
            raise StorageError("Key {!r} does not start with expected prefix {!r}".format(key, self.prefix))
        return key[len(self.prefix):]
1025037
def _key_to_address(key):
    
    key_parts = key.split('.', maxsplit=_MAX_KEY_PARTS - 1)
    key_parts.extend([''] * (_MAX_KEY_PARTS - len(key_parts)))

    return SETTINGS_NAMESPACE + ''.join(_short_hash(x) for x in key_parts)
551659
def titles2marc(self, key, values):
    
    first, rest = values[0], values[1:]

    self.setdefault('245', []).append({
        'a': first.get('title'),
        'b': first.get('subtitle'),
        '9': first.get('source'),
    })

    return [
        {
            'a': value.get('title'),
            'b': value.get('subtitle'),
            '9': value.get('source'),
        } for value in rest
    ]
1122246
def add_subkey(self, subkey):
        
        if self.key.lower() == 'atoms' or not self.has_subkey(subkey):
            self.subkeys.append(subkey)