Given the first part of a slide, returns metadata associated with it.
964531
def parse_metadata(section):
  """"""
  metadata = {}
  metadata_lines = section.split('\n')
  for line in metadata_lines:
    colon_index = line.find(':')
    if colon_index != -1:
      key = line[:colon_index].strip()
      val = line[colon_index + 1:].strip()
      metadata[key] = val

  return metadata
1143181
def metaseries_description_metadata(description):
    """"""
    if not description.startswith('<MetaData>'):
        raise ValueError('invalid MetaSeries image description')

    from xml.etree import cElementTree as etree  # delayed import
    root = etree.fromstring(description)
    types = {'float': float, 'int': int,
             'bool': lambda x: asbool(x, 'on', 'off')}

    def parse(root, result):
        # recursive
        for child in root:
            attrib = child.attrib
            if not attrib:
                result[child.tag] = parse(child, {})
                continue
            if 'id' in attrib:
                i = attrib['id']
                t = attrib['type']
                v = attrib['value']
                if t in types:
                    result[i] = types[t](v)
                else:
                    result[i] = v
        return result

    adict = parse(root, {})
    if 'Description' in adict:
        adict['Description'] = adict['Description'].replace('&#13;&#10;', '\n')
    return adict
1055917
def create_summary_metadata(display_name, description):
  
  content = plugin_data_pb2.ImagePluginData(version=PROTO_VERSION)
  metadata = summary_pb2.SummaryMetadata(
      display_name=display_name,
      summary_description=description,
      plugin_data=summary_pb2.SummaryMetadata.PluginData(
          plugin_name=PLUGIN_NAME,
          content=content.SerializeToString()))
  return metadata
166823
def scanimage_metadata(self):
        """"""
        if not self.is_scanimage:
            return None
        result = {}
        try:
            framedata, roidata = read_scanimage_metadata(self._fh)
            result['FrameData'] = framedata
            result.update(roidata)
        except ValueError:
            pass
        # TODO: scanimage_artist_metadata
        try:
            result['Description'] = scanimage_description_metadata(
                self.pages[0].description)
        except Exception as exc:
            log.warning('ScanImage metadata: %s: %s',
                        exc.__class__.__name__, exc)
        return result
222279
def get_by_name(self, name, default=None):
        """"""
        for slide_layout in self:
            if slide_layout.name == name:
                return slide_layout
        return default
877940
public List<TiffObject> getMetadataList(String name) {
    List<TiffObject> l = new ArrayList<TiffObject>();
    if (metadata == null)
      createMetadataDictionary();
    if (metadata.contains(name))
      l = metadata.getList(name);
    return l;
  }
684295
def get(self, slide_id, default=None):
        
        slide = self.part.get_slide(slide_id)
        if slide is None:
            return default
        return slide
651797
def metadata():
    """"""
    with open(os.path.join(charm_dir(), 'metadata.yaml')) as md:
        return yaml.safe_load(md)
824202
def get_slide(self, slide_id):
        
        for sldId in self._element.sldIdLst:
            if sldId.id == slide_id:
                return self.related_parts[sldId.rId].slide
        return None
1152486
function get() {
      return Sizes.slideWidth * Sizes.length + Components.Gaps.grow + Components.Clones.grow;
    }
1277206
def get_ladders_metadata(session, parsed):
    """"""
    ladders = {}
    for ladder in parsed.find_all('a', href=re.compile(LADDER_URL_REGEX)):
        ladders[ladder.text] = get_ladder_metadata(session, ladder['href'])
    return ladders
1274005
def metadata(self):
        """"""
        if not self._operation.HasField("metadata"):
            return None

        return protobuf_helpers.from_any_pb(
            self._metadata_type, self._operation.metadata
        )
53949
def fluoview_metadata(self):
        """"""
        if not self.is_fluoview:
            return None
        result = {}
        page = self.pages[0]
        result.update(page.tags['MM_Header'].value)
        # TODO: read stamps from all pages
        result['Stamp'] = page.tags['MM_Stamp'].value
        # skip parsing image description; not reliable
        # try:
        #     t = fluoview_description_metadata(page.image_description)
        #     if t is not None:
        #         result['ImageDescription'] = t
        # except Exception as exc:
        #     log.warning('FluoView metadata: '
        #                 'failed to parse image description (%s)', str(exc))
        return result
1149173
def metadata(self):
        
        result = []
        for layer in self._layers:
            if layer in self._values:
                result.append({
                    'layer': layer,
                    'value': self._values[layer][1],
                    'source': self._values[layer][0],
                    'default': layer == self._layers[-1]
                })
        return result
1076849
function(n) {
		if(n >= 0 && n < this._storyslider._slides.length) {
			return this._storyslider._slides[n];
		}
		return null;
	}
6891
def slide_id(self, slide_part):
        
        for sldId in self._element.sldIdLst:
            if self.related_parts[sldId.rId] is slide_part:
                return sldId.id
        raise ValueError('matching slide_part not found')
674202
def getslide(self,slide_num):
		
		slideTrigs = self.copy()
		slideTrigs.extend(row for row in self if row.get_slide_number() == slide_num)
		return slideTrigs