List the overlays in the dataset.
765142
def ls(dataset_uri):
    
    dataset = dtoolcore.DataSet.from_uri(dataset_uri)
    for overlay_name in dataset.list_overlay_names():
        click.secho(overlay_name)
130628
def plot_many(self, datalist, side='left', title=None,
                  xlabel=None, ylabel=None, **kws):
        
        def unpack_tracedata(tdat, **kws):
            if (isinstance(tdat, dict) and
                'xdata' in tdat and 'ydata' in tdat):
                xdata = tdat.pop('xdata')
                ydata = tdat.pop('ydata')
                out = kws
                out.update(tdat)
            elif isinstance(tdat, (list, tuple)):
                out = kws
                xdata = tdat[0]
                ydata = tdat[1]
            return (xdata, ydata, out)

        opts = dict(side=side, title=title, xlabel=xlabel, ylabel=ylabel,
                    delay_draw=True)
        opts.update(kws)
        x0, y0, opts = unpack_tracedata(datalist[0], **opts)

        self.plot(x0, y0, **opts)

        for dat in datalist[1:]:
            x, y, opts = unpack_tracedata(dat, delay_draw=True)
            self.oplot(x, y, **opts)

        conf = self.conf
        if conf.show_legend:
            conf.draw_legend()
        conf.relabel()
        self.draw()
        self.canvas.Refresh()
