#!/usr/bin/env python3
"""
Test case for alias transformation functionality.

This script demonstrates the issue where import aliases are not being transformed properly.
Without the transformer logic, the bundled output will contain both:
1. Alias assignments (generated by generate_alias_assignments)
2. Original import statements (that should be removed/transformed)

This creates redundant code and potentially confusing output.
"""

# These regular import aliases should be transformed/removed in bundled output
import json as j
import os as operating_system
import sys as system_info

# These from-import aliases should have their statements filtered
from utils.data_processor import process_data as process_a
from utils.data_processor import format_output as format_a
from utils.config_manager import load_config as config_a

# These non-aliased imports should remain unchanged
import math
import hashlib

# Mixed from-import: some aliased, some not (partial filtering test)
from utils.helpers import helper_func, debug_print as debug_a


def main():
    """Main function that uses the imported modules with their aliases."""
    # Use regular import aliases
    data = j.dumps({"test": "data"})
    print(f"JSON data: {data}")

    # Use deterministic directory info instead of actual current directory
    dir_hash = hashlib.md5(b"test_directory").hexdigest()[:8]
    print(f"Current directory: /test/deterministic/{dir_hash}")

    python_version = system_info.version
    print(f"Python version: {python_version}")

    # Use from-import aliases
    processed = process_a([1, 2, 3, 4, 5])
    formatted = format_a(processed)
    print(f"Processed and formatted: {formatted}")

    config = config_a("settings.json")
    print(f"Loaded config: {config}")

    # Use non-aliased imports
    result = math.sqrt(16)
    # Use deterministic "random" number based on stable hash
    deterministic_num = int(hashlib.md5(b"alias_transformation_test").hexdigest()[:2], 16)
    print(f"Math result: {result}, Deterministic: {deterministic_num}")

    # Use mixed from-import
    helper_result = helper_func("test")
    debug_a(f"Helper result: {helper_result}")


if __name__ == "__main__":
    main()
