code: def prepare_sendfile(self, *, is_ssl=False, close_after=0):
      port = socket_helper.find_unused_port()
      srv_proto = MySendfileProto(
          loop=self.loop, close_after=close_after
      )
      if is_ssl:
          if not ssl:
              self.skipTest("No ssl module")
          srv_ctx = test_utils.simple_server_sslcontext()
          cli_ctx = test_utils.simple_client_sslcontext()
      else:
          srv_ctx = None
          cli_ctx = None
      srv_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      srv_sock.bind((socket_helper.HOST, port))
      server = self.run_loop(
          self.loop.create_server(
              lambda: srv_proto, sock=srv_sock, ssl=srv_ctx
          )
      )
      self.reduce_receive_buffer_size(srv_sock)
  
      if is_ssl:
          server_hostname = socket_helper.HOST
      else:
          server_hostname = None
      cli_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      cli_sock.connect((socket_helper.HOST, port))
  
      cli_proto = MySendfileProto(loop=self.loop)
      tr, pr = self.run_loop(
          self.loop.create_connection(
              lambda: cli_proto,
              sock=cli_sock,
              ssl=cli_ctx,
              server_hostname=server_hostname,
          )
      )
      self.reduce_send_buffer_size(cli_sock, transport=tr)
  
      def cleanup():
          srv_proto.transport.close()
          cli_proto.transport.close()
          self.run_loop(srv_proto.done)
          self.run_loop(cli_proto.done)
  
          server.close()
          self.run_loop(server.wait_closed())
  
      self.addCleanup(cleanup)
      return srv_proto, cli_proto
  
imports: import asyncio
  import errno
  import os
  import socket
  import sys
  import tempfile
  import unittest
  from asyncio import base_events
  from asyncio import constants
  from unittest import mock
  from test import support
  from test.support import os_helper
  from test.support import socket_helper
  from test.test_asyncio import utils
label_desc: Use image node_id 1 for calling the SendfileMixin obj's underlying member method code with example usage: obj.prepare_sendfile() and returns: srv_proto,  cli_proto