Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def deserialize(code):
data = cloudpickle.loads(base64.b64decode(code))
return data
def loads_fn(fn_bytes: bytes) -> Callable:
fn_bytes_hash = hash(fn_bytes)
try:
fn = _fn_load_cache[fn_bytes_hash]
except KeyError:
fn = cloudpickle.loads(fn_bytes)
_fn_load_cache[fn_bytes_hash] = fn
return fn