<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_file(filename, encoding):
 """ Context manager to handle opening a gzip or text file correctly and reading all the data Args: filename (str):
 The filename to open encoding (str):
 The file encoding to use Yields: str: The string data from the file read """

    try:
        with gzip.open(filename, mode="rt") as fobj:
            yield fobj.read()
    except (OSError, IOError):
        with OPEN(filename, mode="r", encoding=encoding) as fobj:
            yield fobj.read()