def ensure_timestamp(func, argname, arg):
 try:
  return pd.Timestamp(arg)
 except ValueError as e:
  raise TypeError("{func}() couldn't convert argument {argname}={arg!r} to a pandas Timestamp.\nOriginal error was: {t}: {e}".format(func=_qualified_name(func), argname=argname, arg=arg, t=_qualified_name(type(e)), e=e))

def ensure_timestamp ( func , argname , arg ) : try : return pd . Timestamp ( arg ) except ValueError as e : raise TypeError ( "{func}() couldn't convert argument {argname}={arg!r} to a pandas Timestamp.\nOriginal error was: {t}: {e}" . format ( func = _qualified_name ( func ) , argname = argname , arg = arg , t = _qualified_name ( type ( e ) ) , e = e ) )
argument preprocessor that converts the input into a pandas timestamp object .