MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / allow_pickle

Method allow_pickle

monai/utils/misc.py:569–575  ·  view source on GitHub ↗

If true, Auto3DSeg algo (de)serialization may use pickle. Default False. Pickle can execute arbitrary code on load and should only be enabled for files from trusted sources. Prefer ``algo_to_json`` / ``algo_from_json``.

()

Source from the content-addressed store, hash-verified

567
568 @staticmethod
569 def allow_pickle() -> bool:
570 """If true, Auto3DSeg algo (de)serialization may use pickle. Default False.
571
572 Pickle can execute arbitrary code on load and should only be enabled for files
573 from trusted sources. Prefer ``algo_to_json`` / ``algo_from_json``.
574 """
575 return str2bool(os.environ.get("MONAI_ALLOW_PICKLE", "0"))
576
577
578class ImageMetaKey:

Callers 1

_require_pickle_allowedFunction · 0.80

Calls 2

str2boolFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected