code: def to_nbytes(arg, default=None):
      if not arg:
          arg = float("inf")
  
      if arg is True:
          arg = default
  
      if isinstance(arg, Number):
          return arg
  
      match = mem_re.match(arg)
      if match is None:
          raise ValueError(
              "Memory size could not be parsed "
              "(is your capitalisation correct?): {}".format(arg)
          )
  
      num, unit = match.groups()
  
      try:
          return float(num) * sizes[unit]
      except KeyError:  # pragma: no cover
          # Note: I don't think we can reach this
          raise ValueError(
              "Memory size unit not recognised "
              "(is your capitalisation correct?): {}".format(unit)
          )
  
imports: import re
  import warnings
  from numbers import Number
  from pathlib import Path
  from typing import Dict
  import numpy
  from imageio.core.legacy_plugin_wrapper import LegacyPlugin
  from imageio.core.util import Array
  from imageio.core.v3_plugin_api import PluginV3
  from .None import formats
  from .config import known_extensions, known_plugins
  from .core import RETURN_BYTES
  from .core.imopen import imopen
label_desc: Use image node_id 1 for calling a global function with example usage: to_nbytes(arg, default) and returns: arg, unknown