code: def _check_bad_percent(bad_percent):
      """Check that bad_percent is a valid percentage and converts to float."""
      _validate_type(bad_percent, "numeric", "bad_percent")
      bad_percent = float(bad_percent)
      if not 0 <= bad_percent <= 100:
          raise ValueError(
              "Argument 'bad_percent' should define a percentage between 0% "
              f"and 100%. Provided: {bad_percent}%."
          )
      return bad_percent
  
file_path: mne-python/mne/preprocessing/_annotate_amplitude.py
imports: import numpy
  from .._fiff.pick import _picks_by_type, _picks_to_idx
  from ..annotations import Annotations, _adjust_onset_meas_date, _annotations_starts_stops
  from ..fixes import jit
  from ..io import BaseRaw
  from ..utils import _mask_to_onsets_offsets, _validate_type, logger, verbose
label_desc: Use image node_id 3 for calling a global function with example usage: _check_bad_percent(bad_percent) and returns: bad_percent