def add_config(self, config, parent=None, copy_dir=None):
        config_dir = os.path.join(self.path, CONFIG_DIR, config)
        if os.path.exists(config_dir):
            raise errors.UserError(
                "%s: config %r already exists" % (self.name, config))

        if copy_dir:
            try:
                shutil.copytree(copy_dir, config_dir, symlinks=True)
            except (IOError, __HOLE__) as error:
                raise errors.Error("copying config files failed: %s: %s" % (
                        error.__class__.__name__, error))
        else:
            os.makedirs(config_dir)

        conf_file = os.path.join(config_dir, CONFIG_CONF_FILE)
        conf = {}
        if parent:
            conf["parent"] = parent

        util.json_dump(conf, conf_file)

        settings_dir = os.path.join(config_dir, SETTINGS_DIR)
        if not os.path.exists(settings_dir):
            os.mkdir(settings_dir)  # pre-created so it is there for copying files
dataset/ETHPy150Open ohmu/poni/poni/core.py/Node.add_config