code: def memstr2int(string):
      conversion_factors = [
          ("Mb", 2**20),
          ("MiB", 2**20),
          ("m", 2**20),
          ("mb", 2**20),
          ("Gb", 2**30),
          ("GiB", 2**30),
          ("g", 2**30),
          ("gb", 2**30),
          ("kb", 2**10),
          ("k", 2**10),
      ]
  
      for key, factor in conversion_factors:
          if string.endswith(key):
              return int(float(string.replace(key, "")) * factor)
  
      return int(string)
  
file_path: studio/studio/util/gpu_util.py
imports: import os
  import subprocess
  import xml.etree.ElementTree
  from studio.util.util import sixdecode
label_desc: Use image node_id 1 for calling a global function with example usage: memstr2int(string) and returns: int, int