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 creating a function that allows you to set and get a global variable independently. Implement a function, `global_var_manager`, that takes two parameters: `value` (an integer) and `operation` (a string). The `operation` can be 'set' or 'get'. If the operatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert global_var_manager(10, 'set') is None\", \"assert global_var_manager(20, 'set') is None\", \"assert global_var_manager(30, 'set') is None\", \"assert global_var_manager(40, 'set') is None\", \"assert global_var_manager(50, 'set') is None\", \"assert global_v... | {
"split": "train",
"index": 6200,
"acecode_id": "bigcode_python_fns_15364",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string `procedure` that represents a Python function's signature (including its annotations), write a function `is_annotated(procedure: str) -> bool` that returns True if the function is annotated with type hints, otherwise return False. A function is considered annotat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_annotated('def my_function(a: int, b: str) -> None:') == True\", \"assert is_annotated('def another_function(x: float) -> int:') == True\", \"assert is_annotated('def no_annotation(param):') == False\", \"assert is_annotated('def func_with_return() -> str... | {
"split": "train",
"index": 6201,
"acecode_id": "bigcode_python_fns_44399",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates an HTML email body for a password reset email. The function should take in the user's name and a token, and then return an HTML string formatted with the user's details and the token for the password reset. The HTML tem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_reset_password_email('Alice', 'abc123') == '<html>\\\\n<body>\\\\n <p>Dear Alice,</p>\\\\n <p>We have received a request to reset your password. Please use the following token to reset your password:</p>\\\\n <p><strong>abc123</strong></p>\... | {
"split": "train",
"index": 6202,
"acecode_id": "oss_27135",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `extract_email_info` that takes a string representing the content of an email in .eml format and returns a dictionary containing the date, sender, and subject of the email. The function should parse the provided email content and extract these specific metadata... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_email_info('From: sender@example.com\\\\nDate: Tue, 1 Feb 2022 10:00:00 -0500\\\\nSubject: Test Email\\\\n\\\\nHello World!') == {'date': 'Tue, 1 Feb 2022 10:00:00 -0500', 'sender': 'sender@example.com', 'subject': 'Test Email'}\", \"assert extract_e... | {
"split": "train",
"index": 6203,
"acecode_id": "evol_26217",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a quaternion represented as a list of four elements [w, x, y, z], where w is the real part and x, y, z are the imaginary parts, write a function that returns a 4x4 matrix A_L(p) that describes the action of quaternion multiplication. This matrix should be such that when i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert A_L([1, 2, 3, 4]) == [[1, -2, -3, -4], [2, 1, -4, 3], [3, 4, 1, -2], [4, -3, 2, 1]]\", \"assert A_L([0, 0, 0, 0]) == [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]\", \"assert A_L([1, 0, 0, 0]) == [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0... | {
"split": "train",
"index": 6204,
"acecode_id": "bigcode_python_fns_17076",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given two numerical strings, implement a function that extracts the first quartet of numerical values from each string and calculates the sum of the digits in both quartets. The first quartet must have a leading digit that is not zero. If the string does not contain a valid qua... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_quartets('1234', '5678') == 36\", \"assert sum_of_quartets('', '1234') == 10\", \"assert sum_of_quartets('!!!1234!!!', '5678') == 36\", \"assert sum_of_quartets('A1234B', 'C5678') == 36\", \"assert sum_of_quartets('', '') == 0\"]}"
} | {
"split": "train",
"index": 6205,
"acecode_id": "evol_13565",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that accepts a dictionary where keys are strings and values are integers. The function should return a list of strings formatted as 'key: value' for each key-value pair in the dictionary. If the input is not a dictionary, return an empty list.\nPlease re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_dict({'a': 1, 'b': 2}) == ['a: 1', 'b: 2']\", \"assert format_dict({'name': 10, 'age': 20}) == ['name: 10', 'age: 20']\", \"assert format_dict({'x': 5}) == ['x: 5']\", \"assert format_dict({}) == []\", \"assert format_dict({'key1': 0, 'key2': -1}) == ... | {
"split": "train",
"index": 6206,
"acecode_id": "evol_29848",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a string containing JSON data. The function should attempt to parse the JSON data and handle any potential errors during the parsing process. If parsing fails, the function should implement a retry mechanism with a dela... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_json_string('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert parse_json_string('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}') == {'name': 'John', 'age': 30}\", \"assert parse_json_string('{\\\"array\\\": [1, 2, 3]}') == {'array': [1, 2... | {
"split": "train",
"index": 6207,
"acecode_id": "oss_14257",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether the training of a reinforcement learning agent should continue based on certain criteria. The function `should_continue_training` takes the following parameters: `last_debug_time` (the timestamp of the last deb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert should_continue_training(10.0, 5.0, 300.0, 5, 2, 10, 50.0, 60.0, 0.0) == True\", \"assert should_continue_training(10.0, 5.0, 310.0, 5, 2, 10, 50.0, 60.0, 0.0) == False\", \"assert should_continue_training(10.0, 5.0, 300.0, 5, 11, 10, 50.0, 60.0, 0.0) == Fal... | {
"split": "train",
"index": 6208,
"acecode_id": "oss_28349",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of y-values representing data points from a plot, a reference value that represents the maximum value of these data points, and a maximum limit for the y-axis, implement a function that scales the y-values so that the maximum value of the data points is equal to th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scale_y_values([1, 2, 3], 3, 1) == ([0.3333333333333333, 0.6666666666666666, 1.0], 0.3333333333333333)\", \"assert scale_y_values([5, 15, 25], 25, 5) == ([1.0, 3.0, 5.0], 0.2)\", \"assert scale_y_values([0, 0, 0], 1, 10) == ([0, 0, 0], 10.0)\", \"assert scal... | {
"split": "train",
"index": 6209,
"acecode_id": "bigcode_python_fns_623",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of five weights (which can be both integers and floating-point numbers) as input and returns the highest and lowest weights among them. The input list will always contain exactly five weights. Your function should have t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_highest_and_lowest([70.5, 82.3, 65.0, 90.2, 75.1]) == (90.2, 65.0)\", \"assert find_highest_and_lowest([50, 50.5, 51, 49.9, 50.1]) == (51, 49.9)\", \"assert find_highest_and_lowest([100.0, 200.0, 150.0, 175.0, 125.0]) == (200.0, 100.0)\", \"assert find_... | {
"split": "train",
"index": 6210,
"acecode_id": "oss_17183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing data points. Your task is to implement a function called `compute_average(data)` that calculates and returns the average of the given list of integers. If the list is empty, return 0. The average should be calculated as the sum of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_average([1, 2, 3, 4, 5]) == 3.0\", \"assert compute_average([10, 20, 30]) == 20.0\", \"assert compute_average([-1, -2, -3]) == -2.0\", \"assert compute_average([0]) == 0.0\", \"assert compute_average([]) == 0\", \"assert compute_average([1]) == 1.0\"... | {
"split": "train",
"index": 6211,
"acecode_id": "evol_18622",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a project management system for a data science team. Your task is to implement a function that generates a report summarizing the run results for a specific project. The function should take the following parameters: \n- `runs`: A list of dictionaries where e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_run_report([{'proj_id': 1, 'run_id': 101, 'tab_name': 'A', 'row_count': 50}]) == [(1, 101, 'A', 50)]\", \"assert generate_run_report([{'proj_id': 2, 'run_id': 202, 'tab_name': 'B', 'row_count': 100}, {'proj_id': 3, 'run_id': 303, 'tab_name': 'C', 'r... | {
"split": "train",
"index": 6212,
"acecode_id": "oss_16387",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two documents represented as strings: 'suspicious_text' and 'source_text'. You also have a list of plagiarism cases, where each case is represented by a tuple of indices indicating the start and end of the sentences in both documents. Your task is to implement a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_plagiarism_cases([[(0, 1), (0, 1)]], 'Hello world!', 'Hello world!', 5) == [[(0, 1), (0, 1)]]\", \"assert filter_plagiarism_cases([[(0, 1), (0, 1)]], 'abc def', 'xyz abc def', 3) == [[(0, 1), (0, 1)]]\", \"assert filter_plagiarism_cases([[(0, 1), (0, ... | {
"split": "train",
"index": 6213,
"acecode_id": "bigcode_python_fns_22084",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a given usage information string by replacing newline characters (`\\n`) with spaces. The function should take a single string parameter, `usage_info`, which may contain multiple lines. Your goal is to return a single line st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_usage('Job status:\\\\nPENDING\\\\nRUNNING\\\\nCOMPLETED\\\\nFAILED') == 'Job status: PENDING RUNNING COMPLETED FAILED'\", \"assert format_usage('Line 1\\\\nLine 2') == 'Line 1 Line 2'\", \"assert format_usage('Single line with no newlines') == 'Singl... | {
"split": "train",
"index": 6214,
"acecode_id": "oss_20919",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes an exception type and an exception value as input parameters and returns a string representation of the exception. The function should return the formatted exception message which includes only the error type and error value, j... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_exception_message('ValueError', 'Invalid value') == 'ValueError Invalid value'\", \"assert format_exception_message('TypeError', 'Unsupported operation') == 'TypeError Unsupported operation'\", \"assert format_exception_message('KeyError', 'Key not fo... | {
"split": "train",
"index": 6215,
"acecode_id": "bigcode_python_fns_7414",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of IP addresses representing network-attached storage (NAS) devices. Each NAS has a certain number of disks and you need to perform a series of operations on these NAS devices. Your task is to implement a function that takes a list of NAS IP addresses and r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_nas_with_disks(['192.168.1.1', '192.168.1.2', '192.168.1.3'], 2) == 3\", \"assert count_nas_with_disks(['10.0.0.1', '10.0.0.2', '10.0.0.3', '10.0.0.4'], 10) == 0\", \"assert count_nas_with_disks(['192.168.0.1'], 2) == 0\", \"assert count_nas_with_disks... | {
"split": "train",
"index": 6216,
"acecode_id": "bigcode_python_fns_27527",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves all records from a given list of virtual storage arrays, filtering out any arrays marked as deleted. Each virtual storage array is represented by a dictionary containing at least the following keys: 'id', 'name', and 'delet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_active_storage_arrays([{'id': '1', 'name': 'VSA1', 'deleted': False}, {'id': '2', 'name': 'VSA2', 'deleted': True}, {'id': '3', 'name': 'VSA3', 'deleted': False}]) == [{'id': '1', 'name': 'VSA1', 'deleted': False}, {'id': '3', 'name': 'VSA3', 'deleted': ... | {
"split": "train",
"index": 6217,
"acecode_id": "bigcode_python_fns_24369",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates reading an ultrasound distance measurement. The function should take two parameters, `pin_trigger` and `pin_echo`, which represent the GPIO pins used for triggering and receiving the ultrasound signal. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_ultrasound_distance(3, 4) == 1.23\", \"assert get_ultrasound_distance(1, 2) == 1.23\", \"assert get_ultrasound_distance(5, 6) == 1.23\", \"assert get_ultrasound_distance(7, 8) == 1.23\", \"assert get_ultrasound_distance(9, 10) == 1.23\", \"assert get_ult... | {
"split": "train",
"index": 6218,
"acecode_id": "bigcode_python_fns_14680",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing the medal counts of different countries in a sports event. You are given a list of tuples, where each tuple contains the name of a country and the number of winners from that country. Your goal is to implement a function that takes this list as inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_medal_counts([('USA', 10), ('China', 5), ('Russia', 8)]) == ['China', 'Russia', 'USA']\", \"assert sort_medal_counts([('Canada', 2), ('Australia', 3), ('Germany', 1)]) == ['Germany', 'Canada', 'Australia']\", \"assert sort_medal_counts([('France', 7), (... | {
"split": "train",
"index": 6219,
"acecode_id": "oss_21907",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a configuration setup function for a hypothetical application. The function should take in a list of configuration settings, where each setting is represented as a tuple containing a key (string) and a corresponding value (string). Your goal is to r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_config([('a', '1'), ('b', '2'), ('a', '3')]) == {'a': '3', 'b': '2'}\", \"assert setup_config([('key1', 'value1'), ('key2', 'value2'), ('key1', 'value3')]) == {'key1': 'value3', 'key2': 'value2'}\", \"assert setup_config([('x', '10'), ('y', '20'), ('z'... | {
"split": "train",
"index": 6220,
"acecode_id": "bigcode_python_fns_5469",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a 3D transformation with keys 'translation' and 'rotation'. The 'translation' is a list of three floats [x, y, z] representing the position in 3D space, and 'rotation' is a list of four floats [qx, qy, qz, qw] representing the quaternion ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_transform_msg({'translation': [1.0, 2.0, 3.0], 'rotation': [0.0, 0.0, 0.0, 1.0]}) == {'translation': [1.0, 2.0, 3.0], 'rotation': [0.0, 0.0, 0.0, 1.0]}\", \"assert to_transform_msg({'translation': [0.0, 0.0, 0.0], 'rotation': [1.0, 0.0, 0.0, 0.0]}) == {'t... | {
"split": "train",
"index": 6221,
"acecode_id": "bigcode_python_fns_25100",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes the name and owner ID of an EC2 security group as input and returns a dictionary representation of the security group. The function should have the following signature: `def create_security_group(name: str, owner_id: str) -> di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_security_group('my-security-group', '1234567890') == {'eC2SecurityGroupName': 'my-security-group', 'eC2SecurityGroupOwnerId': '1234567890'}\", \"assert create_security_group('default', '9876543210') == {'eC2SecurityGroupName': 'default', 'eC2SecurityG... | {
"split": "train",
"index": 6222,
"acecode_id": "oss_4565",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates file names for particle images. Write a function `create_particle_file_name` that takes in the following parameters:\n- `folder_path` (string): The path to the folder where the file will be stored.\n- `img_number` (integer)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_particle_file_name('/images', 10, 3, 'png') == '/images/10particle3.png'\", \"assert create_particle_file_name('/photos', 5, 0, 'jpg') == '/photos/5particle0.jpg'\", \"assert create_particle_file_name('/data', 1, 12, 'tiff') == '/data/1particle12.tiff... | {
"split": "train",
"index": 6223,
"acecode_id": "oss_9768",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dependency relations, where each relation is represented as a dictionary containing a key '@type' which is a list with the first element being a string that indicates the type of relation. Your task is to implement a function `get_indexed_role(dep: dict)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_indexed_role({'@type': ['conj']}) == (-1, 'conj')\", \"assert get_indexed_role({'@type': ['conj_']}) == (-1, 'conj')\", \"assert get_indexed_role({'@type': ['dep']}) == (None, 'unknown')\", \"assert get_indexed_role({'@type': ['unknown_type']}) == (None,... | {
"split": "train",
"index": 6224,
"acecode_id": "bigcode_python_fns_39654",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to process filter information used in astronomical observations. The function should take a list of filter strings as input, where each string is formatted as 'lambda_eff transmission name'. Your goal is to parse these strings and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_filters(['400.0 0.8 FilterA', '500.0 0.9 FilterB']) == [{'lambda_eff': 400.0, 'transmission': 0.8, 'name': 'FilterA'}, {'lambda_eff': 500.0, 'transmission': 0.9, 'name': 'FilterB'}]\", \"assert parse_filters(['600.0 0.95 FilterC']) == [{'lambda_eff': 6... | {
"split": "train",
"index": 6225,
"acecode_id": "oss_6882",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers: `nums1` and `nums2`. Your task is to merge these two lists into a single list, ensuring that the resulting list is sorted in ascending order. Write a function `merge_and_sort(nums1, nums2)` that takes the two lists as input and returns the m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_sort([3, 1, 4], [2, 5, 0]) == [0, 1, 2, 3, 4, 5]\", \"assert merge_and_sort([], [1, 3, 5]) == [1, 3, 5]\", \"assert merge_and_sort([2, 4, 6], []) == [2, 4, 6]\", \"assert merge_and_sort([1, 2, 2], [2, 3, 4]) == [1, 2, 2, 2, 3, 4]\", \"assert merge_... | {
"split": "train",
"index": 6226,
"acecode_id": "oss_21516",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a dictionary of OpenGL constants and their corresponding hexadecimal values. Implement the function `create_opengl_constants_dict()` which takes no arguments and returns a dictionary where the keys are the names of the OpenGL... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_opengl_constants_dict() == {'GL_DUAL_INTENSITY16_SGIS': 0x811B, 'GL_DUAL_LUMINANCE_ALPHA4_SGIS': 0x811C, 'GL_DUAL_LUMINANCE_ALPHA8_SGIS': 0x811D, 'GL_QUAD_ALPHA4_SGIS': 0x811E, 'GL_QUAD_ALPHA8_SGIS': 0x811F, 'GL_QUAD_LUMINANCE4_SGIS': 0x8120, 'GL_QUAD... | {
"split": "train",
"index": 6227,
"acecode_id": "oss_9970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the nth Bell number, a sequence in number theory. The Bell numbers represent the number of ways to partition a set of n elements. The function should be able to handle large inputs efficiently. Define the function as follows: `def nth_bell_n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nth_bell_number(0) == 1\", \"assert nth_bell_number(1) == 1\", \"assert nth_bell_number(2) == 2\", \"assert nth_bell_number(3) == 5\", \"assert nth_bell_number(4) == 15\", \"assert nth_bell_number(5) == 52\", \"assert nth_bell_number(6) == 203\", \"assert nt... | {
"split": "train",
"index": 6228,
"acecode_id": "evol_12880",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_ip_address(domain_name: str) -> str` that takes a domain name as input and returns its corresponding Internet Protocol (IP) address as a string. If the domain name cannot be resolved, the function should return None. Handle any exceptions that may occu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_ip_address('google.com') is not None\", \"assert get_ip_address('example.com') is not None\", \"assert get_ip_address('invalid-domain') is None\", \"assert get_ip_address('localhost') is not None\", \"assert get_ip_address('github.com') is not None\", \"... | {
"split": "train",
"index": 6229,
"acecode_id": "evol_33065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a square matrix represented as a list of lists, where each inner list represents a row of the matrix. Your task is to implement a function `get_value_at_coords(matrix: List[List[int]], x: int, y: int) -> int` that returns the value of the matrix at the given integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_value_at_coords([[1, 2], [3, 4]], 0, 0) == 1\", \"assert get_value_at_coords([[1, 2], [3, 4]], 1, 1) == 4\", \"assert get_value_at_coords([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 2, 2) == 9\", \"assert get_value_at_coords([[1, 2, 3], [4, 5, 6], [7, 8, 9]], -1,... | {
"split": "train",
"index": 6230,
"acecode_id": "bigcode_python_fns_26111",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates adding visualizations to a list of panels in a visualization system. Each visualization is represented by a configuration object. You need to implement a function `add_visualization` that takes in a list of visualizatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_visualization([{'type': 'bar_chart', 'data': [10, 20, 30]}]) == [{'type': 'bar_chart', 'data': [10, 20, 30]}]\", \"assert add_visualization([{'type': 'line_chart', 'data': [1, 2, 3]}, {'type': 'pie_chart', 'data': [4, 5, 6]}]) == [{'type': 'line_chart', ... | {
"split": "train",
"index": 6231,
"acecode_id": "oss_33046",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_geometric_means(arrays: List[List[int]]) -> List[Union[float, str]]` that takes a list of integer arrays and computes the geometric mean for each array independently. If an array contains a zero or negative number, the function should return 'Zer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_geometric_means([[1, 1, 1]]) == [1.0]\", \"assert calculate_geometric_means([[2, 0, 4]]) == ['Zero or negative number detected']\", \"assert calculate_geometric_means([[-1, 2, 3]]) == ['Zero or negative number detected']\", \"assert calculate_geome... | {
"split": "train",
"index": 6232,
"acecode_id": "evol_423",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two positive real numbers, `eps` (permittivity) and `mu` (permeability), implement a function that calculates and returns the effective index of refraction and impedance. The effective index of refraction is calculated as the square root of the product of `eps` and `mu`, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_properties(1.0, 1.0) == (1.0, 1.0)\", \"assert calculate_properties(2.0, 2.0) == (2.0, 1.0)\", \"assert calculate_properties(0.5, 2.0) == (1.0, 2.0)\", \"assert calculate_properties(3.0, 1.0) == (1.7320508075688772, 0.5773502691896257)\", \"assert ... | {
"split": "train",
"index": 6233,
"acecode_id": "bigcode_python_fns_39900",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string `prefices` that contains comma-separated values. Your task is to create a function `write_combinations` that takes this string and returns a new string consisting of the same values from `prefices` but joined by semicolons instead of commas. The output st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_combinations('abc,def,ghi') == 'abc;def;ghi'\", \"assert write_combinations('apple,banana,cherry') == 'apple;banana;cherry'\", \"assert write_combinations('1,2,3,4,5') == '1;2;3;4;5'\", \"assert write_combinations('') == ''\", \"assert write_combinatio... | {
"split": "train",
"index": 6234,
"acecode_id": "bigcode_python_fns_14408",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, write a function that counts the number of odd digits located at even indexes and the number of even digits located at odd indexes. An index is considered even if it is divisible by 2 and odd if it is not. The function should return the total cou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_odd_even_digits(17428) == 2\", \"assert count_odd_even_digits(13579) == 3\", \"assert count_odd_even_digits(24680) == 2\", \"assert count_odd_even_digits(0) == 0\", \"assert count_odd_even_digits(111111) == 3\", \"assert count_odd_even_digits(135246) =... | {
"split": "train",
"index": 6235,
"acecode_id": "evol_21660",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates a unique geometric sequence of numbers. The function should take three parameters: the starting number of the sequence, the common ratio, and the desired length of the sequence. The function should return a list containing the geometric seque... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert geometric_sequence(1, 2, 10) == [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]\", \"assert geometric_sequence(3, 3, 5) == [3, 9, 27, 81, 243]\", \"assert geometric_sequence(5, 2, 0) == []\", \"assert geometric_sequence(1, 0, 5) == [1, 0, 0, 0, 0]\", \"assert geomet... | {
"split": "train",
"index": 6236,
"acecode_id": "evol_10679",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a simple search index. Write a function `add_page_to_index(index: dict, url: str, content: str) -> None` that takes in three parameters: an index (a dictionary), a URL (a string), and page content (a string). The function should update the index to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_page_to_index({'hello': ['http://example.com']}, 'http://example.com', 'hello again') == None and {'hello': ['http://example.com'], 'again': ['http://example.com']} == {'hello': ['http://example.com'], 'again': ['http://example.com']}\", \"assert add_pag... | {
"split": "train",
"index": 6237,
"acecode_id": "bigcode_python_fns_10530",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simplified version of executing a command in a subprocess. Your function should handle a single command without any arguments and return the output of the command if it was successful, or an error message if the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_command('ls') == 'file1.txt\\\\nfile2.txt\\\\nfile3.txt\\\\n'\", \"assert run_command('pwd') == '/home/user\\\\n'\", \"assert run_command('echo Hello') == 'Hello\\\\n'\", \"assert run_command('nonexistent_command') == 'Command not found\\\\n'\", \"assert... | {
"split": "train",
"index": 6238,
"acecode_id": "oss_7418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates sending emails to learners for evaluation reminders. The function, `send_evaluation_reminders`, takes a list of learners and their corresponding submissions. Each submission contains an entry point and a status. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_evaluation_reminders([{'name': 'Alice', 'email': 'alice@example.com', 'submissions': [{'entry_point': 'EP1', 'status': 'valid', 'reviews': ['C', 'L']}]}]) == ['alice@example.com']\", \"assert send_evaluation_reminders([{'name': 'Bob', 'email': 'bob@exam... | {
"split": "train",
"index": 6239,
"acecode_id": "bigcode_python_fns_49407",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple banking system that allows for the management of multiple bank accounts. Your objective is to implement a function that simulates the operations of creating accounts, depositing funds, withdrawing funds, and calculating the total balance ac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations([('create', 'ACC1', 1000), ('create', 'ACC2', 500), ('deposit', 'ACC1', 200), ('withdraw', 'ACC2', 300), ('withdraw', 'ACC1', 500)]) == 900\", \"assert bank_operations([('create', 'ACC1', 1000), ('create', 'ACC1', 500)]) == 1000\", \"assert b... | {
"split": "train",
"index": 6240,
"acecode_id": "oss_12307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The function should have the following signature: def sum_of_even_numbers(nums: List[int]) -> int. \n\nConstraints:\n- The input list can con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_numbers([10, 21, 32, 43]) == 42\", \"assert sum_of_even_numbers([-2, -4, -6]) == -12\", \"assert sum_of_even_numbers([-1, -3, -5]) == 0\", \"assert sum_of_even_numbers([]) == 0\", \"assert sum... | {
"split": "train",
"index": 6241,
"acecode_id": "bigcode_python_fns_33525",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing a list of password policies and passwords, each separated by a newline. Each line contains a password policy that specifies two positions and a letter, followed by a colon and the corresponding password. The password policy indicates that exact... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_passwords_part2('1-3 a: abcde\\\\n1-3 b: cdefg\\\\n2-9 c: ccccccccc') == 1\", \"assert verify_passwords_part2('1-1 a: b') == 0\", \"assert verify_passwords_part2('1-3 a: abca') == 1\", \"assert verify_passwords_part2('1-3 c: ccc') == 0\", \"assert ver... | {
"split": "train",
"index": 6242,
"acecode_id": "oss_5272",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the smallest even number in the list. If there are no even numbers, return None.\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_smallest_even([45, 22, 11, 90, 33]) == 22\", \"assert find_smallest_even([1, 3, 5, 7]) == None\", \"assert find_smallest_even([2, 4, 6, 8]) == 2\", \"assert find_smallest_even([-2, -4, -6, -8]) == -8\", \"assert find_smallest_even([0, 1, 3, 5]) == 0\", ... | {
"split": "train",
"index": 6243,
"acecode_id": "evol_3348",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of objects, each represented by a dictionary containing 'center' (a list of two integers representing the coordinates) and 'score' (an integer representing the detection score). Your task is to filter out potential duplicate objects based on their proximity... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_duplicates([{'center': [1, 1], 'score': 10}, {'center': [1, 2], 'score': 5}], 1) == [{'center': [1, 1], 'score': 10}]\", \"assert filter_duplicates([{'center': [1, 1], 'score': 10}], 5) == [{'center': [1, 1], 'score': 10}]\", \"assert filter_duplicate... | {
"split": "train",
"index": 6244,
"acecode_id": "bigcode_python_fns_7586",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function solar_dist(planet1, planet2) that takes in two strings representing planet names and returns a tuple of planets that are closer to the sun than both of the specified planets. The function should also include an internal function check_validity() that verifi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solar_dist('Mars', 'Uranus') == ('Mercury', 'Venus', 'Earth')\", \"assert solar_dist('Saturn', 'Jupiter') == ('Mercury', 'Venus', 'Earth', 'Mars')\", \"assert solar_dist('Mercury', 'Venus') == ()\", \"assert solar_dist('Earth', 'Pluto') == ()\", \"assert sol... | {
"split": "train",
"index": 6245,
"acecode_id": "evol_13290",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target integer. Your task is to determine if there are any two distinct integers in the list that sum up to the target integer. Implement a function `has_pair_with_sum(nums: List[int], target: int) -> bool` that returns `True` if such a pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_pair_with_sum([1, 2, 3, 4, 5], 5) == True\", \"assert has_pair_with_sum([1, 2, 3, 4, 5], 10) == False\", \"assert has_pair_with_sum([5, 5, 5], 10) == True\", \"assert has_pair_with_sum([0, -1, 2, -3, 1], -2) == True\", \"assert has_pair_with_sum([1], 1) ... | {
"split": "train",
"index": 6246,
"acecode_id": "bigcode_python_fns_21327",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of request objects and returns a summary of the requests grouped by their product area. Each request has a title, description, product area, target date, created date, priority, staff ID, client ID, and a resolved st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_requests_by_product_area([]) == {}\", \"assert group_requests_by_product_area([Request('Title1', 'Description1', 'CLAIMS', '2023-10-01', '2023-10-01', 1, 1, 1, False)]) == {'CLAIMS': ['Title1']}\", \"assert group_requests_by_product_area([Request('Titl... | {
"split": "train",
"index": 6247,
"acecode_id": "bigcode_python_fns_29512",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `complex_median(l: Union[list, set])` that returns the median including complex numbers of elements in the list or set `l` without sorting or using built-in functions. The function should handle both even and odd numbers of elements, duplicates, and return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_median([3, 1, 2, 4, 5]) == 3\", \"assert complex_median([1, 2, 2, 4, 5]) == 2\", \"assert complex_median([]) == None\", \"assert complex_median(set()) == None\", \"assert complex_median('12345') == None\", \"assert complex_median([1.5, 2.5, 3.5]) == ... | {
"split": "train",
"index": 6248,
"acecode_id": "evol_16295",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `custom_factorial(n)` that calculates the factorial of a negative integer using complex mathematics. The function should handle the following cases: 1) If `n` is a positive integer, return 'Invalid input. Please provide a negative integer.' 2) If `n` is not... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_factorial(-0.5) == 1.7724538509055159\", \"assert custom_factorial(5) == 'Invalid input. Please provide a negative integer.'\", \"assert custom_factorial('string') == 'Invalid input. Please provide a number.'\", \"assert custom_factorial([1, 2]) == 'I... | {
"split": "train",
"index": 6249,
"acecode_id": "evol_25152",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of strings based on their length in relation to a specified length criteria. The function should prioritize strings that are closest in length to the criteria, and in the case of ties, it should sort the strings alphabetically. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_strings_by_length(['Hello', 'World', 'Python', 'Code'], 4) == ['Code', 'Hello', 'World', 'Python']\", \"assert sort_strings_by_length(['Apple', 'Banana', 'Cherry', 'Date'], 6) == ['Banana', 'Cherry', 'Apple', 'Date']\", \"assert sort_strings_by_length([... | {
"split": "train",
"index": 6250,
"acecode_id": "evol_35762",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a message's attributes into a JSON-compliant dictionary format. The attributes of the message include: an identifier (id), a link identifier (link_id), timestamps for when the message was sent (sent) and read (read), the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_message_json(1, 101, None, None, 'Hello World', [], True) == {'id': 1, 'link_id': 101, 'sent': None, 'read': None, 'content': 'Hello World', 'medias': 0}\", \"assert get_message_json(2, 102, datetime(2023, 10, 1, 12, 0), None, 'Sample Message', ['link1.j... | {
"split": "train",
"index": 6251,
"acecode_id": "oss_32687",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of pairs where each pair represents the base and height of different parallelograms (in cm), implement a function that calculates and returns a list containing the corresponding areas of all the parallelograms. Each base and height will be an integer between 1 and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parallelogram_areas([(1, 1), (2, 2), (3, 3)]) == [1, 4, 9]\", \"assert parallelogram_areas([(5, 10), (6, 7)]) == [50, 42]\", \"assert parallelogram_areas([(100, 200), (300, 400)]) == [20000, 120000]\", \"assert parallelogram_areas([(1, 1000000), (1000000, 1)... | {
"split": "train",
"index": 6252,
"acecode_id": "evol_20192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a fraction represented by its numerator and denominator, write a function that determines if the fraction is a proper fraction. A proper fraction is defined as a positive fraction where the numerator is smaller than the denominator. Implement the function `is_proper_fract... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_proper_fraction(1, 2) == True\", \"assert is_proper_fraction(2, 3) == True\", \"assert is_proper_fraction(3, 5) == True\", \"assert is_proper_fraction(5, 5) == False\", \"assert is_proper_fraction(7, 4) == False\", \"assert is_proper_fraction(0, 1) == Fal... | {
"split": "train",
"index": 6253,
"acecode_id": "evol_34136",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a sequence of numbers. The function should take in a list of integers and determine whether the sequence is strictly increasing. A sequence is considered strictly increasing if each number is less than the number tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_strictly_increasing([1, 2, 3, 4, 5]) == True\", \"assert is_strictly_increasing([5, 4, 3, 2, 1]) == False\", \"assert is_strictly_increasing([1, 2, 2, 3, 4]) == False\", \"assert is_strictly_increasing([0, 1, 2, 3]) == True\", \"assert is_strictly_increas... | {
"split": "train",
"index": 6254,
"acecode_id": "oss_15797",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves notification details by their unique identifier. The function should take an input parameter representing the notification ID. If the ID is not provided (i.e., it's None or an empty string), the function should raise a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_notification_by_id('123') == 'Notification details for ID: 123'\", \"assert get_notification_by_id('456') == 'Notification details for ID: 456'\", \"assert get_notification_by_id('abc') == 'Notification details for ID: abc'\", \"assert get_notification_b... | {
"split": "train",
"index": 6255,
"acecode_id": "bigcode_python_fns_10148",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given JSON object represented as a dictionary and returns a list of all the unique keys present in the object, including those found in any nested dictionaries and arrays. The keys should be returned in lexicograph... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_json_keys({'name': 'Alice', 'age': 25}) == ['age', 'name']\", \"assert extract_json_keys({'group': {'member1': 'Bob', 'member2': 'Eve'}}) == ['group', 'member1', 'member2']\", \"assert extract_json_keys({'a': 1, 'b': {'c': 2, 'd': [3, 4]}}) == ['a', ... | {
"split": "train",
"index": 6256,
"acecode_id": "oss_7272",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a request object that represents an HTTP request. This object has a parameter called 'param' which can either be a string representing a test name, or it could be None if no test name is known. Your task is to implement a function `get_test_name(request)` that tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_test_name({'param': 'test_1'}) == 'test_1'\", \"assert get_test_name({'param': None}) == None\", \"assert get_test_name({'param': 'test_case'}) == 'test_case'\", \"assert get_test_name({}) == None\", \"assert get_test_name({'param': 'example_test'}) == '... | {
"split": "train",
"index": 6257,
"acecode_id": "bigcode_python_fns_2904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string of musical notes represented by ASCII characters and returns a list of integers representing the duration, in beats, of each note. The mapping of notes to beats is as follows: 'o' represents a whole note (4 beats), 'o|' represents a half... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_music('o o| .| o| o| .| .| .| .| o o') == [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\", \"assert parse_music('o o o o') == [4, 4, 4, 4]\", \"assert parse_music('o| o| o|') == [2, 2, 2]\", \"assert parse_music('.| .| .| .|') == [1, 1, 1, 1]\", \"assert parse_mus... | {
"split": "train",
"index": 6258,
"acecode_id": "evol_641",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `highest_fibonacci(numbers: List[int]) -> int` that takes a list of integers and returns the highest Fibonacci number found within that list. If there are no Fibonacci numbers in the list, return -1.\nPlease reason step by step, then write a self-contained Pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highest_fibonacci([145, 217, 987]) == 987\", \"assert highest_fibonacci([1, 2, 3, 4, 5]) == 5\", \"assert highest_fibonacci([34, 55, 89]) == 89\", \"assert highest_fibonacci([13, 21, 34]) == 34\", \"assert highest_fibonacci([0, 1, 2, 3, 5, 8]) == 8\", \"asse... | {
"split": "train",
"index": 6259,
"acecode_id": "evol_24848",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that validates the configuration of a neural network model. The function should check various conditions related to the architecture of the model and raise appropriate assertion errors if any of the conditions are not met. Impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_model_config(3, 3, True, 2, 1, [32, 784]) is None\", \"assert validate_model_config(3, 3, False, 2, 1, [32, 784]) is None\", \"assert validate_model_config(1, 1, False, 0, 0, [1, 10]) is None\", \"assert validate_model_config(2, 2, True, 1, 0, [32, ... | {
"split": "train",
"index": 6260,
"acecode_id": "oss_33033",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are working on an e-commerce platform where you need to calculate the total price of items in a user's cart. You have a class called `ItemModel` that contains the following attributes: `user_id` (int) and `price` (float). Your task is to implement a method called `get_total... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_price_by_user_id(1, [ItemModel(1, 10.0), ItemModel(1, 20.0), ItemModel(2, 5.0)]) == 30.0\", \"assert get_total_price_by_user_id(2, [ItemModel(1, 10.0), ItemModel(1, 20.0), ItemModel(2, 5.0)]) == 5.0\", \"assert get_total_price_by_user_id(3, [ItemMo... | {
"split": "train",
"index": 6261,
"acecode_id": "oss_19052",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `unshare_document_count` that takes three parameters: a string `token`, a string `docid`, and a string `userid`. The function should simulate the action of unsharing a document from a user and return the number of users that the docum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unshare_document_count('valid_token', 'A123', 'user1') == 5\", \"assert unshare_document_count('valid_token', 'B456', 'user2') == 10\", \"assert unshare_document_count('valid_token', 'C789', 'user3') == 0\", \"assert unshare_document_count('valid_token', 'D0... | {
"split": "train",
"index": 6262,
"acecode_id": "bigcode_python_fns_42237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string input_str, implement a function that formats the string for writing to a file. The function should ensure that the string ends with a newline character. If the input string is empty, the function should return an empty byte string. If the input string does not en... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_string_for_file('Hello, World!') == b'Hello, World!\\\\n'\", \"assert format_string_for_file('Hello, World!\\\\n') == b'Hello, World!\\\\n'\", \"assert format_string_for_file('') == b''\", \"assert format_string_for_file('Test String') == b'Test Strin... | {
"split": "train",
"index": 6263,
"acecode_id": "bigcode_python_fns_10052",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Define a function called 'intersperse' that takes a list of integers ('numbers') and an integer ('delimeter'). The function should return a list with the 'delimeter' inserted between each element of the 'numbers' list. If the 'delimeter' is negative, use its absolute value to d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([5], 0) == [5]\", \"assert intersperse([1, 2], 1) == [1, 1, 2]\", \"assert intersperse([10, 20, 30], 5) == [10, 5, 20, 5, 30]\", \"assert intersperse([7... | {
"split": "train",
"index": 6264,
"acecode_id": "evol_24996",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an array of n strings, implement a function that accepts two numeric parameters k and m. The function should return the top m longest strings from the array, each having no more than k alphabetic characters. The returned strings should be sorted in descending order based ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lengthy_texts(['a', 'ab', 'abc', 'abcd', 'abcde'], 3, 2) == ['abc', 'ab']\", \"assert lengthy_texts(['one', 'two', 'three', 'four'], 5, 2) == ['three', 'four']\", \"assert lengthy_texts(['a', 'b', 'c'], 0, 2) == []\", \"assert lengthy_texts(['quick', 'brown'... | {
"split": "train",
"index": 6265,
"acecode_id": "evol_30328",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function called 'remove_duplicates_and_sort' that takes a tuple of integers as input and returns a new tuple that contains only the unique elements from the input tuple, sorted in ascending order.\nPlease reason step by step, then write a self-contained Python solution.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates_and_sort((4, 7, 7, 2, 8, 8, 4, 3, 5)) == (2, 3, 4, 5, 7, 8)\", \"assert remove_duplicates_and_sort((1, 1, 1, 1)) == (1,)\", \"assert remove_duplicates_and_sort((10, 5, 3, 8, 3, 10)) == (3, 5, 8, 10)\", \"assert remove_duplicates_and_sort((4... | {
"split": "train",
"index": 6266,
"acecode_id": "evol_17116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing movie data given in a list format where each entry contains the movie's item_id, item_name, and genres. Your function should create a mapping of item_id to item_name and a mapping of item_id to a list of genres. Implement a function `process_movie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_movies([(1, 'The Shawshank Redemption', 'Drama'), (2, 'The Godfather', 'Crime', 'Drama'), (3, 'The Dark Knight', 'Action', 'Crime', 'Drama')]) == ({1: 'The Shawshank Redemption', 2: 'The Godfather', 3: 'The Dark Knight'}, {1: ['Drama'], 2: ['Crime', ... | {
"split": "train",
"index": 6267,
"acecode_id": "oss_31266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of objects representing containers within a pod. Each container is represented as a dictionary. Your task is to implement a function that takes a list of these container objects and checks if any of the containers are None. If any container is None, the fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_containers([{'name': 'container1'}, {'name': 'container2'}, {'name': 'container3'}]) == True\", \"assert check_containers([{'name': 'container1'}]) == True\", \"assert check_containers([]) == True\", \"assert check_containers([{'name': 'container1'}, {... | {
"split": "train",
"index": 6268,
"acecode_id": "bigcode_python_fns_1881",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a 3-way set-associative cache. The function should take an integer `block_number` and determine if the block is present in the cache. The cache is organized into a number of sets, each containing three lines. If the blo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_data(0) == False\", \"assert retrieve_data(1) == False\", \"assert retrieve_data(2) == False\", \"assert retrieve_data(3) == False\", \"assert retrieve_data(4) == False\", \"assert retrieve_data(5) == False\", \"assert retrieve_data(6) == False\", \... | {
"split": "train",
"index": 6269,
"acecode_id": "evol_16894",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the product of the absolute values of integers in a list, excluding prime numbers. The input list may contain positive and negative integers, as well as non-integer numerical types. Round down each number to the nearest integer before computin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_absolute_product([2, -1, 4]) == 4\", \"assert compute_absolute_product([0, -1, 9, -3]) == 0\", \"assert compute_absolute_product([3.2, -2.7, 0]) == 0\", \"assert compute_absolute_product([3, 5, 7]) == 1\", \"assert compute_absolute_product([10, 15, 2... | {
"split": "train",
"index": 6270,
"acecode_id": "evol_4090",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function `check_prime_in_array(array)` that determines whether all elements located at prime indices are prime numbers themselves. The function should return True if all elements at prime indices are prime, and False otherwise. The indice... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_prime_in_array([1, 4, 6, 8, 10]) == False\", \"assert check_prime_in_array([3, 5, 7, 11, 13]) == True\", \"assert check_prime_in_array([2, 4, 6, 8, 10]) == False\", \"assert check_prime_in_array([1, 1, 1, 1, 1]) == False\", \"assert check_prime_in_arra... | {
"split": "train",
"index": 6271,
"acecode_id": "evol_16113",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes an experiment configuration represented as a dictionary. The function should perform the following tasks: 1. Retrieve the training, validation, and test data loaders from the configuration dictionary. Each loader is rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_data_loaders({'train_loader': 'loader1', 'valid_loader': 'loader2', 'test_loader': 'loader3'}) == ('loader1', 'loader2', 'loader3')\", \"assert get_data_loaders({'train_loader': 'train_data', 'valid_loader': 'valid_data', 'test_loader': 'test_data'}) == ... | {
"split": "train",
"index": 6272,
"acecode_id": "oss_29898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts an array of integers in ascending order using the Quick Sort algorithm. The function should take a list of integers as input and return a new list containing the sorted integers. Do not modify the original input list.\nPlease reason step by step,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quick_sort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert quick_sort([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == [1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]\", \"assert quick_sort([1]) == [1]\", \"assert quick_sort([]) == []\", \"assert quick_sort([2, 2, 2]) == [2,... | {
"split": "train",
"index": 6273,
"acecode_id": "evol_19683",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and strings that may represent integers, implement a function `square_list(numbers)` that converts the strings into integers, computes their squares, and returns a list of those squares. If an item cannot be converted to an integer, it should be ignored... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_list([1, 2, '3', 4.0, 'five']) == [1, 4, 9, 16]\", \"assert square_list(['-1', '2', '3.5', '4']) == [1, 4, 16]\", \"assert square_list(['10', '20', '30']) == [100, 400, 900]\", \"assert square_list(['-5', '-10', 'abc', '5']) == [25, 100, 25]\", \"asse... | {
"split": "train",
"index": 6274,
"acecode_id": "evol_7430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples, where each tuple contains two integers representing start and end indices, write a function that determines the total number of unique integers covered by these intervals. The intervals may overlap. Your function should return the count of the unique int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_integers([(1, 5), (2, 6), (4, 8)]) == 8\", \"assert count_unique_integers([(1, 3), (4, 6), (5, 7)]) == 7\", \"assert count_unique_integers([(1, 1), (2, 2), (3, 3)]) == 3\", \"assert count_unique_integers([(1, 10), (5, 15), (10, 20)]) == 20\", \"... | {
"split": "train",
"index": 6275,
"acecode_id": "bigcode_python_fns_27611",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that determines whether a player can navigate from the top-left corner to the bottom-right corner of a grid-based world. The grid is represented by a 2D list where obstacles are denoted by the value 1, and open paths are denote... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_reach_end([[0]]) == True\", \"assert can_reach_end([[0, 0], [0, 0]]) == True\", \"assert can_reach_end([[0, 1], [0, 0]]) == True\", \"assert can_reach_end([[0, 1], [1, 0]]) == False\", \"assert can_reach_end([[0, 0], [1, 1]]) == False\", \"assert can_rea... | {
"split": "train",
"index": 6276,
"acecode_id": "oss_453",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dates in various human-readable formats, implement a function `standardize_date(date_string: str) -> str` that transforms each date into the standardized ISO 8601 format (YYYY-MM-DD). The function should handle different date formats, including but not limited t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert standardize_date('Monday, April 7th, 2020') == '2020-04-07'\", \"assert standardize_date('07/04/2020') == '2020-07-04'\", \"assert standardize_date('04/07/2020') == '2020-04-07'\", \"assert standardize_date('April 7, 2020') == '2020-04-07'\", \"assert standa... | {
"split": "train",
"index": 6277,
"acecode_id": "evol_4106",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the insertion of a 3D component into a generic simulation environment. The function should accept two parameters: a dictionary representing the environment (which holds various attributes) and a boolean value that indicates... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_component({}, True) == True\", \"assert insert_component({}, False) == True\", \"assert insert_component({'roll_name': 0}, True) == True\", \"assert insert_component({'roll_name': 30}, True) == True\", \"assert insert_component({'roll_name': 45}, Fals... | {
"split": "train",
"index": 6278,
"acecode_id": "oss_6510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a biological data matrix. The function, named `_load_data`, takes a data matrix as input and initializes several attributes based on the matrix. Specifically, the function should manage the following attributes: a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _load_data(None) == ([], 0, 0)\", \"assert _load_data(Matrix(taxa=['A', 'B', 'C'])) == (['A', 'B', 'C'], 3, 0)\", \"assert _load_data(Matrix(taxa=['X', 'Y'])) == (['X', 'Y'], 2, 0)\", \"assert _load_data(Matrix(taxa=[])) == ([], 0, 0)\", \"assert _load_data(... | {
"split": "train",
"index": 6279,
"acecode_id": "oss_15223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a DNA sequence, write a function `check_dna_sequence(sequence: str) -> bool` that checks if the sequence is valid. A valid DNA sequence must contain only the characters 'A', 'C', 'T', and 'G' (case-insensitive). Additionally, the sequence should not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_dna_sequence('ACGT') == True\", \"assert check_dna_sequence('acgt') == True\", \"assert check_dna_sequence('A C G T') == False\", \"assert check_dna_sequence('ACGTA') == True\", \"assert check_dna_sequence('') == False\", \"assert check_dna_sequence('A... | {
"split": "train",
"index": 6280,
"acecode_id": "bigcode_python_fns_45598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates the properties of an audio content entry based on specific criteria. The function should take the following parameters: `name` (a string of maximum length 32), `subject` (a string of maximum length 4 restricted to the value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_audio_content('Math Audio', 'math', 'This is a description of math audio content.', 'John Doe', 5, True, '2023-10-01 12:00:00') == True\", \"assert validate_audio_content('Inf Audio', 'inf', 'Informatic audio content.', 'Jane Doe', 10, False, '2023-... | {
"split": "train",
"index": 6281,
"acecode_id": "oss_14135",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `compute_product(list_nums)` that computes the cumulative multiplication of all numbers in the list. The function should return the final product of the numbers. The input list will contain only positive integers.\nPlease reason step b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_product([1, 2, 3, 5, 8]) == 240\", \"assert compute_product([1, 1, 1]) == 1\", \"assert compute_product([2, 2, 2]) == 8\", \"assert compute_product([1, 3, 5]) == 15\", \"assert compute_product([4, 5, 6]) == 120\", \"assert compute_product([2, 4, 8]) ... | {
"split": "train",
"index": 6282,
"acecode_id": "evol_17045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the heights of bars in a histogram, write a function that calculates the area of the largest rectangle that can be formed within the histogram. The rectangle must be formed by using one or more contiguous bars. The function should return th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert largest_rectangle_area([1, 1, 1, 1]) == 4\", \"assert largest_rectangle_area([1, 2, 3, 4, 5]) == 9\", \"assert largest_rectangle_area([5, 4, 1, 2]) == 8\", \"assert largest_rectangle_area([0, 0, 0,... | {
"split": "train",
"index": 6283,
"acecode_id": "bigcode_python_fns_5695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of students in a class. Your task is to implement a function that takes this list as input and returns a new list that contains only the scores that are greater than the average score. If there are no scores greater than ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_above_average([70, 80, 90, 100]) == [90, 100]\", \"assert filter_above_average([50, 60, 70, 80, 90]) == [80, 90]\", \"assert filter_above_average([100, 100, 100, 100]) == []\", \"assert filter_above_average([60, 70, 80, 90, 100, 95]) == [90, 100, 95]\... | {
"split": "train",
"index": 6284,
"acecode_id": "bigcode_python_fns_26412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the vertices of a triangular prism given three points that define the base triangle and the height of the prism. The base triangle is defined by three 3D points, p1, p2, and p3, and the prism has a specific height that should be a positive floati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_prism_vertices([0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], 2.0) == [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 2.0], [1.0, 0.0, 2.0], [0.0, 1.0, 2.0]]\", \"assert calculate_prism_vertices([1.0, 1.0, 1.0], [2.0, 1.0, 1.0], ... | {
"split": "train",
"index": 6285,
"acecode_id": "bigcode_python_fns_42538",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates adding decorations to a text editor based on cursor position. Given a string of text and a cursor position (integer), your function should determine if a word can be selected under the cursor. A word is defined as a seq... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_decoration('Hello World', 0) == {'decoration': 'blue underlined', 'cursor': 'pointing hand'}\", \"assert add_decoration('Hello World', 6) == {'decoration': 'blue underlined', 'cursor': 'pointing hand'}\", \"assert add_decoration('Hello World', 5) == {'de... | {
"split": "train",
"index": 6286,
"acecode_id": "oss_1364",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_user_name(env_vars: dict) -> str` that retrieves the name of the currently logged-in user from a given dictionary of environment variables. The function should check for the key 'JUPYTERHUB_USER' first, and if it does not exist, it s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_name({'JUPYTERHUB_USER': 'alice'}) == 'alice'\", \"assert get_user_name({'USER': 'bob'}) == 'bob'\", \"assert get_user_name({'JUPYTERHUB_USER': 'charlie', 'USER': 'bob'}) == 'charlie'\", \"assert get_user_name({'JUPYTERHUB_USER': 'eve', 'USER': ''})... | {
"split": "train",
"index": 6287,
"acecode_id": "bigcode_python_fns_38125",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, generate the Fibonacci sequence up to n elements. For each element in the sequence, calculate the square of its value and insert these squared values into a new array such that the resulting array remains sorted in ascending order. Your function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_square_sum(1) == ([0], 0)\", \"assert fibonacci_square_sum(2) == ([0, 1], 1)\", \"assert fibonacci_square_sum(3) == ([0, 1, 1], 2)\", \"assert fibonacci_square_sum(4) == ([0, 1, 1, 4], 6)\", \"assert fibonacci_square_sum(5) == ([0, 1, 1, 4, 9], 15)... | {
"split": "train",
"index": 6288,
"acecode_id": "evol_15732",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Develop a function to accurately calculate the perimeter of a rectangle given its length and width. The perimeter of a rectangle can be calculated using the formula: perimeter = 2 * (length + width). Implement a function that takes two parameters, length and width, and returns ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rectangle_perimeter(6, 4) == 20\", \"assert rectangle_perimeter(10, 5) == 30\", \"assert rectangle_perimeter(1, 1) == 4\", \"assert rectangle_perimeter(0, 5) == 10\", \"assert rectangle_perimeter(3, 7) == 20\", \"assert rectangle_perimeter(10, 10) == 40\", \... | {
"split": "train",
"index": 6289,
"acecode_id": "evol_32563",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a version number in the format 'X.Y.Z' where X, Y, and Z are non-negative integers. Your task is to implement a function that determines if the given version number is a valid semantic versioning format. A valid semantic versioning format must satisfy the followin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_semantic_version('1.0.0') == True\", \"assert is_valid_semantic_version('0.1.2') == True\", \"assert is_valid_semantic_version('1.2.3') == True\", \"assert is_valid_semantic_version('1.0') == False\", \"assert is_valid_semantic_version('1.01.0') == ... | {
"split": "train",
"index": 6290,
"acecode_id": "bigcode_python_fns_32365",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that converts a list of tuples into a dictionary format. The function should take in three parameters: `result` (a list of tuples), `columns` (a list of column names), and `single_object` (a boolean indicating whether the result sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_dict([(1, 'Alice'), (2, 'Bob')], ['id', 'name'], True) == {'id': 1, 'name': 'Alice'}\", \"assert convert_to_dict([(1, 'Alice'), (2, 'Bob')], ['id', 'name'], False) == [{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}]\", \"assert convert_to_di... | {
"split": "train",
"index": 6291,
"acecode_id": "oss_1255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of audio samples represented as a list of 16-bit signed integers. Write a function that takes this list as input and returns the maximum amplitude value from the audio samples. The maximum amplitude is defined as the largest absolute value among the audio s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_max_amplitude([0, -1, 2, -3, 4]) == 4\", \"assert get_max_amplitude([1, 2, 3, 4, 5]) == 5\", \"assert get_max_amplitude([-1, -2, -3, -4, -5]) == 5\", \"assert get_max_amplitude([0, 0, 0, 0]) == 0\", \"assert get_max_amplitude([]) == 0\", \"assert get_max... | {
"split": "train",
"index": 6292,
"acecode_id": "bigcode_python_fns_48710",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists, where each inner list contains exactly three integers, implement a function that returns a list containing the sum of integers in each inner list. For example, for the input [[4,6,5],[2,5,8]], the expected output should be [15, 15].\nPlease reason step by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_lists([[1,2,3], [4,5,6], [7,8,9]]) == [6, 15, 24]\", \"assert sum_of_lists([[0,0,0], [1,1,1], [2,2,2]]) == [0, 3, 6]\", \"assert sum_of_lists([[10,20,30], [40,50,60]]) == [60, 150]\", \"assert sum_of_lists([[1,1,1], [1,1,1], [1,1,1]]) == [3, 3, 3]\", ... | {
"split": "train",
"index": 6293,
"acecode_id": "evol_12648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples where each tuple contains a gene_ID and a transcript_ID, write a function that filters the tuples to return only those transcripts that are associated with a specific gene. The function should return a list of tuples containing only the gene_ID and transc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_transcripts([(1, 'T1'), (2, 'T2'), (1, 'T3'), (3, 'T4')], 1) == [(1, 'T1'), (1, 'T3')]\", \"assert filter_transcripts([(1, 'T1'), (2, 'T2'), (1, 'T3'), (3, 'T4')], 2) == [(2, 'T2')]\", \"assert filter_transcripts([(1, 'T1'), (2, 'T2'), (1, 'T3'), (3, ... | {
"split": "train",
"index": 6294,
"acecode_id": "bigcode_python_fns_43396",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to parse a SQL code snippet that defines the creation of a table in a database. Your function should extract the database name, the table name, and the columns with their corresponding data types from the SQL snippet. Implement the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parseSQLCreateTable('CREATE TABLE IF NOT EXISTS test_db.users(\\\"user_id\\\" INT, \\\"user_name\\\" VARCHAR(50));') == {'database_name': 'test_db', 'table_name': 'users', 'columns': [{'column_name': 'user_id', 'data_type': 'INT'}, {'column_name': 'user_name... | {
"split": "train",
"index": 6295,
"acecode_id": "oss_11221",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples where each tuple represents an inconsistency in data, the first element is a unique identifier and the second element is a numeric value, implement a function `reduce_inconsistencies(incons: List[Tuple[int, float]], distance_threshold: float) -> Tuple[Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reduce_inconsistencies([(1, 1.0), (2, 2.0), (3, 2.5)], 0.5) == ([(1, 1.0), (2, 2.0)], {(3, 2.5): (2, 2.0)})\", \"assert reduce_inconsistencies([(1, 1.0), (2, 1.5), (3, 3.0)], 1.0) == ([(1, 1.0), (3, 3.0)], {(2, 1.5): (1, 1.0)})\", \"assert reduce_inconsisten... | {
"split": "train",
"index": 6296,
"acecode_id": "bigcode_python_fns_44170",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a string 'text' and a word 'word', write a function that counts the total occurrences of 'word' in 'text' and returns a tuple containing the count and a list of the starting indices where 'word' appears in 'text'.\nPlease reason step by step, then write a self-contained P... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word('The quick brown fox jumps over the lazy dog.', 'cat') == (0, [])\", \"assert count_word('banana banana banana', 'banana') == (3, [0, 7, 14])\", \"assert count_word('repeat repeat repeat', 'repeat') == (3, [0, 7, 14])\", \"assert count_word('123 4... | {
"split": "train",
"index": 6297,
"acecode_id": "evol_6171",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string `uname` representing a block device unique name, implement a function that returns the block tap type from the unique name. The unique name is structured in a specific format where the block tap type is the second element when the string is split by a delimiter (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert blkdev_uname_to_taptype('device:tap_type:other_info') == 'tap_type'\", \"assert blkdev_uname_to_taptype('disk:tap_type') == 'tap_type'\", \"assert blkdev_uname_to_taptype('device:type') == 'type'\", \"assert blkdev_uname_to_taptype('mydevice:mytap') == 'myta... | {
"split": "train",
"index": 6298,
"acecode_id": "bigcode_python_fns_4438",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two frequency dictionaries, `source_frequency` and `target_frequency`, implement a function `chi_squared` that calculates the Chi Squared statistic by comparing the two frequency distributions. The Chi Squared statistic is defined as the sum of the squared difference betw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert chi_squared({'a': 1, 'b': 1, 'c': 1}, {'a': 1, 'b': 1, 'c': 1}) == 0.0\", \"assert chi_squared({'x': 4, 'y': 5}, {'x': 4, 'y': 4}) == 0.25\", \"assert chi_squared({'p': 10}, {'p': 5}) == 5.0\", \"assert chi_squared({}, {'a': 1, 'b': 1}) == 0.0\", \"assert ch... | {
"split": "train",
"index": 6299,
"acecode_id": "bigcode_python_fns_3074",
"num_tests": 5
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.