Return headerReference element of *type_* or None if not present.
189362
def get_headerReference(self, type_):
        """"""
        matching_headerReferences = self.xpath(
            "./w:headerReference[@w:type='%s']" % WD_HEADER_FOOTER.to_xml(type_)
        )
        if len(matching_headerReferences) == 0:
            return None
        return matching_headerReferences[0]
1300707
def handleHeader(self, key, value):
        """"""

        if key == 'CIMError':
            self.CIMError = urllib.parse.unquote(value)
        if key == 'PGErrorDetail':
            self.PGErrorDetail = urllib.parse.unquote(value)
19557
def get_header_example(cls, header):
        
        if header.is_array:
            result = cls.get_example_for_array(header.item)
        else:
            example_method = getattr(cls, '{}_example'.format(header.type))
            result = example_method(header.properties, header.type_format)
        return {header.name: result}
800328
def get_named_by_definition(cls, element_list, string_def):
        """"""
        try:
            return next(
                (
                    st.value
                    for st in element_list
                    if st.definition == string_def
                )
            )
        except Exception:
            return None
565483
def headerData(self, section, orientation, role=Qt.DisplayRole):
        """"""
        if role != Qt.DisplayRole:
            return to_qvariant()
        i_column = int(section)
        if orientation == Qt.Horizontal:
            headers = (self.header0, _("Type"), _("Size"), _("Value"))
            return to_qvariant( headers[i_column] )
        else:
            return to_qvariant()
389685
def unknown_source_text_element(feature, parent):
    """"""
    _ = feature, parent  # NOQA
    header = unknown_source_text['string_format']
    return header.capitalize()
523249
def headerData(self, section, orientation, role):
        """"""
        if role == Qt.TextAlignmentRole:
            if orientation == Qt.Horizontal:
                return Qt.AlignCenter | Qt.AlignBottom
            else:
                return Qt.AlignRight | Qt.AlignVCenter
        if role != Qt.DisplayRole and role != Qt.ToolTipRole:
            return None
        if self.axis == 1 and self._shape[1] <= 1:
            return None
        orient_axis = 0 if orientation == Qt.Horizontal else 1
        if self.model.header_shape[orient_axis] > 1:
            header = section
        else:
            header = self.model.header(self.axis, section)

            # Don't perform any conversion on strings
            # because it leads to differences between
            # the data present in the dataframe and
            # what is shown by Spyder
            if not is_type_text_string(header):
                header = to_text_string(header)

        return header
665310
def headerData(self, section, orientation, role):
        
        if role == QtCore.Qt.DisplayRole:
            if orientation == Qt.Horizontal:
                return self.attrNames[section]
            else:
                return str(section)
        else:
            return None
120506
def index(self, header):
        
        rv = self.find(header)
        if rv < 0:
            raise IndexError(header)
        return rv
864858
def _prior_headerfooter(self):
        """"""
        preceding_sectPr = self._sectPr.preceding_sectPr
        return (
            None if preceding_sectPr is None
            else _Header(preceding_sectPr, self._document_part, self._hdrftr_index)
        )
1209363
def _definition(self):
        """"""
        headerReference = self._sectPr.get_headerReference(self._hdrftr_index)
        return self._document_part.header_part(headerReference.rId)
1206516
def find(self, header):
        
        header = header.lower()
        for idx, item in enumerate(self._headers):
            if item.lower() == header:
                return idx
        return -1
800153
def subject(self) -> Optional[UnstructuredHeader]:
        """"""
        try:
            return cast(UnstructuredHeader, self[b'subject'][0])
        except (KeyError, IndexError):
            return None
44324
def get_referencer(registry):
    
    # Argument might be a config or request
    regis = getattr(registry, 'registry', None)
    if regis is None:
        regis = registry
    return regis.queryUtility(IReferencer)
208013
def _read_header(self):
        
        if not self.filename or self.header_types:
            return
        rows = csv.reader(open(self.filename))
        #header = rows.next()
        header = next(rows)
        self.header_types = {} # {attr_name:type}
        self._class_attr_name = None
        self.header_order = [] # [attr_name,...]
        for el in header:
            matches = ATTR_HEADER_PATTERN.findall(el)
            assert matches, "Invalid header element: %s" % (el,)
            el_name, el_type, el_mode = matches[0]
            el_name = el_name.strip()
            self.header_order.append(el_name)
            self.header_types[el_name] = el_type
            if el_mode == ATTR_MODE_CLASS:
                assert self._class_attr_name is None, \
                    "Multiple class attributes are not supported."
                self._class_attr_name = el_name
            else:
                assert self.header_types[el_name] != ATTR_TYPE_CONTINUOUS, \
                    "Non-class continuous attributes are not supported."
        assert self._class_attr_name, "A class attribute must be specified."
702901
def get_ioos_def(self, ident, elem_type, ont):
        """"""
        if elem_type == "identifier":
            getter_fn = self.system.get_identifiers_by_name
        elif elem_type == "classifier":
            getter_fn = self.system.get_classifiers_by_name
        else:
            raise ValueError("Unknown element type '{}'".format(elem_type))
        return DescribeSensor.get_named_by_definition(
            getter_fn(ident), urljoin(ont, ident)
        )
1359309
def p_type_ref(self, p):
        ''
        p[0] = AstTypeRef(
            path=self.path,
            lineno=p.lineno(1),
            lexpos=p.lexpos(1),
            name=p[1],
            args=p[2],
            nullable=p[3],
            ns=None,
        )