<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fetch(self, vault_client):
 """Updates the context based on the contents of the Vault server. Note that some resources can not be read after they have been written to and it is up to those classes to handle that case properly."""

        backends = [(self.mounts, SecretBackend),
                    (self.auths, AuthBackend),
                    (self.logs, LogBackend)]
        for b_list, b_class in backends:
            backend_list = b_list()
            if backend_list:
                existing = getattr(vault_client, b_class.list_fun)()
                for backend in backend_list:
                    backend.fetch(vault_client, existing)

        for rsc in self.resources():
            if issubclass(type(rsc), Secret):
                nc_exists = (rsc.mount != 'cubbyhole' and
                             find_backend(rsc.mount, self._mounts).existing)
                if nc_exists or rsc.mount == 'cubbyhole':
                    rsc.fetch(vault_client)
            elif issubclass(type(rsc), Auth):
                if find_backend(rsc.mount, self._auths).existing:
                    rsc.fetch(vault_client)
            elif issubclass(type(rsc), Mount):
                rsc.existing = find_backend(rsc.mount,
                                            self._mounts).existing
            else:
                rsc.fetch(vault_client)

        return self