code: def _to_samples(filter_length, sfreq, phase, fir_design):
      _validate_type(filter_length, (str, "int-like"), "filter_length")
      if isinstance(filter_length, str):
          filter_length = filter_length.lower()
          err_msg = (
              "filter_length, if a string, must be a "
              'human-readable time, e.g. "10s", or "auto", not '
              '"%s"' % filter_length
          )
          if filter_length.lower().endswith("ms"):
              mult_fact = 1e-3
              filter_length = filter_length[:-2]
          elif filter_length[-1].lower() == "s":
              mult_fact = 1
              filter_length = filter_length[:-1]
          else:
              raise ValueError(err_msg)
          # now get the number
          try:
              filter_length = float(filter_length)
          except ValueError:
              raise ValueError(err_msg)
          filter_length = max(
              int(np.ceil(filter_length * mult_fact * sfreq)), 1
          )
          if fir_design == "firwin":
              filter_length += (filter_length - 1) % 2
      filter_length = _ensure_int(filter_length, "filter_length")
      return filter_length
  
imports: from collections import Counter
  from copy import deepcopy
  from functools import partial
  from math import gcd
  import numpy
  from scipy import fft, signal
  from scipy.stats import f
  from ._fiff.pick import _picks_to_idx
  from ._ola import _COLA
  from .cuda import _fft_multiply_repeated, _fft_resample, _setup_cuda_fft_multiply_repeated, _setup_cuda_fft_resample, _smart_pad
  from .parallel import parallel_func
  from .utils import _check_option, _check_preload, _ensure_int, _pl, _validate_type, logger, sum_squared, verbose, warn
label_desc: Use image node_id 30 for calling a global function with example usage: _to_samples(filter_length, sfreq, phase, fir_design) and returns: filter_length