class_docstr: A concrete class representing a :class:`EncryptedDataset`.
  
  This class gives an very simple example on how to use patched `torch.load`
  to load decrypted dataset into memory and constructs an Dataset upon it. You
  can use this :class:`EncryptedDataset` if its load_data method works good with
  your dataset.  Otherwise, it would be quite simple to build your own Dataset
  class given this example
  
  .. note::
    The decryption key passed in should be the same with the key that is
    used to encrypt the dataset through torch.save(dataset, encryption_key=xxx)
docstr: Init method for :class:`EncryptedDataset`.
  
  :param data_path: str. The path where the dataset is stored.
         The dataset should be previously stored using patched `torch.save`
         with the encryption key
  :param key: str. The key which is used to previously encrypted
         the dataset using patched `torch.save`
code: def __init__(self, data_path, key):
      """
      Init method for :class:`EncryptedDataset`.
  
      :param data_path: str. The path where the dataset is stored.
             The dataset should be previously stored using patched `torch.save`
             with the encryption key
      :param key: str. The key which is used to previously encrypted
             the dataset using patched `torch.save`
      """
      self.data = self._load_data(data_path, key)
  
imports: import torch
  from torch.utils.data import Dataset
  import io
  import os
  import pathlib
  from cryptography.fernet import Fernet
  from typing import BinaryIO, Union, IO, Optional
  import pickle
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 1 to create a new EncryptedDataset object from inherited base classes: torch.utils.data with example: obj = EncryptedDataset(data_path, key)