Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /mattyopon_faultray /src /faultray /features.py
| # Copyright (c) 2025-2026 Yutaro Maeda. All rights reserved. | |
| # Licensed under the Apache License 2.0. See LICENSE file for details. | |
| """Feature flags for graceful degradation.""" | |
| from __future__ import annotations | |
| FEATURES: dict[str, bool] = { | |
| "cascade_engine": True, | |
| "dynamic_engine": True, | |
| "ops_engine": True, | |
| "whatif_engine": True, | |
| "capacity_engine": True, | |
| "cost_engine": True, | |
| "security_engine": True, | |
| "compliance_engine": True, | |
| "dr_engine": True, | |
| "predictive_engine": True, | |
| "gameday_engine": True, | |
| "markov_model": True, | |
| "bayesian_model": True, | |
| "advisor_engine": True, | |
| "feed_threat_data": True, | |
| "prometheus_integration": True, | |
| "plugin_system": True, | |
| } | |
| def is_enabled(feature: str) -> bool: | |
| """Check if a feature flag is enabled. Defaults to True for unknown features.""" | |
| return FEATURES.get(feature, True) | |
| def disable(feature: str) -> None: | |
| """Disable a feature flag.""" | |
| FEATURES[feature] = False | |
| def enable(feature: str) -> None: | |
| """Enable a feature flag.""" | |
| FEATURES[feature] = True | |
| def reset_all() -> None: | |
| """Reset all feature flags to True (useful for testing).""" | |
| for key in FEATURES: | |
| FEATURES[key] = True | |
| def list_features() -> dict[str, bool]: | |
| """Return a copy of all feature flags.""" | |
| return dict(FEATURES) | |
Xet Storage Details
- Size:
- 1.35 kB
- Xet hash:
- 5f71b2e609f544f5f896817b891fccc3c78f7ba33dfd40ae03599b3bfb60aa1a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.