<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(stream, container=dict, comment_markers=_COMMENT_MARKERS):
 """ Load and parse Java properties file given as a fiel or file-like object 'stream'. :param stream: A file or file like object of Java properties files :param container: Factory function to create a dict-like object to store properties :param comment_markers: Comment markers, e.g. '#' (hash) :return: Dict-like object holding properties {} {} {} {'calendar.japanese.type': ''} {'calendar.japanese.type': 'LocalGregorianCalendar'} {'key': 'a:b'} {'application/postscript': 'x=Postscript File;y=.eps,.ps'} """

    ret = container()
    prev = ""

    for line in stream.readlines():
        line = _pre_process_line(prev + line.strip().rstrip(),
                                 comment_markers)
        # I don't think later case may happen but just in case.
        if line is None or not line:
            continue

        prev = ""  # re-initialize for later use.

        if line.endswith("\\"):
            prev += line.rstrip(" \\")
            continue

        (key, val) = _parseline(line)
        if key is None:
            LOGGER.warning("Failed to parse the line: %s", line)
            continue

        ret[key] = unescape(val)

    return ret