class_docstr: Stores artifacts as files in a remote directory, via sftp.
code: def list_artifacts(self, path=None):
      artifact_dir = self.path
      list_dir = (
          posixpath.join(artifact_dir, path) if path else artifact_dir
      )
      with self.pool.get_sfp_connection() as sftp:
          if not sftp.isdir(list_dir):
              return []
          artifact_files = sftp.listdir(list_dir)
          infos = []
          for file_name in artifact_files:
              file_path = (
                  file_name
                  if path is None
                  else posixpath.join(path, file_name)
              )
              full_file_path = posixpath.join(list_dir, file_name)
              if sftp.isdir(full_file_path):
                  infos.append(FileInfo(file_path, True, None))
              else:
                  infos.append(
                      FileInfo(
                          file_path,
                          False,
                          sftp.stat(full_file_path).st_size,
                      )
                  )
          return infos
  
imports: import os
  import posixpath
  import sys
  import threading
  import urllib.parse
  from contextlib import contextmanager
  from mlflow.entities import FileInfo
  from mlflow.store.artifact.artifact_repo import ArtifactRepository
label_desc: Use image node_id 5 for calling the SFTPArtifactRepository obj's underlying member method code with example usage: obj.list_artifacts(path) and returns: infos, list