class_docstr: Helper class to adapt between Protocol and StreamReader.
  
  (This is a helper class instead of making StreamReader itself a
  Protocol subclass, because the StreamReader has other potential
  uses, and to prevent the user of the StreamReader to accidentally
  call inappropriate methods of the protocol.)
class_docstr_tok: ["Helper","class","to","adapt","between","Protocol","and","StreamReader",".","(","This","is","a","helper","class","instead","of","making","StreamReader","itself","a","Protocol","subclass",",","because","the","StreamReader","has","other","potential","uses",",","and","to","prevent","the","user","of","the","StreamReader","to","accidentally","call","inappropriate","methods","of","the","protocol",".",")"]
code: def connection_made(self, transport):
      if self._reject_connection:
          context = {
              "message": (
                  "An open stream was garbage collected prior to "
                  "establishing network connection; "
                  'call "stream.close()" explicitly.'
              )
          }
          if self._source_traceback:
              context["source_traceback"] = self._source_traceback
          self._loop.call_exception_handler(context)
          transport.abort()
          return
      self._transport = transport
      reader = self._stream_reader
      if reader is not None:
          reader.set_transport(transport)
      self._over_ssl = (
          transport.get_extra_info("sslcontext") is not None
      )
      if self._client_connected_cb is not None:
          self._stream_writer = StreamWriter(
              transport, self, reader, self._loop
          )
          res = self._client_connected_cb(reader, self._stream_writer)
          if coroutines.iscoroutine(res):
  
              def callback(task):
                  if task.cancelled():
                      transport.close()
                      return
                  exc = task.exception()
                  if exc is not None:
                      self._loop.call_exception_handler(
                          {
                              "message": "Unhandled exception in client_connected_cb",
                              "exception": exc,
                              "transport": transport,
                          }
                      )
                      transport.close()
  
              self._task = self._loop.create_task(res)
              self._task.add_done_callback(callback)
  
          self._strong_reader = None
  
imports: import collections
  import socket
  import sys
  import warnings
  import weakref
  from .None import coroutines
  from .None import events
  from .None import exceptions
  from .None import format_helpers
  from .None import protocols
  from .log import logger
  from .tasks import sleep
label_desc: Use image node_id 4 for calling the StreamReaderProtocol obj's underlying member method code with example usage: obj.connection_made(transport) without return types