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 given a document containing named entities, each represented as a tuple of (text, label, start_char, end_char). Your task is to determine the counts of each unique entity label in the document. The input will be a list of such tuples. Implement a function `count_entity_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_entity_labels([('Apple', 'ORG', 0, 5), ('is', 'O', 5, 7), ('a', 'O', 7, 8), ('fruit', 'O', 8, 13), ('from', 'O', 13, 17), ('California', 'LOC', 17, 27)]) == {'ORG': 1, 'O': 4, 'LOC': 1}\", \"assert count_entity_labels([('Google', 'ORG', 0, 6), ('and', ... | {
"split": "train",
"index": 85500,
"acecode_id": "bigcode_python_fns_7374",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of podcasts, each represented as a dictionary containing 'title', 'description', 'publication_date', 'audio_link', 'transcript_text', and 'channel'. The function should return a list of titles of podcasts that match a given search query in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_podcasts([{'title': 'Tech Talk', 'description': 'Discussion on tech trends', 'publication_date': '2023-10-01', 'audio_link': 'http://example.com/audio1', 'transcript_text': '...', 'channel': 'Tech Channel'}, {'title': 'Health Matters', 'description': ... | {
"split": "train",
"index": 85501,
"acecode_id": "evol_7725",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the behavior of a magnetic system under the influence of external magnetic fields. Implement a function `apply_external_fields(H_ext_list: List[Tuple[float, float, float]]) -> None` that takes a list of external magnetic field vectors and simulate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_external_fields([(1.0, 0.0, 0.0)]) == None\", \"assert apply_external_fields([(0.0, 1.0, 0.0)]) == None\", \"assert apply_external_fields([(0.0, 0.0, 1.0)]) == None\", \"assert apply_external_fields([(1.0, 1.0, 0.0)]) == None\", \"assert apply_external... | {
"split": "train",
"index": 85502,
"acecode_id": "oss_10979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the multiplicative product of three integral parameters: x, y, and z. The function should return the result of multiplying these three integers together.\nPlease reason step by step, then write a self-contained Python solution. Give your fin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply(1, 2, 3) == 6\", \"assert multiply(0, 2, 3) == 0\", \"assert multiply(-1, 2, 3) == -6\", \"assert multiply(5, 5, 5) == 125\", \"assert multiply(7, 2, 4) == 56\", \"assert multiply(10, 0, 5) == 0\", \"assert multiply(-2, -3, 4) == 24\", \"assert mult... | {
"split": "train",
"index": 85503,
"acecode_id": "evol_23548",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of unique pointers and a list of corresponding values. Your task is to create a dictionary where each pointer is a key and its corresponding value is the value in the dictionary. If the input contains a dictionary instead of a list, you should extract the v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_pointer_value_dict(['ptr1', 'ptr2'], ['value1', 'value2']) == {'ptr1': 'value1', 'ptr2': 'value2'}\", \"assert create_pointer_value_dict(['ptr1', 'ptr2', 'ptr3'], {'ptr1': 'value1', 'ptr2': 'value2', 'ptr3': 'value3'}) == {'ptr1': 'value1', 'ptr2': 'v... | {
"split": "train",
"index": 85504,
"acecode_id": "bigcode_python_fns_34036",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that contains display options for a dashboard. Each display option is represented as a dictionary containing a name, a NRQL query string, and a visualization type. Your task is to implement a function `parse_displays(config: Dict) -> Dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_displays({'displays': {'display1': {'nrql': 'SELECT * FROM events', 'visualization': 'line'}}}) == {'display1': {'nrql': 'SELECT * FROM events', 'visualization': 'line'}}\", \"assert parse_displays({'displays': {'display2': {'nrql': '', 'visualization'... | {
"split": "train",
"index": 85505,
"acecode_id": "bigcode_python_fns_1908",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the total size of all files in a given list of file sizes. Your function should take a list of non-negative integers representing the sizes of files in bytes and return the total size in a human-readable format. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_size([1024]) == 'Total size: 1.00 KB'\", \"assert total_size([2048]) == 'Total size: 2.00 KB'\", \"assert total_size([1024, 1024]) == 'Total size: 2.00 KB'\", \"assert total_size([1048576]) == 'Total size: 1.00 MB'\", \"assert total_size([5242880]) == ... | {
"split": "train",
"index": 85506,
"acecode_id": "oss_2715",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents the output of a test framework. Your task is to implement a function that parses this string to determine the total number of tests executed and the number of failed tests. The output string can be in one of two formats: 1) For pytest, it ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_test_stats_from_output('==== 32 passed, 3 failed, 0 deselected ====', None) == (35, 3)\", \"assert parse_test_stats_from_output('3/5 test cases failed', 'fail') == (5, 3)\", \"assert parse_test_stats_from_output('2/2 test cases failed', 'fail') == (2, ... | {
"split": "train",
"index": 85507,
"acecode_id": "bigcode_python_fns_47923",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `min_positive_element(l: list)` that returns the smallest positive integer in the list without using any comparison operations. The list may contain both positive and negative integers, and if there are no positive integers, return 0.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_positive_element([5, -3, 2, 1, -4]) == 1\", \"assert min_positive_element([-1, -2, -3, -4]) == 0\", \"assert min_positive_element([10, 20, 30, 5]) == 5\", \"assert min_positive_element([-10, 0, 2, 1]) == 1\", \"assert min_positive_element([3, 5, 7, 9]) =... | {
"split": "train",
"index": 85508,
"acecode_id": "evol_346",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to represent an animal making a sound. Implement a function named `animal_sound` that takes three parameters: `name` (a string), `species` (a string), and `breed` (a string), and a fourth parameter `sound` (a string). The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert animal_sound('Felix', 'Felino', 'Angor\\u00e1', 'miau') == 'Felix the Felino Angor\\u00e1 makes the sound miau'\", \"assert animal_sound('Buddy', 'Canine', 'Beagle', 'bark') == 'Buddy the Canine Beagle makes the sound bark'\", \"assert animal_sound('Whiskers... | {
"split": "train",
"index": 85509,
"acecode_id": "oss_4981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a positive integer `n`. Your task is to find the smallest prime number that can be obtained by replacing exactly one digit in `n` with any other digit (0-9). The replacement digits do not have to be adjacent or consecutive, but they have to be the same. If `n` is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smallest_prime_replacement(10) == 11\", \"assert smallest_prime_replacement(40) == 41\", \"assert smallest_prime_replacement(56) == 53\", \"assert smallest_prime_replacement(500) == 503\", \"assert smallest_prime_replacement(1000) == 1009\"]}"
} | {
"split": "train",
"index": 85510,
"acecode_id": "oss_8359",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing CPU utilization percentages for different tasks. Write a function that detects outliers based on a specified threshold. An outlier is defined as a value that is greater than the mean of the list plus the threshold times the standard... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_outliers([10, 20, 30, 40, 50], 10) == []\", \"assert detect_outliers([-10, -20, -30, -40, -50], 5) == []\", \"assert detect_outliers([10, 10, 10, 10, 10], 0) == []\", \"assert detect_outliers([0, 0, 0, 0, 0], 1) == []\", \"assert detect_outliers([1, 1... | {
"split": "train",
"index": 85511,
"acecode_id": "bigcode_python_fns_24571",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function `find_superior_numbers(arr)` that identifies and returns all the elements in the array that are greater than their immediate neighbors. An element is considered 'superior' if it is greater than both the element before it and the elem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_superior_numbers([1, 2, 3, 4, 5]) == []\", \"assert find_superior_numbers([1, 3, 2, 4, 1, 5]) == [3, 4]\", \"assert find_superior_numbers([7, 5, 8, 6, 7]) == [8]\", \"assert find_superior_numbers([10, 10, 10, 10]) == []\", \"assert find_superior_numbers... | {
"split": "train",
"index": 85512,
"acecode_id": "evol_7945",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `square(n: int) -> int` that takes an integer n as input and returns the square of that integer. The function should handle both positive and negative integers correctly.\nPlease reason step by step, then write a self-contained Python solution. Give your fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square(0) == 0\", \"assert square(1) == 1\", \"assert square(2) == 4\", \"assert square(3) == 9\", \"assert square(4) == 16\", \"assert square(-1) == 1\", \"assert square(-2) == 4\", \"assert square(-3) == 9\", \"assert square(-4) == 16\", \"assert square(10... | {
"split": "train",
"index": 85513,
"acecode_id": "evol_23210",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that creates an autoscaler for a Managed Instance Group (MIG). Your function should take three parameters: a string representing the name of the autoscaler, a string representing the zone of the MIG, and a dictionary containing the au... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_autoscaler('my-autoscaler', 'us-central1-a', {'min_replicas': 1, 'max_replicas': 5, 'cpu_utilization': 0.6}) == (True, ['my-autoscaler', 'us-central1-a', {'min_replicas': 1, 'max_replicas': 5, 'cpu_utilization': 0.6}])\", \"assert create_autoscaler('a... | {
"split": "train",
"index": 85514,
"acecode_id": "bigcode_python_fns_49429",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that logs information about a machine learning model. The function should take a model object as input and return a string that contains details about the model, including its parameters count, activation count, and floating point operati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_model_info(MockModel('ModelA', 1000, 500, 20000)) == 'Model: ModelA\\\\nParams: 1,000\\\\nActs: 500\\\\nFlops: 20,000'\", \"assert log_model_info(MockModel('ModelB', 2500, 1200, 50000)) == 'Model: ModelB\\\\nParams: 2,500\\\\nActs: 1,200\\\\nFlops: 50,00... | {
"split": "train",
"index": 85515,
"acecode_id": "bigcode_python_fns_14398",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing HTML content that may include special database-representation tags for links and embeds. Your task is to implement a function `transform_html(html: str, for_editor: bool) -> str` that transforms these tags into standard HTML tags usable in te... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_html('<a linktype=\\\"internal\\\">Internal Link</a>', False) == '<a href=\\\"/internal\\\">Internal Link</a>'\", \"assert transform_html('<embed embedtype=\\\"video\\\">Video Content</embed>', True) == '<video controls>Video Content</video>'\", \"... | {
"split": "train",
"index": 85516,
"acecode_id": "bigcode_python_fns_45724",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `sum_in_range` that takes a list of integers as input and returns the sum of all valid numbers in the list. A valid number is defined as an integer that falls within the inclusive range of 1 to 100. If the list contains any numbers that are not integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_in_range([]) == 0\", \"assert sum_in_range([1, 2, 3]) == 6\", \"assert sum_in_range([1, 101, 50, 99]) == 150\", \"assert sum_in_range([-1, 0, 1, 2]) == 3\", \"assert sum_in_range([5, 'hello', 50]) == 55\", \"assert sum_in_range([100, 150, 200]) == 100\",... | {
"split": "train",
"index": 85517,
"acecode_id": "evol_26092",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of unique integers, write a function `can_arrange_v2(arr, limits, criterion)` that identifies an element suitable for a specific role based on a provided criterion, and also finds a possible swap contender within defined limits. The `limits` parameter is a tuple ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_arrange_v2([1, 2, 4, 3, 5], (2, 4), lambda x: x % 2 == 0) == {'index': 2, 'swap_with': 3}\", \"assert can_arrange_v2([1, 3, 5, 7, 9], (0, 4), lambda x: x % 2 == 1) == {'index': 0, 'swap_with': 1}\", \"assert can_arrange_v2([11, 12, 13, 14, 15], (2, 4), l... | {
"split": "train",
"index": 85518,
"acecode_id": "evol_11265",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple version of the game 'Hangman'. The function takes two parameters: a secret word and a list of letters guessed by the player. The function should return the current state of the guessed word as a string, where c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hangman('banana', ['b', 'a', 'n']) == ('banana', 'Won')\", \"assert hangman('grape', ['g', 'r', 'z', 'p', 'e']) == ('gr_pe', 'Still playing')\", \"assert hangman('orange', ['o', 'r', 'a', 'n', 'g', 'e']) == ('orange', 'Won')\", \"assert hangman('cherry', ['c... | {
"split": "train",
"index": 85519,
"acecode_id": "bigcode_python_fns_32218",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked to evaluate the outcome of a dice roll in a game scenario. Given a target value and the result of a dice roll (between 1 and 100), you need to determine the outcome based on the following rules: 1. If the dice roll is less than or equal to the target value: - If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_dice_roll(50, 3) == 'Critical Success'\", \"assert evaluate_dice_roll(50, 5) == 'Critical Success'\", \"assert evaluate_dice_roll(50, 30) == 'Success'\", \"assert evaluate_dice_roll(50, 50) == 'Success'\", \"assert evaluate_dice_roll(50, 51) == 'Fai... | {
"split": "train",
"index": 85520,
"acecode_id": "bigcode_python_fns_13799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_valid_primes()` that returns a list of all prime numbers between 1 and 50 such that when each prime number is subtracted by 7, the result is divisible by 4 without leaving any fraction. The function should return the list in ascending order.\nPlease r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_valid_primes() != []\", \"assert 11 in find_valid_primes()\", \"assert 19 in find_valid_primes()\", \"assert 23 in find_valid_primes()\", \"assert 31 in find_valid_primes()\", \"assert 43 in find_valid_primes()\", \"assert 47 in find_valid_primes()\", \... | {
"split": "train",
"index": 85521,
"acecode_id": "evol_32032",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `receive_message(client)` that simulates receiving a message from a WebSocket client. The function should accept a `client` object and return a string indicating the received message. If the client sends an empty message, the function should return 'No mess... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert receive_message(MockClient('Hello')) == 'Hello'\", \"assert receive_message(MockClient('')) == 'No message received!'\", \"assert receive_message(MockClient('Test message')) == 'Test message'\", \"assert receive_message(MockClient('WebSocket')) == 'WebSocket... | {
"split": "train",
"index": 85522,
"acecode_id": "evol_21188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a 2D grid filled with a specified color. The grid should be created with the given dimensions. If no dimensions are provided, the grid should default to a size of 10x10. The function should return the generated grid as a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_filled_grid('red') == [['red'] * 10 for _ in range(10)]\", \"assert create_filled_grid('blue') == [['blue'] * 10 for _ in range(10)]\", \"assert create_filled_grid('green', (2, 3)) == [['green', 'green', 'green'], ['green', 'green', 'green']]\", \"ass... | {
"split": "train",
"index": 85523,
"acecode_id": "bigcode_python_fns_14156",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the circumference of a circle given its radius. The function should raise a ValueError if the radius is negative and a TypeError if the radius is not a numeric value. The circumference should be calculated using the formula C = 2 * π * r, wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert(abs(circle_circumference(0) - 0) < 0.0001)\", \"assert(abs(circle_circumference(1) - 6.283185307179586) < 0.0001)\", \"assert(abs(circle_circumference(2) - 12.566370614359172) < 0.0001)\", \"assert(abs(circle_circumference(3.5) - 21.991148575128552) < 0.0001... | {
"split": "train",
"index": 85524,
"acecode_id": "evol_14381",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Design a function that generates a unique, unguessable secret code with the following constraints: The code should always be eight characters long and must include at least one uppercase letter, one lowercase letter, one numerical digit, and one special symbol. Additionally, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unique_code() is not None\", \"assert len(generate_unique_code()) == 8\", \"assert any(c.islower() for c in generate_unique_code())\", \"assert any(c.isupper() for c in generate_unique_code())\", \"assert any(c.isdigit() for c in generate_unique_cod... | {
"split": "train",
"index": 85525,
"acecode_id": "evol_18965",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a dictionary as an argument and recursively sums all numerical values present in it, including those in nested dictionaries. The function should only include values of numeric types (int, float, complex) and exclude any non-numeric values. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_dict_values({'a': 1.5, 'b': {'x': 2.5, 'y': 'test'}, 'c': 3}) == 7.0\", \"assert sum_dict_values({'a': {'nested': {'deep': 3}}, 'b': 4}) == 7\", \"assert sum_dict_values({'a': 10, 'b': {'x': -5, 'y': 10.5}, 'c': 'string'}) == 15.5\", \"assert sum_dict_va... | {
"split": "train",
"index": 85526,
"acecode_id": "evol_5519",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 3D coordinates, each represented as a tuple of three integers (x, y, z), write a function `extract_y_coordinates(coords)` that extracts and returns a list of all the y-coordinates from the given list. The input will be a list of tuples, and the output should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_y_coordinates([(1, 2, 3), (4, 5, 6), (7, 8, 9)]) == [2, 5, 8]\", \"assert extract_y_coordinates([(0, 0, 0), (0, 1, 0), (0, 2, 0)]) == [0, 1, 2]\", \"assert extract_y_coordinates([(10, 20, 30), (40, 50, 60)]) == [20, 50]\", \"assert extract_y_coordina... | {
"split": "train",
"index": 85527,
"acecode_id": "bigcode_python_fns_17314",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `check_products_and_gcd(list1: List[int], list2: List[int]) -> Tuple[bool, bool, Optional[int]]` that accepts two lists of integers as input. The function should first check if the product of the numbers in each list is a prime number, outputting a Boolean valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_products_and_gcd([2, 3], [5, 11]) == (False, False, None)\", \"assert check_products_and_gcd([2, 5], [7, 11]) == (False, False, None)\", \"assert check_products_and_gcd([1, 1], [1, 1]) == (False, False, None)\", \"assert check_products_and_gcd([2, 3, 5... | {
"split": "train",
"index": 85528,
"acecode_id": "evol_20319",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates interactions with various social media platforms. The function should take in a platform name and a task as input and return a string indicating the action performed. The supported platforms are 'Admin', 'Discord', and 'Twi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert social_media_integration('Admin', 'fetch_data') == 'Fetching data from Admin platform'\", \"assert social_media_integration('Admin', 'post_data') == 'Posting data to Admin platform'\", \"assert social_media_integration('Admin', 'update_profile') == 'Updating... | {
"split": "train",
"index": 85529,
"acecode_id": "oss_36637",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves the status of an array of integers. The input to the function will be a list of integers, and the function should return a list where each element indicates the status of the corresponding integer in the input list. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_integer_status([1, 0, -1]) == ['Positive', 'Zero', 'Negative']\", \"assert get_integer_status([-5, -3, -1]) == ['Negative', 'Negative', 'Negative']\", \"assert get_integer_status([0, 0, 0]) == ['Zero', 'Zero', 'Zero']\", \"assert get_integer_status([2, 3... | {
"split": "train",
"index": 85530,
"acecode_id": "bigcode_python_fns_32428",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that can contain multiple lines separated by newline characters. Your task is to implement a function `parse_multiline_string(s: str) -> List[str]` that takes this string as input and returns a list of lines. Each line in the output list should be a separ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_multiline_string('Line 1\\\\nLine 2\\\\nLine 3') == ['Line 1', 'Line 2', 'Line 3']\", \"assert parse_multiline_string(' Hello World \\\\n This is a test ') == ['Hello World', 'This is a test']\", \"assert parse_multiline_string('') == []\", \"asser... | {
"split": "train",
"index": 85531,
"acecode_id": "bigcode_python_fns_8167",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `floordiv(divisor: int) -> Callable[[int], int]` that returns a function which takes an integer `numerator` as input and returns the result of the floor division of `numerator` by the `divisor`. The returned function should perform `numerator // divisor`. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert floordiv(2)(5) == 2\", \"assert floordiv(2)(10) == 5\", \"assert floordiv(3)(10) == 3\", \"assert floordiv(1)(5) == 5\", \"assert floordiv(5)(5) == 1\", \"assert floordiv(2)(9) == 4\", \"assert floordiv(2)(-1) == -1\", \"assert floordiv(4)(17) == 4\", \"asse... | {
"split": "train",
"index": 85532,
"acecode_id": "bigcode_python_fns_24513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a given JSON string. Write a function `validate_json(json_string)` that takes a string `json_string` as input and returns a message based on the validation result: If the input string is a valid JSON, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_json('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}') == 'Valid JSON'\", \"assert validate_json('{\\\"isValid\\\": true}') == 'Valid JSON'\", \"assert validate_json('{\\\"data\\\": [1, 2, 3]}') == 'Valid JSON'\", \"assert validate_json('{\\\"name\\\... | {
"split": "train",
"index": 85533,
"acecode_id": "oss_36384",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer `filters` representing the initial number of filters and a float `w_multiplier` representing a width multiplier. Your task is to implement a function `rounding_filters(filters: int, w_multiplier: float) -> int` that calculates and rounds the number of f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rounding_filters(16, 2.0) == 32\", \"assert rounding_filters(15, 1.5) == 24\", \"assert rounding_filters(0, 5.0) == 0\", \"assert rounding_filters(20, 0) == 20\", \"assert rounding_filters(10, 0.5) == 8\", \"assert rounding_filters(50, 0.9) == 48\", \"assert... | {
"split": "train",
"index": 85534,
"acecode_id": "bigcode_python_fns_34432",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a tuple representing the current state of a Tic-Tac-Toe game, where each element in the tuple is an integer from 0 to 8. Each integer represents a position on the 3x3 Tic-Tac-Toe board, where 0 corresponds to the top-left corner and 8 corresponds to the bottom-rig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert expand_basic((0,)) == ((0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (0, 7), (0, 8))\", \"assert expand_basic((1, 2)) == ((1, 2, 0), (1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 2, 6), (1, 2, 7), (1, 2, 8))\", \"assert expand_basic((4,)) == ((4, 0), (4, 1), (4, 2)... | {
"split": "train",
"index": 85535,
"acecode_id": "bigcode_python_fns_48638",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given the root of a binary tree. Write a function `isCompleteBinaryTree(root)` that returns True if the binary tree is a complete binary tree, and False otherwise. A complete binary tree is defined as a binary tree where every level, except possibly the last, is complet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isCompleteBinaryTree(TreeNode(1, TreeNode(2), TreeNode(3))) == True\", \"assert isCompleteBinaryTree(TreeNode(1, TreeNode(2, TreeNode(4), TreeNode(5)), TreeNode(3))) == True\", \"assert isCompleteBinaryTree(TreeNode(1)) == True\", \"assert isCompleteBinaryTr... | {
"split": "train",
"index": 85536,
"acecode_id": "oss_34039",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of bid prices and a list of ask prices for a financial asset. Each list contains pairs of values where the first value is the price and the second value is the quantity of the asset available at that price. Write a function `get_order_book_summary(bids: Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_order_book_summary([(100, 10), (99, 5), (98, 15)], [(101, 20), (102, 30), (103, 25)]) == ([(100, 10), (99, 5), (98, 15)], [(101, 20), (102, 30), (103, 25)])\", \"assert get_order_book_summary([(100, 10)], [(101, 20), (102, 30)]) == ([(100, 10)], [(101, 2... | {
"split": "train",
"index": 85537,
"acecode_id": "bigcode_python_fns_43147",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a version number string by adding leading zeros to the components of the version number. The version number will be given in the format 'major.minor.patch', where 'major', 'minor', and 'patch' are integers. Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_version('1.2.3') == '01.02.03'\", \"assert format_version('10.2.3') == '10.02.03'\", \"assert format_version('1.20.3') == '01.20.03'\", \"assert format_version('1.2.30') == '01.02.30'\", \"assert format_version('1.0.0') == '01.00.00'\", \"assert forma... | {
"split": "train",
"index": 85538,
"acecode_id": "bigcode_python_fns_8271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_singleton_instance()` that returns the same instance of a singleton class each time it is called. Ensure that the class is designed such that only one instance can ever be created, regardless of how many times the function is invoked.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_singleton_instance() is get_singleton_instance()\", \"assert get_singleton_instance() is get_singleton_instance()\", \"assert get_singleton_instance() is get_singleton_instance()\", \"assert get_singleton_instance() is get_singleton_instance()\", \"asser... | {
"split": "train",
"index": 85539,
"acecode_id": "evol_16125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, implement a function that computes and returns an array containing the mean value of the nodes at each level of the tree. The means should be calculated to a precision of 10^-5. Each level is processed from left to right. You may assume that the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert averageOfLevels(TreeNode(3, TreeNode(9), TreeNode(20, TreeNode(15), TreeNode(7)))) == [3.00000, 14.50000, 11.00000]\", \"assert averageOfLevels(TreeNode(1)) == [1.00000]\", \"assert averageOfLevels(TreeNode(10, TreeNode(7), TreeNode(15))) == [10.00000, 11.00... | {
"split": "train",
"index": 85540,
"acecode_id": "evol_3176",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a mixed number represented by a whole number and a fractional part (numerator and denominator), write a function that converts this mixed number into an improper fraction. The function should return a tuple (numerator, denominator) where the numerator is greater than the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_improper(4, 4, 5) == (24, 5)\", \"assert convert_to_improper(2, 3, 4) == (11, 4)\", \"assert convert_to_improper(0, 1, 3) == (1, 3)\", \"assert convert_to_improper(1, 5, 6) == (11, 6)\", \"assert convert_to_improper(3, 2, 5) == (17, 5)\", \"assert... | {
"split": "train",
"index": 85541,
"acecode_id": "evol_27488",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a target timestamp and a list of timestamps sorted in ascending order. Write a function `find_time_position(target: datetime, timestamps: List[datetime], start_position: int = 0) -> int` that finds the position of the target timestamp in the list. If the target ti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_time_position(datetime(2023, 1, 1, 12, 0), [datetime(2022, 12, 31, 12, 0), datetime(2023, 1, 1, 12, 0), datetime(2023, 1, 2, 12, 0)], 0) == 1\", \"assert find_time_position(datetime(2023, 1, 1, 12, 30), [datetime(2022, 12, 31, 12, 0), datetime(2023, 1, ... | {
"split": "train",
"index": 85542,
"acecode_id": "bigcode_python_fns_14436",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks whether a given string is a valid IPv4 address. An IPv4 address is a 32-bit numerical address written in the form of four octets separated by periods. Each octet can range from 0 to 255 and must not contain leading zero... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_ipv4_address('192.168.1.1') == True\", \"assert is_valid_ipv4_address('0.0.0.0') == True\", \"assert is_valid_ipv4_address('255.255.255.255') == True\", \"assert is_valid_ipv4_address('172.16.254.1') == True\", \"assert is_valid_ipv4_address('256.0.... | {
"split": "train",
"index": 85543,
"acecode_id": "oss_23266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `embed_value(data_structure, value, indices)` that embeds a specified value into certain indices of a recursively nested list or dictionary structure. The function should traverse through the structure to find the specified indices and replace the value at ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert embed_value([1, 2, 3], 'embedded', [1]) == [1, 'embedded', 3]\", \"assert embed_value({'a': 1, 'b': 2}, 'embedded', ['a']) == {'a': 'embedded', 'b': 2}\", \"assert embed_value([0, [1, 2, 3]], 'embedded', [1, 0]) == [0, ['embedded', 2, 3]]\", \"assert embed_v... | {
"split": "train",
"index": 85544,
"acecode_id": "evol_10173",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a Dockerfile based on user input for the component and flavor. The function should concatenate templates for Dockerfiles based on the user's selection and return the resulting Dockerfile as a string. The function should tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_dockerfile('tensorflow', 'mkl') == 'os.dockerfilecontenttensorflow.dockerfilecontenthorovod.dockerfilecontent'\", \"assert generate_dockerfile('pytorch', 'mkl') == 'os.dockerfilecontentpytorch.dockerfilecontenthorovod.dockerfilecontent'\", \"assert ... | {
"split": "train",
"index": 85545,
"acecode_id": "oss_16721",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 3D tensor represented as a list of lists of lists (a list of matrices), implement a function `temporal_padding` that pads the middle dimension of the tensor with specified values on the left and right. The function should take three parameters: `tensor`, a 3D list repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert temporal_padding([[[1]]], (1, 1), 9) == [[[9]], [[1]], [[9]]]\", \"assert temporal_padding([[[0]]], (1, 1), 100) == [[[100]], [[0]], [[100]]]\", \"assert temporal_padding([[[1]]], (0, 0), 5) == [[[1]]]\", \"assert temporal_padding([[[7]]], (1, 1), -1) == [[[... | {
"split": "train",
"index": 85546,
"acecode_id": "bigcode_python_fns_22296",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `filter_orders(orders: List[int], min_value: int, max_value: int) -> List[int]` that returns a new list containing only the integers from the input list that are greater than or equal to `min_value` and less than or equal to `max_value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_orders([1, 2, 3, 4, 5], 1, 5) == [1, 2, 3, 4, 5]\", \"assert filter_orders([1, 2, 3, 4, 5], 2, 4) == [2, 3, 4]\", \"assert filter_orders([1, 2, 3, 4, 5], 0, 0) == []\", \"assert filter_orders([], 1, 5) == []\", \"assert filter_orders([5, 5, 5, 5], 5, ... | {
"split": "train",
"index": 85547,
"acecode_id": "bigcode_python_fns_44951",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s and a pattern p, implement a function that returns true if s matches p, where p can include '.' which matches any single character and '*' which matches zero or more of the preceding element. You need to implement the function `isMatch(s: str, p: str) -> bool:`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isMatch('aa', 'a') == False\", \"assert isMatch('aa', 'a*') == True\", \"assert isMatch('ab', '.*') == True\", \"assert isMatch('aab', 'c*a*b') == True\", \"assert isMatch('mississippi', 'mis*is*p*.') == False\", \"assert isMatch('', '.*') == True\", \"asser... | {
"split": "train",
"index": 85548,
"acecode_id": "evol_27520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `is_complete_message(data: bytes, delimiter: bytes) -> bool` that checks if a received byte message is complete based on a specified delimiter. The function should take in two parameters: `data`, which is a bytes object representing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_complete_message(b'Hello, world!', b'!') == True\", \"assert is_complete_message(b'Hello, world', b'!') == False\", \"assert is_complete_message(b'Message complete.', b'complete.') == True\", \"assert is_complete_message(b'Message incomplete', b'!') == Fa... | {
"split": "train",
"index": 85549,
"acecode_id": "oss_35174",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if an array of integers can be sorted in increasing order using specific operations. You can perform the following operations: 1) Reverse any sub-array any number of times, 2) Remove a single prime number from the array once, 3) Swap two pri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimal_sort([5, 4, 11, 7, 9]) == False\", \"assert optimal_sort([]) == True\", \"assert optimal_sort([1, 2, 3, 4, 5]) == True\", \"assert optimal_sort([1, 3, 2]) == True\", \"assert optimal_sort([4, 2, 5, 1, 3]) == False\", \"assert optimal_sort([8, 10, 2, ... | {
"split": "train",
"index": 85550,
"acecode_id": "evol_21467",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two integers x and y, write a function that calculates the difference between the square of x and the square of y. The function should return the result as an integer.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert difference_of_squares(15, 16) == -31\", \"assert difference_of_squares(5, 3) == 16\", \"assert difference_of_squares(10, 10) == 0\", \"assert difference_of_squares(1, 2) == -3\", \"assert difference_of_squares(100, 99) == 199\", \"assert difference_of_square... | {
"split": "train",
"index": 85551,
"acecode_id": "evol_9374",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that ensures the alternating appearance of string elements in a given list while maintaining the original order. The function should take a list of strings as input and return a new list that only includes the first occurrence of each string until the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ensure_alternating(['red', 'red', 'blue', 'blue', 'green']) == ['red', 'blue', 'green']\", \"assert ensure_alternating(['hello', 'hello', 'world']) == ['hello', 'world']\", \"assert ensure_alternating(['one', 'one', 'two', 'two', 'three', 'three', 'three']) ... | {
"split": "train",
"index": 85552,
"acecode_id": "evol_6651",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `describe_individual` that takes two parameters: `name` (a string) and `age` (an integer). The function should return a string in the format: \"The individual's name is {name} and they are {age} years old.\".\nPlease reason step by step, then write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert describe_individual('Alice', 30) == \\\"The individual's name is Alice and they are 30 years old.\\\"\", \"assert describe_individual('Bob', 25) == \\\"The individual's name is Bob and they are 25 years old.\\\"\", \"assert describe_individual('Charlie', 40)... | {
"split": "train",
"index": 85553,
"acecode_id": "evol_25603",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the key repeat behavior of a keyboard. Implement a function `get_key_repeat()` that returns the delay and interval for key repeats as a tuple. The function should return a fixed delay of 500 milliseconds and an interval of 30 milliseconds for repe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_key_repeat() == (500, 30)\", \"assert get_key_repeat() == (500, 30)\", \"assert get_key_repeat() == (500, 30)\", \"assert get_key_repeat() == (500, 30)\", \"assert get_key_repeat() == (500, 30)\", \"assert get_key_repeat() == (500, 30)\", \"assert get_ke... | {
"split": "train",
"index": 85554,
"acecode_id": "bigcode_python_fns_26883",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the end coordinates of a rectangular text box given its starting position and its dimensions. Write a function `calculate_text_box_end(pos: Tuple[int, int], text_box: Tuple[int, int], border: int = 0) -> Tuple[int, int]` that takes the following ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_text_box_end((0, 0), (10, 10), 0) == (10, 10)\", \"assert calculate_text_box_end((10, 10), (0, 0), 0) == (10, 10)\", \"assert calculate_text_box_end((0, 0), (100, 200), 0) == (100, 200)\", \"assert calculate_text_box_end((50, 50), (50, 50), 0) == (... | {
"split": "train",
"index": 85555,
"acecode_id": "bigcode_python_fns_41233",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a year Y and a month M, write a function that computes the total number of days and the total number of weekdays (Monday to Friday) in that month. The inputs Y and M will be within the following constraints: 1583 <= Y <= 2100 and 1 <= M <= 12. The function should return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_day_counts(1992, 7) == (31, 23)\", \"assert get_day_counts(2000, 2) == (29, 21)\", \"assert get_day_counts(1900, 2) == (28, 20)\", \"assert get_day_counts(2021, 1) == (31, 21)\", \"assert get_day_counts(2019, 2) == (28, 20)\", \"assert get_day_counts(200... | {
"split": "train",
"index": 85556,
"acecode_id": "evol_11198",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary represents an animal with the following keys: 'name', 'species', 'habitat', and 'conservation_status'. Your task is to implement a function that takes this list of animals as input and returns a tuple containing three v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_animals([{'name': 'Lion', 'species': 'Panthera leo', 'habitat': 'Grasslands', 'conservation_status': 'Vulnerable'}, {'name': 'Elephant', 'species': 'Loxodonta africana', 'habitat': 'Savanna', 'conservation_status': 'Vulnerable'}]) == (2, 2, 'Grasslan... | {
"split": "train",
"index": 85557,
"acecode_id": "oss_17441",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `cache_user_data(username: str) -> dict` that simulates caching user data in a MongoDB database using a Flask application. The function should accept a username as input and return a simulated dictionary containing the username and a message indicating that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache_user_data('alice') == {'username': 'alice', 'message': 'Data cached successfully'}\", \"assert cache_user_data('bob') == {'username': 'bob', 'message': 'Data cached successfully'}\", \"assert cache_user_data('charlie') == {'username': 'charlie', 'messa... | {
"split": "train",
"index": 85558,
"acecode_id": "evol_7591",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates navigating through a series of images represented by their filenames. The function should take a list of image filenames and a series of navigation commands (either 'next' or 'prev') and return the final image filename ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert navigate_images(['image1.jpg', 'image2.jpg', 'image3.jpg'], ['next', 'next']) == 'image3.jpg'\", \"assert navigate_images(['image1.jpg', 'image2.jpg', 'image3.jpg'], ['prev', 'prev']) == 'image1.jpg'\", \"assert navigate_images(['image1.jpg', 'image2.jpg', '... | {
"split": "train",
"index": 85559,
"acecode_id": "oss_28135",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a list of all the protocols categorized as 'risky' from a predefined set of protocols. The function should return a list of protocol names that are considered risky. The following protocols are deemed risky: 'ftp', 'telnet'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_risky_protocols() == ['ftp', 'telnet', 'http', 'smtp', 'pop3', 'imap', 'netbios', 'snmp', 'ldap', 'smb', 'sip', 'rdp', 'vnc', 'kerberos']\", \"assert len(get_risky_protocols()) == 14\", \"assert 'ftp' in get_risky_protocols()\", \"assert 'http' in get_ri... | {
"split": "train",
"index": 85560,
"acecode_id": "bigcode_python_fns_16616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary that represents different models for a species partition function, write a function `is_nonrigid_model(spc_mod_dct)` that determines if the rotational partition function for a certain species should be calculated according to a non-rigid model. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_nonrigid_model({'rot': {'mod': 'vpt2'}}) == True\", \"assert is_nonrigid_model({'rot': {'mod': 'harmonic'}}) == False\", \"assert is_nonrigid_model({'rot': {'mod': ''}}) == False\", \"assert is_nonrigid_model({'rot': {'mod': 'vpt3'}}) == False\", \"assert... | {
"split": "train",
"index": 85561,
"acecode_id": "bigcode_python_fns_40970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `process_blog_posts` that takes a list of blog post titles as input and processes each title by converting it to uppercase. The function should return a list of the processed titles. Your function should handle an empty list by ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_blog_posts(['first post', 'second post']) == ['FIRST POST', 'SECOND POST']\", \"assert process_blog_posts(['hello world', 'python is fun']) == ['HELLO WORLD', 'PYTHON IS FUN']\", \"assert process_blog_posts(['single post']) == ['SINGLE POST']\", \"as... | {
"split": "train",
"index": 85562,
"acecode_id": "oss_32218",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a URL. Your task is to implement a function that converts any occurrence of 'www' in the URL to 'm'. If the input string does not contain 'www', return the string unchanged. Write a function `transform_url(url: str) -> str` that takes the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_url('http://www.example.com') == 'http://m.example.com'\", \"assert transform_url('https://www.test.com/path') == 'https://m.test.com/path'\", \"assert transform_url('ftp://ftp.example.com') == 'ftp://ftp.example.com'\", \"assert transform_url('www... | {
"split": "train",
"index": 85563,
"acecode_id": "bigcode_python_fns_26732",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a basic server by accepting incoming connections and logging them. The function should take a list of connection requests as input, where each connection is represented by a unique identifier (a string).... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_connections(['conn1', 'conn2', 'conn1']) == ['Connection conn1 accepted', 'Connection conn2 accepted', 'Connection conn1 rejected']\", \"assert log_connections(['connA', 'connB', 'connC', 'connA']) == ['Connection connA accepted', 'Connection connB accep... | {
"split": "train",
"index": 85564,
"acecode_id": "bigcode_python_fns_28839",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a given weight in kilograms to pounds. The conversion formula is as follows: 1 kilogram is equal to 2.2 pounds. Your function should take a single parameter, which is the weight in kilograms (a float), and return the equival... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_kg_to_pounds(0) == 0.0\", \"assert convert_kg_to_pounds(1) == 2.2\", \"assert convert_kg_to_pounds(2) == 4.4\", \"assert convert_kg_to_pounds(5) == 11.0\", \"assert convert_kg_to_pounds(10) == 22.0\", \"assert convert_kg_to_pounds(15) == 33.0\", \"as... | {
"split": "train",
"index": 85565,
"acecode_id": "oss_1955",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that contains the classifications of a room and their associated probabilities. Your task is to determine the label of the room with the highest probability and return a string that contains the label and its probability as a percentage. The output st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_room({'kitchen': 0.85, 'living room': 0.15}) == 'kitchen: 85%'\", \"assert classify_room({'bedroom': 0.5, 'office': 0.5}) in ['bedroom: 50%', 'office: 50%']\", \"assert classify_room({'bathroom': 0.95, 'closet': 0.05}) == 'bathroom: 95%'\", \"assert... | {
"split": "train",
"index": 85566,
"acecode_id": "bigcode_python_fns_16891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, write a function `get_full_string(s: str) -> str` that returns the entire string when no slicing parameters are provided. The function should handle any string input and return the same string as the output. For example, if `s = 'Hello, World!'`, the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_full_string('Hello, World!') == 'Hello, World!'\", \"assert get_full_string('Python anywhere') == 'Python anywhere'\", \"assert get_full_string('') == ''\", \"assert get_full_string('LeetCode') == 'LeetCode'\", \"assert get_full_string('1234567890') == '... | {
"split": "train",
"index": 85567,
"acecode_id": "bigcode_python_fns_45250",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the management of email templates. Your function should be able to create a new email template and list all existing templates. The function should take in a list of template names and return a list of unique template names... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_email_templates(['Template1'], 5) == ['Template1']\", \"assert manage_email_templates(['Template1', 'Template2'], 5) == ['Template1', 'Template2']\", \"assert manage_email_templates(['Template1', 'Template1'], 5) == ['Template1']\", \"assert manage_em... | {
"split": "train",
"index": 85568,
"acecode_id": "oss_8449",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that modifies the names of parameters for a given force in a simulation. Each parameter name must be prefixed with a unique force name to avoid conflicts. The function should take a dictionary representing a force and its parameters, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_force_parameters({'name': 'gravity', 'parameters': ['mass', 'acceleration']}) == {'name': 'gravity', 'parameters': ['gravity_mass', 'gravity_acceleration']}\", \"assert modify_force_parameters({'name': 'friction', 'parameters': ['coefficient', 'force'... | {
"split": "train",
"index": 85569,
"acecode_id": "bigcode_python_fns_31552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with updating a logging configuration in a system. You have a function called `update_logging_config` that takes a dictionary representing new logging settings and returns a response indicating the success of the update. The function should check if the provided ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_logging_config({'level': 'INFO'}) == {'status': 'success', 'message': 'Logging configuration updated successfully'}\", \"assert update_logging_config({'level': 'DEBUG'}) == {'status': 'success', 'message': 'Logging configuration updated successfully'}... | {
"split": "train",
"index": 85570,
"acecode_id": "oss_31884",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of strings representing programming language versions and returns a dictionary containing the count of each major version. The major version is considered to be the first two digits of the version string. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_major_versions([\\\"Programming Language :: Python :: 3.6\\\", \\\"Programming Language :: Python :: 3.7\\\", \\\"Programming Language :: Python :: 3.6\\\", \\\"Programming Language :: Python :: 3.8\\\", \\\"Programming Language :: Python :: 3.7\\\", \... | {
"split": "train",
"index": 85571,
"acecode_id": "oss_15029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers `num1` and `num2`, return their greatest common divisor (GCD). The GCD of two integers is the largest positive integer that divides both numbers without leaving a remainder. Implement a function `gcd(num1: int, num2: int) -> int` that takes in two integers an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gcd(48, 18) == 6\", \"assert gcd(101, 10) == 1\", \"assert gcd(0, 5) == 5\", \"assert gcd(5, 0) == 5\", \"assert gcd(0, 0) == 0\", \"assert gcd(12, 15) == 3\", \"assert gcd(-12, 15) == 3\", \"assert gcd(12, -15) == 3\", \"assert gcd(-12, -15) == 3\", \"asser... | {
"split": "train",
"index": 85572,
"acecode_id": "bigcode_python_fns_24970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the harmonic mean of a dynamic number of positive integers. The function should accept a variable number of arguments and validate that all inputs are non-zero positive integers. If any input is zero or negative, the function should raise a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert harmonic_mean(1, 2, 3) == 1.6363636363636365\", \"assert harmonic_mean(2, 4, 8) == 3.4285714285714284\", \"assert harmonic_mean(3, 3, 3, 3) == 3.0\", \"assert harmonic_mean(1, 1, 1, 1, 1) == 1.0\", \"assert harmonic_mean(4, 4, 4, 4, 4, 4) == 4.0\", \"assert ... | {
"split": "train",
"index": 85573,
"acecode_id": "evol_20764",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a list of software maintainers represented by their names and email addresses. Your goal is to implement a function that takes a list of maintainer names and returns a list of unique email addresses associated with those maintainers. Each maintainer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_emails(['Eve', 'Mallory'], {'Eve': 'eve@example.com', 'Mallory': 'mallory@example.com', 'Charlie': 'charlie@example.com'}) == ['eve@example.com', 'mallory@example.com']\", \"assert get_unique_emails([], {'Alice': 'alice@example.com', 'Bob': 'bob@e... | {
"split": "train",
"index": 85574,
"acecode_id": "oss_925",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the connectivity of nodes in a graph. Your task is to determine if a subgraph exists that contains all the nodes defined by the connectivity list and has the same number of nodes as the length of the connectivity list. Write a funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_subgraph_exist([1, 2, 3]) == True\", \"assert is_subgraph_exist([1, 1, 2]) == True\", \"assert is_subgraph_exist([0, 2, 2, 3]) == True\", \"assert is_subgraph_exist([10, 10, 10]) == True\", \"assert is_subgraph_exist([1]) == True\", \"assert is_subgraph_e... | {
"split": "train",
"index": 85575,
"acecode_id": "bigcode_python_fns_46420",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the details of a conversation participant based on their unique ID. The function should take three parameters: `conversation_id` (a string representing the unique identifier of the conversation), `location` (a string repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_participant_details('conv123', 'New York', 'part456') == {'conversation_id': 'conv123', 'location': 'New York', 'participant_id': 'part456'}\", \"assert get_participant_details('conv789', None, 'part001') == None\", \"assert get_participant_details(None,... | {
"split": "train",
"index": 85576,
"acecode_id": "bigcode_python_fns_12525",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that reads a multi-line text input and returns the total number of words in that text. A word is defined as a sequence of characters separated by whitespace. Implement the function `count_words(text: str) -> int` where `text` is a multi-l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words('Hello world') == 2\", \"assert count_words('This is a test') == 4\", \"assert count_words('') == 0\", \"assert count_words('A quick brown fox jumps over the lazy dog') == 9\", \"assert count_words('SingleWord') == 1\", \"assert count_words('Tab\... | {
"split": "train",
"index": 85577,
"acecode_id": "bigcode_python_fns_36935",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages user information in a web application. The function should support adding, retrieving, and removing user information based on a unique username. Each user has associated attributes such as name, email, and role. Your func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_user_cache([('add', 'user1', 'Alice', 'alice@example.com', 'admin'), ('add', 'user2', 'Bob', 'bob@example.com', 'user'), ('get', 'user1')]) == {'user1': {'name': 'Alice', 'email': 'alice@example.com', 'role': 'admin'}, 'user2': {'name': 'Bob', 'email'... | {
"split": "train",
"index": 85578,
"acecode_id": "oss_33481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves input from the user. The function should simulate user input, returning a predefined string instead of actually asking for user input. Implement a function named `get_user_input()` that returns the string 'sample_input' whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_input() == 'sample_input'\", \"assert get_user_input() == 'sample_input'\", \"assert get_user_input() == 'sample_input'\", \"assert get_user_input() == 'sample_input'\", \"assert get_user_input() == 'sample_input'\", \"assert get_user_input() == 'sa... | {
"split": "train",
"index": 85579,
"acecode_id": "bigcode_python_fns_1127",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that checks if the total sum of all elements in a given list of integers falls within a specified range, and also verifies if the average of the elements exceeds a designated minimum value. The function should return True if both conditions are met, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_within_bounds_and_average([1, 2, 4, 10], 15, 25, 3) == True\", \"assert sum_within_bounds_and_average([1, 5, 10], 5, 15, 4) == False\", \"assert sum_within_bounds_and_average([5, 7, 8], 15, 30, 6) == True\", \"assert sum_within_bounds_and_average([0, 0, ... | {
"split": "train",
"index": 85580,
"acecode_id": "evol_141",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of file shares represented as dictionaries. Each file share dictionary contains the following keys: 'hostname', 'share', 'filename', 'domain', 'username', and 'password'. Your goal is to simulate the crawling of these file shares and return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert crawl_file_shares([{'hostname': 'host1', 'share': 'share1', 'filename': 'file1.txt', 'domain': None, 'username': None, 'password': None}]) == [{'path': 'file1.txt', 'size': 0}]\", \"assert crawl_file_shares([{'hostname': 'host1', 'share': 'share1', 'filename... | {
"split": "train",
"index": 85581,
"acecode_id": "bigcode_python_fns_7168",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function 'calculateWeights' that takes a tuple of entries and returns a dictionary where each valid entry (either an integer or a string) is a key, and its corresponding value (or 'weight') is calculated based on its type. The weight is determined as follows: If the e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculateWeights((3, 3, 3, 2, 2)) == {3:9, 2:6}\", \"assert calculateWeights((0, 0, 'test', 'test')) == {0:6, 'test':10}\", \"assert calculateWeights((1, 2, 3, 4, 5)) == {}\", \"assert calculateWeights(()) == {}\", \"assert calculateWeights((7, 'seven', 7, '... | {
"split": "train",
"index": 85582,
"acecode_id": "evol_20386",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves specific text content based on a resource name provided as a string. You need to implement the function `get_resource(resource_name: str) -> str`, which takes in one argument: the name of the resource. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_resource('resource1') == 'This is resource 1'\", \"assert get_resource('resource2') == 'This is resource 2'\", \"assert get_resource('resource3') == 'This is resource 3'\", \"assert get_resource('resource4') == 'Resource not found'\", \"assert get_resour... | {
"split": "train",
"index": 85583,
"acecode_id": "oss_24571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a floating-point number, implement a function that returns the number as an integer if it is mathematically equivalent to an integer (i.e., it has no fractional part). Otherwise, return the number as it is. The function should handle both positive and negative floating-po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert no_float_zeros(5.0) == 5\", \"assert no_float_zeros(-3.0) == -3\", \"assert no_float_zeros(0.0) == 0\", \"assert no_float_zeros(2.5) == 2.5\", \"assert no_float_zeros(-1.5) == -1.5\", \"assert no_float_zeros(4.1) == 4.1\", \"assert no_float_zeros(-10.0) == -... | {
"split": "train",
"index": 85584,
"acecode_id": "bigcode_python_fns_44081",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the Euclidean distance between two points in a 3D space, represented by tuples of three coordinates each. The function should take in two tuples, `coord1` and `coord2`, where each tuple contains three integers or floats representing the x, y, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert euclidean_distance_3d((1, 2, 3), (4, 5, 6)) == 5.196152422706632\", \"assert euclidean_distance_3d((0, 0, 0), (1, 1, 1)) == 1.7320508075688772\", \"assert euclidean_distance_3d((1.5, 2.5, 3.5), (4.5, 5.5, 6.5)) == 5.196152422706632\", \"assert euclidean_dist... | {
"split": "train",
"index": 85585,
"acecode_id": "evol_26129",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing an image resizing algorithm that takes the height and width of an image and resizes it to fit within specified maximum height and width while maintaining the original aspect ratio. Write a function `resize_image` that takes in the original image... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resize_image(800, 600, 1024, 1024) == (800, 600)\", \"assert resize_image(800, 600, 800, 800) == (800, 600)\", \"assert resize_image(600, 800, 800, 800) == (600, 800)\", \"assert resize_image(4000, 3000, 1000, 1000) == (1000, 750)\", \"assert resize_image(10... | {
"split": "train",
"index": 85586,
"acecode_id": "oss_10267",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_winner(board: List[List[str]]) -> str` that determines the winner of a Tic Tac Toe game. The board is represented as a 3x3 list of lists containing 'X', 'O', or ' ' (a space representing an empty cell). The function should return 'X' if player X has ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_winner([['X', 'X', 'X'], ['O', 'O', ' '], [' ', ' ', ' ']]) == 'X'\", \"assert check_winner([['O', 'O', 'O'], ['X', 'X', 'X'], [' ', ' ', ' ']]) == 'O'\", \"assert check_winner([[' ', ' ', ' '], [' ', ' ', ' '], [' ', ' ', ' ']]) == 'Pending'\", \"asse... | {
"split": "train",
"index": 85587,
"acecode_id": "evol_27505",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of zip codes, write a function `get_zip_code_prefixes(zip_codes: List[str]) -> List[Tuple[str, str, str, str]]` that returns a list of tuples. Each tuple should contain the first one, two, three, and four digits of each zip code in the same order as they appear in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_zip_code_prefixes(['12345', '67890', '54321']) == [('1', '12', '123', '1234'), ('6', '67', '678', '6789'), ('5', '54', '543', '5432')]\", \"assert get_zip_code_prefixes(['00000', '11111', '22222']) == [('0', '00', '000', '0000'), ('1', '11', '111', '1111... | {
"split": "train",
"index": 85588,
"acecode_id": "bigcode_python_fns_11311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_distinct_words(sentence: str) -> int` that takes a string `sentence` as input and returns the count of distinct words in the sentence. Words are defined as sequences of characters separated by whitespace, and the comparison should be case-insensitive... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_distinct_words('Hello world') == 2\", \"assert count_distinct_words('This is a test test') == 4\", \"assert count_distinct_words('Python is fun and fun is Python') == 4\", \"assert count_distinct_words('') == 0\", \"assert count_distinct_words('A B C A... | {
"split": "train",
"index": 85589,
"acecode_id": "evol_22801",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that converts a given time in seconds into a formatted string representing the time in hours, minutes, and seconds. The function should take an integer representing the total number of seconds and return a string in the format 'Tot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_time(3661) == 'Total time: 1 hours, 1 min and 1 seconds'\", \"assert format_time(3600) == 'Total time: 1 hours, 0 min and 0 seconds'\", \"assert format_time(59) == 'Total time: 0 hours, 0 min and 59 seconds'\", \"assert format_time(60) == 'Total time:... | {
"split": "train",
"index": 85590,
"acecode_id": "oss_32612",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a version number parser that handles the addition of a build number to a given version string. The version number is represented as a string in the format 'x.y.z', where x, y, and z are non-negative integers. The build number is an optional non-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_build_number('1.0.0', 5) == '1.0.0.5'\", \"assert add_build_number('0.1.2', 10) == '0.1.2.10'\", \"assert add_build_number('2.3.4', 0) == '2.3.4.0'\", \"assert add_build_number('3.0.0') == '3.0.0.0'\", \"assert add_build_number('10.20.30', 15) == '10.20.... | {
"split": "train",
"index": 85591,
"acecode_id": "oss_10673",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a URL as input and returns a tuple containing the protocol (scheme) and the path segments of the URL. The protocol should be extracted from the URL using the standard format, while the path should include everything after the domain. For examp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_components('http://www.example.com/users') == ('http', '/users')\", \"assert extract_components('https://www.example.com/path/to/resource') == ('https', '/path/to/resource')\", \"assert extract_components('ftp://ftp.example.com/files') == ('ftp', '/f... | {
"split": "train",
"index": 85592,
"acecode_id": "evol_15933",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a caching mechanism for a document retrieval system. The system retrieves documents based on a query and two document identifiers. Your task is to implement a single function called `cache_and_retrieve_preference(symmetric_key: str, preference: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache_and_retrieve_preference('doc1_doc2', 5) == None\", \"assert cache_and_retrieve_preference('doc2_doc1', 15) == None\", \"assert cache_and_retrieve_preference('doc3_doc4', 0) == None\", \"assert cache_and_retrieve_preference('doc4_doc3', 2) == None\", \"... | {
"split": "train",
"index": 85593,
"acecode_id": "oss_7764",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_net_compensation(total_compensation: float, fiscal_withholdings: float, assessment_percentage: float) -> float` that calculates the net monetary compensation based on the total compensation, fiscal withholdings, and applicable assessment percenta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_net_compensation(1000.0, 200.0, 10.0) == 720.0\", \"assert calculate_net_compensation(2000.0, 500.0, 5.0) == 1425.0\", \"assert calculate_net_compensation(1500.0, 300.0, 20.0) == 960.0\", \"assert calculate_net_compensation(0.0, 0.0, 0.0) == 0.0\",... | {
"split": "train",
"index": 85594,
"acecode_id": "evol_1625",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function `remove_vowels(text: str) -> str` that removes all vowels from a given text. The function should handle both uppercase and lowercase vowels and should also correctly manage punctuation, special characters, and numbers. The function should return the modified ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_vowels('Hello World!') == 'Hll Wrld!'\", \"assert remove_vowels('A quick brown fox jumps over 13 lazy dogs.') == ' qck brwn fx jmps vr 13 lzy dgs.'\", \"assert remove_vowels('Python programming 101') == 'Pythn prgrmmng 101'\", \"assert remove_vowels('... | {
"split": "train",
"index": 85595,
"acecode_id": "evol_5730",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that helps users understand how to use a cache command in a system. Write a function called `cache_help()` that returns a string describing the command usage. The function does not take any parameters and should return the following strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache_help() == 'fips cache\\\\nfips cache [config]\\\\n open the CMakeCache file with your default text editor'\", \"assert cache_help() == 'fips cache\\\\nfips cache [config]\\\\n open the CMakeCache file with your default text editor'\", \"assert cach... | {
"split": "train",
"index": 85596,
"acecode_id": "bigcode_python_fns_416",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to simulate a simple file download system. The system should accept a list of file names and a token as input. The function should check if the token is valid and return the names of the files that can be downloaded. If the token is i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_files(['file1.txt', 'file2.txt'], 'valid_token') == ['file1.txt', 'file2.txt']\", \"assert download_files(['file1.txt', 'file2.txt'], 'invalid_token') == []\", \"assert download_files(['document.pdf', 'image.png'], 'valid_token') == ['document.pdf',... | {
"split": "train",
"index": 85597,
"acecode_id": "oss_31510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_even_numbers(n)` that returns a generator expression yielding even numbers from 0 up to (but not including) a given positive integer n. The function should raise a ValueError if the input is not a positive integer.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(generate_even_numbers(10)) == [0, 2, 4, 6, 8]\", \"assert list(generate_even_numbers(5)) == [0, 2, 4]\", \"assert list(generate_even_numbers(2)) == [0]\", \"assert list(generate_even_numbers(15)) == [0, 2, 4, 6, 8, 10, 12, 14]\", \"assert list(generate_... | {
"split": "train",
"index": 85598,
"acecode_id": "evol_28322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `validate_particles` that checks whether the number of particles retrieved from a data source matches the expected number. The function should take the following parameters: 1. `num_particles_retrieved` (int): the number of particles retr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_particles(5, 5, lambda msg: msg) == True\", \"assert validate_particles(3, 5, lambda msg: msg) == False\", \"assert validate_particles(10, 10, lambda msg: msg) == True\", \"assert validate_particles(0, 0, lambda msg: msg) == True\", \"assert validat... | {
"split": "train",
"index": 85599,
"acecode_id": "oss_27902",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.