Prepares the Overview table part for generation HTML code.
16759
private function prepareOverviewTable(): void
  {
    $this->addClass(OverviewTable::$class);

    if (OverviewTable::$responsiveMediaQuery!==null && $this->getAttribute('id')===null)
    {
      $this->setAttrId(Html::getAutoId());
    }
  }
813951
public function generate()
    {
        $code = array();

        if ($this->namespace !== null) {
            $code[] = $this->getIndentation() . 'namespace ' . $this->namespace;
            $code[] = '{';
            $code[] = null;

            // Temporarily add one more level of indentation.
            $this->addIndentationLevel(1);
        }

        $code = array_merge($code, $this->renderUsesLines());

        $indentation = $this->getIndentation();

        $doc = $this->generateDocumentation();
        if ($doc !== null) {
            $code[] = $doc;
        }

        $line = $indentation;
        if ($this->isFinal() === true) {
            $line .= 'final ';
        } elseif ($this->isAbstract() === true) {
            $line .= 'abstract ';
        }

        $line .= 'class ' . $this->name;

        if ($this->extends !== null) {
            $line .= ' extends ' . $this->extends;
        }

        if (count($this->implements) > 0) {
            $line .= ' implements ' . implode(', ', $this->implements);
        }

        $code[] = $line;
        $code[] = $indentation . '{';

        // Class uses.
        $classElements = $this->generateTraitUsesLines();

        // Class constants.
        $classElements = array_merge($classElements, $this->generateConstantsLines());

        // Class properties.
        $classElements = array_merge($classElements, $this->generatePropertiesLines());

        // Class methods.
        $classElements = array_merge($classElements, $this->generateMethodsLines());

        if (count($classElements) > 0) {
            $code[] = null;
            $code = array_merge($code, $classElements);
            // Remove last empty line.
            array_pop($code);
        }

        $code[] = $indentation . '}';

        if ($this->namespace !== null) {
            // Set back the indentation.
            $this->addIndentationLevel(-1);

            $code[] = $this->getIndentation() . '}';
        }

        return implode($this->getLineFeed(), $code);
    }
262907
@Override
	protected void preparePaintComponent(final Request request) {
		if (!isInitialised()) {
			table.setDataModel(createTableModel());
			setInitialised(true);
		}
	}
966494
protected function prepare()
    {
        $this->initPurifier($this->config->getPurifierCacheLocation());

        $this->oldText = $this->purifyHtml($this->oldText);
        $this->newText = $this->purifyHtml($this->newText);
    }
