# Path: slo_generator/utils.py
# def load_configs(path, ctx=os.environ, kind=None):
#     """Load multiple slo-generator configs from a folder path.
# 
#     Args:
#         path (str): Folder path.
#         ctx (dict): Context for variable replacement.
#         kind (str): Config kind filter.
# 
#     Returns:
#         list: List of configs downloaded and parsed.
#     """
#     configs = [
#         load_config(str(p), ctx=ctx, kind=kind)
#         for p in sorted(Path(path).glob('*.yaml'))
#     ]
#     return [cfg for cfg in configs if cfg]
# 
# def load_config(path, ctx=os.environ, kind=None):
#     """Load any slo-generator config, from a local path, a GCS URL, or directly
#     from a string content.
# 
#     Args:
#         path (str): GCS URL, file path, or data as string.
#         ctx (dict): Context for variable replacement.
#         kind (str): Config kind filter.
# 
#     Returns:
#         dict: Config downloaded and parsed.
#     """
#     abspath = Path(path)
#     try:
#         if path.startswith('gs://'):
#             if not GCS_ENABLED:
#                 warnings.warn(
#                     'To load a file from GCS, you need `google-cloud-storage` '
#                     'installed. Please install it using pip by running '
#                     '`pip install google-cloud-storage`', ImportWarning)
#                 sys.exit(1)
#             config = parse_config(content=download_gcs_file(str(path)), ctx=ctx)
#         elif abspath.is_file():
#             config = parse_config(path=str(abspath.resolve()), ctx=ctx)
#         else:
#             LOGGER.debug(f'Path {path} not found. Trying to load from string')
#             config = parse_config(content=str(path), ctx=ctx)
# 
#         # Filter on 'kind'
#         if kind and (
#             not isinstance(config, dict) or kind != config.get('kind', '')
#         ):
#             config = None
#         return config
# 
#     except OSError as exc:
#         if exc.errno == errno.ENAMETOOLONG:
#             return parse_config(content=str(path), ctx=ctx)
#         raise


import json
import os
import sys
import time
from types import ModuleType
from google.cloud.monitoring_v3.proto import metric_service_pb2
from slo_generator.utils import load_configs, load_config
    return os.path.join(TEST_DIR, "fixtures/", filename)


def load_fixture(filename, ctx=os.environ):
    """Load a fixture from the test/fixtures/ directory and replace context
    environmental variables in it.

    Args:
        filename (str): Filename of the fixture to load.
        ctx (dict): Context dictionary (env variables).

    Returns:
        dict: Loaded fixture.
    """
    path = get_fixture_path(filename)
    return load_config(path, ctx=ctx)


def load_sample(filename, ctx=os.environ):
    """Load a sample from the samples/ directory and replace context
    environmental variables in it.

    Args:
        filename (str): Filename of the fixture to load.
        ctx (dict): Context dictionary (env variables).

    Returns:
        dict: Loaded sample.
    """
    filename = os.path.join(SAMPLE_DIR, filename)

# Path: slo_generator/utils.py
# def load_configs(path, ctx=os.environ, kind=None):
#     """Load multiple slo-generator configs from a folder path.
# 
#     Args:
#         path (str): Folder path.
#         ctx (dict): Context for variable replacement.
#         kind (str): Config kind filter.
# 
#     Returns:
#         list: List of configs downloaded and parsed.
#     """
#     configs = [
#         load_config(str(p), ctx=ctx, kind=kind)
#         for p in sorted(Path(path).glob('*.yaml'))
#     ]
#     return [cfg for cfg in configs if cfg]
# 
# def load_config(path, ctx=os.environ, kind=None):
#     """Load any slo-generator config, from a local path, a GCS URL, or directly
#     from a string content.
# 
#     Args:
#         path (str): GCS URL, file path, or data as string.
#         ctx (dict): Context for variable replacement.
#         kind (str): Config kind filter.
# 
#     Returns:
#         dict: Config downloaded and parsed.
#     """
#     abspath = Path(path)
#     try:
#         if path.startswith('gs://'):
#             if not GCS_ENABLED:
#                 warnings.warn(
#                     'To load a file from GCS, you need `google-cloud-storage` '
#                     'installed. Please install it using pip by running '
#                     '`pip install google-cloud-storage`', ImportWarning)
#                 sys.exit(1)
#             config = parse_config(content=download_gcs_file(str(path)), ctx=ctx)
#         elif abspath.is_file():
#             config = parse_config(path=str(abspath.resolve()), ctx=ctx)
#         else:
#             LOGGER.debug(f'Path {path} not found. Trying to load from string')
#             config = parse_config(content=str(path), ctx=ctx)
# 
#         # Filter on 'kind'
#         if kind and (
#             not isinstance(config, dict) or kind != config.get('kind', '')
#         ):
#             config = None
#         return config
# 
#     except OSError as exc:
#         if exc.errno == errno.ENAMETOOLONG:
#             return parse_config(content=str(path), ctx=ctx)
#         raise


# Path: tests/unit/test_stubs.py
import json
import os
import sys
import time
from types import ModuleType
from google.cloud.monitoring_v3.proto import metric_service_pb2
from slo_generator.utils import load_configs, load_config

    return os.path.join(TEST_DIR, "fixtures/", filename)


def load_fixture(filename, ctx=os.environ):
    """Load a fixture from the test/fixtures/ directory and replace context
    environmental variables in it.

    Args:
        filename (str): Filename of the fixture to load.
        ctx (dict): Context dictionary (env variables).

    Returns:
        dict: Loaded fixture.
    """
    path = get_fixture_path(filename)
    return load_config(path, ctx=ctx)


def load_sample(filename, ctx=os.environ):
    """Load a sample from the samples/ directory and replace context
    environmental variables in it.

    Args:
        filename (str): Filename of the fixture to load.
        ctx (dict): Context dictionary (env variables).

    Returns:
        dict: Loaded sample.
    """
    filename = os.path.join(SAMPLE_DIR, filename)

    return load_config(filename, ctx=ctx)