[docs]defbytes_to_human_readable(num:float,/)->tuple[float,str]:"""Turn a float number representing a memory byte size into a human-readable format. Args: num: The number representing a memory size in bytes. Returns: A tuple with the converted number and its determined human-readable unit. """forunitin["bytes","KB","MB","GB","TB","PB","EB","ZB"]:ifabs(num)<1024.0:returnnum,unitnum/=1024.0returnround(num,2),"YB"