<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sync(self, vault_client, opt):
 """Synchronizes the context to the Vault server. This has the effect of updating every resource which is in the context and has changes pending."""

        active_mounts = []
        for audit_log in self.logs():
            audit_log.sync(vault_client)

        # Handle policies only on the first pass. This allows us
        # to ensure that ACL's are in place prior to actually
        # making any changes.
        not_policies = self.sync_policies(vault_client)
        # Handle auth wrapper resources on the next path. The resources
        # may update a path on their own. They may also provide mount
        # tuning information.
        not_auth = self.sync_auth(vault_client, not_policies)
        # Handle mounts only on the next pass. This allows us to
        # ensure that everything is in order prior to actually
        # provisioning secrets. Note we handle removals before
        # anything else, allowing us to address mount conflicts.
        active_mounts, not_mounts = self.sync_mounts(active_mounts,
                                                     not_auth,
                                                     vault_client)
        # Now handle everything else. If "best practices" are being
        # adhered to then every generic mountpoint should exist by now.
        # We handle "child" resources after the first batch
        sorted_resources = sorted(not_mounts, key=childless_first)
        for resource in sorted_resources:
            resource.sync(vault_client)

        for mount in self.mounts():
            if not find_backend(mount.path, active_mounts):
                mount.unmount(vault_client)

        if opt.remove_unknown:
            self.prune(vault_client)