Gives you evidence structure. You can obtain current online by pre-calling:
$this->updateColumnsInfo($evidence, $this->getOnlineColumnsInfo($evidence));

@param string $evidence

@return array
765360
public function getColumnsInfo($evidence = null)
    {
        $evidence = is_null($evidence) ? $this->getEvidence() : $evidence;
        if (!array_key_exists($evidence, $this->columnsInfo)) {
            $this->updateColumnsInfo($this->getOfflineColumnsInfo($evidence),
                $evidence);
        }
        return $this->columnsInfo[$evidence];
    }
864560
protected function getAlterTableInfo($table)
    {
        $columns = $table->getColumns();
        $indexes = $table->getIndexes();
        $name    = $table->getName();

        $databaseService = new DatabaseService($this->config, $this->files);
        $upMigrations    = [
            'columns' => [
                'add'  => [],
                'drop' => [],
            ],
            'indexes' => [
                'add'  => [],
                'drop' => [],
            ],
        ];
        $downMigrations  = [
            'columns' => [
                'add'  => [],
                'drop' => [],
            ],
            'indexes' => [
                'add'  => [],
                'drop' => [],
            ],
        ];

        $updated = false;

        $currentColumns = $databaseService->getTableColumns($name);
        $newColumnNames = array_map(function ($column) {
            return $column->getName();
        }, $columns);
        $oldColumnNames = array_map(function ($column) {
            return $column->getName();
        }, $currentColumns);

        $mustHaveColumns = ['created_at', 'updated_at'];
        foreach ($mustHaveColumns as $column) {
            if (!in_array($column, $newColumnNames)) {
                $newColumnNames[] = $column;
            }
            if (!in_array($column, $oldColumnNames)) {
                $oldColumnNames[] = $column;
            }
        }

        $addedColumns   = array_diff($newColumnNames, $oldColumnNames);
        $removedColumns = array_diff($oldColumnNames, $newColumnNames);

        $previousColumnName = '';
        foreach ($columns as $column) {
            if (in_array($column->getName(), $addedColumns)) {
                $columnObject = new Column($column);

                $upMigrations['columns']['add'][]    = $columnObject->generateAddMigration($previousColumnName).';';
                $downMigrations['columns']['drop'][] = $columnObject->generateDropMigration().';';
                $updated                             = true;
            }
            $previousColumnName = $column->getName();
        }

        $previousColumnName = '';
        foreach ($currentColumns as $column) {
            if (in_array($column->getName(), $removedColumns)) {
                $columnObject = new Column($column);

                $upMigrations['columns']['drop'][]  = $columnObject->generateDropMigration().';';
                $downMigrations['columns']['add'][] = $columnObject->generateAddMigration($previousColumnName).';';
                $updated                            = true;
            }
            $previousColumnName = $column->getName();
        }

        $currentIndexes = $databaseService->getTableIndexes($name);
        $newIndexNames  = array_map(function ($index) {
            return $index->getName();
        }, $indexes);
        $oldIndexNames  = array_map(function ($index) {
            return $index->getName();
        }, $currentIndexes);

        $addedIndexes   = array_diff($newIndexNames, $oldIndexNames);
        $removedIndexes = array_diff($oldIndexNames, $newIndexNames);

        foreach ($indexes as $index) {
            if (in_array($index->getName(), $addedIndexes)) {
                $indexObject = new Index($index);

                $upMigrations['indexes']['add'][]    = $indexObject->generateAddMigration().';';
                $downMigrations['indexes']['drop'][] = $indexObject->generateDropMigration().';';
                $updated                             = true;
            }
        }

        foreach ($currentIndexes as $index) {
            if (in_array($index->getName(), $removedIndexes)) {
                $indexObject = new Index($index);

                $upMigrations['indexes']['drop'][]  = $indexObject->generateDropMigration().';';
                $downMigrations['indexes']['add'][] = $indexObject->generateAddMigration().';';
                $updated                            = true;
            }
        }

        if (!$updated) {
            return false;
        }

        return [
            'upMigrations'   => $upMigrations,
            'downMigrations' => $downMigrations,
        ];
    }
679606
private String build(Evidence evidence) {
        VelocityContext context = new VelocityContext();
        StringWriter writer = new StringWriter();
        context.put("records", evidence.getRecords());
        context.put("caseNo", evidence.getCaseNo());
        context.put("testScriptName", evidence.getScriptName());
        context.put("result", (evidence.hasError()) ? "NG" : "");

        Future<?> screenshotRezeFuture = evidence.getScreenshotResizeFuture();

        if (screenshotRezeFuture != null) {
            try {
                screenshotRezeFuture.get(3, TimeUnit.SECONDS);
            } catch (InterruptedException | ExecutionException | TimeoutException e) {
                LOG.warn("screenshot.resize.wait.error", e);
            }
        }

        tmpl.merge(context, writer);
        return writer.toString();
    }
