code: def _get_sysrandom() -> tuple[Any, bool]:
      # Use the system PRNG for session id generation (if possible)
      # NOTE: secure random string generation implementation is adapted
      #       from the Django project. Reference:
      #       https://github.com/django/django/blob/0ed7d155635da9f79d4dd67e4889087d3673c6da/django/utils/crypto.py
      import random
  
      try:
          sysrandom = random.SystemRandom()
          using_sysrandom = True
          return sysrandom, using_sysrandom
      except NotImplementedError:
          warn(
              "A secure pseudo-random number generator is not available "
              "on your system. Falling back to Mersenne Twister."
          )
          if settings.secret_key() is None:
              warn(
                  "A secure pseudo-random number generator is not available "
                  "and no BOKEH_SECRET_KEY has been set. Setting a secret "
                  "key will mitigate the lack of a secure generator."
              )
          using_sysrandom = False
          return random, using_sysrandom
  
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 8 for calling a global function with example usage: _get_sysrandom() and returns: sysrandom,  using_sysrandom, random,  using_sysrandom