code: def only_run_db_test(item):
      if next(item.iter_markers(name="db_test"), None) and not next(
          item.iter_markers(name="non_db_test_override"), None
      ):
          # non_db_test at individual level can override the db_test set for example on module or class level
          return
      else:
          if next(item.iter_markers(name="backend"), None):
              # Also do not skip the tests marked with `backend` marker - as it is implicitly a db test
              return
          pytest.skip(
              f"The test is skipped as it is not a DB tests "
              f"and --run-db-tests-only flag is passed to pytest. {item}"
          )
  
imports: from __future__ import annotations
  import json
  import os
  import platform
  import subprocess
  import sys
  import warnings
  from contextlib import ExitStack, suppress
  from datetime import datetime, timedelta
  from pathlib import Path
  from typing import TYPE_CHECKING
  import pytest
  import time_machine
  from itsdangerous import URLSafeSerializer
label_desc: Use image node_id 20 for calling a global function with example usage: only_run_db_test(item) without return types