Retrieve analysis title header string from definitions.
425572
def analysis_title_header_element(feature, parent):
    """"""
    _ = feature, parent  # NOQA
    header = analysis_title_header['string_format']
    return header.capitalize()
1082171
def disclaimer_title_header_element(feature, parent):
    """"""
    _ = feature, parent  # NOQA
    header = disclaimer_title_header['string_format']
    return header.capitalize()
596588
def get(self, k, d=None):
        """"""

        return super(HeaderDict, self).get(k.title(), d)
242080
def _request_titles_xml() -> ET.ElementTree:
    """"""
    response = api.titles_request()
    return api.unpack_xml(response.text)
722725
def get_title(self):
        
        try:
            return extract_literal(self.meta_kwargs['title'])
        except KeyError:
            slot = self.get_slot()
            if slot is not None:
                return slot.replace('_', ' ').title()

            return None
293192
def _get_dialog_title(self):
        """"""

        title_filetype = self.filetype[0].upper() + self.filetype[1:]

        if self.filetype == "print":
            title_export = ""
        else:
            title_export = " export"

        return _("{filetype}{export} options").format(filetype=title_filetype,
                                                      export=title_export)
1261492
def extract_header(self):
        """"""
        self.log.info("Extracting the header")
        raw_header = self.raw_header = defaultdict(list)
        first_line = self.blob_file.readline()
        first_line = try_decode_string(first_line)
        self.blob_file.seek(0, 0)
        if not first_line.startswith(str('start_run')):
            self.log.warning("No header found.")
            return raw_header
        for line in iter(self.blob_file.readline, ''):
            line = try_decode_string(line)
            line = line.strip()
            try:
                tag, value = str(line).split(':')
            except ValueError:
                continue
            raw_header[tag].append(str(value).split())
            if line.startswith(str('end_event:')):
                self._record_offset()
                if self._auto_parse and 'physics' in raw_header:
                    parsers = [p[0].lower() for p in raw_header['physics']]
                    self._register_parsers(parsers)
                return raw_header
        raise ValueError("Incomplete header, no 'end_event' tag found!")
88918
def reference_title_header_element(feature, parent):
    """"""
    _ = feature, parent  # NOQA
    header = reference_title_header['string_format']
    return header.capitalize()
562162
def filename_from_headers(headers):
    
    if type(headers) == str:
        headers = headers.splitlines()
    if type(headers) == list:
        headers = dict([x.split(':', 1) for x in headers])
    cdisp = headers.get("Content-Disposition")
    if not cdisp:
        return None
    cdtype = cdisp.split(';')
    if len(cdtype) == 1:
        return None
    if cdtype[0].strip().lower() not in ('inline', 'attachment'):
        return None
    # several filename params is illegal, but just in case
    fnames = [x for x in cdtype[1:] if x.strip().startswith('filename=')]
    if len(fnames) > 1:
        return None
    name = fnames[0].split('=')[1].strip(' \t"')
    name = os.path.basename(name)
    if not name:
        return None
    return name
183458
def get_header_as_text(file_content, reference_id):
    
    res = _CONTENT_PATTERN.findall(file_content)
    if len(res) == 2:
        content = res[0]
    elif len(res) == 1:
        return ''
    else:
        raise ValueError('Unexpected <code><pre> sections: "%r"' % res)
    return _clean_html(content)
1303897
def GetFunctionText(heading, name):
        """"""
        und = '-'*len(heading)
        return r'''

%s
%s

.. autofunction:: %s

''' % (heading, und, name)
348314
def title(self) -> str:
        """"""
        title_element = _find_tag(self.head, 'title')
        if title_element:
            return title_element.textContent
        return ''
160277
def parse_multi_value_header(header_str):
    """"""
    parsed_parts = []
    if header_str:
        parts = header_str.split(',')
        for part in parts:
            match = re.search('\s*(W/)?\"?([^"]*)\"?\s*', part)
            if match is not None:
                parsed_parts.append(match.group(2))
    return parsed_parts
1269173
def extract_headers(lines, max_wrap_lines):
    
    hdrs = {}
    header_name = None

    # Track overlong headers that extend over multiple lines
    extend_lines = 0

    lines_processed = 0

    for n, line in enumerate(lines):
        if not line.strip():
            header_name = None
            continue

        match = HEADER_RE.match(line)
        if match:
            header_name, header_value = match.groups()
            header_name = header_name.strip().lower()
            extend_lines = 0

            if header_name in HEADER_MAP:
                hdrs[HEADER_MAP[header_name]] = header_value.strip()
            lines_processed = n+1
        else:
            extend_lines += 1
            if extend_lines < max_wrap_lines and header_name in HEADER_MAP:
                hdrs[HEADER_MAP[header_name]] = join_wrapped_lines(
                        [hdrs[HEADER_MAP[header_name]], line.strip()])
                lines_processed = n+1
            else:
                # no more headers found
                break

    return hdrs, lines_processed
1227159
def version_title_header_element(feature, parent):
    """"""
    _ = feature, parent  # NOQA
    header = version_title_header['string_format']
    return header.capitalize()
1072554
def _extract_header_value(line):
    

    # Skip blank lines, returning None
    if not line:
        return None

    # Attempt to split by equals sign
    halves = line.split('=')
    if len(halves) > 1:
        key = halves[0].strip()
        value = halves[1].strip()
        return {key: value}

    # Otherwise, attempt to split by colon
    else:
        halves = line.split(':')
        key = halves[0].strip()
        value = halves[1].strip()
        return {key: value}
484127
function extractHeaders(options) {
    let headers = {};
    if (options && options.headers) {
        headers = options.headers;
        delete options.headers;
    }
    return headers;
}