code: def _signature(base_id: str, secret_key: bytes | None) -> str:
      secret_key = _ensure_bytes(secret_key)
      base_id_encoded = codecs.encode(base_id, "utf-8")
      assert secret_key is not None
      signer = hmac.new(secret_key, base_id_encoded, hashlib.sha256)
      return _base64_encode(signer.digest())
  
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 13 for calling a global function with example usage: _signature(base_id, secret_key) and returns: _base64_encode