code: def _cleanup_resources(self, initialized_resources):
          
  
          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)
docs: Cleanup all resources that we own that are open.