code: def from_category(
      cls: Type[L],
      category: str,
      *,
      categories: Sequence[str],
      **kwargs: Any,
  ) -> L:
      return cls(
          categories.index(category), categories=categories, **kwargs
      )
  
file_path: vision/torchvision/prototype/tv_tensors/_label.py
imports: from __future__ import annotations
  from typing import Any, Optional, Sequence, Type, TypeVar, Union
  import torch
  from torch.utils._pytree import tree_map
  from torchvision.tv_tensors._tv_tensor import TVTensor
label_desc: Use image node_id 3 for calling the _LabelBase obj's underlying member method code with example usage: obj.from_category(cls, category) and returns: cls