/*!
Prints all 'top' reports
19218
static function printTopReportsList()
    {
        $debug = eZDebug::instance();
        $reportNames = array_keys( $debug->topReportsList );
        foreach ( $reportNames as $reportName )
        {
            echo $debug->topReportsList[$reportName];
        }
    }
862079
private function show_all()
    {
        $query = "SELECT expires, body FROM cache";
        if ($result = $this->db->query($query)) {
            if ($result->size() > 0) {
                $results = $result->fetchAll();
                echo '<pre>';
                print_r($results);
                echo '</pre>';
            } else {
                return false;
            }
        } else {
            // TODO: Handle error
            return false;
        }
    }
1165718
public static function __print()
    {
        if (error_reporting() !== E_ALL) {
            return;
        }

        // Prevent output when doing AJAX/JSON requests

        if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])
            && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') {
            return;

            if (isset($_SERVER['HTTP_ACCEPT']) && in_array(
                'application/json',
                explode(',', $_SERVER['HTTP_ACCEPT']),
                true
            )) {
                return;
            }
        }

        $a = func_get_args();
        call_user_func_array(array("\Libvaloa\Debug\Debug", 'append'), $a);
    }
23591
def print_results_adj(results, indent=False, prt=sys.stdout):
        """"""
        # Print column headers if there are results to be printed
        if results:
            prt.write("{R}\n".format(R="\t".join(GOEnrichmentStudy.get_prtflds_default(results))))
        # Print the GOEA results
        for rec in results:
            prt.write("{R}\n".format(R=rec.__str__(indent=indent)))
1012538
function formatAll(results, options, showName) {
    var stdout = '';
    if (showName) {
      for (var i = 0; i < results.length; ++i) {
        stdout += results[i].path + ':\n';
        if (options.l) {
          stdout += 'total ' + results[i].size + '\n';
        }
        stdout += results[i].results;
        if (i !== results.length - 1) {
          stdout += '\n\n';
        }
      }
    } else if (results.length === 1) {
      if (options.l && !options.x) {
        stdout += 'total ' + results[0].size + '\n';
      }
      stdout += results[0].results;
    }
    return stdout;
  }
25546
public function printout($clear = true, $runlevel = null) {
		if($runlevel === null) {
			$runlevel = $this->runlevel;
		}
		foreach($this->data as $data) {
			if($runlevel <= $data[0]) {
				$this->writeLine($data[1], $runlevel, $data[2]);
			}
		}
		if($clear) {
			$this->data = array();
		}
	}
990970
def print_header
      @finding_print_index = 0
      hash = {}
      hash['statVersion'] = @statVersion
      hash['process'] = @process
      hash['findings'] = []
      result = hash.to_json
      result = result[0..result.length - 3]
      puts(result)
      puts
      $stdout.flush
    end
486411
public function printSummary() {
    drush_print();

    // Print env files used for this definition.
    drush_print($this->formatHeading('Environment Definitions Found'));
    foreach ($this->loadedEnvs as $filename) {
      drush_print("{$filename}", 1);
    }

    drush_print();
    drush_print($this->formatHeading(dt("CONFIGURATION SUMMARY")));

    // We want to make sure they are printed in the same order as they will run.
    foreach ($this->getActiveDefinition() as $group => $options) {
      // Print a nice heading.
      $heading = $this->formatHeading($group);

      switch (strtolower($group)) {
        case 'modules':
          $this->printModuleSummary($options, $heading);
          break;

        case 'variables':
          $this->printVariableSummary($options, $heading);
          break;

        case 'permissions':
          $this->printPermissionSummary($options, $heading);
          break;

        case 'commands':
          $this->printCommandSummary($options, $heading);
          break;

        default:
          drush_print($this->formatHeading($group));
          drush_log(dt("I'm not sure what to do with '@group'.", ['@group' => $group]), 'warning');
          break;
      }
    }
  }
918361
static function appendTopReport( $reportName, $reportContent )
    {
        $debug = eZDebug::instance();
        $debug->topReportsList[$reportName] = $reportContent;
    }
385940
public function output() {
		$arguments = func_get_args();
		$result = [];

		if (count($arguments) == 1) {
			$headers = $arguments[0];
			$fields = $arguments[0];
		} elseif (count($arguments == 2)) {
			$headers = $arguments[0];
			$fields = $arguments[1];
			if (count($headers) != count($fields)) {
				throw new \Exception('If headers and fields are given, both should have an equal amount of values');
			}
		} else {
			throw new \Exception('This function requires 1 or 2 arrays as parameter: The first is the header, second are the field names or closures.');
		}

		echo("<table class='Skeleton-Pager-Output-Html-" . $this->pager->get_classname() . "'>\n");
		echo("	<thead>\n");
		echo("		<tr>\n");
		foreach ($headers as $header) {
			echo("			<th class='" . $this->clean($header) . "'>" . $header . "</th>\n");
		}
		echo("		</tr>\n");
		echo("	</thead>\n");

		echo("	<tbody>\n");
		foreach ($this->pager->items as $item) {
			echo("		<tr>\n");
			foreach ($headers as $key => $header) {
				if (is_callable($fields[$key])) {
					$value = $fields[$key]($item);
				} else {
					$value = \Skeleton\Pager\Util::object_get_attribute($item, $fields[$key]);
				}
				echo("			<td class='" . $this->clean($header) . "'>" . $value . "</td>\n");
			}
			echo("		</tr>\n");
		}
		echo("	</tbody>\n");
		echo("</table>\n");
	}
556778
function TopMost()
    {
        $sql = Access::SqlBuilder();
        $tbl = PageContent::Schema()->Table();
        $where = $sql->Equals($tbl->Field('Page'), $sql->Value($this->page->GetID()))->
                And_($sql->Equals($tbl->Field('Area'), $sql->Value($this->area->GetID())))->
                And_($sql->IsNull($tbl->Field('Parent')))
                ->And_($sql->IsNull($tbl->Field('Previous')));
        
        return PageContent::Schema()->First($where);
    }
1309238
public static function topTenUser(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
    {
        $databox = $app->findDataboxById($sbas_id);
        $conn = $databox->get_connection();
        $result = [];
        $result['top_ten_doc'] = [];
        $result['top_ten_prev'] = [];
        $result['top_ten_poiddoc'] = [];
        $result['top_ten_poidprev'] = [];

        $params = [':site_id' => $app['conf']->get(['main', 'key'])];

        $datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
        $params = array_merge($params, $datefilter['params']);
/*
        $sql = "SELECT tt.usrid, tt.user, tt.final, tt.record_id, SUM(1) AS nb, SUM(size) AS poid
                FROM (
                    SELECT DISTINCT(log.id), log.usrid, user, final, log_date.record_id
                    FROM (log_docs AS log_date)
                        INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_date.log_id)
                        INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
                        WHERE log.site = :site_id
                        AND log_date.action = 'download'
                        AND (" . $datefilter['sql'] . ")" .
            (('' !== $collfilter['sql']) ?  "AND (" . $collfilter['sql'] . ")" : '')
            . "
                ) AS tt
                LEFT JOIN subdef AS s ON (s.record_id = tt.record_id)
                WHERE s.name = tt.final
                GROUP BY tt.user, tt.final";
*/
        $sql = "SELECT tt.usrid, tt.user, tt.final, tt.record_id, SUM(1) AS nb, SUM(size) AS poid\n"
            . " FROM (\n"
            . "        SELECT DISTINCT(log.id), log.usrid, user, final, log_docs.record_id\n"
            . "        FROM (log_docs)\n"
            . "            INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_docs.log_id)\n"
            . "            WHERE log.site = :site_id\n"
            . "            AND log_docs.action = 'download'\n"
            . "            AND (" . $datefilter['sql'] . ")\n"
            . ") AS tt\n"
            . "LEFT JOIN subdef AS s ON (s.record_id = tt.record_id)\n"
            . "WHERE s.name = tt.final\n"
            . "GROUP BY tt.user, tt.final";

// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);

        $stmt = $conn->prepare($sql);
        $stmt->execute($params);
        $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
        $stmt->closeCursor();

        foreach ($rs as $row) {
            $kttd = 'top_ten_doc';
            $kttp = 'top_ten_poiddoc';

            $kttpr = 'top_ten_prev';
            $kttpp = 'top_ten_poidprev';

            $id = $row['usrid'];

            if ( ! is_null($row['usrid'])
                && ! is_null($row['user'])
                && ! is_null($row['final']) && ! is_null($row['nb'])
                && ! is_null($row['poid'])) {
                if ($row['final'] == 'document') {
                    $result[$kttd][$id]['lib'] = $row['user'];
                    $result[$kttd][$id]['id'] = $id;
                    $result[$kttd][$id]['nb'] = ! is_null($row['nb']) ?
                        (int) $row['nb'] : 0;
                    $result[$kttp][$id]['nb'] = ! is_null($row['poid']) ?
                        (int) $row['poid'] : 0;
                    $result[$kttp][$id]['lib'] = $row['user'];
                    $result[$kttp][$id]['id'] = $id;
                    if ( ! isset($result[$kttd][$id]['nb']))
                        $result[$kttd][$id]['nb'] = 0;
                }
                if ($row['final'] == 'preview') {
                    $result[$kttpr][$id]['lib'] = $row['user'];
                    $result[$kttpr][$id]['id'] = $id;
                    if ( ! isset($result[$kttpr][$id]['nb']))
                        $result[$kttpr][$id]['nb'] = 0;
                    $result[$kttpr][$id]['nb'] = ! is_null($row['nb']) ?
                        (int) $row['nb'] : 0;
                    $result[$kttpp][$id]['nb'] = ! is_null($row['poid']) ?
                        (int) $row['poid'] : 0;
                    $result[$kttpp][$id]['lib'] = $row['user'];
                    $result[$kttpp][$id]['id'] = $id;
                }
            }
        }

        return $result;
    }
