Populate the ``isbns`` key.
16248
def isbns(self, key, value):
    """"""
    def _get_medium(value):
        def _normalize(medium):
            schema = load_schema('hep')
            valid_media = schema['properties']['isbns']['items']['properties']['medium']['enum']

            medium = medium.lower().replace('-', '').replace(' ', '')
            if medium in valid_media:
                return medium
            elif medium == 'ebook':
                return 'online'
            elif medium == 'paperback':
                return 'softcover'

            return ''

        medium = force_single_element(value.get('b', ''))
        normalized_medium = _normalize(medium)

        return normalized_medium

    def _get_isbn(value):
        a_value = force_single_element(value.get('a', ''))
        normalized_a_value = a_value.replace('.', '')
        if normalized_a_value:
            return normalize_isbn(normalized_a_value)

    return {
        'medium': _get_medium(value),
        'value': _get_isbn(value),
    }
139735
def populate_obj(self, obj, keys=None):
        """"""
        keys = keys or self.keys()
        for key in keys:
            key = key.upper()
            value = self.get(key, empty)
            if value is not empty:
                setattr(obj, key, value)
1234754
def fill(self, key, mor_dict):
        
        with self._objects_queue_lock:
            self._objects_queue[key] = mor_dict
400229
def key_add(self):
        """"""
        from .main import add_api_key
        add_api_key(self.key_name.get(), self.key_val.get())

        # Clear the text fields
        self.key_name.set("")
        self.key_val.set("")
668190
def ISBNValidator(raw_isbn):
    
    isbn_to_check = raw_isbn.replace('-', '').replace(' ', '')

    if not isinstance(isbn_to_check, string_types):
        raise ValidationError(_(u'Invalid ISBN: Not a string'))

    if len(isbn_to_check) != 10 and len(isbn_to_check) != 13:
        raise ValidationError(_(u'Invalid ISBN: Wrong length'))
    
    if not isbn.is_valid(isbn_to_check):
        raise ValidationError(_(u'Invalid ISBN: Failed checksum'))

    if isbn_to_check != isbn_to_check.upper():
        raise ValidationError(_(u'Invalid ISBN: Only upper case allowed'))

    return True
294927
def doi(self):
        '''
        
        '''
        if not ISBN.hyphenRange:
            ISBN.hyphenRange = hyphen.ISBNRange()

        seg = ISBN.hyphenRange.hyphensegments(self._id)
        return '10.' + self._id[0:3] + '.' + \
            self._id[3:-(1 + seg[3])] + '/' + self._id[-(1 + seg[3]):]
480694
def keys(self, start=None, stop=None):
        """"""
        return (item[0] for item in self.items(start, stop))
557977
def get_model_from_key(key):
    """"""
    _known_models = {}
    model_name = key.split(':', 2)[0]
    # populate
    for klass in Model.__subclasses__():
        _known_models[klass.__name__] = klass
    return _known_models.get(model_name, None)
1194469
def __get_isbn(self, html):
        

        import re

        reg = re.compile(r'getBookCover\(".*","(.*)"\);')
        res = reg.findall(html)
        if len(res) > 0:
            return res[0]
        else:
            return ''
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
1261641
def fill_prefixes(key, value, prefix, prefixes)
      prefixes = {} if prefixes.nil?
      if prefix.size == 1
        pr = prefix.to_i
        prefixes[pr] ||= {}
        prefixes[pr][key] = value
      else
        pr = prefix[0].to_i
        prefixes[pr] = fill_prefixes(key, value, prefix[1..-1], prefixes[pr])
      end
      prefixes
    end
920693
function (bnList) {
    var ret = []
    for (var k in bnList) {
      var v = bnList[k]
      if (ethutil.BN.isBN(v)) {
        ret.push('0x' + v.toString('hex', 64))
      } else {
        ret.push('0x' + (new ethutil.BN(v)).toString('hex', 64)) // TEMP FIX TO REMOVE ONCE https://github.com/ethereumjs/ethereumjs-vm/pull/293 is released
      }
    }
    return ret
  }
457659
def keys(self):
    """"""
    columns = set()
    for name in vars(self):
      if (not name) or name[0] == "_":
        continue
      columns.add(name)
    return columns
437348
def sunionstore(self, destkey, key, *keys):
        """"""
        return self.execute(b'SUNIONSTORE', destkey, key, *keys)
1122319
def _init_map(self, record_types=None, **kwargs):
        """"""
        osid_objects.OsidCatalogForm._init_map(self, record_types, **kwargs)
1246320
def setKey(self, key):
        """"""
        newkey = []
        for ki in range(len(key)):
            bsrc = ord(key[ki])
            btgt = 0
            for i in range(8):
                if bsrc & (1 << i):
                    btgt = btgt | (1 << 7-i)
            newkey.append(chr(btgt))
        super(RFBDes, self).setKey(newkey)
704506
def _make_publisher(catalog_or_dataset):
    """"""
    level = catalog_or_dataset
    keys = [k for k in ["publisher_name", "publisher_mbox"] if k in level]
    if keys:
        level["publisher"] = {
            key.replace("publisher_", ""): level.pop(key) for key in keys
        }
    return level