conversations
listlengths
2
2
[ { "from": "human", "value": "Create a function to validate user-provided postal codes and log the validation results. The detailed requirements are as follows: Implement a function in Python that takes a user's postal code as input and checks it against a predefined list of valid postal codes. The function ...
[ { "from": "human", "value": "Create a Python function that processes, filters, and validates user comments according to specific rules. The detailed requirements are as follows: Implement a function in Python that processes a list of user-generated comments. The function should:\n1. Strip all punctuation fr...
[ { "from": "human", "value": "Develop a data processing pipeline that reads, processes, and writes data using Google Cloud Storage, with automated deployment and testing using build tools. The detailed requirements are as follows: Implement a function named `process_data_pipeline` that reads a JSON file from...
[ { "from": "human", "value": "Create a Python function that converts a user-inputted text message into binary and classifies it using a decision tree model. The detailed requirements are as follows: Develop a Python function that takes a string input from the user, converts the string to its binary represent...
[ { "from": "human", "value": "Implement a function to connect to an SQLite database, retrieve sales data, clean the data using pandas, and compute the average sales per product category. The detailed requirements are as follows: Write a Python function that connects to an SQLite database to fetch sales data....
[ { "from": "human", "value": "Develop a Python function that reads book data from an XML file, enables efficient title searches using binary search, and saves search results in a CSV file. The detailed requirements are as follows: Implement a function in Python that reads a library catalog from an XML file, ...
[ { "from": "human", "value": "Develop a Python script to create a basic code editor with read-only file access and syntax highlighting for string literals. The detailed requirements are as follows: Create a Python script that functions as a basic code editor with the following capabilities: \n1. Allow the us...
[ { "from": "human", "value": "Develop a Python function that fetches book details from an external API, reads a JSON file of favorite books, and allows book details retrieval based on user queries. The detailed requirements are as follows: Implement a function in Python that integrates with an external book ...
[ { "from": "human", "value": "Develop a Python function to modify the color of SVG images based on specific conditions. The detailed requirements are as follows: Create a Python function that takes an SVG file path, a condition (e.g., 'on_sale'), and a target color as inputs. The function should read the SVG...
[ { "from": "human", "value": "Write a Python function to process and validate event data from a CSV file, ensuring dates are correctly formatted and no fields are empty, while handling any errors gracefully. The detailed requirements are as follows: Implement a Python function named `process_event_data` that...
[ { "from": "human", "value": "Create a function that searches for a book by title or author in a library management system using a linear search algorithm, with efficient memory management and data storage in the file system. The detailed requirements are as follows: Develop a function in Python for a librar...
[ { "from": "human", "value": "You are provided with a grid of numerical values representing an image, and you are required to perform bilinear interpolation to find the value at a non-integer point (x, y) within the grid. Bilinear interpolation is a method for interpolating functions of two variables (e.g., ...
[ { "from": "human", "value": "Optimize delivery routes, determine the most popular delivery time, and generate order summaries based on provided data. The detailed requirements are as follows: Write a Python function that takes a list of delivery routes with their respective distances, a list of delivery tim...
[ { "from": "human", "value": "Create a Python function to find a path between two nodes in a graph using DFS for a dynamic warehouse management system. The detailed requirements are as follows: Implement a function in Python that uses Depth-First Search (DFS) to find a path from a given start node to a targe...
[ { "from": "human", "value": "Develop a Python function to optimize an investment portfolio by minimizing its overall volatility using historical stock price data. The detailed requirements are as follows: Create a Python function that accepts historical stock price data for multiple stocks, assesses their m...
[ { "from": "human", "value": "Develop a Python function that decodes corrupted shipment codes using Maximum Likelihood Decoding and stores the corrected codes in Google Cloud Storage. The detailed requirements are as follows: Implement a Python function that takes a corrupted shipment code and a list of poss...
[ { "from": "human", "value": "Create a Python function to process and validate email lists stored on AWS S3, and write unit tests for it. The detailed requirements are as follows: Write a Python function that processes an email list stored in an AWS S3 bucket. The function should:\n1. Download the email list...
[ { "from": "human", "value": "Create a Python function to hash user input from a survey form using SHA-512, store the hashed data, and provide immediate feedback to the user confirming secure data receipt. The detailed requirements are as follows: Develop a Python function that takes user input from a survey...
[ { "from": "human", "value": "Decode a Base32 encoded string, tokenize the decoded text into sentences, and log the results to the console. The detailed requirements are as follows: Implement a Python function that takes a Base32 encoded string as input, decodes it, tokenizes the decoded text into sentences ...
[ { "from": "human", "value": "Develop a Python function to validate course data, fetch the adjacency list of prerequisites, and sort the courses based on the number of prerequisites. The detailed requirements are as follows: Implement a function in Python that takes a list of course dictionaries and a dictio...
[ { "from": "human", "value": "Implement a function to securely store votes in a Redis database, ensuring data integrity and handling potential exceptions. The detailed requirements are as follows: Implement a function `store_vote` in Python that takes a voter's unique token and their vote as input, hashes th...
[ { "from": "human", "value": "Parse an XML file of book information and sort the books by popularity within their categories. The detailed requirements are as follows: Implement a Python function that parses an XML file containing book information, extracts the book details (title, author, category, and popu...
[ { "from": "human", "value": "Develop an object-oriented Python program to manage and optimize delivery routes using collections.deque and higher-order functions, with thorough module testing and validation. The detailed requirements are as follows: Create an object-oriented Python program to manage and opti...
[ { "from": "human", "value": "Build a function in Python that retrieves health metrics from an API, computes their probability distributions, and visualizes these distributions using vertical bar charts. The detailed requirements are as follows: Create a Python function that retrieves health metrics data fro...
[ { "from": "human", "value": "Develop a Python program that reads historical sales data from a CSV file, builds a multiple linear regression model to predict sales, and prints the regression coefficients and predicted sales values. The detailed requirements are as follows: You are provided with a CSV file co...
[ { "from": "human", "value": "Create a function that retrieves historical stock prices from a MongoDB database, manages the data using heap allocation, and visualizes the trends with a line chart. The detailed requirements are as follows: Implement a Python function that retrieves historical stock price data...
[ { "from": "human", "value": "You are required to implement a function that takes a list of strings representing numbers and returns a list of those numbers parsed as integers. If any string in the list cannot be converted to an integer, the function should raise a `TypeError` with an appropriate error messa...
[ { "from": "human", "value": "Develop a Python application that captures, anonymizes, and sends user feedback via a REST API, while efficiently managing memory and handling user interactions. The detailed requirements are as follows: Develop a Python-based web application that captures user feedback on produ...
[ { "from": "human", "value": "Implement a function to authenticate users, track bandwidth usage for file operations, and print a formatted summary report. The detailed requirements are as follows: Your task is to implement a function in Python that authenticates users via OAuth, tracks the bandwidth usage fo...
[ { "from": "human", "value": "Securely verify an administrator's credentials and update a network graph by adding a new node and connecting it to specified existing nodes. The detailed requirements are as follows: Implement a Python function that performs a secure operation on a network graph. The function s...
[ { "from": "human", "value": "Create a function to process and summarize daily activity data, converting units based on an environment variable. The detailed requirements are as follows: Implement a Python function called `process_activity_data` that takes a list of dictionaries containing daily activity dat...
[ { "from": "human", "value": "Calculate the total downtime in hours for servers over a specified period and ensure the accuracy of your implementation using mutation testing. The detailed requirements are as follows: Implement a Python function that takes two inputs: a list of server logs containing start an...
[ { "from": "human", "value": "Build a function to parse and validate sales data from an XML file, and analyze data skew to identify regions with significantly higher or lower sales compared to the average. The detailed requirements are as follows: Implement a Python function that takes an XML file containing...
[ { "from": "human", "value": "You are tasked with implementing a function that processes data from a SQL database and performs specific mathematical operations on it. The function will import data from a SQL table, perform integer division and element-wise multiplication on the retrieved data, and then expor...
[ { "from": "human", "value": "Develop a function that authenticates a user using two-factor authentication, then uses BFS to find connections up to a given degree, and returns a specified slice of this connection list. The detailed requirements are as follows: Create a function that first ensures user authen...
[ { "from": "human", "value": "Develop a Python program that predicts whether a product will be a bestseller using TensorFlow's logistic regression, while efficiently managing CPU usage through multi-threading and updating the database schema to use more intuitive column names. The detailed requirements are a...
[ { "from": "human", "value": "Create a Python function to monitor delivery logs for delays and send email warnings, using a test-driven development approach. The detailed requirements are as follows: Develop a function in Python that reads a large log file in chunks and checks for delivery delays. If a delay...
[ { "from": "human", "value": "Develop a multithreaded Python function to capture and serialize incoming customer support requests, including phone numbers and messages, ensuring data is preserved and can handle concurrent requests. The detailed requirements are as follows: Implement a Python function that ca...
[ { "from": "human", "value": "Determine the maximum depth of an organizational hierarchy using Depth-First Search (DFS) in Python. The detailed requirements are as follows: Implement a function in Python that takes as input the adjacency list representation of the organizational hierarchy and the ID of the C...
[ { "from": "human", "value": "**Problem Description:**\n\nYou are given a list of events, each represented by a tuple containing the start time and end time in the format `(start_hour, start_minute, end_hour, end_minute)`. Each event is guaranteed to occur within a single day. Your task is to write a functio...
[ { "from": "human", "value": "Write a Python function to sanitize and evenly distribute real-time GPS data from delivery trucks across multiple processing units using Round Robin Partitioning. The detailed requirements are as follows: Implement a Python function that takes in a stream of real-time GPS data, ...
[ { "from": "human", "value": "Develop a function to collect and visualize performance metrics from multiple servers. The detailed requirements are as follows: Create a Python function that establishes a socket connection to a monitoring server, retrieves performance metrics from multiple servers using REST A...
[ { "from": "human", "value": "Develop a function to randomly assign patients to different clinical trial groups based on specific eligibility criteria. The detailed requirements are as follows: Implement a Python function named `assign_to_trial_group` that takes a list of patients, each represented by a dict...
[ { "from": "human", "value": "Create a function that dynamically adjusts CPU voltage based on load, monitors network latency, and manages WebSocket connections with IoT devices. The detailed requirements are as follows: Implement a Python function `optimize_resource_usage` that performs the following: \n1. M...
[ { "from": "human", "value": "Develop a Python function that updates a warehouse grid based on a series of item addition operations and saves the updated grid state to a specified S3 path. The detailed requirements are as follows: Implement a function in Python that takes a 2D grid representing the warehouse...
[ { "from": "human", "value": "You are given a JSON configuration file that contains a list of integers. Your task is to implement a function that reads this configuration file, sorts the list of integers in ascending order, and returns the sorted list. The configuration file is named `config.json` and has th...
[ { "from": "human", "value": "Develop a Python function to preprocess a dataset by handling missing values and applying temperature scaling to confidence scores, and implement an event handler for displaying tooltips on data point hover in a visualization plot. The detailed requirements are as follows: Creat...
[ { "from": "human", "value": "Create a function to verify if a role name is a palindrome, using a while loop to check if the string reads the same forwards and backwards. The detailed requirements are as follows: You are tasked with creating a function in Python that verifies if a given role name is a palind...
[ { "from": "human", "value": "Implement a function to fetch daily blood sugar readings from an API, store the data in a blob storage system, and calculate the median blood sugar level. The detailed requirements are as follows: Write a Python function that fetches blood sugar data from a given API, stores the...
[ { "from": "human", "value": "Develop a function that normalizes user activity data and calculates the mean values, then expose this functionality via a RESTful API. The detailed requirements are as follows: Implement a Python function that receives raw activity data from multiple users through a RESTful API...
[ { "from": "human", "value": "Clean the dataset by handling missing values and compute the average rating per product, then save the results to a new CSV file. The detailed requirements are as follows: You are provided with a dataset containing customer ratings for different products. The dataset has some mi...
[ { "from": "human", "value": "Create a Python function that uses an iterative binary search to find the number of steps taken on a specific date from a sorted list of step records. Ensure that user authentication is implemented to allow only logged-in users to access and update their settings. The detailed r...
[ { "from": "human", "value": "Develop a Python function to compress a list of image filenames and search for filenames that match a given query using the two-pointer technique. The detailed requirements are as follows: In the photo gallery application, implement a function in Python that takes a list of imag...
[ { "from": "human", "value": "Develop a Django REST framework API for uploading video files, filtering them by filename prefix, and sending their metadata to another server over TCP. The detailed requirements are as follows: Create a Django REST framework API that allows clients to upload video files to the ...
[ { "from": "human", "value": "Create a Python function to submit a fault-tolerant quantum computation job through a Cloud Console, providing the user with a confirmation message upon successful submission. The detailed requirements are as follows: Create a Python function `submit_quantum_job` that takes user...
[ { "from": "human", "value": "Develop a note-taking application in Python that includes user signup, note storage in a BST, in-order traversal for retrieving notes in chronological order, and an option to reverse the content of each note. The detailed requirements are as follows: Create a Python function for...
[ { "from": "human", "value": "Write a function to invert the order of a list of book IDs using a stack-based approach and save the inverted list to a database. The detailed requirements are as follows: Implement a Python function `process_book_returns(book_list)` that takes a list of book IDs representing th...
[ { "from": "human", "value": "Develop a Python program that reads patient data from a binary file, anonymizes PII, and incorporates error handling mechanisms. The detailed requirements are as follows: Design a Python program that reads patient data from a binary file, anonymizes any personally identifiable i...
[ { "from": "human", "value": "Develop a secure file upload web application that uses SSL/TLS encryption for data transmission and stores files in Google Cloud Storage, while sending email warnings in case of upload issues. The detailed requirements are as follows: Develop a Python web application that allows...
[ { "from": "human", "value": "You are tasked with developing a Python function that processes a list of user-selected items from a dropdown menu. Each item in the dropdown menu has a unique identifier. The function should determine the frequency of each selected item and return a dictionary with the item ide...
[ { "from": "human", "value": "Implement a function that handles patient signup by validating user input and displaying alerts for any invalid or missing fields, ensuring proper user authentication before account creation. The detailed requirements are as follows: Develop a Python function within a healthcare...
[ { "from": "human", "value": "Develop a Python function to calculate the Return on Equity (ROE) for a company based on its financial statement data. The detailed requirements are as follows: Create a Python function that calculates the Return on Equity (ROE) for a company. The function should take as input a...
[ { "from": "human", "value": "Create a Python function to monitor server uptime, log the data, manage spare resources, and generate a visual uptime report. The detailed requirements are as follows: Develop a Python function that performs the following tasks: monitors the uptime of a list of servers, logs the...
[ { "from": "human", "value": "Develop a Python function that validates date formats from real-time data and handles swipe events for navigating a calendar. The detailed requirements are as follows: Implement a function in Python that takes a date input from a real-time data stream and validates its format. T...
[ { "from": "human", "value": "Develop a function to calculate the memory usage of a document object and its references using Python, adhering to domain-driven design principles. The detailed requirements are as follows: Implement a Python function that uses the `gc.get_referents` method to calculate the memo...
[ { "from": "human", "value": "Create a Python function to validate a city name input, fetch the current weather data for that city using an API, and handle any potential errors that may arise during the process. The detailed requirements are as follows: Develop a Python function that accepts a city name as i...
[ { "from": "human", "value": "Develop an optimized Bellman-Ford algorithm in Python to compute the shortest paths from a central warehouse to all delivery locations, considering real-time travel time updates. The detailed requirements are as follows: Implement a function in Python that uses an optimized vers...
[ { "from": "human", "value": "Develop a function to process drone-captured images, locate a lost individual, re-assign the drone's position, and calculate the shortest path using the A* algorithm. The detailed requirements are as follows: Implement a function in Python that processes a series of images captu...
[ { "from": "human", "value": "Analyze real-time sensor data from a Redis database to identify abnormal environmental conditions and generate a report with actionable insights. The detailed requirements are as follows: Implement a Python function that connects to a Redis database to fetch the latest sensor da...
[ { "from": "human", "value": "Implement a function that performs polynomial regression on historical temperature data and generates an XML file containing the predicted temperature values. The detailed requirements are as follows: You are tasked with developing a function in Python that takes in historical t...
[ { "from": "human", "value": "Create a Python function to estimate the average age of patients by sampling a subset of patient records and calculating their ages, also offering user guidance on data input and result interpretation. The detailed requirements are as follows: Implement a function in Python that...
[ { "from": "human", "value": "Develop a Python function to analyze and categorize customer feedback from SQL dump files using a Transformer-based NLP model. The detailed requirements are as follows: Implement a Python function that imports customer feedback data from multiple SQL dump files, merges the feedb...
[ { "from": "human", "value": "Create a function in Python that processes customer data, predicts churn using machine learning, writes the results to a CSV file, and verifies the file's SHA-256 hash. The detailed requirements are as follows: Develop a Python function that takes in a dataset of customer intera...
[ { "from": "human", "value": "Create a function to schedule workout reminders, generate weekly fitness reports in HTML, and enable pinch zoom on performance graphs within the fitness tracking app. The detailed requirements are as follows: Develop a Python function within the mobile app that performs the foll...
[ { "from": "human", "value": "Create a signup form in Python that calculates the user's age from their date of birth and animates the submit button on click. The detailed requirements are as follows: Task Description: Implement a signup form in Python that includes a date of birth input field and a submit bu...
[ { "from": "human", "value": "Write a Python function to validate foreign key constraints and perform a join operation to retrieve book information along with author names and genres. The detailed requirements are as follows: Implement a Python function that validates foreign key constraints when adding a ne...
[ { "from": "human", "value": "Implement a Python function to predict stock prices using a Random Forest Regressor, incorporating a cache that refreshes on access to ensure real-time accuracy. The detailed requirements are as follows: Your task is to implement a function in Python that performs stock price pr...
[ { "from": "human", "value": "Develop a Python program to evaluate employee performance by multiplying their performance metrics vector with a performance standards matrix and updating their promotion status in the database if they exceed a performance threshold. The detailed requirements are as follows: Wri...
[ { "from": "human", "value": "Develop a Python function that rebases a NoSQL database to a new schema and performs sentiment analysis on user comments. The detailed requirements are as follows: Write a Python function that performs a rebase operation on a dataset stored in a NoSQL database, updating the sche...
[ { "from": "human", "value": "Implement a Python function that filters a list of tasks based on specified conditions such as priority level, due date, and completion status. The detailed requirements are as follows: You are tasked with implementing a function in Python that filters a list of tasks based on s...
[ { "from": "human", "value": "Develop a Python web application that shortens URLs and tracks their access counts. The detailed requirements are as follows: Create a Python-based web application that provides two key functionalities: URL shortening and redirection. Users should be able to input a long URL and...
[ { "from": "human", "value": "Develop a Python application to manage a healthcare clinic's appointment scheduling, ensuring no double bookings and accurate calculation of available slots. The detailed requirements are as follows: Create a Python application for a healthcare clinic's appointment scheduling sy...
[ { "from": "human", "value": "Encrypt user data using the 'Noble Libs' library in Python to securely store information for a digital library system. The detailed requirements are as follows: Implement a function called `secure_store` in Python that takes a user's name and email as input and returns an encryp...
[ { "from": "human", "value": "Analyze a sales performance dataset to describe its structure and key statistics, and then build a regression tree model to predict future sales based on the data. The detailed requirements are as follows: Given a dataset containing sales performance data, your task is to write ...
[ { "from": "human", "value": "Implement a `merge_sort` function in Python that sorts a list of integers using the Merge Sort algorithm and employs reference counting for efficient memory management. The detailed requirements are as follows: Your task is to implement a `merge_sort` function in Python that sor...
[ { "from": "human", "value": "Implement a function to process user reviews, identify those ending with 'y', and save them to an Excel file. The detailed requirements are as follows: Write a Python function that reads a text file containing user reviews, uses regular expressions to identify reviews that end w...
[ { "from": "human", "value": "Develop a function to process real-time traffic data and determine optimal traffic signal timings while handling missing or incorrect data points. The detailed requirements are as follows: Given a list of traffic data entries, where each entry is a dictionary containing 'vehicle...
[ { "from": "human", "value": "Develop a Python function to find the minimum number of non-overlapping delivery routes required to cover all delivery points. The detailed requirements are as follows: Write a Python function that takes a list of delivery routes, each represented as a list of delivery points, a...
[ { "from": "human", "value": "You are tasked with implementing a function to analyze feedback from a user survey. The feedback consists of numeric ratings given by users for different aspects of a service. The goal is to validate the input, compute the average rating for each aspect, and return the ratings i...
[ { "from": "human", "value": "Develop a function to analyze market volatility by processing stock prices and timestamps, handling missing data, and calculating the standard deviation of the stock prices. The detailed requirements are as follows: Create a Python function named `analyze_market_volatility` that...
[ { "from": "human", "value": "Develop a Python function to analyze command history, identify error-prone sequences, and suggest improvements while providing a visual representation of command paths. The detailed requirements are as follows: Create a Python function named `analyze_command_history` that takes ...
[ { "from": "human", "value": "Develop a Python module that calculates the shortest path for item picking in a warehouse using the A* algorithm and sends the path data to a central server via UDP. The detailed requirements are as follows: You are tasked with developing a module for the warehouse management sy...
[ { "from": "human", "value": "Build a Python function to validate a CSV file's data integrity and column name format, providing live updates for screen reader accessibility. The detailed requirements are as follows: Create a Python function that takes a CSV file as input and validates its data. The function ...
[ { "from": "human", "value": "Develop a Python function to read, compress, and safely close multiple data files, ensuring data integrity throughout the process. The detailed requirements are as follows: Implement a Python function that reads data from a list of file paths, compresses the data using gzip, wri...
[ { "from": "human", "value": "Implement a Python function that finds the nth polite number and logs the current date and time when the number is found. The detailed requirements are as follows: Create a function in Python that takes an integer n as input and returns the nth polite number. Additionally, the f...
[ { "from": "human", "value": "Implement a Python function to classify emails as spam or not spam using linear SVM, ensuring the project is managed with version control. The detailed requirements are as follows: Develop a Python function that reads email data from a file, preprocesses the data, trains a linea...
[ { "from": "human", "value": "Develop a function to manage a library's book inventory, validate book identifiers, and suggest similar books based on the author and publication year. The detailed requirements are as follows: Implement a Python function that takes a list of books as input, where each book is r...
[ { "from": "human", "value": "Develop a function to preprocess e-commerce purchase data and apply association rule learning to find patterns in user purchases. The detailed requirements are as follows: Implement a Python function that takes a dataset of user purchases as input. The function should first vali...
[ { "from": "human", "value": "Write a Python function to analyze stock market data using a fixed-size sliding window and bitwise OR operations, and manage dependencies with pip. The detailed requirements are as follows: Develop a Python function named `analyze_stock_data` that takes a list of binary-encoded ...
[ { "from": "human", "value": "Develop a function to analyze sales data by fetching it from an SQL database, performing statistical computations with NumPy, and enriching the data with external market insights via an HTTP request. The detailed requirements are as follows: Write a Python function that connects...