code: def skip_if_crdb(reason, conn=None, version=None):
      """Skip a test or test class if we are testing against CockroachDB.
  
      Can be used as a decorator for tests function or classes:
  
          @skip_if_crdb("my reason")
          class SomeUnitTest(UnitTest):
              # ...
  
      Or as a normal function if the *conn* argument is passed.
  
      If *version* is specified it should be a string such as ">= 20.1", "< 20",
      "== 20.1.3": the test will be skipped only if the version matches.
  
      """
      if not isinstance(reason, str):
          raise TypeError(
              f"reason should be a string, got {reason!r} instead"
          )
  
      if conn is not None:
          ver = crdb_version(conn)
          if ver is not None and _crdb_match_version(ver, version):
              if reason in crdb_reasons:
                  reason = (
                      "%s (https://github.com/cockroachdb/cockroach/issues/%s)"
                      % (reason, crdb_reasons[reason])
                  )
              raise unittest.SkipTest(
                  f"not supported on CockroachDB {ver}: {reason}"
              )
  
      @decorate_all_tests
      def skip_if_crdb_(f):
          @wraps(f)
          def skip_if_crdb__(self, *args, **kwargs):
              skip_if_crdb(reason, conn=self.connect(), version=version)
              return f(self, *args, **kwargs)
  
          return skip_if_crdb__
  
      return skip_if_crdb_
  
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 17 for calling a global function with example usage: skip_if_crdb(reason, conn, version) and returns: skip_if_crdb_, skip_if_crdb__, f