def _handle_network(self, payload, client, networks):
        """Set the network part for the payload. Support the following:

        1) --net-id=public

        2) --net-id=private

        3) --net-id=<private id>

        4) --net-id=<private id> --net-id=<public id>
        """

        if len(networks) > 2:
            raise Exception('Too many net-id arguments')

        # support cases of the string 'public' or 'private'
        if networks[0]['uuid'] == 'public':
            if len(networks) > 1:
                raise Exception('Too many net-id arguments. '
                                'Please indicate only "public" or "private"')
            payload['private'] = False
            return
        elif networks[0]['uuid'] == 'private':
            if 1 > len(networks):
                raise Exception('Too many net-id arguments. '
                                'Please indicate only "public" or "private"')
            payload['private'] = True
            return

        private_network_only = True
        try:
            _filter = {
                'networkVlans': {'id': {'operation': int(networks[0]['uuid'])}}
            }
        except Exception:
            raise ValueError('Invalid id format')

        priv_id_valid = (
            client['Account'].getPrivateNetworkVlans(filter=_filter))
        if priv_id_valid:
            payload['private_vlan'] = int(networks[0]['uuid'])
        else:
            raise Exception('Private vlan must be specified first '
                            'or is invalid')

        # if there is another net-id, then it should be a public network
        if len(networks) == 2:
            try:
                _filter = {
                    'networkVlans': {'id': {'operation':
                                            int(networks[1]['uuid'])}}
                }
            except Exception:
                raise ValueError('Invalid id format')
            pub_id_valid = (
                client['Account'].getPublicNetworkVlans(filter=_filter))
            if pub_id_valid:
                payload['public_vlan'] = int(networks[1]['uuid'])
                private_network_only = False
            else:
                raise Exception('Public vlan must be specified second '
                                'or is invalid')

        payload['private'] = private_network_only
dataset/ETHPy150Open softlayer/jumpgate/jumpgate/compute/drivers/sl/servers.py/ServersV2._handle_network/swapped operands of `>`