emat/util/filez/finding.py
def first_existing(*filenames, expanduser=True):
	"""
	Finds the first existing file among listed file names.

	Parameters
	----------
	filenames : tuple of Path-like
	expanduser : bool, default true
		Should each filename be passed through the `os.path.expanduser` function?

	Returns
	-------
	f : Path-like
		The first existing file in the list.

	Raises
	------
	FileNotFoundError
		If none of the listed file names exists

	"""
	for f in filenames:
		if expanduser:
			f = os.path.expanduser(f)
		if os.path.exists(f):
			return f
	raise FileNotFoundError('none of these files found:\n'+ '\n'.join(filenames) )

	Finds the first existing file among listed file names.

	Parameters
	----------
	filenames : tuple of Path-like
	expanduser : bool, default true
		Should each filename be passed through the `os.path.expanduser` function?

	Returns
	-------
	f : Path-like
		The first existing file in the list.

	Raises
	------
	FileNotFoundError
		If none of the listed file names exists

	
Finds the first existing file among listed file names.
Parameters



Returns

f : Path-like
The first existing file in the list.

Raises

FileNotFoundError
If none of the listed file names exists
Finds the first existing file among listed file names . Parameters Returns f : Path - like The first existing file in the list . Raises FileNotFoundError If none of the listed file names exists
def first_existing(*filenames, expanduser=True):
	for f in filenames:
		if expanduser:
			f = os.path.expanduser(f)
		if os.path.exists(f):
			return f
	raise FileNotFoundError('none of these files found:\n'+ '\n'.join(filenames) )
def first_existing ( * filenames , expanduser = True ) : for f in filenames : if expanduser : f = os . path . expanduser ( f ) if os . path . exists ( f ) : return f raise FileNotFoundError ( 'none of these files found:\n' + '\n' . join ( filenames ) )
Finds the first existing file among listed file names.
Finds the first existing file among listed file names .
"""
	Finds the first existing file among listed file names.

	Parameters
	----------
	filenames : tuple of Path-like
	expanduser : bool, default true
		Should each filename be passed through the `os.path.expanduser` function?

	Returns
	-------
	f : Path-like
		The first existing file in the list.

	Raises
	------
	FileNotFoundError
		If none of the listed file names exists

	"""
expanduser