code: def _check_subject(
      first,
      second,
      *,
      raise_error=True,
      first_kind="class subject attribute",
      second_kind="input subject",
  ):
      """Get subject name from class."""
      if second is not None:
          _validate_type(second, "str", "subject input")
          if first is not None and first != second:
              raise ValueError(
                  f"{first_kind} ({repr(first)}) did not match "
                  f"{second_kind} ({second})"
              )
          return second
      elif first is not None:
          _validate_type(
              first,
              "str",
              f"Either {second_kind} subject or {first_kind}",
          )
          return first
      elif raise_error is True:
          raise ValueError(
              f"Neither {second_kind} subject nor {first_kind} "
              "was a string"
          )
      return None
  
imports: import numbers
  import operator
  import os
  import re
  from builtins import input
  from difflib import get_close_matches
  from importlib import import_module
  from pathlib import Path
  import numpy
  from ..defaults import HEAD_SIZE_DEFAULT, _handle_default
  from ..fixes import _compare_version, _median_complex
  from ._logging import _record_warnings, _verbose_safe_false, logger, verbose, warn
label_desc: Use image node_id 13 for calling a global function with example usage: _check_subject(first, second) and returns: None, second, first