1288822
def _get_evidence(self, trigger_id, args, agent_coords, site_coords):
        """"""
        trigger_info = self._entity_dict[trigger_id]

        # Get the sentence index from the trigger word.
        s_idx_set = {self._entity_dict[eid]['sentenceIndex']
                     for eid in args.values()
                     if 'sentenceIndex' in self._entity_dict[eid]}
        if s_idx_set:
            i_min = min(s_idx_set)
            i_max = max(s_idx_set)

            text = '. '.join(self._sentences[i_min:(i_max+1)]) + '.'

            s_start = self._sentence_starts[i_min]
            annotations = {
                'agents': {'coords': [_fix_coords(coords, s_start)
                                      for coords in agent_coords]},
                'trigger': {'coords': _fix_coords([trigger_info['charStart'],
                                                   trigger_info['charEnd']],
                                                  s_start)}
                }
        else:
            logger.info('Unable to get sentence index')
            annotations = {}
            text = None
        if site_coords:
            annotations['site'] = {'coords': _fix_coords(site_coords, s_start)}

        return Evidence(text_refs=self._text_refs.copy(), text=text,
                        source_api='rlimsp', pmid=self._text_refs.get('PMID'),
                        annotations=annotations)
672904
protected function getUpgradeLogColumnNames() {
		$colNames = array();
		foreach( array('time','script filename','script file hash') as $attrib ) {
			$colNames[self::toLowerCamelCase($attrib)] = $this->toDbObjectName($attrib);
		}
		return $colNames;
	}
1162773
public function extractResultIDs($resultInfo)
    {
        $candidates = [];
        foreach ($resultInfo as $insertResult) {
            $newID = $insertResult['id'];
            if (array_key_exists('request-id', $insertResult)) {
                $extid = $insertResult['request-id'];
            } else {
                $extid = null;
            }
            $evidence                      = explode('/', $insertResult['ref'])[3];
            $candidates[$evidence][$extid] = $newID;
        }
        return $candidates;
    }
1208156
protected static function transform_user_evidence($userid, user_evidence $ue) {
        $options = ['context' => $ue->get_context()];
        return [
            'name' => format_string($ue->get('name'), true, $options),
            'description' => format_text($ue->get('description'), $ue->get('descriptionformat'), $options),
            'url' => $ue->get('url'),
            'timecreated' => $ue->get('timecreated') ? transform::datetime($ue->get('timecreated')) : '-',
            'timemodified' => $ue->get('timemodified') ? transform::datetime($ue->get('timemodified')) : '-',
            'created_or_modified_by_you' => transform::yesno($ue->get('usermodified') == $userid),
            'competencies' => []
        ];
    }
108686
public function getPastRowFromCurrent(Row $row)
    {
        $pastData = $this->getPastDataTable();
        if (empty($pastData)) {
            return null;
        }

        $label = $row->getColumn('label');
        return $label ? $pastData->getRowFromLabel($label) : $pastData->getFirstRow();
    }
19119
public static function list_user_evidence($userid) {
        static::require_enabled();
        if (!user_evidence::can_read_user($userid)) {
            $context = context_user::instance($userid);
            throw new required_capability_exception($context, 'moodle/competency:userevidenceview', 'nopermissions', '');
        }

        $evidence = user_evidence::get_records(array('userid' => $userid), 'name');
        return $evidence;
    }
84213
public function getRelationsInfo($evidence = null)
    {
        $relationsInfo = null;
        if (is_null($evidence)) {
            $evidence = $this->getEvidence();
        }
        $propsName = lcfirst(FlexiBeeRO::evidenceToClassName($evidence));
        if (isset(\FlexiPeeHP\Relations::$$propsName)) {
            $relationsInfo = Relations::$$propsName;
        }
        return $relationsInfo;
    }
