code: def socket_patches(mocker):
      Patches = namedtuple("Patches", ["socket"])
      mock_patch = Patches(mocker.patch("socket.socket"))
      mock_patch.socket.recv.side_effect = [
          b"L",
          b"\x00\x00\x00\x0a",
          b"model_name",
          b"\x00\x00\x00\x0a",
          b"model_path",
          b"\x00\x00\x00\x01",
          b"\x00\x00\x00\x07",
          b"handler",
          b"\x00\x00\x00\x01",
          b"\x00\x00\x00\x08",
          b"envelope",
      ]
      return mock_patch
  
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 1 for calling a global function with example usage: socket_patches(mocker) and returns: mock_patch