def _validate_pad(padtype, padlen, x, axis, ntaps):
 if (padtype not in ['even', 'odd', 'constant', None]):
  raise ValueError(("Unknown value '%s' given to padtype.  padtype must be 'even', 'odd', 'constant', or None." % padtype))
 if (padtype is None):
  padlen = 0
 if (padlen is None):
  edge = (ntaps * 3)
 else:
  edge = padlen
 if (x.shape[axis] <= edge):
  raise ValueError(('The length of the input vector x must be at least padlen, which is %d.' % edge))
 if ((padtype is not None) and (edge > 0)):
  if (padtype == 'even'):
   ext = even_ext(x, edge, axis=axis)
  elif (padtype == 'odd'):
   ext = odd_ext(x, edge, axis=axis)
  else:
   ext = const_ext(x, edge, axis=axis)
 else:
  ext = x
 return (edge, ext)

def _validate_pad ( padtype , padlen , x , axis , ntaps ) : if ( padtype not in [ 'even' , 'odd' , 'constant' , None ] ) : raise ValueError ( ( "Unknown value '%s' given to padtype.  padtype must be 'even', 'odd', 'constant', or None." % padtype ) ) if ( padtype is None ) : padlen = 0 if ( padlen is None ) : edge = ( ntaps * 3 ) else : edge = padlen if ( x . shape [ axis ] <= edge ) : raise ValueError ( ( 'The length of the input vector x must be at least padlen, which is %d.' % edge ) ) if ( ( padtype is not None ) and ( edge > 0 ) ) : if ( padtype == 'even' ) : ext = even_ext ( x , edge , axis = axis ) elif ( padtype == 'odd' ) : ext = odd_ext ( x , edge , axis = axis ) else : ext = const_ext ( x , edge , axis = axis ) else : ext = x return ( edge , ext )
helper to validate padding for filtfilt .