data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes image metadata for a user. The function should take a dictionary containing information about an image and determine if the image is original or processed. If it is an original image, it should store it in a list of ori... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_image_metadata({'username': 'user1', 'filename': 'image1.jpg', 'size': 2048, 'timestamp': '2023-01-01T12:00:00', 'proc_image': 'proc_image1.jpg', 'proc_size': 1024, 'proc_time': 2, 'proc_step': 'resize'}) == {'orig_img': [{'filename': 'image1.jpg', '... | {
"split": "train",
"index": 63500,
"acecode_id": "bigcode_python_fns_48540",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `clamp_values(values, min_value, max_value)` that takes a list of numerical values and two numerical boundaries (minimum and maximum). The function should ensure that each value in the list is within the specified range. If a value is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clamp_values([0.5, -1.5, 1.5], -1.0, 1.0) == [0.5, -1.0, 1.0]\", \"assert clamp_values([-2.0, 0.0, 2.0], -1.0, 1.0) == [-1.0, 0.0, 1.0]\", \"assert clamp_values([0.0, 0.0, 0.0], -1.0, 1.0) == [0.0, 0.0, 0.0]\", \"assert clamp_values([-1.0, 1.0, 0.5], -1.0, 1... | {
"split": "train",
"index": 63501,
"acecode_id": "bigcode_python_fns_44949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a formatted message string for a Telegram bot based on provided parameters. Your function should take in three inputs: a message text (string), a bot token (string), and a chat ID (integer). The function should return a str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_telegram_message('Hello World', 'abc123', 456) == 'Message: Hello World, Token: abc123, Chat ID: 456'\", \"assert format_telegram_message('Test Message', 'test_token', 789) == 'Message: Test Message, Token: test_token, Chat ID: 789'\", \"assert format... | {
"split": "train",
"index": 63502,
"acecode_id": "bigcode_python_fns_650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of positive rational numbers, implement a function `find_pair(numbers, target)` that locates one pair of numbers whose multiplication equals a specified target value. If such a pair exists, return it as a tuple. If no pair exists, return None.\nPlease reason step b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pair([1, 2, 3, 4, 5], 10) == (2, 5)\", \"assert find_pair([2, 3, 6, 1, 8], 24) == (3, 8)\", \"assert find_pair([10, 15, 3, 7], 21) == (3, 7)\", \"assert find_pair([9, 5, 2, 8], 72) == (9, 8)\", \"assert find_pair([10, 20, 30, 40], 600) == (20, 30)\", \"... | {
"split": "train",
"index": 63503,
"acecode_id": "evol_987",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple request handler for making HTTP requests. Write a function `request_handler` that takes in two parameters: `method` (string): The HTTP method for the request, either 'GET' or 'POST'; and `url` (string): The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert request_handler('GET', 'https://example.com/api/data') == 'GET request made to https://example.com/api/data'\", \"assert request_handler('POST', 'https://example.com/api/data') == 'POST request made to https://example.com/api/data'\", \"assert request_handle... | {
"split": "train",
"index": 63504,
"acecode_id": "oss_20570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a summary report for a restaurant management system. You will be given two lists: one representing menus and another representing products. Each product will have an associated category. Your goal is to implement the function `get_dashboard_summary(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_dashboard_summary(['Breakfast', 'Lunch', 'Dinner'], [('Pancakes', 'Breakfast'), ('Burger', 'Lunch'), ('Pizza', 'Dinner'), ('Salad', 'Lunch')]) == {'total_menus': 3, 'total_products': 4, 'products_in_categories': {'Breakfast': 1, 'Lunch': 2, 'Dinner': 1}}... | {
"split": "train",
"index": 63505,
"acecode_id": "oss_31402",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts specific configuration settings from a given dictionary representing a Django settings module. The input will be a dictionary containing various settings and a list of setting names to extract. Your function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_django_settings({'DATABASES': {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'mydatabase'}}, 'INSTALLED_APPS': ['django.contrib.admin', 'django.contrib.auth', 'myapp']}, ['DATABASES', 'INSTALLED_APPS', 'SECRET_KEY']) == {'DATABASES': {'... | {
"split": "train",
"index": 63506,
"acecode_id": "oss_26211",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a list of article URLs, each separated by commas. Your task is to write a function that extracts these URLs and returns them as a list. The input string may contain leading or trailing spaces around the URLs. Write a function `extract_article... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_article_urls('https://example.com/article1, https://example.com/article2') == ['https://example.com/article1', 'https://example.com/article2']\", \"assert extract_article_urls(' https://example.com/article1 , https://example.com/article2 ') == ['http... | {
"split": "train",
"index": 63507,
"acecode_id": "oss_18858",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of protein file names and a base file name. Each protein file is expected to have a specific extension: either '.narrowPeak', '.broadPeak', or '.bigwig'. Your task is to implement a function that checks the provided protein file names and separates them int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_protein_files(['file1.narrowPeak', 'file2.broadPeak', 'file3.bigwig', 'file4.txt'], 'basefile.ph5') == {'narrowPeak': ['file1.narrowPeak'], 'broadPeak': ['file2.broadPeak'], 'bigwig': ['file3.bigwig'], 'invalid': ['file4.txt']}\", \"assert classify_... | {
"split": "train",
"index": 63508,
"acecode_id": "bigcode_python_fns_20945",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a numeric value representing the mean squared error loss, denoted as `loss_mse`. Write a function `compute_rmse(loss_mse)` that computes the root mean squared error (RMSE) using the formula: RMSE = sqrt(2 * loss_mse). The function should return the RMSE as a numer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_rmse(0) == 0.0\", \"assert compute_rmse(1) == 1.4142135623730951\", \"assert compute_rmse(4) == 2.8284271247461903\", \"assert compute_rmse(10) == 4.47213595499958\", \"assert compute_rmse(16) == 5.656854249492381\", \"assert compute_rmse(25) == 7.07... | {
"split": "train",
"index": 63509,
"acecode_id": "bigcode_python_fns_11098",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a specified word exists in a given string, considering case sensitivity. The function should return True if the word is found, and False otherwise. The search should be conducted against the original string without splitting it into individua... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_word('This is a simple sentence.', 'simple') == True\", \"assert find_word('This is a simple sentence.', 'Simple') == False\", \"assert find_word('Hello World!', 'world') == False\", \"assert find_word('Python programming is fun.', 'Python') == True\", ... | {
"split": "train",
"index": 63510,
"acecode_id": "evol_14174",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to manage an indented text structure. The function should allow you to track the hierarchy level of each line of text and retrieve the indentation level for a given line. Your task is to implement the function `get_indent_level(indent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_indent_level([3, 5, 7], 0) == 3\", \"assert get_indent_level([3, 5, 7], 1) == 5\", \"assert get_indent_level([3, 5, 7], 2) == 7\", \"assert get_indent_level([3, 5, 7], 3) == None\", \"assert get_indent_level([], 0) == None\", \"assert get_indent_level([1... | {
"split": "train",
"index": 63511,
"acecode_id": "oss_29932",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `update_contact_details(existing_phone_number: str, new_phone_number: str, new_name: str) -> Union[Dict[str, Union[str, Dict[str, str]]]]` that updates the contact details of an existing contact. The function should check if the contact with the existing ph... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_contact_details('1234567890', '1111111111', 'Charlie') == {'message': 'Contact updated successfully', 'contact': {'phone_number': '1111111111', 'name': 'Charlie'}}\", \"assert update_contact_details('1234567890', '2222222222', 'David') == {'message': ... | {
"split": "train",
"index": 63512,
"acecode_id": "evol_29120",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two integers x and y, write a function `hamming_distance(x, y)` that calculates the Hamming distance between them. The Hamming distance is defined as the number of positions at which the corresponding bits are different. For instance, the Hamming distance between the inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hamming_distance(1, 4) == 2\", \"assert hamming_distance(0, 0) == 0\", \"assert hamming_distance(1, 1) == 0\", \"assert hamming_distance(3, 1) == 1\", \"assert hamming_distance(2, 2) == 0\", \"assert hamming_distance(10, 15) == 2\", \"assert hamming_distance... | {
"split": "train",
"index": 63513,
"acecode_id": "oss_9702",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of robot components represented as dictionaries, where each dictionary contains the name of the component and its parent component. Your task is to implement a function that transforms this list into a structured dictionary that separates components into tw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_robot_components([{'name': 'link1', 'parent': 'link0'}, {'name': 'link2', 'parent': 'link1'}, {'name': 'world', 'parent': 'link2'}, {'name': 'joint1', 'parent': 'link1', 'child': 'link2'}, {'name': 'work', 'parent': 'joint1'}]) == {'links': {'link1... | {
"split": "train",
"index": 63514,
"acecode_id": "bigcode_python_fns_9064",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and a specific integer, write a function that returns the list of indices where the specific integer occurs in the array. The function should return an empty list if the integer does not exist in the array.\nPlease reason step by step, then write a se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_positions([1,2,3,2,4,2,5,2,3,2,1], 2) == [1, 3, 5, 7, 9]\", \"assert find_positions([5, 5, 5], 5) == [0, 1, 2]\", \"assert find_positions([1, 2, 3, 4, 5], 6) == []\", \"assert find_positions([], 1) == []\", \"assert find_positions([1, 2, 3, 4, 5], 1) ==... | {
"split": "train",
"index": 63515,
"acecode_id": "evol_29215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of genetic variants represented as tuples, each containing information about the chromosome, position, reference allele, and alternate allele (e.g., ('chr1', 100, 'A', 'C')), write a function that formats these variants into a specific string format. The format sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_variants([('chr1', 100, 'A', 'C')]) == ['chr1-100-A-C']\", \"assert format_variants([('chr2', 200, 'G', 'T')]) == ['chr2-200-G-T']\", \"assert format_variants([('chr3', 300, 'C', 'G')]) == ['chr3-300-C-G']\", \"assert format_variants([('chr6', 600, 'A... | {
"split": "train",
"index": 63516,
"acecode_id": "bigcode_python_fns_9892",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `ternary_search` that takes an unsorted list of integers and a target integer. The function should first check if the list is sorted, and if not, sort the list using a sorting algorithm of your choice (without using any built-in sorting methods). After sort... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ternary_search([5, 3, 2, 4, 1], 3) == 2\", \"assert ternary_search([5, 3, 2, 4, 1], 6) == -1\", \"assert ternary_search([10, 20, 30], 20) == 1\", \"assert ternary_search([10, 20, 30], 10) == 0\", \"assert ternary_search([30, 20, 10], 30) == 2\", \"assert ter... | {
"split": "train",
"index": 63517,
"acecode_id": "evol_11981",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string and returns the string with its characters sorted in alphabetical order. Your function should consider both uppercase and lowercase letters, treating them as distinct characters. Spaces and punctuation should be ignore... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_characters('hello world!') == 'dehllloorw'\", \"assert sort_characters('!@#$%^&*()') == ''\", \"assert sort_characters('') == ''\", \"assert sort_characters('aBc') == 'Bac'\", \"assert sort_characters('!hello!') == 'ehllo'\", \"assert sort_characters('C... | {
"split": "train",
"index": 63518,
"acecode_id": "oss_27877",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a sequence of predicate statements. Each predicate statement is defined by a lowercase English letter followed by parentheses containing zero or more lowercase English letters. Your task is to implement a function `parse_ans(text: str) -... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_ans('a(bc) d(e)') == ['a(bc)', 'd(e)']\", \"assert parse_ans('x() y(a)') == ['x()', 'y(a)']\", \"assert parse_ans('foo bar a(b)') == ['a(b)']\", \"assert parse_ans('no valid predicates here!') == []\", \"assert parse_ans('') == []\", \"assert parse_ans... | {
"split": "train",
"index": 63519,
"acecode_id": "bigcode_python_fns_25141",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `highest_palindrome(low: int, high: int) -> int` that returns the largest palindrome integer within the specified inclusive range [low, high]. If there are no palindromes in the range, the function should return zero. A palindrome is a number that reads the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highest_palindrome(10, 100) == 99\", \"assert highest_palindrome(100, 200) == 191\", \"assert highest_palindrome(9998, 10000) == 9999\", \"assert highest_palindrome(78, 81) == 0\", \"assert highest_palindrome(1, 1) == 1\", \"assert highest_palindrome(20, 30)... | {
"split": "train",
"index": 63520,
"acecode_id": "evol_9642",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of labels representing different brain regions and a vertex list representing the vertices of a brain surface. Each label consists of a list of vertex indices that belong to that label. Write a function that takes in the list of labels and the vertex list, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_vertices_to_labels([[0, 1], [2, 3]], [0, 1, 2, 3, 4]) == [0, 0, 1, 1, -1]\", \"assert map_vertices_to_labels([[0], [1, 2], [3]], [0, 1, 2, 3, 4, 5]) == [0, 1, 1, 2, -1, -1]\", \"assert map_vertices_to_labels([[0, 1, 2], [3]], [0, 1, 2, 3, 4, 5, 6]) == [0... | {
"split": "train",
"index": 63521,
"acecode_id": "bigcode_python_fns_7314",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a dictionary containing the following statistics: 1. 'count': The total number of integers in the list. 2. 'sum': The sum of all integers in the list. 3. 'mean': The mean (average) of the inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_statistics([]) == {'count': 0, 'sum': 0, 'mean': None, 'min': None, 'max': None, 'median': None}\", \"assert calculate_statistics([1, 2, 3, 4, 5]) == {'count': 5, 'sum': 15, 'mean': 3.0, 'min': 1, 'max': 5, 'median': 3.0}\", \"assert calculate_stat... | {
"split": "train",
"index": 63522,
"acecode_id": "bigcode_python_fns_43977",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even integers from the original list. The order of even integers in the new list should be the same as they appeared in the original list. Your function should handl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbers([0, 1, 2, 3]) == [0, 2]\", \"assert filter_even_numbers... | {
"split": "train",
"index": 63523,
"acecode_id": "oss_22240",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a string representation of a finite state automaton (FSA) into an FSA object. The FSA is represented in the following format: '<states>,<alphabet>,<transitions>,<initial_state>,<accepting_states>'. Your function should p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert str_to_fsa('q0,q1,q2,a,b,c,q0,a,q1,q1,b,q2,q2,c,q2,q0,q2').initial_state == 'q0'\", \"assert str_to_fsa('q0,q1,q2,a,b,c,q0,a,q1,q1,b,q2,q2,c,q2,q0,q2').accepting_states == ['q2']\", \"assert str_to_fsa('q0,q1,a,q0,q0').accepting_states == ['q0']\", \"assert ... | {
"split": "train",
"index": 63524,
"acecode_id": "oss_2031",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of tuples containing IPNS (InterPlanetary Name System) URLs and RSS (Really Simple Syndication) URLs. The function should filter out any IPNS URLs containing the substring ':hash' and return a list of RSS URLs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_ipns_urls([('ipns://example.com', 'http://example.com/rss'), ('ipns://example.com:hash', 'http://example.com/rss2')]) == ['http://example.com/rss']\", \"assert process_ipns_urls([('ipns://valid1.com', 'http://valid1.com/rss'), ('ipns://valid2.com', '... | {
"split": "train",
"index": 63525,
"acecode_id": "oss_25283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a number of days `range_in_days`, write a function `generate_time_ranges(range_in_days: int, start_date: str, end_date: str) -> List[str]` that generates a list of strings representing time ranges. Each range should start from the `start_date` and extend to `end_date`, wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_time_ranges(5, '2023-01-01', '2023-01-10') == ['20230101:20230105', '20230106:20230110']\", \"assert generate_time_ranges(1, '2023-03-01', '2023-03-05') == ['20230301:20230301', '20230302:20230302', '20230303:20230303', '20230304:20230304', '2023030... | {
"split": "train",
"index": 63526,
"acecode_id": "bigcode_python_fns_11564",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining the candidate who received the k-th most votes in a local election based on a list of votes cast. Each vote is represented by a string containing the name of the candidate. Write a function `solution(k, votes)` that returns the name of the candid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solution(1, ['Alice', 'Bob', 'Alice']) == 'Alice'\", \"assert solution(2, ['Alice', 'Bob', 'Alice']) == 'Bob'\", \"assert solution(3, ['Charlie', 'Charlie', 'Alice', 'Bob', 'Bob']) == 'Alice'\", \"assert solution(2, ['David', 'Eve', 'David', 'Eve', 'Frank'])... | {
"split": "train",
"index": 63527,
"acecode_id": "oss_32895",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Design a function that builds a binary expression tree for a given arithmetic equation represented as a string. The equation will only contain non-negative integers, the operators '+', '-', '*', and '/', and will be well-formed without any parentheses. Your function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_expression_tree('5-2+3').data == '+'\", \"assert build_expression_tree('5-2+3').left.data == '-'\", \"assert build_expression_tree('8*2/4').data == '/'\", \"assert build_expression_tree('8*2/4').left.data == '*'\", \"assert build_expression_tree('1*2*3... | {
"split": "train",
"index": 63528,
"acecode_id": "evol_17843",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of currency exchange rates and a maximum exchange rate. Each entry in the list is represented as a string in the format 'currency_name exchange_rate%', where 'exchange_rate' is a percentage. Your task is to implement a function `filter_exchange_rates(data, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_exchange_rates(['SGD 0.75%', 'HKD 1.30%', 'ZAR 1.15%', 'SEK 1.40%'], 1.25) == ['SGD 0.75', 'ZAR 1.15']\", \"assert filter_exchange_rates(['JPY 0.95%', 'CNY 1.05%', 'HKD 1.20%', 'KRW 0.85%'], 1.00) == ['JPY 0.95', 'KRW 0.85']\", \"assert filter_exchang... | {
"split": "train",
"index": 63529,
"acecode_id": "oss_31404",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a variable number of string inputs representing file names, implement a function `load_files` that returns a list of the same file names, but with each file name converted to uppercase. The function should take any number of string arguments and return a list of strings. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_files('file1.txt', 'file2.txt') == ['FILE1.TXT', 'FILE2.TXT']\", \"assert load_files('data.csv', 'report.doc') == ['DATA.CSV', 'REPORT.DOC']\", \"assert load_files('image.png') == ['IMAGE.PNG']\", \"assert load_files('notes.txt', 'summary.txt', 'todo.tx... | {
"split": "train",
"index": 63530,
"acecode_id": "bigcode_python_fns_40710",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of supported IRGA types and a string representing the IRGA type from a control file, implement a function that returns the corresponding check routine based on the IRGA type. The function should remove any hyphens or spaces from the IRGA type string before checking... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_check_routine('li7500') == 'do_li7500check'\", \"assert get_check_routine('li7500a') == 'do_li7500acheck'\", \"assert get_check_routine('li7500 ') == 'do_li7500check'\", \"assert get_check_routine(' li7500') == 'do_li7500check'\", \"assert get_check_rout... | {
"split": "train",
"index": 63531,
"acecode_id": "bigcode_python_fns_45967",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given two positive integers `start` and `end`, and a float `pct` in the range [0.0, 1.0], implement a function `annealing_exp(start: int, end: int, pct: float) -> float` that calculates the exponentially annealed value from `start` to `end` as `pct` varies from 0.0 to 1.0. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(annealing_exp(10, 20, 0.0) - 10) < 1e-9\", \"assert abs(annealing_exp(5, 25, 0.0) - 5) < 1e-9\", \"assert abs(annealing_exp(1, 10, 0.0) - 1) < 1e-9\", \"assert abs(annealing_exp(3, 9, 0.0) - 3) < 1e-9\", \"assert abs(annealing_exp(2, 8, 0.0) - 2) < 1e-9\... | {
"split": "train",
"index": 63532,
"acecode_id": "bigcode_python_fns_553",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that doubles each number in a given list of integers. Your function should take a single parameter, which is a list of integers, and return a new list containing each of the integers from the input list multiplied by 2. If the input list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert double([1, 2, 3]) == [2, 4, 6]\", \"assert double([0]) == [0]\", \"assert double([-1, -2, -3]) == [-2, -4, -6]\", \"assert double([10, 20, 30]) == [20, 40, 60]\", \"assert double([]) == []\", \"assert double([5]) == [10]\", \"assert double([100, 200]) == [20... | {
"split": "train",
"index": 63533,
"acecode_id": "bigcode_python_fns_4183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing timestamps in the format 'Month Day, Year' (e.g., 'Jan 01, 2020'). Your task is to implement a function that returns the earliest timestamp in ISO 8601 format ('YYYY-MM-DDTHH:MM:SS'). If the input list is empty, return an empty strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getEarliestTimestamp(['Jan 01, 2020', 'Feb 28, 2020', 'Mar 01, 2019']) == '2019-03-01T00:00:00'\", \"assert getEarliestTimestamp(['Dec 25, 2018', 'Jan 01, 2019', 'Nov 11, 2019']) == '2018-12-25T00:00:00'\", \"assert getEarliestTimestamp(['Invalid Date', 'Feb... | {
"split": "train",
"index": 63534,
"acecode_id": "bigcode_python_fns_47451",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total sum of all numeric elements in a potentially deeply nested list. The function should handle input that may include integers, floats, and nested lists. If any element in the input is not a number (neither inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert loopList([1, 2, 3]) == 6\", \"assert loopList([[1, 2], [3, 4]]) == 10\", \"assert loopList([1, [2, [3]], 4]) == 10\", \"assert loopList([[1, 2], 3, 4]) == 10\", \"assert loopList([[], [1, 2, 3]]) == 6\", \"assert loopList([[1, [2.5, 3]], 4.5]) == 11.0\", \"a... | {
"split": "train",
"index": 63535,
"acecode_id": "evol_1491",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of records, where each record is represented as a dictionary containing the following keys: 'name' (string), 'age' (integer), 'state-province' (string), and 'domains' (list of strings). Your task is to implement a function `process_records`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_records([{'name': 'Alice', 'age': 30, 'state-province': 'California', 'domains': ['AI', 'ML']}, {'name': 'Bob', 'age': 25, 'state-province': 'New York', 'domains': []}]) == ['Name: Alice, Age: 30, State/Province: California, Domains: AI, ML', 'Name: ... | {
"split": "train",
"index": 63536,
"acecode_id": "oss_27939",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given YouTube video URL is valid based on its duration. The function should take in a URL and a duration limit (in seconds), returning True if the video duration is less than or equal to the limit, and False otherwise... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_video('https://example.com/video1', 300) == True\", \"assert is_valid_video('https://example.com/video1', 200) == False\", \"assert is_valid_video('https://example.com/video2', 120) == True\", \"assert is_valid_video('https://example.com/video2', 15... | {
"split": "train",
"index": 63537,
"acecode_id": "bigcode_python_fns_10498",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Your task is to implement a function that determines the average age of the group. The function should take in a list of integers and return the average age as a float, rounded to two decimal places. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_age([20, 30, 40]) == 30.0\", \"assert average_age([25, 35, 45, 55]) == 40.0\", \"assert average_age([18, 22, 27, 30, 35]) == 26.4\", \"assert average_age([50]) == 50.0\", \"assert average_age([0, 0, 0]) == 0.0\", \"assert average_age([]) == 0.0\", \"... | {
"split": "train",
"index": 63538,
"acecode_id": "oss_13148",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the head of a linked list that contains unique integer values and a list G which is a subset of the values present in the linked list. Your task is to implement a function `numConnectedComponents(head: ListNode, G: List[int]) -> int` that calculates and returns th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numConnectedComponents(create_linked_list([0, 1, 2, 3]), [0, 1, 3]) == 2\", \"assert numConnectedComponents(create_linked_list([0, 1, 2, 3, 4]), [0, 3, 1, 4]) == 2\", \"assert numConnectedComponents(create_linked_list([1, 2, 3, 4]), [2, 4]) == 2\", \"assert ... | {
"split": "train",
"index": 63539,
"acecode_id": "evol_35954",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, a and b. Your task is to write a function that checks if the two integers are equal or not. If they are equal, the function should return False, indicating that the next operation should not be skipped. If they are not equal, the function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert skip_next_if_unequal(0, 1) == True\", \"assert skip_next_if_unequal(1, 0) == True\", \"assert skip_next_if_unequal(5, 5) == False\", \"assert skip_next_if_unequal(-1, 1) == True\", \"assert skip_next_if_unequal(10, 10) == False\", \"assert skip_next_if_unequ... | {
"split": "train",
"index": 63540,
"acecode_id": "bigcode_python_fns_35781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of faces representing a 3D mesh and the number of points in the mesh. Each face is represented by a list of three vertices. Write a function `populate_neighbor_lists(npoints, faces)` that takes in the number of points `npoints` and a list of faces `faces`, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert populate_neighbor_lists(4, [[0, 1, 2], [1, 2, 3], [2, 3, 0], [3, 0, 1]]) == [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]]\", \"assert populate_neighbor_lists(3, [[0, 1, 2]]) == [[1, 2], [0, 2], [0, 1]]\", \"assert populate_neighbor_lists(1, []) == [[]]\", \"a... | {
"split": "train",
"index": 63541,
"acecode_id": "oss_227",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a string that may contain alphabetic characters, special characters, and numbers, write a function that removes all consecutive duplicate characters from the string, while preserving the order of non-duplicate characters. The function should return the modified string. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates('AAABBBCCC123$$$%%%') == 'ABC123$%'\", \"assert remove_duplicates('abcABCaaa') == 'abcABCa'\", \"assert remove_duplicates('1122334455') == '12345'\", \"assert remove_duplicates('!!!@@@###') == '!@#'\", \"assert remove_duplicates('') == ''\"... | {
"split": "train",
"index": 63542,
"acecode_id": "evol_31179",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers `org` and a list of sequences `seqs`. Your task is to determine if the original list can be uniquely reconstructed from the sequences. A sequence can only be used if it forms a valid ascending order within the original list. Implement a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sequenceReconstruction([1,2,3], [[1,2],[1,3],[2,3]]) == (True, 3)\", \"assert sequenceReconstruction([1,2,3], [[1,2],[2,3]]) == (True, 3)\", \"assert sequenceReconstruction([1], [[1]]) == (True, 1)\", \"assert sequenceReconstruction([4,5,6], [[4,5],[5,6]]) =... | {
"split": "train",
"index": 63543,
"acecode_id": "evol_34115",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if all elements in a list of integers are unique. The function should take a list of integers as input and return True if all elements are unique, and False otherwise. For example, given the list [1, 2, 3, 4], the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_elements_unique([1, 2, 3, 4]) == True\", \"assert are_elements_unique([1, 1, 1, 1]) == False\", \"assert are_elements_unique([1, 2, 3]) == True\", \"assert are_elements_unique([]) == True\", \"assert are_elements_unique([0]) == True\", \"assert are_eleme... | {
"split": "train",
"index": 63544,
"acecode_id": "bigcode_python_fns_19953",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to detect a specific synchronization pattern in a byte stream. The synchronization pattern is represented by a sequence of four consecutive zero bytes. Your function should take a list of bytes as input and return a boolean indicating... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_sync_pattern([1, 2, 3, 4, 5]) == False\", \"assert detect_sync_pattern([0, 0, 0, 0]) == True\", \"assert detect_sync_pattern([1, 0, 0, 0, 0, 2]) == True\", \"assert detect_sync_pattern([2, 0, 1, 0, 0, 0, 0]) == True\", \"assert detect_sync_pattern([0,... | {
"split": "train",
"index": 63545,
"acecode_id": "oss_29463",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a response dictionary and returns a specific payment URL. The response dictionary contains information about a payment, and the function should extract the payment URL from the nested structure. Specifically, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_payment_url({'info': {'paymentUrl': {'web': 'https://example.com/payment'}}}) == 'https://example.com/payment'\", \"assert extract_payment_url({'info': {'paymentUrl': {}}}) == 'https://defaultpayment.com'\", \"assert extract_payment_url({'info': {}})... | {
"split": "train",
"index": 63546,
"acecode_id": "oss_7906",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the embedding range and entity dimension for a neural network based on given parameters. The function should take four parameters: `hidden_dim` (an integer representing the dimension of the hidden layer), `gamma` (a fl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_embedding_and_dimension(10, 0.5, 0.5, True) == (0.1, 20)\", \"assert calculate_embedding_and_dimension(10, 1.0, 1.0, False) == (0.2, 10)\", \"assert calculate_embedding_and_dimension(5, 2.0, 2.0, True) == (0.8, 10)\", \"assert calculate_embedding_a... | {
"split": "train",
"index": 63547,
"acecode_id": "oss_35224",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary string `s` (a string consisting only of '0' and '1's), write a function that returns a list containing two integers. The first integer should be the total number of substrings consisting of only '1's or only '0's, and the second integer should be the number of su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numberOfSubstrings('111111') == [21, 0]\", \"assert numberOfSubstrings('1') == [1, 0]\", \"assert numberOfSubstrings('0') == [1, 0]\", \"assert numberOfSubstrings('111') == [6, 0]\", \"assert numberOfSubstrings('0000') == [10, 0]\", \"assert numberOfSubstrin... | {
"split": "train",
"index": 63548,
"acecode_id": "evol_35198",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a list of RPM (Revolutions Per Minute) values. The validation should ensure that each RPM value in the list is a positive integer. If any value is invalid, your function should raise a ValueError with a message indicating w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_rpms([3000, 5000, 7000]) is None\", \"assert validate_rpms([1000, 2000, 3000]) is None\", \"assert validate_rpms([1, 2, 3]) is None\", \"assert validate_rpms([100]) is None\", \"assert validate_rpms([5000]) is None\", \"assert validate_rpms([4000, 4... | {
"split": "train",
"index": 63549,
"acecode_id": "oss_21611",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique interview link for job applicants. The function should take the details of the job and the applicant's information as input and return a formatted interview link. The input will be a dictionary containing the follo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_interview_link({'interview_template_id': '123', 'job_id': '456', 'job_code': 'JOB001', 'job_title': 'Software Engineer', 'first_name': 'John', 'last_name': 'Doe', 'email': 'john.doe@example.com'}) == 'https://example.com/interviews/456/invite'\", \"... | {
"split": "train",
"index": 63550,
"acecode_id": "bigcode_python_fns_46869",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a rectangular cake with height `h` and width `w`, and two arrays of integers `horizontalCuts` and `verticalCuts`, where `horizontalCuts[i]` is the distance from the top of the rectangular cake to the `ith` horizontal cut and similarly, `verticalCuts[j]` is the distance fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxArea(5, 4, [3], [3]) == [9, 2]\", \"assert maxArea(10, 10, [1, 3, 6], [2, 5, 8]) == [12, 6]\", \"assert maxArea(12, 22, [2, 7, 9], [1, 3, 15]) == [60, 6]\", \"assert maxArea(1000, 1000, [500], [500]) == [250000, 2]\", \"assert maxArea(2, 1000000000, [1], ... | {
"split": "train",
"index": 63551,
"acecode_id": "evol_25962",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given two objects `prev` and `curr`, each representing a marker in a 2D space. Each marker has two properties: `depth` (an integer representing the vertical position of the marker) and a method `is_stars()` that returns a boolean indicating if the marker is a star or no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert star_marker_level(MockMarker(True, 1), MockMarker(False, 1)) == True\", \"assert star_marker_level(MockMarker(True, 2), MockMarker(False, 2)) == True\", \"assert star_marker_level(MockMarker(True, 3), MockMarker(True, 3)) == False\", \"assert star_marker_lev... | {
"split": "train",
"index": 63552,
"acecode_id": "bigcode_python_fns_40399",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps representing data entries and a specific timestamp. Your task is to filter out all timestamps from the list that are older than the specified timestamp. Implement a function 'filter_recent_entries' that takes the following parameters: 'timesta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_recent_entries(['2023-01-01 12:00:00', '2023-01-02 12:00:00', '2023-01-03 12:00:00'], '2023-01-01 12:00:00') == ['2023-01-02 12:00:00', '2023-01-03 12:00:00']\", \"assert filter_recent_entries(['2023-01-01 11:00:00', '2023-01-01 12:00:00', '2023-01-01... | {
"split": "train",
"index": 63553,
"acecode_id": "bigcode_python_fns_10488",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with merging flight data for two consecutive days. Given two lists of flight records, `prev_flights` and `next_flights`, where each record contains a unique flight ID and associated data, your goal is to create a new list that combines the flight data from both d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_flights([{'FLIGHT_ID': 'A123', 'DATA': 'Prev Data 1'}], [{'FLIGHT_ID': 'A124', 'DATA': 'Next Data 1'}]) == [{'FLIGHT_ID': 'A123', 'DATA': 'Prev Data 1'}, {'FLIGHT_ID': 'A124', 'DATA': 'Next Data 1'}]\", \"assert merge_flights([{'FLIGHT_ID': 'A123', 'DA... | {
"split": "train",
"index": 63554,
"acecode_id": "bigcode_python_fns_20302",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a dictionary where each key is a unique character from the string and the corresponding value is the count of how many times that character appears in the string.\nPlease reason step by step, then write a self-contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_count('hello') == {'h': 1, 'e': 1, 'l': 2, 'o': 1}\", \"assert char_count('test') == {'t': 2, 'e': 1, 's': 1}\", \"assert char_count('') == {}\", \"assert char_count('a') == {'a': 1}\", \"assert char_count('abc') == {'a': 1, 'b': 1, 'c': 1}\", \"assert ... | {
"split": "train",
"index": 63555,
"acecode_id": "evol_12161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `configure_logging` that takes three parameters: `config_file` (a string representing the path to a configuration file), `debug` (a boolean indicating if debug mode should be enabled), and `verbose` (a boolean indicating if ver... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_logging('config.yaml', False, False) == {'config_file': 'config.yaml', 'log_level': 'WARNING'}\", \"assert configure_logging('config.yaml', True, False) == {'config_file': 'config.yaml', 'log_level': 'DEBUG'}\", \"assert configure_logging('config.y... | {
"split": "train",
"index": 63556,
"acecode_id": "bigcode_python_fns_20752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes three strings as input. The first two strings represent sets of alphabetic characters, while the third string is a combination of the first two strings, but its letters are shuffled. The function should return True if the third string is a proper... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_shuffle_anagram('abc', 'def', 'abcdef') == True\", \"assert is_shuffle_anagram('abc', 'def', 'fedcba') == True\", \"assert is_shuffle_anagram('a', 'b', 'ab') == True\", \"assert is_shuffle_anagram('a', 'b', 'ba') == True\", \"assert is_shuffle_anagram('aa... | {
"split": "train",
"index": 63557,
"acecode_id": "evol_29098",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that takes this list and returns a new list containing only the even integers from the original list, preserving the original order. The function should be named `filter_even_numbers`. The input list may con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_n... | {
"split": "train",
"index": 63558,
"acecode_id": "bigcode_python_fns_28765",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a simple messaging system where each message can either be read or unread by the recipient. Your task is to implement a function that accepts a list of boolean values representing the read status of multiple messages and returns a list of indices fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unread_message_indices([False, True, False, True]) == [0, 2]\", \"assert get_unread_message_indices([True, True, True]) == []\", \"assert get_unread_message_indices([False, False, False]) == [0, 1, 2]\", \"assert get_unread_message_indices([]) == []\", \... | {
"split": "train",
"index": 63559,
"acecode_id": "oss_10102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with decoding an EAN-13 barcode from a string of bits (0s and 1s) that represents the barcode. The input to your function will be a string 'codes' of length 95, where each character is either '0' or '1'. Your function should return a string representing the decod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_EAN13('10111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101') == ''\", \"assert decode_EAN13('11001011011000100110010111111111010111000111011110010101010011000101100111011011110011001010101') == ''\", \"asser... | {
"split": "train",
"index": 63560,
"acecode_id": "bigcode_python_fns_6141",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of biometric data readings (represented as integers) and returns the average of these readings. The average should be rounded to two decimal places. If the input list is empty, the function should return 0.00. Please... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.00\", \"assert calculate_average([10, 20, 30]) == 20.00\", \"assert calculate_average([-1, -2, -3, -4, -5]) == -3.00\", \"assert calculate_average([0, 0, 0, 0]) == 0.00\", \"assert calculate_average([100]) == 100.00\",... | {
"split": "train",
"index": 63561,
"acecode_id": "evol_15271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that accepts a list of user profiles and returns a list of profiles where each profile is represented by a dictionary containing the user's ID, profile photo URL, bio, contact number, location, and username. The function should fil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_valid_profiles([{'id': 1, 'userPhoto': 'url1', 'bio': 'Bio 1', 'contact': '1234567890', 'location': 'Location 1', 'username': 'user1'}, {'id': 2, 'userPhoto': 'url2', 'bio': 'Bio 2', 'contact': '', 'location': 'Location 2', 'username': 'user2'}]) == [... | {
"split": "train",
"index": 63562,
"acecode_id": "oss_31393",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes two lists of integers and returns a new list which contains only the unique elements from both of the lists. The lists might contain up to 1,000,000 elements, and the integers in the list range from -1,000,000 to 1,000,000. The output list sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 4], [3, 4, 5, 6]) == [1, 2, 5, 6]\", \"assert unique_elements([1, 1, 2, 2], [2, 2, 3, 3]) == [1, 3]\", \"assert unique_elements([-1, -2, -3], [-3, -4, -5]) == [-5, -4, -2, -1]\", \"assert unique_elements([0, 0, 0], [0, 0, 0]) == []\... | {
"split": "train",
"index": 63563,
"acecode_id": "evol_34152",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `extract_tweets` that takes a list of tweet objects and returns a list of tweet texts from those objects. Each tweet object is represented as a dictionary with at least the key 'text' containing the tweet content. You can assume the input list will always conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_tweets([{'text': 'Hello World!'}, {'text': 'Learning Python!'}]) == ['Hello World!', 'Learning Python!']\", \"assert extract_tweets([{'text': 'Tweet 1'}, {'text': 'Tweet 2'}, {'text': 'Tweet 3'}]) == ['Tweet 1', 'Tweet 2', 'Tweet 3']\", \"assert extr... | {
"split": "train",
"index": 63564,
"acecode_id": "evol_17360",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `instr` that represents a command line input for a program. Your task is to implement a function `execute_command(instr: str) -> Tuple[str, str]` that simulates executing the command and returns a tuple containing two strings: the first string is a simula... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command('run process') == ('Command executed successfully', '')\", \"assert execute_command('compile code') == ('Command executed successfully', '')\", \"assert execute_command('error in process') == ('Command executed successfully', 'An error occurr... | {
"split": "train",
"index": 63565,
"acecode_id": "bigcode_python_fns_47399",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a simple in-memory settings dictionary for a hypothetical application. The settings dictionary should be initialized with a token when the function is called. The function should provide two capabilities: fetching the cur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_settings('my_token') == {'token': 'my_token'}\", \"assert manage_settings('my_token', {'key1': 'value1'}) == {'token': 'my_token', 'key1': 'value1'}\", \"assert manage_settings('my_token', {'key1': 'value1', 'key2': 'value2'}) == {'token': 'my_token',... | {
"split": "train",
"index": 63566,
"acecode_id": "oss_31975",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a geometric shape with a 'type' key indicating the shape type (e.g., 'circle', 'square', 'triangle') and a 'has_geometry' key which is a boolean indicating whether the shape has geometry information. Write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_if_all_shapes_have_geometry([{'type': 'circle', 'has_geometry': True}, {'type': 'square', 'has_geometry': True}, {'type': 'triangle', 'has_geometry': True}]) == True\", \"assert check_if_all_shapes_have_geometry([{'type': 'circle', 'has_geometry': True... | {
"split": "train",
"index": 63567,
"acecode_id": "bigcode_python_fns_35602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `remove_duplicate_chars(s: str) -> str` that takes a string `s` as input and returns a new string that contains all the unique characters from `s`, preserving the order of their first appearance.\nPlease reason step by step, then write a self-contained Python s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicate_chars('hello') == 'helo'\", \"assert remove_duplicate_chars('aabbcc') == 'abc'\", \"assert remove_duplicate_chars('123321') == '123'\", \"assert remove_duplicate_chars('') == ''\", \"assert remove_duplicate_chars('abcdefg') == 'abcdefg'\", \... | {
"split": "train",
"index": 63568,
"acecode_id": "evol_18134",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing election ballot data from a CSV file. Each ballot entry contains the following fields: 'entity_id', 'status', 'type', 'yeas', 'nays', 'eligible_voters', 'empty', and 'invalid'. Your goal is to validate these entries and collect any errors found du... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_ballot_data([{'entity_id': 1, 'status': 'counted', 'type': 'regular', 'yeas': 10, 'nays': 5, 'eligible_voters': 20, 'empty': 0, 'invalid': 0}]) == []\", \"assert process_ballot_data([{'entity_id': 1, 'status': 'unknown', 'type': 'regular', 'yeas': 10... | {
"split": "train",
"index": 63569,
"acecode_id": "bigcode_python_fns_23809",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_anagram(s1: str, s2: str) -> Union[bool, str]` that takes two strings as input and checks if they are anagrams of each other, considering case insensitivity. If they are anagrams, return True. If they are not anagrams, but at least one of the strings is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_anagram('rat', 'tar') == True\", \"assert is_anagram('bob', 'bbo') == True\", \"assert is_anagram('hello', 'world') == False\", \"assert is_anagram('civic', 'vicic') == True\", \"assert is_anagram('level', 'leveL') == True\", \"assert is_anagram('not', 'a... | {
"split": "train",
"index": 63570,
"acecode_id": "evol_27927",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a string representing hexadecimal digits and converts it into a byte array. The input string can contain whitespace characters, which should be ignored during the conversion. The function should also handle invalid hexad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_string_to_byte_array('48656c6c6f') == b'Hello'\", \"assert hex_string_to_byte_array('') == b''\", \"assert hex_string_to_byte_array('4e6f77206973207468652074696d65') == b'Now is the time'\", \"assert hex_string_to_byte_array('5468697320697320612074657374... | {
"split": "train",
"index": 63571,
"acecode_id": "oss_4234",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a grid representing a maze, where each cell can be either empty (represented by 0) or blocked (represented by 1). Your task is to determine the number of unique paths from the top-left corner of the grid to the bottom-right corner, moving only through empty cells.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_paths([[0, 0], [1, 0]]) == 1\", \"assert unique_paths([[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == 2\", \"assert unique_paths([[0, 1], [0, 0]]) == 1\", \"assert unique_paths([[0, 0], [0, 1]]) == 0\", \"assert unique_paths([[0]]) == 1\", \"assert unique_paths... | {
"split": "train",
"index": 63572,
"acecode_id": "oss_1855",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total sales amount for a specific seller within a defined time range. You are given sales data represented as a list of dictionaries, where each dictionary contains the following keys: 'sale_date' (a string in the format 'YYYY-MM-DD HH:MM:SS'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_sales_amount(1, '2023-01-01 00:00:00', '2023-01-31 23:59:59', [{'sale_date': '2023-01-10 10:00:00', 'seller_id': 1, 'quantity': 0, 'unit_price': 10.0}, {'sale_date': '2023-01-15 12:00:00', 'seller_id': 1, 'quantity': 5, 'unit_price': 5.0}]) =... | {
"split": "train",
"index": 63573,
"acecode_id": "oss_25154",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a mapping of variables to their components. Your task is to create a function called `aggregate_components` that takes in two parameters: `variable` (a string or a list of strings representing the variable(s) to aggregate) and `components... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_components('A', ['A1', 'A2', 'A3']) == {'A1': 'A', 'A2': 'A', 'A3': 'A'}\", \"assert aggregate_components(['A', 'B'], ['A1', 'A2']) == {'A1': 'A', 'A2': 'A'}\", \"assert aggregate_components('C', ['C1', 'C2']) == {'C1': 'C', 'C2': 'C'}\", \"assert ... | {
"split": "train",
"index": 63574,
"acecode_id": "bigcode_python_fns_25023",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a hill climbing algorithm for finding the maximum value of a given mathematical function. The function takes a candidate solution and determines if it should be accepted as the new best solution based on a certain score... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hill_climb(5.0, 4.0) == 5.0\", \"assert hill_climb(3.0, 4.0) == 4.0\", \"assert hill_climb(4.4, 4.0) == 4.4\", \"assert hill_climb(4.0, 4.0) == 4.0\", \"assert hill_climb(4.1, 4.0) == 4.1\", \"assert hill_climb(4.5, 4.0) == 4.5\", \"assert hill_climb(4.2, 4.... | {
"split": "train",
"index": 63575,
"acecode_id": "oss_16377",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of test case execution times represented as a dictionary, where the keys are the names of the test case classes (as strings) and the values are the execution times in seconds (as floats). Write a function `aggregate_timings(test_case_timings: Dict[str, floa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_timings({'TestX': 1.2}) == {'TestX': 1.2}\", \"assert aggregate_timings({}) == {}\", \"assert aggregate_timings({'TestD': 5.0}) == {'TestD': 5.0}\", \"assert aggregate_timings({'TestE': 0.0}) == {'TestE': 0.0}\", \"assert aggregate_timings({'TestA'... | {
"split": "train",
"index": 63576,
"acecode_id": "bigcode_python_fns_36126",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that manages user credentials for a web application. The function should perform the following tasks: Initialize default values for user credentials, and then update these credentials with new values when necessary. Your function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_credentials('https://newexample.com', 'new_password', 'new_username', 'new_test_password', 'new_test@example.com', 'new_template') == {'baseURL': 'https://newexample.com', 'password': 'new_password', 'username': 'new_username', 'usertestingpassword': ... | {
"split": "train",
"index": 63577,
"acecode_id": "oss_12138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function named `subset_sums` that calculates all possible subset sums of the input list and returns them as a sorted list in ascending order. The input will be a list of integers, and the output should be a list of integers representing the uni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subset_sums([]) == [0]\", \"assert subset_sums([1]) == [0, 1]\", \"assert subset_sums([2]) == [0, 2]\", \"assert subset_sums([1, 1]) == [0, 1, 2]\", \"assert subset_sums([1, 2, 3]) == [0, 1, 2, 3, 4, 5, 6]\", \"assert subset_sums([-1, 1]) == [-1, 0, 1]\", \"... | {
"split": "train",
"index": 63578,
"acecode_id": "oss_11139",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a program that counts the occurrences of a specific CSS selector pattern in a given CSS code snippet. The CSS selector pattern to be counted is defined as follows: It starts with the character sequence \"QToolButton\", is followed by a colon (\"... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countCSSSelectorOccurrences('QToolButton:pressed {\\\\n', 'QToolButton:pressed') == 1\", \"assert countCSSSelectorOccurrences('QToolButton:pressed {\\\\nQToolButton:pressed {\\\\n', 'QToolButton:pressed') == 2\", \"assert countCSSSelectorOccurrences('QToolBu... | {
"split": "train",
"index": 63579,
"acecode_id": "oss_37520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to create a function that returns a new list containing only the unique integers from the input list, preserving the original order in which they first appeared. Write a function `get_unique_integers(nums: List[int]) -> List[int]` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 2, 3, 1, 4]) == [1, 2, 3, 4]\", \"assert get_unique_integers([5, 5, 5, 5]) == [5]\", \"assert get_unique_integers([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert get_unique_integers([]) == []\", \"assert get_unique_intege... | {
"split": "train",
"index": 63580,
"acecode_id": "oss_19720",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple classification system. The function `manage_classes(system_id_or_identifier, action, classes=None)` should accept the following parameters: \n1. `system_id_or_identifier` (str): The id or identifier for the classif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_classes('system1', 'create', ['classA', 'classB']) == {'message': 'Classes created successfully.', 'classes': ['classA', 'classB']}\", \"assert manage_classes('system1', 'delete') == {'message': 'Classes of system1 deleted successfully.'}\", \"assert ... | {
"split": "train",
"index": 63581,
"acecode_id": "bigcode_python_fns_6447",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the product of elements in a given list based on a modulo criterion and a numerical range criterion. The function should take a list of integers, a modulo value, and a tuple representing the range (inclusive). It should return the product of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_product([2, 3, 4, 7, 8, 10, 14, 16, 18, 21, 25], None, (10, 25)) == 10 * 14 * 16 * 18 * 21 * 25\", \"assert get_product([2, 3, 4, 7, 8, 10, 14, 16, 18, 21, 25], 1, (0, 30)) == 2 * 3 * 4 * 7 * 8 * 10 * 14 * 16 * 18 * 21 * 25\", \"assert get_product([-5, -... | {
"split": "train",
"index": 63582,
"acecode_id": "evol_301",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates an HTTP PUT request to a specified URL. The function should accept a URL, optional headers (as a dictionary), optional data (which can be a string or None), and an optional timeout value. The function needs to return a stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_put_request('http://example.com', None, None, 10) == 'Request to http://example.com was successful'\", \"assert simulate_put_request('http://example.com', {'Authorization': 'Bearer token'}, 'data', None) == 'Request to http://example.com was success... | {
"split": "train",
"index": 63583,
"acecode_id": "oss_23760",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing the characteristics of a hero in a role-playing game. You will implement a function `manage_hero_characteristics(hero: dict, characteristic: str, points: int) -> dict` that updates the hero's characteristics based on the provided input. Your functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_hero_characteristics({'Strength': 10, 'Agility': 8, 'Intelligence': 6}, 'Strength', 5) == {'Strength': 15, 'Agility': 8, 'Intelligence': 6}\", \"assert manage_hero_characteristics({'Strength': 10, 'Agility': 8, 'Intelligence': 6}, 'Intelligence', 2) =... | {
"split": "train",
"index": 63584,
"acecode_id": "oss_9998",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_primes(n: int) -> int` that counts the number of prime numbers less than a given integer n. The function should return 0 for any value of n less than or equal to 1, and should correctly count the prime numbers for values of n greater than 1.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_primes(0) == 0\", \"assert count_primes(1) == 0\", \"assert count_primes(2) == 0\", \"assert count_primes(3) == 1\", \"assert count_primes(4) == 2\", \"assert count_primes(10) == 4\", \"assert count_primes(20) == 8\", \"assert count_primes(30) == 10\",... | {
"split": "train",
"index": 63585,
"acecode_id": "evol_22256",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python module that provides a set of tools for working with two specific astronomical observatories: Hinode and IRIS. The module should expose only the functions related to these observatories while hiding all other internal functions and vari... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert 'hinode' in __all__\", \"assert 'iris' in __all__\", \"assert '_internal_function' not in __all__\", \"assert isinstance(hinode, type(lambda: None))\", \"assert isinstance(iris, type(lambda: None))\", \"assert hinode.__name__ == 'hinode'\", \"assert iris.__n... | {
"split": "train",
"index": 63586,
"acecode_id": "oss_1419",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing hexadecimal escape sequences. Your task is to write a function to decode the string and return the corresponding ASCII representation. The input string `hex_string` consists of hexadecimal escape sequences in the format `\\xHH`, where `HH` repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_hex_escape('\\\\\\\\x48\\\\\\\\x65\\\\\\\\x6c\\\\\\\\x6c\\\\\\\\x6f') == 'Hello'\", \"assert decode_hex_escape('\\\\\\\\x41\\\\\\\\x42\\\\\\\\x43') == 'ABC'\", \"assert decode_hex_escape('\\\\\\\\x57\\\\\\\\x6f\\\\\\\\x72\\\\\\\\x6c\\\\\\\\x64') == 'W... | {
"split": "train",
"index": 63587,
"acecode_id": "oss_26745",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that configures an application with specific credentials. The function should take in a dictionary of credentials and a name for the application configuration. If no credentials are provided, the function should raise a TypeError. If the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_application({'username': 'user1', 'password': 'pass1'}, 'app_config') == 'app_config'\", \"assert configure_application({'api_key': 'key123'}, 'my_app') == 'my_app'\", \"assert configure_application({'token': 'abc123'}, 'secure_app') == 'secure_app... | {
"split": "train",
"index": 63588,
"acecode_id": "bigcode_python_fns_28746",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines if an error occurred during an HTTP request. An error is defined as an event where the HTTP response is invalid or the connection is interrupted. The function should take in a dictionary representing the HTTP flow, contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_http_error({'status_code': 200, 'connection': True}) == False\", \"assert is_http_error({'status_code': 404, 'connection': True}) == True\", \"assert is_http_error({'status_code': 500, 'connection': True}) == True\", \"assert is_http_error({'status_code':... | {
"split": "train",
"index": 63589,
"acecode_id": "bigcode_python_fns_43483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes the following parameters: a list of strings representing file paths to image files, a boolean indicating whether album names should be treated as keywords, a boolean indicating whether person names should be treated as keywords,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_image_metadata(['image1.jpg', 'image2.jpg'], True, False, ['keyword1', 'keyword2'], ['description1'], True) == {'image1.jpg': {'use_albums_as_keywords': True, 'use_persons_as_keywords': False, 'keyword_template': ['keyword1', 'keyword2'], 'descriptio... | {
"split": "train",
"index": 63590,
"acecode_id": "bigcode_python_fns_25627",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `detect_objects(image: List[int], model: str) -> List[str]` that takes an image represented as a list of integers (pixel values) and a string representing the model ('custom' or 'yolo'). The function should return a list of detected objects in the image usi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_objects([255, 0, 0], 'custom') == ['cat', 'dog']\", \"assert detect_objects([0, 255, 0], 'custom') == ['car']\", \"assert detect_objects([0, 0, 255], 'custom') == []\", \"assert detect_objects([128, 128, 128], 'custom') == []\", \"assert detect_object... | {
"split": "train",
"index": 63591,
"acecode_id": "evol_35005",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_output_valid(func)` that takes a single argument, a function `func` which takes an integer input and returns an integer. The function `is_output_valid` should return `True` if the `func` outputs only the values -1, 0, or 1 for all integer inputs from -1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_output_valid(lambda x: -1 if x < 0 else (0 if x == 0 else 1)) == True\", \"assert is_output_valid(lambda x: 2 if x > 0 else -2) == False\", \"assert is_output_valid(lambda x: x) == False\", \"assert is_output_valid(lambda x: -1 if x % 2 == 0 else 1) == Tr... | {
"split": "train",
"index": 63592,
"acecode_id": "evol_36145",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string S, write a function that returns the index of the last occurrence of a specific substring p within S. If the substring p does not exist in S, return -1. Implement the function `find_last_occurrence(S: str, p: str) -> int`.\nPlease reason step by step, then write ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_last_occurrence('Data Science', 'S') == 5\", \"assert find_last_occurrence('Test case', 'test') == -1\", \"assert find_last_occurrence('banana', 'an') == 3\", \"assert find_last_occurrence('abcdefg', 'h') == -1\", \"assert find_last_occurrence('12345678... | {
"split": "train",
"index": 63593,
"acecode_id": "evol_22754",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a Python decorator that logs the execution of a function. The decorator should print the name of the function and the arguments it was called with every time the function is executed. Your function should not return any value. Create a simple function to demonstrate t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert my_decorator(lambda x: x)(5) is None\", \"assert my_decorator(lambda x, y: x + y)(2, 3) is None\", \"assert my_decorator(lambda: print('Hello'))() is None\", \"assert my_decorator(lambda a, b, c: a * b * c)(1, 2, 3) is None\", \"assert my_decorator(lambda: 4... | {
"split": "train",
"index": 63594,
"acecode_id": "evol_17419",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `modify_5d_array(coords: Tuple[int, int, int, int, int], new_value: int) -> None` that modifies a 5D array of size 3 x 3 x 3 x 3 x 3 where every element corresponds to -1. The function should update the value at the specified 5D coordinates `coords` with `n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_5d_array((0, 0, 0, 0, 0), 99) is None\", \"assert modify_5d_array((1, 1, 1, 1, 1), 50) is None\", \"assert modify_5d_array((2, 2, 2, 2, 2), 75) is None\", \"assert modify_5d_array((0, 1, 2, 0, 1), 10) is None\", \"assert modify_5d_array((1, 0, 1, 1, 1... | {
"split": "train",
"index": 63595,
"acecode_id": "evol_33203",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a group of applications deployed in a cluster. Each application can have multiple tasks running at any time. Your job is to implement a function that simulates scaling an individual application within a group. The function should take the following ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scale_application([{'id': 'app1', 'tasks': 1}, {'id': 'app2', 'tasks': 1}], 'app1', 2) == [{'id': 'app1', 'tasks': 2}, {'id': 'app2', 'tasks': 1}]\", \"assert scale_application([{'id': 'app1', 'tasks': 3}, {'id': 'app2', 'tasks': 2}], 'app2', 5) == [{'id': '... | {
"split": "train",
"index": 63596,
"acecode_id": "bigcode_python_fns_44640",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of orders represented as dictionaries, each containing 'order_id', 'order_time', and 'subtotal', write a function `select_data(orders)` that filters and returns a list of orders where 'order_time' is greater than a specified timestamp. The function should take two ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_data([{'order_id': 1, 'order_time': '2023-10-01 10:00:00', 'subtotal': 100.0}, {'order_id': 2, 'order_time': '2023-10-02 11:00:00', 'subtotal': 150.0}], '2023-10-01 12:00:00') == [{'order_id': 2, 'order_time': '2023-10-02 11:00:00', 'subtotal': 150.0}... | {
"split": "train",
"index": 63597,
"acecode_id": "evol_26828",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `number_category(num: int) -> str` that evaluates the category of the given integer `num`. The function should return 'even' if the number is even, 'odd' if the number is odd, and 'null' if the number is zero.\nPlease reason step by step, then write a self-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert number_category(0) == 'null'\", \"assert number_category(1) == 'odd'\", \"assert number_category(2) == 'even'\", \"assert number_category(-1) == 'odd'\", \"assert number_category(-2) == 'even'\", \"assert number_category(3) == 'odd'\", \"assert number_catego... | {
"split": "train",
"index": 63598,
"acecode_id": "evol_15327",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_search(arr: List[int], x: int) -> int` that performs a binary search on a sorted array `arr` to find the index of the element `x`. If `x` exists in the array, return its index. If `x` does not exist in the array, return -1. The input array is guaran... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5) == 4\", \"assert binary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1) == 0\", \"assert binary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10) == 9\", \"assert binary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6) == 5\"... | {
"split": "train",
"index": 63599,
"acecode_id": "evol_27447",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.