<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def synchronize(self):
 """Perform sync of the security groups between ML2 and EOS."""


        # Get expected ACLs and rules
        expected_acls = self.get_expected_acls()

        # Get expected interface to ACL mappings
        all_expected_bindings = self.get_expected_bindings()

        # Check that config is correct on every registered switch
        for switch_ip in self._switches.keys():
            expected_bindings = all_expected_bindings.get(switch_ip, [])
            try:
                self.synchronize_switch(switch_ip, expected_acls,
                                        expected_bindings)
            except Exception:
                LOG.exception("Failed to sync SGs for %(switch)s",
                              {'switch': switch_ip})