code: def __init__(self, restrictions: Optional[Dict[int, int]] = None):
      self.restrictions = restrictions or {}
      self.sockets: Dict[int, socket.socket] = {}
  
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 1 to create a new PortsLock object  with example: obj = PortsLock(restrictions)