def bootstrap(X, X_err=None, n=None, smooth=False):
    '\n    (smooth) bootstrap\n    bootstrap(X,Xerr,n,smooth=True)\n    X : array to be resampled\n    X_err [optional]: errors to perturb data for smooth bootstrap\n                      only provide is doing smooth bootstrapping\n    n : number of samples. Default - len(X)\n    smooth: optionally use smooth bootstrapping.\n            will be set to False if no X_err is provided\n    '
    if (X_err is None):
        smooth = False
    if (n is None):
        n = len(X)
    resample_i = np.random.randint(0, len(X), size=(n,))
    X_resample = np.asarray(X)[resample_i]
    if smooth:
        X_resample = np.random.normal(X_resample, np.asarray(X_err)[resample_i])
    return X_resample
(smooth) bootstrap
bootstrap(X,Xerr,n,smooth=True)
X : array to be resampled
X_err [optional]: errors to perturb data for smooth bootstrap
                  only provide is doing smooth bootstrapping
n : number of samples. Default - len(X)
smooth: optionally use smooth bootstrapping.
        will be set to False if no X_err is provided
def bootstrap(X, X_err=None, n=None, smooth=False):
    '\n    (smooth) bootstrap\n    bootstrap(X,Xerr,n,smooth=True)\n    X : array to be resampled\n    X_err [optional]: errors to perturb data for smooth bootstrap\n                      only provide is doing smooth bootstrapping\n    n : number of samples. Default - len(X)\n    smooth: optionally use smooth bootstrapping.\n            will be set to False if no X_err is provided\n    '
    if (X_err is None):
        smooth = False
    if (n is None):
        n = len(X)
    resample_i = np.random.randint(0, len(X), size=(n,))
    X_resample = np.asarray(X)[resample_i]
    if smooth:
        X_resample = np.random.normal(X_resample, np.asarray(X_err)[resample_i])
    return X_resample