# SPDX-License-Identifier: Apache-2.0
# Copyright 2025 Simple Test Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Simple test module demonstrating basic Python functionality.
"""

import sys
from datetime import datetime


def greet_user(name: str = "World") -> str:
    """
    Generate a personalized greeting message.
    
    Args:
        name: The name to greet (defaults to "World")
        
    Returns:
        A formatted greeting string
    """
    if not isinstance(name, str):
        raise TypeError("Name must be a string")
    
    return f"Hello, {name}!"


def get_current_time() -> str:
    """
    Get the current timestamp in a readable format.
    
    Returns:
        Current date and time as a formatted string
    """
    return datetime.now().strftime("%Y-%m-%d %H:%M:%S")


def main() -> None:
    """
    Main function to demonstrate the simple test functionality.
    """
    try:
        print("=== Simple Test Task ===")
        print(greet_user())
        print(greet_user("Python Developer"))
        print(f"Current time: {get_current_time()}")
        print("Test completed successfully!")
        
    except Exception as e:
        print(f"Error occurred: {e}", file=sys.stderr)
        sys.exit(1)


if __name__ == "__main__":
    main()