MCPcopy Create free account
hub / github.com/tensorflow/tensorboard / sgetattr

Function sgetattr

tensorboard/tools/diagnose_tensorboard.py:129–138  ·  view source on GitHub ↗

Get an attribute off the `socket` module, or use a default.

(attr, default)

Source from the content-addressed store, hash-verified

127
128
129def sgetattr(attr, default):
130 """Get an attribute off the `socket` module, or use a default."""
131 sentinel = object()
132 result = getattr(socket, attr, sentinel)
133 if result is sentinel:
134 print("socket.%s does not exist" % attr)
135 return default
136 else:
137 print("socket.%s = %r" % (attr, result))
138 return result
139
140
141@check

Callers 1

addrinfosFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…