Get a formatted infographic header sentence for an impact function.

    For instance:
    * infographic_header_element('flood') -> 'Estimated impact of a flood'
320530
def infographic_header_element(impact_function_name, feature, parent):
    
    _ = feature, parent  # NOQA
    string_format = infographic_header['string_format']
    if impact_function_name:
        header = string_format.format(
            impact_function_name=impact_function_name)
        return header.capitalize()
    return None
88918
def reference_title_header_element(feature, parent):
    """"""
    _ = feature, parent  # NOQA
    header = reference_title_header['string_format']
    return header.capitalize()
88961
def source_title_header_element(feature, parent):
    """"""
    _ = feature, parent  # NOQA
    header = source_title_header['string_format']
    return header.capitalize()
274117
def get_help(self, ctx):
        
        formatter = ctx.make_formatter()
        self.format_help(ctx, formatter)
        return formatter.getvalue().rstrip('\n')
582560
def ready_message():
    
    title = m.Heading(tr('Ready'), **PROGRESS_UPDATE_STYLE)
    notes = m.Paragraph(
        tr('You can now proceed to run your analysis by clicking the '),
        m.EmphasizedText(tr('Run'), **KEYWORD_STYLE),
        tr('button.'))
    message = m.Message(LOGO_ELEMENT, title, notes)
    return message
1005996
def get_header(file,**kw):
    '''
    '''
    if type(file) == str:
        #if called with a filename, recall with opened file.
        if test(kw, "gzip") and kw['gzip'] == 'guess':
            kw['gzip'] = re.search(r'\.gz$', file) is not None;
        if test(kw, "gzip"):
            with gzip.open(file,'rb') as f:
                return get_header(f,**kw);
        else:
            with open(file,'rb') as f:
                return get_header(f,**kw);
    if test(kw, "size"):
        size = file.tell();
    header = get_dict(
        file,'iiss',
        ['dump_type','dversion', 'title','revision']);
    if header['dump_type'] == 1:
        #this is a particle dump file
        d = get_dict(file,
            'fiiii',
            ['timestamp','geometry','sflagsx','sflagsy','sflagsz']);
        header.update(d);
        #reading params
        
        header['num_species'] = get_int(file);
        header['num_particles'] = get_int(file);
        nparams = get_int(file);
        units = [get_str(file) for i in range(nparams)];
        labels = ['q', 'x', 'y', 'z', 'ux', 'uy', 'uz']
        if nparams == 7:
            pass;
        elif nparams == 8 or nparams == 11:
            labels += ['H']
        elif nparams == 10 or nparams == 11:
            labels += ['xi', 'yi', 'zi'];
        else:
            raise NotImplementedError(
                'Not implemented for these number of parameters:{}.'.format(n));
        header['params'] = list(zip(labels,units));
    elif header['dump_type'] == 2 or header['dump_type'] == 3:
        #this is a fields file or a scalars file.
        d = get_dict(file,'fii',['timestamp','geometry','domains']);
        header.update(d);
        #reading quantities
        n = get_int(file);
        names=[get_str(file) for i in range(n)];
        units=[get_str(file) for i in range(n)];
        header['quantities'] = list(zip(names,units));
    elif header['dump_type'] == 6:
        #this is a particle movie file
        d = get_dict(file,
            'iiii',
            ['geometry','sflagsx','sflagsy','sflagsz']);
        header.update(d);
        #reading params
        n = get_int(file);
        flags=[bool(get_int(file)) for i in range(n)];
        units=[get_str(file) for i in range(n)];
        labels=['q','x','y','z','ux','uy','uz','E'];
        if n == 8:
            pass;
        elif n == 7:
            labels = labels[:-1];
        elif n == 11:
            labels+=['xi','yi','zi'];
        else:
            raise NotImplementedError(
                'Not implemented for these number of parameters:{}.'.format(n));
        header['params'] = [
            (label,unit) for (label,unit,flag) in zip(labels,units,flags) if flag
        ];
    elif header['dump_type'] == 10:
        #this is a particle extraction file:
        header['geometry'] = get_int(file);
        #reading quantities
        n = get_int(file);
        header['quantities'] = [get_str(file) for i in range(n)];
    else:
        raise ValueError('Unknown dump_type: {}'.format(header['dump_type']));
    if test(kw,'size'):
        return header, file.tell()-size;
    return header;
348055
def get_info(self, symbol):
        
        sym = self._get_symbol_info(symbol)
        if not sym:
            raise NoDataFoundException("Symbol does not exist.")
        ret = {}
        ret['chunk_count'] = sym[CHUNK_COUNT]
        ret['len'] = sym[LEN]
        ret['appended_rows'] = sym[APPEND_COUNT]
        ret['metadata'] = sym[METADATA] if METADATA in sym else None
        ret['chunker'] = sym[CHUNKER]
        ret['chunk_size'] = sym[CHUNK_SIZE] if CHUNK_SIZE in sym else 0
        ret['serializer'] = sym[SERIALIZER]
        return ret
218098
def get_header(self, idx, formatted=False):
        
        header = self._uname if not formatted else self._fname
        return [header[x] for x in idx]
