def create_config(self, advanced_config=False):
        """
        Either creates a new configuration file or overwrites an existing one. Will ask the user for input on configurable properties
        and writes them to the configuration file in ~/.rally/rally.ini.

        :param advanced_config: Whether to ask for properties that are not necessary for everyday use (on a dev machine). Default: False.
        """
        if self.config_present():
            print("\nWARNING: Will overwrite existing config file at [%s]\n" % self._config_file.location)
        else:
            print("Rally has not detected any configuration file at %s. It will ask a few questions about the environment.\n\n" %
                  self._config_file.location)

        print("The benchmark root directory contains benchmark data, logs, etc. . It will consume several GB of free space depending on "
              "which benchmarks are executed (expect at least 10 GB).")
        benchmark_root_dir = self._ask_property("Enter the benchmark root directory (will be created automatically)")
        env_name = self._ask_env_name()

        only_binary = self._ask_property("Do you want to benchmark only official binary distributions of Elasticsearch? Note: If you "
                                         "answer with 'Yes' you will not need certain software (like Gradle or git) but you will not "
                                         "be able to benchmark the latest development versions from Elasticsearch unless you reconfigure "
                                         "Rally with esrally --configure again.",
                                         check_pattern=Config.BOOLEAN_PATTERN, default_value="No")

        if not (self._to_bool(only_binary)):
            default_src_dir = "%s/src" % benchmark_root_dir
            source_dir = self._ask_property("Enter the directory where sources are located (your Elasticsearch project directory)",
                                            default_value=default_src_dir)
            # Not everybody might have SSH access. Play safe with the default. It may be slower but this will work for everybody.
            repo_url = self._ask_property("Enter the Elasticsearch repo URL", default_value="https://github.com/elastic/elasticsearch.git")
            default_gradle_location = io.guess_install_location("gradle", fallback="/usr/local/bin/gradle")
            gradle_bin = self._ask_property("Enter the full path to the Gradle binary", default_value=default_gradle_location,
                                            check_path_exists=True)
            if advanced_config:
                default_mvn_location = io.guess_install_location("mvn", fallback="/usr/local/bin/mvn")
                maven_bin = self._ask_property("Enter the full path to the Maven 3 binary", default_value=default_mvn_location,
                                               check_path_exists=True)
            else:
                maven_bin = ""
        default_jdk_8 = io.guess_java_home(major_version=8, fallback="")
        jdk8_home = self._ask_property(
            "Enter the JDK 8 root directory (e.g. something like /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home on a Mac)",
            default_value=default_jdk_8,
            check_path_exists=True)
        if advanced_config:
            stats_disk_device = self._ask_property("Enter the HDD device name for stats (e.g. /dev/disk1)")
        else:
            stats_disk_device = ""

        data_store_host, data_store_port, data_store_secure, data_store_user, data_store_password = self._ask_data_store()

        config = configparser.ConfigParser()
        config["meta"] = {}
        config["meta"]["config.version"] = str(self.CURRENT_CONFIG_VERSION)

        config["system"] = {}
        config["system"]["root.dir"] = benchmark_root_dir
        config["system"]["log.root.dir"] = "logs"
        config["system"]["env.name"] = env_name

        if not (self._to_bool(only_binary)):
            config["source"] = {}
            config["source"]["local.src.dir"] = source_dir
            config["source"]["remote.repo.url"] = repo_url

            config["build"] = {}
            config["build"]["gradle.bin"] = gradle_bin
            config["build"]["maven.bin"] = maven_bin

        config["provisioning"] = {}
        config["provisioning"]["local.install.dir"] = "install"

        config["runtime"] = {}
        config["runtime"]["java8.home"] = jdk8_home

        config["benchmarks"] = {}
        config["benchmarks"]["local.dataset.cache"] = "${system:root.dir}/data"
        config["benchmarks"]["metrics.stats.disk.device"] = stats_disk_device

        config["reporting"] = {}
        config["reporting"]["datastore.host"] = data_store_host
        config["reporting"]["datastore.port"] = data_store_port
        config["reporting"]["datastore.secure"] = data_store_secure
        config["reporting"]["datastore.user"] = data_store_user
        config["reporting"]["datastore.password"] = data_store_password

        self._config_file.store(config)

        print("\nConfiguration successfully written to '%s'. Please rerun esrally now." % self._config_file.location)
dataset/ETHPy150Open elastic/rally/esrally/config.py/Config.create_config/original