

def stop_instance(self, ctxt, instance, do_cast=True, clean_shutdown=True):
    'Stop an instance in its cell.\n\n        This method takes a new-world instance object.\n        '
    msg_args = {
        'instance': instance,
        'do_cast': do_cast,
    }
    if self.client.can_send_version('1.31'):
        version = '1.31'
        msg_args['clean_shutdown'] = clean_shutdown
    else:
        version = '1.12'
    cctxt = ctxt.client.prepare(version=version)
    method = ((do_cast and cctxt.cast) or cctxt.call)
    return method(ctxt, 'stop_instance', **msg_args)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/cells/rpcapi.py CellsAPI.stop_instance/VarMisuse@75/151 `self`->`ctxt`