class_docstr: See documentation here
  
  https://wiki.yandex-team.ru/yatool/test/#python-acquire-ports
class_docstr_tok: ["See","documentation","here","https",":","\/\/wiki.yandex-team.ru\/yatool\/test\/","#","python-acquire-ports"]
code: def __init__(self, sync_dir=None):
      self._sync_dir = sync_dir or os.environ.get("PORT_SYNC_PATH")
      if self._sync_dir:
          _makedirs(self._sync_dir)
  
      self._valid_range = get_valid_port_range()
      self._valid_port_count = self._count_valid_ports()
      self._filelocks = {}
      self._lock = threading.Lock()
  
imports: import os
  import errno
  import socket
  import random
  import logging
  import platform
  import threading
  import six
label_desc: Use image node_id 1 to create a new PortManager object from inherited base classes: object with example: obj = PortManager(sync_dir)