code: def load_key(self, key_path, password):
          
  
          try:
              return paramiko.RSAKey.from_private_key_file(key_path)
          except PasswordRequiredException as ex:
              return paramiko.RSAKey.from_private_key_file(key_path,
                                                           password=password)
docs: Creates paramiko rsa key
  
          :type key_path: str
          :param key_path: path to rsa key
          :type password: str
          :param password: password to try if rsa key is encrypted