545784
def grid_items(self):
        
        if list(self.keys()) == []:  return {}
        cols = self._max_cols
        return {(idx // cols, idx % cols): (key, item)
                for idx, (key, item) in enumerate(self.data.items())}
1099600
def data_children(self) -> List["DataNode"]:
        """"""
        res = []
        for child in self.children:
            if isinstance(child, DataNode):
                res.append(child)
            elif not isinstance(child, SchemaTreeNode):
                res.extend(child.data_children())
        return res
1219264
def __datasets_desc():
    """"""
    datasets = __get_data_folder_path() + 'datasets.csv'
    df = pd.read_csv(datasets)
    df = df[['Item', 'Title']]
    df.columns = ['dataset_id', 'title']
    # print('a list of the available datasets:')
    return df
661768
def listDatasets(self, dataset="", parent_dataset="", is_dataset_valid=1,
                     release_version="", pset_hash="", app_name="",
                     output_module_label="", global_tag="", processing_version=0, 
                     acquisition_era="", run_num=-1, physics_group_name="",
                     logical_file_name="", primary_ds_name="",
                     primary_ds_type="", processed_ds_name="", data_tier_name="",
                     dataset_access_type="VALID", prep_id="", create_by='', last_modified_by='', min_cdate=0, max_cdate=0,
                     min_ldate=0, max_ldate=0, cdate=0, ldate=0, detail=False, dataset_id=-1):
        
        if(logical_file_name and logical_file_name.find("%")!=-1):
            dbsExceptionHandler('dbsException-invalid-input', 'DBSDataset/listDatasets API requires \
                fullly qualified logical_file_name. NO wildcard is allowed in logical_file_name.')
        if(dataset and dataset.find("/%/%/%")!=-1):
            dataset=''
	with self.dbi.connection() as conn:
            dao = (self.datasetbrieflist, self.datasetlist)[detail]
            if dataset_access_type: dataset_access_type = dataset_access_type.upper()
            if data_tier_name: data_tier_name = data_tier_name.upper()
            #if  processing_version:  processing_version =  processing_version.upper()
            #if acquisition_era: acquisition_era = acquisition_era.upper()
            for item in dao.execute(conn, 
                                 dataset, is_dataset_valid,
                                 parent_dataset,
                                 release_version,
                                 pset_hash,
                                 app_name,
                                 output_module_label,
                                 global_tag,
                                 processing_version,
                                 acquisition_era, 
                                 run_num, physics_group_name,
                                 logical_file_name,
                                 primary_ds_name, primary_ds_type,
                                 processed_ds_name, data_tier_name,
                                 dataset_access_type, prep_id, create_by, last_modified_by, 
                                 min_cdate, max_cdate, min_ldate, max_ldate,
                                 cdate, ldate, dataset_id):
	        yield item
1104794
def ListGrrBinaries(context=None):
  """"""

  items = context.SendIteratorRequest("ListGrrBinaries", None)
  return utils.MapItemsIterator(
      lambda data: GrrBinary(data=data, context=context), items)
862540
def overlay(overlay_name, dataset_uri, item_identifier):
    
    dataset = dtoolcore.DataSet.from_uri(dataset_uri)
    if overlay_name not in dataset.list_overlay_names():
        click.secho(
            "No such overlay in dataset: {}".format(overlay_name),
            fg="red",
            err=True
        )
        sys.exit(4)
    overlay = dataset.get_overlay(overlay_name)

    try:
        click.secho(str(overlay[item_identifier]))
    except KeyError:
        click.secho(
            "No such identifier in overlay: {}".format(item_identifier),
            fg="red",
            err=True
        )
        sys.exit(5)
1179900
def asList(self):
        
        return [self._red, self._green, self._blue, self._alpha]
745183
def _get_dataset(self, dataset, name, color):
        
        global palette
        html = "{"
        html += '\t"label": "' + name + '",'
        if color is not None:
            html += '"backgroundColor": "' + color + '",\n'
        else:
            html += '"backgroundColor": ' + palette + ',\n'
        html += '"data": ' + self._format_list(dataset) + ',\n'
        html += "}"
        return html
1038750
def get_all_resources(datasets):
        # type: (List['Dataset']) -> List[hdx.data.resource.Resource]
        
        resources = []
        for dataset in datasets:
            for resource in dataset.get_resources():
                resources.append(resource)
        return resources
785149
def plot(self, overlay=True, **labels): # pragma: no cover
        ''''''
        pylab = LazyImport.pylab()
        colours = list('rgbymc')
        colours_len = len(colours)
        colours_pos = 0
        plots = len(self.groups)
        for name, series in self.groups.iteritems():
            colour = colours[colours_pos % colours_len]
            colours_pos += 1
            if not overlay:
                pylab.subplot(plots, 1, colours_pos)
            kwargs = {}
            if name in labels:
                name = labels[name]
            if name is not None:
                kwargs['label'] = name
            pylab.plot(series.dates, series.values, '%s-' % colour, **kwargs)
            if name is not None:
                pylab.legend()
        pylab.show()
1202665
def elements(self):
        """"""

        elements = []

        for el in ct:
            if isinstance(el[1], datapoint.Element.Element):
                elements.append(el[1])

        return elements
175065
def list(self, request, *args, **kwargs):
        
        return super(ServicesViewSet, self).list(request, *args, **kwargs)
1113315
def get_overlay(self):
        
        overlay = {}
        dcmlist = self.files_in_serie

        for i in range(len(dcmlist)):
            onefile = dcmlist[i]
            logger.info("reading '%s'" % onefile)
            data = self._read_file(onefile)

            if len(overlay) == 0:
                # first there is created dictionary with
                # avalible overlay indexes
                for i_overlay in range(0, 50):
                    try:
                        # overlay index
                        data2d = decode_overlay_slice(data, i_overlay)
                        # mport pdb; pdb.set_trace()
                        shp2 = data2d.shape
                        overlay[i_overlay] = np.zeros([len(dcmlist), shp2[0],
                                                       shp2[1]], dtype=np.int8)
                        overlay[i_overlay][-i - 1, :, :] = data2d

                    except Exception:
                        # exception is exceptetd. We are trying numbers 0-50
                        # logger.exception('Problem with overlay image number ' +
                        #               str(i_overlay))
                        pass

            else:
                for i_overlay in overlay.keys():
                    try:
                        data2d = decode_overlay_slice(data, i_overlay)
                        overlay[i_overlay][-i - 1, :, :] = data2d
                    except Exception:
                        logger.warning('Problem with overlay number ' +
                                       str(i_overlay))

        return overlay
621812
def offset_overlays(self, text, offset=0, run_deps=True, **kw):
        

        if run_deps and self.dependencies:
            text.overlay(self.dependencies)

        for ovlf in self.matchers[0].offset_overlays(text,
                                                     goffset=offset,
                                                     **kw):
            for ovll in self._fit_overlay_lists(text, ovlf.end,
                                                self.matchers[1:]):
                yield self._merge_ovls([ovlf] + ovll)
676356
def avail_images():
    '''
    
    '''
    response = _query('grid', 'image/list')

    ret = {}
    for item in response['list']:
        name = item['friendlyName']
        ret[name] = item

    return ret