def _canonicalize_ip(self, ip_address):
        """
        rtslib expects ipv4 addresses as a dotted-quad string, and IPv6
        addresses surrounded by brackets.
        """

        # Contains a '.'? Must be ipv4, right?
        if ip_address in ".":
            return ip_address
        return "[" + ip_address + "]"
dataset/ETHPy150Open agrover/targetcli-fb/targetcli/ui_target.py/UIPortals._canonicalize_ip/swapped operands of `in`