<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_py(stream, filepath=None):
 """Load python-formatted data from a stream. Args: stream (file-like object). Returns: dict. """

    with add_sys_paths(config.package_definition_build_python_paths):
        return _load_py(stream, filepath=filepath)