code: def release(self) -> Dict[int, int]:
      mapping = self.dict()
      for sock in self.sockets.values():
          sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
          sock.close()
      self.sockets = {}
      return mapping
  
file_path: dstack/src/dstack/_internal/core/services/ssh/ports.py
imports: import errno
  import socket
  from typing import Dict, List, Optional
  from dstack._internal.core.errors import DstackError
  from dstack._internal.core.models.configurations import PortMapping
label_desc: Use image node_id 3 for calling the PortsLock obj's underlying member method code with example usage: obj.release() and returns: mapping