@classmethod
    def from_line(cls, line, lineno=None, filename=None):
        '''
        Parses the given line of text to find the name(s) for the host,
        the type of key, and the key data.
        '''
        if not line or not line.strip():
            return None
        fields = line.strip().split(' ')
        if not fields or fields[0].startswith('#'):
            return None
        if fields[0].startswith('@'):
            marker = fields[0]
            fields = fields[1:]
        else:
            marker = None

        if len(fields) < 3:
            raise UnreadableKey('Invalid known_hosts line', line, lineno)

        names, keytype, key = fields[:3]
        names = names.split(',')

        # Decide what kind of key we're looking at and create an object
        # to hold it accordingly.
        key = key.encode('ascii')
        # SSH-2 Key format consists of 2 (text) fields
        #     keytype, base64_blob
        try:
            if keytype == 'ssh-rsa':
                key = paramiko.RSAKey(data=base64.b64decode(key))
            elif keytype == 'ssh-dss':
                key = paramiko.DSSKey(data=base64.b64decode(key))
            elif keytype == 'ecdsa-sha2-nistp256':
                key = paramiko.ECDSAKey(data=base64.b64decode(key), validate_point=False)
            elif len(fields) > 3:
                # SSH-1 Key format consists of 3 integer fields
                #     bits, exponent, modulus (RSA Only)
                try:
                    bits = int(fields[1])
                    exponent = int(fields[2])
                    modulus = long(fields[3])
                    key = paramiko.RSAKey(vals=(exponent, modulus))
                except __HOLE__:
                    raise UnreadableKey('Invalid known_hosts line', line, lineno, filename)
            else:
                raise UnreadableKey('Invalid known_hosts line', line, lineno, filename)
            return cls(names, key, marker, lineno, filename)
        except Exception as e:
            raise UnreadableKey('Invalid known_hosts line (%s)' % e, line, lineno, filename)
dataset/ETHPy150Open radssh/radssh/radssh/known_hosts.py/HostKeyEntry.from_line