code: def filter_safe_paths(members):
      base_dir = resolve_path(".")
      for finfo in members:
          valid_path = False
          if is_path_in_dir(finfo.name, base_dir):
              valid_path = True
              yield finfo
          elif finfo.issym() or finfo.islnk():
              if is_link_in_dir(finfo, base_dir):
                  valid_path = True
                  yield finfo
          if not valid_path:
              warnings.warn(
                  "Skipping invalid path during archive extraction: "
                  f"'{finfo.name}'.",
                  stacklevel=2,
              )
  
imports: import hashlib
  import os
  import pathlib
  import re
  import shutil
  import tarfile
  import urllib
  import warnings
  import zipfile
  from urllib.request import urlretrieve
  from keras.api_export import keras_export
  from keras.backend import config
  from keras.utils import io_utils
  from keras.utils.module_utils import gfile
  from keras.utils.progbar import Progbar
label_desc: Use image node_id 5 for calling a global function with example usage: filter_safe_paths(members) without return types