793979
def show_top(**kwargs):
    '''
    
    '''
    __opts__['grains'] = __grains__
    opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)
    st_ = salt.client.ssh.state.SSHHighState(
            opts,
            __pillar__,
            __salt__,
            __context__['fileclient'])
    top_data = st_.get_top()
    errors = []
    errors += st_.verify_tops(top_data)
    if errors:
        return errors
    matches = st_.top_matches(top_data)
    return matches
403096
def print_report_on_all_logs() -> None:
    
    d = {}
    # noinspection PyUnresolvedReferences
    for name, obj in logging.Logger.manager.loggerDict.items():
        d[name] = get_log_report(obj)
    rootlogger = logging.getLogger()
    d['(root logger)'] = get_log_report(rootlogger)
    print(json.dumps(d, sort_keys=True, indent=4, separators=(',', ': ')))
52120
function dump($return = false, $print = true, $depth = 1)
    {
        $dump = array();
        $dump['count'] = $this->count;
        $dump['results'] = array();
        foreach ((array)$this->records() as $key => $record) {
            if ($record instanceof Resource) {
                $dump['results'][$key] = $record->data();
                foreach ($record->links as $field => $link) {
                    if ($depth < 1) {
                        try {
                            $link_record = $record[$field];
                        } catch (ServerException $e) {
                            $link_record = array('$error' => $e->getMessage());
                        }

                        if ($link_record instanceof Resource) {
                            $dump['results'][$key][$field] = $link_record->dump(true, false, $depth+1);
                        } else {
                            $dump['results'][$key][$field] = $link_record;
                        }
                    }
                }
            }
        }
        if ($dump['results'] && $links = $this->links) {
            $dump['$links'] = $this->dump_links($links);
        }
        if ($dump['count'] > 0) {
            $dump['page'] = $this->page;
        }
        if ($this->pages) {
            $dump['pages'] = $this->pages;
        }
        
        if ($print) {
            return print_r($dump, $return);
        } else {
            return $dump;
        }
    }
466858
def print_all(self, out=sys.stdout):
        
        THREAD_FUNC_NAME_LEN = 25
        THREAD_NAME_LEN = 13
        THREAD_ID_LEN = 15
        THREAD_SCHED_CNT_LEN = 10

        out.write(CRLF)
        out.write("name           tid              ttot      scnt")
        out.write(CRLF)
        for stat in self:
            out.write(StatString(stat.name).ltrim(THREAD_NAME_LEN))
            out.write(" " * COLUMN_GAP)
            out.write(StatString(stat.id).rtrim(THREAD_ID_LEN))            
            out.write(" " * COLUMN_GAP)
            out.write(StatString(_fft(stat.ttot)).rtrim(TIME_COLUMN_LEN))
            out.write(" " * COLUMN_GAP)
            out.write(StatString(stat.sched_count).rtrim(THREAD_SCHED_CNT_LEN))
            out.write(CRLF)
564129
public static function getTopStates($t_state_v, $top_k = 4, $options = array())
    {
        arsort($t_state_v);

        $top_states = array_slice($t_state_v, 0, $top_k);

        return $top_states;
    }