699449
function(incoming) {

      var body, attr, path, stylesheet, sortable, demo, url, login, blocks, grid;

      // get body
      body = document.querySelector('body');

      // production
      login = '/login';
      path = '/node_modules/hashedit/';
      stylesheet = ['/node_modules/hashedit/dist/hashedit-min.css'];
      sortable = ['.sortable'];
      demo = false;
      url = null;
      blocks = [];

      // get attributes
      if(body != null) {

        // setup development
        if(incoming.dev) {
          path = '/dev/hashedit/';
          stylesheet = ['/dev/hashedit/css/hashedit.css'];
        }

        if(incoming.path) {
          path = incoming.path;
        }

        if(incoming.stylesheet) {
          stylesheet = incoming.stylesheet;
        }

        // setup demo
        if(body.hasAttribute('hashedit-demo') == true) {
          demo = true;
        }

        // setup framework
        if(incoming.framework) {
          hashedit.framework = incoming.framework;
        }

        // setup sortable
        if(incoming.sortable) {

          if(incoming.sortable != '') {
            sortable = incoming.sortable.split(',');
          }

        }

        // setup blocks
        if(incoming.blocks) {

          if(incoming.blocks != '') {
            blocks = incoming.blocks.split(',');
          }

        }

        // setup grid
        if(incoming.grid) {

          if(incoming.grid != '') {
            grid = incoming.grid;
          }

        }

        // setup editable
        if(incoming.editable) {

          if(incoming.editable != '') {
            editable = incoming.editable.split(',');
          }

        }

        // set url
        if(incoming.url) {
          url = incoming.url;
        }

        // set previewUrl
        if(incoming.previewUrl) {
          hashedit.previewUrl = incoming.previewUrl;
        }
        else {
          hashedit.previewUrl = url;
        }

        // set title
        if(incoming.title) {
          hashedit.title = incoming.title;
        }

        // set login
        if(incoming.login) {
          login = incoming.login;
        }

        // handle alternative auth types (e.g. token based auth)
        if(incoming.auth) {

          // setup token auth
          if(incoming.auth === 'token') {

            // defaults
            hashedit.useToken = true;
            hashedit.authHeader = 'Authorization';
            hashedit.authHeaderPrefix = 'Bearer';
            hashedit.tokenName = 'id_token';

            // override defaults
            if(incoming.authHeader) {
              hashedit.authHeader = incoming.authHeader;
            }

            if(incoming.authHeaderPrefix) {
              hashedit.authHeaderPrefix = incoming.authHeaderPrefix;
            }

            if(incoming.tokenName) {
              hashedit.tokenName = incoming.tokenName;
            }

          }

        }

        // handle language
        if(incoming.translate) {

          hashedit.canTranslate = true;
          hashedit.language = 'en';
          hashedit.languagePath = '/i18n/{{language}}.json';

          if(incoming.languagePath) {
            hashedit.languagePath = incoming.languagePath;
          }

          // get language
          if(localStorage['user_language'] != null){
    				hashedit.language = localStorage['user_language'];
    			}
    		}

    		if(incoming.saveUrl) {
      		hashedit.saveUrl = incoming.saveUrl;
    		}

      }

      // setup config
      var config = {
        path: path,
        login: login,
        stylesheet: stylesheet,
        sortable: sortable,
        blocks: blocks,
        grid: grid,
        demo: demo
      };

      // set url
      if (url != null) {
        config.url = url;
      }

      // setup editor
      hashedit.setupEditor(config);

    }
