def _get_file_mode(filename, default='readonly'):

    mode = default
    closed = fileobj_closed(filename)

    fmode = fileobj_mode(filename)
    if fmode is not None:
        mode = FILE_MODES.get(fmode)
        if mode is None:
            raise IOError(
                "File mode of the input file object (%r) cannot be used to "
                "read/write FITS files." % fmode)

    return mode, closed
If the last ``Snapshot`` in the ``list``\ s passed to
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/convenience.py/_get_file_mode--crossover with--dataset/ETHPy150Open ClusterHQ/flocker/flocker/volume/test/test_filesystems_zfs.py/LatestCommonSnapshotTests.test_last_snapshot_common