code: def _validate_two_version(old_version: str, new_version: str) -> None:
      if version.parse(old_version) > version.parse(new_version):
          raise ValueError(
              "Invalid version relationship. The deprecated version must be smaller than "
              "the removed version, but (deprecated version, removed version) = ({}, {}) are "
              "specified.".format(old_version, new_version)
          )
  
file_path: optuna/optuna/_deprecated.py
imports: import functools
  import textwrap
  from typing import Any
  from typing import Callable
  from typing import Optional
  from typing import TYPE_CHECKING
  from typing import TypeVar
  import warnings
  from packaging import version
  from optuna._experimental import _get_docstring_indent
  from optuna._experimental import _validate_version
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_two_version(old_version, new_version) without return types