code: def bytes_to_readable_str(num_bytes, include_b=False):
      """Generate a human-readable string representing number of bytes.
  
      The units B, kB, MB and GB are used.
  
      Args:
        num_bytes: (`int` or None) Number of bytes.
        include_b: (`bool`) Include the letter B at the end of the unit.
  
      Returns:
        (`str`) A string representing the number of bytes in a human-readable way,
          including a unit at the end.
      """
  
      if num_bytes is None:
          return str(num_bytes)
      if num_bytes < 1024:
          result = "%d" % num_bytes
      elif num_bytes < 1048576:
          result = "%.2fk" % (num_bytes / float(1 << 10))
      elif num_bytes < 1073741824:
          result = "%.2fM" % (num_bytes / float(1 << 20))
      else:
          result = "%.2fG" % (num_bytes / float(1 << 30))
  
      if include_b:
          result += "B"
      return result
  
file_path: hub/tensorflow_hub/tf_utils.py
imports: import os
  import time
  import uuid
  from absl import logging
  import tensorflow
label_desc: Use image node_id 6 for calling a global function with example usage: bytes_to_readable_str(num_bytes, include_b) and returns: result, str