code: def from_file(filename, password='', keytype=None):
          
          if keytype is None:
              try:
                  key = RSAKey.from_private_key_file(filename)
                  keytype = 'rsa'
              except SSHException as e:
                  try:
                      key = DSSKey.from_private_key_file(filename)
                      keytype = 'dss'
                  except SSHException as e:
                      msg = 'not a recognized private key: ' + repr(filename)
                      raise ValueError(msg)
          key = PrivateKey(keytype)
          key.filename = filename
          key.password = password
          return key
docs: Returns a new PrivateKey instance with the given attributes.
          If keytype is None, we attempt to automatically detect the type.
  
          :type  filename: string
          :param filename: The key file name.
          :type  password: string
          :param password: The key password.
          :type  keytype: string
          :param keytype: The key type.
          :rtype:  PrivateKey
          :return: The new key.