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 basic salary of 10,000 and an allowance of 4,000 for employees. Each employee may have different bonuses and deductions based on their performance and other factors. Your task is to implement a function `calculate_gross_salary(bonus: int, deduction: int) -> int`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_gross_salary(0, 0) == 14000\", \"assert calculate_gross_salary(1000, 500) == 14500\", \"assert calculate_gross_salary(4000, 4000) == 14000\", \"assert calculate_gross_salary(10000, 5000) == 19000\", \"assert calculate_gross_salary(2500, 2500) == 14... | {
"split": "train",
"index": 85100,
"acecode_id": "evol_30188",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of particle distributions represented as tuples of amplitude values for three different types of particles: Electron (E), Proton (P), and Baryon (B). Each particle distribution is represented as a tuple (amplitude_Electron, amplitude_Proton, amplitude_Baryo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_energy([(1.0, 2.0, 3.0), (4.0, 5.0, 6.0), (7.0, 8.0, 9.0)]) == 45.0\", \"assert calculate_total_energy([(10.0, 20.0, 30.0)]) == 60.0\", \"assert calculate_total_energy([(0.0, 0.0, 0.0)]) == 0.0\", \"assert calculate_total_energy([(1.0, 1.0, 1... | {
"split": "train",
"index": 85101,
"acecode_id": "bigcode_python_fns_4074",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_frequency_distribution(data: List[int]) -> Dict[int, int]` that takes a list of integers and returns a frequency distribution table as a dictionary, where the keys are the unique integers from the list and the values are their corresponding counts. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_frequency_distribution([1, 1, 1, 2, 2, 3, 3, 3]) == {1: 3, 2: 2, 3: 3}\", \"assert create_frequency_distribution([]) == {}\", \"assert create_frequency_distribution([5, 5, 5]) == {5: 3}\", \"assert create_frequency_distribution([0]) == {0: 1}\", \"ass... | {
"split": "train",
"index": 85102,
"acecode_id": "evol_20417",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two positive integers, `a` and `b`, implement a function that calculates the unsigned absolute difference between the two numbers. The unsigned absolute difference is defined as the absolute value of the difference between `a` and `b`, which can be expressed mathematicall... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unsigned_absolute_difference(5, 3) == 2\", \"assert unsigned_absolute_difference(3, 5) == 2\", \"assert unsigned_absolute_difference(10, 10) == 0\", \"assert unsigned_absolute_difference(0, 0) == 0\", \"assert unsigned_absolute_difference(1, 0) == 1\", \"ass... | {
"split": "train",
"index": 85103,
"acecode_id": "bigcode_python_fns_14497",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tuple `shape` which represents the dimensions of a tensor, implement a function `zeros(shape)` that returns a list filled with zeros, with the length of the list being the product of all the dimensions in `shape`. For example, if `shape` is (2, 3), the function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert zeros((0,)) == []\", \"assert zeros((2, 3)) == [0, 0, 0, 0, 0, 0]\", \"assert zeros((4,)) == [0, 0, 0, 0]\", \"assert zeros((1, 1, 1)) == [0]\", \"assert zeros((3, 2)) == [0, 0, 0, 0, 0, 0]\", \"assert zeros((1, 2, 3)) == [0, 0, 0, 0, 0, 0]\", \"assert zeros... | {
"split": "train",
"index": 85104,
"acecode_id": "bigcode_python_fns_29217",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that determines if the list is an arithmetic progression. An arithmetic progression is a sequence of numbers such that the difference between consecutive elements is constant. The function should return True if the list is an arith... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_arithmetic_progression([1, 3, 5, 7, 9]) == True\", \"assert is_arithmetic_progression([10, 20, 30, 40]) == True\", \"assert is_arithmetic_progression([2, 4]) == True\", \"assert is_arithmetic_progression([2, 5, 8, 11]) == True\", \"assert is_arithmetic_pr... | {
"split": "train",
"index": 85105,
"acecode_id": "evol_9494",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with constructing a simple 3D model using various shapes. You have three types of pieces available: corner pieces, top pieces, and side pieces. You will be provided with a list of figures that specify the type of piece to be assembled. Your goal is to assemble th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assemble_model(['C1', 'C2'], ['T1', 'T2'], ['S1'], [{'type': 'corner'}, {'type': 'top'}, {'type': 'side'}]) == ['C1', 'T1', 'S1']\", \"assert assemble_model(['C1', 'C2'], [], [], [{'type': 'corner'}, {'type': 'top'}, {'type': 'side'}]) == ['C1']\", \"assert ... | {
"split": "train",
"index": 85106,
"acecode_id": "oss_525",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `create_software_engineer` that takes in three parameters: `qualifications`, `experience`, and `programming_skills`. This function should return a dictionary representing a software engineer with the given attributes. The dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_software_engineer('BSc in Computer Science', 5, ['Python', 'Java', 'C++']) == {'qualifications': 'BSc in Computer Science', 'experience': 5, 'programming_skills': ['Python', 'Java', 'C++']}\", \"assert create_software_engineer('MSc in Software Enginee... | {
"split": "train",
"index": 85107,
"acecode_id": "evol_3310",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of coordinates representing the vertices of a polygon and returns the area of that polygon. The coordinates are given in the format of a list of tuples, where each tuple contains the x and y coordinates of a vertex. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert polygon_area([(0, 0), (4, 0), (4, 3), (0, 3)]) == 12.0\", \"assert polygon_area([(1, 1), (1, 4), (4, 4), (4, 1)]) == 9.0\", \"assert polygon_area([(0, 0), (1, 1), (2, 0)]) == 1.0\", \"assert polygon_area([(0, 0), (5, 0), (5, 5), (0, 5)]) == 25.0\", \"assert ... | {
"split": "train",
"index": 85108,
"acecode_id": "bigcode_python_fns_22264",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of equal length, `y_true` and `y_pred`, which represent the true values and predicted values respectively. Your task is to implement a function `total_error_avgAx0(y_true: List[float], y_pred: List[float]) -> float` that calculates the total squared erro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_error_avgAx0([1.0, 2.0, 3.0], [1.5, 2.5, 3.5]) == 2.0\", \"assert total_error_avgAx0([4.0, 5.0, 6.0], [4.5, 5.5, 6.5]) == 2.0\", \"assert total_error_avgAx0([10.0, 10.0, 10.0], [9.0, 11.0, 10.0]) == 0.0\", \"assert total_error_avgAx0([1.0, 1.0, 1.0], [... | {
"split": "train",
"index": 85109,
"acecode_id": "bigcode_python_fns_47099",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list containing mixed data types, specifically integers and strings. Your task is to implement a function that sorts only the strings in the list alphabetically while keeping the integers in their original order. The function should return a new list with the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_strings([12, 'apple', 'dog', 100, 'cat', 'banana']) == [12, 'apple', 'banana', 100, 'cat', 'dog']\", \"assert sort_strings([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert sort_strings([8, 3, 'grape', 'apple']) == [8, 3, 'apple', 'grape']\", \"assert sort_stri... | {
"split": "train",
"index": 85110,
"acecode_id": "evol_22811",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `filter_data` that processes a list of dictionaries. Each dictionary represents a signal with the following fields: 'freqStart', 'freqStop', and 'description'. Your function should return a new list of dictionaries that includes only ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_data([{'freqStart': 1000, 'freqStop': 2100, 'description': 'Sample signal'}]) == [{'freqStart': 1000, 'freqStop': 2100, 'description': 'Sample signal'}]\", \"assert filter_data([{'freqStart': 500, 'freqStop': 1500, 'description': 'Another signal'}]) =... | {
"split": "train",
"index": 85111,
"acecode_id": "oss_2511",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function to approximate the root of the equation x^2 - 2x - 3 using the bisection method. The function should take two parameters, a and b, which represent the interval in which the root is to be found. Ensure that the function handles cases where the prov... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(bisection(-2, 0) - (-1)) < 0.01\", \"assert abs(bisection(1, 5) - 3) < 0.01\", \"assert abs(bisection(2.5, 3.5) - 3) < 0.01\", \"assert abs(bisection(-1.5, 0.5) - (-1)) < 0.01\", \"assert abs(bisection(-3, 0) - (-1)) < 0.01\", \"assert abs(bisection(2, 4... | {
"split": "train",
"index": 85112,
"acecode_id": "evol_10783",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple function to parse a mathematical expression represented as a string. Your function should take a string containing a mathematical expression involving addition and subtraction of integers and return the result of the expression. The exp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('3 + 5 - 2') == 6\", \"assert evaluate_expression('10 - 4 + 2') == 8\", \"assert evaluate_expression(' 1 + 1 ') == 2\", \"assert evaluate_expression(' 2 - 1 + 3 - 4 ') == 0\", \"assert evaluate_expression('0 + 0') == 0\", \"assert eva... | {
"split": "train",
"index": 85113,
"acecode_id": "oss_30658",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of sorted characters `letters` containing only uppercase letters, and a target letter `target`, implement a function that finds the largest element in the list that is smaller than the given target. The letters wrap around, meaning if the target is 'A' and the list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_letter(['C', 'F', 'J'], 'D') == 'C'\", \"assert search_letter(['C', 'F', 'J'], 'F') == 'C'\", \"assert search_letter(['C', 'F', 'J'], 'G') == 'F'\", \"assert search_letter(['C', 'F', 'J'], 'K') == 'J'\", \"assert search_letter(['C', 'F', 'J'], 'C') ==... | {
"split": "train",
"index": 85114,
"acecode_id": "evol_8055",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a basic JIT (Just-In-Time) compilation process for a given function. Your function should take three parameters: a function `func`, a list of `link` (which should always be empty), and a boolean `debug`. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jitdevice(lambda x: x, []) == 'Compiled with debug mode: False'\", \"assert jitdevice(lambda x: x, [], True) == 'Compiled with debug mode: True'\", \"assert jitdevice(lambda x: x, [], False) == 'Compiled with debug mode: False'\", \"assert jitdevice(lambda x... | {
"split": "train",
"index": 85115,
"acecode_id": "bigcode_python_fns_26250",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a traffic light system that can be in one of three states: 'red', 'yellow', or 'green'. Your goal is to implement a function `traffic_light_controller(events: List[str], initial_state: str) -> str` that takes in a list of events and an initial sta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert traffic_light_controller(['change', 'change', 'change'], 'red') == 'red'\", \"assert traffic_light_controller(['change'], 'red') == 'green'\", \"assert traffic_light_controller(['change', 'invalid'], 'green') == 'yellow'\", \"assert traffic_light_controller(... | {
"split": "train",
"index": 85116,
"acecode_id": "oss_29790",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries where each dictionary represents a city with its name and population, write a function that sorts the cities based on their population. The function should take two parameters: the list of cities and a boolean `ascending`. If `ascending` is `True`, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_data([{'City': 'A', 'Population': 5000}, {'City': 'B', 'Population': 10000}], True) == [{'City': 'A', 'Population': 5000}, {'City': 'B', 'Population': 10000}]\", \"assert sort_data([{'City': 'C', 'Population': 2000}, {'City': 'D', 'Population': 1500}], ... | {
"split": "train",
"index": 85117,
"acecode_id": "evol_17183",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the sum of the digits of a non-negative integer. The function should take the following parameters: an integer n, an optional integer power (default is 1), an optional integer modulo (default is None), and an optional integer multiplier (default... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_digits(123) == 6\", \"assert sum_of_digits(123, 2) == 14\", \"assert sum_of_digits(123, 2, 7) == 0\", \"assert sum_of_digits(123, 2, 7, 3) == 0\", \"assert sum_of_digits(0) == 0\", \"assert sum_of_digits(0, 2) == 0\", \"assert sum_of_digits(0, 2, 3) =... | {
"split": "train",
"index": 85118,
"acecode_id": "evol_1723",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_string()` that returns a string consisting of exactly eight characters, where each character is randomly selected from the combination of uppercase letters, lowercase letters, and digits (0-9). The output string should not contain any spaces or specia... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_string()) == 8\", \"assert all(c.isalnum() for c in generate_string())\", \"assert any(c.isupper() for c in generate_string())\", \"assert any(c.islower() for c in generate_string())\", \"assert generate_string() != generate_string()\", \"assert... | {
"split": "train",
"index": 85119,
"acecode_id": "evol_784",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `usage_help` that describes the usage of a command-line option, and a value `default` which can be of type string, integer, float, or boolean. Your task is to create a function `add_default_to_usage_help` that appends the default value to the usage help s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_default_to_usage_help('This is a help message.', 'example') == 'This is a help message. default=example'\", \"assert add_default_to_usage_help('This is a help message.', 42) == 'This is a help message. default=42'\", \"assert add_default_to_usage_help('T... | {
"split": "train",
"index": 85120,
"acecode_id": "bigcode_python_fns_27544",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple card game. The game involves drawing cards from a standard 52-card deck and comparing the drawn cards to determine the winner. The function should take two arguments: `player1` and `player2`, each representi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_cards(['2 H'], ['3 D']) == 'Player 2 wins!'\", \"assert compare_cards(['A S'], ['K H']) == 'Player 1 wins!'\", \"assert compare_cards(['J H'], ['J S']) == 'Player 2 wins!'\", \"assert compare_cards(['Q C'], ['Q H']) == 'Player 1 wins!'\", \"assert co... | {
"split": "train",
"index": 85121,
"acecode_id": "oss_6139",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given an integer array 'blocks' representing the number of blocks in a cache device. The array is initially filled with non-negative integers. When a core device fails, all blocks previously occupied by that core should be available again in the cache. Implement a funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert available_blocks_after_failure([2, 3, 5, 0], 1) == [2, 0, 5, 0]\", \"assert available_blocks_after_failure([1, 2, 3], 0) == [0, 2, 3]\", \"assert available_blocks_after_failure([0, 0, 0], 2) == [0, 0, 0]\", \"assert available_blocks_after_failure([2, 4, 6, 8... | {
"split": "train",
"index": 85122,
"acecode_id": "bigcode_python_fns_32843",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with verifying the correctness of a server's response based on two input strings, `s1` and `s2`, and an encrypted response from the server. Each input string contains key-value pairs separated by a specific separator. Your goal is to determine if the server's res... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_server_response('ID:999|Name:Z', 'ID:888|Name:Y', 'Name:ZName:Y') == False\", \"assert verify_server_response('ID:10|Name:Kappa', 'ID:11|Name:Lambda', 'Name:KappaName:Lambda') == False\", \"assert verify_server_response('ID:50|Name:Mu', 'ID:51|Name:Nu... | {
"split": "train",
"index": 85123,
"acecode_id": "oss_13250",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified task management system. You need to define a function `manage_task(status: str) -> bool` that takes a string representing the status of a task, which can be either 'completed', 'missed', or 'pending'. The function should return a bo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_task('completed') == False\", \"assert manage_task('missed') == True\", \"assert manage_task('pending') == False\", \"assert manage_task('completed') == False\", \"assert manage_task('missed') == True\", \"assert manage_task('pending') == False\", \"a... | {
"split": "train",
"index": 85124,
"acecode_id": "oss_28015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of letters and an integer p0, implement a function that counts the number of triplets (3-letter segments) starting from position p0 until the first occurrence of either 'aaa', 'bbb', or 'ccc'. If none of these patterns are found after p0, return -1. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_triplet('abcabcabc', 'aaa|bbb|ccc', 2) == -1\", \"assert find_triplet('aaabbbccc', 'aaa|bbb|ccc', 0) == 0\", \"assert find_triplet('xyzxyzxyz', 'aaa|bbb|ccc', 0) == -1\", \"assert find_triplet('abcdefg', 'aaa|bbb|ccc', 1) == -1\", \"assert find_triplet(... | {
"split": "train",
"index": 85125,
"acecode_id": "evol_13227",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_maximum` that returns the maximum integer from the list. If the list is empty, the function should return None. The input list can contain both positive and negative integers. Your task is to implement the function `find_maximum(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3, 4, 5]) == 5\", \"assert find_maximum([-1, -2, -3, -4, -5]) == -1\", \"assert find_maximum([5, 5, 5, 5]) == 5\", \"assert find_maximum([0, 0, 0]) == 0\", \"assert find_maximum([100, 200, 300]) == 300\", \"assert find_maximum([-10, 0, 10... | {
"split": "train",
"index": 85126,
"acecode_id": "bigcode_python_fns_1222",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates an event handling system. The function should allow for the registration of event handlers for specific event types and provide a mechanism to trigger those handlers when the corresponding events occur. Implement a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_events([('post_save', menu_change_handler)], 'post_save', (1, 2), {'key': 'value'}) == None\", \"assert handle_events([('click', menu_change_handler)], 'click', (3,), {'user': 'admin'}) == None\", \"assert handle_events([], 'post_save', (1,), {}) == N... | {
"split": "train",
"index": 85127,
"acecode_id": "oss_10292",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates and returns the Fibonacci sequence up to the n-th number. The function should handle and validate the input, ensuring that it processes only non-negative integers. Additionally, if the input is provided as a string with non-digit characters, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 85128,
"acecode_id": "evol_22140",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D array of numbers, write a function that calculates the sum of all elements in the array and identifies the row with the highest sum. The function should handle cases where the rows may have different lengths. Do not use any built-in functions for summing arrays and d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert row_with_highest_sum([[1], [2], [3], [4], [5]]) == (5, 4)\", \"assert row_with_highest_sum([[0, 0], [0, 0, 0], [1, 1]]) == (2, 2)\", \"assert row_with_highest_sum([[10], [20, 30], [40, 50, 60]]) == (150, 2)\", \"assert row_with_highest_sum([[5, 5, 5], [5, 5]... | {
"split": "train",
"index": 85129,
"acecode_id": "evol_32139",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that reads a string input representing either a YAML or JSON document and returns a dictionary containing the document's contents. If the input string ends with '.yaml', the document should be interpreted as YAML; otherwise, it should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_document('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert read_document('{\\\"a\\\": 1, \\\"b\\\": 2}') == {'a': 1, 'b': 2}\", \"assert read_document('{\\\"foo\\\": [1, 2, 3]}') == {'foo': [1, 2, 3]}\", \"assert read_document('{\\\"nested... | {
"split": "train",
"index": 85130,
"acecode_id": "bigcode_python_fns_39824",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `a` and `b`, and your task is to compute the element-wise sum of these two lists and return the resulting list `c`. The lists `a` and `b` will have the same length `n`. Write a function `elementwise_sum(a: List[int], b: List[int]) -> List[in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert elementwise_sum([1, 2, 3], [4, 5, 6]) == [5, 7, 9]\", \"assert elementwise_sum([-1, -2, -3], [4, 5, 6]) == [3, 3, 3]\", \"assert elementwise_sum([0, 0, 0], [0, 0, 0]) == [0, 0, 0]\", \"assert elementwise_sum([1], [1]) == [2]\", \"assert elementwise_sum([10, ... | {
"split": "train",
"index": 85131,
"acecode_id": "oss_6273",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the deletion of compute nodes in a cloud computing environment. The function should take the following parameters: a dictionary representing the configuration of the environment, a boolean indicating whether to delete all n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_nodes({}, False, False, False, []) is None\", \"assert delete_nodes({}, True, False, False, []) is None\", \"assert delete_nodes({}, False, True, False, []) is None\", \"assert delete_nodes({}, False, False, True, []) is None\", \"assert delete_nodes(... | {
"split": "train",
"index": 85132,
"acecode_id": "bigcode_python_fns_17785",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are asked to implement a Python function that identifies the viewset class with the maximum number of subclasses from a given list of viewsets. A viewset is defined as a class that serves as a base for other classes. Each viewset can have zero or more subclasses. Your funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_most_child_viewset([ViewsetA, ViewsetB, ViewsetC, ViewsetD]) == 'ViewsetA'\", \"assert find_most_child_viewset([ViewsetX, ViewsetY, ViewsetZ]) == 'ViewsetX'\", \"assert find_most_child_viewset([ViewsetA, ViewsetB]) == 'ViewsetA'\", \"assert find_most_ch... | {
"split": "train",
"index": 85133,
"acecode_id": "oss_2843",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the root mean square (RMS) of a list of numbers. The RMS is defined as the square root of the average of the squares of the numbers in the list. The function should take a list of floats or integers and return the RMS as a float.\nPlease reason ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert root_mean_square([0, 0, 0]) == 0.0\", \"assert root_mean_square([1, 2, 3, 4]) == 2.7386127875258306\", \"assert root_mean_square([-1, -2, -3, -4]) == 2.7386127875258306\", \"assert root_mean_square([-1, 0, 1]) == 0.816496580927726\", \"assert root_mean_squar... | {
"split": "train",
"index": 85134,
"acecode_id": "evol_14269",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given an integer array `nums` and a positive integer `k`, determine if it is possible to partition the array into `k` non-empty subsets such that each subset has the same sum. Return `True` if such a partition is possible, otherwise return `False`. Note that the number of eleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert canPartitionKSubsets([4, 3, 2, 3, 5, 2, 1], 4) == True\", \"assert canPartitionKSubsets([1, 1, 1, 1], 2) == True\", \"assert canPartitionKSubsets([1, 2, 3, 4, 5, 6], 3) == True\", \"assert canPartitionKSubsets([1, 2, 3, 4], 3) == False\", \"assert canPartiti... | {
"split": "train",
"index": 85135,
"acecode_id": "evol_35736",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an integer array, implement a function that alters the minimum number of elements to convert the array into a palindrome. However, the function should also limit the number of unique alterations to a given maximum. If the number of unique alterations exceeds this limit, r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimum_changes([1, 2, 3, 4, 3, 2, 2], 2) == 1\", \"assert minimum_changes([1, 2, 3, 2, 1], 1) == 0\", \"assert minimum_changes([1,1,1,1,1], 5) == 0\", \"assert minimum_changes([1,2,3,4,5,6,7,8,9], 4) == 4\", \"assert minimum_changes([1,2,2,1], 1) == 0\", \"... | {
"split": "train",
"index": 85136,
"acecode_id": "evol_1146",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of VLAN configurations for multiple switches in a network. Each configuration consists of a switch identifier, a VLAN number, and a list of ports associated with that VLAN on the switch. Your task is to implement a function that aggregates VLANs by switch a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_vlans([('switch1', 10, [1, 2]), ('switch1', 20, [2, 3]), ('switch2', 10, [1])]) == {'switch1': {'1': [10], '2': [10, 20], '3': [20]}, 'switch2': {'1': [10]}}\", \"assert aggregate_vlans([('switchA', 30, [4, 5]), ('switchA', 40, [5]), ('switchB', 30... | {
"split": "train",
"index": 85137,
"acecode_id": "bigcode_python_fns_26527",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the movement of a drone. The drone can respond to specific commands from the user. Your function will take a string input representing a command to move the drone. If the input command is 'q', the function should return 'do... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert drone_command('q') == ('down', 30)\", \"assert drone_command('up') == ('invalid command', 0)\", \"assert drone_command('left') == ('invalid command', 0)\", \"assert drone_command('right') == ('invalid command', 0)\", \"assert drone_command('') == ('invalid c... | {
"split": "train",
"index": 85138,
"acecode_id": "oss_18151",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an undirected graph represented as an adjacency list, implement a function that finds the length of the shortest cycle in the graph. If no cycle exists, return -1. The graph is represented as a list of lists, where each index corresponds to a vertex and contains a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_cycle([[1,2],[0,2],[0,1]]) == 3\", \"assert shortest_cycle([[1],[0]]) == -1\", \"assert shortest_cycle([[1,3],[0,2,3],[1],[0,1]]) == 3\", \"assert shortest_cycle([[1,2,3],[0,2],[0,1,3],[0,1]]) == 3\", \"assert shortest_cycle([[1,2],[0,2],[0,1]]) == ... | {
"split": "train",
"index": 85139,
"acecode_id": "evol_34535",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing API responses. Each dictionary contains the keys: 'name' (string), 'status' (integer), 'return' (integer), 'resp_time' (integer), and 'payload' (dictionary). Your task is to implement the function `process_api_responses(api_resp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_api_responses([{'name': 'Test 1', 'status': 400, 'return': 100, 'resp_time': 30, 'payload': {}}]) == 100\", \"assert process_api_responses([{'name': 'Test 2', 'status': 400, 'return': 200, 'resp_time': 50, 'payload': {}}]) == 200\", \"assert process_... | {
"split": "train",
"index": 85140,
"acecode_id": "oss_31622",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of media requests represented as URLs. Implement a function `process_requests(requests: List[str], info: str) -> List[str]` that takes in a list of media request URLs and additional info. Your function should process each request URL by app... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_requests(['http://example.com/media1', 'http://example.com/media2'], 'info1') == ['Processed http://example.com/media1 with info1', 'Processed http://example.com/media2 with info1']\", \"assert process_requests(['http://example.com/media3'], 'info2')... | {
"split": "train",
"index": 85141,
"acecode_id": "oss_9689",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that parses a JSON object representing a media manifest and extracts specific attributes from it. Your function should take a dictionary (representing the JSON object) as input and return a dictionary with the following attributes extract... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_manifest({'id': '123', 'manifestName': 'MyManifest', 'name': 'Sample Manifest', 'description': 'This is a sample.', 'customData': {'key': 'value'}, 'outputs': []}) == {'id': '123', 'manifestName': 'MyManifest', 'name': 'Sample Manifest', 'description':... | {
"split": "train",
"index": 85142,
"acecode_id": "oss_4635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an associative array (dictionary) that maps elements to their respective counts, implement a function `find_overrepresented_element` that identifies the element(s) with the highest count and returns a list of those elements along with their count. If there are multiple el... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_overrepresented_element({'A':1, 'B':1, 'C':3, 'D':3, 'E':3}) == (['C', 'D', 'E'], 3)\", \"assert find_overrepresented_element({'X':5, 'Y':5, 'Z':2}) == (['X', 'Y'], 5)\", \"assert find_overrepresented_element({'A':0, 'B':0, 'C':0}) == (['A', 'B', 'C'], ... | {
"split": "train",
"index": 85143,
"acecode_id": "evol_24126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a simple interactive debugger activation system. This function, `activate_debugger`, takes a boolean parameter `is_debug_enabled`. If `is_debug_enabled` is True, the function should return the string 'Debugg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert activate_debugger(True) == 'Debugger Activated'\", \"assert activate_debugger(False) == 'Debugger Not Activated'\", \"assert activate_debugger(True) == 'Debugger Activated'\", \"assert activate_debugger(False) == 'Debugger Not Activated'\", \"assert activate... | {
"split": "train",
"index": 85144,
"acecode_id": "bigcode_python_fns_43925",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to read a temperature value from a byte array, which represents a 16-bit unsigned integer for temperature followed by an 8-bit checksum. Your goal is to extract the temperature value and verify its integrity using a checksum. The chec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_temperature(bytearray([0xFF, 0xFF, 0xFE])) == None\", \"assert read_temperature(bytearray([0x05, 0x05, 0x0A])) == None\", \"assert read_temperature(bytearray([0x02, 0x03, 0x05])) == None\", \"assert read_temperature(bytearray([0x12, 0x34, 0x46])) == Non... | {
"split": "train",
"index": 85145,
"acecode_id": "oss_5402",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the nuclear charges of different elements, write a function that calculates the sum of these nuclear charges. The function should return the total sum of the nuclear charges in the list. Your function should be called `sum_nuclear_charges(Z... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_nuclear_charges([1, 2, 3]) == 6\", \"assert sum_nuclear_charges([10, 20, 30]) == 60\", \"assert sum_nuclear_charges([1]) == 1\", \"assert sum_nuclear_charges([4, 5, 6]) == 15\", \"assert sum_nuclear_charges([7, 14]) == 21\", \"assert sum_nuclear_charges(... | {
"split": "train",
"index": 85146,
"acecode_id": "bigcode_python_fns_22316",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two classes, `PythonRunCommandDetectorMixin` and `PythonBuildPack`, your task is to implement a new class called `ModifiedPythonBuildPack` that inherits from both of these classes. The `ModifiedPythonBuildPack` class should combine the functionalities of both parent class... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(ModifiedPythonBuildPack, type) == True\", \"assert 'PythonRunCommandDetectorMixin' in ModifiedPythonBuildPack.__bases__[0].__name__\", \"assert 'PythonBuildPack' in ModifiedPythonBuildPack.__bases__[1].__name__\", \"assert hasattr(ModifiedPythonBu... | {
"split": "train",
"index": 85147,
"acecode_id": "oss_33748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_smallest_even(numbers)` that identifies the smallest even number in the list. If there are no even numbers, the function should return None. The function should only take one parameter: a list of integers.\nPlease reason step by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_smallest_even([45, 22, 11, 90, 33]) == 22\", \"assert find_smallest_even([1, 3, 5, 7]) == None\", \"assert find_smallest_even([2, 4, 6, 8]) == 2\", \"assert find_smallest_even([-4, -2, 0, 3]) == -4\", \"assert find_smallest_even([10, 15, 20, 25]) == 10\... | {
"split": "train",
"index": 85148,
"acecode_id": "evol_27651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string as input and returns the number of words in that string. A word is defined as a sequence of characters separated by whitespace. Your function should ignore any leading or trailing whitespace. Additionally, if the input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words('Hello world') == 2\", \"assert count_words('') == 0\", \"assert count_words('One') == 1\", \"assert count_words('Two words here') == 3\", \"assert count_words(' ') == 0\", \"assert count_words('Multiple spaces') == 2\", \"assert count_words... | {
"split": "train",
"index": 85149,
"acecode_id": "oss_19193",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, each representing a Z-Wave node's status with various attributes. Your task is to implement a function `get_node_status(node_id: int, nodes: List[Dict]) -> Dict` that retrieves the status for a specific Z-Wave node identified by `node_id`. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_node_status(1, [{'node_query_stage': 1, 'node_id': 1, 'is_zwave_plus': True, 'is_awake': True, 'is_failed': False, 'node_baud_rate': 9600, 'is_beaming': True, 'is_flirs': False, 'is_routing': True, 'is_securityv1': True, 'node_basic_string': 'Basic', 'no... | {
"split": "train",
"index": 85150,
"acecode_id": "bigcode_python_fns_15727",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of gene names. Your task is to write a function that returns a dictionary where each gene name is mapped to its corresponding description. If a gene has multiple possible descriptions, choose the first one. If a gene has no description available, it should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_gene_descriptions(['BRCA1']) == {'BRCA1': 'Breast cancer 1'}\", \"assert retrieve_gene_descriptions(['TP53']) == {'TP53': 'Tumor protein p53'}\", \"assert retrieve_gene_descriptions(['EGFR']) == {'EGFR': 'Epidermal growth factor receptor'}\", \"asse... | {
"split": "train",
"index": 85151,
"acecode_id": "bigcode_python_fns_31994",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a distance R from the center of a protoplanetary disk, an inner radius Rin, an initial dust surface density Sig0, and a power law exponent p, implement a function that calculates the dust surface density (Sigma d) at the distance R using the formula: Sigma d = Sig0 * (R /... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dust_surface_density(20.0, 10.0, 5.0, 1.0) == 2.5\", \"assert dust_surface_density(5.0, 5.0, 3.0, 0.0) == 3.0\", \"assert dust_surface_density(1.0, 1.0, 1.0, 1.0) == 1.0\", \"assert dust_surface_density(12.0, 6.0, 7.0, 2.0) == 1.75\", \"assert dust_surface_d... | {
"split": "train",
"index": 85152,
"acecode_id": "bigcode_python_fns_46524",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `stable_normalize(arr: List[int], etha: float = 1e-8) -> List[float]` that normalizes the list to have a magnitude of 1. If the magnitude of the list is less than `etha`, use `etha` as the normalization factor instead. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stable_normalize([3, 4]) == [0.6, 0.8]\", \"assert stable_normalize([1, 1]) == [0.7071067811865475, 0.7071067811865475]\", \"assert stable_normalize([0, 5, 0]) == [0.0, 1.0, 0.0]\", \"assert stable_normalize([-3, -4]) == [-0.6, -0.8]\", \"assert stable_norma... | {
"split": "train",
"index": 85153,
"acecode_id": "bigcode_python_fns_39382",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `link_title_to_selection(current_file: str, title: str, selection: str) -> str` that returns a new title for a window based on the current file and the selected text. The new title should follow the format: 'File: <current_file> | Selection: <selection>'. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert link_title_to_selection('document.txt', 'My Window', 'Hello World') == 'File: document.txt | Selection: Hello World'\", \"assert link_title_to_selection('document.txt', 'My Window', '') == 'File: document.txt'\", \"assert link_title_to_selection('', 'My Wind... | {
"split": "train",
"index": 85154,
"acecode_id": "bigcode_python_fns_3461",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that renames notes in a notetrack. The function should take in a list of current notes, an index of the note to rename, and a new name for the note. The new name should only contain alphanumeric characters and underscores, and if it conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rename_note(['note1', 'note2', 'note3'], 1, 'new_note') == ['note1', 'new_note', 'note3']\", \"assert rename_note(['note1', 'note2', 'note3'], 0, 'updated_note') == ['updated_note', 'note2', 'note3']\", \"assert rename_note(['note1', 'note2', 'note3'], 2, 's... | {
"split": "train",
"index": 85155,
"acecode_id": "bigcode_python_fns_7076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of strings and a target substring. The function should return a list of indices representing the positions of all occurrences of the target substring within the strings of the list. If the target substring does not e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_substring_indices(['Hello world', 'hello there', 'hi'], 'hello') == [0, 1]\", \"assert find_substring_indices(['abc', 'def', 'ghi'], 'xyz') == []\", \"assert find_substring_indices(['Python is fun', 'I love Python', 'Python programming'], 'python') == [... | {
"split": "train",
"index": 85156,
"acecode_id": "bigcode_python_fns_1933",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Your task is to write a function `count_age_groups(ages: List[int]) -> Dict[str, int]` that counts how many people fall into each of the following age groups: '0-12', '13-19', '20-35', '36-64', and '65... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_age_groups([1, 2, 3, 4, 5]) == {'0-12': 5, '13-19': 0, '20-35': 0, '36-64': 0, '65+': 0}\", \"assert count_age_groups([13, 14, 15, 16]) == {'0-12': 0, '13-19': 4, '20-35': 0, '36-64': 0, '65+': 0}\", \"assert count_age_groups([20, 25, 30, 31, 32, 34]) ... | {
"split": "train",
"index": 85157,
"acecode_id": "bigcode_python_fns_15291",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an integer n as input and returns a list of length n, where each element is initialized to the value 0. The function should handle cases where n is 0 gracefully by returning an empty list.\nPlease reason step by step, then write a self-contained ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_zero_array(0) == []\", \"assert generate_zero_array(1) == [0]\", \"assert generate_zero_array(2) == [0, 0]\", \"assert generate_zero_array(3) == [0, 0, 0]\", \"assert generate_zero_array(4) == [0, 0, 0, 0]\", \"assert generate_zero_array(5) == [0, 0... | {
"split": "train",
"index": 85158,
"acecode_id": "evol_12066",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a string representing the name of an experiment and returns the full path to the latest model file for that experiment. The path should follow the format: 'logs/{experiment_name}/latest.pth'. Your function should ensure that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_latest_model_path('experiment1') == 'logs/experiment1/latest.pth'\", \"assert get_latest_model_path('test_experiment') == 'logs/test_experiment/latest.pth'\", \"assert get_latest_model_path('experiment_with_special_#chars') == 'logs/experiment_with_speci... | {
"split": "train",
"index": 85159,
"acecode_id": "bigcode_python_fns_33823",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n)` that returns a list containing the Fibonacci sequence up to the provided number `n`. The sequence should include all Fibonacci numbers less than `n`. For example, if `n` is 10, the function should return [0, 1, 1, 2, 3, 5, 8].\nPlease reason ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(8) == [0, 1,... | {
"split": "train",
"index": 85160,
"acecode_id": "evol_24559",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers of length n (1 <= n <= 10^5), implement a function that calculates the sum of all even integers in this array. The elements of the array can range from 1 to 100. Your function should take this array as input and return the sum of the even integers. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_elements([8, 5, 13, 2, 10]) == 20\", \"assert sum_even_elements([1, 3, 5, 7, 9]) == 0\", \"assert sum_even_elements([2, 4, 6, 8, 10]) == 30\", \"assert sum_even_elements([1, 2, 3, 4, 5]) == 6\", \"assert sum_even_elements([7, 14, 21, 28]) == 42\", \... | {
"split": "train",
"index": 85161,
"acecode_id": "evol_3269",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given application name, represented as a string, is currently running on a system based on a list of running processes. The function should handle the following scenarios: If the application name starts with a '/', the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_app_running('MyApp', ['/Applications/MyApp.app/Contents/MacOS/MyApp', '/usr/bin/otherapp']) == True\", \"assert is_app_running('OtherApp', ['/Applications/MyApp.app/Contents/MacOS/MyApp', '/usr/bin/otherapp']) == False\", \"assert is_app_running('/usr/bin... | {
"split": "train",
"index": 85162,
"acecode_id": "bigcode_python_fns_47325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `classify_review(review: str) -> str` that classifies a given text review into two classes: 'Positive' or 'Negative'. A review is classified as 'Positive' if it contains positive sentiment indicators such as 'great', 'excellent', 'amazing', 'love', or 'fant... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_review('This is a great movie!') == 'Positive'\", \"assert classify_review('This movie was terrible') == 'Negative'\", \"assert classify_review('I love this place!') == 'Positive'\", \"assert classify_review('The food was horrible') == 'Negative'\",... | {
"split": "train",
"index": 85163,
"acecode_id": "evol_22531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing data for a single subject in a study on ankle models. The dictionary contains a key 'X' which is a list of feature values, and a key 'y' which is a list of corresponding true labels. Implement a function `predict_labels(data: dict) -> dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_labels({'X': [0.1, 0.5, 0.8], 'y': [0, 0, 1]}) == {'predicted': [0, 1, 1], 'true': [0, 0, 1]}\", \"assert predict_labels({'X': [0.4, 0.4, 0.4], 'y': [1, 1, 1]}) == {'predicted': [0, 0, 0], 'true': [1, 1, 1]}\", \"assert predict_labels({'X': [1.0, 0.2... | {
"split": "train",
"index": 85164,
"acecode_id": "bigcode_python_fns_47251",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a custom iterator object that allows iterating over the characters in the input string in reverse order. Modify the code below to use the custom iterator object.\n\n```\nword = \"apple\"\nfor i in range(len(word)):\n print(word[i])\n```\n\nNote: Do not use the reve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ''.join(list(ReverseIterator('apple'))) == 'elppa'\", \"assert ''.join(list(ReverseIterator('hello'))) == 'olleh'\", \"assert ''.join(list(ReverseIterator('')))== ''\", \"assert ''.join(list(ReverseIterator('a'))) == 'a'\", \"assert ''.join(list(ReverseItera... | {
"split": "train",
"index": 85165,
"acecode_id": "evol_8946",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a given string contains at least a specified minimum count of a certain digit. Write a function `digit_count_check(s: str, digit: str, min_count: int) -> bool` that takes in three parameters: a string `s`, a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert digit_count_check('asdqwe872536', '8', 1) == True\", \"assert digit_count_check('hello123', '1', 1) == True\", \"assert digit_count_check('abcdefg', '2', 0) == True\", \"assert digit_count_check('9876543210', '0', 1) == True\", \"assert digit_count_check('11... | {
"split": "train",
"index": 85166,
"acecode_id": "bigcode_python_fns_24203",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a set of distinct positive integers `nums`, return the largest subset `answer` such that every pair `(answer[i], answer[j])` of elements in this subset satisfies: `answer[i] % answer[j] == 0`, or `answer[j] % answer[i] == 0`. The subset must contain both the smallest and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largestDivisibleSubset([1, 2, 3]) == [1, 2]\", \"assert largestDivisibleSubset([1, 2, 4, 8]) == [1, 2, 4, 8]\", \"assert largestDivisibleSubset([3, 6, 12, 24]) == [3, 6, 12, 24]\", \"assert largestDivisibleSubset([5, 10, 20, 40]) == [5, 10, 20, 40]\", \"asse... | {
"split": "train",
"index": 85167,
"acecode_id": "evol_23076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a sequence of numbers. The function should take a string input representing a sequence of numbers between 1 and 10, separated by commas. The function must convert this string into a list of integers and return it. Ho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_sequence('1,2,3,4') == [1, 2, 3, 4]\", \"assert process_sequence('5,6,7,8,9,10') == [5, 6, 7, 8, 9, 10]\", \"assert process_sequence('1,2,3') == 'Number of elements should be even. Exit'\", \"assert process_sequence('1,2,3,4,5') == 'Number of element... | {
"split": "train",
"index": 85168,
"acecode_id": "oss_22769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string input in the format 'item_id, quantity', implement a function that checks if a specified quantity of an item is available in stock. The function should return a string indicating the availability of the item in the format '<quantity> is available' if the item is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_availability('1, 5') == '5 is available'\", \"assert check_availability('4, 1') == 0\", \"assert check_availability('6, 3') == 0\", \"assert check_availability('8, 5') == 0\", \"assert check_availability('11, 7') == 0\", \"assert check_availability('13... | {
"split": "train",
"index": 85169,
"acecode_id": "bigcode_python_fns_45397",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that simulates a decision-making process using a weighted random selection algorithm. Write a function `weighted_random_selection(options: List[str], weights: List[int]) -> str` that takes in two parameters: - `options` (1 <= len(options) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert weighted_random_selection(['A', 'B', 'C'], [1, 2, 3]) in ['A', 'B', 'C']\", \"assert weighted_random_selection(['X', 'Y'], [5, 1]) in ['X', 'Y']\", \"assert weighted_random_selection(['Apple', 'Banana', 'Cherry'], [10, 0, 0]) == 'Apple'\", \"assert weighted_... | {
"split": "train",
"index": 85170,
"acecode_id": "oss_17541",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a template containing placeholders in the format {key}. You are also given a dictionary where the keys correspond to the placeholders in the template, and the values are the replacement strings. Write a function `generate_string(template: str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_string('Hello, {name}. Welcome to {place}!', {'name': 'Alice', 'place': 'Wonderland'}) == 'Hello, Alice. Welcome to Wonderland!'\", \"assert generate_string('This is a {adjective} day.', {'adjective': 'beautiful'}) == 'This is a beautiful day.'\", \... | {
"split": "train",
"index": 85171,
"acecode_id": "bigcode_python_fns_17813",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that determines the total number of distinct palindromic substrings within the string. A palindromic substring is defined as a substring that reads the same forward and backward. Implement the function 'count_palindrome_substrings(string: str) -... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_palindrome_substrings('a') == 1\", \"assert count_palindrome_substrings('abc') == 3\", \"assert count_palindrome_substrings('level') == 7\", \"assert count_palindrome_substrings('') == 0\", \"assert count_palindrome_substrings('abcba') == 7\", \"assert... | {
"split": "train",
"index": 85172,
"acecode_id": "evol_10486",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of names, implement a function `sort_names` that returns a new list containing the names sorted in alphabetical order. The input list may contain duplicates and will only consist of string elements.\nPlease reason step by step, then write a self-contained Python so... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_names(['John', 'Adam', 'Paul', 'Jessica', 'Olivia']) == ['Adam', 'Jessica', 'John', 'Olivia', 'Paul']\", \"assert sort_names(['Alice', 'Bob', 'Charlie', 'David']) == ['Alice', 'Bob', 'Charlie', 'David']\", \"assert sort_names(['Zara', 'Anna', 'Liam', 'E... | {
"split": "train",
"index": 85173,
"acecode_id": "evol_27390",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list, implement a function that returns the third element of the list. If the list does not contain a third element, the function should return a specified default value. Additionally, the function should handle cases where the input is not a list by returning an error ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert access_third_element([1, 2, 3, 4], 'default') == 3\", \"assert access_third_element([1, 2], 'default') == 'default'\", \"assert access_third_element([], 'default') == 'default'\", \"assert access_third_element([None, None, None], 'default') == None\", \"asse... | {
"split": "train",
"index": 85174,
"acecode_id": "evol_4268",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the daily prices of a stock. Your task is to write a function `max_profit(prices: List[int]) -> int` that determines the maximum profit you can achieve by buying and selling the stock on different days. You can only complete one tra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([2, 1, 2, 1, 2]) == 1\", \"asser... | {
"split": "train",
"index": 85175,
"acecode_id": "oss_8734",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of musical notes represented by their MIDI numbers. Your task is to write a function that calculates the following statistics based on the notes provided: 1. `note_frequency`: A dictionary containing the frequency of each note. 2. `total_duration`: The tota... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_notes([60, 62, 60, 64, 65]) == {'note_frequency': {60: 2, 62: 1, 64: 1, 65: 1}, 'total_duration': 5, 'average_pitch': 62.2}\", \"assert analyze_notes([]) == {'note_frequency': {}, 'total_duration': 0, 'average_pitch': 0}\", \"assert analyze_notes([70... | {
"split": "train",
"index": 85176,
"acecode_id": "oss_3232",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You need to create a function `create_sample_category(user: str, name: str = 'Movie', slug: str = 'film') -> dict` that simulates the creation of a category for a user. The function should return a dictionary representing the created category with the keys 'user', 'name', and '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_sample_category('User1') == {'user': 'User1', 'name': 'Movie', 'slug': 'film'}\", \"assert create_sample_category('User2', 'Book') == {'user': 'User2', 'name': 'Book', 'slug': 'film'}\", \"assert create_sample_category('User3', 'Series', 'tv') == {'us... | {
"split": "train",
"index": 85177,
"acecode_id": "bigcode_python_fns_48155",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `manipulate_array` that doubles the last element of the list. If the list is empty, the function should return the string 'Array is empty.' The function should return the modified list if it is not empty. Please implement only the `man... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manipulate_array([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 10]\", \"assert manipulate_array([10]) == [20]\", \"assert manipulate_array([]) == 'Array is empty.'\", \"assert manipulate_array([-1, -2, -3]) == [-1, -2, -6]\", \"assert manipulate_array([0, 0, 0]) == [0, 0... | {
"split": "train",
"index": 85178,
"acecode_id": "evol_32262",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing transaction amounts. Your task is to implement a function `event_speakers_call(transactions: List[int]) -> int` that calculates the total amount of all transactions. The function should return the sum of the transactions. If the lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert event_speakers_call([100, 200, 300]) == 600\", \"assert event_speakers_call([-100, -200, -300]) == -600\", \"assert event_speakers_call([1, 2, 3, 4, 5]) == 15\", \"assert event_speakers_call([0, 0, 0]) == 0\", \"assert event_speakers_call([10]) == 10\", \"as... | {
"split": "train",
"index": 85179,
"acecode_id": "bigcode_python_fns_7162",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that identifies and returns the lengthiest contiguous subarray where the sum equals zero. If there are multiple subarrays of the same maximum length, return all such subarrays. Additionally, the function should validate that the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_zero_sum_subarray([1, 2, 3, 4]) == []\", \"assert longest_zero_sum_subarray([0, 1, -1]) == [[0, 1, -1]]\", \"assert longest_zero_sum_subarray([]) == []\", \"assert longest_zero_sum_subarray([-1, 1]) == [[-1, 1]]\", \"assert longest_zero_sum_subarray(... | {
"split": "train",
"index": 85180,
"acecode_id": "evol_11810",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given two vectors A and B in n-dimensional space, implement a function called `proj(A: List[float], B: List[float]) -> List[float]` that computes the projection of vector A onto the hyperplane defined by vector B. The hyperplane defined by B is the set of all points x such that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert proj([1.0, 1.0], [1.0, 1.0]) == [1.0, 1.0]\", \"assert proj([5.0, 5.0], [1.0, 1.0]) == [5.0, 5.0]\", \"assert proj([0.0, 0.0], [0.0, 1.0]) == [0.0, 0.0]\", \"assert proj([-1.0, -1.0], [1.0, 1.0]) == [-1.0, -1.0]\", \"assert proj([1.0, 2.0, 3.0], [1.0, 2.0, 3... | {
"split": "train",
"index": 85181,
"acecode_id": "bigcode_python_fns_37204",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of entities with their relationships in the form of stronger pairs, a list representing their charisma values, and a list representing their wisdom values. Implement a function `validate_entity(N: int, stronger: List[Tuple[int, int]], charisma: List[int], w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_entity(3, [(0, 1), (1, 2)], [1, 2, 3], [3, 2, 1]) == [2, 2, 2]\", \"assert validate_entity(5, [], [4, 5, 1, 2, 3], [0, 1, 2, 3, 4]) == [0, 1, 2, 3, 4]\", \"assert validate_entity(2, [(0, 1)], [1, 2], [2, 1]) == [1, 1]\", \"assert validate_entity(0, ... | {
"split": "train",
"index": 85182,
"acecode_id": "evol_20966",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a message queue system. The function should take a channel name and a message in the form of a dictionary. The goal is to create a deep copy of the message and return it along with the channel name in a tuple format. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_message('channel1', {'value': [1, 2, 3]}) == ('channel1', {'value': [1, 2, 3]})\", \"assert send_message('channel2', {'key': 'value'}) == ('channel2', {'key': 'value'})\", \"assert send_message('channel3', {'a': 1, 'b': 2}) == ('channel3', {'a': 1, 'b':... | {
"split": "train",
"index": 85183,
"acecode_id": "oss_4362",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the first n numbers in the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. Your function should return a list containing the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(0) == []\", \"assert fib(1) == [0]\", \"assert fib(2) == [0, 1]\", \"assert fib(3) == [0, 1, 1]\", \"assert fib(4) == [0, 1, 1, 2]\", \"assert fib(5) == [0, 1, 1, 2, 3]\", \"assert fib(6) == [0, 1, 1, 2, 3, 5]\", \"assert fib(7) == [0, 1, 1, 2, 3, 5, 8]\... | {
"split": "train",
"index": 85184,
"acecode_id": "evol_3672",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to write a Python function that takes two integers, x and y, and returns the optimized result of the equation x + x + y + y + y. The function should calculate this using the simplest form of the equation. Implement the function optimize_equation that takes two ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimize_equation(1, 1) == 5\", \"assert optimize_equation(0, 0) == 0\", \"assert optimize_equation(2, 3) == 13\", \"assert optimize_equation(-1, -1) == -5\", \"assert optimize_equation(5, 0) == 10\", \"assert optimize_equation(0, 5) == 15\", \"assert optimi... | {
"split": "train",
"index": 85185,
"acecode_id": "evol_5680",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that converts a given string of text into its corresponding Morse code representation. The Morse code for each character should be represented using dots (.) and dashes (-), with a space between each Morse character and a special separator ' / ' between... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_morse('A') == '.- '\", \"assert convert_to_morse('B') == '-... '\", \"assert convert_to_morse('C') == '-.-. '\", \"assert convert_to_morse('HELLO') == '.... . .-.. .-.. --- '\", \"assert convert_to_morse('SOS') == '... --- ... '\", \"assert conver... | {
"split": "train",
"index": 85186,
"acecode_id": "evol_31317",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `calculate_cost` that computes the mean squared error between a computed cost and a maximum permissible cost based on the following formula: `cost = x[0] * (x[1] ** 2) * (x[2] ** 2)`, where `x` is a list of three values representing p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_cost([1, 1, 1]) == 1.0\", \"assert calculate_cost([1, 2, 1]) == 4.0\", \"assert calculate_cost([0, 1, 1]) == 4.0\", \"assert calculate_cost([1, 0, 1]) == 4.0\", \"assert calculate_cost([1, 1, 0]) == 4.0\", \"assert calculate_cost([0, 0, 0]) == 4.0\... | {
"split": "train",
"index": 85187,
"acecode_id": "bigcode_python_fns_37277",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a 2D matrix of integers, implement a function that sorts the entire matrix in ascending order. The sorting should be done such that all elements in the matrix are rearranged to form a single sorted list, then reconstructed into the original matrix dimensions. Write a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_matrix([[4, 7, 1], [5, 8, 2]]) == [[1, 2, 4], [5, 7, 8]]\", \"assert sort_matrix([[10, 20, 30], [5, 15, 25], [0, 40, 50]]) == [[0, 5, 10], [15, 20, 25], [30, 40, 50]]\", \"assert sort_matrix([[3]]) == [[3]]\", \"assert sort_matrix([[1, 1], [1, 1]]) == [... | {
"split": "train",
"index": 85188,
"acecode_id": "evol_765",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that concatenates two matrices along the last dimension and reshapes the result into a specified batch size. The function should take two 2D matrices, `left` and `right`, and an integer `batch_size` as input. The `left` matrix has a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_and_reshape([[1, 2, 3], [4, 5, 6]], [[7, 8], [9, 10]], 1) == [[[1, 2, 3, 7, 8], [4, 5, 6, 9, 10]]]\", \"assert concatenate_and_reshape([[1, 2]], [[3, 4]], 1) == [[[1, 2, 3, 4]]]\", \"assert concatenate_and_reshape([[1]], [[2]], 1) == [[[1, 2]]]\"... | {
"split": "train",
"index": 85189,
"acecode_id": "oss_19828",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of strings and returns a dictionary where the keys are the unique words from the list and the values are their corresponding counts of occurrences. The function should handle an empty list by returning an empty dictionary.\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words([]) == {}\", \"assert count_words(['apple']) == {'apple': 1}\", \"assert count_words(['apple', 'banana']) == {'apple': 1, 'banana': 1}\", \"assert count_words(['apple', 'apple', 'banana']) == {'apple': 2, 'banana': 1}\", \"assert count_words(['ap... | {
"split": "train",
"index": 85190,
"acecode_id": "evol_15989",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of colors represented by integers and a list of queries, each query consists of an index and a desired color. Implement a function that returns the minimum distance from the given index to the nearest occurrence of the desired color in the list. If the desired colo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_distance_to_desired_hue([2, 2, 2, 2, 2], [(1, 2), (0, 2), (4, 2)]) == [0, 0, 0]\", \"assert min_distance_to_desired_hue([1, 1, 1, 1, 1], [(2, 1)]) == [0]\", \"assert min_distance_to_desired_hue([1, 2, 1, 2, 1], [(0, 2), (4, 1)]) == [1, 0]\", \"assert min... | {
"split": "train",
"index": 85191,
"acecode_id": "evol_18589",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a specific value is present in an iterable. The function should take two parameters: an iterable (such as a list or tuple) and a value to search for. The function should return True if the value is found in the iterable... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_value_in_iterable([1, 2, 3, 4, 5], 3) == True\", \"assert is_value_in_iterable([1, 2, 3, 4, 5], 6) == False\", \"assert is_value_in_iterable(['apple', 'banana', 'cherry'], 'banana') == True\", \"assert is_value_in_iterable(['apple', 'banana', 'cherry'], '... | {
"split": "train",
"index": 85192,
"acecode_id": "oss_19341",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `extract_headlines(html_content: str) -> List[str]` that takes in a string representing the HTML content of a webpage and returns a list of news headlines. The headlines are assumed to be wrapped in <h1> tags within the HTML content. If there are no <h1> tags p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_headlines('<h1>Breaking News</h1><h1>Latest Updates</h1>') == ['Breaking News', 'Latest Updates']\", \"assert extract_headlines('<div><h1>Headline 1</h1></div><h1>Headline 2</h1>') == ['Headline 1', 'Headline 2']\", \"assert extract_headlines('<h1>He... | {
"split": "train",
"index": 85193,
"acecode_id": "evol_7171",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that accepts an integer 'n' as an argument and returns a list of all the even integers within the range of 2 to 'n', inclusive.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display_evens(2) == [2]\", \"assert display_evens(3) == [2]\", \"assert display_evens(4) == [2, 4]\", \"assert display_evens(5) == [2, 4]\", \"assert display_evens(6) == [2, 4, 6]\", \"assert display_evens(10) == [2, 4, 6, 8, 10]\", \"assert display_evens(11... | {
"split": "train",
"index": 85194,
"acecode_id": "evol_25305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to simulate the loading of circuit data and data type information for a neural network simulation. Implement a function `load_circuit_files(data_files, data_type_files)` that takes two parameters: a string `data_files` representing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_circuit_files('another_valid_circuit.h5', 'another_valid_data.csv') == 'Files loaded successfully.'\", \"assert load_circuit_files('valid_circuit_1.h5', 'valid_data_1.csv') == 'Files loaded successfully.'\", \"assert load_circuit_files('valid_circuit_3.... | {
"split": "train",
"index": 85195,
"acecode_id": "oss_28075",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function that generates a glossary of verbs along with their explanations. The function should take a list of tuples, where each tuple contains a verb (string) and its corresponding explanation (string). Your function should return a dictionary w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_glossary([('run', 'to move swiftly on foot'), ('jump', 'to leap off the ground'), ('run', 'to manage or conduct')]) == {'run': 'to move swiftly on foot', 'jump': 'to leap off the ground'}\", \"assert generate_glossary([('read', 'to look at and compr... | {
"split": "train",
"index": 85196,
"acecode_id": "bigcode_python_fns_35426",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two strings: `new_user` and `usernameOfFriend`. Your task is to determine if `new_user` is friends with `usernameOfFriend`. You should implement a function `check_friends(new_user: str, usernameOfFriend: str) -> bool`. The friendship can be determined as follows: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_friends('alice', 'alice') == True\", \"assert check_friends('bob', 'bob') == True\", \"assert check_friends('charlie', 'charlie') == True\", \"assert check_friends('dave', 'dave') == True\", \"assert check_friends('eve', 'eve') == True\", \"assert chec... | {
"split": "train",
"index": 85197,
"acecode_id": "bigcode_python_fns_40195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a filtering mechanism for a list of assemblies based on certain criteria. Each assembly is represented as an instance of the `DBAssembly` class, which has an attribute `active` that indicates whether the assembly is active. You also have a `Requ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_assemblies([DBAssembly('A1', True), DBAssembly('A2', True)], RequestMock()) == [DBAssembly('A1', True)]\", \"assert filter_assemblies([DBAssembly('A1', False), DBAssembly('A2', False)], RequestMock()) == []\", \"assert filter_assemblies([DBAssembly('A... | {
"split": "train",
"index": 85198,
"acecode_id": "oss_28456",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function that returns the highest product of elements from a list of lists, along with the corresponding list or lists that achieve this product. The function must handle lists containing both positive and negative integers, as well as zero. If multiple lists have the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product_list([[1, 2], [3, 4], [5, 6]]) == (30, [[5, 6]])\", \"assert max_product_list([[0, 0], [0, 1], [1, 1]]) == (1, [[1, 1]])\", \"assert max_product_list([[-1, -2], [-3, -4], [-5, -6]]) == (30, [[-5, -6]])\", \"assert max_product_list([[0], [0], [0]]... | {
"split": "train",
"index": 85199,
"acecode_id": "evol_112",
"num_tests": 12
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.