Load the selected cmap.
15912
def _signal_load(self):
        

        # set our name
        self.set_name(str(self._combobox_cmaps.currentText()))

        # load the colormap
        self.load_colormap()

        # rebuild the interface
        self._build_gui()

        self._button_save.setEnabled(False)
130315
private void loadConfiguration() {

        CmsRpcAction<CmsGalleryConfiguration> action = new CmsRpcAction<CmsGalleryConfiguration>() {

            @Override
            public void execute() {

                start(200, false);
                m_galleryService.getAdeViewModeConfiguration(this);
            }

            @Override
            protected void onResponse(CmsGalleryConfiguration result) {

                stop(false);
                if (result.getReferencePath() == null) {
                    result.setReferencePath(CmsCoreProvider.get().getUri());
                }
                openDialog(result);

            }
        };
        if (m_dialog != null) {
            openDialog(null);
        } else {
            action.execute();
        }

    }
1086299
def _add_colorbar(ax: Axes, cmap: colors.Colormap, cmap_data: np.ndarray, norm: colors.Normalize):
    """"""
    fig = ax.get_figure()
    mappable = cm.ScalarMappable(cmap=cmap, norm=norm)
    mappable.set_array(cmap_data)   # TODO: Or what???
    fig.colorbar(mappable, ax=ax)
531709
void reload() {

        CmsRpcAction<CmsResourceStatusBean> action = new CmsRpcAction<CmsResourceStatusBean>() {

            @Override
            public void execute() {

                start(0, true);
                CmsCoreProvider.getVfsService().getResourceStatus(
                    m_structureId,
                    CmsCoreProvider.get().getLocale(),
                    m_includeTargets,
                    m_detailContentId,
                    null,
                    this);
            }

            @Override
            protected void onResponse(CmsResourceStatusBean result) {

                reinitContent(result);
            }
        };
        action.execute();
    }
172695
def load(self, **kwargs):
        """"""

        coordsys = kwargs.get('coordsys', 'CEL')
        extdir = kwargs.get('extdir', self.extdir)
        srcname = kwargs.get('srcname', None)

        self.clear()
        self.load_diffuse_srcs()

        for c in self.config['catalogs']:

            if isinstance(c, catalog.Catalog):
                self.load_existing_catalog(c)
                continue

            extname = os.path.splitext(c)[1]
            if extname != '.xml':
                self.load_fits_catalog(c, extdir=extdir, coordsys=coordsys,
                                       srcname=srcname)
            elif extname == '.xml':
                self.load_xml(c, extdir=extdir, coordsys=coordsys)
            else:
                raise Exception('Unrecognized catalog file extension: %s' % c)

        for c in self.config['sources']:

            if 'name' not in c:
                raise Exception(
                    'No name field in source dictionary:\n ' + str(c))

            self.create_source(c['name'], c, build_index=False)

        self._build_src_index()
977433
private void loadCategories() {

        CmsRpcAction<List<CmsCategoryTreeEntry>> action = new CmsRpcAction<List<CmsCategoryTreeEntry>>() {

            @Override
            public void execute() {

                start(200, true);
                CmsCoreProvider.getService().getCategoriesForSitePath(m_dialogBean.getReferenceSitePath(), this);
            }

            @Override
            protected void onResponse(List<CmsCategoryTreeEntry> result) {

                m_dialogBean.setCategories(result);
                m_handler.setCategoriesTabContent(result, new ArrayList<String>());
                m_handler.onCategoriesTabSelection();
                stop(false);
            }
        };
        action.execute();
    }
304282
def load():
    """"""
    initialize_experiment_package(os.getcwd())
    try:
        try:
            from dallinger_experiment import experiment
        except ImportError:
            from dallinger_experiment import dallinger_experiment as experiment

        classes = inspect.getmembers(experiment, inspect.isclass)
        for name, c in classes:
            if "Experiment" in c.__bases__[0].__name__:
                return c
        else:
            raise ImportError
    except ImportError:
        logger.error("Could not import experiment.")
        raise
30811
def _get_cmap(kwargs: dict) -> colors.Colormap:
    
    from matplotlib.colors import ListedColormap

    cmap = kwargs.pop("cmap", default_cmap)
    if isinstance(cmap, list):
        return ListedColormap(cmap)
    if isinstance(cmap, str):
        try:
            cmap = plt.get_cmap(cmap)
        except BaseException as exc:
            try:
                # Try to use seaborn palette
                import seaborn as sns
                sns_palette = sns.color_palette(cmap, n_colors=256)
                cmap = ListedColormap(sns_palette, name=cmap)
            except ImportError:
                raise exc
    return cmap
343288
@Override
    public void load()
    {
        if (surface == null)
        {
            surface = Graphics.createImageBuffer(map.getInTileWidth(), map.getInTileHeight(), ColorRgba.TRANSPARENT);
        }
    }
1183542
def grayify_cmap(cmap):
    
    cmap = plt.cm.get_cmap(cmap)
    colors = cmap(np.arange(cmap.N))
    # convert RGBA to perceived greyscale luminance
    # cf. http://alienryderflex.com/hsp.html
    RGB_weight = [0.299, 0.587, 0.114]
    luminance = np.sqrt(np.dot(colors[:, :3] ** 2, RGB_weight))
    colors[:, :3] = luminance[:, np.newaxis]
    return mplcolors.LinearSegmentedColormap.from_list(cmap.name + "_grayscale", colors, cmap.N)
923292
def process_cmap(cmap, ncolors=None, provider=None, categorical=False):
    
    providers_checked="matplotlib, bokeh, or colorcet" if provider is None else provider

    if isinstance(cmap, Cycle):
        palette = [rgb2hex(c) if isinstance(c, tuple) else c for c in cmap.values]
    elif isinstance(cmap, list):
        palette = cmap
    elif isinstance(cmap, basestring):
        mpl_cmaps = _list_cmaps('matplotlib')
        bk_cmaps = _list_cmaps('bokeh')
        cet_cmaps = _list_cmaps('colorcet')
        if provider=='matplotlib' or (provider is None and (cmap in mpl_cmaps or cmap.lower() in mpl_cmaps)):
            palette = mplcmap_to_palette(cmap, ncolors, categorical)
        elif provider=='bokeh' or (provider is None and (cmap in bk_cmaps or cmap.capitalize() in bk_cmaps)):
            palette = bokeh_palette_to_palette(cmap, ncolors, categorical)
        elif provider=='colorcet' or (provider is None and cmap in cet_cmaps):
            from colorcet import palette
            if cmap.endswith('_r'):
                palette = list(reversed(palette[cmap[:-2]]))
            else:
                palette = palette[cmap]
        else:
            raise ValueError("Supplied cmap %s not found among %s colormaps." %
                             (cmap,providers_checked))
    else:
        try:
            # Try processing as matplotlib colormap
            palette = mplcmap_to_palette(cmap, ncolors)
        except:
            palette = None
    if not isinstance(palette, list):
        raise TypeError("cmap argument %s expects a list, Cycle or valid %s colormap or palette."
                        % (cmap,providers_checked))
    if ncolors and len(palette) != ncolors:
        return [palette[i%len(palette)] for i in range(ncolors)]
    return palette
1124255
def load(self, size):
        """"""
        if self.exists() and self.isfile():
            return eval(open(self).read(size))
283623
public void loadAndShow() {

        CmsRpcAction<CmsRenameInfoBean> infoAction = new CmsRpcAction<CmsRenameInfoBean>() {

            @Override
            public void execute() {

                start(0, true);
                CmsCoreProvider.getVfsService().getRenameInfo(m_structureId, this);
            }

            @Override
            protected void onResponse(CmsRenameInfoBean renameInfo) {

                stop(false);
                CmsRenameView view = new CmsRenameView(renameInfo, m_renameHandler);
                for (CmsPushButton button : view.getDialogButtons()) {
                    addButton(button);
                }
                setMainContent(view);
                view.setDialog(CmsRenameDialog.this);
                center();
            }
        };
        infoAction.execute();
    }
189437
private void loadChildren() throws CmsException {

        for (CmsResource resource : new ArrayList<CmsResource>(m_knownResources)) {
            if (resource.isFolder()) {
                if (!m_mustLoadChildren.contains(resource)) {
                    continue;
                }
                List<CmsResource> children = getChildren(resource);
                for (CmsResource child : children) {
                    m_knownResources.add(child);
                    m_childMap.put(resource, child);
                }
            }
        }
    }
1358329
protected function loadMetadatas()
    {
        try {
            $this->metadatas = array();
            $em = $this->getEntityManager();
            $cmf = $em->getMetadataFactory();
            foreach ($cmf->getAllMetadata() as $metaData) {
                $this->metadatas[$metaData->getName()] = $metaData;
            }
        } catch (MappingException $e) {
            // we don't want them complaining about a src directory not being in the package.
        }
    }
454849
def load(self):
        '''
        
        '''
        response = pu.open(title='Load perspective warp', patterns=['*.h5'])
        if response is not None:
            self.warp_actor.load(response)
832215
def load(name):
        """"""
        global __tile_maps
        # Remove the current map.
        TileMapManager.unload()

        TileMapManager.active_map = __tile_maps[name]
        TileMapManager.active_map.parse_tilemap()
        TileMapManager.active_map.parse_collisions()
        TileMapManager.active_map.parse_objects()

        world = Ragnarok.get_world()
        world.add_obj(TileMapManager.active_map)

        for obj in TileMapManager.active_map.objects:
            world.add_obj(obj)