code: def gen_unique_id():
      
      # Workaround for http://bugs.python.org/issue4607
      if ctypes and _uuid_generate_random:
          buffer = ctypes.create_string_buffer(16)
          _uuid_generate_random(buffer)
          return str(UUID(bytes=buffer.raw))
      return str(uuid4())
docs: Generate a unique id, having - hopefully - a very small chance of
      collission.
  
      For now this is provided by :func:`uuid.uuid4`.