def remove_local_port(self, lport):
        if self.get_datapath() is None:
            LOG.error(_LE("datapath is none"))
            return

        secgroups = lport.get_security_groups()
        if secgroups is None:
            return

        # uninstall ct table
        self._uninstall_connection_track_flows(lport)

        ip = lport.get_ip()
        for secgroup_id in secgroups:
            # uninstall associating flow
            self._uninstall_associating_flows(secgroup_id, lport)

            # update the record of aggregate addresses of ports associated
            # with this security group.
            aggregate_addresses_range = \
                self.secgroup_aggregate_addresses.get(secgroup_id)
            if aggregate_addresses_range is not None:
                new_cidr_array, added_cidr, removed_cidr = \
                    SGApp._remove_one_address(
                        aggregate_addresses_range,
                        SGApp._get_integer_value_from_address(ip)
                    )
                if len(new_cidr_array) == 0:
                    del self.secgroup_aggregate_addresses[secgroup_id]
                else:
                    self.secgroup_aggregate_addresses[secgroup_id] = \
                        new_cidr_array

                # update the flows representing those rules each of which
                # specifies this security group as its
                # parameter of remote group.
                secrules = self.remote_secgroup_ref.get(secgroup_id)
                if secrules is not None:
                    for rule_info in secrules.values():
                        self._update_security_group_rule_flows_by_addresses(
                            rule_info.security_group_id,
                            rule_info,
                            added_cidr,
                            removed_cidr
                        )

            # update the record of ports associated with this security group.
            associate_ports = \
                self.secgroup_associate_local_ports.get(secgroup_id)
            if associate_ports is not None:
                if associate_ports in lport.get_id():
                    associate_ports.remove(lport.get_id())
                    if len(associate_ports) == 0:
                        self._uninstall_security_group_flow(secgroup_id)
                        self._release_security_group_id(secgroup_id)
                        del self.secgroup_associate_local_ports[secgroup_id]
dataset/ETHPy150Open openstack/dragonflow/dragonflow/controller/sg_app.py/SGApp.remove_local_port/swapped operands of `in`