code: def add(self, filename, arcname=None, recursive: bool = True):
      if arcname is not None:
          print(f"adding: {arcname}")
      else:
          print(f"adding: {filename}")
  
      if recursive and Path(filename).is_dir():
          for f in Path(filename).glob("**/*"):
              if f.is_dir():
                  continue
  
              if arcname is not None:
                  _arcname = Path(arcname) / f
              else:
                  _arcname = None
  
              self.add(f, _arcname)
          return
  
      if self.type == "tar":
          return self.fopen.add(filename, arcname)
      elif self.type == "zip":
          return self.fopen.write(filename, arcname)
      else:
          raise ValueError(f"Not supported: type={self.type}")
  
imports: import os
  import sys
  import tarfile
  import zipfile
  from datetime import datetime
  from io import BytesIO, TextIOWrapper
  from pathlib import Path
  from typing import Dict, Iterable, Optional, Union
  import yaml
label_desc: Use image node_id 6 for calling the Archiver obj's underlying member method code with example usage: obj.add(filename, arcname, recursive) and returns: self, self