MCPcopy Create free account
hub / github.com/dask/dask / serialize

Function serialize

dask/config.py:847–863  ·  view source on GitHub ↗

Serialize config data into a string. Typically used to pass config via the ``DASK_INTERNAL_INHERIT_CONFIG`` environment variable. Parameters ---------- data: json-serializable object The data to serialize Returns ------- serialized_data: str The seriali

(data: Any)

Source from the content-addressed store, hash-verified

845
846
847def serialize(data: Any) -> str:
848 """Serialize config data into a string.
849
850 Typically used to pass config via the ``DASK_INTERNAL_INHERIT_CONFIG`` environment variable.
851
852 Parameters
853 ----------
854 data: json-serializable object
855 The data to serialize
856
857 Returns
858 -------
859 serialized_data: str
860 The serialized data as a string
861
862 """
863 return base64.urlsafe_b64encode(json.dumps(data).encode()).decode()
864
865
866def deserialize(data: str) -> Any:

Callers 2

test_config_inheritanceFunction · 0.90

Calls

no outgoing calls

Tested by 2

test_config_inheritanceFunction · 0.72