def hostport(scheme, host, port):
 if ((port, scheme) in [(80, 'http'), (443, 'https')]):
  return host
 else:
  return ('%s:%s' % (host, port))

def hostport ( scheme , host , port ) : if ( ( port , scheme ) in [ ( 80 , 'http' ) , ( 443 , 'https' ) ] ) : return host else : return ( '%s:%s' % ( host , port ) )
returns the host component .