(config_name, value, path: Optional[Path] = None)
| 67 | |
| 68 | |
| 69 | def overwrite_local_config(config_name, value, path: Optional[Path] = None): |
| 70 | p = path or Path.cwd().resolve() / ".codecarbon.config" |
| 71 | |
| 72 | config = configparser.ConfigParser() |
| 73 | if p.exists(): |
| 74 | config.read(str(p)) |
| 75 | if "codecarbon" not in config.sections(): |
| 76 | config.add_section("codecarbon") |
| 77 | |
| 78 | config["codecarbon"][config_name] = value |
| 79 | with p.open("w") as f: |
| 80 | config.write(f) |
| 81 | |
| 82 | |
| 83 | def create_new_config_file(): |
no outgoing calls
no test coverage detected
searching dependent graphs…