

def list_ports(self, **_params):
    ret = []
    device_id = _params.get('device_id')
    for port in self._fake_ports.values():
        if device_id:
            if (port['device_id'] in device_id):
                ret.append(device_id)
        else:
            ret.append(port)
    return {
        'ports': ret,
    }

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/api/openstack/compute/test_neutron_security_groups.py MockClient.list_ports/VarMisuse@61/84 `port`->`device_id`