

def handle(site):
    from core.models import Controller, ControllerSite, Site
    ctrl_sites = ControllerSite.objects.filter(site=site)
    existing_controllers = [cs.controller for cs in ctrl_sites]
    all_controllers = Controller.objects.all()
    for ctrl in all_controllers:
        if (ctrl not in existing_controllers):
            ctrl_site = ControllerSite(controller=ctrl, site=site)
            ctrl_site.save()

dataset/ETHPy150Open open-cloud/xos/xos/synchronizers/openstack/model_policies/model_policy_Site.py handle/original