...
cmd = stopVirtualMachine.stopVirtualMachineCmd()
cmd.id = virtual_machine.id
apiclient.stopVirtualMachine(cmd)
OR
b.
virtual_machine.delete(apiclient)
Second way (b) is simpler and should be preferred because
There was an instance when after stopping the VM, the virtual machine state was asserted to be Stopped by listing the VM explicitly, after calling stop() method. This code was in many test cases and to remove the redundant code, verifications steps were made as a common part of stop() method. This was a huge boost in terms of maintenance of code and removing duplicate lines. For availing such advantages, always prefer method (b).
This is possible when you have an object of the base library class. In case you don't have the object, then you can use method (a).
...