This is an example custom assistant that will help you complete the Python onboarding in VS Code. After trying it out, feel free to experiment with other blocks or create your own custom assistant.
You are a Python coding assistant. You should always try to - Use type hints consistently - Write concise docstrings on functions and classes - Follow the PEP8 style guide
You are an experienced data scientist who specializes in Python-based
data science and machine learning. You use the following tools:
- Python 3 as the primary programming language
- PyTorch for deep learning and neural networks
- NumPy for numerical computing and array operations
- Pandas for data manipulation and analysis
- Jupyter for interactive development and visualization
- Conda for environment and package management
- Matplotlib for data visualization and plotting
Use Cargo to write a comprehensive suite of unit tests for this function
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP (1000) [WeekStartDate]
,[WeekEndDate]
,[Model]
,[GroupingType]
,[TotalCases]
,[Accuracy]
,[Precision]
,[Recall]
,[F1Score]
,[AUCROC]
,[BrierScore]
,[TruePositives]
,[FalsePositives]
,[FalseNegatives]
,[TrueNegatives]
,[WorstCategory]
,[WorstCategoryAccuracy]
,[BestCategory]
,[BestCategoryAccuracy]
,[CalibrationError]
,[EvaluationDate]
FROM [MLPreprocessing].[MM].[WeeklyModelMetrics]
Sample Data:
WeekStartDate WeekEndDate Model GroupingType TotalCases Accuracy Precision Recall F1Score AUCROC BrierScore TruePositives FalsePositives FalseNegatives TrueNegatives WorstCategory WorstCategoryAccuracy BestCategory BestCategoryAccuracy CalibrationError EvaluationDate
2024-04-28 2024-05-04 LOS AdmitDate 19 0.5789 0.3750 0.5000 0.4286 0.5577 0.4643 3 5 3 8 NULL NULL NULL NULL 0.5537 2025-04-30 15:21:18.607
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP (1000) [Last_ExistingId]
,[Next_ExistingId]
,[Num_MissingIds]
,[MissingId]
,[Status]
,[Insert_Datetime]
,[Total_MissingIds]
,[TotalMissingIds_Success_Status]
,[Missed_On_Date]
FROM [MLPreprocessing].[MM].[Missing_Run_IDs]
Last_ExistingId Next_ExistingId Num_MissingIds MissingId Status Insert_Datetime Total_MissingIds TotalMissingIds_Success_Status Missed_On_Date
70959 70963 3 70960 Failure 2025-04-29 15:27:27.220 279 7 2025-03-15
70959 70963 3 70961 Failure 2025-04-29 15:27:27.220 279 7 2025-03-15
70959 70963 3 70962 Failure 2025-04-29 15:27:27.220 279 7 2025-03-15
This is an example dockerfile from a similar dockerized application running on production.
# Use the official lightweight Python 3.11 image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
ACCEPT_EULA=Y \
SQL_SERVER=default_server \
SQL_DATABASE=default_database \
SQL_USERNAME=default_user \
SQL_PASSWORD=default_password \
MLFLOW_TRACKING_URI=http://mlflow:5000
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential unixodbc-dev curl gnupg2 && \
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql17 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy and install requirements first
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir streamlit==1.28.0 && \
pip list | grep streamlit
# Create necessary directories
RUN mkdir -p /app/data
# Copy the rest of the application files
COPY . .
# List files to debug
RUN echo "Files in container:" && ls -la /app
# Expose Streamlit port
EXPOSE 8501
# Run the Streamlit app
CMD ["python", "-m", "streamlit", "run", "dashboard.py", "--server.port=8501", "--server.address=0.0.0.0"]
No Data configured
No MCP Servers configured