495407
public function getColumnDetails($refresh = false)
    {
        if (empty($this->columnCache) || $refresh) {
            $query = PostgresqlGrammar::showTableColumns($this->db->replacePrefix($this->getName()));

            $fields = $this->db->setQuery($query)->loadAll();

            $result = [];

            foreach ($fields as $field) {
                // Do some dirty translation to MySQL output.
                $result[$field->column_name] = (object) [
                    'column_name' => $field->column_name,
                    'type' => $field->column_type,
                    'null' => $field->Null,
                    'Default' => $field->Default,
                    'Field' => $field->column_name,
                    'Type' => $field->column_type,
                    'Null' => $field->Null,
                    'Extra' => null,
                    'Privileges' => null,
                    'Comment' => $field->Comment,
                    'Key' => '',
                ];
            }

            $keys = $this->getIndexes();

            foreach ($result as $field) {
                if (strpos($field->Default, 'nextval') !== false) {
                    $field->Extra = 'auto_increment';
                    $field->Default = 0;
                }

                if (preg_match("/^NULL::*/", $field->Default)) {
                    $field->Default = null;
                }

                if (preg_match("/'(.*)'::[\w\s]/", $field->Default, $matches)) {
                    $field->Default = $matches[1] ?? '';
                }

                if (strpos($field->Type, 'character varying') !== false) {
                    $field->Type = str_replace('character varying', 'varchar', $field->Type);
                }

                // Find key
                $index = null;

                foreach ($keys as $key) {
                    if ($key->column_name == $field->column_name) {
                        $index = $key;
                        break;
                    }
                }

                if ($index) {
                    if ($index->is_primary) {
                        $field->Key = 'PRI';
                    } elseif ($index->is_unique) {
                        $field->Key = 'UNI';
                    } else {
                        $field->Key = 'MUL';
                    }
                }
            }

            $this->columnCache = $result;
        }

        return $this->columnCache;
    }
828927
public function getActionsInfo($evidence = null)
    {
        $actionsInfo = null;
        if (is_null($evidence)) {
            $evidence = $this->getEvidence();
        }
        $propsName = lcfirst(FlexiBeeRO::evidenceToClassName($evidence));
        if (isset(\FlexiPeeHP\Actions::$$propsName)) {
            $actionsInfo = Actions::$$propsName;
        }
        return $actionsInfo;
    }
1021028
public function deserialize(array $data, Evidence $evidence = null, array $options = [])
    {
        $this->sipe('narrative', 'setNarrative', $data, $evidence);
        $this->sipe('name', 'setName', $data, $evidence);

        if (isset($data['resources'])) {
            $resources = [];
            foreach ($data['resources'] as $resource) {
                $node = $this->_om->getObject($resource, ResourceNode::class);
                $resources[] = $this->resourceNodeSerializer->deserialize($resource, $node);
            }
            $evidence->setResourceEvidences($resources);
        }
    }
172414
def get_or_create_evidence(self, citation: Citation, text: str) -> Evidence:
        """"""
        sha512 = hash_evidence(text=text, type=str(citation.type), reference=str(citation.reference))

        if sha512 in self.object_cache_evidence:
            evidence = self.object_cache_evidence[sha512]
            self.session.add(evidence)
            return evidence

        evidence = self.get_evidence_by_hash(sha512)

        if evidence is not None:
            self.object_cache_evidence[sha512] = evidence
            return evidence

        evidence = Evidence(
            text=text,
            citation=citation,
            sha512=sha512,
        )

        self.session.add(evidence)
        self.object_cache_evidence[sha512] = evidence
        return evidence
271526
public static function getBlameds($blame)
    {
        if (is_string($blame)) {
            $blame = static::getBlame($blame);
        }
        if (empty($blame)) {
            return [];
        }
        $noInit = static::buildNoInitModel();
        /* @var $noInit static */
        return static::find()->createdBy($blame->host)->
                andWhere(['like', $noInit->multiBlamesAttribute, $blame->getGUID()])->all();
    }
962685
public function setFormat($format)
    {
        $result = true;
        if (($this->debug === true) && !empty($this->evidence) && isset(Formats::$$this->evidence)) {
            if (array_key_exists($format, array_flip(Formats::$$this->evidence))
                === false) {
                $result = false;
            }
        }
        if ($result === true) {
            $this->format = $format;
            $this->updateApiURL();
        }
        return $result;
    }
937492
public static function update_user_evidence($data, $draftitemid = null) {
        static::require_enabled();
        $userevidence = new user_evidence($data->id);
        $context = $userevidence->get_context();

        if (!$userevidence->can_manage()) {
            throw new required_capability_exception($context, 'moodle/competency:userevidencemanage', 'nopermissions', '');

        } else if (array_key_exists('userid', $data) && $data->userid != $userevidence->get('userid')) {
            throw new coding_exception('Can not change the userid of a user evidence.');
        }

        $userevidence->from_record($data);
        $userevidence->update();

        if (!empty($draftitemid)) {
            $fileareaoptions = array('subdirs' => true);
            $itemid = $userevidence->get('id');
            file_save_draft_area_files($draftitemid, $context->id, 'core_competency', 'userevidence', $itemid, $fileareaoptions);
        }

        // Trigger an evidence of prior learning updated event.
        \core\event\competency_user_evidence_updated::create_from_user_evidence($userevidence)->trigger();

        return $userevidence;
    }