class_docstr: Applies a function as a transformation This is called ad-hoc, because it is
  not serializable.
  
  It is OK to use this for experiments and outside of a model pipeline that
  needs to be serialized.
class_docstr_tok: ["Applies","a","function","as","a","transformation","This","is","called","ad-hoc",",","because","it","is","not","serializable",".","It","is","OK","to","use","this","for","experiments","and","outside","of","a","model","pipeline","that","needs","to","be","serialized","."]
code: def transform(self, data: DataEntry) -> DataEntry:
      return self.func(data.copy())
  
imports: import abc
  from dataclasses import dataclass
  from typing import Callable, Iterable, Iterator, List
  from gluonts.core.component import equals, validated
  from gluonts.dataset.common import DataEntry, Dataset
  from gluonts.env import env
label_desc: Use image node_id 2 for calling the AdhocTransform obj's underlying member method code with example usage: obj.transform(data) and returns: self