docs: def ensure_backend(resource, backend, backends, opt, managed=True):
      """Ensure the backend for a resource is properly in context"""
      existing_mount = find_backend(resource.mount, backends)
      if not existing_mount:
          new_mount = backend(resource, opt, managed=managed)
          backends.append(new_mount)
          return new_mount
  
      return existing_mount