Prints the contributions tab content

@uses $OUTPUT, $USER
542617
private function print_contributions_content() {
        global $CFG, $OUTPUT, $USER;
        $page = $this->page;

        if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
            $fresh = wiki_refresh_cachedcontent($page);
            $page = $fresh['page'];
        }

        $swid = $this->subwiki->id;

        $table = new html_table();
        $table->head = array(get_string('contributions', 'wiki') . $OUTPUT->help_icon('contributions', 'wiki'));
        $table->attributes['class'] = 'generalbox table';
        $table->data = array();
        $table->rowclasses = array();

        $lastversions = array();
        $pages = array();
        $users = array();

        if ($contribs = wiki_get_contributions($swid, $USER->id)) {
            foreach ($contribs as $contrib) {
                if (!array_key_exists($contrib->pageid, $pages)) {
                    $page = wiki_get_page($contrib->pageid);
                    $pages[$contrib->pageid] = $page;
                } else {
                    continue;
                }

                if (!array_key_exists($page->id, $lastversions)) {
                    $version = wiki_get_last_version($page->id);
                    $lastversions[$page->id] = $version;
                } else {
                    $version = $lastversions[$page->id];
                }

                if (!array_key_exists($version->userid, $users)) {
                    $user = wiki_get_user_info($version->userid);
                    $users[$version->userid] = $user;
                } else {
                    $user = $users[$version->userid];
                }

                $link = wiki_parser_link($page->title, array('swid' => $swid));
                $class = ($link['new']) ? 'class="wiki_newentry"' : '';

                $linkpage = '<a href="' . $link['url'] . '"' . $class . '>' . format_string($link['content'], true, array('context' => $this->modcontext)) . '</a>';
                $icon = $OUTPUT->user_picture($user, array('popup' => true));

                $table->data[] = array("$icon&nbsp;$linkpage");
            }
        } else {
            $table->data[] = array(get_string('nocontribs', 'wiki'));
        }
        echo html_writer::table($table);
    }
519422
private function printOutput(): void
    {
        foreach ($this->db->query('SELECT id, file_name FROM tests WHERE completed = 1')->fetchAll() as $test) {
            $this->printer->printFeedback($this->pending[$test['file_name']]);
            $this->db->prepare('DELETE FROM tests WHERE id = :id')->execute([
                'id' => $test['id'],
            ]);
        }
    }
564274
public function output() {
		if ( ! $form = $this->manager->get_form() ) {
			_doing_it_wrong( __FUNCTION__, 'Cannot output the section until the form is created', null );
			return;
		}

		$attributes = [
			'role'        => 'tabpanel',
			'id'          => $this->uniqid(),
			'aria-hidden' => ! empty( $this->options['active'] ) ? 'false' : 'true',
		];

		echo '<section' . Utils::build_html_attributes( $attributes ) . '>'; // WPCS: XSS OK.

		foreach ( $this->fields as $field ) {
			$form->show( $field );
		}

		echo '</section>';
	}
1177190
function display_body(body, is_toplevel, output, allow_directives) {
          var last = body.length - 1;
          in_directive = allow_directives;
          body.forEach(function(stmt, i) {
              if (in_directive === true && !(stmt instanceof AST_Directive ||
                  stmt instanceof AST_EmptyStatement ||
                  (stmt instanceof AST_SimpleStatement && stmt.body instanceof AST_String)
              )) {
                  in_directive = false;
              }
              if (!(stmt instanceof AST_EmptyStatement)) {
                  output.indent();
                  stmt.print(output);
                  if (!(i == last && is_toplevel)) {
                      output.newline();
                      if (is_toplevel) output.newline();
                  }
              }
              if (in_directive === true &&
                  stmt instanceof AST_SimpleStatement &&
                  stmt.body instanceof AST_String
              ) {
                  in_directive = false;
              }
          });
          in_directive = false;
      }
