# Path: slo_generator/utils.py
#     GCS_ENABLED = True
#     GCS_ENABLED = False
# LOGGER = logging.getLogger(__name__)
# def load_configs(path, ctx=os.environ, kind=None):
# def load_config(path, ctx=os.environ, kind=None):
# def parse_config(path=None, content=None, ctx=os.environ):
#     def replace_env_vars(content, ctx):
# def setup_logging():
# def get_human_time(timestamp, timezone=None):
# def get_exporters(config, spec):
# def get_backend(config, spec):
# def get_error_budget_policy(config, spec):
# def get_backend_cls(backend):
# def get_exporter_cls(exporter):
# def import_cls(cls_name, expected_type):
# def import_dynamic(package, name, prefix="class"):
# def capitalize(word):
# def snake_to_caml(word):
# def caml_to_snake(word):
# def dict_snake_to_caml(data):
# def apply_func_dict(data, func):
# def str2bool(string):
# def download_gcs_file(url):
# def decode_gcs_url(url):
# def get_files(source, extensions=['yaml', 'yml', 'json']):
# def get_target_path(source_dir, target_dir, relative_path, mkdir=True):
# def fmt_traceback(exc):
# 
# Path: slo_generator/constants.py
# COLORED_OUTPUT = int(os.environ.get("COLORED_OUTPUT", "0"))
# 
# MIN_VALID_EVENTS = int(os.environ.get("MIN_VALID_EVENTS", "1"))
# 
# NO_DATA = -1
# 
# class Colors:
#     """Colors for console output."""
#     HEADER = '\033[95m'
#     OKBLUE = '\033[94m'
#     OKGREEN = '\033[92m'
#     WARNING = '\033[93m'
#     FAIL = '\033[91m'
#     ENDC = '\033[0m'
#     BOLD = '\033[1m'
#     UNDERLINE = '\033[4m'


import logging
from dataclasses import asdict, dataclass, fields, field
from slo_generator import utils
from slo_generator.constants import (COLORED_OUTPUT, MIN_VALID_EVENTS, NO_DATA,
                                     Colors)

            # Tuple should contain only elements of type int or float
            if not all(isinstance(n, (float, int)) for n in data):
                error = (
                    'Backend method returned a tuple with some elements having'
                    ' a type different than float or int')
                self.errors.append(error)
                return False

            # Tuple should not contain any element with value None.
            if good is None or bad is None:
                error = (
                    f'Backend method returned a valid tuple {data} but one of '
                    'the values is None.')
                self.errors.append(error)
                return False

            # Tuple should not have NO_DATA everywhere
            if (good, bad) == (NO_DATA, NO_DATA):
                error = (
                    f'Backend method returned a valid tuple {data} but the '
                    'good and bad count is NO_DATA (-1).')
                self.errors.append(error)
                return False

            # Tuple should not have elements where the sum is inferior to our
            # minimum valid events threshold
            if (good + bad) < MIN_VALID_EVENTS:
                error = (
                    f'Not enough valid events ({good + bad}) found. Minimum '

# Path: slo_generator/utils.py
#     GCS_ENABLED = True
#     GCS_ENABLED = False
# LOGGER = logging.getLogger(__name__)
# def load_configs(path, ctx=os.environ, kind=None):
# def load_config(path, ctx=os.environ, kind=None):
# def parse_config(path=None, content=None, ctx=os.environ):
#     def replace_env_vars(content, ctx):
# def setup_logging():
# def get_human_time(timestamp, timezone=None):
# def get_exporters(config, spec):
# def get_backend(config, spec):
# def get_error_budget_policy(config, spec):
# def get_backend_cls(backend):
# def get_exporter_cls(exporter):
# def import_cls(cls_name, expected_type):
# def import_dynamic(package, name, prefix="class"):
# def capitalize(word):
# def snake_to_caml(word):
# def caml_to_snake(word):
# def dict_snake_to_caml(data):
# def apply_func_dict(data, func):
# def str2bool(string):
# def download_gcs_file(url):
# def decode_gcs_url(url):
# def get_files(source, extensions=['yaml', 'yml', 'json']):
# def get_target_path(source_dir, target_dir, relative_path, mkdir=True):
# def fmt_traceback(exc):
# 
# Path: slo_generator/constants.py
# COLORED_OUTPUT = int(os.environ.get("COLORED_OUTPUT", "0"))
# 
# MIN_VALID_EVENTS = int(os.environ.get("MIN_VALID_EVENTS", "1"))
# 
# NO_DATA = -1
# 
# class Colors:
#     """Colors for console output."""
#     HEADER = '\033[95m'
#     OKBLUE = '\033[94m'
#     OKGREEN = '\033[92m'
#     WARNING = '\033[93m'
#     FAIL = '\033[91m'
#     ENDC = '\033[0m'
#     BOLD = '\033[1m'
#     UNDERLINE = '\033[4m'


# Path: slo_generator/report.py
import logging
from dataclasses import asdict, dataclass, fields, field
from slo_generator import utils
from slo_generator.constants import (COLORED_OUTPUT, MIN_VALID_EVENTS, NO_DATA,
                                     Colors)


            # Tuple should contain only elements of type int or float
            if not all(isinstance(n, (float, int)) for n in data):
                error = (
                    'Backend method returned a tuple with some elements having'
                    ' a type different than float or int')
                self.errors.append(error)
                return False

            # Tuple should not contain any element with value None.
            if good is None or bad is None:
                error = (
                    f'Backend method returned a valid tuple {data} but one of '
                    'the values is None.')
                self.errors.append(error)
                return False

            # Tuple should not have NO_DATA everywhere
            if (good, bad) == (NO_DATA, NO_DATA):
                error = (
                    f'Backend method returned a valid tuple {data} but the '
                    'good and bad count is NO_DATA (-1).')
                self.errors.append(error)
                return False

            # Tuple should not have elements where the sum is inferior to our
            # minimum valid events threshold
            if (good + bad) < MIN_VALID_EVENTS:
                error = (
                    f'Not enough valid events ({good + bad}) found. Minimum '

                    f'valid events: {MIN_VALID_EVENTS}.')