data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a job status management system for a distributed computing environment. The system should support various job lifecycle states: 'STOPPED', 'RUNNING', 'COMPLETED', and 'FAILED'. Your task is to implement a function `update_job_status(current_stat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_job_status('RUNNING', 'STOPPED', 'Stop triggered by the cleaning hook.') == 'Invalid transition from RUNNING to STOPPED'\", \"assert update_job_status('STOPPED', 'RUNNING', 'Starting job.') == 'Status updated to RUNNING - Starting job.'\", \"assert up... | {
"split": "train",
"index": 83200,
"acecode_id": "oss_14781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to process data from a group of motors. The function should check if the data for a specific motor is available and then perform further processing based on the availability of the data. You need to implement a Python function `proces... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_motor_data(1, 100, 4, mock_group_sync_read) == 'Data not available'\", \"assert process_motor_data(2, 101, 4, mock_group_sync_read) == 50\", \"assert process_motor_data(4, 103, 4, mock_group_sync_read) == 'Data not available'\", \"assert process_moto... | {
"split": "train",
"index": 83201,
"acecode_id": "oss_24282",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_to_n(n)` that computes the sum of all integers from n down to 1. The function should terminate early if the total sum exceeds 10000. If n is less than or equal to 0, the function should return 0.\nPlease reason step by step, then write a self-contained Pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_to_n(0) == 0\", \"assert sum_to_n(-5) == 0\", \"assert sum_to_n(1) == 1\", \"assert sum_to_n(2) == 3\", \"assert sum_to_n(3) == 6\", \"assert sum_to_n(4) == 10\", \"assert sum_to_n(5) == 15\", \"assert sum_to_n(10) == 55\", \"assert sum_to_n(14) == 105\"... | {
"split": "train",
"index": 83202,
"acecode_id": "evol_14911",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given an image represented as a 3D tensor with dimensions (channels, height, width). Your task is to compute a binary mask indicating the regions of the image where the gradient of the pixel values is greater than zero. Implement a function `compute_gradient_mask(image:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_gradient_mask([[[1, 2], [3, 4]]]) == [[[1, 1], [1, 1]]]\", \"assert compute_gradient_mask([[[0, 0], [0, 0]]]) == [[[0, 0], [0, 0]]]\", \"assert compute_gradient_mask([[[1, 2], [2, 1]]]) == [[[1, 1], [1, 1]]]\", \"assert compute_gradient_mask([[[1, 3]... | {
"split": "train",
"index": 83203,
"acecode_id": "bigcode_python_fns_34503",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes two parameters: an integer 'a' and an optional integer 'b'. If 'b' is not provided, it defaults to 0. The function should return the sum of 'a' and 'b'.\nPlease reason step by step, then write a self-contained Python solution. Give your final progra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert my_function(10) == 10\", \"assert my_function(5, 3) == 8\", \"assert my_function(0) == 0\", \"assert my_function(-1, 1) == 0\", \"assert my_function(15, 5) == 20\", \"assert my_function(2, 2) == 4\", \"assert my_function(-10) == -10\", \"assert my_function(1... | {
"split": "train",
"index": 83204,
"acecode_id": "evol_6510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a second order recurrence relation defined as follows: G_k = G_{k-1} + G_{k-2}, with G_1 = 1 and G_2 = 4, generate the first 'n' terms of the sequence. Implement a function that takes an integer 'n' (1 <= n <= 30) as input and returns a list containing the first 'n' terms... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert golden_nuggets(1) == [1]\", \"assert golden_nuggets(2) == [1, 4]\", \"assert golden_nuggets(3) == [1, 4, 5]\", \"assert golden_nuggets(4) == [1, 4, 5, 9]\", \"assert golden_nuggets(5) == [1, 4, 5, 9, 14]\", \"assert golden_nuggets(6) == [1, 4, 5, 9, 14, 23]\... | {
"split": "train",
"index": 83205,
"acecode_id": "evol_23667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the retrieval of configuration values from an INI file format. Your function should take three parameters: a list of strings representing the lines of the configuration file, a string representing the section name, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_config_value(['[common]', 'database=example_db', 'server=example_server', '[advanced]', 'timeout=5000'], 'common', 'database') == 'example_db'\", \"assert parse_config_value(['[common]', 'database=example_db', 'server=example_server', '[advanced]', 'ti... | {
"split": "train",
"index": 83206,
"acecode_id": "oss_18757",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that returns the common unique elements from two inputted lists, arranged in increasing sequence. The function should handle both integers and strings, combining the common unique strings in lexicographical order. However, you must avoid using any Python built... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shared_elements([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653]\", \"assert shared_elements(['apple', 'banana', 'pear'], ['pear', 'apple', 'plum']) == ['apple', 'pear']\", \"assert shared_elements([10, 20, 30], [30, 40, 50]) == [30]\", \"... | {
"split": "train",
"index": 83207,
"acecode_id": "evol_3968",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that verifies the behavior of a method called `GetFormatStringAttributeNames`. This method should return a predefined list of attribute names related to network data usage events. Your task is to create a Python function `validate_att... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_attribute_names(SRUMNetworkDataUsageEventFormatter()) == True\", \"assert validate_attribute_names(SRUMNetworkDataUsageEventFormatter()) == True\", \"assert validate_attribute_names(SRUMNetworkDataUsageEventFormatter()) == True\", \"assert validate_... | {
"split": "train",
"index": 83208,
"acecode_id": "oss_6466",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a destination dictionary and one or more source dictionaries. Your task is to merge these dictionaries together such that the values of matching keys are combined into lists. If a key is present in the destination dictionary, its value should be extended with the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_dicts({'a': [1]}, {'a': [2]}) == {'a': [1, 2]}\", \"assert merge_dicts({'x': [10]}, {'x': [20], 'y': [30]}) == {'x': [10, 20], 'y': [30]}\", \"assert merge_dicts({}, {'a': [1]}) == {'a': [1]}\", \"assert merge_dicts({'key': []}, {'key': [1], 'another_k... | {
"split": "train",
"index": 83209,
"acecode_id": "bigcode_python_fns_18225",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing text data to extract specific information related to minerals, ages, and locations. Write a Python function `process_text_data(minerallist, lemmas, ners)` that takes three input parameters: `minerallist`, a list of minerals; `lemmas`, a list of le... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_text_data(['gold', 'silver', 'copper'], ['gold', 'silver'], ['gold', 'AGE', 'LOCATION']) == (['gold', 'silver'], ['AGE'], ['LOCATION'])\", \"assert process_text_data(['platinum'], ['platinum'], ['platinum', 'AGE']) == (['platinum'], ['AGE'], [])\", \... | {
"split": "train",
"index": 83210,
"acecode_id": "oss_7643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing an email address, implement a function `validate_email(email_str: str) -> bool` that checks if the email address is valid based on the following rules: 1. The local part (before the '@') can contain lowercase letters, digits, and special characters (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email('test.email@example.com') == True\", \"assert validate_email('user.name+tag+sorting@example.com') == True\", \"assert validate_email('user@sub.example.com') == True\", \"assert validate_email('user@.com') == False\", \"assert validate_email('u... | {
"split": "train",
"index": 83211,
"acecode_id": "bigcode_python_fns_27759",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that processes an input string to extract specific information. If the string contains multiple components separated by spaces, commas, semicolons, or asterisks, return a list of those components. If the string is entirely made up of uppercase letters, retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_data('Good morning!') == ['Good', 'morning!']\", \"assert extract_data('Good;morning!') == ['Good', 'morning!']\", \"assert extract_data('Good*morning') == ['Good', 'morning']\", \"assert extract_data('ABCDE') == 3\", \"assert extract_data('HELLO') =... | {
"split": "train",
"index": 83212,
"acecode_id": "evol_32976",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to preprocess a dictionary of data based on certain language-specific parameters. The function `preprocess` takes two parameters: `data`, a dictionary containing data to be preprocessed, and `lang`, a string representing the language ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert preprocess({'arg_negate': True}, 'en') == {'arg_negate': True, 'arg_is_regex': False}\", \"assert preprocess({'arg_is_regex': True}, 'en') == {'arg_negate': False, 'arg_is_regex': True}\", \"assert preprocess({'arg_negate': False, 'arg_is_regex': False}, 'en... | {
"split": "train",
"index": 83213,
"acecode_id": "oss_14169",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a zero-indexed array A of N integers, return the total count of arithmetic subsequence slices in the array A. A subsequence slice (P0, P1, ..., Pk) of array A is deemed arithmetic if the sequence A[P0], A[P1], ..., A[Pk] is arithmetic, meaning it has at least three elemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numberOfArithmeticSlices([1, 3, 6, 9]) == 0\", \"assert numberOfArithmeticSlices([3, 1, 2, 5, 7]) == 0\", \"assert numberOfArithmeticSlices([]) == 0\", \"assert numberOfArithmeticSlices([1]) == 0\", \"assert numberOfArithmeticSlices([1, 2]) == 0\", \"assert ... | {
"split": "train",
"index": 83214,
"acecode_id": "evol_30338",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates updating a traffic class configuration. The function should accept a traffic class name, its type, and a dictionary of additional parameters. The traffic class type should be one of 'ipv4', 'ipv6', or 'mac'. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_traffic_class('classA', 'ipv4', {}) is not None\", \"assert update_traffic_class('classB', 'ipv6', {}) is not None\", \"assert update_traffic_class('classC', 'mac', {}) is not None\", \"assert update_traffic_class('classD', 'ipv4', {'extra_param': 123... | {
"split": "train",
"index": 83215,
"acecode_id": "bigcode_python_fns_5021",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `historical` and `simulation`, both containing the same number of elements. Your task is to write a function that adjusts the values in the `simulation` list by adding the average of the corresponding values in the `historical` list to each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_simulation([0, 0, 0], [5, 5, 5]) == [5, 5, 5]\", \"assert adjust_simulation([10, 10, 10], [0, 0, 0]) == [10, 10, 10]\", \"assert adjust_simulation([5, 5, 5], [5, 5, 5]) == [10, 10, 10]\", \"assert adjust_simulation([0], [0]) == [0]\", \"assert adjust_... | {
"split": "train",
"index": 83216,
"acecode_id": "bigcode_python_fns_45119",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function called `nth_power` that takes a list of numbers and an integer n as inputs, and returns a new list containing each number raised to the power of n. Your function should raise a ValueError if the input list contains any non-numeric values or if n is not an integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nth_power([2, 3, 4], 2) == [4, 9, 16]\", \"assert nth_power([1, 2, 3], 3) == [1, 8, 27]\", \"assert nth_power([0, -1, 1], 5) == [0, -1, 1]\", \"assert nth_power([1.5, 2.5, 3.5], 2) == [2.25, 6.25, 12.25]\", \"assert nth_power([2, 2, 2], 0) == [1, 1, 1]\", \"... | {
"split": "train",
"index": 83217,
"acecode_id": "evol_15949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D array of integers, implement a function `sum_sub_array(arr, start_row, end_row, start_col, end_col)` that calculates the sum of a subarray defined by the specified row and column indices. The function should raise a ValueError if the array does not contain only lists... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_sub_array([[1, 2], [3, 4]], 0, 2, 0, 2) == 10\", \"assert sum_sub_array([[1, 2, 3], [4, 5, 6]], 0, 2, 0, 3) == 21\", \"assert sum_sub_array([[1, -1], [-1, 1]], 0, 1, 0, 2) == 0\", \"assert sum_sub_array([[0]], 0, 1, 0, 1) == 0\", \"assert sum_sub_array([... | {
"split": "train",
"index": 83218,
"acecode_id": "evol_25920",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a queue that supports standard enqueue and dequeue operations, as well as a method to retrieve the minimum element currently in the queue in constant time, O(1). You need to implement a function `min_queue_operations(operations: List[Tuple[str, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_queue_operations([('enqueue', 2), ('enqueue', 5), ('enqueue', 1), ('minimum', None)]) == [1]\", \"assert min_queue_operations([('enqueue', 1), ('enqueue', 1), ('enqueue', 1), ('minimum', None)]) == [1]\", \"assert min_queue_operations([('enqueue', 3), ('... | {
"split": "train",
"index": 83219,
"acecode_id": "oss_18444",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Lowest Common Multiple (LCM) of all integers in a list. The function should handle errors for non-integer elements and ensure that all integers are non-negative. If any element is negative or not an integer, the function should raise a V... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lowest_common_multiple([3, 5, 4]) == 60\", \"assert lowest_common_multiple([1, 2, 3, 4, 5]) == 60\", \"assert lowest_common_multiple([2, 4, 6, 8]) == 24\", \"assert lowest_common_multiple([7, 14, 21]) == 42\", \"assert lowest_common_multiple([5, 10, 15]) == ... | {
"split": "train",
"index": 83220,
"acecode_id": "evol_5561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a context dictionary that contains information about a file encoding. The context contains a key 'enc' that specifies the encoding type and a key 'root' which is another dictionary. The 'root' dictionary has an 'in' key representing the input file path and an 'enc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_encoding({'enc': 'arbenc', 'root': {'in': 'inpathhere', 'encoding': '{enc}'}}) == ('inpathhere', 'arbenc', 'arbenc')\", \"assert process_encoding({'enc': 'utf-8', 'root': {'in': 'file.txt', 'encoding': '{enc}'}}) == ('file.txt', 'utf-8', 'utf-8')\", ... | {
"split": "train",
"index": 83221,
"acecode_id": "bigcode_python_fns_10574",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing folder paths in a storage system. Each folder path is represented as a string with components separated by a forward slash (e.g., 'folder1/folder2/folder3'). Your task is to implement a function that returns a list of unique top-leve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_top_level_folders(['folder1/folder2', 'folder1/folder3', 'folder2/folder4']) == ['folder1', 'folder2']\", \"assert list_top_level_folders(['folder1/', 'folder2/folder3', 'folder1/folder4']) == ['folder1', 'folder2']\", \"assert list_top_level_folders(['... | {
"split": "train",
"index": 83222,
"acecode_id": "bigcode_python_fns_30525",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that reverses a given string by a specified number of characters to the right direction. The function should modify the string in place and handle negative reversal values, indicating reversal to the left. The function should also correctly process reversal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello', 2) == 'lohel'\", \"assert reverse_string('abcdef', 6) == 'abcdef'\", \"assert reverse_string('python', 0) == 'python'\", \"assert reverse_string('python', -6) == 'python'\", \"assert reverse_string('a', 1) == 'a'\", \"assert reverse_s... | {
"split": "train",
"index": 83223,
"acecode_id": "evol_31529",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of distinct integers, write a function that returns the first n distinct permutations of the list. The function should take two parameters: a list of integers `arr` and an integer `n`. If `n` is greater than the total number of distinct permutations, return all dis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_permutations([1, 2, 3], 6) == [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]\", \"assert get_permutations([1, 2], 3) == [[1, 2], [2, 1]]\", \"assert get_permutations([1], 1) == [[1]]\", \"assert get_permutations([], 5) == [[]]\", \"as... | {
"split": "train",
"index": 83224,
"acecode_id": "evol_1293",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a workprogress ID, write a function to retrieve a list of transform IDs associated with that workprogress. You need to implement a function called `get_transform_ids(workprogress_id: int) -> List[int]` that takes a single parameter, `workprogress_id`, which is a positive ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_transform_ids(1) == [101, 102]\", \"assert get_transform_ids(2) == [201]\", \"assert get_transform_ids(3) == []\", \"assert get_transform_ids(4) == []\", \"assert get_transform_ids(5) == []\", \"assert get_transform_ids(1) != [201]\", \"assert get_transf... | {
"split": "train",
"index": 83225,
"acecode_id": "bigcode_python_fns_40287",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing an event related to a container. The dictionary contains two keys: 'from' and 'time'. The value associated with 'from' is a string that may or may not contain a colon ':'. Your task is to implement a function that extracts the image name ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_event_details({'from': 'ubuntu', 'time': '2023-10-01T12:00:00Z'}) == ('ubuntu:latest', '2023-10-01T12:00:00Z')\", \"assert get_event_details({'from': 'python:3.8', 'time': '2023-10-02T15:30:00Z'}) == ('python:3.8', '2023-10-02T15:30:00Z')\", \"assert get... | {
"split": "train",
"index": 83226,
"acecode_id": "bigcode_python_fns_18361",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that computes the area of a triangle given the lengths of its three sides. The function should validate that the sides can form a legal triangle (the sum of any two sides must be greater than the third). If the sides do not constitute... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert triangle_area(3, 4, 5) == 6.0000\", \"assert triangle_area(5, 5, 5) == 10.8253\", \"assert triangle_area(1, 1, 1) == 0.4330\", \"assert triangle_area(0, 4, 5) == None\", \"assert triangle_area(3, 3, 6) == None\", \"assert triangle_area(1, 1, 2) == None\", \"... | {
"split": "train",
"index": 83227,
"acecode_id": "evol_13536",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given integer to its corresponding Roman numeral representation. The input will be a positive integer between 1 and 3999 (inclusive). Write a function named `intToRoman` that takes an integer `num` as input and returns its Roman numeral equi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intToRoman(1) == 'I'\", \"assert intToRoman(2) == 'II'\", \"assert intToRoman(3) == 'III'\", \"assert intToRoman(4) == 'IV'\", \"assert intToRoman(5) == 'V'\", \"assert intToRoman(6) == 'VI'\", \"assert intToRoman(7) == 'VII'\", \"assert intToRoman(8) == 'VI... | {
"split": "train",
"index": 83228,
"acecode_id": "evol_33246",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the downloading and storage of Wikidata dump files based on specified parameters. The function `download_wikidata_dumps(version: str, mirror: str, sites_table: bool = True, pages_meta_history: bool = True) -> dict` should t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_wikidata_dumps('20230101', 'https://example.com/mirror', True, True) == {'sites_table': 'sitestabledump', 'pages_meta_history': 'example_page_ids'}\", \"assert download_wikidata_dumps('20230101', 'https://example.com/mirror', True, False) == {'sites... | {
"split": "train",
"index": 83229,
"acecode_id": "oss_3740",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a task description for building a multi-layer perceptron (MLP) model for image classification. Your task is to implement a function that checks if the task description is valid for creating a binary classification MLP model. The task desc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_task_description({'output': {'num_categories': 2, 'type': 'binary'}}) == True\", \"assert validate_task_description({'output': {'num_categories': 3, 'type': 'binary'}}) == True\", \"assert validate_task_description({'output': {'num_categories': 1, '... | {
"split": "train",
"index": 83230,
"acecode_id": "bigcode_python_fns_24588",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes five distinct integers as input and returns the maximum integer among them.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum(3, 4, 8, 1, 5) == 8\", \"assert find_maximum(-1, -2, -3, -4, -5) == -1\", \"assert find_maximum(10, 20, 30, 40, 50) == 50\", \"assert find_maximum(1, 2, 3, 4, 5) == 5\", \"assert find_maximum(100, 200, 300, 400, 500) == 500\", \"assert find_maxi... | {
"split": "train",
"index": 83231,
"acecode_id": "evol_24023",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_phone(phone_number: str) -> bool` that checks if the input string is a valid phone number. A valid phone number must follow the format +1-XXXXXXXXXX, where X is a digit (0-9). The phone number must start with +1- and be followed by exactly 10 digi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_phone('+1-6301021122') == True\", \"assert validate_phone('+1-1234567890') == True\", \"assert validate_phone('+1-9876543210') == True\", \"assert validate_phone('+1-0000000000') == True\", \"assert validate_phone('+1-1111111111') == True\", \"asser... | {
"split": "train",
"index": 83232,
"acecode_id": "evol_10237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts an array of integers and decimals in a unique order. The order starts with the smallest number in the array, followed by the largest remaining number, then the next smallest, and continues alternating between the smallest and largest of the remai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert specialized_BST_sort([1, 2, 3, 4]) == [1, 4, 2, 3]\", \"assert specialized_BST_sort([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert specialized_BST_sort([]) == []\", \"assert specialized_BST_sort([-2, 1.5, 3.5, -1]) == [-2, 3.5, -1, 1.5]\", \"assert specialized_BS... | {
"split": "train",
"index": 83233,
"acecode_id": "evol_19669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a class `PdType` which simulates a model containing parameters. The class has the following methods: `get_shape`, `shape`, and `__getitem__`. Your task is to implement a new method in the `PdType` class called `flatten_params` that returns a list of all the parame... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert PdType([[1, 2], [3, 4]]).flatten_params() == [1, 2, 3, 4]\", \"assert PdType([[5], [6, 7, 8]]).flatten_params() == [5, 6, 7, 8]\", \"assert PdType([[], [1, 2, 3]]).flatten_params() == [1, 2, 3]\", \"assert PdType([[9, 10, 11], []]).flatten_params() == [9, 10... | {
"split": "train",
"index": 83234,
"acecode_id": "oss_5413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of an electrical switch. The function should take a list of boolean values where each value represents the desired state of the switch (True for 'on' and False for 'off'). The function should return a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_switch([True, False, True]) == [True, False, True]\", \"assert simulate_switch([False, False, True]) == [False, False, True]\", \"assert simulate_switch([True, True, False]) == [True, True, False]\", \"assert simulate_switch([False, True, False]) ==... | {
"split": "train",
"index": 83235,
"acecode_id": "oss_20494",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a slug for a given article title. A slug is a URL-friendly version of a string, typically generated by converting the string to lowercase, replacing spaces and special characters with hyphens, and removing any non-alphanume... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_slug('Hello World!') == 'hello-world'\", \"assert generate_slug('A Quick Brown Fox Jumps Over The Lazy Dog') == 'a-quick-brown-fox-jumps-over-the-lazy-dog'\", \"assert generate_slug('Python & Django: The Best Frameworks') == 'python-django-the-best-... | {
"split": "train",
"index": 83236,
"acecode_id": "oss_9992",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom attribute validator in Python. Create a function `validate_attributes` that takes a dictionary of attributes and their values. The function should validate these attributes based on the following criteria: the 'name' attribute must be a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_attributes({'name': 'Alice', 'age': 30}) == True\", \"assert validate_attributes({'name': 'Bob', 'age': 25}) == True\", \"assert validate_attributes({'name': 'Charlie', 'age': 18}) == True\", \"assert validate_attributes({'name': 'Grace', 'age': 50}... | {
"split": "train",
"index": 83237,
"acecode_id": "oss_8442",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a list of strings representing words and returns a dictionary containing the frequency of each unique word in the list. The function should ignore case sensitivity, treating 'Word' and 'word' as the same word. Additional... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency(['apple', 'banana', 'Apple', 'orange', 'banana', 'apple!']) == {'apple': 3, 'banana': 2, 'orange': 1}\", \"assert word_frequency(['hello', 'world', 'Hello', 'WORLD!', 'hello?']) == {'hello': 3, 'world': 2}\", \"assert word_frequency(['test', '... | {
"split": "train",
"index": 83238,
"acecode_id": "oss_8716",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates generating a configuration for a semantic segmentation task based on provided parameters. Your function should take the following arguments: a boolean `nochip`, a boolean `test`, a string `target`, and a list of scene IDs. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_config(True, False, 'buildings', ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']) == {'train_ids': ['1', '2', '3', '4', '5', '6', '7', '8'], 'val_ids': ['9', '10'], 'chip_size': 325}\", \"assert generate_config(False, False, 'buildings', ['1', '... | {
"split": "train",
"index": 83239,
"acecode_id": "bigcode_python_fns_41320",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates and serializes a list of product names. Each product name is represented as a string and should have a maximum length of 200 characters. The function should take a list of product names and return a serialized list of valid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_products(['Product1', 'Product2', 'Product3']) == ['Product1', 'Product2', 'Product3']\", \"assert serialize_products(['ValidProduct', 'AnotherValidProduct']) == ['ValidProduct', 'AnotherValidProduct']\", \"assert serialize_products(['ProductWithVe... | {
"split": "train",
"index": 83240,
"acecode_id": "oss_33444",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary of movie ratings from various users and a new user's movie ratings, implement a function that recommends a specified number of movies for the new user based on user-based filtering. The recommendation should be determined by finding the most similar users and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recommend_movies({1: 4.0, 3: 2.0}, [1], 2, 1, {1: {1: 5.0, 2: 3.0}, 2: {1: 4.0, 2: 2.0}, 3: {2: 5.0, 3: 4.0}}) == [2]\", \"assert recommend_movies({5: 2.0, 6: 5.0}, [5, 6], 3, 2, {1: {5: 5.0, 6: 3.0}, 2: {5: 1.0, 6: 2.0}, 3: {5: 3.0, 6: 4.0}}) == []\", \"ass... | {
"split": "train",
"index": 83241,
"acecode_id": "bigcode_python_fns_25054",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the factorial of a given non-negative integer n. If n is a negative number, the function should return an appropriate error message indicating that the factorial of a negative number does not exist. Remember that the factorial of 0 is define... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(5) == 120\", \"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 83242,
"acecode_id": "evol_32575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the counts of different classes. Your task is to balance these classes such that each class has exactly a specified number of samples, either by upsampling (adding duplicates) if the class has fewer samples than the specified number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert balance_classes([5, 10, 15], 10) == [10, 10, 10]\", \"assert balance_classes([0, 0, 0], 5) == [5, 5, 5]\", \"assert balance_classes([3, 7, 2], 4) == [4, 4, 4]\", \"assert balance_classes([10, 15, 5, 0], 10) == [10, 10, 10, 10]\", \"assert balance_classes([8,... | {
"split": "train",
"index": 83243,
"acecode_id": "bigcode_python_fns_5849",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing genomic records, where each record contains the following keys: 'chr', 'left', 'right', 'strand', 'num_transcript', 'num_sample', 'genome', 'annotation', and 'label'. Your task is to implement a function `group_records_by_label(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_records_by_label([{'chr': '1', 'left': 100, 'right': 200, 'strand': '+', 'num_transcript': 1, 'num_sample': 10, 'genome': 'hg19', 'annotation': 'exon', 'label': 'A'}, {'chr': '1', 'left': 150, 'right': 250, 'strand': '-', 'num_transcript': 2, 'num_samp... | {
"split": "train",
"index": 83244,
"acecode_id": "bigcode_python_fns_22930",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a model represented by a string and a dictionary that maps dataset names to their respective oversampling counts. Create a function `resume_training` that simulates resuming training on the model with the specified dataset oversampling. The function should take th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resume_training('model_1', {'dataset_a': 5, 'dataset_b': 10}) == 'Resuming training for model_1 with 2 datasets and a total oversampling of 15.'\", \"assert resume_training('model_2', {'dataset_x': 0, 'dataset_y': 3}) == 'Resuming training for model_2 with 2... | {
"split": "train",
"index": 83245,
"acecode_id": "bigcode_python_fns_26772",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates annotation requests for a given dataset. The function `generate_annotation_request` should accept a list of strings representing the dataset and an optional string for a claim. If the claim is not provided, the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_annotation_request(['text1', 'text2', 'text3'], None).startswith('Annotation request for example:')\", \"assert generate_annotation_request(['item1', 'item2'], 'Claim A') == 'Annotation request for claim: Claim A'\", \"assert generate_annotation_req... | {
"split": "train",
"index": 83246,
"acecode_id": "oss_7756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_even_odd(num: int) -> str` that takes an integer as input and returns 'Even' if the integer is even and 'Odd' if the integer is odd.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_even_odd(0) == 'Even'\", \"assert check_even_odd(1) == 'Odd'\", \"assert check_even_odd(2) == 'Even'\", \"assert check_even_odd(-1) == 'Odd'\", \"assert check_even_odd(-2) == 'Even'\", \"assert check_even_odd(3) == 'Odd'\", \"assert check_even_odd(4) =... | {
"split": "train",
"index": 83247,
"acecode_id": "evol_8859",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of issues, where each issue is represented by a dictionary containing a 'number' (an integer) and a 'title' (a string). Your task is to write a function that takes this list of issues as input and returns a dictionary where the keys are the issue numbers an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prepare_issue_dict([{'number': 1, 'title': 'new ontology project'}, {'number': 2, 'title': 'old project'}, {'number': 3, 'title': 'ontology update'}]) == {1: 'new ontology project', 3: 'ontology update'}\", \"assert prepare_issue_dict([{'number': 7, 'title':... | {
"split": "train",
"index": 83248,
"acecode_id": "bigcode_python_fns_6289",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a rank and a suit of a playing card into a string representation of that card. The function should take two parameters, `rank` and `suit`, where `rank` can be one of the following: 'A', '2', '3', '4', '5', '6', '7', '8', '9'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert card_representation('A', 'C') == 'A of Clubs'\", \"assert card_representation('2', 'D') == '2 of Diamonds'\", \"assert card_representation('3', 'H') == '3 of Hearts'\", \"assert card_representation('4', 'S') == '4 of Spades'\", \"assert card_representation('... | {
"split": "train",
"index": 83249,
"acecode_id": "bigcode_python_fns_26727",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_last_context` that takes a list of context names and returns the last context added to the list. If the list is empty, return an empty string. The function should handle the case where the context names may contain spaces and special characters. \n\n##... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_last_context(['context1', 'context2', 'context3']) == 'context3'\", \"assert get_last_context(['alpha', 'beta', 'gamma']) == 'gamma'\", \"assert get_last_context(['test', 'example', 'sample']) == 'sample'\", \"assert get_last_context(['first', 'second', ... | {
"split": "train",
"index": 83250,
"acecode_id": "bigcode_python_fns_26887",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer num_bits, write a function generate_ones(num_bits) that returns a list containing num_bits number of 1's. The length of the list should be equal to num_bits. If num_bits is 0, the function should return an empty list. The function should only use basic Python d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_ones(0) == []\", \"assert generate_ones(1) == [1]\", \"assert generate_ones(2) == [1, 1]\", \"assert generate_ones(3) == [1, 1, 1]\", \"assert generate_ones(4) == [1, 1, 1, 1]\", \"assert generate_ones(5) == [1, 1, 1, 1, 1]\", \"assert generate_ones... | {
"split": "train",
"index": 83251,
"acecode_id": "bigcode_python_fns_34983",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `run()` that returns a new list containing only the unique elements from the input list, preserving their original order. The input list may contain duplicate values, and the output list should only include each unique value once. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run([1, 2, 3, 3, 4, 5, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert run([7, 8, 9, 9, 9, 10]) == [7, 8, 9, 10]\", \"assert run([]) == []\", \"assert run([1, 1, 1, 1]) == [1]\", \"assert run([5, 4, 3, 2, 1]) == [5, 4, 3, 2, 1]\", \"assert run([1, 2, 2, 3, 1, 4, 4,... | {
"split": "train",
"index": 83252,
"acecode_id": "oss_28779",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of windows represented by their start and end positions, and a mask dictionary that contains masked ranges for each chromosome. Write a function that calculates the total proportion of the window that is masked, identifies the masked positions relative to t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mask_stats(['chr1:0-10', 0, 10], 0, {'chr1': [(10, 15), (16, 20)]}, 10) == [0.0, [], 0]\", \"assert mask_stats(['chr1:0-10', 0, 10], 0, {'chr1': [(0, 10)]}, 10) == [1.0, [[0, 10]], 0]\", \"assert mask_stats(['chr2:0-20', 0, 20], 0, {'chr2': [(5, 15)]}, 20) =... | {
"split": "train",
"index": 83253,
"acecode_id": "bigcode_python_fns_29716",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a mode, which can be either 'train', 'valid', or 'test'. Your task is to implement a function that returns a numerical index corresponding to each mode. The mapping is as follows: 'train' should return 0, 'valid' should return 1, and 'test' s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert examine_mode('train') == 0\", \"assert examine_mode('valid') == 1\", \"assert examine_mode('test') == 2\", \"assert examine_mode('train') == 0\", \"assert examine_mode('valid') == 1\", \"assert examine_mode('test') == 2\", \"assert examine_mode('train') == 0... | {
"split": "train",
"index": 83254,
"acecode_id": "bigcode_python_fns_23070",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a command line interface (CLI) command for creating artifacts. The function should take a list of command-line arguments and return an exit code. The exit code should be 0 if the command is successfully executed, which requ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_artifact(['artifacts', 'create']) == 2\", \"assert create_artifact(['artifacts', 'create', 'bucket1']) == 0\", \"assert create_artifact(['artifacts', 'create', '']) == 2\", \"assert create_artifact(['artifacts', 'create', 'bucket2']) == 0\", \"assert ... | {
"split": "train",
"index": 83255,
"acecode_id": "bigcode_python_fns_28980",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a user's guess and an answer string. Implement a function that generates a message for the user who guessed incorrectly and has no more chances left to play. The message should inform the user of their wrong guess and reveal the correct answer. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hung('apple', 'banana') == 'Your guess: apple is incorrect. The correct answer was: banana.'\", \"assert hung('dog', 'cat') == 'Your guess: dog is incorrect. The correct answer was: cat.'\", \"assert hung('hello', 'world') == 'Your guess: hello is incorrect.... | {
"split": "train",
"index": 83256,
"acecode_id": "bigcode_python_fns_48681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates directory paths and symlinks based on a given directory name, an attribute string, and a list of values. The function should perform the following steps: 1. For each value in the list, create a new directory with the name b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_symlinks('mydir', 'attr1', ['value1', 'value2']) == ['../../_data/mydir', '../../_data/mydir']\", \"assert create_symlinks('test', 'attr', ['a', 'b', 'c']) == ['../../_data/test', '../../_data/test', '../../_data/test']\", \"assert create_symlinks('pr... | {
"split": "train",
"index": 83257,
"acecode_id": "bigcode_python_fns_34120",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a string as input and modifies the string based on the following rules: 1. If the input string starts with the letter 's', remove the first and last characters from the string. 2. If the input string ends with the letter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_string('sentry') == 'entr'\", \"assert modify_string('python') == 'pythoning'\", \"assert modify_string('happy') == 'happies'\", \"assert modify_string('star') == 'ta'\", \"assert modify_string('s') == ''\", \"assert modify_string('') == 'ing'\", \"as... | {
"split": "train",
"index": 83258,
"acecode_id": "oss_4552",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a message object. The function should perform the following steps: 1. Extract the content of the message, excluding the first character. 2. Check if the message author is a bot. If so, return without further processing. 3. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_message({'content': '%Hello World', 'author': 'user'}) == '**Comment user:** Hello World'\", \"assert process_message({'content': '%This is a test', 'author': 'user'}) == '**Comment user:** This is a test'\", \"assert process_message({'content': '%An... | {
"split": "train",
"index": 83259,
"acecode_id": "oss_1246",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` composed solely of lowercase English letters, implement a function `maxNumOfSubstrings(s: str) -> List[str]` that returns the maximum number of non-empty non-overlapping substrings of `s` such that each substring includes all instances of at least one charact... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxNumOfSubstrings('aabbcc') == ['aa', 'bb', 'cc']\", \"assert maxNumOfSubstrings('a') == ['a']\", \"assert maxNumOfSubstrings('aabb') == ['aa', 'bb']\", \"assert maxNumOfSubstrings('abcdefg') == ['a', 'b', 'c', 'd', 'e', 'f', 'g']\", \"assert maxNumOfSubstr... | {
"split": "train",
"index": 83260,
"acecode_id": "evol_11968",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the average score for each student in a class based on their test scores. The input to the function is a dictionary `summary` containing test scores for each student. The keys of the dictionary are student names, and t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_scores({'Alice': [85, 90, 92], 'Bob': [78, 85, 80], 'Charlie': [90, 92, 89]}) == {'Alice': 89, 'Bob': 81, 'Charlie': 90}\", \"assert calculate_average_scores({'David': [70, 75, 80], 'Eve': [90, 95, 100]}) == {'David': 75, 'Eve': 95}\", \"as... | {
"split": "train",
"index": 83261,
"acecode_id": "oss_2304",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a port name, a signal type, and an interface that contains various signals. Your task is to implement a function that searches for a matching signal in the interface based on the provided port name and signal type. The function should return the matching signal al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_signal('port5', 'unknown', interface) == (None, 'none')\", \"assert search_signal('port6_signal_p', 'signal', interface) == (None, 'none')\", \"assert search_signal('port8_signal', 'signal', interface) == (None, 'none')\", \"assert search_signal('port... | {
"split": "train",
"index": 83262,
"acecode_id": "bigcode_python_fns_46935",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that accepts a list of user objects and validates whether each user has a required profile picture. Each user object is a dictionary that contains the fields: 'username', 'email', 'date_of_birth', and 'profile_picture'. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_profile_pictures([{'username': 'user1', 'email': 'user1@example.com', 'date_of_birth': '2000-01-01', 'profile_picture': 'image1.png'}, {'username': 'user2', 'email': 'user2@example.com', 'date_of_birth': '1995-05-05', 'profile_picture': ''}]) == [Tr... | {
"split": "train",
"index": 83263,
"acecode_id": "oss_28527",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a decorator function that ensures a given function can only be called once. If it is called multiple times, it should return the result of the first call. Implement a function `once(func: Callable) -> Callable` that acts as this decorator. The decor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert once(lambda: 42)() == 42\", \"assert once(lambda: 'Hello, World!')() == 'Hello, World!'\", \"assert once(lambda: 3.14)() == 3.14\", \"assert once(lambda: [1, 2, 3])() == [1, 2, 3]\", \"assert once(lambda: {'key': 'value'})() == {'key': 'value'}\", \"assert o... | {
"split": "train",
"index": 83264,
"acecode_id": "bigcode_python_fns_20039",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the frequency of each distinct character in a given string, including spaces and other non-alphabetic characters. Additionally, identify and return the character with the highest frequency. If there are multiple characters with the same high... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_frequency('hello world') == ({'h': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'w': 1, 'r': 1, 'd': 1}, 'l')\", \"assert char_frequency('aabbcc') == ({'a': 2, 'b': 2, 'c': 2}, 'a')\", \"assert char_frequency('abcdefg') == ({'a': 1, 'b': 1, 'c': 1, 'd': 1, 'e': 1... | {
"split": "train",
"index": 83265,
"acecode_id": "evol_14155",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function that checks if a multidimensional array contains a given value and returns the number of times the value appears in the array. The function should take two parameters: a multidimensional list `array` and a value `value`. If the value is not found, return 0. For... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_multi_dimensional_array([[1, 2], [3, 2, 4]], 2) == 2\", \"assert check_multi_dimensional_array([[1, 2], [3, 2, 4]], 5) == 0\", \"assert check_multi_dimensional_array([[5, 5], [5]], 5) == 3\", \"assert check_multi_dimensional_array([[1], [2, 3], [4, 5]]... | {
"split": "train",
"index": 83266,
"acecode_id": "evol_31680",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating point numbers representing stock prices, implement a function `truncate_prices(prices: List[float]) -> List[float]` that truncates each price to three decimal places without rounding. The input list will only contain floating point numbers. Return a new... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert truncate_prices([337.510009765625]) == [337.510]\", \"assert truncate_prices([10.0001, 20.0002, 30.0003]) == [10.0, 20.0, 30.0]\", \"assert truncate_prices([1.1, 1.11, 1.111]) == [1.1, 1.11, 1.111]\", \"assert truncate_prices([0.5, 0.555, 0.5555]) == [0.5, 0... | {
"split": "train",
"index": 83267,
"acecode_id": "evol_12056",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a time value representing a specific point in an orbital cycle, write a function that determines if climate data exists for that time value within a predefined list of available timestamps. The function should return True if the time exists in the list, and False otherwis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_climate_data_available(1.0, [0.5, 1.0, 1.5]) == True\", \"assert is_climate_data_available(2.0, [0.5, 1.0, 1.5]) == False\", \"assert is_climate_data_available(0.0, [0.0, 1.0, 2.0]) == True\", \"assert is_climate_data_available(-1.0, [-1.0, 0.0, 1.0]) == ... | {
"split": "train",
"index": 83268,
"acecode_id": "bigcode_python_fns_47929",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that inverts the case of alphabetic characters, replaces odd numerals with their immediate descendant primes, and triples any special symbols within a given string. An immediate descendant prime is the next prime number that comes after a given number. For exa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_case_inversion_and_alteration('Test1#') == 'tEST2###'\", \"assert advanced_case_inversion_and_alteration('Python3$') == 'pYTHON5$$$'\", \"assert advanced_case_inversion_and_alteration('A1B2C3!') == 'a2b2c5!!!'\", \"assert advanced_case_inversion_and... | {
"split": "train",
"index": 83269,
"acecode_id": "evol_12346",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of words and an integer n, write a function `generate_ngrams(sequence: List[str], n: int) -> List[Tuple[str]]` that generates all possible n-grams from the list of words. An n-gram is a contiguous sequence of n items from the list. The function should return a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_ngrams(['the', 'quick', 'brown', 'fox'], 2) == [('the', 'quick'), ('quick', 'brown'), ('brown', 'fox')]\", \"assert generate_ngrams(['the', 'quick'], 3) == []\", \"assert generate_ngrams(['hello', 'world'], 1) == [('hello',), ('world',)]\", \"assert... | {
"split": "train",
"index": 83270,
"acecode_id": "bigcode_python_fns_42456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes no parameters and returns a specific URL string that points to a global data structure for the Sustainable Development Goals (SDGs). The function should return the following URL: 'https://registry.sdmx.org/ws/public/sdmxapi/rest... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_dsd_url() == 'https://registry.sdmx.org/ws/public/sdmxapi/rest/datastructure/IAEG-SDGs/SDG/latest/?format=sdmx-2.1&detail=full&references=children'\", \"assert get_dsd_url() == 'https://registry.sdmx.org/ws/public/sdmxapi/rest/datastructure/IAEG-SDGs/SDG... | {
"split": "train",
"index": 83271,
"acecode_id": "bigcode_python_fns_33668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `replace_space(original_string: str, character: str) -> str` that replaces all spaces in the given string with a specified character. Additionally, if the string contains more than two consecutive spaces, replace them with exactly two occurrences of the specifi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_space('Hello World', '*') == 'Hello**World'\", \"assert replace_space('Hello World', '*') == 'Hello**World'\", \"assert replace_space('Hello World', '*') == 'Hello**World'\", \"assert replace_space('Hello World', '*') == 'Hello**World'\", \... | {
"split": "train",
"index": 83272,
"acecode_id": "evol_24359",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of blueprint references for a web application and returns a dictionary containing the number of times each blueprint is referenced in the list. Each reference is represented as a string in the format 'from .bl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_blueprint_references([\\\"from .blue_prints.main import main as main_blueprint\\\", \\\"from .blue_prints.admin import admin as admin_blueprint\\\", \\\"from .blue_prints.main import main as main_blueprint\\\", \\\"from .blue_prints.user import user as... | {
"split": "train",
"index": 83273,
"acecode_id": "oss_35124",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total duration of a series of animations. Each animation has a duration represented by a positive integer. Your function should take a variable number of integer arguments, where each integer represents the duratio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_duration(1, 2, 3) == 6\", \"assert calculate_total_duration(5, 10, 15) == 30\", \"assert calculate_total_duration(0, 0, 0) == 0\", \"assert calculate_total_duration(7) == 7\", \"assert calculate_total_duration(4, 6) == 10\", \"assert calculat... | {
"split": "train",
"index": 83274,
"acecode_id": "oss_16630",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of mixed numbers, which may include fractions and decimal values. Implement a function `sort_mixed_numbers(numbers: List[Union[int, float]]) -> List[float]` that sorts these numbers in ascending order. The input list can contain both fractions represented a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_mixed_numbers(['1/8', 0.75, '1/3', '5/6']) == [0.125, 0.3333333333333333, 0.75, 0.8333333333333334]\", \"assert sort_mixed_numbers(['5/6', '1/3', 0.75, '1/8']) == [0.125, 0.3333333333333333, 0.75, 0.8333333333333334]\", \"assert sort_mixed_numbers(['1/8... | {
"split": "train",
"index": 83275,
"acecode_id": "evol_25465",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of file names, write a function that filters out file names that have a specific extension (e.g., '.nam') and excludes any file names that contain any of the specified keywords. The function should take in a list of file names and a list of keywords to exclude. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files(['file1.nam', 'file2.txt', 'file3.nam', 'exclude_this.nam'], ['exclude_this']) == ['file1.nam', 'file3.nam']\", \"assert filter_files(['test.nam', 'sample.nam', 'example.txt'], ['sample']) == ['test.nam']\", \"assert filter_files(['data.nam', 'd... | {
"split": "train",
"index": 83276,
"acecode_id": "bigcode_python_fns_45146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple task management system for handling actions. The function `manage_actions(actions)` takes a list of tuples as input, where each tuple contains an action (a string) and an action type (either 'normal' or 'special').... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_actions([('action1', 'normal'), ('action2', 'special'), ('action3', 'normal')]) == ['action2', 'action1', 'action3']\", \"assert manage_actions([('actionA', 'normal'), ('actionB', 'normal'), ('actionC', 'special')]) == ['actionC', 'actionA', 'actionB'... | {
"split": "train",
"index": 83277,
"acecode_id": "oss_6491",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a setup configuration string for integrating a CUDA extension into a Python package. Your function should take two inputs: a string `extension_name`, representing the name of the CUDA extension, and a list of strings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_setup_config('adaptive_sigmoid', ['adaptive_sigmoid.cpp', 'adaptive_sigmoid_cuda.cu']) == \\\"setup(name='adaptive_sigmoid', ext_modules=[CUDAExtension('adaptive_sigmoid_gpu',['adaptive_sigmoid.cpp', 'adaptive_sigmoid_cuda.cu']),], cmdclass={'build_... | {
"split": "train",
"index": 83278,
"acecode_id": "oss_28208",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of zero-indexed backend module names and a backend module name to check. Your task is to implement a function `check_backend_module` that returns `True` if the provided backend module name is present in the list of zero-indexed backend modules, and `False` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_backend_module('module_a', ['module_a', 'module_b', 'module_c']) == True\", \"assert check_backend_module('module_b', ['module_a', 'module_b', 'module_c']) == True\", \"assert check_backend_module('module_c', ['module_a', 'module_b', 'module_c']) == Tr... | {
"split": "train",
"index": 83279,
"acecode_id": "oss_12649",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of operations represented by integers where positive integers denote deposits and negative integers denote withdrawals. Your task is to implement a function that calculates the maximum balance that occurs during the sequence of these operations. The balance... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximum_balance([1, 2, 3]) == 6\", \"assert maximum_balance([-5, -10, -15]) == 0\", \"assert maximum_balance([10, -5, 2, -10]) == 10\", \"assert maximum_balance([0, 0, 0]) == 0\", \"assert maximum_balance([5, 5, -3, 2]) == 10\", \"assert maximum_balance([1, ... | {
"split": "train",
"index": 83280,
"acecode_id": "evol_24466",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a MySQL connection string given the database host and port. The function should take in two parameters: `host` (a string representing the database host) and `port` (an integer representing the port number). The output s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_mysql_connection_string('mysqlopsdb001', 3306) == 'mysqlopsdb001:3306'\", \"assert generate_mysql_connection_string('localhost', 3306) == 'localhost:3306'\", \"assert generate_mysql_connection_string('192.168.1.1', 3306) == '192.168.1.1:3306'\", \"a... | {
"split": "train",
"index": 83281,
"acecode_id": "bigcode_python_fns_6247",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that checks if two input strings have identical unique words, disregarding capitalization and non-alphabetical characters, but also verifies if these words were originally capitalized in the same way. Implement the following function: def check_word_identical... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_word_identicality_and_capitalization('Hello!', 'hello') == False\", \"assert check_word_identicality_and_capitalization('apple', 'Apple') == False\", \"assert check_word_identicality_and_capitalization('banana', 'Banana') == False\", \"assert check_wor... | {
"split": "train",
"index": 83282,
"acecode_id": "evol_18335",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of student course requests represented as tuples, where each tuple contains the student's ID, the course ID, and the status of the request ('approved', 'pending', or 'declined'), implement a function that returns a list of dictionaries containing the approved reque... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_approved_requests([(1, 101, 'approved'), (2, 102, 'pending'), (3, 103, 'declined')]) == [{'student_id': 1, 'course_id': 101, 'message': 'Request approved'}]\", \"assert get_approved_requests([(4, 201, 'approved'), (5, 202, 'approved'), (6, 203, 'pending'... | {
"split": "train",
"index": 83283,
"acecode_id": "bigcode_python_fns_7972",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_primes(N)` that returns a list of all prime numbers in the range from 1 to N (inclusive). The function should handle errors by raising a TypeError if N is not an integer, and a ValueError if N is less than 1. A prime number is defined as a natural... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_primes(1) == []\", \"assert generate_primes(2) == [2]\", \"assert generate_primes(3) == [2, 3]\", \"assert generate_primes(4) == [2, 3]\", \"assert generate_primes(5) == [2, 3, 5]\", \"assert generate_primes(10) == [2, 3, 5, 7]\", \"assert generate_... | {
"split": "train",
"index": 83284,
"acecode_id": "evol_18595",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that removes all instances of a specified character from a given string while preserving the original structure of the string. The function should also return the count of the characters that were removed. The function signature is as follows: def remove_an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_and_count('Hello World', 'o') == ('Hell Wrld', 2)\", \"assert remove_and_count('aaaaa', 'a') == ('', 5)\", \"assert remove_and_count('No characters removed', 'x') == ('No characters removed', 0)\", \"assert remove_and_count('Data Science', 'i') == ('D... | {
"split": "train",
"index": 83285,
"acecode_id": "evol_14500",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a variable scheduler. The function `update_variable` takes three parameters: an integer `epoch`, a float `current_value`, and a function `schedule`. The `schedule` function takes two arguments: the curre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_variable(0, 10.0, lambda epoch, value: value * 0.9, True) == 9.0\", \"assert update_variable(1, 10.0, lambda epoch, value: value + 1, False) == 11.0\", \"assert update_variable(2, 20.0, lambda epoch, value: value - epoch, True) == 18.0\", \"assert upd... | {
"split": "train",
"index": 83286,
"acecode_id": "oss_29429",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a state machine for processing orders in an e-commerce system. The state machine has five states: PENDING_CONFIRM, PENDING_CANCEL, CANCELED, CONFIRMED, and FAILED, represented by the integer values 1, 2, 3, 4, and 5 respectively. The transitions... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_order_state(1, 'confirm') == 4\", \"assert process_order_state(1, 'cancel') == 2\", \"assert process_order_state(2, 'confirm') == 5\", \"assert process_order_state(2, 'cancel') == 3\", \"assert process_order_state(4, 'any_event') == 4\", \"assert pro... | {
"split": "train",
"index": 83287,
"acecode_id": "oss_1162",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of three floating-point numbers representing RGB color values. The function should validate that the input list contains exactly three elements. If the input list is not of length three, it should raise a TypeError w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_color([1.0, 0.5, 0.0]) == 'RGB( 1.0, 0.5, 0.0 )'\", \"assert format_color([0.0, 0.0, 0.0]) == 'RGB( 0.0, 0.0, 0.0 )'\", \"assert format_color([0.2, 0.3, 0.4]) == 'RGB( 0.2, 0.3, 0.4 )'\", \"assert format_color([255.0, 128.0, 64.0]) == 'RGB( 255.0, 128... | {
"split": "train",
"index": 83288,
"acecode_id": "bigcode_python_fns_36629",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that extracts the entrypoint type from a given module name. The entrypoint type is defined as the type of the function named 'main' within the module. Your function should take a module name as a string input and return the typ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_entrypoint_type('module_without_main') is None\", \"assert get_entrypoint_type('non_existent_module') is None\", \"assert get_entrypoint_type('empty_module') is None\", \"assert get_entrypoint_type('module_with_wrong_entrypoint') is None\", \"assert get_... | {
"split": "train",
"index": 83289,
"acecode_id": "oss_6511",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a geographic coordinate in the format 'latitude,longitude', write a function that extracts the latitude and longitude as two separate floating-point numbers. The latitude should be in the range of -90 to 90, and the longitude should be in the range o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_coordinates('34.0522,-118.2437') == (34.0522, -118.2437)\", \"assert extract_coordinates('-90.0,180.0') == (-90.0, 180.0)\", \"assert extract_coordinates('0.0,0.0') == (0.0, 0.0)\", \"assert extract_coordinates('45.1234,-75.9876') == (45.1234, -75.98... | {
"split": "train",
"index": 83290,
"acecode_id": "bigcode_python_fns_12629",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates adding nodes and edges to a directed graph and retrieving the neighbors of a specific node. The graph is represented using an adjacency list. You need to implement a function `graph_operations(operations: List[Tuple[str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert graph_operations([('add_node', 'A'), ('add_node', 'B'), ('add_edge', 'A', 'B', 5), ('get_neighbors', 'A')]) == {'A': ['B']}\", \"assert graph_operations([('add_node', 'C'), ('add_node', 'D'), ('add_edge', 'C', 'D', 10), ('get_neighbors', 'C')]) == {'C': ['D'... | {
"split": "train",
"index": 83291,
"acecode_id": "oss_18845",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python that takes two parameters, `start` and `end`, and returns the sum of squares of all odd numbers between `start` and `end`, inclusive. If the `end` value exceeds 10,000, the function should raise a ValueError. The function signature should be: `def su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares(1, 10) == 165\", \"assert sum_of_squares(0, 9) == 165\", \"assert sum_of_squares(3, 7) == 83\", \"assert sum_of_squares(9, 9) == 81\", \"assert sum_of_squares(15, 15) == 225\"]}"
} | {
"split": "train",
"index": 83292,
"acecode_id": "evol_32199",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `delete_files_dirs` that simulates the deletion of files and directories based on a list of given paths. The function takes two parameters: a string `device` representing the device name and a list of strings `paths` representi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_files_dirs('shutdown', ['/MUSIC/song.mp3', '/MUSIC/subdir/a.mp3', '/MUSIC/subdir/b.mp3']) == []\", \"assert delete_files_dirs('flashair', ['/MUSIC/song.mp3']) == ['/MUSIC/song.mp3']\", \"assert delete_files_dirs('flashair', ['/']) == []\", \"assert de... | {
"split": "train",
"index": 83293,
"acecode_id": "bigcode_python_fns_46219",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that counts the number of files with a specific file extension in a given list of file names. Your function should accept two parameters: a list of file names and a string representing the file extension (without the dot). The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_files_with_extension(['file1.txt', 'file2.txt', 'subdirectory/file3.txt', 'subdirectory/file4.txt'], 'txt') == 4\", \"assert count_files_with_extension(['image.png', 'document.docx', 'presentation.pptx', 'report.pdf'], 'pdf') == 1\", \"assert count_fil... | {
"split": "train",
"index": 83294,
"acecode_id": "oss_19845",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of unique integers representing the positions of pebbles on an infinite number line. Your task is to determine the minimum and maximum number of moves required to shift the pebbles so that they occupy consecutive positions without any gaps. A move consists ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numMovesStonesII([7, 4, 9]) == [1, 2]\", \"assert numMovesStonesII([6, 5, 4, 3, 10]) == [2, 3]\", \"assert numMovesStonesII([100, 101, 104, 102, 103]) == [0, 0]\", \"assert numMovesStonesII([1, 3, 5, 7]) == [2, 2]\", \"assert numMovesStonesII([3, 4, 2, 1]) =... | {
"split": "train",
"index": 83295,
"acecode_id": "evol_20011",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the daily stock prices of a company. Write a function `max_profit(prices: List[int]) -> int` that calculates the maximum profit that can be obtained by buying and selling the stock at most once. If no profit can be made, the functio... | 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([1, 2]) == 1\", \"assert max_profit([2, 1]) == 0\", \"assert max_profit([3, 3, 3]) == 0\", \"assert max_profit([1]) == 0\", \"assert max_profit([]) == 0\"... | {
"split": "train",
"index": 83296,
"acecode_id": "oss_18367",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement the Gnome Sort algorithm to sort a given list of integers in increasing order. The function should accept a list of integers and return the sorted list. For example, given the list [8, 3, 6, 1, 5], the output should be [1, 3, 5, 6, 8].\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gnomeSort([8, 3, 6, 1, 5]) == [1, 3, 5, 6, 8]\", \"assert gnomeSort([3, 2, 1]) == [1, 2, 3]\", \"assert gnomeSort([1, 2, 3]) == [1, 2, 3]\", \"assert gnomeSort([7, 5, 3, 9, 1]) == [1, 3, 5, 7, 9]\", \"assert gnomeSort([-1, -3, 2, 0]) == [-3, -1, 0, 2]\", \"a... | {
"split": "train",
"index": 83297,
"acecode_id": "evol_34668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists, where each inner list represents a collection of image data as a 2D array (list of lists). Each image is represented by a list of floating-point numbers. Your task is to implement a function `load_images(image_data: List[List[List[float]]], min_nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_images([[[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]]], 2) == [[[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]]]\", \"assert load_images([[[1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]]], 1) == [[[1.0, 1... | {
"split": "train",
"index": 83298,
"acecode_id": "bigcode_python_fns_7621",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that counts the number of substrings containing numeric values and returns a list of these numeric substrings sorted in descending order of their numeric value. The function should also handle floating point numbers and should ignore any cas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_extract_sort_number_strings('The price is 12.5 dollars and 35.99 cents.') == (2, [35.99, 12.5])\", \"assert count_extract_sort_number_strings('No numbers here!') == (0, [])\", \"assert count_extract_sort_number_strings('1, 2, 3, 4, 5') == (5, [5.0, 4.0... | {
"split": "train",
"index": 83299,
"acecode_id": "evol_33853",
"num_tests": 14
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.