class_docstr: Helper utils for Model Archiver tool.
  This class lists out all the methods such as validations for model archiving.
docstr: This method zips the dir and filters out some files based on a expression
  :param archive_format:
  :param path:
  :param dst:
  :param model_name:
  :return:
docstr_tok: ["This","method","zips","the","dir","and","filters","out","some","files","based","on","a","expression",":","param","archive_format",":",":","param","path",":",":","param","dst",":",":","param","model_name",":",":","return",":"]
code: def archive_dir(path, dst, archive_format, model_name):
      """
      This method zips the dir and filters out some files based on a expression
      :param archive_format:
      :param path:
      :param dst:
      :param model_name:
      :return:
      """
      unwanted_dirs = {"__MACOSX", "__pycache__"}
  
      for root, directories, files in os.walk(path):
          # Filter directories
          directories[:] = [
              d
              for d in directories
              if ModelExportUtils.directory_filter(d, unwanted_dirs)
          ]
          for f in files:
              file_path = os.path.join(root, f)
              if archive_format == "tgz":
                  dst.add(
                      file_path,
                      arcname=os.path.join(
                          model_name, os.path.relpath(file_path, path)
                      ),
                  )
              elif archive_format == "no-archive":
                  dst_dir = os.path.dirname(
                      os.path.join(
                          dst, os.path.relpath(file_path, path)
                      )
                  )
                  ModelExportUtils.make_dir(dst_dir)
                  shutil.copy(file_path, dst_dir)
              else:
                  dst.write(file_path, os.path.relpath(file_path, path))
  
imports: import glob
  import logging
  import os
  import re
  import shutil
  import tarfile
  import tempfile
  import zipfile
  from io import BytesIO
  from pathlib import Path
  from .manifest_components.manifest import Manifest
  from .manifest_components.model import Model
  from .model_archiver_config import ModelArchiverConfig
  from .model_archiver_error import ModelArchiverError
label_desc: Use image node_id 10 for calling the ModelExportUtils obj's underlying member method code with example usage: obj.archive_dir(path, dst, archive_format, model_name) without return types