MCPcopy Index your code
hub / github.com/STIXProject/python-stix / has_value

Function has_value

stix/utils/__init__.py:280–285  ·  view source on GitHub ↗

Returns ``True`` if `var` is not ``None`` and not empty.

(var)

Source from the content-addressed store, hash-verified

278
279
280def has_value(var):
281 """Returns ``True`` if `var` is not ``None`` and not empty."""
282 if var is None:
283 return
284
285 return bool(var) or (var in (False, 0))
286
287
288@silence_warnings

Callers 1

to_dictFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected