code: def check_fname(fname, filetype, endings, endings_err=()):
      """Enforce MNE filename conventions.
  
      Parameters
      ----------
      fname : str
          Name of the file.
      filetype : str
          Type of file. e.g., ICA, Epochs etc.
      endings : tuple
          Acceptable endings for the filename.
      endings_err : tuple
          Obligatory possible endings for the filename.
      """
      _validate_type(fname, "path-like", "fname")
      fname = str(fname)
      if len(endings_err) > 0 and not fname.endswith(endings_err):
          print_endings = " or ".join(
              [", ".join(endings_err[:-1]), endings_err[-1]]
          )
          raise OSError(
              "The filename (%s) for file type %s must end with %s"
              % (fname, filetype, print_endings)
          )
      print_endings = " or ".join(
          [", ".join(endings[:-1]), endings[-1]]
      )
      if not fname.endswith(endings):
          warn(
              "This filename (%s) does not conform to MNE naming conventions. "
              "All %s files should end with %s"
              % (fname, filetype, print_endings)
          )
  
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 3 for calling a global function with example usage: check_fname(fname, filetype, endings, endings_err) without return types