code: def format_bytes(b: int) -> str:
      """Formats bytes into a human-readable string."""
      for i in range(1, len(_BYTE_UNITS)):
          if b < _BYTE_UNITS[i][0]:
              n = f"{b / _BYTE_UNITS[i-1][0]:.2f}"
              units = _BYTE_UNITS[i - 1][1]
              break
      else:
          n = f"{b / _BYTE_UNITS[-1][0]:.2f}"
          units = _BYTE_UNITS[-1][1]
      n = n.rstrip("0").rstrip(".")
      return f"{n}{units}"
  
file_path: tensorflow-upstream/tensorflow/tools/proto_splitter/util.py
imports: from collections.abc import Sequence
  from typing import Any, Optional, Union
  from google.protobuf import descriptor
  from google.protobuf import message
  from tensorflow.tools.proto_splitter import chunk_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: format_bytes(b) and returns: n, units