593711
public static void createAndShowTableDemoFrame() {
        // Create and set up the frame and the table demo panel.
        JFrame frame = new JFrame("LGoodDatePicker Table Editors Demo "
                + InternalUtilities.getProjectVersionString());
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        TableEditorsDemo tableDemoPanel = new TableEditorsDemo();
        frame.setContentPane(tableDemoPanel);
        tableDemoPanel.setOpaque(true);

        //Display the frame.
        frame.pack();
        frame.setSize(new Dimension(1000, 700));
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
956248
def prepare(self):

        self.body_html = markdown(
            codecs.open(self.abspath, 'r').read(),
            extras=['fenced-code-blocks', 'hilite', 'tables', 'metadata'])

        self.header = self.body_html.metadata
        """"""
        if 'tags' in self.header:  # pages can lack tags
            self.header['tags'] = [t.strip().lower() for t in
                                   self.header['tags'].split(',')]

        else:
            self.header['tags'] = ("",)

        self.date = self.header.get('published', datetime.datetime.now())

        if isinstance(self.date, str):
            self.date = datetime.datetime.strptime(self.date, "%Y-%m-%d")

        for k, v in self.header.items():
            try:
                setattr(self, k, v)
            except AttributeError:
                pass

        if self.id:
            return

        rec = {'filename': self.path,
               'mtime': int(os.path.getmtime(self.abspath))}

        if self.header['kind'] == 'writing':
            _id = Entry.db.posts.insert(rec)

        elif self.header['kind'] == 'page':
            _id = Entry.db.pages.insert(rec)

        self.id = _id
794834
def make_table(self, renderable):
        """"""
        self._make_prefix()
        diffs = renderable.diff._diff

        # set up iterator to wrap lines that exceed desired width
        if self._wrapcolumn:
            diffs = self._line_wrapper(diffs, renderable.diff.hide_expected)

        # collect up from/to lines and flags into lists (also format the lines)
        fromlist, tolist, flaglist = self._collect_lines(diffs)

        # process change flags, generating middle column of next anchors/links
        fromlist, tolist, flaglist, next_href, next_id = self._convert_flags(
            fromlist, tolist, flaglist, False, 5)

        s = []
        fmt = '            <tr><td class="diff_next"%s>%s</td>%s' + \
              '<td class="diff_next">%s</td>%s</tr>\n'
        for i in range(len(flaglist)):
            if flaglist[i] is None:
                # mdiff yields None on separator lines skip the bogus ones
                # generated for the first line
                if i > 0:
                    s.append('        </tbody>        \n        <tbody>\n')
            else:
                s.append(fmt % (next_id[i], next_href[i], fromlist[i],
                                next_href[i], tolist[i]))
        header_row = '<thead><tr>%s%s%s%s</tr></thead>' % (
            '<th class="diff_next"><br /></th>',
            '<th colspan="2" class="diff_header">%s</th>' % self.FROM_DESC,
            '<th class="diff_next"><br /></th>',
            '<th colspan="2" class="diff_header">%s</th>' % self.TO_DESC)

        table = self._table_template % dict(
            data_rows=''.join(s),
            header_row=header_row,
            prefix=self._prefix[1])

        return table.replace('\0+', '<span class="diff_add">'). \
            replace('\0-', '<span class="diff_sub">'). \
            replace('\0^', '<span class="diff_chg">'). \
            replace('\1', '</span>'). \
            replace('\t', '&nbsp;')
52422
def as_html(self, table_class='code-difftable', line_class='line',
                new_lineno_class='lineno old', old_lineno_class='lineno new',
                code_class='code'):
        
        def _link_to_if(condition, label, url):
            """
            Generates a link if condition is meet or just the label if not.
            """

            if condition:
                return '''<a href="%(url)s">%(label)s</a>''' % {'url': url,
                                                                'label': label}
            else:
                return label
        diff_lines = self.prepare()
        _html_empty = True
        _html = []
        _html.append('''<table class="%(table_class)s">\n''' \
                                            % {'table_class': table_class})
        for diff in diff_lines:
            for line in diff['chunks']:
                _html_empty = False
                for change in line:
                    _html.append('''<tr class="%(line_class)s %(action)s">\n''' \
                        % {'line_class': line_class,
                           'action': change['action']})
                    anchor_old_id = ''
                    anchor_new_id = ''
                    anchor_old = "%(filename)s_o%(oldline_no)s" % \
                                {'filename': self._safe_id(diff['filename']),
                                 'oldline_no': change['old_lineno']}
                    anchor_new = "%(filename)s_n%(oldline_no)s" % \
                                {'filename': self._safe_id(diff['filename']),
                                 'oldline_no': change['new_lineno']}
                    cond_old = change['old_lineno'] != '...' and \
                                                        change['old_lineno']
                    cond_new = change['new_lineno'] != '...' and \
                                                        change['new_lineno']
                    if cond_old:
                        anchor_old_id = 'id="%s"' % anchor_old
                    if cond_new:
                        anchor_new_id = 'id="%s"' % anchor_new
                    ###########################################################
                    # OLD LINE NUMBER
                    ###########################################################
                    _html.append('''\t<td %(a_id)s class="%(old_lineno_cls)s">''' \
                                    % {'a_id': anchor_old_id,
                                       'old_lineno_cls': old_lineno_class})

                    _html.append('''<pre>%(link)s</pre>''' \
                        % {'link':
                        _link_to_if(cond_old, change['old_lineno'], '#%s' \
                                                                % anchor_old)})
                    _html.append('''</td>\n''')
                    ###########################################################
                    # NEW LINE NUMBER
                    ###########################################################

                    _html.append('''\t<td %(a_id)s class="%(new_lineno_cls)s">''' \
                                    % {'a_id': anchor_new_id,
                                       'new_lineno_cls': new_lineno_class})

                    _html.append('''<pre>%(link)s</pre>''' \
                        % {'link':
                        _link_to_if(cond_new, change['new_lineno'], '#%s' \
                                                                % anchor_new)})
                    _html.append('''</td>\n''')
                    ###########################################################
                    # CODE
                    ###########################################################
                    _html.append('''\t<td class="%(code_class)s">''' \
                                                % {'code_class': code_class})
                    _html.append('''\n\t\t<pre>%(code)s</pre>\n''' \
                                                % {'code': change['line']})
                    _html.append('''\t</td>''')
                    _html.append('''\n</tr>\n''')
        _html.append('''</table>''')
        if _html_empty:
            return None
        return ''.join(_html)
1210245
public function renderTableAsHtml()
    {
        $render = '';
        $tableConfig = $this->getTable()->getOptions();

        if ($tableConfig->getShowColumnFilters()) {
            $render .= $this->renderFilters();
        }

        $render .= $this->renderHead();
        $render = sprintf('<thead>%s</thead>', $render);
        $render .= $this->getTable()->getRow()->renderRows();
        $table = sprintf('<table %s>%s</table>', $this->getTable()->getAttributes(), $render);

        $view = new \Zend\View\Model\ViewModel();
        $view->setTemplate('container');

        $view->setVariable('table', $table);

        $view->setVariable('paginator', $this->renderPaginator());
        $view->setVariable('paramsWrap', $this->renderParamsWrap());
        $view->setVariable('itemCountPerPage', $this->getTable()->getParamAdapter()->getItemCountPerPage());
        $view->setVariable('quickSearch', $this->getTable()->getParamAdapter()->getQuickSearch());
        $view->setVariable('name', $tableConfig->getName());
        $view->setVariable('itemCountPerPageValues', $tableConfig->getValuesOfItemPerPage());
        $view->setVariable('showQuickSearch', $tableConfig->getShowQuickSearch());
        $view->setVariable('showPagination', $tableConfig->getShowPagination());
        $view->setVariable('showItemPerPage', $tableConfig->getShowItemPerPage());
        $view->setVariable('showExportToCSV', $tableConfig->getShowExportToCSV());

        return $this->getRenderer()->render($view);
    }
856385
protected function prepareDocument()
	{
		$app   = JFactory::getApplication();
		$menus = $app->getMenu();

		// Because the application sets a default page title, we need to get it from the menu item itself
		$menu = $menus->getActive();

		if ($menu)
		{
			$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
		}
		else
		{
			$this->params->def('page_heading', JText::_($this->pageHeading));
		}

		$title = $this->params->get('page_title', '');

		if (empty($title))
		{
			$title = $app->get('sitename');
		}
		elseif ($app->get('sitename_pagetitles', 0) == 1)
		{
			$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
		}
		elseif ($app->get('sitename_pagetitles', 0) == 2)
		{
			$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
		}

		$this->document->setTitle($title);

		if ($this->params->get('menu-meta_description'))
		{
			$this->document->setDescription($this->params->get('menu-meta_description'));
		}

		if ($this->params->get('menu-meta_keywords'))
		{
			$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
		}

		if ($this->params->get('robots'))
		{
			$this->document->setMetadata('robots', $this->params->get('robots'));
		}
	}
1155686
public function applyFormatting()
    {
        $this->resetOrder();

        $dbLookup   = $this->util->getDbLookup();
        $translated = $this->util->getTranslated();

        // Token id & respondent
        $this->set('gto_id_token',           'label', $this->_('Token'),
                'elementClass', 'Exhibitor',
                'formatFunction', 'strtoupper'
                );
        $this->set('gr2o_patient_nr',        'label', $this->_('Respondent nr'),
                'elementClass', 'Exhibitor'
                );
        $this->set('respondent_name',        'label', $this->_('Respondent name'),
                'elementClass', 'Exhibitor'
                );
        $this->set('gto_id_organization',    'label', $this->_('Organization'),
                'elementClass', 'Exhibitor',
                'multiOptions', $dbLookup->getOrganizationsWithRespondents()
                );

        // Track, round & survey
        $this->set('gtr_track_name',         'label', $this->_('Track'),
                'elementClass', 'Exhibitor'
                );
        $this->set('gr2t_track_info',        'label', $this->_('Description'),
                'elementClass', 'Exhibitor'
                );
        $this->set('gto_round_description',  'label', $this->_('Round'),
                'elementClass', 'Exhibitor'
                );
        $this->set('gsu_survey_name',        'label', $this->_('Survey'),
                'elementClass', 'Exhibitor'
                );
        $this->set('ggp_name',               'label', $this->_('Assigned to'),
                'elementClass', 'Exhibitor'
                );

        // Token, editable part
        $manual = $translated->getDateCalculationOptions();
        $this->set('gto_valid_from_manual',  'label', $this->_('Set valid from'),
                'description', $this->_('Manually set dates are fixed an will never be (re)calculated.'),
                'elementClass', 'Radio',
                'multiOptions', $manual,
                'separator', ' '
                );
        $this->set('gto_valid_from',         'label', $this->_('Valid from'),
                'elementClass', 'Date',
                'formatFunction', $translated->formatDateNever,
                'tdClass', 'date');
        $this->set('gto_valid_until_manual', 'label', $this->_('Set valid until'),
                'description', $this->_('Manually set dates are fixed an will never be (re)calculated.'),
                'elementClass', 'Radio',
                'multiOptions', $manual,
                'separator', ' '
                );
        $this->set('gto_valid_until',        'label', $this->_('Valid until'),
                'elementClass', 'Date',
                'formatFunction', $translated->formatDateForever,
                'tdClass', 'date');
        $this->set('gto_comment',            'label', $this->_('Comments'),
                'cols', 50,
                'elementClass', 'Textarea',
                'rows', 3,
                'tdClass', 'pre'
                );

        // Token, display part
        $this->set('gto_mail_sent_date',     'label', $this->_('Last contact'),
                'elementClass', 'Exhibitor',
                'formatFunction', $translated->formatDateNever,
                'tdClass', 'date');
        $this->set('gto_mail_sent_num',      'label', $this->_('Number of contact moments'),
                'elementClass', 'Exhibitor'
                );
        $this->set('gto_completion_time',    'label', $this->_('Completed'),
                'elementClass', 'Exhibitor',
                'formatFunction', $translated->formatDateNa,
                'tdClass', 'date');
        $this->set('gto_duration_in_sec',    'label', $this->_('Duration in seconds'),
                'elementClass', 'Exhibitor'
                );
        $this->set('gto_result',             'label', $this->_('Score'),
                'elementClass', 'Exhibitor'
                );
        $this->set('grc_description',        'label', $this->_('Reception code'),
                'formatFunction', array($this->translate, '_'),
                'elementClass', 'Exhibitor'
                );
        $this->set('gto_changed',            'label', $this->_('Changed on'),
                'elementClass', 'Exhibitor',
                'formatFunction', $translated->formatDateUnknown
                );
        $this->set('assigned_by',            'label', $this->_('Assigned by'),
                'elementClass', 'Exhibitor'
                );

        $this->refreshGroupSettings();

        return $this;
    }
1090154
def html(self):
        
        classes = list()

        package = ""
        if self.package is not None:
            package = "Package: " + self.package + "<br/>"

        for classname in self.classes:
            classes.append(self.classes[classname].html())

        errs = ""
        for error in self.errors:
            if not len(errs):
                errs += "<tr><th colspan='2' align='left'>Errors</th></tr>"
            for part in ["type", "message", "text"]:
                if part in error:
                    errs += "<tr><td>{}</td><td><pre>{}</pre></td></tr>".format(
                        part,
                        tag.text(error[part]))

        stdio = ""
        if self.stderr or self.stdout:
            stdio += "<tr><th colspan='2' align='left'>Output</th></tr>"
            if self.stderr:
                 stdio += "<tr><td>Stderr</td><td><pre>{}</pre></td></tr>".format(
                        tag.text(self.stderr))
            if self.stdout:
                 stdio += "<tr><td>Stdout</td><td><pre>{}</pre></td></tr>".format(
                        tag.text(self.stdout))

        props = ""
        if len(self.properties):
            props += "<table>"
            propnames = sorted(self.properties)
            for prop in propnames:
                props += "<tr><th>{}</th><td>{}</td></tr>".format(prop, self.properties[prop])
            props += "</table>"

        return """
        <div class="testsuite">
            <h2>Test Suite: {name}</h2><a name="{anchor}">
            {package}
            {properties}
            <table>
            <tr><th align="left">Duration</th><td align="right">{duration} sec</td></tr>
            <tr><th align="left">Test Cases</th><td align="right">{count}</td></tr>
            <tr><th align="left">Failures</th><td align="right">{fails}</td></tr>
            {errs}
            {stdio}
            </table>
            <a name="toc"></a>
            <h2>Results Index</h2>
            {toc}
            <hr size="2"/>
            <h2>Test Results</h2>
            <div class="testclasses">
            {classes}
            </div>
        </div>
        """.format(name=tag.text(self.name),
                   anchor=self.anchor(),
                   duration=self.duration,
                   errs=errs,
                   stdio=stdio,
                   toc=self.toc(),
                   package=package,
                   properties=props,
                   classes="".join(classes),
                   count=len(self.all()),
                   fails=len(self.failed()))
611023
function() {
  this.colon = false;
  HelpDocument.apply(this, arguments);
  this.format = fmt.MARKDOWN_FORMAT;
  this.vanilla = true;
  this.useCustom = true;
  // disable columns
  this.use = false;
  var format = '* `%s`: %s';
  var overrides = {
    synopsis: '```synopsis\n%s\n```'
  }
  this.markdown = {};
  var conf = this.conf.markdown || {}, i, key;
  var formats = conf.formats || {};
  for(i = 0;i < this.sections.length;i++) {
    key = this.sections[i];
    this.markdown[key] = formats[key] || overrides[key] || format;
  }
}
543911
def _populate_large_table(self, trs):
        
        for tr in trs:
            tds = tr.select('td')
            cs = Course(
                code=coursecode(tds[0]),
                title=text(tds[1]),
                semester=parseint(tds[2]),
                status=text(tds[3]),
                ects=parsefloat(tds[4]),
                followed=parsebool(tds[5]),
            )

            followed = cs['followed']
            cs['session'] = text(tds[7]) if followed else None
            cs['result'] = parseresult(tds[6]) if followed else None

            self.append(cs)
579230
def convert_toml_outline_tables(parsed):
    """"""
    def convert_tomlkit_table(section):
        for key, value in section._body:
            if not key:
                continue
            if hasattr(value, "keys") and not isinstance(value, tomlkit.items.InlineTable):
                table = tomlkit.inline_table()
                table.update(value.value)
                section[key.key] = table

    def convert_toml_table(section):
        for package, value in section.items():
            if hasattr(value, "keys") and not isinstance(value, toml.decoder.InlineTableDict):
                table = toml.TomlDecoder().get_empty_inline_table()
                table.update(value)
                section[package] = table

    is_tomlkit_parsed = isinstance(parsed, tomlkit.container.Container)
    for section in ("packages", "dev-packages"):
        table_data = parsed.get(section, {})
        if not table_data:
            continue
        if is_tomlkit_parsed:
            convert_tomlkit_table(table_data)
        else:
            convert_toml_table(table_data)

    return parsed
1170272
def prepare_table(table):
    
    n = len(table)
    for i, row in enumerate(table):
        assert len(row) == n
        for j, el in enumerate(row):
            if i == j:
                table[i][i] = 0.0
            elif i > j:
                table[i][j] = 1-table[j][i]
    return table