code: def get_local_addr(self, timeout=None):
          
  
          # If we're not running, just return None
          if not self.running:
              return None
  
          # OK, we're running; wait on the _local_addr_event
          if not self._local_addr_event.wait(timeout):
              # Still not set after timeout
              return None
  
          # We have a local address!
          return self._local_addr
docs: Retrieve the current local address.
  
          :param timeout: If not given or given as ``None``, waits until
                          the local address is available.  Otherwise,
                          waits for as long as specified.  If the local
                          address is not set by the time the timeout
                          expires, returns ``None``.