code: def str_to_num(str):
      # Convert str to num.
      #   12345678
      #   123e123  123 ^ 123
      #   1234K    1234 * 1000
      #   1234k    1234 * 1024
      #   1234M    1234 * 1000^2
      #   1234m    1234 * 1024^2
      #   1234G    1234 * 1000^3
      #   1234g    1234 * 1024^3
      #   1234T    1234 * 1000^4
      #   1234t    1234 * 1024^4
      #   1234P    1234 * 1000^5
      #   1234p    1234 * 1024^5
      import re
  
      m = re.match(
          r"(^[1-9][0-9]*$|^([1-9][0-9]*(\.[0-9]+)?)((e)([0-9]+)|[KkMmGgTtPp]))$",
          str,
      )
      print(m)
      if m:
          if m.group(4):
              if m.group(5):
                  return int(float(m.group(2)) ** int(m.group(6)))
              else:
                  return int(
                      float(m.group(2))
                      * {
                          "K": 1000,
                          "k": 1024,
                          "M": 1000**2,
                          "m": 1024**2,
                          "G": 1000**3,
                          "g": 1024**3,
                          "T": 1000**4,
                          "t": 1024**4,
                          "P": 1000**5,
                          "p": 1024**5,
                      }[m.group(4)]
                  )
          else:
              return int(m.group(1))
      else:
          return -1
  
imports: import os
  import re
  import timeit
  from contextlib import contextmanager
  import nnabla
  import nnabla.utils.callback
  import numpy
  from nnabla.config import nnabla_config
  from nnabla.logger import logger
  from nnabla.utils import nnabla_pb2
  from nnabla.utils.communicator_util import current_communicator
  from nnabla.utils.get_file_handle import get_file_handle_save, get_decorated_file_loader, load_files
  from contextlib import contextmanager
  import nnabla.logger
  from nnabla.lms import SwapInOutScheduler
label_desc: Use image node_id 2 for calling a global function with example usage: str_to_num(str) and returns: unknown, int, int, int