original_docstring: 
          Clean up this host, including removing any containers is created.  This
          is necessary especially for Docker-in-Docker so we don't leave dangling
          volumes.
          :return:
          
docstring: Clean up this host, including removing any containers is created.  This
  is necessary especially for Docker-in-Docker so we don't leave dangling
  volumes.
docstring_tokens: Clean up this host including removing any containers is created . This is necessary especially for Docker - in - Docker so we don ' t leave dangling volumes .
code: def cleanup(self):
          """
          Clean up this host, including removing any containers is created.  This
          is necessary especially for Docker-in-Docker so we don't leave dangling
          volumes.
          :return:
          """
          if self.dind:
              # For Docker-in-Docker, we need to remove all containers and
              # all images...
              self.remove_containers()
              self.remove_images()
  
              # ...and the outer container for DinD.
              docker.rm("-f", self.name, _ok_code=[0, 1])
          else:
              # For non Docker-in-Docker, we can only remove the containers we
              # created - so remove the workloads and the calico node.
              self.remove_workloads()
              docker.rm("-f", "calico-node", _ok_code=[0, 1])
  
          self._cleaned = True
code_tokens: def cleanup ( self ) : if self . dind : self . remove_containers ( ) self . remove_images ( ) docker . rm ( "-f" , self . name , _ok_code = [ 0 , 1 ] ) else : self . remove_workloads ( ) docker . rm ( "-f" , "calico-node" , _ok_code = [ 0 , 1 ] ) self . _cleaned = True
short_docstring: Clean up this host, including removing any containers is created.
short_docstring_tokens: Clean up this host including removing any containers is created .
comment: """
          Clean up this host, including removing any containers is created.  This
          is necessary especially for Docker-in-Docker so we don't leave dangling
          volumes.
          :return:
          """$SEP$# For Docker-in-Docker, we need to remove all containers and$SEP$# all images...$SEP$# ...and the outer container for DinD.$SEP$# For non Docker-in-Docker, we can only remove the containers we$SEP$# created - so remove the workloads and the calico node.