class_docstr: Type specifically made for labels that are mapped to a key.
  
  Parameters
  ----------
  path
      Path to a file that has multiple classes separated by new line character.
      Index of the line will be considered as the key for each class. This parameter
      is mutually exclusive to `classes` parameter
  classes
      A list, tuple or a dict of classes. If it's list or a tuple, index of the
      class, is the key. If it's a dictionary, the key must be an integer
code: def __post_init__(self):
      if self.classes is None:
          if self.path is None:
              raise ValueError(
                  "Must provide either classes as a list or "
                  "path to a text file that contains classes"
              )
          with Path(self.path).open(mode="r") as f:
              self.classes = tuple(
                  item.strip() for item in f.readlines()
              )
      if isinstance(self.classes, dict):
          self._reverse_map = {}
          for key, value in self.classes.items():
              if not isinstance(key, int):
                  raise TypeError(
                      "Key from the label dict must be an int"
                  )
              self._reverse_map[value] = key
      elif isinstance(self.classes, (list, tuple)):
          self._reverse_map = {
              value: i for i, value in enumerate(self.classes)
          }
      else:
          raise TypeError("`classes` must be a list, tuple or a dict")
  
file_path: lightning-flash/src/flash/core/serve/types/label.py
imports: from dataclasses import dataclass, field
  from pathlib import Path
  from typing import Dict, List, Tuple, Union
  import torch
  from torch import Tensor
  from flash.core.serve.types.base import BaseType
label_desc: Use image node_id 1 for calling the Label obj's underlying member method code with example usage: obj.__post_init__() without return types