#NEWLINE# def find_in_data_path( filename ) : #NEWLINE# #INDENT# "Searches for a file within Fuel's data path.\n\n    This function loops over all paths defined in Fuel's data path and\n    returns the first path in which the file is found.\n\n    Parameters\n    ----------\n    filename : str\n        Name of the file to find.\n\n    Returns\n    -------\n    file_path : str\n        Path to the first file matching `filename` found in Fuel's\n        data path.\n\n    Raises\n    ------\n    IOError\n        If the file doesn't appear in Fuel's data path.\n\n    " #NEWLINE# for path in config . data_path : #NEWLINE# #INDENT# path = os . path . expanduser ( os . path . expandvars ( path ) ) #NEWLINE# file_path = os . path . join ( path , filename ) #NEWLINE# if os . path . isfile ( file_path ) : #NEWLINE# #INDENT# return file_path #NEWLINE# #UNINDENT# #UNINDENT# raise IOError ( "{} not found in Fuel's data path" . format ( filename ) )