def _process_times(inst, use_times, n_peaks=None, few=False):
 if isinstance(use_times, string_types):
  if (use_times == 'peaks'):
   if (n_peaks is None):
    n_peaks = min((3 if few else 7), len(inst.times))
   use_times = _find_peaks(inst, n_peaks)
  elif (use_times == 'auto'):
   if (n_peaks is None):
    n_peaks = min((5 if few else 10), len(use_times))
   use_times = np.linspace(inst.times[0], inst.times[(-1)], n_peaks)
  else:
   raise ValueError("Got an unrecognized method for `times`. Only 'peaks' and 'auto' are supported (or directly passing numbers).")
 elif np.isscalar(use_times):
  use_times = [use_times]
 use_times = np.array(use_times, float)
 if (use_times.ndim != 1):
  raise ValueError(('times must be 1D, got %d dimensions' % use_times.ndim))
 if (len(use_times) > 20):
  raise RuntimeError('Too many plots requested. Please pass fewer than 20 time instants.')
 return use_times

def _process_times ( inst , use_times , n_peaks = None , few = False ) : if isinstance ( use_times , string_types ) : if ( use_times == 'peaks' ) : if ( n_peaks is None ) : n_peaks = min ( ( 3 if few else 7 ) , len ( inst . times ) ) use_times = _find_peaks ( inst , n_peaks ) elif ( use_times == 'auto' ) : if ( n_peaks is None ) : n_peaks = min ( ( 5 if few else 10 ) , len ( use_times ) ) use_times = np . linspace ( inst . times [ 0 ] , inst . times [ ( - 1 ) ] , n_peaks ) else : raise ValueError ( "Got an unrecognized method for `times`. Only 'peaks' and 'auto' are supported (or directly passing numbers)." ) elif np . isscalar ( use_times ) : use_times = [ use_times ] use_times = np . array ( use_times , float ) if ( use_times . ndim != 1 ) : raise ValueError ( ( 'times must be 1D, got %d dimensions' % use_times . ndim ) ) if ( len ( use_times ) > 20 ) : raise RuntimeError ( 'Too many plots requested. Please pass fewer than 20 time instants.' ) return use_times
helper to return a list of times for topomaps .