862330
function welcomeUserCourse() {
        global $USER, $CONTEXT;
        if ( isset($USER->displayname) ) {
            if ( isset($CONTEXT->title) ) {
                printf(_m("<p>Welcome %s from %s"), htmlent_utf8($USER->displayname), htmlent_utf8($CONTEXT->title));
            } else {
                printf(_m("<p>Welcome %s"), htmlent_utf8($USER->displayname));
            }
        } else {
            if ( isset($CONTEXT->title) ) {
                printf(_m("<p>Welcome from %s"), htmlent_utf8($CONTEXT->title));
            } else {
                printf(_m("<p>Welcome "));
            }
        }

        if ( $USER->admin ) {
            echo(" "._m("(Instructor+Administrator)"));
        } else if ( $USER->instructor ) {
            echo(" "._m("(Instructor)"));
        }
        echo("</p>\n");
    }
404141
def pretty_print_user_list(list)
      total = 0
      data = []
      # Header row
      data.push('Asset', 'Total Value', 'Change % (Week)')
      list.user_pairs.each do |user_pair|
        data.push(user_pair.symbol)
        data.push(user_pair.valuation.format)
        data.push(user_pair.perchant_change_week.to_s)
        total += user_pair.valuation
      end

      data.push('', '', '')
      data.push('TOTAL:', total.format, '')
      data.push('', '', '')
      print_arrays(data, 3)
    end
297398
def contribution_breakdown():
    
    args = ['git', 'blame']
    counts = {}
    line_format = '{0:30}\t{1:>10}\t{2:>10}%'
    files = subprocess.check_output(['git', 'ls-files']).decode("utf-8").split('\n')

    for f in files[:-1]:
        if 'docs/latest' in f or '_themes' in f:
            continue  # skip generated stuff
        lines = subprocess.check_output(args + [f]).decode('utf-8')
        blames = [get_line_blame(line) for line in lines.split('\n')]
        for blame in blames:
            counts[blame] = counts.get(blame, 0) + 1

    total = sum([counts[count] for count in counts])
    contribs = [(user, counts[user]) for user in counts]
    contribs.sort(key=lambda x: x[1], reverse=True)

    print(line_format.format('User', 'Lines', 'Line '))

    for user in contribs:
        percent = floor(100.0 * user[1] / total)
        if percent == 0: percent = '>1'
        print(line_format.format(user[0], user[1], percent))

    print(line_format.format('Total', total, 100))
980725
public void display() {
    System.out.printf("Job id=%s, name=%s\n", getJobID(), getJobName());
    System.out.printf("Configuration file: %s\n", getJobID());
    System.out.printf("Tracking URL: %s\n", getTrackingURL());

    System.out.printf("Completion: map: %f reduce %f\n",
        100.0 * this.mapProgress, 100.0 * this.reduceProgress);

    System.out.println("Job total maps = " + totalMaps);
    System.out.println("Job completed maps = " + completedMaps);
    System.out.println("Map percentage complete = " + mapProgress);
    System.out.println("Job total reduces = " + totalReduces);
    System.out.println("Job completed reduces = " + completedReduces);
    System.out.println("Reduce percentage complete = " + reduceProgress);
    System.out.flush();
  }
710710
public function renderToolUserContentAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');
        $melisTranslation = $this->getServiceLocator()->get('MelisCoreTranslation');
        $melisTool = $this->getServiceLocator()->get('MelisCoreTool');
        $translator = $this->getServiceLocator()->get('translator');
        $melisTool->setMelisToolKey('meliscore', $this::TOOL_KEY);

        $moduleSvc       =  $this->getServiceLocator()->get('ModulesService');
        $modules         = $moduleSvc->getAllModules();

        $request = $this->getRequest();
        $uri     = $request->getUri();
        $domain = isset($get['domain']) ? $get['domain'] : null;
        $scheme = isset($get['scheme']) ? $get['scheme'] : null;

        $columns = $melisTool->getColumns();
        // add action column
        $columns['actions'] = array('text' => $translator->translate('tr_meliscore_global_action'), 'css' => 'width:10%');

        $netStatus = $melisTool->isConnected();


        $view = new ViewModel();
        $view->melisKey = $melisKey;
        $view->tableColumns = $columns;
        $view->getToolDataTableConfig = $melisTool->getDataTableConfiguration();

        $melisTool->setMelisToolKey('meliscore', 'user_view_date_connection_tool');
        $view->getToolDataTableConfigForDateConnection = $melisTool->getDataTableConfiguration('#tableUserViewDateConnection', null, null, array('order' => '[[ 0, "desc" ]]'));
        $view->modules = serialize($modules);

        $view->scheme  = $scheme;
        $view->domain  = $domain;
        $view->netStatus  = $netStatus;

        return $view;
    }
