<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_scheduler(self):
 """Download the scheduler.info file and perform a smart comparison with what we currently have so that we don't overwrite the last_run timestamp To do a smart comparison, we go over each entry in the server's scheduler file. If a scheduler entry is not present in the server copy, we delete it in the client copy and if the scheduler entry is present in the server copy, then we overwrite the frequency count in the client copy """

        # get the server scheduler.info file
        url = "%s/%s/%s" % (self.config['server']['server_url'],
                            "experiments", "scheduler.info")
        try:
            req = requests.get(url, proxies=self.config['proxy']['proxy'],
                               auth=self.auth,
                               verify=self.verify)
            req.raise_for_status()
        except Exception as exp:
            logging.exception("Error trying to download scheduler.info: %s" % exp)
            raise exp

        try:
            server_sched = json.loads(req.content)
        except Exception as exp:
            logging.exception("Error parsing server scheduler: %s" % exp)
            raise exp

        sched_filename = os.path.join(self.config['dirs']['experiments_dir'],
                                      'scheduler.info')
        if not os.path.exists(sched_filename):
            with open(sched_filename, 'w') as file_p:
                json.dump(server_sched, file_p, indent=2,
                      separators=(',', ': '))
            return

        client_sched = {}
        try:
            with open(sched_filename, 'r') as file_p:
                client_sched = json.load(file_p)
        except Exception as exp:
            client_sched = {}
            logging.exception("Error loading scheduler file: %s" % exp)
            logging.info("Making an empty scheduler")

        # delete any scheduled tasks as necessary
        #
        # Note: this looks ugly, but we can't modify dictionaries
        # while we iterate over them
        client_exp_keys = client_sched.keys()
        for exp in client_exp_keys:
            if exp not in server_sched:
                del client_sched[exp]
        # and update all the other frequencies
        for exp in server_sched:
            if exp in client_sched:
                client_sched[exp]['frequency'] = server_sched[exp]['frequency']
            else:
                client_sched[exp] = server_sched[exp]

        # write out the results
        with open(sched_filename, 'w') as file_p:
            json.dump(client_sched, file_p, indent=2,
                      separators=(',', ': '))