code: def test_socket_in_use(self, mocker):
      remove = mocker.patch("os.remove")
      path_exists = mocker.patch("os.path.exists")
      remove.side_effect = OSError()
      path_exists.return_value = True
  
      with pytest.raises(
          Exception,
          match=r".*socket already in use: sampleSocketName.9999.*",
      ):
          TorchModelServiceWorker(
              "unix", self.socket_name, None, None, metrics_config_path
          )
  
imports: import os
  import socket
  import sys
  from collections import namedtuple
  import mock
  import pytest
  from mock import Mock
  from ts.model_service_worker import TorchModelServiceWorker
  from ts.service import Service
label_desc: Use image node_id 2 for calling the TestInit obj's underlying member method code with example usage: obj.test_socket_in_use(mocker) without return types