'Called to stop the script from running.  This also deletes the
script.
Args:
kill (bool, optional): - Stop the script without
calling any relevant script hooks.
Returns:
result (int): 0 if the script failed to stop, 1 otherwise.
Used in counting.'

def stop(self, kill=False):

    if (not kill):
        try:
            self.at_stop()
        except Exception:
            logger.log_trace()
    self._stop_task()
    try:
        self.delete()
    except AssertionError:
        logger.log_trace()
        return 0
    except ObjectDoesNotExist:
        return 0
    return 1
