Retrieve the author list from the given path via calling git.

@return array
355912
private function getAuthorListFrom()
    {
        $filePath = $this->getFilePathCollection($this->currentPath);

        $authors = [];
        foreach ((array) $filePath['commits'] as $commit) {
            if ($this->isMergeCommit($commit)
                || isset($authors[\md5($commit['name'])])
            ) {
                continue;
            }

            $authors[\md5($commit['name'])] = $commit;
        }

        if (isset($filePath['pathHistory'])) {
            foreach ((array) $filePath['pathHistory'] as $pathHistory) {
                foreach ((array) $pathHistory['commits'] as $commitHistory) {
                    if ($this->isMergeCommit($commitHistory)
                        || isset($authors[\md5($commitHistory['name'])])
                    ) {
                        continue;
                    }

                    $authors[\md5($commitHistory['name'])] = $commitHistory;
                }
            }
        }

        return $authors;
    }
57042
public function getCandidateAuthors()
    {
        if ($this->config()->get('restrict_authors_to_group')) {
            return Group::get()->filter('Code', $this->config()->get('restrict_authors_to_group'))->first()->Members();
        }

        $list = Member::get();
        $this->extend('updateCandidateAuthors', $list);
        return $list;
    }
832906
public function listPagesBuilds(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages/builds',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
    }
630272
public function getAuthors()
    {
        if (is_array($this->_authors)) return $this->_authors;
        $this->_authors = array();
        if(!isset($this->_packageXml->authors->author)) {
            return array();
        }
        foreach ($this->_packageXml->authors->author as $_author) {
            $this->_authors[] = array(
                'name' => (string)$_author->name,
                'user' => (string)$_author->user,
                'email'=> (string)$_author->email
            );
        }
        return $this->_authors;
    }
919541
public function getSingleCommit(string $sha): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:sha',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha));
    }
52507
public function findAllFiles(DirectoryPath $path = null)
    {
        if (null === $path) {
            $path = new DirectoryPath();
        }

        $finder = new Finder();
        $searchPath = $path->prepend($this->gitService->getRepositoryPath());

        $finder->in($searchPath->toAbsoluteString(DIRECTORY_SEPARATOR));

        $filePaths = [];

        foreach ($finder->files() as $file) {
            /** @var SplFileInfo $file */
            $filePaths[] = FilePath::parse('/' . $file->getRelativePathname())->prepend($path);
        }

        return $filePaths;
    }
1327360
public function getCopyLeftAuthors($pathName)
    {
        $result = [];
        foreach ($this->copyLeft as $author => $paths) {
            if ($this->matchPatterns($pathName, $paths)) {
                $realAuthor                           = $this->getRealAuthor($this->copyLeftReal[$author]);
                $result[$this->arrayKey($realAuthor)] = $realAuthor;
            }
        }

        return $result;
    }
88158
public function getGitHubUrlInfo()
    {
        $info = $this->getGithubInfo();

        if (isset($info['url'])) {
            $matches = [];
            $pattern = '/(?:https?:\/\/github.com\/|git\@.+\:)([\w\/\-\_]+)/';

            if (preg_match($pattern, $info['url'], $matches)) {
                list($account, $repo) = explode(
                    DIRECTORY_SEPARATOR,
                    $matches[1]
                );

                return [
                    'account' => $account,
                    'repository' => $repo,
                ];
            }
        }

        return [];
    }
836083
public function list(string $commit, string $path, array $params = [])
    {
        $path = $this->buildFileHistoryPath($commit, ...explode('/', $path));

        return $this->get($path, $params);
    }
932195
public function getMethods($path) {
		if ($this->methods->has($path)) {
			return $this->methods->get($path)->toArray();
		}

		return [];
	}
1278746
public function getMappingFiles($path)
    {
        $files = $this->files->glob($path.'/*_*.php');

        if ($files === false) {
            return [];
        }

        $files = array_map(function ($file) {
            return str_replace('.php', '', basename($file));
        }, $files);

        return $files;
    }
