class_docstr: A non-blocking TCP connection factory.
  
  .. versionchanged:: 5.0
     The ``io_loop`` argument (deprecated since version 4.1) has been removed.
code: def _create_stream(
      self,
      max_buffer_size: int,
      af: socket.AddressFamily,
      addr: Tuple,
      source_ip: Optional[str] = None,
      source_port: Optional[int] = None,
  ) -> Tuple[IOStream, "Future[IOStream]"]:
      # Always connect in plaintext; we'll convert to ssl if necessary
      # after one connection has completed.
      source_port_bind = (
          source_port if isinstance(source_port, int) else 0
      )
      source_ip_bind = source_ip
      if source_port_bind and not source_ip:
          # User required a specific port, but did not specify
          # a certain source IP, will bind to the default loopback.
          source_ip_bind = (
              "::1" if af == socket.AF_INET6 else "127.0.0.1"
          )
          # Trying to use the same address family as the requested af socket:
          # - 127.0.0.1 for IPv4
          # - ::1 for IPv6
      socket_obj = socket.socket(af)
      if source_port_bind or source_ip_bind:
          # If the user requires binding also to a specific IP/port.
          try:
              socket_obj.bind((source_ip_bind, source_port_bind))
          except socket.error:
              socket_obj.close()
              # Fail loudly if unable to use the IP/port.
              raise
      try:
          stream = IOStream(socket_obj, max_buffer_size=max_buffer_size)
      except socket.error as e:
          fu = Future()  # type: Future[IOStream]
          fu.set_exception(e)
          return stream, fu
      else:
          return stream, stream.connect(addr)
  
imports: import functools
  import socket
  import numbers
  import datetime
  import ssl
  import typing
  from tornado.concurrent import Future, future_add_done_callback
  from tornado.ioloop import IOLoop
  from tornado.iostream import IOStream
  from tornado import gen
  from tornado.netutil import Resolver
  from tornado.gen import TimeoutError
  from typing import Any, Union, Dict, Tuple, List, Callable, Iterator, Optional
label_desc: Use image node_id 3 for calling the TCPClient obj's underlying member method code with example usage: obj._create_stream(max_buffer_size, af, addr, source_ip, source_port) and returns: stream,  stream, stream,  fu