105119
public function outputUserInfo(User $user, OutputInterface $output)
    {
        $output->writeln([
            '  ID: <info>'.$user->getId().'</info>',
            '  eMail: <info>'.$user->getEmail().'</info>',
            '  API-Key: <info>'.$user->getApiKey().'</info>',
        ]);
    }
1237425
protected function outputGitHubIssues()
    {
        $issues = $this
            ->taskGitHubIssueList(
                $this->getToken(),
                $this->getAccount(),
                $this->getRepository()
            )
            ->run();

        unset($issues['time']);

        $table = (new Table($this->output))
            ->setHeaders(['Issue', 'Title', 'State', 'Assignee', 'Labels', 'Author']);

        $rows = [];
        foreach ($issues as $issue) {
            $labels = isset($issue['labels'])
                ? $this->formatLabelNames($issue['labels'])
                : null;

            $assignee = isset($issue['assignee']['login'])
                ? $issue['assignee']['login']
                : 'none';

            $rows[] = [
                $issue['number'],
                $issue['title'],
                $issue['state'],
                $assignee,
                $labels,
                $issue['user']['login'],
            ];
        }
        $table->setRows($rows);
        $table->render();

        return $this;
    }
706031
public function printUsers($username, $start_from, $sort_by, $sort_dir, $show_group)
    {
        $userlist_data = [];

        $username = Container::get('hooks')
            ->fire('model.userlist.print_users_start', $username, $start_from, $sort_by, $sort_dir, $show_group);

        // Retrieve a list of user IDs, LIMIT is (really) expensive so we only fetch the
        // IDs here then later fetch the remaining data
        $result = DB::forTable('users')
            ->select('u.id')
            ->tableAlias('u')
            ->whereGt('u.id', 1)
            ->whereNotEqual('u.group_id', ForumEnv::get('FEATHER_UNVERIFIED'));

        if ($username != '') {
            $result = $result->whereLike('u.username', str_replace('*', '%', $username));
        }
        if ($show_group > -1) {
            $result = $result->where('u.group_id', $show_group);
        }

        $result = $result->orderByExpr($sort_by . ' ' . $sort_dir)
            ->orderByAsc('u.id')
            ->limit(50)
            ->offset($start_from);

        $result = Container::get('hooks')->fireDB('model.userlist.print_users_query', $result);
        $result = $result->findMany();

        if ($result) {
            $user_ids = [];
            foreach ($result as $cur_user_id) {
                $user_ids[] = $cur_user_id['id'];
            }

            // Grab the users
            $result['select'] = ['u.id', 'u.username', 'u.title', 'u.num_posts', 'u.registered',
                'g.g_id', 'g.g_user_title'];

            $result = DB::forTable('users')
                ->tableAlias('u')
                ->selectMany($result['select'])
                ->leftOuterJoin(DB::prefix() . 'groups', ['g.g_id', '=', 'u.group_id'], 'g')
                ->whereIn('u.id', $user_ids)
                ->orderByExpr($sort_by . ' ' . $sort_dir)
                ->orderByAsc('u.id');
            $result = Container::get('hooks')->fireDB('model.userlist.print_users_grab_query', $result);
            $result = $result->find_many();

            foreach ($result as $user_data) {
                $userlist_data[] = $user_data;
            }
        }

        $userlist_data = Container::get('hooks')->fire('model.userlist.print_users', $userlist_data);

        return $userlist_data;
    }
