code: def join_authority(authority):
      
      (user, passwd, host, port) = authority
      result = ''
      if user:
          result += user
          if passwd:
              result += ':' + passwd
          result += '@'
      result += host
      if port:
          result += ':' + port
      return result
docs: Reverse of split_authority()
  
         >>>join_authority(('user', 'password', 'host', 'port'))
         "user:password@host:port"