MCPcopy Create free account
hub / github.com/google-research/language / default

Method default

language/capwap/utils/io_utils.py:283–292  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

281 """Helper to encode things with Numpy objects."""
282
283 def default(self, obj):
284 if isinstance(obj, np.ndarray):
285 return obj.tolist()
286 if np.issubdtype(obj, np.integer):
287 return int(obj)
288 if np.issubdtype(obj, float):
289 return float(obj)
290 if np.issubdtype(obj, bool):
291 return bool(obj)
292 return json.JSONEncoder.default(self, obj)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected