Load a bitmap file from the backends/images subdirectory in which the
    matplotlib library is installed. The filename parameter should not
    contain any path information as this is determined automatically.

    Returns a wx.Bitmap object
9010
def _load_bitmap(filename):
    

    basedir = os.path.join(rcParams['datapath'],'images')

    bmpFilename = os.path.normpath(os.path.join(basedir, filename))
    if not os.path.exists(bmpFilename):
        raise IOError('Could not find bitmap file "%s"; dying'%bmpFilename)

    bmp = wx.Bitmap(bmpFilename)
    return bmp
666043
def _read(self, directory, filename, session, path, name, extension, spatial, spatialReferenceID, replaceParamFile):
        
        # Assign file extension attribute to file object
        self.fileExtension = extension
        self.filename = filename

        self._load_raster_text(path)
        
        if spatial:
            # Get well known binary from the raster file using the MapKit RasterLoader
            wkbRaster = RasterLoader.grassAsciiRasterToWKB(session=session,
                                                           grassRasterPath=path,
                                                           srid=str(spatialReferenceID),
                                                           noData='0')
            self.raster = wkbRaster
693291
def loadMsbwt(self, dirName, logger):
        '''
        
        '''
        #open the file with our BWT in it
        self.dirName = dirName
        self.bwt = np.load(self.dirName+'/comp_msbwt.npy', 'r')
        
        #build auxiliary structures
        self.constructTotalCounts(logger)
        self.constructIndexing()
        self.constructFMIndex(logger)
1165697
def _load_root_directory(self):
        
        kwargs = self._req_directory(0)
        self._root_directory = Directory(api=self, **kwargs)
513582
def image_path_from_index(self, index):
        
        assert self.image_set_index is not None, "Dataset not initialized"
        name = self.image_set_index[index]
        image_file = os.path.join(self.data_path, 'JPEGImages', name + self.extension)
        assert os.path.exists(image_file), 'Path does not exist: {}'.format(image_file)
        return image_file
436906
def _load_texture(file_name, resolver):
    
    file_data = resolver.get(file_name)
    image = PIL.Image.open(util.wrap_as_stream(file_data))
    return image
341623
def load(self , filename=None, data=None):
        

        self.__load(filename=filename, data=data)
84640
def draw_capitan_score_bitmap(self, export_path: ExportPath) -> None:
        
        with Image.fromarray(self.image_data, mode='L') as image:
            image.save(export_path.get_full_path())
515247
def load(self, filename, wildcard='*', mav=None, check=True):
        ''''''
        try:
            f = open(filename, mode='r')
        except:
            print("Failed to open file '%s'" % filename)
            return False
        count = 0
        changed = 0
        for line in f:
            line = line.strip()
            if not line or line[0] == "#":
                continue
            line = line.replace(',',' ')
            a = line.split()
            if len(a) != 2:
                print("Invalid line: %s" % line)
                continue
            # some parameters should not be loaded from files
            if a[0] in self.exclude_load:
                continue
            if not fnmatch.fnmatch(a[0].upper(), wildcard.upper()):
                continue
            if mav is not None:
                if check:
                    if a[0] not in self.keys():
                        print("Unknown parameter %s" % a[0])
                        continue
                    old_value = self.__getitem__(a[0])
                    if math.fabs(old_value - float(a[1])) <= self.mindelta:
                        count += 1
                        continue
                    if self.mavset(mav, a[0], a[1]):
                        print("changed %s from %f to %f" % (a[0], old_value, float(a[1])))
                else:
                    print("set %s to %f" % (a[0], float(a[1])))
                    self.mavset(mav, a[0], a[1])
                changed += 1
            else:
                self.__setitem__(a[0], float(a[1]))
            count += 1
        f.close()
        if mav is not None:
            print("Loaded %u parameters from %s (changed %u)" % (count, filename, changed))
        else:
            print("Loaded %u parameters from %s" % (count, filename))
        return True
289161
def load( self ):
        
        if self._loaded:
            return
        
        self._loaded = True
        self.setChildIndicatorPolicy(self.DontShowIndicatorWhenChildless)
        
        if not self.isFolder():
            return
        
        path = self.filepath()
        if not os.path.isdir(path):
            path = os.path.dirname(path)
        
        for name in os.listdir(path):
            # ignore 'hidden' folders
            if name.startswith('_') and not name.startswith('__'):
                continue
            
            # ignore special cases (only want modules for this)
            if '-' in name:
                continue
            
            # use the index or __init__ information
            if name in ('index.html', '__init__.html'):
                self._url = 'file:///%s/%s' % (path, name)
                continue
            
            # otherwise, load a childitem
            filepath = os.path.join(path, name)
            folder = os.path.isdir(filepath)
            XdkEntryItem(self, filepath, folder=folder)
1276877
def load_image(fname):
    
    with open(fname, "rb") as f:
        i = Image.open(fname)
        #i.load()
        return i
1018217
def OnLinkBitmap(self, event):
        """"""

        # Get file name
        wildcard = "*"
        message = _("Select bitmap for current cell")
        style = wx.OPEN | wx.CHANGE_DIR
        filepath, __ = \
            self.grid.interfaces.get_filepath_findex_from_user(wildcard,
                                                               message, style)
        try:
            bmp = wx.Bitmap(filepath)
        except TypeError:
            return

        if bmp.Size == (-1, -1):
            # Bitmap could not be read
            return

        code = "wx.Bitmap(r'{filepath}')".format(filepath=filepath)

        key = self.grid.actions.cursor
        self.grid.actions.set_code(key, code)
445820
def load_nb(cls, inline=True):
        
        import matplotlib.pyplot as plt
        backend = plt.get_backend()
        if backend not in ['agg', 'module://ipykernel.pylab.backend_inline']:
            plt.switch_backend('agg')
667778
def loadLayer(filename, name = None, provider=None):
    '''
    
    '''
    name = name or os.path.splitext(os.path.basename(filename))[0]
    if provider != 'gdal': # QGIS3 crashes if opening a raster as vector ... this needs further investigations
        qgslayer = QgsVectorLayer(filename, name, provider or "ogr")
    if provider == 'gdal' or not qgslayer.isValid():
        qgslayer = QgsRasterLayer(filename, name, provider or "gdal")
        if not qgslayer.isValid():
            raise RuntimeError('Could not load layer: ' + unicode(filename))

    return qgslayer
993742
def get_image_path(definition):
    
    path = resources_path(
        'img', 'wizard', 'keyword-subcategory-%s.svg' % definition['key'])
    if os.path.exists(path):
        return path
    else:
        return not_set_image_path
902438
public static Bitmap loadBitmapOptimized(String fileName, int limit) throws ImageLoadException {
        return loadBitmapOptimized(new FileSource(fileName), limit);
    }
261680
def browse( parent, filename = '' ):
        
        dlg = XdkWindow(parent)
        dlg.show()
        
        if ( filename ):
            dlg.loadFilename(filename)