def _check_file_exists(filename, verbose=True):
    """Test if a file exists

    Parameters
    ----------
    filename : str
        Path and filename to check
    verbose : bool
        Print message on screen if file does not exist (default True)

    Returns
    -------
    exit : bool
        True if file exists, False otherwise
    """

    try:
        with open(filename) as file:
            pass
        exist = True
    except IOError:
        if verbose:
            print('{} does not exist'.format(filename))
        exist = False
    return exist