code: def crdb_version(conn, __crdb_version=[]):
      """
      Return the CockroachDB version if that's the db being tested, else None.
  
      Return the number as an integer similar to PQserverVersion: return
      v20.1.3 as 200103.
  
      Assume all the connections are on the same db: return a cached result on
      following calls.
  
      """
      if __crdb_version:
          return __crdb_version[0]
  
      sver = conn.info.parameter_status("crdb_version")
      if sver is None:
          __crdb_version.append(None)
      else:
          m = re.search(r"\bv(\d+)\.(\d+)\.(\d+)", sver)
          if not m:
              raise ValueError(
                  f"can't parse CockroachDB version from {sver}"
              )
  
          ver = (
              int(m.group(1)) * 10000
              + int(m.group(2)) * 100
              + int(m.group(3))
          )
          __crdb_version.append(ver)
  
      return __crdb_version[0]
  
imports: import re
  import os
  import sys
  import types
  import ctypes
  import select
  import operator
  import platform
  import unittest
  from functools import wraps
  from ctypes.util import find_library
  from io import StringIO
  from io import TextIOBase
  from importlib import reload
  import psycopg2
  import psycopg2.errors
  import psycopg2.extensions
  from .testconfig import green, dsn, repl_dsn
label_desc: Use image node_id 16 for calling a global function with example usage: crdb_version(conn, __crdb_version) and returns: __crdb_version, __crdb_version