code: def __init__(self, kind, value, maxvalue, name=None):
      # unlink_now is only used on win32 or when we are using fork.
      unlink_now = False
      if name is None:
          # Try to find an unused name for the SemLock instance.
          for _ in range(100):
              try:
                  self._semlock = _SemLock(
                      kind,
                      value,
                      maxvalue,
                      SemLock._make_name(),
                      unlink_now,
                  )
              except FileExistsError:  # pragma: no cover
                  pass
              else:
                  break
          else:  # pragma: no cover
              raise FileExistsError("cannot find name for semaphore")
      else:
          self._semlock = _SemLock(
              kind, value, maxvalue, name, unlink_now
          )
      self.name = name
      util.debug(
          f"created semlock with handle {self._semlock.handle} and name "
          f'"{self.name}"'
      )
  
      self._make_methods()
  
      def _after_fork(obj):
          obj._semlock._after_fork()
  
      util.register_after_fork(self, _after_fork)
  
      # When the object is garbage collected or the
      # process shuts down we unlink the semaphore name
      resource_tracker.register(self._semlock.name, "semlock")
      util.Finalize(
          self, SemLock._cleanup, (self._semlock.name,), exitpriority=0
      )
  
imports: import os
  import sys
  import tempfile
  import threading
  import _multiprocessing
  from time import time
  from multiprocessing import process, util
  from multiprocessing.context import assert_spawning
  from .None import resource_tracker
label_desc: Use image node_id 1 to create a new SemLock object  with example: obj = SemLock(kind, value, maxvalue, name)