<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _cleanup_resources(self, initialized_resources):
 """Cleanup all resources that we own that are open."""


        cleanup_errors = []

        # Make sure we clean up all resources that we can and don't error out at the
        # first one.
        for name, res in initialized_resources.items():
            try:
                if res.opened:
                    res.close()
            except Exception:
                _type, value, traceback = sys.exc_info()
                cleanup_errors.append((name, value, traceback))

        if len(cleanup_errors) > 0:
            raise RecipeResourceManagementError(operation="resource cleanup", errors=cleanup_errors)