def pandas_wrapper_freq(func, trim_head=None, trim_tail=None, freq_kw='freq', columns=None, *args, **kwargs):
 @wraps(func)
 def new_func(X, *args, **kwargs):
  if (not _is_using_pandas(X, None)):
   return func(X, *args, **kwargs)
  wrapper_func = _get_pandas_wrapper(X, trim_head, trim_tail, columns)
  index = X.index
  freq = index.inferred_freq
  kwargs.update({freq_kw: freq_to_period(freq)})
  ret = func(X, *args, **kwargs)
  ret = wrapper_func(ret)
  return ret
 return new_func

def pandas_wrapper_freq ( func , trim_head = None , trim_tail = None , freq_kw = 'freq' , columns = None , * args , ** kwargs ) : @ wraps ( func ) def new_func ( X , * args , ** kwargs ) : if ( not _is_using_pandas ( X , None ) ) : return func ( X , * args , ** kwargs ) wrapper_func = _get_pandas_wrapper ( X , trim_head , trim_tail , columns ) index = X . index freq = index . inferred_freq kwargs . update ( { freq_kw : freq_to_period ( freq ) } ) ret = func ( X , * args , ** kwargs ) ret = wrapper_func ( ret ) return ret return new_func
return a new function that catches the incoming x .