Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def stop_container(self):
if self.container_id:
ai2thor.docker.kill_container(self.container_id)
self.container_id = None
atexit.register(lambda: ai2thor.docker.kill_container(self.container_id))
else: