code: def _base64_decode(encoded: bytes | str) -> bytes:
      # base64 lib both takes and returns bytes, we want to work with strings
      encoded_as_bytes = (
          codecs.encode(encoded, "ascii")
          if isinstance(encoded, str)
          else encoded
      )
      # put the padding back
      mod = len(encoded_as_bytes) % 4
      if mod != 0:
          encoded_as_bytes = encoded_as_bytes + (b"=" * (4 - mod))
      assert (len(encoded_as_bytes) % 4) == 0
      return base64.urlsafe_b64decode(encoded_as_bytes)
  
imports: from __future__ import annotations
  import logging
  import base64
  import calendar
  import codecs
  import datetime
  import hashlib
  import hmac
  import json
  import time
  import zlib
  from typing import TYPE_CHECKING, Any
  from ..core.types import ID
  from ..settings import settings
  from .warnings import warn
label_desc: Use image node_id 12 for calling a global function with example usage: _base64_decode(encoded) and returns: base64