def extract_data_from_file(file_location: str, parser: Callable[[str], Any]=lambda data: data, separator: str=None)-> List[Any]:
with open(file_location, '<STR_LIT:r>') as file:<EOL><INDENT>contents = file.read()<EOL><DEDENT>if separator is not None:<EOL><INDENT>raw_data = contents.split(separator)<EOL><DEDENT>else:<EOL><INDENT>raw_data = [contents]<EOL><DEDENT>extracted = []<EOL>for item in raw_data:<EOL><INDENT>parsed = parser(item)<EOL>extracted.append(parsed)<EOL><DEDENT>return extracted<EOL>
Extracts data from the file at the given location, using the given parser.
:param file_location: the location of the file to read data from
:param parser: the parser to extract data from the file
:param separator: (optional) separator for data in the file
:return: the extracted data