# Test Patterns File
# This file contains various patterns for testing file matching and search functionality

# Common programming patterns
def function_definition():
    pass

class ClassDefinition:
    def __init__(self):
        self.attribute = "value"

# Import statements
import os
import sys
from collections import defaultdict
import json as JSON

# Variable assignments
variable = "string value"
number = 42
boolean = True
none_value = None

# Control structures
if condition:
    print("condition is true")
elif other_condition:
    print("other condition")
else:
    print("default case")

for item in items:
    process(item)

while running:
    continue_processing()

# Exception handling
try:
    risky_operation()
except ValueError as e:
    handle_error(e)
except Exception:
    handle_generic_error()
finally:
    cleanup()

# Comments and documentation
"""
This is a docstring that explains
what this module does.
"""

# Inline comment
code_line()  # This is an inline comment

# Special characters and symbols
symbols = "!@#$%^&*()_+-=[]{}|;':\",./<>?"
unicode_text = "Hello 世界 🌍"
escape_sequences = "line1\nline2\ttab"

# JSON-like structure
data = {
    "key": "value",
    "number": 123,
    "array": [1, 2, 3],
    "nested": {
        "inner": True
    }
}

# Regular expressions patterns
regex_patterns = [
    r'\d+',
    r'[a-zA-Z]+',
    r'^\w+@\w+\.\w+$',
    r'(?:https?://)?(?:www\.)?[\w.-]+\.[a-z]{2,}'
]

# SQL-like queries (for testing search functionality)
SELECT * FROM users WHERE active = 1;
INSERT INTO logs (message, timestamp) VALUES ('test', NOW());
UPDATE settings SET value = 'new_value' WHERE key = 'config';
DELETE FROM temp_data WHERE created < '2023-01-01';

# Configuration patterns
CONFIG = {
    'DEBUG': True,
    'DATABASE_URL': 'postgresql://user:pass@localhost/db',
    'SECRET_KEY': 'your-secret-key-here',
    'ALLOWED_HOSTS': ['localhost', '127.0.0.1']
}

# File paths and URLs
file_paths = [
    '/absolute/path/to/file.txt',
    './relative/path/file.py',
    '../parent/directory/file.json',
    '~/home/user/file.log'
]

urls = [
    'https://example.com/path?param=value',
    'http://localhost:8000/api/v1/resource',
    'ftp://files.example.com/download/file.zip',
    'mailto:user@example.com'
]

# Different bracket styles
parentheses = (1, 2, 3)
square_brackets = [4, 5, 6]
curly_braces = {7, 8, 9}
angle_brackets = "<tag>content</tag>"

# Mathematical expressions
math_expressions = [
    "x = y + z",
    "result = (a * b) / (c - d)",
    "power = base ** exponent",
    "modulo = dividend % divisor"
]

# End of file marker
# EOF
