(self, lab_only=True)
Clear the packages/extensions.
Clear the packages/extensions.
Clear the packages / extensions .
def clear_packages(self, lab_only=True):
        """Clear the packages/extensions.
        """
        data = self._data
        # Clear all dependencies
        if lab_only:
            # Clear all "@jupyterlab/" dependencies
            data['dependencies'] = _only_nonlab(data['dependencies'])
            data['resolutions'] = _only_nonlab(data['resolutions'])
            data['jupyterlab']['extensions'] = _only_nonlab(
                data['jupyterlab']['extensions'])
            data['jupyterlab']['mimeExtensions'] = _only_nonlab(
                data['jupyterlab']['mimeExtensions'])
            data['jupyterlab']['singletonPackages'] = _only_nonlab(
                data['jupyterlab']['singletonPackages'])
        else:
            data['dependencies'] = {}
            data['resolutions'] = {}
            data['jupyterlab']['extensions'] = {}
            data['jupyterlab']['mimeExtensions'] = {}
            data['jupyterlab']['singletonPackages'] = []
def clear_packages ( self , lab_only = True ) : data = self . _data # Clear all dependencies if lab_only : # Clear all "@jupyterlab/" dependencies data [ 'dependencies' ] = _only_nonlab ( data [ 'dependencies' ] ) data [ 'resolutions' ] = _only_nonlab ( data [ 'resolutions' ] ) data [ 'jupyterlab' ] [ 'extensions' ] = _only_nonlab ( data [ 'jupyterlab' ] [ 'extensions' ] ) data [ 'jupyterlab' ] [ 'mimeExtensions' ] = _only_nonlab ( data [ 'jupyterlab' ] [ 'mimeExtensions' ] ) data [ 'jupyterlab' ] [ 'singletonPackages' ] = _only_nonlab ( data [ 'jupyterlab' ] [ 'singletonPackages' ] ) else : data [ 'dependencies' ] = { } data [ 'resolutions' ] = { } data [ 'jupyterlab' ] [ 'extensions' ] = { } data [ 'jupyterlab' ] [ 'mimeExtensions' ] = { } data [ 'jupyterlab' ] [ 'singletonPackages' ] = [ ]