code: def _clean_names(names, remove_whitespace=False, before_dash=True):
      """Remove white-space on topo matching.
  
      This function handles different naming
      conventions for old VS new VectorView systems (`remove_whitespace`).
      Also it allows to remove system specific parts in CTF channel names
      (`before_dash`).
  
      Usage
      -----
      # for new VectorView (only inside layout)
      ch_names = _clean_names(epochs.ch_names, remove_whitespace=True)
  
      # for CTF
      ch_names = _clean_names(epochs.ch_names, before_dash=True)
  
      """
      cleaned = []
      for name in names:
          if " " in name and remove_whitespace:
              name = name.replace(" ", "")
          if "-" in name and before_dash:
              name = name.split("-")[0]
          if name.endswith("_v"):
              name = name[:-2]
          cleaned.append(name)
  
      return cleaned
  
imports: import fnmatch
  import gc
  import hashlib
  import inspect
  import os
  import subprocess
  import sys
  import traceback
  import weakref
  from contextlib import ExitStack, contextmanager
  from importlib.resources import files
  from math import log
  from queue import Empty, Queue
  from string import Formatter
  from textwrap import dedent
  from threading import Thread
  import numpy
  from decorator import FunctionMaker
  from ._logging import logger, verbose, warn
  from .check import _check_option, _validate_type
label_desc: Use image node_id 9 for calling a global function with example usage: _clean_names(names, remove_whitespace, before_dash) and returns: cleaned