code: def start_transport(transport, username, key):
      
  
      transport.start_client()
  
      agent = paramiko.agent.Agent()
      keys = itertools.chain((key,) if key else (), agent.get_keys())
      for test_key in keys:
          try:
              transport.auth_publickey(username, test_key)
              break
          except paramiko.AuthenticationException as e:
              pass
      else:
          raise ValueError('No valid key supplied')
  
      return transport
docs: Begin a transport client and authenticate it
  
          :param transport: the transport object to start
          :type transport: paramiko.Transport
          :param username: SSH username
          :type username: str
          :param key: key object used for authentication
          :type key: paramiko.RSAKey
  
          :return: the transport object passed
          :rtype: paramiko.Transport