code: def _crdb_match_version(version, pattern):
      if pattern is None:
          return True
  
      m = re.match(
          r"^(>|>=|<|<=|==|!=)\s*(\d+)(?:\.(\d+))?(?:\.(\d+))?$",
          pattern,
      )
      if m is None:
          raise ValueError(
              "bad crdb version pattern %r: should be 'OP MAJOR[.MINOR[.BUGFIX]]'"
              % pattern
          )
  
      ops = {
          ">": "gt",
          ">=": "ge",
          "<": "lt",
          "<=": "le",
          "==": "eq",
          "!=": "ne",
      }
      op = getattr(operator, ops[m.group(1)])
      ref = (
          int(m.group(2)) * 10000
          + int(m.group(3) or 0) * 100
          + int(m.group(4) or 0)
      )
      return op(version, ref)
  
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 18 for calling a global function with example usage: _crdb_match_version(version, pattern) and returns: op, True