236066
public function get_listing($path = '', $page = '') {
        global $USER, $OUTPUT;
        $itemid = optional_param('itemid', 0, PARAM_INT);
        $env = optional_param('env', 'filepicker', PARAM_ALPHA);
        $ret = array(
            'dynload' => true,
            'nosearch' => true,
            'nologin' => true,
            'list' => array(),
        );
        if (empty($itemid) || $env !== 'editor') {
            return $ret;
        }

        // In the most cases files embedded in textarea do not have subfolders. Do not show path by default.
        $retpath = array(array('name' => get_string('files'), 'path' => ''));
        if (!empty($path)) {
            $pathchunks = preg_split('|/|', trim($path, '/'));
            foreach ($pathchunks as $i => $chunk) {
                $retpath[] = array(
                    'name' => $chunk,
                    'path' => '/'. join('/', array_slice($pathchunks, 0, $i + 1)). '/'
                );
            }
            $ret['path'] = $retpath; // Show path if already inside subfolder.
        }

        $context = context_user::instance($USER->id);
        $fs = get_file_storage();
        $files = $fs->get_directory_files($context->id, 'user', 'draft', $itemid,
                empty($path) ? '/' : $path, false, true);
        foreach ($files as $file) {
            if ($file->is_directory()) {
                $node = array(
                    'title' => basename($file->get_filepath()),
                    'path' => $file->get_filepath(),
                    'children' => array(),
                    'datemodified' => $file->get_timemodified(),
                    'datecreated' => $file->get_timecreated(),
                    'icon' => $OUTPUT->image_url(file_folder_icon(24))->out(false),
                    'thumbnail' => $OUTPUT->image_url(file_folder_icon(90))->out(false)
                );
                $ret['list'][] = $node;
                $ret['path'] = $retpath; // Show path if subfolders exist.
                continue;
            }
            $fileurl = moodle_url::make_draftfile_url($itemid, $file->get_filepath(), $file->get_filename());
            $node = array(
                'title' => $file->get_filename(),
                'size' => $file->get_filesize(),
                'source' => $fileurl->out(),
                'datemodified' => $file->get_timemodified(),
                'datecreated' => $file->get_timecreated(),
                'author' => $file->get_author(),
                'license' => $file->get_license(),
                'isref' => $file->is_external_file(),
                'iscontrolledlink' => $file->is_controlled_link(),
                'icon' => $OUTPUT->image_url(file_file_icon($file, 24))->out(false),
                'thumbnail' => $OUTPUT->image_url(file_file_icon($file, 90))->out(false)
            );
            if ($file->get_status() == 666) {
                $node['originalmissing'] = true;
            }
            if ($imageinfo = $file->get_imageinfo()) {
                $node['realthumbnail'] = $fileurl->out(false, array('preview' => 'thumb', 'oid' => $file->get_timemodified()));
                $node['realicon'] = $fileurl->out(false, array('preview' => 'tinyicon', 'oid' => $file->get_timemodified()));
                $node['image_width'] = $imageinfo['width'];
                $node['image_height'] = $imageinfo['height'];
            }
            $ret['list'][] = $node;
        }
        $ret['list'] = array_filter($ret['list'], array($this, 'filter'));
        return $ret;
    }
972880
public function getCommitActivity(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/commit_activity',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
    }
1163632
public function getRepoUrl()
    {
        switch ($this->type) {
            case 'github':
                return "git@github.com:{$this->name}.git";

            case 'github-https':
                return "https://github.com/{$this->name}.git";

            case 'gitlab':
                return "git@gitlab.com:{$this->name}.git";
                break;

            case 'bitbucket':
                return "git@bitbucket.org:{$this->name}.git";

            default:

                // Check of type 'scheme://host/path'
                if (filter_var($this->type, FILTER_VALIDATE_URL)) {
                    return $this->type;
                }

                // Check of type 'user@host'
                if (filter_var($this->type, FILTER_VALIDATE_EMAIL)) {
                    return "{$this->type}:{$this->name}.git";
                }

                return;
                break;
        }
    }
717892
protected function loadModulePath($path, $locale, $name,$author)
    {
        if ($this->files->exists($full = "{$path}/{$author}/{$name}/translate/{$locale}.php")) {
            return $this->files->getRequire($full);
        }
        return [];
    }
1019188
def get_git_info():
    """"""
    start_dir = abspath(curdir)
    try:
        chdir(dirname(abspath(__file__)))
        re_patt_str = (r'commit\s+(?P<commit_hash>\w+).*?Author:\s+'
                       r'(?P<author_name>.*?)\s+<(?P<author_email>.*?)>\s+Date:\s+'
                       r'(?P<date>.*?)\n\s+(?P<commit_msg>.*?)(?:\ndiff.*?)?$')
        show_out = check_output(['git', 'show']).decode('ascii')
        revp_out = check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])
        revp_out = revp_out.decode('ascii').strip()
        m = re.search(re_patt_str, show_out, re.DOTALL)
        assert m is not None, \
            "Regex pattern:\n\n\"%s\"\n\n failed to match string:\n\n\"%s\"" \
            % (re_patt_str, show_out)
        ret_dict = m.groupdict()
        ret_dict['branch_name'] = revp_out
    finally:
        chdir(start_dir)
    return ret_dict
1136724
public function getList(): array {
        $this->_verifyPath();

        // strip off preceding slash, add trailing one.
        $path = substr($this->_config['path'], 1) . '/';
        return $this->_getApi()->listObjects([
            'Bucket' => $this->_config['bucket'],
            'Prefix' => $path
        ])->get('Contents');
    }