code: def _check_ptp(ptp, name, info, picks):
      """Check the PTP threhsold argument, and converts it to dict if needed."""
      _validate_type(ptp, ("numeric", dict, None))
  
      if ptp is not None and not isinstance(ptp, dict):
          if ptp < 0:
              raise ValueError(
                  f"Argument '{name}' should define a positive threshold. "
                  f"Provided: '{ptp}'."
              )
          ch_types = set(info.get_channel_types(picks))
          ptp = {ch_type: ptp for ch_type in ch_types}
      elif isinstance(ptp, dict):
          for key, value in ptp.items():
              if value < 0:
                  raise ValueError(
                      f"Argument '{name}' should define positive thresholds. "
                      f"Provided for channel type '{key}': '{value}'."
                  )
      return ptp
  
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 2 for calling a global function with example usage: _check_ptp(ptp, name, info, picks) and returns: ptp