class_docstr: Remote dataset server
  
  `Here's a sample usage of the server <https://github.com/labmlai/labml/blob/master/helpers/labml_helpers/datasets/remote/test/mnist_server.py>`_
class_docstr_tok: ["Remote","dataset","server","`","Here","'s","a","sample","usage","of","the","server","<","https",":","\/\/github.com\/labmlai\/labml\/blob\/master\/helpers\/labml_helpers\/datasets\/remote\/test\/mnist_server.py",">","`","_"]
docstr: Add a dataset
  
  
  Arguments:
      name (str): name of the data set
      dataset (Dataset): dataset to be served
docstr_tok: ["Add","a","dataset","Arguments",":","name","(","str",")",":","name","of","the","data","set","dataset","(","Dataset",")",":","dataset","to","be","served"]
code: def add_dataset(self, name: str, dataset: Dataset):
      """
      Add a dataset
  
  
      Arguments:
          name (str): name of the data set
          dataset (Dataset): dataset to be served
      """
      assert name not in self.datasets
      sd = _ServerDataset(name, dataset)
      self.datasets[name] = sd
      self.app.add_api_route(
          "/" + name + "/len", sd.len_handler, methods=["GET"]
      )
      self.app.add_api_route(
          "/" + name + "/item/{idx}", sd.item_handler, methods=["GET"]
      )
  
file_path: labml/helpers/labml_helpers/datasets/remote/server.py
imports: import pickle
  import uvicorn
  from fastapi import FastAPI, Request, Response
  from torch.utils.data import Dataset
label_desc: Use image node_id 2 for calling the DatasetServer obj's underlying member method code with example usage: obj.add_dataset(name, dataset) without return types