61540
function renderHeader(statuses) {
  var txt = '';

  // Build Header
  for (var k in statuses) {
    var status = statuses[k];

    // Create header
    var col = centerText(k, width);

    // Set header status color
    if (status === false) {
      col = chalk.dim(col);
    } else {
      col = chalk.white(col);
    }

    txt += col;
  }

  return txt;
}
909782
def info(self):
        

        info = ''

        if self._header is not None:
            if self._header_encoding is None:
                header = ''

                for b in bytearray(self.header):
                    if chr(b) in string.printable:
                        header += chr(b)
                    else:
                        header += '\\x{:02x}'.format(b)
            else:
                header = self.header

            info += 'Header:                  "{}"\n'.format(header)

        if self.execution_start_address is not None:
            info += 'Execution start address: 0x{:08x}\n'.format(
                self.execution_start_address)

        info += 'Data ranges:\n\n'

        for address, data in self._segments:
            minimum_address = address
            size = len(data)
            maximum_address = (minimum_address + size // self.word_size_bytes)
            info += 4 * ' '
            info += '0x{:08x} - 0x{:08x} ({})\n'.format(
                minimum_address,
                maximum_address,
                format_size(size, binary=True))

        return info
1020069
def info(self, msg, indent=0, **kwargs):
        """"""
        return self.logger.info(self._indent(msg, indent), **kwargs)
534767
def get_impact_report_as_string(analysis_dir):
    
    html_report_products = [
        'impact-report-output.html',
        'multi-exposure-impact-report-output.html']
    output_dir_path = join(analysis_dir, 'output')

    for html_report_product in html_report_products:
        table_report_path = join(output_dir_path, html_report_product)
        if exists(table_report_path):
            break
        table_report_path = None

    if not table_report_path:
        return None

    # We can display an impact report.
    # We need to open the file in UTF-8, the HTML may have some accents
    with open(table_report_path, 'r', encoding='utf-8') as table_report_file:
        report = table_report_file.read()
        return report
1192615
def header(text, border="--"):
    
    if not text or not border:
        return text

    if border.endswith(" "):
        decorated = "%s%s" % (border, text)
        fmt = "{decorated}\n{hr}"

    else:
        decorated = "%s %s %s" % (border, text, border)
        fmt = "{hr}\n{decorated}\n{hr}"

    return fmt.format(decorated=decorated, hr=border[0] * len(decorated))
233567
def header(self):
        '''
        

        '''
        lines = ['ply']

        if self.text:
            lines.append('format ascii 1.0')
        else:
            lines.append('format ' +
                         _byte_order_reverse[self.byte_order] +
                         ' 1.0')

        # Some information is lost here, since all comments are placed
        # between the 'format' line and the first element.
        for c in self.comments:
            lines.append('comment ' + c)

        for c in self.obj_info:
            lines.append('obj_info ' + c)

        lines.extend(elt.header for elt in self.elements)
        lines.append('end_header')
        return '\n'.join(lines)
17077
def description(self):
        """"""
        result = ""
        if isinstance(self._element, ValueElement):
            if self._element.kind is not None:
                result = "{}({}) | {}".format(self._element.dtype, self._element.kind,
                                          self._element.summary)
            else:
                result = "{} | {}".format(self._element.dtype,
                                          self._element.summary)
        elif isinstance(self._element, Executable):
            result = "({})".format(self._element.parameters_as_string())
        elif isinstance(self._element, str):
            result = "Intrinsic Fortran Symbol"
        elif isinstance(self._element, TypeExecutable):
            result = self._type_description()

        #Clean off any line breaks from the XML and excessive whitespace.
        cleaned = re.sub("\s+", " ", result.replace("\n", " "))
        return cleaned
101128
def getSignalHeader(self, chn):
        
        return {'label': self.getLabel(chn),
                'dimension': self.getPhysicalDimension(chn),
                                 'sample_rate': self.getSampleFrequency(chn),
                'physical_max':self.getPhysicalMaximum(chn),
                'physical_min': self.getPhysicalMinimum(chn),
                'digital_max': self.getDigitalMaximum(chn),
                'digital_min': self.getDigitalMinimum(chn),
                'prefilter':self.getPrefilter(chn),
                'transducer': self.getTransducer(chn)}
699735
def _get_section(self, event):
        """"""
        sentence_id = event.get('sentence')
        section = None
        if sentence_id:
            qstr = "$.sentences.frames[(@.frame_id is \'%s\')]" % sentence_id
            res = self.tree.execute(qstr)
            if res:
                sentence_frame = list(res)[0]
                passage_id = sentence_frame.get('passage')
                if passage_id:
                    qstr = "$.sentences.frames[(@.frame_id is \'%s\')]" % \
                            passage_id
                    res = self.tree.execute(qstr)
                    if res:
                        passage_frame = list(res)[0]
                        section = passage_frame.get('section-id')
        # If the section is in the standard list, return as is
        if section in self._section_list:
            return section
        # Next, handle a few special cases that come up in practice
        elif section.startswith('fig'):
            return 'figure'
        elif section.startswith('supm'):
            return 'supplementary'
        elif section == 'article-title':
            return 'title'
        elif section in ['subjects|methods', 'methods|subjects']:
            return 'methods'
        elif section == 'conclusions':
            return 'conclusion'
        elif section == 'intro':
            return 'introduction'
        else:
            return None