code: def change_to(self):
      if self.workdir is not None:
          self.olddir = Path.cwd()
          if not self.workdir.exists():
              logger.info(
                  f"Creating specified working directory {self.workdir}."
              )
              self.workdir.mkdir(parents=True)
          os.chdir(self.workdir)
  
imports: from dataclasses import dataclass, field
  import os
  from pathlib import Path
  from typing import Optional
  from snakemake.logging import logger
label_desc: Use image node_id 1 for calling the WorkdirHandler obj's underlying member method code with example usage: obj.change_to() without return types