code: def is_lock_not_available_error(error: OperationalError):
      """Check if the Error is about not being able to acquire lock."""
      # DB specific error codes:
      # Postgres: 55P03
      # MySQL: 3572, 'Statement aborted because lock(s) could not be acquired immediately and NOWAIT
      #               is set.'
      # MySQL: 1205, 'Lock wait timeout exceeded; try restarting transaction
      #              (when NOWAIT isn't available)
      db_err_code = (
          getattr(error.orig, "pgcode", None) or error.orig.args[0]
      )
  
      # We could test if error.orig is an instance of
      # psycopg2.errors.LockNotAvailable/_mysql_exceptions.OperationalError, but that involves
      # importing it. This doesn't
      if db_err_code in ("55P03", 1205, 3572):
          return True
      return False
  
imports: from __future__ import annotations
  import contextlib
  import copy
  import datetime
  import json
  import logging
  from typing import TYPE_CHECKING, Any, Generator, Iterable, overload
  from dateutil import relativedelta
  from sqlalchemy import TIMESTAMP, PickleType, event, nullsfirst, tuple_
  from sqlalchemy.dialects import mysql
  from sqlalchemy.types import JSON, Text, TypeDecorator
  from airflow.configuration import conf
  from airflow.serialization.enums import Encoding
  from airflow.utils.timezone import make_naive, utc
label_desc: Use image node_id 9 for calling a global function with example usage: is_lock_not_available_error(error) and returns: False, True