MCPcopy Create free account

hub / github.com/ai-infra-curriculum/ai-infra-engineer-learning / functions

Functions523 in github.com/ai-infra-curriculum/ai-infra-engineer-learning

Methodtest_deduplication
TODO: Test duplicate handling - Index duplicate documents - Verify only one indexed - Check ID generation
projects/project-103-llm-deployment/tests/test_ingestion.py:98
Methodtest_directory_loader
TODO: Test directory loading - Load all files in directory - Verify file count - Check all loaded
projects/project-103-llm-deployment/tests/test_ingestion.py:45
Methodtest_docker_build
TODO: Test Docker image building
projects/project-102-mlops-pipeline/tests/test_deployment.py:32
Functiontest_docs_endpoint
TODO: Test Swagger UI docs endpoint Example implementation: response = client.get("/docs") assert response.status_code == 20
projects/project-101-basic-model-serving/tests/test_api.py:529
Methodtest_document_filtering
TODO: Test filtering - Filter by length - Filter by language - Check filtered count
projects/project-103-llm-deployment/tests/test_ingestion.py:67
Functiontest_env
Set up test environment variables. TODO: Implement environment setup - Set test environment variables - Override production configs
projects/project-103-llm-deployment/tests/conftest.py:454
Methodtest_feature_scaling
TODO: Test feature scaling
projects/project-102-mlops-pipeline/tests/test_data.py:126
Functiontest_first_inference_without_warmup
TODO: Test first inference without warm-up (should be slower) Steps to test: 1. Load model without warm-up 2. Time first inference
projects/project-101-basic-model-serving/tests/test_model.py:528
Methodtest_fixed_size_chunking
TODO: Test fixed-size chunking - Chunk document - Verify chunk sizes - Check overlap
projects/project-103-llm-deployment/tests/test_rag.py:18
Functiontest_full_prediction_pipeline
TODO: Test complete prediction pipeline Steps to test: 1. Check health endpoint 2. Make prediction 3. Validate prediction format
projects/project-101-basic-model-serving/tests/test_api.py:616
Methodtest_generate_streaming
TODO: Test streaming response - Send request with stream=true - Verify SSE format - Check chunks received
projects/project-103-llm-deployment/tests/test_api.py:31
Methodtest_generate_success
TODO: Test successful generation - Send generate request - Verify 200 response - Check response format
projects/project-103-llm-deployment/tests/test_api.py:22
Methodtest_generate_text
TODO: Test text generation - Generate text from prompt - Verify output format - Check token count
projects/project-103-llm-deployment/tests/test_llm.py:30
Functiontest_handle_corrupted_image
TODO: Test handling of corrupted image Steps to test: 1. Create corrupted image data 2. Try to predict 3. Assert appropriate err
projects/project-101-basic-model-serving/tests/test_model.py:567
Functiontest_handle_wrong_image_mode
TODO: Test handling of wrong image mode (grayscale, RGBA, etc.) Steps to test: 1. Create image with different mode 2. Predict 3.
projects/project-101-basic-model-serving/tests/test_model.py:587
Functiontest_health_check
TODO: Test health check endpoint Steps to test: 1. Send GET request to "/health" 2. Assert status code is 200 3. Assert response
projects/project-101-basic-model-serving/tests/test_api.py:168
Methodtest_health_check
TODO: Test health check functionality
projects/project-102-mlops-pipeline/tests/test_deployment.py:41
Methodtest_health_check
TODO: Test health endpoint - Send GET /health - Verify 200 response - Check model status
projects/project-103-llm-deployment/tests/test_api.py:88
Functiontest_health_check_response_format
TODO: Test health check response format Verify the response contains all expected fields: - status: "healthy" or "unhealthy" - model
projects/project-101-basic-model-serving/tests/test_api.py:192
Methodtest_ingestion_pipeline
TODO: Test complete ingestion pipeline
projects/project-102-mlops-pipeline/tests/test_data.py:69
Methodtest_invalid_request
TODO: Test validation - Send invalid request - Verify 422 response - Check error message
projects/project-103-llm-deployment/tests/test_api.py:40
Functiontest_known_image_prediction
TODO: Test prediction on known image (sanity check) Steps to test: 1. Load a known image (e.g., image of a cat) 2. Predict 3. As
projects/project-101-basic-model-serving/tests/test_model.py:676
Methodtest_kubernetes_deployment
TODO: Test Kubernetes deployment
projects/project-102-mlops-pipeline/tests/test_deployment.py:37
Functiontest_llm_generation
Test LLM text generation with specified parameters. Args: prompt: Input prompt temperature: Sampling temperature (0-2)
projects/project-103-llm-deployment/notebooks/utils.py:21
Functiontest_load_model
TODO: Test model loading Steps to test: 1. Create ModelInference instance 2. Call load_model() 3. Assert model is not None 4
projects/project-101-basic-model-serving/tests/test_model.py:158
Functiontest_load_model_twice
TODO: Test loading model twice (should handle gracefully) Steps to test: 1. Load model 2. Load model again 3. Assert no errors
projects/project-101-basic-model-serving/tests/test_model.py:183
Functiontest_memory_cleanup_after_inference
TODO: Test that memory is cleaned up after inference Steps to test: 1. Check initial memory 2. Run inference 3. Check memory aft
projects/project-101-basic-model-serving/tests/test_model.py:615
Methodtest_metadata_enrichment
TODO: Test enrichment - Enrich document - Verify keywords extracted - Check statistics added
projects/project-103-llm-deployment/tests/test_ingestion.py:76
Methodtest_metadata_filtering
TODO: Test filtered search - Search with metadata filter - Verify filtering works - Check results
projects/project-103-llm-deployment/tests/test_rag.py:71
Functiontest_method_not_allowed
TODO: Test 405 response for wrong HTTP method Example implementation: # POST endpoint accessed with GET response = client.ge
projects/project-101-basic-model-serving/tests/test_api.py:437
Functiontest_metrics_after_prediction
TODO: Test that metrics are updated after prediction Steps to test: 1. Make prediction request 2. Check metrics endpoint 3. Asse
projects/project-101-basic-model-serving/tests/test_api.py:477
Functiontest_metrics_endpoint
TODO: Test Prometheus metrics endpoint Steps to test: 1. Send GET request to "/metrics" 2. Assert status code is 200 3. Assert c
projects/project-101-basic-model-serving/tests/test_api.py:455
Methodtest_missing_value_imputation
TODO: Test missing value handling
projects/project-102-mlops-pipeline/tests/test_data.py:117
Methodtest_mlflow_logging
TODO: Test MLflow logging with mocked MLflow
projects/project-102-mlops-pipeline/tests/test_training.py:44
Methodtest_model_creation
TODO: Test model creation
projects/project-102-mlops-pipeline/tests/test_training.py:36
Functiontest_model_init
TODO: Test model initialization Steps to test: 1. Create ModelInference instance 2. Assert model is None before loading 3. Asser
projects/project-101-basic-model-serving/tests/test_model.py:91
Functiontest_model_init_with_cuda_device
TODO: Test initialization with CUDA device Steps to test: 1. Check if CUDA is available 2. If available, create instance with cuda d
projects/project-101-basic-model-serving/tests/test_model.py:132
Functiontest_model_init_with_invalid_name
TODO: Test initialization with invalid model name Steps to test: 1. Try to create instance with invalid model name 2. Assert error i
projects/project-101-basic-model-serving/tests/test_model.py:114
Functiontest_model_loading
TODO: Test function to verify model loading works This is useful for debugging and validation. Example: print("Testing model loadin
projects/project-101-basic-model-serving/src/model.py:444
Methodtest_model_loading
TODO: Test model loading - Initialize LLM server - Verify model loaded - Check model configuration
projects/project-103-llm-deployment/tests/test_llm.py:21
Methodtest_model_training
TODO: Test model training
projects/project-102-mlops-pipeline/tests/test_training.py:40
Functiontest_openapi_schema
TODO: Test OpenAPI schema endpoint Example implementation: response = client.get("/openapi.json") assert response.status_cod
projects/project-101-basic-model-serving/tests/test_api.py:513
Methodtest_pdf_loader
TODO: Test PDF loading - Load PDF file - Verify pages extracted - Check metadata
projects/project-103-llm-deployment/tests/test_ingestion.py:27
Functiontest_postprocess_output
TODO: Test post-processing of model output Steps to test: 1. Create mock model output (logits) 2. Post-process to get class names an
projects/project-101-basic-model-serving/tests/test_model.py:401
Functiontest_predict
TODO: Test model prediction Steps to test: 1. Run prediction on sample image 2. Assert output format is correct 3. Assert predic
projects/project-101-basic-model-serving/tests/test_model.py:284
Functiontest_predict_response_includes_metadata
TODO: Test that prediction response includes metadata Verify response includes: - predictions: list of predictions - model: model na
projects/project-101-basic-model-serving/tests/test_api.py:336
Functiontest_predict_with_different_top_k
TODO: Test prediction with different top_k values Steps to test: 1. Predict with top_k=1, 3, 5, 10 2. Assert correct number of predi
projects/project-101-basic-model-serving/tests/test_model.py:357
Functiontest_predict_with_invalid_image
TODO: Test prediction with invalid image Steps to test: 1. Send POST request with invalid image data 2. Assert status code is 400 (B
projects/project-101-basic-model-serving/tests/test_api.py:251
Functiontest_predict_with_invalid_top_k
TODO: Test prediction with invalid top_k values Steps to test: 1. Test with top_k = 0 (should fail) 2. Test with top_k = -1 (should
projects/project-101-basic-model-serving/tests/test_api.py:393
Functiontest_predict_with_large_file
TODO: Test prediction with file exceeding size limit Steps to test: 1. Create large image (> max allowed size) 2. Send prediction re
projects/project-101-basic-model-serving/tests/test_api.py:366
Functiontest_predict_with_tensor_input
TODO: Test prediction with tensor input Steps to test: 1. Call predict with preprocessed tensor 2. Assert prediction succeeds 3.
projects/project-101-basic-model-serving/tests/test_model.py:314
Functiontest_predict_with_threshold
TODO: Test prediction with confidence threshold Steps to test: 1. Predict with confidence threshold 2. Assert all returned predictio
projects/project-101-basic-model-serving/tests/test_model.py:374
Functiontest_predict_with_top_k_parameter
TODO: Test prediction with top_k parameter Steps to test: 1. Send prediction request with top_k=3 2. Assert response contains exactl
projects/project-101-basic-model-serving/tests/test_api.py:310
Functiontest_predict_with_valid_image
TODO: Test prediction with valid image Steps to test: 1. Send POST request to "/predict" with image file 2. Assert status code is 20
projects/project-101-basic-model-serving/tests/test_api.py:219
Functiontest_predict_with_wrong_content_type
TODO: Test prediction with wrong content type Steps to test: 1. Send image with wrong content type (e.g., text/plain) 2. Assert stat
projects/project-101-basic-model-serving/tests/test_api.py:273
Functiontest_predict_without_file
TODO: Test prediction without file upload Steps to test: 1. Send POST request without file 2. Assert status code is 422 (missing req
projects/project-101-basic-model-serving/tests/test_api.py:294
Functiontest_predict_without_loading_model
TODO: Test prediction without loading model first Steps to test: 1. Create ModelInference instance 2. Try to predict without loading
projects/project-101-basic-model-serving/tests/test_model.py:333
Functiontest_prediction_consistency
TODO: Test prediction consistency Steps to test: 1. Run prediction multiple times on same image 2. Assert predictions are consistent
projects/project-101-basic-model-serving/tests/test_model.py:653
Functiontest_prediction_latency
TODO: Test prediction latency Steps to test: 1. Make prediction request 2. Measure latency 3. Assert latency is within acceptabl
projects/project-101-basic-model-serving/tests/test_api.py:546
Functiontest_preprocess_image
TODO: Test image preprocessing Steps to test: 1. Preprocess sample image 2. Assert output is torch.Tensor 3. Assert correct shap
projects/project-101-basic-model-serving/tests/test_model.py:210
Functiontest_preprocess_with_different_sizes
TODO: Test preprocessing with different image sizes Steps to test: 1. Create images of various sizes 2. Preprocess each 3. Asser
projects/project-101-basic-model-serving/tests/test_model.py:255
Functiontest_preprocess_with_invalid_input
TODO: Test preprocessing with invalid input Steps to test: 1. Try to preprocess invalid input (not PIL Image) 2. Assert appropriate
projects/project-101-basic-model-serving/tests/test_model.py:235
Methodtest_preprocessing_pipeline
TODO: Test complete preprocessing pipeline
projects/project-102-mlops-pipeline/tests/test_data.py:130
Methodtest_pull_model_from_registry
TODO: Test model pulling from registry
projects/project-102-mlops-pipeline/tests/test_deployment.py:27
Methodtest_quantization
TODO: Test model quantization - Load quantized model - Verify memory reduction - Check accuracy maintained
projects/project-103-llm-deployment/tests/test_llm.py:62
Methodtest_rag_generation
TODO: Test RAG generation - Retrieve relevant docs - Inject context - Generate response - Verify sources incl
projects/project-103-llm-deployment/tests/test_rag.py:85
Methodtest_rag_generation
TODO: Test RAG generation - Send RAG request - Verify sources included - Check response quality
projects/project-103-llm-deployment/tests/test_api.py:53
Functiontest_rag_pipeline
Test RAG pipeline end-to-end. Args: query: User query top_k: Number of documents to retrieve chunk_size: Document ch
projects/project-103-llm-deployment/notebooks/utils.py:76
Methodtest_range_validation
TODO: Test range validation
projects/project-102-mlops-pipeline/tests/test_data.py:99
Methodtest_rate_limiting
TODO: Test rate limiting - Send many requests - Verify 429 response - Check headers
projects/project-103-llm-deployment/tests/test_api.py:66
Methodtest_recursive_chunking
TODO: Test recursive chunking - Chunk with separators - Verify semantic boundaries - Check metadata preserved
projects/project-103-llm-deployment/tests/test_rag.py:27
Methodtest_regression_evaluation
TODO: Test regression evaluation
projects/project-102-mlops-pipeline/tests/test_training.py:65
Functiontest_root_endpoint
TODO: Test root endpoint Steps to test: 1. Send GET request to "/" 2. Assert status code is 200 3. Assert response contains expe
projects/project-101-basic-model-serving/tests/test_api.py:147
Methodtest_schema_validation_valid
TODO: Test schema validation with valid data
projects/project-102-mlops-pipeline/tests/test_data.py:91
Functiontest_settings
TODO: Create test-specific settings Steps to implement: 1. Create Settings with test configuration 2. Override production settings
projects/project-101-basic-model-serving/tests/test_api.py:58
Methodtest_similarity_search
TODO: Test similarity search - Query vector DB - Verify top-k results - Check relevance scores
projects/project-103-llm-deployment/tests/test_rag.py:62
Methodtest_single_embedding
TODO: Test single text embedding - Generate embedding - Verify dimension - Check normalization
projects/project-103-llm-deployment/tests/test_rag.py:40
Methodtest_streaming_generation
TODO: Test streaming generation - Generate text stream - Verify token-by-token output - Check finish reason
projects/project-103-llm-deployment/tests/test_llm.py:40
Functiontest_switch_models
TODO: Test switching between different models Steps to test: 1. Load resnet18 2. Make prediction 3. Load resnet50 4. Make pr
projects/project-101-basic-model-serving/tests/test_model.py:705
Methodtest_text_cleaning
TODO: Test text cleaning - Clean messy text - Verify whitespace normalized - Check URLs removed
projects/project-103-llm-deployment/tests/test_ingestion.py:58
Methodtest_text_loader
TODO: Test text file loading - Load text file - Verify content - Check metadata
projects/project-103-llm-deployment/tests/test_ingestion.py:18
Functiontest_warmup
TODO: Test model warm-up Steps to test: 1. Load model 2. Run warm-up 3. Measure first real inference time 4. Assert it's rea
projects/project-101-basic-model-serving/tests/test_model.py:497
Methodtest_web_loader
TODO: Test web scraping - Mock HTTP request - Load from URL - Verify HTML parsed
projects/project-103-llm-deployment/tests/test_ingestion.py:36
Methodto_dict
TODO: Convert to dictionary - Return dict with content and metadata
projects/project-103-llm-deployment/src/ingestion/loader.py:78
Methodto_dict
TODO: Convert settings to dictionary Returns: Dictionary of all settings Example usage: config_dict
projects/project-101-basic-model-serving/src/config.py:427
Functiontrack_request
Decorator to track request metrics. TODO: Implement request tracking decorator - Track request count - Track latency - Track err
projects/project-103-llm-deployment/src/monitoring/metrics.py:349
Functiontrack_requests
TODO: Implement request tracking middleware This middleware should: 1. Record start time 2. Process the request 3. Calculate req
projects/project-101-basic-model-serving/src/api.py:230
Functiontrack_tokens
Decorator to track token usage. TODO: Implement token tracking decorator - Extract token counts from response - Record tokens -
projects/project-103-llm-deployment/src/monitoring/metrics.py:409
Methodtrain
TODO: Train model with MLflow tracking Steps: 1. Start MLflow run 2. Log hyperparameters 3. Train model
projects/project-102-mlops-pipeline/src/training/train.py:162
Functiontrain_model_with_mlflow
TODO: Train ML model with MLflow experiment tracking Steps: 1. Initialize MLflow experiment 2. Load training data 3. Set hyperpa
projects/project-102-mlops-pipeline/dags/training_pipeline.py:83
Methodtransform
TODO: Transform data using fitted pipeline Args: df: Data to transform (validation/test) Returns: p
projects/project-102-mlops-pipeline/src/data/preprocessing.py:450
Functiontruncate_to_token_limit
Truncate text to token limit. Args: text: Input text max_tokens: Maximum tokens tokenizer: Optional tokenizer R
projects/project-103-llm-deployment/src/rag/pipeline.py:539
Methodtune_hyperparameters
TODO: Perform hyperparameter tuning using GridSearchCV or RandomizedSearchCV Steps: 1. Setup cross-validation strategy
projects/project-102-mlops-pipeline/src/training/train.py:266
Methodupdate_gpu_metrics
Update GPU metrics. TODO: Implement GPU metrics update - Set GPU memory gauge - Set GPU utilization gauge A
projects/project-103-llm-deployment/src/monitoring/metrics.py:296
Methodupdate_metrics
Update GPU metrics. TODO: Implement metrics update - Get current GPU stats - Update Prometheus metrics
projects/project-103-llm-deployment/src/monitoring/metrics.py:538
Methodvalidate_completeness
TODO: Validate data completeness (missing values) Steps: 1. Check for null values in required columns 2. Calculate m
projects/project-102-mlops-pipeline/src/data/validation.py:156
Methodvalidate_confidence_threshold
TODO: Validate confidence threshold Steps to implement: 1. Check if value is between 0.0 and 1.0 2. Raise ValueError
projects/project-101-basic-model-serving/src/config.py:322
Functionvalidate_configuration
TODO: Validate entire configuration Performs comprehensive validation beyond field-level checks: - Check if model files exist - Veri
projects/project-101-basic-model-serving/src/config.py:629
Methodvalidate_custom_rules
TODO: Validate custom business rules Steps: 1. Execute each custom validation rule 2. Collect violations 3.
projects/project-102-mlops-pipeline/src/data/validation.py:353
Functionvalidate_data_quality
TODO: Implement data validation using Great Expectations or Pandera Steps: 1. Load raw data 2. Define expectations (schema, ranges,
projects/project-102-mlops-pipeline/dags/data_pipeline.py:108
← previousnext →401–500 of 523, ranked by callers