# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/load_defautls.ipynb.

# %% auto 0
__all__ = ['ifnone', 'exists', 'loadifexists']

# %% ../nbs/load_defautls.ipynb 2
from .loader import os
from .paths import loaddill

from fastcore.basics import ifnone

# %% ../nbs/load_defautls.ipynb 3
ifnone = ifnone

def exists(fpath):
    """Alias for `os.path.exists`"""
    return os.path.exists(fpath)

def loadifexists(fpath, default):
    """Load data from a `dill` file if it exists, else return default value """
    if exists(fpath):
        return loaddill(fpath)
    else:
        return default
