code: def gen(self, struct, text=""):
      if isinstance(struct, (str, bytes, pathlib.PurePath)):
          struct = {struct: text}
  
      return self._gen(struct)
  
imports: import os
  import pathlib
  import sys
  from contextlib import contextmanager
  from functools import partialmethod
  from dvc.utils import serialize
label_desc: Use image node_id 8 for calling the TmpDir obj's underlying member method code with example usage: obj.gen(struct, text) and returns: self