nvflare.fuel.f3.cellnet.utils module

buffer_len(buffer: Any)[source]
decode_payload(message: Message, encoding_key='cn__payload_encoding')[source]
encode_payload(message: Message, encoding_key='cn__payload_encoding')[source]
format_log_message(fqcn: str, message: Message, log: str) str[source]
format_size(size, binary=False)[source]

Format size in human-readable formats like KB, MB, KiB, MiB

Parameters:
  • size – Size in bytes

  • binary – If binary, one K is 1024 bytes, otherwise 1000 bytes.

Returns: Size in human-readable format (like 10MB, 100.2GiB etc)

get_msg_header_value(m, k)[source]
make_reply(rc: str, error: str = '', body=None) Message[source]
shorten_fqcn(fqcn)[source]
shorten_string(string)[source]