1333024
function output ( $_top = '' )
		{
			global $_top;

			//	Make sure that folder names have a trailing '/'
			if (strlen($this->template_dir)  &&  substr($this->template_dir, -1) != '/')
			{
				$this->template_dir  .=  '/';
			}
			if (strlen($this->temp_dir)  &&  substr($this->temp_dir, -1) != '/')
			{
				$this->temp_dir  .=  '/';
			}
			//	Prepare Template Content
			if (!is_array($_top))
			{
				if (strlen($_top))
				{
					$this->tpl_file  =  $_top;
				}
				$_top  =  $this->data;
			}
			$_obj  =  &$_top;
			$_stack_cnt  =  0;
			$_stack[$_stack_cnt++]  =  $_obj;

			//	Check if template is already compiled
			$cpl_file_name = preg_replace('/[:\/.\\\\]/', '_', $this->tpl_file);
			if (strlen($cpl_file_name) > 0)
			{
	    		$this->cpl_file  =  $this->temp_dir . $cpl_file_name . '.php';
				$compile_template  =  true;
				if ($this->reuse_code)
				{
					if (is_file($this->cpl_file))
					{
						if ($this->mtime($this->cpl_file) > $this->mtime($this->template_dir . $this->tpl_file))
						{
							$compile_template  =  false;
						}
					}
				}
				if ($compile_template)
				{
					if (@include_once("class.smarttemplateparser.php"))
					{
						$this->parser = new SmartTemplateParser($this->template_dir . $this->tpl_file);
						if (!$this->parser->compile($this->cpl_file))
						{
							exit( "SmartTemplate Parser Error: " . $this->parser->error );
						}
					}
					else
					{
						exit( "SmartTemplate Error: Cannot find class.smarttemplateparser.php; check SmartTemplate installation");
					}
				}
				//	Execute Compiled Template
				include($this->cpl_file);
			}
			else
			{
				exit( "SmartTemplate Error: You must set a template file name");
			}
			//	Delete Global Content Array in order to allow multiple use of SmartTemplate class in one script
			unset ($_top);
		}
1053766
public function output()
    {
        // Print the description if it's defined.
        if ($this->description) {
            $this->climate->out($this->description)->br();
        }

        // Print the usage statement with the arguments without a prefix at the end.
        $this->climate->out("Usage: {$this->command} "
                            . $this->short($this->getOrderedArguments()));

        // Print argument details.
        foreach (['required', 'optional'] as $type) {
            $this->outputArguments($this->filter->{$type}(), $type);
        }
    }
701630
function templ_user($attrib)
    {
        // Create username input
        $attrib['name'] = 'acluser';

        $textfield = new html_inputfield($attrib);

        $fields['user'] = html::label(array('for' => $attrib['id']), $this->gettext('username'))
            . ' ' . $textfield->show();

        // Add special entries
        if (!empty($this->specials)) {
            foreach ($this->specials as $key) {
                $fields[$key] = html::label(array('for' => 'id'.$key), $this->gettext($key));
            }
        }

        $this->rc->output->set_env('acl_specials', $this->specials);

        // Create list with radio buttons
        if (count($fields) > 1) {
            $ul = '';
            $radio = new html_radiobutton(array('name' => 'usertype'));
            foreach ($fields as $key => $val) {
                $ul .= html::tag('li', null, $radio->show($key == 'user' ? 'user' : '',
                        array('value' => $key, 'id' => 'id'.$key))
                    . $val);
            }

            $out = html::tag('ul', array('id' => 'usertype', 'class' => $attrib['class']), $ul, html::$common_attrib);
        }
        // Display text input alone
        else {
            $out = $fields['user'];
        }

        return $out;
    }
1277187
def print_usage_table(options={})
      fields = get_usage_fields options[:fields]
      fields, opts =  get_fields_and_options(fields, options)
      render_table(fields, opts, options)
    end
635394
public static function render()
    {
        $trace = static::$chronology;

        ob_start();
        include __DIR__ . '/Views/Debugger.php';
        $output = ob_get_contents();
        ob_end_clean();

        static::$chronology = [];

        echo $output;
    }