(path: Optional[Path] = None)
| 9 | |
| 10 | |
| 11 | def get_config(path: Optional[Path] = None): |
| 12 | p = path or Path.cwd().resolve() / ".codecarbon.config" |
| 13 | |
| 14 | if p.exists(): |
| 15 | config = configparser.ConfigParser() |
| 16 | config.read(str(p)) |
| 17 | if "codecarbon" in config.sections(): |
| 18 | d = dict(config["codecarbon"]) |
| 19 | return d |
| 20 | |
| 21 | else: |
| 22 | raise FileNotFoundError( |
| 23 | "No .codecarbon.config file found in the current directory." |
| 24 | ) |
| 25 | |
| 26 | |
| 27 | def get_api_endpoint(path: Optional[Path] = None): |
no outgoing calls
no test coverage detected
searching dependent graphs…