code: def format_memory(nbytes: int) -> str:
      """Returns a formatted memory size string."""
      KB = 1024
      MB = 1024 * KB
      GB = 1024 * MB
      if abs(nbytes) >= GB:
          return "{:.2f} Gb".format(nbytes * 1.0 / GB)
      elif abs(nbytes) >= MB:
          return "{:.2f} Mb".format(nbytes * 1.0 / MB)
      elif abs(nbytes) >= KB:
          return "{:.2f} Kb".format(nbytes * 1.0 / KB)
      else:
          return str(nbytes) + " b"
  
imports: import functools
  from collections import OrderedDict, defaultdict, namedtuple
  from typing import Any, List, NamedTuple, Optional, Tuple
  import torch
  import torch.profiler
label_desc: Use image node_id 8 for calling a global function with example usage: format_memory(nbytes) and returns: str, str, str, unknown