Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/hyperopt/hyperopt
/ safe_int_cast
Function
safe_int_cast
hyperopt/rdists.py:268–273 ·
view source on GitHub ↗
(obj)
Source
from the content-addressed store, hash-verified
266
267
268
def
safe_int_cast(obj):
269
if
isinstance(obj, np.ndarray):
270
return
obj.astype(
"int"
)
271
if
isinstance(obj, list):
272
return
[int(i)
for
i in obj]
273
return
int(obj)
274
275
276
# -- non-empty last line for flake8
Callers
8
__init__
Method · 0.85
rvs
Method · 0.85
__init__
Method · 0.85
rvs
Method · 0.85
in_domain
Method · 0.85
rvs
Method · 0.85
in_domain
Method · 0.85
rvs
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected