Cleanup all resources that we own that are open.
558849
def _cleanup_resources(self, initialized_resources):
        """"""

        cleanup_errors = []

        # Make sure we clean up all resources that we can and don't error out at the
        # first one.
        for name, res in initialized_resources.items():
            try:
                if res.opened:
                    res.close()
            except Exception:
                _type, value, traceback = sys.exc_info()
                cleanup_errors.append((name, value, traceback))

        if len(cleanup_errors) > 0:
            raise RecipeResourceManagementError(operation="resource cleanup", errors=cleanup_errors)
1334988
public function cleanAll()
    {
        $collections = array_keys($this->environment->all()) + array_keys($this->manifest->all());

        foreach ($collections as $collection)
        {
            $this->clean($collection);
        }
    }
74872
public function cleanup() {
		foreach ( $this->_factories as $factory ) {
			if ( $factory instanceof \WPCC\Component\Factory ) {
				$factory->deleteAll();
			}
		}
	}
69453
def clean(self):
        
        if self._initialized:
            logger.info("brace yourselves, removing %r", self.path)
            shutil.rmtree(self.path)
392390
protected function cleanUp()
    {
        $files = glob(__DIR__.DIRECTORY_SEPARATOR.'Mapping'.DIRECTORY_SEPARATOR.'{DataType,Property,Type}'.DIRECTORY_SEPARATOR.'*.php', GLOB_BRACE);
        foreach ($files as $file) {
            unlink($file);
        }
    }
1208320
def __cleanup(self):
        
# TODO: Test this.
        with self.__class__.__locker:

            while self.__read_buffer_index > 0:
                del self.__buffers[0]
                self.__read_buffer_index -= 1
592042
protected function cleanup()
    {
        // if $this->fs is an object, the Filesystem has been used, clean it up.
        if (is_object($this->fs)) {
            if ($this->fs->isDirectory($this->tempPath)) {
                $this->fs->deleteDirectory($this->tempPath, false);
            }
        }
    }
1106295
public void cleanup() throws ResourceException
   {
      for (HelloWorldConnectionImpl connection : connections)
      {
         connection.setManagedConnection(null);
      }
      connections.clear();
   }
1098027
public function removeResources ()
	{

		foreach (array_keys ($this->resources) as $name)
		{
			if (isset ($this->$name))
			{
				unset ($this->$name);
			}
		}

		unset ($this->resources);
		
	}
920355
def cleanup_repo(self):
        """"""
        if self.source and path.isdir(self.source):
            self.log.debug('Cleaning up source repo from %s', self.source)
            shutil.rmtree(self.source)
206754
protected function cleanup()
    {
        if ($this->resource) {
            proc_terminate($this->resource);
        }

        if (is_resource($this->handle)) {
            fclose($this->handle);
        }

        $this->handle   = null;
        $this->resource = null;
    }
697109
def _cleanup(self):
        '''
        
        '''
        if (hasattr(self, 'config')
           and self.config.get('support_archive')
           and os.path.exists(self.config['support_archive'])):
            self.out.warning('Terminated earlier, cleaning up')
            try:
                os.unlink(self.config['support_archive'])
            except Exception as err:
                log.debug(err)
                self.out.error('{} while cleaning up.'.format(err))
1227059
def cleanup():
    
    script_dir = os.path.dirname(__file__) if not os.path.islink(__file__) else os.path.dirname(os.readlink(__file__))
    script_dir = os.path.realpath(os.path.join(script_dir, ".."))
    shutil.rmtree(os.path.join(script_dir, "dist"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "tmp"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh", "tmp"), ignore_errors=True)
663288
def cleanup_environment():
    
    SERV.terminate()
    shutil.rmtree(TMP_PATH)
    if os.path.exists(TMP_PATH):
        os.rmdir(TMP_PATH)

    global TMP_PATH
    TMP_PATH = None
380965
@Override
    protected void cleanUp() {

        m_pageStorage = null;
        m_folderStorage = null;
        m_webAppNames = null;
        m_webappUrl = null;
        super.cleanUp();
    }
1219791
def cleanup(self):
        

        all([delete_file_or_tree(f) for f in self.to_delete])
        self.to_delete = []
122719
def cleanup(self):
        """"""
        for item in self.server_map:
            self.member_del(item, reconfig=False)
        self.server_map.clear()