def add(self, hostname, key, hash_hostname=False):
        # Per sshd man page on known_hosts:
        # It is permissible (but not recommended) to have several lines or
        # different host keys for the same names.
        # So if called to add, it is not necessary to check for duplication
        # here, and hope that the caller is handling conflicts.
        with _lock:
            lineno = len(self._lines)
            keyval = key.get_base64()
            keytype = key.get_name()
            if hash_hostname or hostname.startswith('|'):
                if not hostname.startswith('|'):
                    # Add index entry for unhashed hostname
                    self._index[hostname].append(lineno)
                    hostname = paramiko.HostKeys.hash_host(hostname)
                else:
                    self._hashed_hosts.append((hostname, lineno))
            else:
                self._index[hostname].append(lineno)
            self._lines.append('%s %s %s' %
                               (hostname, keytype, keyval))
            if self._filename:
                self.save()
        logging.getLogger('radssh.keys').info('Added new known_hosts entry for %s (%s) to %s' % (hostname, printable_fingerprint(key), self._filename))
        return HostKeyEntry([hostname], key, lineno=lineno)
Create upload URL for POST form.
dataset/ETHPy150Open radssh/radssh/radssh/known_hosts.py/KnownHosts.add--crossover with--dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/api/blobstore/blobstore.py/create_upload_url