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, implement a function `find_min_three_elements(nums_list)` that returns a list containing the three smallest unique elements from the input list. If the list contains fewer than three unique elements, return all unique elements in ascending order. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_min_three_elements([88, -15, 74, 60, -90, -30]) == [-90, -30, -15]\", \"assert find_min_three_elements([3, 1, 2, 1]) == [1, 2, 3]\", \"assert find_min_three_elements([5, 5, 5, 5]) == [5]\", \"assert find_min_three_elements([1]) == [1]\", \"assert find_m... | {
"split": "train",
"index": 67200,
"acecode_id": "evol_17199",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer `n`, write a function `reverseBits` that reverses the bits of the integer and returns the resulting integer. The input integer will be a 32-bit unsigned integer. For example, if the input is `43261596`, which is `00000010100101000001111010011100` in binary, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverseBits(0) == 0\", \"assert reverseBits(1) == 2147483648\", \"assert reverseBits(2) == 1073741824\", \"assert reverseBits(3) == 3221225472\", \"assert reverseBits(4) == 536870912\", \"assert reverseBits(8) == 268435456\", \"assert reverseBits(15) == 4026... | {
"split": "train",
"index": 67201,
"acecode_id": "oss_26673",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two lists of strings as input and returns a list of distinct elements that are present in either of the two lists but not in both. The order of elements in the output list should be the same as the order they appeared in the first list followed b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_distinct(['a', 'b', 'c'], ['b', 'c', 'd']) == ['a', 'd']\", \"assert find_distinct(['x', 'y', 'z'], ['x', 'y', 'a']) == ['z', 'a']\", \"assert find_distinct(['apple', 'banana'], ['banana', 'cherry']) == ['apple', 'cherry']\", \"assert find_distinct(['ma... | {
"split": "train",
"index": 67202,
"acecode_id": "evol_18176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of model names represented as strings. Your task is to create a function that takes this list as input and returns a dictionary with each model name as the key and its corresponding test accuracy as the value. The test accuracy is defined as the length of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert model_test_accuracy(['modelA', 'modelB', 'modelC']) == {'modelA': 0.6, 'modelB': 0.6, 'modelC': 0.6}\", \"assert model_test_accuracy(['']) == {'': 0.0}\", \"assert model_test_accuracy(['a', 'ab', 'abc', 'abcd']) == {'a': 0.1, 'ab': 0.2, 'abc': 0.3, 'abcd': 0... | {
"split": "train",
"index": 67203,
"acecode_id": "bigcode_python_fns_26462",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `process_image(image_path)` that takes the path to an input image as an argument and simulates the detection and localization of objects in the image. The function should return a list of detected objects, where each object is represented... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_image('fake_path.jpg') == [{'class_name': 'cat', 'confidence': 0.9, 'bounding_box': (0.1, 0.1, 0.5, 0.5)}, {'class_name': 'dog', 'confidence': 0.8, 'bounding_box': (0.2, 0.2, 0.6, 0.6)}, {'class_name': 'person', 'confidence': 0.95, 'bounding_box': (0... | {
"split": "train",
"index": 67204,
"acecode_id": "oss_10391",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that simulates the settings of a linter for Python code. This dictionary contains a key 'pylintrc' which may or may not contain another dictionary named 'MASTER'. Your task is to create a function `check_max_line_length_configured(config... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_max_line_length_configured({'pylintrc': {'MASTER': {'max-line-length': '80'}}}) == 'max-line-length is correct'\", \"assert check_max_line_length_configured({'pylintrc': {'MASTER': {'max-line-length': '100'}}}) == 'max-line-length wrong, is 100, should... | {
"split": "train",
"index": 67205,
"acecode_id": "bigcode_python_fns_27681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorial_iterative(n: int) -> int` that calculates the factorial of a non-negative integer n using an iterative approach. The factorial of n is defined as the product of all positive integers less than or equal to n. For example, factorial(5) = 5 * 4 * 3 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_iterative(0) == 1\", \"assert factorial_iterative(1) == 1\", \"assert factorial_iterative(2) == 2\", \"assert factorial_iterative(3) == 6\", \"assert factorial_iterative(4) == 24\", \"assert factorial_iterative(5) == 120\", \"assert factorial_itera... | {
"split": "train",
"index": 67206,
"acecode_id": "evol_1006",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts a dictionary of settings and modifies the logging level based on the value of the 'debug_logging' key. If 'debug_logging' is True, set the logging level to 'DEBUG'. If it is False, set it to 'INFO'. Your function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_log_level({'debug_logging': True}) == 'DEBUG'\", \"assert set_log_level({'debug_logging': False}) == 'INFO'\", \"assert set_log_level({'debug_logging': True}) == 'DEBUG'\", \"assert set_log_level({'debug_logging': False}) == 'INFO'\", \"assert set_log_le... | {
"split": "train",
"index": 67207,
"acecode_id": "bigcode_python_fns_2834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing resume data in JSON format. Your task is to write a function `count_invalid_resumes(resumes: List[str]) -> int` that counts and returns the number of invalid resumes. A resume is considered invalid if it is not a well-formed JSON str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_invalid_resumes(['{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}', '{\\\"name\\\": \\\"Bob\\\", \\\"age\\\": 25}', '{name: \\\"Charlie\\\", age: 20}']) == 1\", \"assert count_invalid_resumes(['{\\\"id\\\": 1, \\\"valid\\\": true}', '{\\\"id\\\": 2, \\\... | {
"split": "train",
"index": 67208,
"acecode_id": "bigcode_python_fns_42251",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a 2D convolution operation with a fixed 2x2 kernel. Your function should take the following parameters: 'in_planes' (an integer representing the number of input channels), 'out_planes' (an integer representi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert conv2x2(3, 64) == {'in_planes': 3, 'out_planes': 64, 'stride': 1, 'groups': 1, 'dilation': 1, 'padding': 0}\", \"assert conv2x2(1, 32, stride=2) == {'in_planes': 1, 'out_planes': 32, 'stride': 2, 'groups': 1, 'dilation': 1, 'padding': 0}\", \"assert conv2x2(... | {
"split": "train",
"index": 67209,
"acecode_id": "bigcode_python_fns_5211",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the inorder and postorder traversal sequences of a binary tree. Your task is to construct the binary tree from these traversal sequences and return the root node of the tree. Implement a function `build_tree(inorder: List[int], postorder: List[int]) -> TreeNode` t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_tree([9, 3, 15, 20, 7], [9, 15, 7, 20, 3]).val == 3\", \"assert build_tree([2, 1], [1, 2]).val == 2\", \"assert build_tree([1], [1]).val == 1\", \"assert build_tree([1, 2, 3], [1, 3, 2]).val == 2\", \"assert build_tree([4, 2, 5, 1, 3], [4, 5, 2, 3, 1])... | {
"split": "train",
"index": 67210,
"acecode_id": "oss_18582",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Create a function called `create_sequence` that takes a variable number of arguments and returns a list containing all the provided arguments. The resulting list should maintain the order of the input arguments. The function should accept any type of arguments (e.g., integers, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_sequence(1, 2, 3) == [1, 2, 3]\", \"assert create_sequence('a', 'b', 'c') == ['a', 'b', 'c']\", \"assert create_sequence(1, 'a', True) == [1, 'a', True]\", \"assert create_sequence(3.14, 1, 'test') == [3.14, 1, 'test']\", \"assert create_sequence() ==... | {
"split": "train",
"index": 67211,
"acecode_id": "bigcode_python_fns_7323",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two vectors `v` and `w` of the same length, implement a function that calculates the Euclidean (L2) distance between them. The Euclidean distance is defined as the square root of the sum of the squared differences between corresponding elements of the two vectors. You may... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert euclidean_distance([1.0, 2.0, 3.0], [4.0, 5.0, 6.0]) == 5.196152422706632\", \"assert euclidean_distance([0.0, 0.0], [0.0, 0.0]) == 0.0\", \"assert euclidean_distance([1.0], [1.0]) == 0.0\", \"assert euclidean_distance([1.0, 1.0], [2.0, 2.0]) == 1.4142135623... | {
"split": "train",
"index": 67212,
"acecode_id": "bigcode_python_fns_38954",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings that represent GitHub repository identifiers and a corresponding list of API access tokens for a continuous integration (CI) provider. Write a function `initialize_ci_repositories(repositories: List[str], tokens: List[str], provider: str = 'travi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_ci_repositories(['repo1', 'repo2'], ['token1', 'token2'], 'travis') == None\", \"assert initialize_ci_repositories(['repoA'], ['tokenA'], 'circleci') == None\", \"assert initialize_ci_repositories(['repoX', 'repoY'], ['tokenX', 'tokenY']) == None\... | {
"split": "train",
"index": 67213,
"acecode_id": "bigcode_python_fns_4876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_distance_and_angle(pointA: Tuple[float, float, float], pointB: Tuple[float, float, float], pointC: Tuple[float, float, float]) -> Tuple[float, float]`. This function takes in three 3D points represented as tuples of three coordinates (x, y, z). I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distance_and_angle((0, 0, 0), (1, 0, 0), (0, 1, 0)) == (1.0, 90.0)\", \"assert calculate_distance_and_angle((1, 1, 1), (4, 1, 1), (1, 5, 1)) == (3.0, 90.0)\", \"assert calculate_distance_and_angle((0, 0, 0), (0, 0, 0), (0, 1, 0)) == (0.0, 0.0)\", \... | {
"split": "train",
"index": 67214,
"acecode_id": "evol_2515",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting an Adabas response code into a human-readable text format. Implement a function `convert_rsp_to_text(rsp: int, subcode1: int = 0, subcode2: int = 0, erri: str = '', cmd: str = '', subcmd1: str = '', subcmd2: str = '') -> str` that takes the follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_rsp_to_text(100) == 'Adabas Response 100: no explanation available'\", \"assert convert_rsp_to_text(200, 0, 0) == 'Adabas Response 200: no explanation available'\", \"assert convert_rsp_to_text(300, 1, 0) == 'Adabas Response 300: no explanation avail... | {
"split": "train",
"index": 67215,
"acecode_id": "bigcode_python_fns_30765",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom linked list data structure in Python. Your linked list will consist of nodes, where each node contains an integer value and a reference to the next node in the list. You need to implement a function `get_last_node_value(head: Node) -> O... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_last_node_value(None) == None\", \"assert get_last_node_value(Node(1)) == 1\", \"assert get_last_node_value(Node(1, Node(2))) == 2\", \"assert get_last_node_value(Node(1, Node(2, Node(3)))) == 3\", \"assert get_last_node_value(Node(5, Node(10, Node(15)))... | {
"split": "train",
"index": 67216,
"acecode_id": "oss_23707",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `round_number(num)` that takes a single parameter `num`, which can be a float or an integer, and returns the number rounded to the nearest whole number. If the input is not a valid number (e.g., a string or None), the function should return None.\nPlease re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_number(15.5) == 16\", \"assert round_number(2.3) == 2\", \"assert round_number(2.7) == 3\", \"assert round_number(0) == 0\", \"assert round_number(3.0) == 3\", \"assert round_number(5.5) == 6\", \"assert round_number(-0.5) == 0\", \"assert round_number... | {
"split": "train",
"index": 67217,
"acecode_id": "evol_13700",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing ratings and an integer n representing the number of ratings in the list. Your task is to write a function `count_increasing(ratings: List[int], n: int) -> List[int]` that returns a list of integers. Each integer in the output list c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_increasing([1, 2, 1, 3], 4) == [1, 2, 1, 2]\", \"assert count_increasing([5, 1, 2, 3, 4], 5) == [1, 1, 2, 3, 4]\", \"assert count_increasing([3, 3, 3, 3], 4) == [1, 1, 1, 1]\", \"assert count_increasing([1], 1) == [1]\", \"assert count_increasing([2, 2... | {
"split": "train",
"index": 67218,
"acecode_id": "bigcode_python_fns_18062",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `clean_text(input_text: str) -> str` that takes a string `input_text` and returns a new string with all special characters removed. Special characters are defined as any character that is not a letter (a-z, A-Z), a digit (0-9), or a space. The output should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_text('Hello, World!') == 'Hello World'\", \"assert clean_text('Python 3.8 is great!') == 'Python 38 is great'\", \"assert clean_text('Clean@text#now$') == 'Cleantextnow'\", \"assert clean_text('1234567890') == '1234567890'\", \"assert clean_text('No sp... | {
"split": "train",
"index": 67219,
"acecode_id": "evol_9944",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a hexadecimal color code represented as a string of six characters (without the '#' prefix). Your task is to write a function `hex_to_rgb(hex_color)` that converts this hexadecimal color code into its corresponding RGB values. The RGB values should be represented ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_rgb('73ED73') == (115, 237, 115)\", \"assert hex_to_rgb('FFFFFF') == (255, 255, 255)\", \"assert hex_to_rgb('000000') == (0, 0, 0)\", \"assert hex_to_rgb('FF5733') == (255, 87, 51)\", \"assert hex_to_rgb('C70039') == (199, 0, 57)\", \"assert hex_to_rg... | {
"split": "train",
"index": 67220,
"acecode_id": "oss_26952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary representing logging and plugin settings for an application. Your task is to implement a function `validate_logging_config(config: dict) -> bool` that validates the configuration based on the following rules: \n\n1. The key 'logging.con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_logging_config({'logging.console': True, 'logging.file': False, 'plugins.apps': [], 'plugins.backbones': []}) == False\", \"assert validate_logging_config({'logging.console': True, 'logging.file': False, 'logging.console_verbosity': 'INFO', 'logging... | {
"split": "train",
"index": 67221,
"acecode_id": "bigcode_python_fns_3313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a tag. Your task is to implement a function that takes this list of tags and appends a new tag to the list. The function should return the updated list of tags. If the new tag already exists in the list, it should no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert append_tag(['foo', 'bar'], 'baz') == ['foo', 'bar', 'baz']\", \"assert append_tag(['foo', 'bar'], 'foo') == ['foo', 'bar']\", \"assert append_tag([], 'baz') == ['baz']\", \"assert append_tag(['tag1', 'tag2', 'tag3'], 'tag2') == ['tag1', 'tag2', 'tag3']\", \"... | {
"split": "train",
"index": 67222,
"acecode_id": "bigcode_python_fns_44524",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, where each integer represents the size of an intermediate representation in a neural network's hidden layers. Write a function `total_intermediate_size` that calculates and returns the total size of all intermediate representations. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_intermediate_size([100, 200, 150]) == 450\", \"assert total_intermediate_size([0, 0, 0]) == 0\", \"assert total_intermediate_size([1]) == 1\", \"assert total_intermediate_size([10, 20, 30, 40]) == 100\", \"assert total_intermediate_size([-10, -20, -30]... | {
"split": "train",
"index": 67223,
"acecode_id": "oss_25516",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a multiline string that contains multiple records, where each record is formatted as 'name=<username>, age=<age>'. Your task is to write a function that parses this string and extracts the usernames and ages into a list of dictionaries. Each dictionary should cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_user_data('name=username1, age=1001\\\\nname=username2, age=1002\\\\nname=username3, age=1003') == [{'name': 'username1', 'age': '1001'}, {'name': 'username2', 'age': '1002'}, {'name': 'username3', 'age': '1003'}]\", \"assert extract_user_data('name=... | {
"split": "train",
"index": 67224,
"acecode_id": "bigcode_python_fns_32383",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that generates HTML code to display an image on a web page. The function takes in the following parameters:\n- `im_type`: a string representing the type of the image (e.g., 'png', 'jpg').\n- `caption`: a string containing the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_image_html('png', 'Sample Image', 'iVBORw0KGgoAAAANSUhEUgAA...') == '<img src=\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...\\\" alt=\\\"Sample Image\\\" />'\", \"assert generate_image_html('jpg', 'Another Image', 'BASE64ENCODEDIMAGE') == '<i... | {
"split": "train",
"index": 67225,
"acecode_id": "oss_21802",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and returns a new list containing only the even integers from the original list. The function should maintain the order of the even integers as they appeared in the original list.\nPlease reason step by step, then write a self-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even([1, 3, 5, 7]) == []\", \"assert filter_even([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even([]) == []\", \"assert filter_even([... | {
"split": "train",
"index": 67226,
"acecode_id": "evol_11595",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sample_function(value)` that takes an integer `value` as input. If the value is greater than 20, the function should return a string indicating that the value is greater than 20 and also return the result of multiplying the value by 2. If the value is 20 o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sample_function(21) == 'The value is greater than 20. The result is 42.'\", \"assert sample_function(20) == 80\", \"assert sample_function(19) == 76\", \"assert sample_function(25) == 'The value is greater than 20. The result is 50.'\", \"assert sample_funct... | {
"split": "train",
"index": 67227,
"acecode_id": "evol_8351",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a date string in the format 'YYYY-MM-DD', write a function `humanize_date(date_string: str) -> str` that converts the date into a human-readable format of 'Month Day Year', where 'Month' is the full name of the month (e.g., 'January', 'February', etc.), 'Day' is the day o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert humanize_date('2019-08-24') == 'August 24 2019'\", \"assert humanize_date('2020-01-01') == 'January 01 2020'\", \"assert humanize_date('2021-12-31') == 'December 31 2021'\", \"assert humanize_date('2022-07-04') == 'July 04 2022'\", \"assert humanize_date('20... | {
"split": "train",
"index": 67228,
"acecode_id": "bigcode_python_fns_16516",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a given dictionary where keys represent translation strings and values represent their translations. Your function should replace any untranslated strings (where the value is None) with a formatted string that surrounds the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mark_untranslated_strings({'hello': None, 'world': 'world', 'test': None}) == {'hello': '\\u2264hello\\u2265', 'world': 'world', 'test': '\\u2264test\\u2265'}\", \"assert mark_untranslated_strings({'key1': None, 'key2': None, 'key3': 'value'}) == {'key1': '\... | {
"split": "train",
"index": 67229,
"acecode_id": "bigcode_python_fns_23562",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a history of counts and timestamps. Write a function called `manage_history` that takes an initial count and timestamp as parameters and allows updating the history with a new count and timestamp. The function should return the latest count and time... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_history(10, '2023-10-01T10:00:00', [(20, '2023-10-01T11:00:00'), (15, '2023-10-01T12:00:00')]) == (15, '2023-10-01T12:00:00')\", \"assert manage_history(5, '2023-10-01T09:00:00', [(3, '2023-10-01T10:30:00'), (8, '2023-10-01T10:45:00')]) == (8, '2023-1... | {
"split": "train",
"index": 67230,
"acecode_id": "oss_16013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a software license key based on certain criteria. The license key is represented as a string containing alphanumeric characters and dashes. The function should check if the license key is valid according to the follo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_license_key('ABCD-EFGH-IJKL-MNOP', 19, 4) == True\", \"assert validate_license_key('A-B-C-D-E-F-G-H', 15, 1) == True\", \"assert validate_license_key('ABCD-EFGH-IJKL', 16, 4) == False\", \"assert validate_license_key('ABCD-EFGH-IJKL-MNOPQ', 23, 4) =... | {
"split": "train",
"index": 67231,
"acecode_id": "oss_4803",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a CSV record. Your task is to implement a function that merges these CSV records into a single CSV record. Each record is assumed to have the same structure (i.e., the same number of columns). The output should be a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_csv_records(['name,age', 'Alice,30', 'Bob,25']) == 'name,age\\\\nAlice,30\\\\nBob,25'\", \"assert merge_csv_records(['id,name', '1,Alice', '2,Bob', '3,Charlie']) == 'id,name\\\\n1,Alice\\\\n2,Bob\\\\n3,Charlie'\", \"assert merge_csv_records(['product,p... | {
"split": "train",
"index": 67232,
"acecode_id": "oss_10141",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `get_class_name` that returns the string 'RigidTendonMuscle'. This function should not take any parameters and should simply return the specified class name as a constant string. Your implementation should be straightforward an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_class_name() == 'RigidTendonMuscle'\", \"assert get_class_name() == 'RigidTendonMuscle'\", \"assert get_class_name() == 'RigidTendonMuscle'\", \"assert get_class_name() == 'RigidTendonMuscle'\", \"assert get_class_name() == 'RigidTendonMuscle'\", \"asser... | {
"split": "train",
"index": 67233,
"acecode_id": "bigcode_python_fns_23042",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that calculates the aggregate sum of all odd integers between a given lower limit 'l' and upper limit 'r', where these integers are positive and not fractions. The function should return this aggregate sum. If the lower limit is greater than the upper ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_odd_numbers(1, 10) == 25\", \"assert sum_odd_numbers(0, 5) == 9\", \"assert sum_odd_numbers(6, 6) == 0\", \"assert sum_odd_numbers(7, 7) == 7\", \"assert sum_odd_numbers(1, 1) == 1\", \"assert sum_odd_numbers(15, 15) == 15\", \"assert sum_odd_numbers(-10... | {
"split": "train",
"index": 67234,
"acecode_id": "evol_29354",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a response processing function that handles incoming command responses. Your function should take three parameters: a boolean `response_received`, a string `status`, and a session object `session`. The function should perform the following actio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_response(True, 'success', mock_session) == None\", \"assert process_response(False, 'failure', mock_session) == None\", \"assert process_response(True, 'pending', mock_session) == None\", \"assert process_response(False, 'timeout', mock_session) == N... | {
"split": "train",
"index": 67235,
"acecode_id": "oss_6983",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an alphanumeric string as input and returns the product of all the individual digits present in the string. If there are no digits in the string, return 1.\nPlease reason step by step, then write a self-contained Python solution. Give your final ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_digits_in_string('a1b2c3d4e5') == 120\", \"assert product_of_digits_in_string('abc') == 1\", \"assert product_of_digits_in_string('x5y6z7') == 210\", \"assert product_of_digits_in_string('1234') == 24\", \"assert product_of_digits_in_string('0a1b2... | {
"split": "train",
"index": 67236,
"acecode_id": "evol_21222",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that identifies the domain specifier based on a given input domain. You need to implement a function `get_domain_specifier(input_domain)` that takes an input domain as an argument and returns the corresponding domain specifier. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_domain_specifier(ImageObjectDetectionDomainSpecifier) == ImageObjectDetectionDomainSpecifier\", \"assert get_domain_specifier(TextAnalysisDomainSpecifier) == TextAnalysisDomainSpecifier\", \"assert get_domain_specifier(SpeechRecognitionDomainSpecifier) =... | {
"split": "train",
"index": 67237,
"acecode_id": "oss_21161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `activate_user` that simulates the activation of a user account based on a unique activation code provided in the input. The function should take a single argument `code`, which is a string representing the activation code. If the activat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert activate_user('ABC123') == {'status': 'activated', 'message': 'User successfully activated.'}\", \"assert activate_user('XYZ456') == {'status': 'activated', 'message': 'User successfully activated.'}\", \"assert activate_user('LMN789') == {'status': 'activat... | {
"split": "train",
"index": 67238,
"acecode_id": "bigcode_python_fns_20395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of logits representing the output of a classification model, where each entry is an array of probabilities corresponding to different classes. You also have a list of true labels. Your task is to implement a function that calculates the accuracy of the mode... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_accuracy([[0.1, 0.8, 0.1], [0.2, 0.7, 0.1]], [1, 1]) == 1.0\", \"assert calculate_accuracy([[0.7, 0.3], [0.4, 0.6], [0.3, 0.7]], [[1, 0], [1, 0], [0, 1]]) == 0.6666666666666666\", \"assert calculate_accuracy([[0.1, 0.0, 0.9], [0.6, 0.3, 0.1]], [[0,... | {
"split": "train",
"index": 67239,
"acecode_id": "bigcode_python_fns_37372",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of odd numbers, implement a function that returns True if there exists a pair of unique numbers in the list such that the sum of the two numbers is divisible by 5. If no such pair exists, return False.\nPlease reason step by step, then write a self-contained Python... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_sum_divisible_by_five([1, 3, 5, 7]) == True\", \"assert odd_sum_divisible_by_five([11, 13, 17, 19]) == True\", \"assert odd_sum_divisible_by_five([3, 5, 7, 9]) == True\", \"assert odd_sum_divisible_by_five([1, 9, 11, 15]) == True\", \"assert odd_sum_divi... | {
"split": "train",
"index": 67240,
"acecode_id": "evol_19364",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a given file path ends with a specific extension. The function should take a file path as input and return a boolean value indicating whether the file has the specified extension. Your function should be named `has_e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_extension('document.pdf', '.pdf') == True\", \"assert has_extension('image.jpg', '.jpg') == True\", \"assert has_extension('report.docx', '.docx') == True\", \"assert has_extension('presentation.pptx', '.pptx') == True\", \"assert has_extension('archive.... | {
"split": "train",
"index": 67241,
"acecode_id": "oss_7961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string input and encodes it into UTF-8 bytes. The function should ensure that if the input is an empty string, it should return an empty byte string. If the input is a non-empty string, it should return the UTF-8 encoded byte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_to_utf8('Hello, World!') == b'Hello, World!'\", \"assert encode_to_utf8('') == b''\", \"assert encode_to_utf8('Python') == b'Python'\", \"assert encode_to_utf8('\\u4f60\\u597d') == b'\\\\xe4\\\\xbd\\\\xa0\\\\xe5\\\\xa5\\\\xbd'\", \"assert encode_to_ut... | {
"split": "train",
"index": 67242,
"acecode_id": "bigcode_python_fns_6235",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to control a traffic light system. The traffic light has three colors: red, yellow, and green. Your function should take a string command as input and return the state of the traffic lights based on the command. The supported commands are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert traffic_light_control('red on') == {'red': True, 'yellow': False, 'green': False}\", \"assert traffic_light_control('yellow on') == {'red': False, 'yellow': True, 'green': False}\", \"assert traffic_light_control('green on') == {'red': False, 'yellow': False... | {
"split": "train",
"index": 67243,
"acecode_id": "oss_9042",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, your task is to sort the list from high to low. The program should also correctly handle negative numbers and should be implemented using your own sorting algorithm, without using built-in or library functions. Implement a function `sort_descending(num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_descending([2, -5, 8, 3, 9, -6]) == [9, 8, 3, 2, -5, -6]\", \"assert sort_descending([-1, -2, -3, -4]) == [-1, -2, -3, -4]\", \"assert sort_descending([5, 3, 8, 6, 2]) == [8, 6, 5, 3, 2]\", \"assert sort_descending([0, 0, 0]) == [0, 0, 0]\", \"assert so... | {
"split": "train",
"index": 67244,
"acecode_id": "evol_30253",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `x` and `y`, representing the x and y coordinates of points on a 2D plane. Your task is to implement a function `maxlinedev(x, y)` that calculates the maximum distance between any two points from the contour formed by these coordinates and r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxlinedev([1], [2]) == (0.0, 0)\", \"assert maxlinedev([], []) == None\", \"assert maxlinedev([1, 2], [2, 3]) == (1.4142135623730951, 1)\", \"assert maxlinedev([1, 2, 3], [1, 2, 1]) == (2.0, 2)\", \"assert maxlinedev([-1, -2], [-1, -2]) == (1.41421356237309... | {
"split": "train",
"index": 67245,
"acecode_id": "oss_14791",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that categorizes a list of GitHub repository names into specific topics based on certain rules. Each repository name will either end with '_extension' or not. If it ends with '_extension', it should be categorized as 'ocds-extension',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_repositories(['repo1_extension', 'repo2', 'repo3_core_extension', 'repo4_community_extension']) == {'repo1_extension': ['ocds-extension'], 'repo2': ['ocds-profile'], 'repo3_core_extension': ['ocds-extension', 'ocds-core-extension'], 'repo4_communi... | {
"split": "train",
"index": 67246,
"acecode_id": "bigcode_python_fns_29757",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `evaluate_expression(expression: str, varMap: dict) -> Union[float, str]` that calculates the result of a mathematical expression given in infix notation. The expression may contain variables defined in the `varMap` dictionary. The function should replace t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('8 + 2 * (3 + 4)', {}) == 22\", \"assert evaluate_expression('a + b', {'a': 3, 'b': 2}) == 5\", \"assert evaluate_expression('2 * (3 + 4) / 2', {}) == 7.0\", \"assert evaluate_expression('4 / 0', {}) == 'Error: division by zero'\", \"asse... | {
"split": "train",
"index": 67247,
"acecode_id": "evol_28122",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a two-dimensional array representing pixel values of an image, where each value can be positive, negative, or zero. Your task is to implement a function that returns a new array based on the following rules: For each pixel in the input array, if the value is posit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_image([[1, -2, 0], [3, 4, -5]]) == [[1, 2, 0], [3, 4, 5]]\", \"assert transform_image([[0, 0, 0], [0, 0, 0]]) == [[0, 0, 0], [0, 0, 0]]\", \"assert transform_image([[1, 2, 3], [-1, -2, -3], [0, 0, 0]]) == [[1, 2, 3], [1, 2, 3], [0, 0, 0]]\", \"asse... | {
"split": "train",
"index": 67248,
"acecode_id": "bigcode_python_fns_46748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `req` that contains project information formatted in a specific way. The string is structured as follows: it starts with 'name: <project_name>', followed by 'owner: <first_name> <last_name>', and 'email: <email_address>'. Your task is to extract the proje... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_project_info('name: Project-Alpha\\\\nowner: Alice Smith\\\\nemail: alice@example.edu') == {'project_name': 'Project-Alpha', 'first_name': 'Alice', 'last_name': 'Smith', 'owner_type': 'internal'}\", \"assert extract_project_info('name: Project-Beta\\... | {
"split": "train",
"index": 67249,
"acecode_id": "bigcode_python_fns_14044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of user-defined settings for a web application. Each setting is represented as a dictionary with two keys: 'json_parsing' and 'log_level'. The 'json_parsing' key can have one of two values: 'DISABLED' or 'STANDARD', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_settings([{'json_parsing': 'STANDARD', 'log_level': 'NORMAL'}, {'json_parsing': 'DISABLED', 'log_level': 'VERBOSE'}]) == [True, True]\", \"assert validate_settings([{'json_parsing': 'INVALID', 'log_level': 'NORMAL'}, {'json_parsing': 'STANDARD', 'lo... | {
"split": "train",
"index": 67250,
"acecode_id": "bigcode_python_fns_25012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of cities represented by their coordinates as (x, y) and a route which is a list of indices representing the order in which the cities should be visited. Your task is to create a function that returns a list of coordinates of the cities in the order specifi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_route_coordinates([(0, 0), (1, 1), (2, 2)], [0, 1, 2]) == [(0, 0), (1, 1), (2, 2), (0, 0)]\", \"assert get_route_coordinates([(0, 0), (1, 2), (3, 4)], [1, 2, 0]) == [(1, 2), (3, 4), (0, 0), (1, 2)]\", \"assert get_route_coordinates([(5, 5), (10, 10), (15... | {
"split": "train",
"index": 67251,
"acecode_id": "bigcode_python_fns_1321",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to write a function that calculates the total area of the skyline formed by these buildings. The area is defined as the sum of the areas of the rectangles formed between each pair ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_skyline_area([0, 2, 0, 3, 0]) == 5\", \"assert calculate_skyline_area([5, 0, 5]) == 10\", \"assert calculate_skyline_area([]) == 0\", \"assert calculate_skyline_area([1]) == 1\", \"assert calculate_skyline_area([2, 2]) == 2\", \"assert calculate_sk... | {
"split": "train",
"index": 67252,
"acecode_id": "bigcode_python_fns_36314",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of participants and assigns each participant a unique number ranging from 1 to the length of the list. The function should return a dictionary where the keys are the participants' names and the values are the assigned... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_unique_numbers(['Alice', 'Bob', 'Charlie']) in [{'Alice': 1, 'Bob': 2, 'Charlie': 3}, {'Alice': 2, 'Bob': 1, 'Charlie': 3}, {'Alice': 3, 'Bob': 1, 'Charlie': 2}, {'Alice': 1, 'Bob': 3, 'Charlie': 2}, {'Alice': 2, 'Bob': 3, 'Charlie': 1}, {'Alice': 3, ... | {
"split": "train",
"index": 67253,
"acecode_id": "oss_7411",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You have been given a list of integers representing the number of views for a series of videos on a platform. Your task is to implement a function that takes this list as input and returns the maximum number of views that any single video has received. If the list is empty, ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_views([100, 200, 300]) == 300\", \"assert max_views([10, 50, 20, 50]) == 50\", \"assert max_views([1, 2, 3, 4, 5]) == 5\", \"assert max_views([5, 5, 5, 5]) == 5\", \"assert max_views([0, 0, 0]) == 0\", \"assert max_views([]) == 0\", \"assert max_views([9... | {
"split": "train",
"index": 67254,
"acecode_id": "bigcode_python_fns_17183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that parses a given data string to extract stock information. The data string will be in the format: 'SYMBOL,PRICE,VOLUME|SYMBOL,PRICE,VOLUME|...'. Each stock is separated by a pipe ('|') character. Your function should return a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_stock_data('AAPL,150.25,1000|GOOGL,1200.50,500|MSFT,200.75,750') == [{'symbol': 'AAPL', 'price': 150.25, 'volume': 1000}, {'symbol': 'GOOGL', 'price': 1200.50, 'volume': 500}, {'symbol': 'MSFT', 'price': 200.75, 'volume': 750}]\", \"assert parse_stock_... | {
"split": "train",
"index": 67255,
"acecode_id": "oss_14097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that takes a variable number of integer arguments and returns their product. Write a function `product_of_numbers(*args: int) -> int` that calculates the product of all the integers provided in the arguments. If no integers are provided, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_numbers(1, 2, 3) == 6\", \"assert product_of_numbers(0, 5, 10) == 0\", \"assert product_of_numbers(-1, -2, 3) == 6\", \"assert product_of_numbers(2) == 2\", \"assert product_of_numbers() == 1\", \"assert product_of_numbers(1, 0, 5) == 0\", \"asser... | {
"split": "train",
"index": 67256,
"acecode_id": "bigcode_python_fns_13400",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that modifies a given dictionary of keyword arguments by setting a default value for a specific key named 'order'. If the 'order' key is not already present in the dictionary, it should be set to a default value of 0. Your function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_default_order({}) == {'order': 0}\", \"assert set_default_order({'order': 1}) == {'order': 1}\", \"assert set_default_order({'foo': 'bar'}) == {'foo': 'bar', 'order': 0}\", \"assert set_default_order({'order': 5}) == {'order': 5}\", \"assert set_default_... | {
"split": "train",
"index": 67257,
"acecode_id": "bigcode_python_fns_40316",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a mathematical expression consisting of numbers and the operators '+', '-', '*', and '/', write a function that evaluates the expression and returns the result. The expression will be provided as a string without any spaces, and it will always be val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('10-2*3') == 4.0\", \"assert evaluate_expression('7*3-2') == 19.0\", \"assert evaluate_expression('8-3+2*2') == 9.0\", \"assert evaluate_expression('5*5-1') == 24.0\", \"assert evaluate_expression('2+3*4-8/2') == 10.0\", \"assert evaluate... | {
"split": "train",
"index": 67258,
"acecode_id": "bigcode_python_fns_11314",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a string representing key-value pairs in a configuration format. The input string consists of multiple lines, each containing a key and its corresponding value separated by an equal sign (=). Lines that start with a has... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_config('# This is a comment\\\\nkey1 = value1\\\\nkey2 = value2') == {'key1': 'value1', 'key2': 'value2'}\", \"assert parse_config('key1=value1\\\\n# comment\\\\nkey2=value2') == {'key1': 'value1', 'key2': 'value2'}\", \"assert parse_config('key1=value... | {
"split": "train",
"index": 67259,
"acecode_id": "oss_28101",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list filled with programming languages represented as strings, implement a function that sorts the languages in reverse alphabetical order while considering case insensitivity. The function should modify the input list in place and return the sorted list.\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_languages(['Csharp', 'Go', 'Ruby', 'Kotlin']) == ['Ruby', 'Kotlin', 'Go', 'Csharp']\", \"assert sort_languages(['java', 'javascript', 'Java']) == ['javascript', 'java', 'Java']\", \"assert sort_languages(['swift', 'SWIFT', 'Swift']) == ['swift', 'SWIFT'... | {
"split": "train",
"index": 67260,
"acecode_id": "evol_35349",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `x` and a set of integers `inArray`, write a function `filter_and_sort` that filters the elements from `x` which are also present in `inArray`, adds them to `inArray`, and returns the sorted list of unique elements from `inArray`. The function should ma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sort([3, 5, 2, 7, 5], {2, 5, 8, 10}) == [2, 5]\", \"assert filter_and_sort([1, 3, 4, 5], {5, 6, 7}) == [5]\", \"assert filter_and_sort([10, 20, 30], {40, 20, 10}) == [10, 20]\", \"assert filter_and_sort([5, 5, 5], {5}) == [5]\", \"assert filter_an... | {
"split": "train",
"index": 67261,
"acecode_id": "oss_28142",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing job data from multiple sources and performing a series of operations on it. You need to implement a function called `process_jobs` that takes a dictionary of job sources, where each source is represented as a dictionary containing an `extract_func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_jobs({ 'source1': {'extract_func': lambda: ['developer', 'designer']}, 'source2': {'extract_func': lambda: ['manager']}}) == ['DEVELOPER', 'DESIGNER', 'MANAGER']\", \"assert process_jobs({ 'source1': {'extract_func': lambda: []}, 'source2': {'extract... | {
"split": "train",
"index": 67262,
"acecode_id": "bigcode_python_fns_20687",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that rotates an array to the left by a given number of positions. The rotation should be done in-place, meaning you should not use any additional arrays or lists. The function should take an array and an integer d as parameters, where d is the number of pos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotateArr([1, 2, 3, 4, 5, 6], 2) == [3, 4, 5, 6, 1, 2]\", \"assert rotateArr([1, 2, 3, 4, 5], 3) == [4, 5, 1, 2, 3]\", \"assert rotateArr([1], 0) == [1]\", \"assert rotateArr([1, 2, 3], 1) == [2, 3, 1]\", \"assert rotateArr([1, 2, 3, 4, 5, 6], 6) == [1, 2, 3... | {
"split": "train",
"index": 67263,
"acecode_id": "evol_15475",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of Event objects and extracting all data lake records from them. Each Event object has an attribute `datalake_records` which is a list of integers. Your task is to implement a function `get_all_records(events: List[Event]) -> List[int]` tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_all_records([Event([1, 2, 3]), Event([4, 5, 6])]) == [1, 2, 3, 4, 5, 6]\", \"assert get_all_records([Event([7, 8]), Event([9])]) == [7, 8, 9]\", \"assert get_all_records([Event([]), Event([])]) == []\", \"assert get_all_records([Event([10]), Event([20, 3... | {
"split": "train",
"index": 67264,
"acecode_id": "oss_9817",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `text`, write a function `count_words(text: str) -> int` that returns the total number of words in the string. A word is defined as a sequence of characters separated by whitespace. Words can include letters, numbers, and special characters but must be non-empty.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words('Hello world') == 2\", \"assert count_words(' Leading and trailing spaces ') == 4\", \"assert count_words('OneWord') == 1\", \"assert count_words(' ') == 0\", \"assert count_words('123 456 789') == 3\", \"assert count_words('!@# $%^ &*()') == ... | {
"split": "train",
"index": 67265,
"acecode_id": "bigcode_python_fns_35970",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries, `dict1` and `dict2`, that may contain nested dictionaries as values. Your task is to write a function `merge_dicts(dict1, dict2)` that merges these two dictionaries. The merging process should follow these rules: If both dictionaries contain the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_dicts({'a': 1, 'b': {'c': 3}}, {'b': {'d': 4}, 'e': 5}) == {'a': 1, 'b': {'c': 3, 'd': 4}, 'e': 5}\", \"assert merge_dicts({'x': {'y': 1}}, {'x': {'y': 2}, 'z': 3}) == {'x': {'y': 2}, 'z': 3}\", \"assert merge_dicts({'key1': 'value1'}, {'key1': 'value2... | {
"split": "train",
"index": 67266,
"acecode_id": "bigcode_python_fns_21550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of topic strings and a regex pattern. Your task is to implement a function that returns a list of topics that match the given regex pattern. Each topic in the returned list should be in lowercase. The function signature is as follows: \n\n```python\ndef get... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_matching_topics(['Building/LAB/Device1', 'Building/LAB/Device2', 'Building/Office/Device1'], 'Building\\\\/LAB\\\\/Device.*') == ['building/lab/device1', 'building/lab/device2']\", \"assert get_matching_topics(['Building/Room1/MixedAir', 'Building/Room2/... | {
"split": "train",
"index": 67267,
"acecode_id": "bigcode_python_fns_47740",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that removes all punctuation from a given string except for periods and commas. Additionally, convert all uppercase letters to lowercase. The function should take a single string as input and return the modified string.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_some_punctuation('Hello, World! Are you 100% sure?') == 'hello, world are you 100 sure'\", \"assert remove_some_punctuation('Python is Fun!') == 'python is fun'\", \"assert remove_some_punctuation('This is a test...') == 'this is a test...'\", \"asser... | {
"split": "train",
"index": 67268,
"acecode_id": "evol_844",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing test results, where each integer is either 0 (indicating a failed test) or 1 (indicating a passed test). Write a function `analyze_tests(results: List[int]) -> Tuple[int, int]` that returns a tuple containing the number of passed te... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_tests([1, 1, 1]) == (3, 0)\", \"assert analyze_tests([0, 0, 0]) == (0, 3)\", \"assert analyze_tests([1, 0, 1]) == (2, 1)\", \"assert analyze_tests([1]) == (1, 0)\", \"assert analyze_tests([0]) == (0, 1)\", \"assert analyze_tests([1, 1, 0, 0, 1]) == (... | {
"split": "train",
"index": 67269,
"acecode_id": "bigcode_python_fns_48210",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `check_singularity_wrapper` that verifies whether a given configuration allows the use of Singularity and if the necessary wrapper files are present to support it. The function should take the following parameters: a dictionary `descr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_singularity_wrapper({'file1': True}, {'GLIDEIN_Singularity_Use': {'value': 'OPTIONAL'}}, {'GLIDEIN_Singularity_Use': {'value': 'OPTIONAL'}}, 'group1') == True\", \"assert check_singularity_wrapper({'file1': True, 'file2': False}, {'GLIDEIN_Singularity_... | {
"split": "train",
"index": 67270,
"acecode_id": "bigcode_python_fns_5567",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that returns the unique identifier of a device based on its properties. The function should take a list of device properties as input and return an integer representing the device id. Each device is uniquely identified by a combinatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_device_id(['model_x', 'version_1.0']) == hash(('model_x', 'version_1.0'))\", \"assert get_device_id(['model_y', 'version_2.0', 'color_red']) == hash(('model_y', 'version_2.0', 'color_red'))\", \"assert get_device_id(['model_a']) == hash(('model_a',))\", ... | {
"split": "train",
"index": 67271,
"acecode_id": "bigcode_python_fns_16780",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid world represented as an array, where each cell can either be empty (0) or contain a positive integer representing a reward. The agent starts at the top-left corner of the grid and can move in four directions: up, down, left, and right. Your task is to im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert random_walk_reward([[0, 0], [0, 10]], 5) in [0, 10]\", \"assert random_walk_reward([[0]], 10) == 0\", \"assert random_walk_reward([[1, 2], [3, 4]], 1) in [1, 2, 3, 4]\", \"assert random_walk_reward([[0, 1], [2, 3]], 3) in [0, 1, 2, 3, 4, 5]\", \"assert rando... | {
"split": "train",
"index": 67272,
"acecode_id": "oss_923",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that verifies the validity of a password based on certain criteria. The function should take a single string parameter, `password`, and return a boolean value indicating whether the password is valid or not. A valid password must m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_password('Password1@') == True\", \"assert is_valid_password('pass') == False\", \"assert is_valid_password('PASSWORD123') == False\", \"assert is_valid_password('Password') == False\", \"assert is_valid_password('password1!') == False\", \"assert i... | {
"split": "train",
"index": 67273,
"acecode_id": "oss_9807",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of strings, where each string represents the text content of a document paragraph. Your function should concatenate all the strings together and count the total number of stars ('*') present in the combined te... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_paragraphs(['Hello', 'World*', 'This is a test*']) == ('HelloWorld*This is a test*', 2)\", \"assert process_paragraphs(['No stars here', 'Just text', '']) == ('No stars hereJust text', 0)\", \"assert process_paragraphs(['*First star', '*Second star*'... | {
"split": "train",
"index": 67274,
"acecode_id": "oss_2251",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that matches words that can be confused for each other but contain different characters. Specifically, you need to implement a function called `match_confusables` that takes two parameters: a list of words and an input word. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_confusables(['stop', 'tops', 'spot', 'pots', 'opts'], 'stop') == ['tops', 'spot', 'pots', 'opts']\", \"assert match_confusables(['stop', 'tops', 'spot', 'pots'], 'Stop') == ['tops', 'spot', 'pots']\", \"assert match_confusables(['abc', 'acb', 'bac', 'c... | {
"split": "train",
"index": 67275,
"acecode_id": "oss_36081",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of to-do items, where each item is represented as a dictionary containing 'title', 'description', 'completed', and 'due_date'. The function should return a list of titles of the to-do items that are marked as completed. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_completed_titles([{'title': 'Task 1', 'description': 'Description 1', 'completed': True, 'due_date': '2023-10-01'}, {'title': 'Task 2', 'description': 'Description 2', 'completed': False, 'due_date': '2023-10-02'}]) == ['Task 1']\", \"assert get_complete... | {
"split": "train",
"index": 67276,
"acecode_id": "oss_36450",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of partition strings in the format 'key=value' and a corresponding list of integers representing the number of rows for each partition. Your task is to implement a function that takes in these two lists and returns a dictionary where the keys are the values... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_partition_to_num_rows(['year=2020', 'year=2021'], [100, 200]) == {'2020': 100, '2021': 200}\", \"assert get_partition_to_num_rows(['month=01', 'month=02', 'month=03'], [150, 250, 350]) == {'01': 150, '02': 250, '03': 350}\", \"assert get_partition_to_num... | {
"split": "train",
"index": 67277,
"acecode_id": "bigcode_python_fns_8977",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that accepts a list of template designs and their corresponding performance metrics from an A/B testing service. The function should return the design that has the highest performance metric. If there are multiple designs with the sam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_best_design([('Design A', 0.75), ('Design B', 0.85), ('Design C', 0.80)]) == 'Design B'\", \"assert get_best_design([('Design X', 0.90), ('Design Y', 0.90), ('Design Z', 0.60)]) == 'Design X'\", \"assert get_best_design([('Template 1', 1.0), ('Template 2... | {
"split": "train",
"index": 67278,
"acecode_id": "evol_6472",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a platform string based on its components: operating system (OS), architecture, and variant. The function should take in a platform string formatted as 'OS/Architecture/Variant', where the OS and Architecture are mandatory,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_platform('linux/amd64') == ('linux', 'amd64', None)\", \"assert validate_platform('windows/x86/server') == ('windows', 'x86', 'server')\", \"assert validate_platform('macos/arm/desktop') == ('macos', 'arm', 'desktop')\", \"assert validate_platform('... | {
"split": "train",
"index": 67279,
"acecode_id": "bigcode_python_fns_13582",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file names in a directory. Each file name may have a '.nii.gz' extension. Your task is to implement a function that filters out the valid file names that have the '.nii.gz' extension and returns a list of these valid file names. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_nifti_files(['image1.nii.gz', 'image2.txt', 'image3.nii.gz']) == ['image1.nii.gz', 'image3.nii.gz']\", \"assert filter_nifti_files(['test.nii.gz', 'example.nii.gz', 'sample.nii']) == ['test.nii.gz', 'example.nii.gz']\", \"assert filter_nifti_files(['f... | {
"split": "train",
"index": 67280,
"acecode_id": "bigcode_python_fns_14421",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a rectangle of height h and width w. You can make horizontal cuts at certain positions defined in the list horizontalCuts, and vertical cuts at positions defined in the list verticalCuts. Additionally, there are obstacles located at specific coordinates in the lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxArea(5, 4, [1, 2], [1, 3], [[2, 2], [4, 1]]) == 3\", \"assert maxArea(6, 6, [1, 2, 5], [1, 3, 4], []) == 6\", \"assert maxArea(10, 10, [1, 5, 9], [2, 4, 6], [[3, 3], [5, 5]]) == 16\", \"assert maxArea(3, 3, [1, 2], [1, 2], [[1, 1]]) == 1\", \"assert maxAr... | {
"split": "train",
"index": 67281,
"acecode_id": "evol_25634",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, return a sorted list of their shared elements. If the median of the shared elements is greater than or equal to the maximum of the shared elements, exclude the median from the final output. The output should be sorted in ascending order. Implement t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shared_elements([1, 2, 3, 4, 5], [3, 4, 5, 6, 7]) == [3, 4, 5]\", \"assert shared_elements([10, 20, 30, 40], [30, 40, 50, 60]) == [30, 40]\", \"assert shared_elements([1, 1, 2, 3], [3, 2, 2, 1]) == [1, 2, 3]\", \"assert shared_elements([5, 10, 15], [1, 2, 3]... | {
"split": "train",
"index": 67282,
"acecode_id": "evol_12006",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the average position of points in a given jar. Each jar is identified by a unique ID, and for each jar, you are provided with a list of points, where each point has an x and a y coordinate. Your task is to implement a function `average_position(j... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_position(1, [{'x': 1, 'y': 2}, {'x': 3, 'y': 4}, {'x': 5, 'y': 6}]) == (3.0, 4.0)\", \"assert average_position(2, [{'x': 2, 'y': 3}, {'x': 4, 'y': 5}, {'x': 6, 'y': 7}]) == (4.0, 5.0)\", \"assert average_position(3, [{'x': 0, 'y': 0}, {'x': 10, 'y': ... | {
"split": "train",
"index": 67283,
"acecode_id": "oss_11361",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of integers representing pixel values in an image. The function should take this input list, determine the maximum and minimum pixel values, and return a new list where each pixel value is normalized to th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_image([50, 100, 150]) == [0, 127, 255]\", \"assert normalize_image([0, 0, 0]) == [0, 0, 0]\", \"assert normalize_image([100, 100, 100]) == [0, 0, 0]\", \"assert normalize_image([255, 0]) == [255, 0]\", \"assert normalize_image([5]) == [0]\", \"asse... | {
"split": "train",
"index": 67284,
"acecode_id": "oss_28157",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts bounding box coordinates from the format (xmin, ymin, xmax, ymax) into a normalized format (center_x/width, center_y/height, box_width/width, box_height/height) based on the size of an image. The function `convert(size, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert((800, 600), (200, 150, 600, 450)) == (0.5, 0.5, 0.5, 0.5)\", \"assert convert((640, 480), (0, 0, 640, 480)) == (0.5, 0.5, 1.0, 1.0)\", \"assert convert((1920, 1080), (960, 540, 1920, 1080)) == (0.75, 0.75, 0.5, 0.5)\", \"assert convert((500, 500), (2... | {
"split": "train",
"index": 67285,
"acecode_id": "oss_459",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `unique_word_frequency(sentence1: str, sentence2: str, sentence3: str) -> Tuple[List[str], Dict[str, int]]` that takes three sentences as input and returns a tuple containing a list of unique words (words that appear only once across all sentences) and a di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_word_frequency('apple banana', 'banana orange', 'orange apple') == ([], {'apple': 2, 'banana': 2, 'orange': 2})\", \"assert unique_word_frequency('cat dog', 'cat', 'dog') == ([], {'cat': 2, 'dog': 2})\", \"assert unique_word_frequency('quick brown fox... | {
"split": "train",
"index": 67286,
"acecode_id": "evol_12362",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function to calculate the Hamming distance between two strings of equal length. The Hamming distance is defined as the number of positions at which the corresponding characters are different. If the strings are not of the same length, the function should raise a ValueEr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hamming_distance('abc', 'abd') == 1\", \"assert hamming_distance('10101', '10011') == 2\", \"assert hamming_distance('hello', 'hallo') == 1\", \"assert hamming_distance('string', 'strong') == 1\", \"assert hamming_distance('abcd', 'abcd') == 0\", \"assert ha... | {
"split": "train",
"index": 67287,
"acecode_id": "evol_2398",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that pauses multiple services provided in a list. The function should take in a list of services as input and return a list indicating whether each service has been successfully paused or not. If a service fails to pause, it should be mar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pause_services(['service1', 'service2', 'service3']) == ['Paused', 'Paused', 'Paused']\", \"assert pause_services(['serviceZ']) == ['Paused']\", \"assert pause_services([]) == []\", \"assert pause_services(['service1']) == ['Paused']\", \"assert pause_servic... | {
"split": "train",
"index": 67288,
"acecode_id": "bigcode_python_fns_28696",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, an integer `k`, and a string `p` representing the priority order, implement a function `rearrange_string(s: str, k: int, p: str) -> str`. The function should rearrange the characters in `s` such that identical characters are separated by at least `k` indices... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_string('aabbcc', 3, 'abc') == 'abcabc'\", \"assert rearrange_string('aaabc', 3, 'abc') == ''\", \"assert rearrange_string('aaadbbcc', 2, 'abcd') == 'abacabcd'\", \"assert rearrange_string('abc', 1, 'abc') == 'abc'\", \"assert rearrange_string('aabb... | {
"split": "train",
"index": 67289,
"acecode_id": "evol_5298",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_weight(groceries)` that calculates the total weight of groceries in a shopping basket based on their category. Each category has different measurement units: 'fruits_vegetables' should be measured in kilograms, 'beverages' in liters (which is equival... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_weight([{'item':'peach', 'weight':0.70, 'category':'fruits_vegetables'}, {'item':'beer', 'volume':0.75, 'category':'beverages'}]) == 1.45\", \"assert calculate_weight([{'item':'onion', 'weight':0.40, 'category':'fruits_vegetables'}, {'item':'lime',... | {
"split": "train",
"index": 67290,
"acecode_id": "evol_18192",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an integer n (2 ≤ n ≤ 10^6) as input and returns a tuple containing a list of the prime factors of n and a dictionary that displays each factor's occurrence frequency in the factorization. The factors should be listed according to their frequency... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorize(8) == ([2, 2, 2], {2: 3}, {2: True})\", \"assert factorize(25) == ([5, 5], {5: 2}, {5: True})\", \"assert factorize(70) == ([2, 5, 7], {2: 1, 5: 1, 7: 1}, {2: True, 5: True, 7: True})\", \"assert factorize(1) == ([], {}, {})\", \"assert factorize(2... | {
"split": "train",
"index": 67291,
"acecode_id": "evol_16210",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating all possible combinations of elements from multiple input lists. Write a function `generate_combinations(input_lists)` that takes a list of input lists and returns a list containing all possible combinations of elements from these lists. Each comb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_combinations([[1, 2], ['a', 'b']]) == [(1, 'a'), (1, 'b'), (2, 'a'), (2, 'b')]\", \"assert generate_combinations([[1], ['a'], ['x', 'y']]) == [(1, 'a', 'x'), (1, 'a', 'y')]\", \"assert generate_combinations([[1, 3], [4, 5]]) == [(1, 4), (1, 5), (3, ... | {
"split": "train",
"index": 67292,
"acecode_id": "oss_30490",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sum_of_two_values(a, b)` that takes two parameters and returns their sum. The function should handle exceptions for the following cases: (1) if either `a` or `b` is not a numeric value (i.e., not an int or float), it should raise a ValueError with the mess... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_two_values(1, 2) == 3\", \"assert sum_of_two_values(-1, 1) == 0\", \"assert sum_of_two_values(1.5, 2.5) == 4.0\", \"assert sum_of_two_values(0, 0) == 0\", \"assert sum_of_two_values(1, 2.9999999999999999) == 4.0\", \"assert sum_of_two_values(2.2, 3.3)... | {
"split": "train",
"index": 67293,
"acecode_id": "evol_21194",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Create a function that accepts an acronym and returns its full form based on a predefined list of acronyms and their corresponding full forms. The function should be case insensitive. If the acronym is not in the list, the function should return 'Acronym not found in predefined... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_acronym('GDP') == 'Gross Domestic Product'\", \"assert find_acronym('FBI') == 'Federal Bureau of Investigation'\", \"assert find_acronym('BBC') == 'British Broadcasting Corporation'\", \"assert find_acronym('NASA') == 'National Aeronautics and Space Adm... | {
"split": "train",
"index": 67294,
"acecode_id": "evol_17239",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of records, where each record is a dictionary containing various key-value pairs. Each dictionary represents information about a genome and contains the keys: 'genome_id' (a string), 'patric_genome' (an integer), and other integer attributes representing ad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_genomes([{'genome_id': 'G1', 'patric_genome': 2, 'data': 10}, {'genome_id': 'G2', 'patric_genome': 1, 'data': 20}, {'genome_id': 'G3', 'patric_genome': 2, 'data': 30}]) == [{'genome_id': 'G2', 'patric_genome': 1, 'data': 20}, {'genome_id': 'G1', 'patric... | {
"split": "train",
"index": 67295,
"acecode_id": "bigcode_python_fns_14275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates drawing rectangles on a canvas. The function should accept a list of rectangles, where each rectangle is represented as a tuple containing the coordinates of the top-left corner (x, y), width, and height. Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_area([(0, 0, 2, 2)]) == 4\", \"assert calculate_total_area([(0, 0, 2, 2), (1, 1, 2, 2)]) == 7\", \"assert calculate_total_area([(0, 0, 2, 2), (2, 0, 2, 2)]) == 8\", \"assert calculate_total_area([(1, 1, 3, 3), (0, 0, 5, 5)]) == 25\", \"assert... | {
"split": "train",
"index": 67296,
"acecode_id": "oss_24566",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary for a file exchange system that contains user information. Each user is represented by a dictionary with fields such as 'username' and 'password'. Write a function `configValid` that checks whether the configuration is valid based on the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configValid({'sam': {'username': 'user1', 'password': 'pass1'}, 'alice': {'username': 'user2', 'password': 'pass2'}}) == True\", \"assert configValid({'sam': {'username': 'user1', 'password': None}, 'alice': {'username': 'user2', 'password': 'pass2'}}) == Fa... | {
"split": "train",
"index": 67297,
"acecode_id": "oss_28347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `calculate_market_value` that takes in three parameters: `brand` (a string), `model` (a string), and `year` (an integer). The function should return the market value of the bicycle based on the given year, using the following formula: market value = ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_market_value('Giant', 'Defy', 2020) == 900\", \"assert calculate_market_value('Specialized', 'Roubaix', 2018) == 800\", \"assert calculate_market_value('Cannondale', 'Synapse', 2021) == 950\", \"assert calculate_market_value('Bianchi', 'Oltre', 201... | {
"split": "train",
"index": 67298,
"acecode_id": "evol_9027",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dates and a corresponding list of silver volume values (in tons) for those dates. Your task is to implement a function that takes two parameters: a list of strings representing dates in the format 'YYYY-MM-DD' and a list of floats representing silver vol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_silver_volume_dict(['2023-01-01', '2023-01-02'], [100.0, 200.0]) == {'2023-01-01': 100.0, '2023-01-02': 200.0}\", \"assert build_silver_volume_dict(['2023-01-01', '2023-01-01'], [100.0, 150.0]) == {'2023-01-01': 150.0}\", \"assert build_silver_volume_d... | {
"split": "train",
"index": 67299,
"acecode_id": "bigcode_python_fns_46276",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.