code: def _init_supervisor_rpc(self, rpc_or_port):
          '''Initialize supervisor RPC.
  
          Allow passing in an RPC connection, or a port number for
          making one.
  
          '''
          if isinstance(rpc_or_port, int):
              if self.username:
                  leader = 'http://{self.username}:{self.password}@'
              else:
                  leader = 'http://'
              tmpl = leader + '{self.name}:{port}'
              url = tmpl.format(self=self, port=rpc_or_port)
              self.rpc = xmlrpc_client.ServerProxy(
                  url, transport=TimeoutTransport())
          else:
              self.rpc = rpc_or_port
          self.supervisor = self.rpc.supervisof _init_supervisor_rpc(self, rpc_or_port):
          '''Initialize supervisor RPC.
  
          Allow passing in an RPC connection, or a port number for
          making one.
  
          '''
          if isinstance(rpc_or_port, int):
              if self.username:
                  leader = 'http://{self.username}:{self.password}@'
              else:
                  leader = 'http://'
              tmpl = leader + '{self.name}:{port}'
              url = tmpl.format(self=self, port=rpc_or_port)
              self.rpc = xmlrpc_client.ServerProxy(
                  url, transport=TimeoutTransport())
          else:
              self.rpc = rpc_or_port
          self.supervisor = self.rpc.supervisor
docs: Initialize supervisor RPC.
  
          Allow passing in an RPC connection, or a port number for
          making one.