MCPcopy Index your code
hub / github.com/tensorflow/tensorboard / get_url

Method get_url

tensorboard/program.py:857–881  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

855 logger.error("HTTP serving error", exc_info=exc_info)
856
857 def get_url(self):
858 if not self._url:
859 if self._auto_wildcard:
860 display_host = socket.getfqdn()
861 # Confirm that the connection is open, otherwise change to `localhost`
862 try:
863 socket.create_connection(
864 (display_host, self.server_port), timeout=1
865 )
866 except socket.error as e:
867 display_host = "localhost"
868
869 else:
870 host = self._host
871 display_host = (
872 "[%s]" % host
873 if ":" in host and not host.startswith("[")
874 else host
875 )
876 self._url = "http://%s:%d%s/" % (
877 display_host,
878 self.server_port,
879 self._flags.path_prefix.rstrip("/"),
880 )
881 return self._url
882
883 def print_serving_message(self):
884 if self._flags.host is None and not self._flags.bind_all:

Callers 5

testPathPrefixSlashMethod · 0.95
testSpecifiedHostMethod · 0.95
launchMethod · 0.45
_register_infoMethod · 0.45

Calls

no outgoing calls

Tested by 3

testPathPrefixSlashMethod · 0.76
testSpecifiedHostMethod · 0.76