class_docstr: Stores artifacts as files in a remote directory, via sftp.
code: def __init__(self, artifact_uri):
      self.uri = artifact_uri
      parsed = urllib.parse.urlparse(artifact_uri)
      self.config = {
          "host": parsed.hostname,
          "port": parsed.port,
          "username": parsed.username,
          "password": parsed.password,
      }
      self.path = parsed.path or "/"
  
      import paramiko
      import pysftp
  
      if self.config["host"] is None:
          self.config["host"] = "localhost"
  
      ssh_config = paramiko.SSHConfig()
      user_config_file = os.path.expanduser("~/.ssh/config")
      if os.path.exists(user_config_file):
          with open(user_config_file) as f:
              ssh_config.parse(f)
  
      user_config = ssh_config.lookup(self.config["host"])
  
      if "hostname" in user_config:
          self.config["host"] = user_config["hostname"]
  
      if (
          self.config.get("username", None) is None
          and "user" in user_config
      ):
          self.config["username"] = user_config["user"]
  
      if self.config.get("port", None) is None:
          if "port" in user_config:
              self.config["port"] = int(user_config["port"])
          else:
              self.config["port"] = 22
  
      if "identityfile" in user_config:
          self.config["private_key"] = user_config["identityfile"][0]
  
      connections = [
          pysftp.Connection(**self.config)
          for _ in range(self.max_workers)
      ]
      self.pool = _SftpPool(connections)
  
      super().__init__(artifact_uri)
  
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 1 to create a new SFTPArtifactRepository object from inherited base classes: ArtifactRepository with example: obj = SFTPArtifactRepository(artifact_uri)