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": "Given a list of integers, write a function that returns the maximum sum of any contiguous subarray of the list. The function should take in a list of integers and return a single integer representing the maximum sum. A contiguous subarray is defined as a subarray that consists ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, 2, 3, -2, 5]) == 9\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([0, 0, 0, 0]) == 0\", \"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) ==... | {
"split": "train",
"index": 79100,
"acecode_id": "bigcode_python_fns_5825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a user creation functionality for a web application that utilizes role-based access control. The function `create_user(role, current_user_role)` should determine whether a user with a specific role can be created based on the role of the user at... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user('Manager', 'Administrator') == True\", \"assert create_user('Editor', 'Administrator') == True\", \"assert create_user('Viewer', 'Administrator') == True\", \"assert create_user('Administrator', 'Administrator') == False\", \"assert create_user('... | {
"split": "train",
"index": 79101,
"acecode_id": "oss_26921",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function called `register` that takes a string `key` as input and returns a decorator function. This decorator will take an object (function or class) as input, store it in a global registry using the provided key, and return the original object. The glo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register('data_source.processor')(lambda x: x)(5) == 5\", \"assert register('data_source.rcmed')(list)([1, 2, 3]) == [1, 2, 3]\", \"assert register('data_source.handler')(str)('test') == 'test'\", \"assert register('data_source.rcmed')(int)(10) == 10\", \"as... | {
"split": "train",
"index": 79102,
"acecode_id": "bigcode_python_fns_7153",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, your task is to implement a function `find_unique_numbers` that returns a list of integers that appear only once in the input list. The returned list should be in ascending order. If there are no unique numbers, return an empty list. The input list can... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unique_numbers([1, 2, 3, 2, 1]) == [3]\", \"assert find_unique_numbers([4, 5, 6, 4, 5, 6]) == []\", \"assert find_unique_numbers([7, 8, 9, 10, 9, 8, 7]) == [10]\", \"assert find_unique_numbers([-1, -2, -3, -2, -1]) == [-3]\", \"assert find_unique_number... | {
"split": "train",
"index": 79103,
"acecode_id": "oss_1531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates an animation from an image represented as a grid of subimages. The function should take in the number of rows and columns that the image is divided into, along with the duration for which each frame should be displayed. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_animation(2, 2, 0.1) == AnimationRepresentation(grid=[[0, 1], [2, 3]], frame_duration=0.1)\", \"assert generate_animation(1, 1, 0.5) == AnimationRepresentation(grid=[[0]], frame_duration=0.5)\", \"assert generate_animation(3, 3, 0.2) == AnimationRep... | {
"split": "train",
"index": 79104,
"acecode_id": "bigcode_python_fns_1771",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining whether two players have ever played a match against each other based on their player IDs. Implement a function `check_for_rematch(player_id1: int, player_id2: int) -> bool` that returns `True` if the two players have played a match before and `F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_for_rematch(1, 2, [(1, 3), (2, 3), (1, 2)]) == True\", \"assert check_for_rematch(1, 4, [(1, 3), (2, 3), (1, 2)]) == False\", \"assert check_for_rematch(10, 20, [(10, 30), (20, 30), (10, 20)]) == True\", \"assert check_for_rematch(5, 6, [(5, 7), (8, 9)... | {
"split": "train",
"index": 79105,
"acecode_id": "bigcode_python_fns_33659",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of vectors represented as 1D arrays of numbers. Your task is to create a new vector by concatenating all the vectors in the list, except for the last vector if a specific condition is met. The condition is that if a boolean flag `on_para_eq_constraint` is s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_vecs_to_var([[1, 2], [3, 4], [5, 6]], True) == [1, 2, 3, 4]\", \"assert convert_vecs_to_var([[1, 2], [3, 4], [5, 6]], False) == [1, 2, 3, 4, 5, 6]\", \"assert convert_vecs_to_var([[7, 8]], True) == []\", \"assert convert_vecs_to_var([[7, 8]], False) ... | {
"split": "train",
"index": 79106,
"acecode_id": "bigcode_python_fns_16572",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates an HTTP exception handling mechanism. The function should take two parameters: `http_status` (an integer representing the HTTP status code) and `message` (a string representing the error message). The function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert http_exception(400, 'Invalid input') == (400, 'Invalid input')\", \"assert http_exception(401, 'Access denied') == (401, 'Access denied')\", \"assert http_exception(403, 'Permission denied') == (403, 'Permission denied')\", \"assert http_exception(404, 'Reso... | {
"split": "train",
"index": 79107,
"acecode_id": "oss_26412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a caching decorator that uses the functools library to memoize the results of a recursive function. Your goal is to create a decorator called `cache_func` that utilizes `functools.lru_cache` correctly to optimize the execution of a function that... | 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": 79108,
"acecode_id": "evol_143",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a date represented by three integers, `day`, `month`, and `year`, determine the corresponding day of the week and calculate the number of days until the next occurrence of the same weekday. The output should be a tuple where the first element is the name of the weekday (o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert weekday_from_date(31, 8, 2019) == ('Saturday', 7)\", \"assert weekday_from_date(18, 7, 1999) == ('Sunday', 7)\", \"assert weekday_from_date(15, 8, 1993) == ('Sunday', 7)\", \"assert weekday_from_date(1, 1, 2000) == ('Saturday', 7)\", \"assert weekday_from_da... | {
"split": "train",
"index": 79109,
"acecode_id": "evol_33919",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `link_controller_to_database(controller: dict, base: dict) -> dict` that links a controller represented as a dictionary to a database represented as another dictionary. The controller dictionary contains the following keys: 'history', 'ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert link_controller_to_database({'history': True, 'table_or_collection': 'users', 'skip_name_check': False, 'skip_unknown_fields': False, 'skip_update_indexes': False, 'skip_log_for_unknown_fields': False}, {}) == {'history': True, 'table_or_collection': 'users'... | {
"split": "train",
"index": 79110,
"acecode_id": "bigcode_python_fns_37409",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary containing a boolean value associated with the key 'v', implement a function `template(txt: str, data: dict) -> str` that processes a string template with conditional statements. The template contains an `if` statement checking the value of 'v'. If 'v' is Tru... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert template('''{{if v:}}ok{{else:}}no{{pass}}''', {'v': True}) == 'ok'\", \"assert template('''{{if v:}}ok{{else:}}no{{pass}}''', {'v': False}) == 'no'\", \"assert template('''{{if v:}}ok{{else:}}no{{pass}}''', {'v': True}) == 'ok'\", \"assert template('''{{if ... | {
"split": "train",
"index": 79111,
"acecode_id": "bigcode_python_fns_37953",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing only the unique integers from the input list, preserving the order of their first appearance. If there are no unique integers, return an empty list. The input list may contain both positive and negati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 4]) == [1, 3]\", \"assert unique_integers([5, 5, 5, 5]) == []\", \"assert unique_integers([]) == []\", \"assert unique_integers([7, -1, 8, -1, 9, 7]) == [8, 9]\", \"assert unique_integers([3, 3, 3, 2, 2, 1]) == [1]\", \"assert... | {
"split": "train",
"index": 79112,
"acecode_id": "bigcode_python_fns_37593",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a set of candidate strings and a target symbol string, return a set of candidates that match the target when split by a specified separator and compared in reverse order. The function takes three parameters: a set of strings `candidates`, a string `symbol`, and an optiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_reverse({'x::y', 'y::x', 'z'}, 'y::x') == {'y::x'}\", \"assert match_reverse({'one::two::three', 'three::two::one'}, 'one::two::three') == {'one::two::three'}\", \"assert match_reverse({'apple::banana', 'banana::apple'}, 'banana::apple') == {'banana::a... | {
"split": "train",
"index": 79113,
"acecode_id": "bigcode_python_fns_720",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that registers a help article for a specific module and topic. The function should take in three parameters: a string 'module' representing the name of the module, a string 'topic' representing the topic of the help article, and 'cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_help('auth', 'login', 'This is the login help.') == 'Help article registered for auth on topic login. Contents: This is the login help.'\", \"assert register_help('data', 'fetch', lambda: 'Fetch data help.') == 'Help article registered for data on t... | {
"split": "train",
"index": 79114,
"acecode_id": "bigcode_python_fns_35074",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a numeric date in the format DDMMYYYY, write a function that returns the corresponding day of the week in full (e.g., 'Wednesday' rather than 'Wed'). The function should validate the input date and handle leap years appropriately. If the input date is invalid, return 'Inv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_day_of_week('01012021') == 'Friday'\", \"assert get_day_of_week('29022020') == 'Saturday'\", \"assert get_day_of_week('31012020') == 'Friday'\", \"assert get_day_of_week('29022019') == 'Invalid date'\", \"assert get_day_of_week('31022020') == 'Invalid da... | {
"split": "train",
"index": 79115,
"acecode_id": "evol_28644",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a hierarchy of categories, where each category is defined by a unique key. Each category has a 'parent' that indicates its parent category's key, a 'nicename' which is a string representing the category's name, and potentially nested s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_category_tree('root', {'root': {'parent': None, 'nicename': 'Root'}, 'child1': {'parent': 'root', 'nicename': 'Child 1'}, 'child2': {'parent': 'root', 'nicename': 'Child 2'}}) == [{'parent': 'root', 'nicename': 'Child 1', 'children': []}, {'parent': 'r... | {
"split": "train",
"index": 79116,
"acecode_id": "bigcode_python_fns_7717",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `safe_addition(n1, n2)` that takes two parameters and returns their sum. If either parameter is of a type that cannot be added (such as string, list, or any other non-numeric type), the function should return 'Invalid input'. Your function should be able to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_addition(1, 2) == 3\", \"assert safe_addition(1.5, 2.5) == 4.0\", \"assert safe_addition(10, -5) == 5\", \"assert safe_addition(-1, -1) == -2\", \"assert safe_addition(0, 0) == 0\", \"assert safe_addition(1, 'a') == 'Invalid input'\", \"assert safe_addi... | {
"split": "train",
"index": 79117,
"acecode_id": "evol_12001",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a date in the format 'YYYY-MM-DD HH:MM:SS', write a function that converts this string into a more readable format 'DD MMM YYYY'. If the input date string is 'N/A' or is not a valid date, return 'N/A'. The function should handle invalid date formats ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_date('2023-10-05 14:30:00') == '05 Oct 2023'\", \"assert format_date('2020-01-01 00:00:00') == '01 Jan 2020'\", \"assert format_date('1999-12-31 23:59:59') == '31 Dec 1999'\", \"assert format_date('N/A') == 'N/A'\", \"assert format_date('2023-02-30 10... | {
"split": "train",
"index": 79118,
"acecode_id": "bigcode_python_fns_32213",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a successful user login for a web application. The function will accept a dictionary representing user credentials and return a string indicating the login success message. The function should be named `user_login_success` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_login_success({'username': 'user1', 'password': 'pass1'}) == 'Login successful!'\", \"assert user_login_success({'username': 'admin', 'password': 'admin123'}) == 'Login successful!'\", \"assert user_login_success({'username': 'test_user', 'password': 't... | {
"split": "train",
"index": 79119,
"acecode_id": "bigcode_python_fns_18413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a Python project that involves importing modules from different directories. You have a main module located in the root directory, and you need to import two specific modules, `antoine_test` and `dance`, from subdirectories. Your task is to write the necessar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_import_statements() == ['from subdirectory1 import antoine_test', 'from subdirectory2 import dance']\", \"assert get_import_statements() != []\", \"assert 'from subdirectory1 import antoine_test' in get_import_statements()\", \"assert 'from subdirectory2... | {
"split": "train",
"index": 79120,
"acecode_id": "oss_35029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether a given state allows log output to the console. The state is represented as an integer where 0 indicates that logging is disabled and any positive integer indicates that logging is enabled. Implement the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_log_output_enabled(0) == False\", \"assert is_log_output_enabled(1) == True\", \"assert is_log_output_enabled(10) == True\", \"assert is_log_output_enabled(-5) == False\", \"assert is_log_output_enabled(2) == True\", \"assert is_log_output_enabled(100) ==... | {
"split": "train",
"index": 79121,
"acecode_id": "bigcode_python_fns_40453",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that calculates the sum of all even numbers in the list. The function should take a single argument, `numbers`, which is a list of integers. Your function should return the sum of all the even integers in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_even_numbers([10, 15, 20, 25]) == 30\", \"assert sum_even_numbers([0, 1, 2, 3]) == 2\", \"assert sum_even_numbers([-1, -2, -3, -4]) == -6\", \"assert sum_even_numbers([]) == 0\", \"assert sum_even_number... | {
"split": "train",
"index": 79122,
"acecode_id": "oss_25698",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the balance of a token for different wallet addresses. Write a Python function `get_total_balance(balances)` that takes in a single parameter: a list of integers `balances`. The function should return the total balance of all wallet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_balance([10, 20, 30]) == 60\", \"assert get_total_balance([0, 0, 0]) == 0\", \"assert get_total_balance([5]) == 5\", \"assert get_total_balance([]) == 0\", \"assert get_total_balance([1, 2, 3, 4, 5]) == 15\", \"assert get_total_balance([-1, -2, -3]... | {
"split": "train",
"index": 79123,
"acecode_id": "oss_29002",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a filename, implement a function that determines if the filename matches a specified pattern. The pattern can include specific characters as well as placeholders for variable parts. The placeholders are represented by the following rules: \n- `*` can... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_filename('abc_123.txt', 'abc_*.txt') == True\", \"assert match_filename('abc_123.txt', 'abc_*.pdf') == False\", \"assert match_filename('xyz_456.log', 'xyz_*.log') == True\", \"assert match_filename('test_file.txt', 'test_*.txt') == True\", \"assert ma... | {
"split": "train",
"index": 79124,
"acecode_id": "bigcode_python_fns_35842",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple logging function for a software application. The logging function should accept a message and a log level (e.g., 'INFO', 'WARNING', 'ERROR'). The function should return a string indicating whether the message was logged or not based on ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_message('This is an informational message', 'INFO', 'WARNING') == 'Not logged'\", \"assert log_message('This is a warning message', 'WARNING', 'WARNING') == 'Logged: This is a warning message'\", \"assert log_message('This is an error message', 'ERROR', ... | {
"split": "train",
"index": 79125,
"acecode_id": "oss_8888",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer N and an integer K, write a function that returns the K-th digit from the right in the binary representation of the sum of the digits of N. If K is greater than the length of the binary representation, return 'ERROR'.\nPlease reason step by step, then w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve(123, 3) == '1'\", \"assert solve(999, 2) == '1'\", \"assert solve(1001, 2) == '1'\", \"assert solve(9999, 3) == '1'\", \"assert solve(5, 1) == '1'\", \"assert solve(5, 2) == '0'\", \"assert solve(15, 2) == '1'\", \"assert solve(28, 1) == '0'\", \"asser... | {
"split": "train",
"index": 79126,
"acecode_id": "evol_10306",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_cumulative(my_array)` that takes a complex multidimensional array as input. The array can contain integers, nested arrays, sets, dictionaries, strings, and floating point numbers. The function should return a single integer indicating the total n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_cumulative([1, 2, 3, 4]) == 4\", \"assert calculate_cumulative([]) == 0\", \"assert calculate_cumulative([[1], [2], [3], [4], [5]]) == 5\", \"assert calculate_cumulative([set([1, 2]), set([3, 4])]) == 4\", \"assert calculate_cumulative([{'x': [1, 2... | {
"split": "train",
"index": 79127,
"acecode_id": "evol_23405",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple lexer for a text editor application. The lexer should be able to apply a specific style to a given piece of text based on a case sensitivity option. Your goal is to implement a function called `apply_style` that takes in two parameters:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_style('Hello', True) == 'style:bold.ignore_case Hello'\", \"assert apply_style('Hello', False) == 'style:bold Hello'\", \"assert apply_style('world', True) == 'style:bold.ignore_case world'\", \"assert apply_style('world', False) == 'style:bold world'\... | {
"split": "train",
"index": 79128,
"acecode_id": "oss_26249",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings that represent the components of a fastq filename. Your task is to determine if the fastq file has passed the filter based on the last component of the list. The rules are as follows: If the last component starts with 'pass', return True. If it s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_fastq_pf_flag(['file', 'name', 'with', 'some', 'components', 'and', 'more', 'pass']) == True\", \"assert parse_fastq_pf_flag(['file', 'name', 'with', 'some', 'components', 'and', 'more', 'nopass']) == False\", \"assert parse_fastq_pf_flag(['file', 'nam... | {
"split": "train",
"index": 79129,
"acecode_id": "bigcode_python_fns_10984",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing user configurations for a web application. Your goal is to create a function called `manage_user_config` that handles user-specific settings and preferences using a dictionary to store the configurations. The function should take three parameters: `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_user_config([('set', 'theme', 'dark'), ('get', 'theme', None)]) == ['dark']\", \"assert manage_user_config([('set', 'language', 'English'), ('get', 'language', None)]) == ['English']\", \"assert manage_user_config([('set', 'notifications', True), ('ge... | {
"split": "train",
"index": 79130,
"acecode_id": "oss_27274",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a monitoring system for a blockchain node running on an Amazon EC2 instance. Your task is to implement a Python function that will analyze the disk usage and block information, and perform the following actions:\n1. If the maximum current block is n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monitor_blockchain_node('ec2-1', [], 5, 10, 70.0, 'running', 50.0, 20.0) == 'Block info recorded: 5, 10, 70.00%'\", \"assert monitor_blockchain_node('ec2-2', [], 0, 10, 70.0, 'running', 50.0, 20.0) == 'Block info recorded: 0, 10, 70.00%'\", \"assert monitor_... | {
"split": "train",
"index": 79131,
"acecode_id": "oss_8958",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer `val` and an integer `length`, implement a function `swap_endianness(val: int, length: int) -> int` that swaps the endianness of `val` based on the specified `length`. The `length` can be 16, 32, or 64 bits. If the length is less than or equal to 8 bits... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_endianness(0x12345678, 32) == 0x78563412\", \"assert swap_endianness(0xABCD, 16) == 0xCDAB\", \"assert swap_endianness(0x1, 8) == 0x1\", \"assert swap_endianness(0xFFFFFFFFFFFFFFFF, 64) == 0xFFFFFFFFFFFFFFFF\", \"assert swap_endianness(0x0, 32) == 0x0\"... | {
"split": "train",
"index": 79132,
"acecode_id": "bigcode_python_fns_2579",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing a series of measurements, implement a function that calculates the average of these measurements. The function should take the following parameters: \n- `measurements`: A list of integers. Each integer represents a measurement value. The li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_measurements([10]) == 10.0\", \"assert average_measurements([1, 2, 3]) == 2.0\", \"assert average_measurements([5, 5, 5, 5]) == 5.0\", \"assert average_measurements([-1, -2, -3]) == -2.0\", \"assert average_measurements([0, 0, 0]) == 0.0\", \"assert ... | {
"split": "train",
"index": 79133,
"acecode_id": "bigcode_python_fns_31170",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a bank account, which contains a 'pin' (a string) and a 'balance' (a float). Write a function `make_withdrawal(account: dict, amount: float) -> dict` that processes a withdrawal from the account. The function should perform the following ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_withdrawal({'pin': '1234', 'balance': 100.0}, 50.0) == {'pin': '1234', 'balance': 50.0}\", \"assert make_withdrawal({'pin': '5678', 'balance': 200.0}, 150.0) == {'pin': '5678', 'balance': 50.0}\", \"assert make_withdrawal({'pin': '3333', 'balance': 50.0... | {
"split": "train",
"index": 79134,
"acecode_id": "bigcode_python_fns_34015",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D array of integers called 'inputs' representing a collection of input data. Implement a function `decode` that takes this 2D array and returns a new 2D array where each element is the result of adding 1 to the corresponding element in the input array. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode([[1, 2], [3, 4]]) == [[2, 3], [4, 5]]\", \"assert decode([[0]]) == [[1]]\", \"assert decode([[10, 20], [30, 40], [50, 60]]) == [[11, 21], [31, 41], [51, 61]]\", \"assert decode([[-1, -2], [-3, -4]]) == [[0, -1], [-2, -3]]\", \"assert decode([[100]]) =... | {
"split": "train",
"index": 79135,
"acecode_id": "bigcode_python_fns_47312",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset configuration defined by an integer representing the dataset type (0 for CIFAR10, 1 for MNIST, 2 for ImageNet). Your task is to create a function that generates a dictionary containing transformation parameters based on the dataset type. The dictionary s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_transform_dict(0) == {'train': 'CIFAR10_Labeled', 'train_unlabeled': 'CIFAR10_Unlabeled', 'test': 'CIFAR10_Test'}\", \"assert generate_transform_dict(1) == {'train': 'MNIST_Labeled', 'train_unlabeled': 'MNIST_Unlabeled', 'test': 'MNIST_Test'}\", \"a... | {
"split": "train",
"index": 79136,
"acecode_id": "bigcode_python_fns_8195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents an element containing an 'attrib' key that is itself a dictionary. Your task is to implement a function that checks whether any of the dictionaries in the input list contain an attribute 'k' with the value '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_street_name([{'attrib': {'k': 'addr:street'}}, {'attrib': {'k': 'other'}}]) == True\", \"assert contains_street_name([{'attrib': {'k': 'addr:street_1'}}, {'attrib': {'k': 'random'}}]) == True\", \"assert contains_street_name([{'attrib': {'k': 'other... | {
"split": "train",
"index": 79137,
"acecode_id": "bigcode_python_fns_43937",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `remove_duplicates(lst)` that takes a list of integers as input and returns a new list with all duplicate integers removed while maintaining the original order of the first occurrences. The output list should only contain unique integers. For example, given the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([1, 1, 2, 2, 3, 3]) == [1, 2, 3]\", \"assert remove_duplicates([4, 5, 4, 6, 7, 5]) == [4, 5, 6, 7]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([1, 2, 1, 3... | {
"split": "train",
"index": 79138,
"acecode_id": "evol_16080",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given string is a valid email address. A valid email address must follow the standard format: it must contain exactly one '@' symbol, followed by a domain name that contains at least one '.' (dot) character. The domain na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_email('test@example.com') == True\", \"assert is_valid_email('user.name@domain.co') == True\", \"assert is_valid_email('user@sub.domain.com') == True\", \"assert is_valid_email('user@domain') == False\", \"assert is_valid_email('@domain.com') == Fal... | {
"split": "train",
"index": 79139,
"acecode_id": "bigcode_python_fns_30551",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the compression ratio of files based on their sizes. The compression ratio is defined as the ratio of the original file size to the compressed file size. Your task is to implement a function that takes the original file size and the compressed fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_compression_ratio(2.1, 2.1) == 1.0\", \"assert calculate_compression_ratio(39, 39) == 1.0\", \"assert calculate_compression_ratio(2.1, 1.0) == 2.1\", \"assert calculate_compression_ratio(100, 50) == 2.0\", \"assert calculate_compression_ratio(50, 2... | {
"split": "train",
"index": 79140,
"acecode_id": "oss_33138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words and a sentence. Your task is to find the index of the word in the list that appears first in the sentence. If none of the words appear in the sentence, return -1. The function should ignore case when matching words. Implement a function `find_first... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_first_word_index(['apple', 'banana', 'cherry'], 'I like to eat an apple') == 0\", \"assert find_first_word_index(['apple', 'banana', 'cherry'], 'I like to eat a banana') == 1\", \"assert find_first_word_index(['apple', 'banana', 'cherry'], 'I like to ea... | {
"split": "train",
"index": 79141,
"acecode_id": "bigcode_python_fns_16417",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid representing a game board where each cell can contain a '0' (an empty cell) or a '1' (an occupied cell). Your task is to implement a function `next_empty_cell(grid: List[List[int]], current: Tuple[int, int]) -> Tuple[int, int]` which takes a grid and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_empty_cell([[1, 1, 1], [1, 1, 1]], (0, 0)) == (-1, -1)\", \"assert next_empty_cell([[1, 0, 0], [0, 1, 0], [0, 0, 0]], (1, 0)) == (2, 0)\", \"assert next_empty_cell([[1]], (0, 0)) == (-1, -1)\", \"assert next_empty_cell([[1, 1], [1, 1]], (0, 0)) == (-1, ... | {
"split": "train",
"index": 79142,
"acecode_id": "bigcode_python_fns_48854",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given an undirected graph with `n` nodes, represented by an `edgeList` where each edge is defined as `edgeList[i] = [ui, vi, disi]`, indicating an edge between nodes `ui` and `vi` with a distance of `disi`. You also have an array of `queries`, where each query is define... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert edgeLengthRestrictedPaths(3, [[0,1,2],[1,2,4],[2,0,8],[1,0,16]], [[0,1,2],[0,2,5]]) == [False, True]\", \"assert edgeLengthRestrictedPaths(5, [[0,1,10],[1,2,5],[2,3,9],[3,4,13]], [[0,4,14],[1,4,13]]) == [True, False]\", \"assert edgeLengthRestrictedPaths(4, ... | {
"split": "train",
"index": 79143,
"acecode_id": "evol_18957",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a simple thesaurus. Your function should allow adding synonyms and antonyms for given words and provide a way to retrieve synonyms and antonyms for a specific word. Implement the function `thesaurus_operations(operations:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert thesaurus_operations([('add_synonym', 'happy', 'joyful'), ('add_synonym', 'happy', 'content'), ('get_synonyms', 'happy', '')]) == {'happy': ['joyful', 'content']}\", \"assert thesaurus_operations([('add_antonym', 'happy', 'sad'), ('get_antonyms', 'happy', ''... | {
"split": "train",
"index": 79144,
"acecode_id": "evol_14370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary represents a record with different attributes. Each record contains a key-value pair where the key is a string and the value can be of any data type. Your task is to implement a function that takes this list of dictiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distinct_values([{'key': 'value1'}, {'key': 'value2'}, {'key': 'value1'}], 'key') == ['value1', 'value2']\", \"assert distinct_values([{'key': 'value1'}, {'other_key': 'value2'}, {'key': 'value1'}], 'key') == ['value1']\", \"assert distinct_values([], 'key')... | {
"split": "train",
"index": 79145,
"acecode_id": "bigcode_python_fns_44994",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `coerce_input(val)` that can coerce input values into a standardized format. The function should return values according to the following rules: 1. If `val` is a string representing a date in the format 'YYYY-MM-DD', it should be retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert coerce_input('2023-10-01') == datetime.date(2023, 10, 1)\", \"assert coerce_input('2023-10-01T12:00:00') == datetime.datetime(2023, 10, 1, 12, 0)\", \"assert coerce_input(datetime.date(2023, 10, 1)) == datetime.date(2023, 10, 1)\", \"assert coerce_input(date... | {
"split": "train",
"index": 79146,
"acecode_id": "oss_9915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that renames a given list of directory names by transliterating their names. Transliteration is the process of converting text from one script into another, often preserving the pronunciation of the original words. The transliteration pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transliterate_directories(['caf\\u00e9', 'ni\\u00f1o', 'jalape\\u00f1o']) == ['cafe', 'nino', 'jalapeno']\", \"assert transliterate_directories(['r\\u00e9sum\\u00e9', 'fa\\u00e7ade', 'touch\\u00e9']) == ['resume', 'facade', 'touche']\", \"assert transliterat... | {
"split": "train",
"index": 79147,
"acecode_id": "oss_27643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves secrets from a given prefix or returns a default set of secrets if the prefix is None. The function should take a single parameter, `ssm_prefix`, which can either be a string representing the prefix for the secrets or N... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_secrets(None) == {'default_key_1': 'default_value_1', 'default_key_2': 'default_value_2'}\", \"assert get_secrets('prefix1') == {'key1': 'value_from_prefix1_key1', 'key2': 'value_from_prefix1_key2'}\", \"assert get_secrets('prefix2') == {'key1': 'value_f... | {
"split": "train",
"index": 79148,
"acecode_id": "oss_25227",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `password_check(password: str) -> str` that validates a given password based on the following criteria: 1. The password must contain a minimum of 10 characters. 2. It should include at least one upper case and one lower case letter. 3. It must have at least... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert password_check('Short1!') == 'Your password must contain a minimum of 10 characters'\", \"assert password_check('Abc123!') == 'Your password must contain a minimum of 10 characters'\", \"assert password_check('Abcdefghij123') == 'Your password must contain a... | {
"split": "train",
"index": 79149,
"acecode_id": "evol_19972",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a given view ID based on certain criteria. The view ID is a string that should adhere to the following rules: 1. The view ID must be exactly 4 characters long. 2. The first two characters must be digits between 01 and 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_view_id('1201') == True\", \"assert validate_view_id('0115') == True\", \"assert validate_view_id('1231') == True\", \"assert validate_view_id('0001') == False\", \"assert validate_view_id('1305') == False\", \"assert validate_view_id('1212') == Tru... | {
"split": "train",
"index": 79150,
"acecode_id": "oss_3424",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You will receive a list of integers. Your task is to find the largest prime number within the list such that the sum of its digits is also a prime number. If no such prime number exists, return -1.\nPlease reason step by step, then write a self-contained Python solution. Give y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_largest_prime_with_prime_digit_sum([10, 2, 3, 5, 11]) == 11\", \"assert find_largest_prime_with_prime_digit_sum([4, 6, 8, 9]) == -1\", \"assert find_largest_prime_with_prime_digit_sum([2, 3, 5, 7, 10]) == 7\", \"assert find_largest_prime_with_prime_digi... | {
"split": "train",
"index": 79151,
"acecode_id": "evol_30364",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates the Fibonacci sequence within specified integer boundaries. The function should take two parameters, `initial_value` and `final_value`, and return a list of all Fibonacci numbers that fall within this range, inclusive of the boundaries. The F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(0, 0) == [0]\", \"assert generate_fibonacci(2, 8) == [2, 3, 5, 8]\", \"assert generate_fibonacci(5, 5) == [5]\", \"assert generate_fibonacci(10, 20) == [13]\", \"assert generate_fibonacci(21, 34) == [21, 34]\", \"assert generate_fibonacci(... | {
"split": "train",
"index": 79152,
"acecode_id": "evol_17871",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing neural activity data represented as a list of binary states. Each state corresponds to the presence (1) or absence (0) of neural activity for a neuron at a specific time step. Your goal is to write a Python function `compute_integrated_information(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_integrated_information([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == 1.0\", \"assert compute_integrated_information([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == 0.0\", \"assert compute_integrated_information([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == 0.3333333333333333\... | {
"split": "train",
"index": 79153,
"acecode_id": "oss_6686",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Create a function `unpack_and_invoke(func, input_data)` that takes in a function `func` and an argument `input_data`. If `input_data` is a tuple, it should call `func` with the elements of the tuple as arguments. If `input_data` is not a tuple, it should call `func` with `input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unpack_and_invoke(lambda x: x + 1, (1,)) == 2\", \"assert unpack_and_invoke(lambda x, y: x + y, (1, 2)) == 3\", \"assert unpack_and_invoke(lambda x: x * 2, 5) == 10\", \"assert unpack_and_invoke(lambda x, y: x - y, (10, 5)) == 5\", \"assert unpack_and_invoke... | {
"split": "train",
"index": 79154,
"acecode_id": "bigcode_python_fns_5997",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the average score for a given set of students based on their performance in a series of tests. The function should take in a dictionary containing the test scores for each student and return a new dictionary wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_scores({'Alice': [85, 90, 92, 88, 95]}, 'mean') == {'Alice': 90.0}\", \"assert calculate_average_scores({'Bob': [78, 82, 80, 85, 88]}, 'median') == {'Bob': 82.0}\", \"assert calculate_average_scores({'Eve': [70, 75, 80, 85]}, 'mean') == {'E... | {
"split": "train",
"index": 79155,
"acecode_id": "oss_8500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of real numbers and you need to implement a function that calculates the arcsine (inverse sine) of each number in the list. The function should raise a ValueError if any number in the list is less than -1 or greater than 1, as the arcsine is not defined for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_arcsine([0, 0.5, 1]) == [0.0, 0.5235987755982989, 1.5707963267948966]\", \"assert calculate_arcsine([-1, 0, 1]) == [-1.5707963267948966, 0.0, 1.5707963267948966]\", \"assert calculate_arcsine([0, -0.5, -1]) == [0.0, -0.5235987755982989, -1.57079632... | {
"split": "train",
"index": 79156,
"acecode_id": "bigcode_python_fns_11110",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a trail with a unique identifier under the key 'pid'. Write a function `diff_last_filter(trail: List[Dict[str, int]]) -> Optional[List[Dict[str, int]]]` that checks if the 'pid' of the last element in the li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert diff_last_filter([]) == None\", \"assert diff_last_filter([{'pid': 1}]) == None\", \"assert diff_last_filter([{'pid': 1}, {'pid': 2}]) == [{'pid': 1}, {'pid': 2}]\", \"assert diff_last_filter([{'pid': 1}, {'pid': 1}]) == None\", \"assert diff_last_filter([{'... | {
"split": "train",
"index": 79157,
"acecode_id": "bigcode_python_fns_22156",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a program to monitor the time taken for a series of steps in a process. Your goal is to determine if the time taken for each step exceeds a predefined threshold of 5 seconds. You need to write a function that takes an integer N representing the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monitor_steps(3, [5, 5, 5]) == ['OK', 'OK', 'OK']\", \"assert monitor_steps(5, [1, 2, 3, 4, 5]) == ['OK', 'OK', 'OK', 'OK', 'OK']\", \"assert monitor_steps(2, [6, 7]) == ['SLOW', 'SLOW']\", \"assert monitor_steps(1, [10]) == ['SLOW']\", \"assert monitor_step... | {
"split": "train",
"index": 79158,
"acecode_id": "oss_31029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of words and performs a specific operation on them based on a list of boolean values. The function takes two input parameters: `words`, a list of strings representing the words, and `operations`, a list of boo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_words(['apple', 'banana'], [True, False]) == None\", \"assert process_words(['cat', 'dog'], [False, True]) == None\", \"assert process_words(['hello', 'world'], [True, True]) == None\", \"assert process_words(['foo', 'bar'], [False, False]) == None\"... | {
"split": "train",
"index": 79159,
"acecode_id": "oss_24825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers. Write a function that takes this array as input and returns a new array containing the elements sorted in descending order. The original array should remain unchanged. For example, given the input array [6, 2, 5, 3, 9], the output should be [... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_descending([6, 2, 5, 3, 9]) == [9, 6, 5, 3, 2]\", \"assert sort_descending([1, 2, 3]) == [3, 2, 1]\", \"assert sort_descending([10, 8, 6, 4, 2]) == [10, 8, 6, 4, 2]\", \"assert sort_descending([7, 7, 7]) == [7, 7, 7]\", \"assert sort_descending([5]) == ... | {
"split": "train",
"index": 79160,
"acecode_id": "evol_17547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of compute nodes represented by their states in a string format, where each node can be in one of the following states: 'idle', 'busy', or 'offline'. Your task is to implement a function `validate_compute_nodes(compute_nodes: List[str], expected_state: str)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_compute_nodes(['idle', 'idle', 'idle'], 'idle') == True\", \"assert validate_compute_nodes(['busy', 'busy', 'busy'], 'busy') == True\", \"assert validate_compute_nodes(['offline', 'offline'], 'offline') == True\", \"assert validate_compute_nodes(['i... | {
"split": "train",
"index": 79161,
"acecode_id": "bigcode_python_fns_42755",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of user dictionaries, each containing information about a user such as their username, ID, and URL, write a function `examine_user_info(users: List[Dict[str, Any]]) -> List[str]` that returns a list of formatted strings. Each string should contain the user's ID and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert examine_user_info([{'id': 1, 'username': 'user1'}, {'id': 2, 'username': 'user2'}]) == ['User ID: 1, Username: user1', 'User ID: 2, Username: user2']\", \"assert examine_user_info([{'id': 3, 'username': 'user3'}]) == ['User ID: 3, Username: user3']\", \"asse... | {
"split": "train",
"index": 79162,
"acecode_id": "evol_31224",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of data elements, where each data element has a method `to_verbose_dict()` that returns a dictionary containing its verbose information. Your task is to implement a function `to_verbose_list(data_elements: List[DataElement]) -> List[dict]` that returns a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_verbose_list([DataElement('A'), DataElement('B')]) == [{'name': 'A'}, {'name': 'B'}]\", \"assert to_verbose_list([DataElement('X'), DataElement('Y'), DataElement('Z')]) == [{'name': 'X'}, {'name': 'Y'}, {'name': 'Z'}]\", \"assert to_verbose_list([]) == []... | {
"split": "train",
"index": 79163,
"acecode_id": "oss_21234",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages the ratings for books by users. The function should accept a list of ratings and a user ID, and return a dictionary where the keys are the book IDs and the values are the most recent ratings given by that user. If a user has ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_ratings([(1, 101, 5), (2, 102, 4), (1, 101, 3)], 1) == {101: 3}\", \"assert manage_ratings([(1, 101, 5), (1, 102, 4), (1, 101, 3)], 1) == {101: 3, 102: 4}\", \"assert manage_ratings([(1, 101, 5), (1, 102, 4)], 2) == {}\", \"assert manage_ratings([(1, ... | {
"split": "train",
"index": 79164,
"acecode_id": "bigcode_python_fns_10233",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of dictionaries. Each dictionary represents a record containing an 'id' and a 'name'. Your task is to implement the function `process_records` that takes in this list of dictionaries and performs the following... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_records([{'id': 1, 'name': 'John', 'status': 'processing'}, {'id': 2, 'name': 'Alice'}, {'id': 3, 'name': 'Bob', 'status': 'invalid_status'}, {'id': 4, 'name': 'Eve', 'status': 'completed'}]) == [{'id': 1, 'name': 'John', 'status': 'processing'}, {'i... | {
"split": "train",
"index": 79165,
"acecode_id": "oss_14424",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given three numerical values: a close price of a stock, its yearly high price, and its yearly low price. Your task is to implement a function `calculate_percentage_change(close_price: float, yearly_high_price: float, yearly_low_price: float) -> dict` that calculates the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_percentage_change(150, 200, 100) == {'high_change': -25.0, 'low_change': 50.0}\", \"assert calculate_percentage_change(200, 200, 100) == {'high_change': 0.0, 'low_change': 100.0}\", \"assert calculate_percentage_change(100, 200, 100) == {'high_chan... | {
"split": "train",
"index": 79166,
"acecode_id": "oss_28847",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a tri-dimensional array characterized by its p layers, m horizontal lines, and n vertical lines. Each layer contains negative, positive, and zero values. Implement a function that reorders the layers in ascending order based on the sum of their respective non-nega... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_and_sort_3D_array([[[1, -2, 3], [4, -5, 0], [7, 8, -9]], [[10, 11, -12], [13, -14, 0]]]) == [1, 3, 4, 0, 7, 8, 10, 11, 13, 0]\", \"assert flatten_and_sort_3D_array([[[1, 2, 3]], [[-1, -2, -3]], [[4, 5, 6]]]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten_... | {
"split": "train",
"index": 79167,
"acecode_id": "evol_20519",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of training metrics and their corresponding validation metrics, write a function `get_best_metric(metrics: List[Dict[str, float]]) -> Tuple[str, float]` that returns the name of the metric with the highest validation value and the corresponding validation value its... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_best_metric([{'name': 'accuracy', 'train': 0.8, 'validation': 0.85}, {'name': 'loss', 'train': 0.5, 'validation': 0.3}]) == ('accuracy', 0.85)\", \"assert get_best_metric([{'name': 'bce', 'train': 0.6, 'validation': 0.7}, {'name': 'cce', 'train': 0.3, 'v... | {
"split": "train",
"index": 79168,
"acecode_id": "bigcode_python_fns_13881",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the value of a specified attribute from a given object. The function should take two parameters: an object and a string representing the attribute name. If the attribute exists on the object, return its value; otherwise, re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_attribute_value({'foo': 42}, 'foo') == 42\", \"assert get_attribute_value({'a': 1, 'b': 2}, 'b') == 2\", \"assert get_attribute_value({'x': 10, 'y': 20}, 'z') == None\", \"assert get_attribute_value({'name': 'John'}, 'name') == 'John'\", \"assert get_att... | {
"split": "train",
"index": 79169,
"acecode_id": "bigcode_python_fns_362",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target integer. Your task is to determine if there are any two distinct integers in the list that sum up to the target integer. Implement a function `two_sum(nums: List[int], target: int) -> bool` that returns True if such a pair exists, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert two_sum([1, 2, 3, 4, 5], 9) == True\", \"assert two_sum([10, 15, 3, 7], 17) == True\", \"assert two_sum([1, 2, 3, 4, 5], 10) == False\", \"assert two_sum([1, 2, 3, 4, 5], 2) == False\", \"assert two_sum([0, -1, 2, -3, 1], -2) == True\", \"assert two_sum([5, ... | {
"split": "train",
"index": 79170,
"acecode_id": "bigcode_python_fns_18029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple music player interface. The function should accept a list of song names and a command. The command can be one of the following: 'play', 'pause', 'stop', or 'next'. Depending on the command, the function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert music_player_interface(['Shape of You'], 'play') == 'Playing Shape of You'\", \"assert music_player_interface(['Shape of You'], 'pause') == 'Pausing the current song'\", \"assert music_player_interface(['Shape of You'], 'stop') == 'Stopping the current song'... | {
"split": "train",
"index": 79171,
"acecode_id": "oss_23085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to perform arithmetic operations on intervals. An interval is defined by its lower and upper bounds. Your function should take two intervals as input and return the result of adding and subtracting these intervals as two separate inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interval_arithmetic((-2, 2), (1, 3)) == [(-1, 5), (-5, 1)]\", \"assert interval_arithmetic((10, 20), (5, 15)) == [(15, 35), (-5, 15)]\", \"assert interval_arithmetic((0, 0), (0, 0)) == [(0, 0), (0, 0)]\", \"assert interval_arithmetic((1, 1), (2, 3)) == [(3, ... | {
"split": "train",
"index": 79172,
"acecode_id": "oss_35913",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `add_authorization_entry` that takes a dictionary of options and returns a new dictionary representing an authorization entry. The function should accept a dictionary named `opts` with the following possible keys: `connection`, `domain`, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_authorization_entry({'connection': None}) == {'error': 'VOLTTRON is not running. This command requires VOLTTRON platform to be running.'}\", \"assert add_authorization_entry({'connection': 'active'}) == {'error': 'No options specified, interactive wizard... | {
"split": "train",
"index": 79173,
"acecode_id": "bigcode_python_fns_29330",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `data` that represents a nested structure, and a string `jsonpath` that specifies a path to extract a value from that nested structure. The `jsonpath` is represented in a dot notation format where each part of the path is separated by a dot (e.g., '.f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jsonpath_extract({'foo': {'bar': {'baz': 42}}}, '.foo.bar.baz') == 42\", \"assert jsonpath_extract({'a': {'b': {'c': 'hello'}}}, '.a.b.c') == 'hello'\", \"assert jsonpath_extract({'x': {'y': {'z': 100}}}, '.x.y.z') == 100\", \"assert jsonpath_extract({'data'... | {
"split": "train",
"index": 79174,
"acecode_id": "bigcode_python_fns_27778",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries representing share networks with details such as 'id', 'name', 'project_id', and 'created_at', implement a function `filter_share_networks(networks: List[Dict[str, Union[str, int]]], project_id: str, created_since: str, created_before: str) -> List[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_share_networks([{'id': '1', 'name': 'Net1', 'project_id': 'proj1', 'created_at': '2023-01-01'}, {'id': '2', 'name': 'Net2', 'project_id': 'proj2', 'created_at': '2023-01-02'}], 'proj1', '2022-12-31', '2023-01-02') == [{'id': '1', 'name': 'Net1', 'proj... | {
"split": "train",
"index": 79175,
"acecode_id": "bigcode_python_fns_47812",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the cosine similarity between two vectors of equal length. The cosine similarity is defined as the dot product of the two vectors divided by the product of the magnitudes of the two vectors. Your implementation should take in two lists of numbers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_cosine_similarity([1, 2, 3], [4, 5, 6]) == 0.9746318461970762\", \"assert calculate_cosine_similarity([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert calculate_cosine_similarity([1, 0, 0], [0, 1, 0]) == 0.0\", \"assert calculate_cosine_similarity([1, 2, 3... | {
"split": "train",
"index": 79176,
"acecode_id": "oss_21281",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples representing probabilities for actions in a game state, convert this into a dictionary where each key is a string representation of the state and the value is a list of (action, probability) pairs. Each input state is represented as a tuple where the firs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_policy_to_dict([('state1', {'action1': 0.5, 'action2': 0.5}), ('state2', {'action1': 0.3, 'action2': 0.7})]) == {'state1': [('action1', 0.5), ('action2', 0.5)], 'state2': [('action1', 0.3), ('action2', 0.7)]}\", \"assert convert_policy_to_dict([('sta... | {
"split": "train",
"index": 79177,
"acecode_id": "bigcode_python_fns_29263",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the names of unique groups based on material information. Each material has a group ID and a group name associated with it. Your function should take a list of tuples, where each tuple contains a material's group ID and its... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_group_names([(1, 'A'), (2, 'B'), (1, 'A'), (3, 'C'), (2, 'B')]) == ['A', 'B', 'C']\", \"assert get_unique_group_names([(1, 'X'), (1, 'X'), (1, 'Y')]) == ['X', 'Y']\", \"assert get_unique_group_names([]) == []\", \"assert get_unique_group_names([(1... | {
"split": "train",
"index": 79178,
"acecode_id": "bigcode_python_fns_23187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_armstrong(n: int) -> bool` that determines whether the provided integer `n` is an Armstrong number. An Armstrong number (also known as a narcissistic number) is a number that is equal to the sum of its own digits each raised to the power of the number o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_armstrong(0) == True\", \"assert is_armstrong(1) == True\", \"assert is_armstrong(2) == True\", \"assert is_armstrong(3) == True\", \"assert is_armstrong(4) == True\", \"assert is_armstrong(5) == True\", \"assert is_armstrong(6) == True\", \"assert is_arm... | {
"split": "train",
"index": 79179,
"acecode_id": "evol_14101",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a read-only permission code name based on a given model name. The generated permission code name should be formatted by appending the model name to a predefined prefix string 'READ_ONLY' with an underscore separating them. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_read_only_permission_codename('User') == 'READ_ONLY_User'\", \"assert get_read_only_permission_codename('Product') == 'READ_ONLY_Product'\", \"assert get_read_only_permission_codename('Order') == 'READ_ONLY_Order'\", \"assert get_read_only_permission_cod... | {
"split": "train",
"index": 79180,
"acecode_id": "bigcode_python_fns_7074",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the coefficients and powers of a polynomial function f(x) = ax^m + bx^n + c, implement a function that computes its derivative f'(x). The function should take five parameters: a, m, b, n, and c, where a, b are the coefficients (floats or integers), and m, n are the powers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert derivative(1, 5, 2, 3, 1) == '5*x**4 + 6*x**2'\", \"assert derivative(0, 0, 0, 0, 0) == '0'\", \"assert derivative(1, 0, 0, 0, 0) == '0'\", \"assert derivative(1, 5, 0, 0, 1) == '5*x**4'\", \"assert derivative(3, 4, 0, 0, 1) == '12*x**3'\", \"assert derivati... | {
"split": "train",
"index": 79181,
"acecode_id": "evol_26518",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents the contents of a JavaScript file. Your task is to implement a function that counts the number of times a specific keyword appears in the string. The function should be case-sensitive. You need to write a function `count_keyword_in_js_file... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_keyword_in_js_file('const a = 5; const b = 10; const sum = a + b;', 'const') == 3\", \"assert count_keyword_in_js_file('function test() {} function test2() {}', 'function') == 2\", \"assert count_keyword_in_js_file('let x = 10; let y = 20; let result =... | {
"split": "train",
"index": 79182,
"acecode_id": "bigcode_python_fns_15159",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_multiple(n: int, m: int) -> bool` that determines whether the integer `n` is a multiple of the integer `m`. A number `n` is considered a multiple of `m` if there exists an integer `k` such that `n = k * m`. The function should return `True` if `n` is a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_multiple(10, 5) == True\", \"assert is_multiple(10, 3) == False\", \"assert is_multiple(0, 5) == True\", \"assert is_multiple(5, 1) == True\", \"assert is_multiple(-10, 5) == True\", \"assert is_multiple(-10, -5) == True\", \"assert is_multiple(10, -5) ==... | {
"split": "train",
"index": 79183,
"acecode_id": "evol_27440",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a configuration for an OpenResty server. Your goal is to implement a function that replaces specific placeholders in two configuration files, `nginx.conf` and `app.lua`. The function should take three parameters: 1) `database_host`: a string represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_placeholders('localhost', 4, {'nginx_conf': 'worker_processes THREADS;', 'app_lua': 'host = DBHOSTNAME;'}) == ('worker_processes 4;', 'host = localhost;')\", \"assert replace_placeholders('127.0.0.1', 8, {'nginx_conf': 'worker_processes THREADS; even... | {
"split": "train",
"index": 79184,
"acecode_id": "oss_9620",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the application of a regularization parameter in a machine learning model. Your function should accept a single floating-point number as input, representing the regularization parameter, and return a string indicating t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_regularization(0.01) == 'Regularization parameter: 0.01\\\\nApplying regularization parameter in the machine learning model...'\", \"assert apply_regularization(0.1) == 'Regularization parameter: 0.1\\\\nApplying regularization parameter in the machine... | {
"split": "train",
"index": 79185,
"acecode_id": "oss_7372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that determines if the total sum of all integers in a list falls within a specified inclusive range, and if the average of those integers exceeds a given threshold. The function should take a list of integers, a lower bound, an upper bound, and a min... | 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([], 0, 10, 0) == False\", \"assert sum_within_bounds_and_average([-1, -2, -3], ... | {
"split": "train",
"index": 79186,
"acecode_id": "evol_29565",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a dictionary representation of a spider class. The function should take no parameters and return a dictionary with the following characteristics: the key 'name' should have the value 'sc_curitibanos', the key 'FECAM_QUERY' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_spider_dict() == {'name': 'sc_curitibanos', 'FECAM_QUERY': 'cod_entidade:82', 'TERRITORY_ID': '4204806'}\", \"assert create_spider_dict()['name'] == 'sc_curitibanos'\", \"assert create_spider_dict()['FECAM_QUERY'] == 'cod_entidade:82'\", \"assert crea... | {
"split": "train",
"index": 79187,
"acecode_id": "oss_4866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that receives a list of species names and a list of data source IDs, and returns a dictionary where each species name is associated with its corresponding data source ID. The function should resolve the species names against the provi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resolve_species(['Lion', 'Tiger'], ['DS1', 'DS2']) == {'Lion': 'DS1', 'Tiger': 'DS2'}\", \"assert resolve_species('Lion', ['DS1', 'DS2']) == {'Lion': 'DS1'}\", \"assert resolve_species([], ['DS1', 'DS2']) == {}\", \"assert resolve_species('Tiger', []) == {'T... | {
"split": "train",
"index": 79188,
"acecode_id": "bigcode_python_fns_5018",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a string of words. Write a Python function that computes the total number of unique monosyllabic words present in this string. A monosyllabic word is defined as a word containing exactly one vowel. The vowels are 'a', 'e', 'i', 'o', and 'u'. Your function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_monosyllabic_words('I have a cat') == 2\", \"assert count_unique_monosyllabic_words('One fish two fish red fish blue fish') == 4\", \"assert count_unique_monosyllabic_words('A bee sees a tree') == 1\", \"assert count_unique_monosyllabic_words('S... | {
"split": "train",
"index": 79189,
"acecode_id": "evol_15832",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that sorts an array of tuples containing fruit names, botanical families, and nutrient values. The sorting should be done primarily by the botanical family in descending order, then by the fruit name in alphabetical order (also descending), and final... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([('banana', 'Musaceae', 96), ('banana', 'Musaceae', 88), ('banana', 'Musaceae', 92)]) == [('banana', 'Musaceae', 96), ('banana', 'Musaceae', 92), ('banana', 'Musaceae', 88)]\", \"assert bubble_sort([('lime', 'Rutaceae', 30), ('lime', 'Rutaceae', ... | {
"split": "train",
"index": 79190,
"acecode_id": "evol_8159",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing metrics for a model evaluation. The dictionary has keys representing different evaluation metrics and their corresponding values. Your task is to implement a function that extracts specific metrics from this dictionary. The metrics you need... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_metrics({'test/f1': 0.8, 'test/precision': 0.75, 'test/recall': 0.85, 'test/loss': 0.5}) == [0.8, 0.75, 0.85, 0.5]\", \"assert get_metrics({'test/f1': 0.9, 'test/precision': 0.85}) == [0.9, 0.85, None, None]\", \"assert get_metrics({'test/loss': 0.2, 'te... | {
"split": "train",
"index": 79191,
"acecode_id": "bigcode_python_fns_31166",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates retrieving values from a simple computer system's memory based on a provided instruction and its parameter modes. The memory is represented as a list of integers. Each instruction is represented as an integer that conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_value(1002, 1, 0, [5, 10, 15]) == 10\", \"assert get_value(2000, 0, 1, [5, 10, 15]) == 5\", \"assert get_value(1001, 2, 0, [0, 1, 2, 3]) == 2\", \"assert get_value(1100, 0, 0, [0, 1, 2]) == 0\", \"assert get_value(1001, 1, 0, [0, 1, 2]) == 1\", \"assert ... | {
"split": "train",
"index": 79192,
"acecode_id": "oss_2451",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where the keys are package identifiers (strings) and the values are package sizes (integers), write a function `calculate_average(package_sizes: Dict[str, int]) -> float` that calculates the average size of the packages. If the dictionary is empty, the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average({'pkg1': 10, 'pkg2': 20, 'pkg3': 30}) == 20.0\", \"assert calculate_average({'pkgA': 5, 'pkgB': 15}) == 10.0\", \"assert calculate_average({'item1': 100, 'item2': 200, 'item3': 300, 'item4': 400}) == 250.0\", \"assert calculate_average({'sm... | {
"split": "train",
"index": 79193,
"acecode_id": "bigcode_python_fns_48434",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that logs a message indicating the completion of a task. The function should take a single input parameter, `outputlabel`, which is a string representing the message to be logged. The function should return a string 'Done' followed by the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_task_completion('Task 1 completed') == 'Done Task 1 completed'\", \"assert log_task_completion('Upload finished') == 'Done Upload finished'\", \"assert log_task_completion('Download successful') == 'Done Download successful'\", \"assert log_task_completi... | {
"split": "train",
"index": 79194,
"acecode_id": "bigcode_python_fns_28050",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the control of a smart home device that manages the charging of a battery. The device's operation is determined by the state of the battery, which is indicated by a boolean value. Your goal is to write a Python function that takes the state of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert control_relay(True) == 'Activate relay'\", \"assert control_relay(False) == 'Continue charging'\", \"assert control_relay(True) == 'Activate relay'\", \"assert control_relay(False) == 'Continue charging'\", \"assert control_relay(True) == 'Activate relay'\",... | {
"split": "train",
"index": 79195,
"acecode_id": "oss_2802",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `choose_game(name: str, age: int) -> str` that takes a person's name and age as input and returns the name of the game they should play based on their age. If the age is less than 18, they should play 'FrogWorld'. If the age is 18 or olde... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert choose_game('Alice', 17) == 'FrogWorld'\", \"assert choose_game('Bob', 18) == 'WizardWorld'\", \"assert choose_game('Charlie', 15) == 'FrogWorld'\", \"assert choose_game('Diana', 30) == 'WizardWorld'\", \"assert choose_game('', 10) == 'Invalid name'\", \"ass... | {
"split": "train",
"index": 79196,
"acecode_id": "bigcode_python_fns_17472",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a boolean value `v`, implement a function `inf_set_mark_code(v: bool) -> bool` that simulates setting a mark code based on the input value. If `v` is True, the function should return True indicating that the mark code was successfully set. If `v` is False, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inf_set_mark_code(True) == True\", \"assert inf_set_mark_code(False) == False\", \"assert inf_set_mark_code(True) == True\", \"assert inf_set_mark_code(False) == False\", \"assert inf_set_mark_code(True) == True\", \"assert inf_set_mark_code(False) == False\... | {
"split": "train",
"index": 79197,
"acecode_id": "bigcode_python_fns_27110",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates setting the migration status to 'FAILED'. The function should accept two parameters: a dictionary representing a migration configuration and a logger object. The migration configuration dictionary will contain the following... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert failed({'MIGRATION_ID': '123', 'PROJECT_DIR': 'my_project', 'MIGRATIONS_DIR': 'migrations'}, MockLogger()) == True\", \"assert failed({'MIGRATION_ID': '456', 'PROJECT_DIR': 'my_project', 'MIGRATIONS_DIR': 'migrations'}, MockLogger()) == True\", \"assert fail... | {
"split": "train",
"index": 79198,
"acecode_id": "bigcode_python_fns_19326",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string of numerical values separated by commas, implement a function that takes this string as input, removes any duplicate values, and returns a list of the unique numerical values in random order. The input string will only contain integer values. For example, if the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_values('1, 3, 3, 7, 9, 9') != rearrange_values('1, 3, 3, 7, 9, 9')\", \"assert sorted(rearrange_values('1, 2, 2, 3')) == [1, 2, 3]\", \"assert sorted(rearrange_values('5, 5, 5, 5')) == [5]\", \"assert sorted(rearrange_values('10, 20, 20, 10, 30')) ... | {
"split": "train",
"index": 79199,
"acecode_id": "evol_542",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.