def _file_and_exists ( val , input_files ) : return ( ( os . path . exists ( val ) and os . path . isfile ( val ) ) or val in input_files )
python if only one of two files exist
Check if an input is a file and exists .
def _file_and_exists(val, input_files):
    """Check if an input is a file and exists.

    Checks both locally (staged) and from input files (re-passed but never localized).
    """
    return ((os.path.exists(val) and os.path.isfile(val)) or
            val in input_files)