@classmethod
def discover(cls, conf, repo, environments, commit_hash, regex=None, check=
    False):
    """
        Discover benchmarks in the given `benchmark_dir`.

        Parameters
        ----------
        conf : Config object
            The project's configuration

        repo : Repo object
            The project's repository

        environments : list of Environment
            List of environments available for benchmark discovery.

        commit_hash : list of str
            Commit hashes to use for benchmark discovery.

        regex : str or list of str, optional
            `regex` is a list of regular expressions matching the
            benchmarks to run.  If none are provided, all benchmarks
            are run.

        check : bool
            Run additional checks after discovery.

        """
    benchmarks = cls._disc_benchmarks(conf, repo, environments, commit_hash,
        check)
    return cls(conf, benchmarks, regex=regex)
