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 simulates the creation of a new model in a database migration context. The function should create a dictionary representing a new model named 'NewModel'. This dictionary should contain the following fields: 'name' (a string represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_new_model('Alice', 30) == {'name': 'Alice', 'age': 30, 'created_at': '2023-10-01T12:00:00'}\", \"assert create_new_model('Bob', 25) == {'name': 'Bob', 'age': 25, 'created_at': '2023-10-01T12:00:00'}\", \"assert create_new_model('Charlie', 40) == {'nam...
{ "split": "train", "index": 62700, "acecode_id": "oss_10276", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple banking system that allows deposits and withdrawals. Write a function named `banking_operations` that takes a list of operations and returns the final account balance and the total number of transactions performed. The operations list can...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert banking_operations(['deposit 100', 'withdraw 50']) == (50, 2)\", \"assert banking_operations(['deposit 200', 'withdraw 300']) == (200, 1)\", \"assert banking_operations(['deposit 150', 'withdraw 150', 'withdraw 20']) == (0, 2)\", \"assert banking_operations(...
{ "split": "train", "index": 62701, "acecode_id": "oss_29008", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `analyze_password_complexity(password: str) -> Tuple[str, Dict[str, bool]]` that analyzes the complexity of a given password. The function should return a message indicating whether the password is strong enough and a dictionary containing boolean values fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_password_complexity('Password123!') == ('Your password is strong enough.', {'length_error': False, 'digit_error': False, 'uppercase_error': False, 'lowercase_error': False, 'symbol_error': False})\", \"assert analyze_password_complexity('weakpass') =...
{ "split": "train", "index": 62702, "acecode_id": "evol_21751", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a game. Your task is to implement a function `highest_score` that takes in the list of scores and returns the highest score achieved in the game. The function should have the following signature: `def highest_score(sco...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highest_score([42, 56, 78, 91, 64, 29, 83]) == 91\", \"assert highest_score([0]) == 0\", \"assert highest_score([5, 5, 5, 5]) == 5\", \"assert highest_score([1, 2, 3, 4, 5]) == 5\", \"assert highest_score([100, 200, 300]) == 300\", \"assert highest_score([55...
{ "split": "train", "index": 62703, "acecode_id": "oss_9708", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a given hash algorithm name based on specific rules. The function should take a string input representing the hash algorithm and return the validated name if it is recognized, or raise a ValueError if it is unknown. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_hash_algorithm('SHA256', False) == 'SHA256'\", \"assert validate_hash_algorithm('SHA512', False) == 'SHA512'\", \"assert validate_hash_algorithm('MD5', False) == 'MD5'\", \"assert validate_hash_algorithm('RAW', True) == 'RAW'\", \"assert validate_ha...
{ "split": "train", "index": 62704, "acecode_id": "bigcode_python_fns_42360", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of configuration dictionaries, where each dictionary contains the keys 'ADAPTER', 'FLAVOR', and optionally 'CONFIG_MAPPING'. Your task is to implement a function `get_flavors_metadata_ui_converters(configs: List[Dict[str, Any]]) -> Dict[str, Dict[str, Any]]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_flavors_metadata_ui_converters([{'ADAPTER': 'adapter1', 'FLAVOR': 'flavor1', 'CONFIG_MAPPING': {'key1': 'value1'}}, {'ADAPTER': 'adapter1', 'FLAVOR': 'flavor2'}]) == {'adapter1': {'flavor1': {'key1': 'value1'}, 'flavor2': {}}}\", \"assert get_flavors_met...
{ "split": "train", "index": 62705, "acecode_id": "bigcode_python_fns_32114", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `primes_upto_n(n: int) -> List[int]` that returns a list of all prime numbers up to a specified integer n. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should us...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert primes_upto_n(1) == []\", \"assert primes_upto_n(2) == [2]\", \"assert primes_upto_n(3) == [2, 3]\", \"assert primes_upto_n(10) == [2, 3, 5, 7]\", \"assert primes_upto_n(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert primes_upto_n(30) == [2, 3, 5, 7, 11, 13...
{ "split": "train", "index": 62706, "acecode_id": "evol_18096", "num_tests": 16 }
acecode
[ { "role": "user", "content": "We are playing a modified Guessing Game. In this game, I will pick a number between `1` and `n`. You will guess a number. If you guess correctly, you win the game. If you guess incorrectly, you will be told whether the number I picked is higher or lower, and then you will conti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getMoneyAmount(1) == 0\", \"assert getMoneyAmount(2) == 1\", \"assert getMoneyAmount(3) == 2\", \"assert getMoneyAmount(4) == 4\", \"assert getMoneyAmount(5) == 6\", \"assert getMoneyAmount(6) == 8\", \"assert getMoneyAmount(7) == 10\"]}" }
{ "split": "train", "index": 62707, "acecode_id": "evol_23426", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a sequence of numbers. Your task is to write a function that takes this list and returns the maximum sum of any contiguous subarray of the list. A contiguous subarray is defined as a sequence of elements that are next to each other ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_contiguous_subarray_sum([-2, -3, -1]) == -1\", \"assert max_contiguous_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_contiguous_subarray_sum([]) == 0\", \"assert max_contiguous_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"assert max_contiguous_subarra...
{ "split": "train", "index": 62708, "acecode_id": "bigcode_python_fns_7739", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that takes a string as input and returns a dictionary. In this dictionary, each unique character from the input string should be a key, and its corresponding value should be the character's ASCII value. The function should handle an empty string by retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ascii_dict('abcd') == {'a': 97, 'b': 98, 'c': 99, 'd': 100}\", \"assert ascii_dict('') == {}\", \"assert ascii_dict('hello') == {'h': 104, 'e': 101, 'l': 108, 'o': 111}\", \"assert ascii_dict('Python') == {'P': 80, 'y': 121, 't': 116, 'h': 104, 'o': 111, 'n'...
{ "split": "train", "index": 62709, "acecode_id": "evol_6832", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_customer_view_status(customers: List[int], customer_id: int) -> str` that takes a list of customer IDs and a specific customer ID. The function should return a string indicating whether the specific customer ID is present in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_customer_view_status([1, 2, 3, 4, 5], 3) == 'Customer Found'\", \"assert get_customer_view_status([1, 2, 3, 4, 5], 6) == 'Customer Not Found'\", \"assert get_customer_view_status([1, 2, 2, 4, 5], 2) == 'Customer Found'\", \"assert get_customer_view_statu...
{ "split": "train", "index": 62710, "acecode_id": "bigcode_python_fns_19637", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers 'arr' and an integer 'multiple', write a function that expands the list by inserting a new element (0) at a specified index 'dim' and then tiles the list by repeating the expanded list 'multiple' times. The function should return the new list after the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert expand_and_tile([5, 6, 7], 1, 0) == [0, 5, 6, 7]\", \"assert expand_and_tile([8, 9], 3, -1) == [8, 9, 0, 8, 9, 0, 8, 9, 0]\", \"assert expand_and_tile([], 2, 0) == [0, 0]\", \"assert expand_and_tile([10], 1, 0) == [0, 10]\", \"assert expand_and_tile([4, 5, 6...
{ "split": "train", "index": 62711, "acecode_id": "bigcode_python_fns_11428", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `keyword_search(keywords: List[str]) -> List[str]` that searches for a list of given keywords in a predefined dictionary and also considers keywords that may have similar meanings based on a predefined synonyms mapping. The function should return a list of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert keyword_search(['Car']) == ['A vehicle with four wheels']\", \"assert keyword_search(['Bicycle']) == ['Definition not found for Bicycle']\", \"assert keyword_search(['Tablet']) == ['Definition not found for Tablet']\", \"assert keyword_search(['Play']) == ['...
{ "split": "train", "index": 62712, "acecode_id": "evol_32609", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a variable that can hold different types of data, including integers, strings, lists, and dictionaries. Your task is to implement a function that processes this variable. If the variable is a list or a dictionary, the function should return its JSON serialized rep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_variable(42) == 42\", \"assert process_variable('Hello World') == 'Hello World'\", \"assert process_variable([1, 2, 3]) == '[1, 2, 3]'\", \"assert process_variable({'key': 'value'}) == '{\\\"key\\\": \\\"value\\\"}'\", \"assert process_variable(None)...
{ "split": "train", "index": 62713, "acecode_id": "bigcode_python_fns_38709", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes commands to control a virtual camera in a 3D space. The camera can either rotate or move based on the provided commands. The commands are specified as follows: \n\n1. The command to rotate the camera is in the format: `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_camera_command(\\\"!camera rotate 90\\\", (0, 0), 0.0) == ((0, 0), 90.0)\", \"assert process_camera_command(\\\"!camera move 10 5\\\", (0, 0), 0.0) == ((10, 5), 0.0)\", \"assert process_camera_command(\\\"!camera rotate -45\\\", (0, 0), 90.0) == ((0,...
{ "split": "train", "index": 62714, "acecode_id": "oss_33632", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `num` and a base `base`, implement a function `convert_to_base` that converts the integer `num` into its representation in the specified base. The function should return a list of integers representing the digits of the number in the specified base, starting wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_base(255, 16) == [15, 15]\", \"assert convert_to_base(10, 10) == [0, 1]\", \"assert convert_to_base(0, 5) == [0]\", \"assert convert_to_base(100, 10) == [0, 0, 1]\", \"assert convert_to_base(7, 8) == [7]\", \"assert convert_to_base(1, 2) == [1]\",...
{ "split": "train", "index": 62715, "acecode_id": "oss_3237", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing lines of data, where each line consists of two space-separated elements: an address (in hexadecimal format) and a value (which can be in hexadecimal or decimal format). Your task is to write a function `process_lines(lines: List[str]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_lines([\\\"0x0 0x1\\\", \\\"0x1 10\\\", \\\"\\\\n\\\", \\\"0x2 0xA\\\", \\\"0x3 3\\\"]) == {0: 1, 0: 10, 1: 10, 1: 3}\", \"assert process_lines([\\\"0x4 0xFF\\\", \\\"0x8 256\\\", \\\"\\\\n\\\", \\\"0x1 0x0\\\", \\\"0x7 7\\\"]) == {2: 255, 4: 256, 0:...
{ "split": "train", "index": 62716, "acecode_id": "oss_23937", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that applies text formatting based on a given map of annotation colors. Write a function `annotation_colours_changed` that takes a dictionary `color_map` as input. The keys of the dictionary represent annotation tags (like 'call', 're...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert annotation_colours_changed({'call': 'blue', 'rescall': 'green'}) == {'call': {'underline': True, 'foreground': 'blue'}, 'rescall': {'underline': True, 'foreground': 'green'}}\", \"assert annotation_colours_changed({'unsafe': 'black'}) == {'unsafe': {'backgro...
{ "split": "train", "index": 62717, "acecode_id": "oss_12322", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of 3D object labels, where each label contains information about the object class, width, length, height, and the z-axis coordinate. Your task is to implement a function that calculates the average width, length, and height of a specified object class from ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_dimensions(['car 2.0 4.0 1.5 0.0', 'car 2.5 4.5 1.8 1.0', 'bike 1.0 2.0 1.0 0.0'], 'car') == [2.25, 4.25, 1.65]\", \"assert calculate_average_dimensions(['car 2.0 4.0 1.5 0.0', 'bike 1.0 2.0 1.0 0.0'], 'bike') == [1.0, 2.0, 1.0]\", \"assert...
{ "split": "train", "index": 62718, "acecode_id": "bigcode_python_fns_37621", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers and an index, write a function `get_element_at_index(array, index)` that returns the value of the element at the specified index. If the index is out of bounds, return the string 'Index out of bounds'. The array is 0-indexed, meaning the first element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_element_at_index([3, 7, 11, 15, 19], 2) == 11\", \"assert get_element_at_index([3, 7, 11, 15, 19], 0) == 3\", \"assert get_element_at_index([-1, -5, 2, 0, 4], 1) == -5\", \"assert get_element_at_index([-1, -5, 2, 0, 4], 4) == 4\", \"assert get_element_at...
{ "split": "train", "index": 62719, "acecode_id": "oss_6512", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_layout(level: int, stage: int) -> List[Optional[str]]` that simulates the creation of plot axes based on the input parameters. The function should return a list of axes represented by strings. The rules for creating the axes are a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_layout(1, 0) is None\", \"assert create_layout(3, 2) == ['ax_main', 'ax_bin', 'ax_poi', 'ax_structure', 'ax_signal', 'ax_fourier', 'ax_tags']\", \"assert create_layout(3, 1) == ['ax_main', 'ax_bin', 'ax_poi', None, None, None, None]\", \"assert create...
{ "split": "train", "index": 62720, "acecode_id": "bigcode_python_fns_19260", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the execution of cron jobs based on given intervals and job names. The function should take a list of tuples as input, where each tuple contains an integer representing the interval in seconds and a string representing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_cron_jobs([]) == []\", \"assert simulate_cron_jobs([(10, 'test1')]) == ['Triggered test1 job every 10 seconds.']\", \"assert simulate_cron_jobs([(5, 'job1'), (15, 'job2')]) == ['Triggered job1 job every 5 seconds.', 'Triggered job2 job every 15 seco...
{ "split": "train", "index": 62721, "acecode_id": "bigcode_python_fns_48440", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a structured HTML header for a web page that displays information about an experiment and its associated modules. Write a function `generate_experiment_header(base_dir: str, experiment_dir: str, modules: List[Dict[str, str]]) -> str` that takes in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_experiment_header('/experiments', 'experiment001', [{'id': '1', 'title': 'Module A'}, {'id': '2', 'title': 'Module B'}]) == \\\"<header class=\\\\\\\"w3-container w3-dark-grey\\\\\\\"><h5><a href='#'>experiment001</a></h5></header>\\\\n<div style='w...
{ "split": "train", "index": 62722, "acecode_id": "bigcode_python_fns_8700", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a string representing a sequence of characters. Your task is to implement a function that checks if the string contains any invalid characters. An invalid character is defined as any character that is not a lowercase letter (a-z). If the string contains any invali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_invalid_characters('abcde') == False\", \"assert contains_invalid_characters('abc1de') == True\", \"assert contains_invalid_characters('abcdE') == True\", \"assert contains_invalid_characters('abc!de') == True\", \"assert contains_invalid_characters...
{ "split": "train", "index": 62723, "acecode_id": "bigcode_python_fns_48403", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the genotype of an individual. Your task is to write a function that selects two distinct indices from the list such that the indices are separated by at least one index. The function should return these indices as a tuple. If it is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert choose_genes([1, 2, 3, 4, 5]) == (0, 2)\", \"assert choose_genes([10, 20, 30, 40, 50]) == (0, 2)\", \"assert choose_genes([1]) == None\", \"assert choose_genes([1, 2]) == None\", \"assert choose_genes([1, 2, 3]) in [(0, 2), (0, 1), (1, 2)]\", \"assert choose...
{ "split": "train", "index": 62724, "acecode_id": "bigcode_python_fns_10365", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to check if a given string is a palindrome. A palindrome is a string that reads the same forwards and backwards, ignoring spaces, punctuation, and capitalization. Your function should take a single string input and return a boolean in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('race a car') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome(' ') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palin...
{ "split": "train", "index": 62725, "acecode_id": "oss_36827", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer `n`, write a function `is_happy(number: int) -> bool` that determines if the number is a 'happy number'. A happy number is defined by the following process: starting with any positive integer, replace the number by the sum of the squares of its digits, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_happy(1) == True\", \"assert is_happy(2) == False\", \"assert is_happy(3) == False\", \"assert is_happy(4) == False\", \"assert is_happy(5) == False\", \"assert is_happy(6) == False\", \"assert is_happy(8) == False\", \"assert is_happy(9) == False\", \"as...
{ "split": "train", "index": 62726, "acecode_id": "bigcode_python_fns_35064", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an object, determine if it is a valid fraction represented as a tuple of two integers (numerator, denominator) where the denominator is not zero. A valid fraction should be in the form (a, b) where a is the numerator and b is the denominator. Implement a function 'is_vali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_fraction((1, 2)) == True\", \"assert is_valid_fraction((3, 4)) == True\", \"assert is_valid_fraction((5, -2)) == True\", \"assert is_valid_fraction((-3, 4)) == True\", \"assert is_valid_fraction((0, 1)) == True\", \"assert is_valid_fraction((1, 0)) ...
{ "split": "train", "index": 62727, "acecode_id": "bigcode_python_fns_29050", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a random architecture for a convolutional neural network (CNN) based on given constraints. The architecture should include a specified number of convolutional layers, each with a random number of filters, and a specifie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_cnn_architecture(4, 2, 512)['conv_layers']) <= 4\", \"assert len(generate_cnn_architecture(4, 2, 512)['dense_layers']) <= 2\", \"assert all(16 <= layer['filters'] <= 512 for layer in generate_cnn_architecture(4, 2, 512)['conv_layers'])\", \"asse...
{ "split": "train", "index": 62728, "acecode_id": "oss_23508", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a machine learning model represented as a dictionary. The dictionary contains two keys: 'inputs' and 'outputs'. The 'inputs' key maps to another dictionary where each key is the name of an input layer and the value is a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_model({'inputs': {'input1': [None, 28, 28, 1], 'input2': [None, 224, 224, 3]}, 'outputs': ['output1', 'output2']}) == ((\\\"input1\\\", [None, 28, 28, 1]), \\\"output1\\\")\", \"assert process_model({'inputs': {'layerA': [None, 64], 'layerB': [None, ...
{ "split": "train", "index": 62729, "acecode_id": "oss_23982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 3D array called `vox_volume` representing voxel data and a list of block indices `block_inds` that specify the starting points of blocks within the voxel data. Each block index is a pair of coordinates (x, y) indicating the top-left corner of a block. The size o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_block_features([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], [(0, 0)], 2) == [36]\", \"assert extract_block_features([[[0]], [[0]]], [(0, 0)], 1) == [0]\", \"assert extract_block_features([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], [(0, 0), (0, 0)], 2) == [36, 36]...
{ "split": "train", "index": 62730, "acecode_id": "oss_20446", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the generation and management of activities related to data entities and their provenance. Write a function `manage_provenance(data_entity_id: int, code_name: str, code_description: str) -> dict` that takes in a data en...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_provenance(1, 'random.gauss', 'Generate some random numbers') == {'name': 'random.gauss', 'description': 'Generate some random numbers', 'used': [{'name': 'random.gauss', 'description': 'Generate some random numbers'}]}\", \"assert manage_provenance(2...
{ "split": "train", "index": 62731, "acecode_id": "bigcode_python_fns_12293", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two timestamps in string format, `ts1` and `ts2`, implement a function that checks whether `ts1` is greater than `ts2`. The function should return True if `ts1` is greater than `ts2`, otherwise return False. Both timestamps are in the format 'YYYY-MM-DDTHH:MM:SSZ'.\nPleas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_timestamp('2023-10-01T10:00:00Z', '2023-09-30T10:00:00Z') == True\", \"assert check_timestamp('2023-09-30T10:00:00Z', '2023-10-01T10:00:00Z') == False\", \"assert check_timestamp('2023-10-01T10:00:00Z', '2023-10-01T10:00:00Z') == False\", \"assert chec...
{ "split": "train", "index": 62732, "acecode_id": "bigcode_python_fns_24176", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of 64-bit integers representing timestamps in nanoseconds, write a function that converts each timestamp to a string representing the corresponding date and time in UTC format (YYYY-MM-DD HH:MM:SS). The function should return a list of these formatted date-time str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_timestamps_to_utc([0]) == ['1970-01-01 00:00:00']\", \"assert convert_timestamps_to_utc([1609459200000000000]) == ['2021-01-01 00:00:00']\", \"assert convert_timestamps_to_utc([1577836800000000000, 1577923200000000000, 1578009600000000000]) == ['2020...
{ "split": "train", "index": 62733, "acecode_id": "bigcode_python_fns_18120", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `lucas(n: int) -> int` that returns the nth element in the Lucas numerological sequence, where the sequence starts with 2 and 1, and each subsequent number is the sum of the two preceding ones. The function should handle values of n where n is a positive in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lucas(1) == 2\", \"assert lucas(2) == 1\", \"assert lucas(3) == 3\", \"assert lucas(4) == 4\", \"assert lucas(5) == 7\", \"assert lucas(6) == 11\", \"assert lucas(7) == 18\", \"assert lucas(8) == 29\", \"assert lucas(9) == 47\", \"assert lucas(10) == 76\", \...
{ "split": "train", "index": 62734, "acecode_id": "evol_21105", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a collection of quantitative data points. Your task is to implement a function that identifies if there are any outliers in the data based on the Z-score method. An outlier is defined as a data point that has a Z-score greater than ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_aberration([10, 12, 13, 11, 12]) == False\", \"assert find_aberration([5, 6, 7, 8]) == False\", \"assert find_aberration([7, 8, 9, 10, 11]) == False\", \"assert find_aberration([100, 101, 102, 103, 104, 105, 106, 107, 108, 200]) == True\", \"assert find...
{ "split": "train", "index": 62735, "acecode_id": "evol_23435", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a string, write a function `partition_special_characters(text: str) -> Set[str]` that returns a set of distinct special characters present in the provided string. Special characters are defined as any characters that are not alphanumeric (letters and numbers) and not spac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert partition_special_characters('Hello@#World') == {'@', '#'}\", \"assert partition_special_characters('abc$%^&*def') == {'$', '%', '^', '&', '*'}\", \"assert partition_special_characters('1234!') == {'!'}\", \"assert partition_special_characters('NoSpecialChar...
{ "split": "train", "index": 62736, "acecode_id": "evol_4975", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of geographical territories, each represented as a list containing the territory name, its population, and its land area in square kilometers, write a function that calculates the population density (population divided by land area) for each territory and returns a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert population_density([['Country_1', 5000000, 10000], ['Country_2', 3000000, 8000], ['Country_3', 2000000, 6000]]) == [('Country_3', 333.333), ('Country_2', 375.0), ('Country_1', 500.0)]\", \"assert population_density([['Territory_A', 50000000, 2500], ['Territo...
{ "split": "train", "index": 62737, "acecode_id": "evol_8774", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates handling keypress events for a debugging widget. The function should take a key code as input and perform specific actions based on the key pressed. Implement the function `handle_keypress(key_code)` which should behave...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_keypress(1) == 'Browsing history backward'\", \"assert handle_keypress(2) == 'Resetting search position'\", \"assert handle_keypress(3) == 'Resetting search position'\", \"assert handle_keypress(4) == 'No action taken'\", \"assert handle_keypress(0) =...
{ "split": "train", "index": 62738, "acecode_id": "oss_12338", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the total duration spent on each task by a specific user based on a list of time tracking entries. Each entry includes a username, date, task, duration, work type, and details. Your function should take a list of time trac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_duration('daniel', [('daniel', '20220101', 'task1', '30m', 'development', 'Some details'), ('daniel', '20220102', 'task2', '1h', 'testing', 'Some other details'), ('daniel', '20220103', 'task1', '45m', 'development', 'Some more details')]) ==...
{ "split": "train", "index": 62739, "acecode_id": "oss_17590", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `counting_sort` that takes an array of integers and sorts it in non-decreasing order. The function should efficiently handle arrays containing a significant number of duplicate elements. You may assume that all elements in the array are non-negative ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert counting_sort([4, 2, 2, 8, 3, 3, 1], 8) == [1, 2, 2, 3, 3, 4, 8]\", \"assert counting_sort([1, 0, 1, 0, 1, 0], 1) == [0, 0, 0, 1, 1, 1]\", \"assert counting_sort([5, 5, 5, 5, 5], 5) == [5, 5, 5, 5, 5]\", \"assert counting_sort([100, 1, 99, 100, 0, 1], 100) =...
{ "split": "train", "index": 62740, "acecode_id": "evol_20157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D grid representing a game board where each cell contains a non-negative integer reward. Your task is to implement a function `next_move(grid: List[List[int]], position: Tuple[int, int]) -> Tuple[int, int]` that takes in the grid and a current position represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert next_move([[1, 2, 1], [2, 3, 4], [3, 4, 5]], (1, 2)) == (2, 2)\", \"assert next_move([[1]], (0, 0)) == (0, 0)\", \"assert next_move([[0, 0, 0], [0, 1, 0], [0, 0, 0]], (1, 1)) == (0, 1)\", \"assert next_move([[1, 0], [0, 2]], (0, 0)) == (1, 0)\", \"assert nex...
{ "split": "train", "index": 62741, "acecode_id": "oss_20602", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with determining the coverage status of a test case based on its status string. Write a function `parse_coverage_status(status: str) -> str` that takes a single input parameter `status`, which is a string that can either be 'SATISFIED' or any other string. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_coverage_status('SATISFIED') == 'HIT'\", \"assert parse_coverage_status('satisfied') == 'HIT'\", \"assert parse_coverage_status('SAtisfied') == 'HIT'\", \"assert parse_coverage_status('MISSED') == 'MISSED'\", \"assert parse_coverage_status('missed') ==...
{ "split": "train", "index": 62742, "acecode_id": "bigcode_python_fns_904", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working for a social media analytics company and need to create a program that extracts the username from a given Facebook author URL. The author URL is formatted as 'https://facebook.com/username'. Write a Python function `extract_username` that takes a Facebook author...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_username('https://facebook.com/user123') == 'user123'\", \"assert extract_username('https://facebook.com/jane.doe') == 'jane.doe'\", \"assert extract_username('https://facebook.com/JohnDoe1985') == 'JohnDoe1985'\", \"assert extract_username('https://...
{ "split": "train", "index": 62743, "acecode_id": "oss_36719", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `symbolizer` that represents an XML snippet used to define a styling rule for a map feature, create a function `add_sld_boilerplate` that wraps this snippet in the appropriate SLD (Styled Layer Descriptor) XML structure. The function should return a complete SLD ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_sld_boilerplate('<PointSymbolizer><Graphic><Mark><WellKnownName>circle</WellKnownName><Fill><CssParameter name=\\\"fill\\\">#ff0000</CssParameter></Fill></Mark></Graphic></PointSymbolizer>') == '<StyledLayerDescriptor version=\\\"1.0.0\\\" xmlns=\\\"http...
{ "split": "train", "index": 62744, "acecode_id": "bigcode_python_fns_48367", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a formatted string representation of an HTTP response. The function should take in the following parameters: a list of addresses, a boolean indicating if the response is fatal, an integer representing the number of retr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_http_response(['192.168.1.1'], False, 3, 200, 'OK') == '200 OK'\", \"assert format_http_response(['10.0.0.1'], True, 1, 404, 'Not Found') == '404 Not Found'\", \"assert format_http_response(['172.16.0.1'], False, 0, 0, 'No Content') == 'No Content'\",...
{ "split": "train", "index": 62745, "acecode_id": "oss_15418", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `generate_word_frequency_map(s: str) -> dict` that accepts a string `s` consisting of contiguous characters. The function should generate a hashmap (dictionary) where each distinct word corresponds to a key, yielding the frequency of its appearance as the v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_word_frequency_map('Python is great. Python is fun!') == {'fun': 1, 'great': 1, 'is': 2, 'python': 2}\", \"assert generate_word_frequency_map('test, test; test_test. Test?') == {'test': 3, 'test_test': 1}\", \"assert generate_word_frequency_map('abc...
{ "split": "train", "index": 62746, "acecode_id": "evol_14887", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a sequence. Your task is to find the maximum sum of a contiguous subarray within the sequence. The contiguous subarray must contain at least one number. Implement a function `max_subarray_sum(nums: List[int]) -> int` that returns th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([-1]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-2, -3, -1]) == -1\", \"assert max_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"ass...
{ "split": "train", "index": 62747, "acecode_id": "bigcode_python_fns_29371", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a specific index, implement a function that inserts a given element at that index in the list. The function should return the modified list after the insertion. You may assume that the index is always valid for the given list. Write a function `inse...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_at_index([2, 4, 6, 8, 10], 3, 5) == [2, 4, 6, 5, 8, 10]\", \"assert insert_at_index([1, 3, 5], 0, 0) == [0, 1, 3, 5]\", \"assert insert_at_index([10, 20, 30], 2, 25) == [10, 20, 25, 30]\", \"assert insert_at_index([], 0, 1) == [1]\", \"assert insert_a...
{ "split": "train", "index": 62748, "acecode_id": "evol_17182", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `create_batches` that takes the list, a batch size, and a boolean flag `shuffle`. The function should return a list of lists, where each inner list represents a batch of integers. If `shuffle` is True, the input list should be shuffled...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_batches([1, 2, 3, 4, 5], 2, False) == [[1, 2], [3, 4], [5]]\", \"assert create_batches([1, 2, 3, 4, 5], 3, False) == [[1, 2, 3], [4, 5]]\", \"assert create_batches([1, 2, 3, 4, 5], 5, False) == [[1, 2, 3, 4, 5]]\", \"assert create_batches([1, 2, 3, 4,...
{ "split": "train", "index": 62749, "acecode_id": "bigcode_python_fns_37772", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that calculates the aggregate sum of unique elements in the list and returns the count of these distinct elements. The function should be able to handle lists containing both positive and negative integers and should work for lists of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_aggregate_unique_elements([1, 2, 3, 4, 5]) == (15, 5)\", \"assert calculate_aggregate_unique_elements([-1, -2, -3, -1, -2]) == (-6, 3)\", \"assert calculate_aggregate_unique_elements([0, 0, 0, 0]) == (0, 1)\", \"assert calculate_aggregate_unique_el...
{ "split": "train", "index": 62750, "acecode_id": "evol_6361", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a collection of strings denoted as `words`, your task is to identify and return those words that can be typed using only the letters present on a single row of the American keyboard. The rows are defined as follows: the top row contains the characters 'qwertyuiop', the mi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findWords(['omk']) == []\", \"assert findWords(['adsdf','sfd']) == ['adsdf','sfd']\", \"assert findWords(['QWERTY','ASDF','ZXCV']) == ['QWERTY','ASDF','ZXCV']\", \"assert findWords(['qwerty', 'asdf', 'zxcvbn']) == ['qwerty', 'asdf', 'zxcvbn']\", \"assert fin...
{ "split": "train", "index": 62751, "acecode_id": "evol_3273", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple logger for applications. Implement a function `register_application(name: str) -> bool` that takes a string `name` representing the name of the application and registers it in the logger. The logger maintains a record of registered applicat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_application('app1') == True\", \"assert register_application('app2') == True\", \"assert register_application('app3') == True\", \"assert register_application('app4') == True\", \"assert register_application('app5') == True\", \"assert register_appl...
{ "split": "train", "index": 62752, "acecode_id": "bigcode_python_fns_10961", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with setting up a virtual camera configuration based on given parameters. Implement a function called `setup_virtual_camera` that takes a boolean parameter `is_fullscreen`. If `is_fullscreen` is True, the camera should be set to full screen mode. If it is False, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_virtual_camera(True) == {'resolution': '1920x1080', 'fullscreen': True, 'window_size': None, 'awb_mode': 'off'}\", \"assert setup_virtual_camera(False) == {'resolution': '1920x1080', 'fullscreen': False, 'window_size': '800x600', 'awb_mode': 'off'}\", ...
{ "split": "train", "index": 62753, "acecode_id": "bigcode_python_fns_43316", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines if a user has permission to perform a certain action based on their authentication status and permissions. The function should take two parameters: a boolean `is_authenticated` indicating if the user is authenticated, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_permission(True, True) == True\", \"assert has_permission(True, False) == False\", \"assert has_permission(False, True) == False\", \"assert has_permission(False, False) == False\", \"assert has_permission(True, True) == True\", \"assert has_permission(F...
{ "split": "train", "index": 62754, "acecode_id": "oss_19078", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates the length of user-generated messages called 'chirps'. A chirp is a short message, and it should not exceed 80 characters. Your function should take a string input representing the chirp and return a message if the chirp is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_chirp('Hello, world!') is None\", \"assert validate_chirp('This chirp is exactly eighty characters long and it should be valid.') is None\", \"assert validate_chirp('Short chirp') is None\", \"assert validate_chirp('') is None\", \"assert validate_c...
{ "split": "train", "index": 62755, "acecode_id": "oss_18707", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a 2D game character. The function should take the following parameters: `pos_x` (an integer representing the character's x-coordinate), `pos_y` (an integer representing the character's y-coordinate), `img_idx` (an integ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_character(5, 5, 1, 3, 6, 7, 2) == '3:0 2:3'\", \"assert simulate_character(0, 0, 0, 0, 4, 4, 1) == '0:0 1:0'\", \"assert simulate_character(10, 10, 5, 10, 15, 20, 3) == '10:0 3:10'\", \"assert simulate_character(1, 1, 2, 5, 2, 2, 4) == '5:0 4:5'\", ...
{ "split": "train", "index": 62756, "acecode_id": "oss_13646", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples where each tuple consists of an operation (a string that can be 'equal', 'delete', or 'insert') and a string representing data, convert this list into a modified diff format. The output should be a list of tuples where each tuple represents a line change....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_diff_format([('insert', 'This'), ('insert', 'is'), ('equal', 'a test')]) == [(1, '+This'), (2, '+is'), (3, 'a test')]\", \"assert convert_diff_format([('delete', 'Only Deleted')]) == [(1, '-Only Deleted')]\", \"assert convert_diff_format([('insert', ...
{ "split": "train", "index": 62757, "acecode_id": "bigcode_python_fns_17014", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of tracks represented by their unique IDs and a function that retrieves similar tracks based on a given track ID. Your task is to implement a function that adds up to 'howmany' similar tracks for a specified track or a range of tracks from the playlist. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_similar_tracks(0, 3, True) == 3\", \"assert add_similar_tracks(1, 2, False) == 2\", \"assert add_similar_tracks('0:2', 4, True) == 4\", \"assert add_similar_tracks('1:3', 1, False) == 1\", \"assert add_similar_tracks('0:3', 2, True) == 2\", \"assert add_...
{ "split": "train", "index": 62758, "acecode_id": "bigcode_python_fns_12224", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that returns the maximum product of any three distinct numbers in the array. If the array has fewer than three elements, the function should raise an exception.\nPlease reason step by step, then write a self-contained Python solution...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_product_of_three([2, 4, 8, 9, 3]) == 288\", \"assert max_product_of_three([-10, -10, 5, 2]) == 500\", \"assert max_product_of_three([1, 2, 3]) == 6\", \"assert max_product_of_three([-1, -2, -3, -4]) == -6\", \"assert max_product_of_three([1, 2, 3, 4, 5])...
{ "split": "train", "index": 62759, "acecode_id": "evol_9678", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers representing the daily stock prices of a particular stock. Your task is to find the maximum profit that can be obtained by buying and selling the stock at most once. The maximum profit is defined as the maximum difference between any two price...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxProfit([240, 145, 129, 151]) == 22\", \"assert maxProfit([7, 1, 5, 3, 6, 4]) == 5\", \"assert maxProfit([7, 6, 4, 3, 1]) == 0\", \"assert maxProfit([1, 2, 3, 4, 5]) == 4\", \"assert maxProfit([5, 4, 3, 2, 1]) == 0\", \"assert maxProfit([1]) == 0\", \"asse...
{ "split": "train", "index": 62760, "acecode_id": "oss_31019", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the Root Mean Square Error (RMSE) between two sets of data points. The RMSE is defined as the square root of the average of the squares of the differences between the predicted and actual values. Implement a function `calculate_rmse(predicted: Li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rmse([1.0, 2.0, 3.0], [1.0, 2.0, 3.0]) == 0.0\", \"assert calculate_rmse([1.0, 2.0], [1.0, 2.0]) == 0.0\", \"assert calculate_rmse([5.0, 5.0], [4.0, 4.0]) == 1.0\", \"assert calculate_rmse([0.0, 0.0, 0.0], [0.0, 0.0, 0.0]) == 0.0\", \"assert calcul...
{ "split": "train", "index": 62761, "acecode_id": "bigcode_python_fns_13979", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes two lists of strings representing file paths. The first list contains input file paths and the second list contains output file paths. Your function should return a list of tuples, where each tuple contains the input fil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pair_files(['input1.mp4', 'input2.mp4'], ['output1.mov', 'output2.mov']) == [('input1.mp4', 'output1.mov'), ('input2.mp4', 'output2.mov')]\", \"assert pair_files(['file1.txt'], ['file1_out.txt']) == [('file1.txt', 'file1_out.txt')]\", \"assert pair_files(['f...
{ "split": "train", "index": 62762, "acecode_id": "oss_2460", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents an XML document containing various elements. Your task is to implement a function that extracts the title from the XML document. The title is defined as the text content of the first `<title>` element found in the XML. If there is no `<tit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_title('<root><title>Example Title</title></root>') == 'Example Title'\", \"assert extract_title('<root><title>Another Title</title><title>Second Title</title></root>') == 'Another Title'\", \"assert extract_title('<root><Title>Case Sensitive Title</T...
{ "split": "train", "index": 62763, "acecode_id": "bigcode_python_fns_22205", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the Collatz sequence for a given positive integer n. The Collatz sequence is defined as follows: Start with any positive integer n. If n is even, the next term is n divided by 2. If n is odd, the next term is 3 times n pl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert collatz(1) == [1]\", \"assert collatz(2) == [2, 1]\", \"assert collatz(3) == [3, 10, 5, 16, 8, 4, 2, 1]\", \"assert collatz(4) == [4, 2, 1]\", \"assert collatz(5) == [5, 16, 8, 4, 2, 1]\", \"assert collatz(6) == [6, 3, 10, 5, 16, 8, 4, 2, 1]\", \"assert coll...
{ "split": "train", "index": 62764, "acecode_id": "oss_5435", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates storing a value in memory and calculating the size of a string. The function, `store_and_return_size`, should take three parameters: an integer `dst_ptr` representing a memory address, a string `out_str` whose size need...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert store_and_return_size(0, 'Hello, World!', 32) == 1\", \"assert store_and_return_size(10, 'Python', 64) == 0\", \"assert store_and_return_size(5, '', 16) == 0\", \"assert store_and_return_size(20, 'LeetCode', 32) == 1\", \"assert store_and_return_size(15, 'Op...
{ "split": "train", "index": 62765, "acecode_id": "oss_20622", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing the name of a certificate file. Your task is to implement a function that returns a string indicating the content of the certificate. For simplicity, the content of the certificate can be represented as a predefined mapping of certificate nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_certificate_content('cert1') == 'Content of Certificate 1'\", \"assert get_certificate_content('cert2') == 'Content of Certificate 2'\", \"assert get_certificate_content('cert3') == 'Content of Certificate 3'\", \"assert get_certificate_content('cert4') ...
{ "split": "train", "index": 62766, "acecode_id": "bigcode_python_fns_21052", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D list of integers representing a matrix, write a function `get_zero_columns(matrix: List[List[int]]) -> List[bool]` that returns a list of boolean values indicating whether each column in the matrix contains only zeros. The output list should have the same number of e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_zero_columns([[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == [True, False, True]\", \"assert get_zero_columns([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [False, False, False]\", \"assert get_zero_columns([[0], [0], [0]]) == [True]\", \"assert get_zero_columns([[1], [0]...
{ "split": "train", "index": 62767, "acecode_id": "bigcode_python_fns_15671", "num_tests": 14 }
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 be defined as `def sum_of_evens(numbers: List[int]) -> int:`. \n\nExample:\n- Input: [1, 2, 3, 4, 5] \n- Output: 6 \n- ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([1, 2, 3, 5, 7]) == 2\", \"asser...
{ "split": "train", "index": 62768, "acecode_id": "bigcode_python_fns_32950", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of strings: messages and categories. Each list contains the same number of elements, and the ith element in messages corresponds to the ith element in categories. Your task is to create a function that combines these two lists into a dictionary where the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_messages_and_categories(['Hello', 'World', 'Hello'], ['Greeting', 'Place', 'Greeting']) == {'Hello': ['Greeting', 'Greeting'], 'World': 'Place'}\", \"assert combine_messages_and_categories(['A', 'B', 'C'], ['1', '2', '3']) == {'A': '1', 'B': '2', 'C'...
{ "split": "train", "index": 62769, "acecode_id": "bigcode_python_fns_48952", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of a group of people. Your task is to implement a function that determines how many people are taller than a specified height. The function should take in two parameters: a list of integers `heights` and an integer `thre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_taller([150, 160, 170, 180], 165) == 2\", \"assert count_taller([150, 160, 170, 180], 150) == 3\", \"assert count_taller([150, 160, 170, 180], 180) == 0\", \"assert count_taller([150, 160, 170, 180], 200) == 0\", \"assert count_taller([], 165) == 0\", ...
{ "split": "train", "index": 62770, "acecode_id": "oss_25116", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of context objects where each context has a 'name' and a 'help' string. Write a function `print_contexts(contexts: List[Dict[str, str]]) -> List[str]` that takes a list of contexts and returns a list of strings formatted as 'name - help'. If the input list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_contexts([]) == ['No contexts were found.']\", \"assert print_contexts([{'name': 'context1', 'help': 'Help for context 1'}]) == ['context1 - Help for context 1']\", \"assert print_contexts([{'name': 'context1', 'help': 'Help for context 1'}, {'name': '...
{ "split": "train", "index": 62771, "acecode_id": "bigcode_python_fns_24170", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a skyline view. Your task is to determine the maximum height of the skyline that can be formed by these buildings when viewed from the front. The skyline is defined as the highest point visible from the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_skyline_height([]) == 0\", \"assert max_skyline_height([1, 2, 3, 4, 5]) == 5\", \"assert max_skyline_height([5, 4, 3, 2, 1]) == 5\", \"assert max_skyline_height([1, 3, 2, 5, 4]) == 5\", \"assert max_skyline_height([2, 2, 2, 2, 2]) == 2\", \"assert max_sk...
{ "split": "train", "index": 62772, "acecode_id": "bigcode_python_fns_24525", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of transactions, where each transaction is represented as a set of items. Your task is to implement a function `generate_header_table(dataSet)` that takes this list of transactions as input and returns a dictionary. This dictionary should contain unique ite...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_header_table([{'apple', 'bread', 'milk'}, {'bread', 'milk'}, {'apple', 'bread', 'milk'}, {'apple', 'bread'}, {'bread', 'milk'}]) == {'apple': 3, 'bread': 5, 'milk': 4}\", \"assert generate_header_table([{'banana'}, {'banana', 'orange'}, {'apple'}, {...
{ "split": "train", "index": 62773, "acecode_id": "oss_7026", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates running a series of environment tests. The function `run_environment_tests` should take a list of test names as input and return a list of results indicating whether each test was successful or failed. Each test name ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert run_environment_tests(['SSH Connection']) == ['Success']\", \"assert run_environment_tests(['ICMP Ping']) == ['Failure']\", \"assert run_environment_tests(['Ganeti Commands']) == ['Success']\", \"assert run_environment_tests(['SSH Connection', 'ICMP Ping']) ...
{ "split": "train", "index": 62774, "acecode_id": "bigcode_python_fns_45824", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sentence, implement a function that extracts individual words, ignores any punctuation, and returns a list of those words sorted by their length in descending order. The sorting should be case insensitive and for words of the same length, they should appear in the order...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_words_by_length('Hello, beautiful World!') == ['beautiful', 'hello', 'world']\", \"assert sort_words_by_length('Python is great!') == ['python', 'great', 'is']\", \"assert sort_words_by_length('Hello!! This is a test...') == ['hello', 'this', 'test', 'i...
{ "split": "train", "index": 62775, "acecode_id": "evol_8817", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that removes a specified client ID from a list of registered client IDs for an OpenID Connect provider. Your function should take in two parameters: a string representing the OpenID Connect Provider ARN and a string representing the Clien...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_client_id('arn:aws:iam::123456789012:oidc-provider/example.com', 'client1', ['client1', 'client2', 'client3']) == ['client2', 'client3']\", \"assert remove_client_id('arn:aws:iam::123456789012:oidc-provider/example.com', 'client4', ['client1', 'client...
{ "split": "train", "index": 62776, "acecode_id": "bigcode_python_fns_31373", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing player data in a gaming system. You are provided with a dictionary containing player IDs as keys and another dictionary as values, which includes the player's date of birth and company name. Write a function called `get_player_data(player_id: str, s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_player_data('player1', {'player1': {'date_birth': '1990-05-15', 'company': 'Gaming Inc.'}, 'player2': {'date_birth': '1985-12-25', 'company': 'Game Studios'}}) == {'date_birth': '1990-05-15', 'company': 'Gaming Inc.'}\", \"assert get_player_data('player2...
{ "split": "train", "index": 62777, "acecode_id": "oss_34619", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the Lowest Common Multiple (LCM) of two positive integers 'x' and 'y'. The function should raise an error if either input is not a positive integer. The function should return the LCM if both inputs are valid. If the inputs are invalid, return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_lcm(3, 5) == 15\", \"assert compute_lcm(4, 6) == 12\", \"assert compute_lcm(15, 25) == 75\", \"assert compute_lcm(7, 3) == 21\", \"assert compute_lcm(9, 12) == 36\", \"assert compute_lcm(1, 1) == 1\", \"assert compute_lcm(13, 39) == 39\", \"assert co...
{ "split": "train", "index": 62778, "acecode_id": "evol_6653", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages the training status of a machine learning model. Your function should allow the user to set the training status and retrieve whether the model has been trained or not. The function should have the following specifications...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_model_training(False, 'get') == False\", \"assert manage_model_training(True, 'set') == None\", \"assert manage_model_training(False, 'set') == None\", \"assert manage_model_training(False, 'get') == False\", \"assert manage_model_training(True, 'set'...
{ "split": "train", "index": 62779, "acecode_id": "oss_20814", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are asked to implement a function that validates UUID (Universally Unique Identifier) strings. A valid UUID string must follow the format 'xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx', where 'x' is any hexadecimal digit (0-9, a-f), 'M' indicates the version (1-5), and 'N' indicate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_uuid('12345678-1234-5678-1234-56781234567G') == False\", \"assert validate_uuid('12345678-1234-5678-1234-5678123456781') == False\", \"assert validate_uuid('12345678-1234-5678-1234-56781234567') == False\", \"assert validate_uuid('12345678-1234-5678...
{ "split": "train", "index": 62780, "acecode_id": "bigcode_python_fns_30482", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a 2D array of integers where each element represents a score. Additionally, you are provided with a 1D array of integers representing the weights for each corresponding column in the 2D array. Your task is to calculate the weighted percentage score for each column...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_weighted_percentage([[0, 0, 0], [0, 0, 0]], [1, 2, 3]) == [0.0, 0.0, 0.0]\", \"assert calculate_weighted_percentage([[1]], [1]) == [100.0]\", \"assert calculate_weighted_percentage([[0]], [1]) == [0.0]\", \"assert calculate_weighted_percentage([[1,...
{ "split": "train", "index": 62781, "acecode_id": "bigcode_python_fns_36579", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that finds and returns the maximum product of any two distinct integers in the list. If the list contains fewer than two integers, the function should return None. The function should be named `max_product_of_two(nums: List[int]) -> Op...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_product_of_two([3, 5, 2, 8]) == 40\", \"assert max_product_of_two([-10, -20, 5, 3]) == 200\", \"assert max_product_of_two([1, 0, -1, 3]) == 3\", \"assert max_product_of_two([7]) == None\", \"assert max_product_of_two([]) == None\", \"assert max_product_o...
{ "split": "train", "index": 62782, "acecode_id": "bigcode_python_fns_4675", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two integers, `m` and `k`, and a sequence of integers. Your task is to implement a function `calculateMKAverage(sequence: List[int], m: int, k: int) -> int` that computes the MKAverage for the given sequence. The MKAverage is defined as follows: If the count of el...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculateMKAverage([3, 1], 3, 1) == -1\", \"assert calculateMKAverage([3, 1, 10], 3, 1) == 3\", \"assert calculateMKAverage([3, 1, 10, 5, 5], 3, 1) == 5\", \"assert calculateMKAverage([3, 1, 10, 5, 5, 5], 3, 1) == 5\", \"assert calculateMKAverage([1, 2, 3, 4...
{ "split": "train", "index": 62783, "acecode_id": "evol_33982", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of collection names as strings. Write a function `remove_collections(collections: List[str]) -> List[str]` that simulates the removal of these collections. The function should return a list of strings indicating the result of each removal operation. If the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_collections(['Sx-Cat']) == ['Successfully removed Sx-Cat collection.']\", \"assert remove_collections(['Collection1', 'Collection2']) == ['Failed to remove the Sx-Cat collection. Check if the collection exists and remove it manually.', 'Failed to remo...
{ "split": "train", "index": 62784, "acecode_id": "bigcode_python_fns_18919", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D list of floating-point numbers, create a function that generates a heatmap representation of the values. The heatmap should use a gradient from red to green, where lower values are represented by red and higher values by green. Your function should return a 2D list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_heatmap([[1.0]]) == [['1.00']]\", \"assert generate_heatmap([[0.0, 5.0], [10.0, 15.0]]) == [['0.00', '5.00'], ['10.00', '15.00']]\", \"assert generate_heatmap([[1.1, 2.2], [3.3, 4.4]]) == [['1.10', '2.20'], ['3.30', '4.40']]\", \"assert generate_hea...
{ "split": "train", "index": 62785, "acecode_id": "bigcode_python_fns_35313", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a function called `count_subsequences` to determine the number of non-overlapping subsequences of a given substring within an initial string. The function should take two parameters: a string `string` and a substring `substring`. It should return the count of distinct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_subsequences('', 'a') == 0\", \"assert count_subsequences('abc', '') == 0\", \"assert count_subsequences('abc', 'a') == 1\", \"assert count_subsequences('abcabc', 'ab') == 3\", \"assert count_subsequences('abcd', 'd') == 1\", \"assert count_subsequence...
{ "split": "train", "index": 62786, "acecode_id": "evol_5579", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a string of text to replace specific abbreviations with their corresponding full forms. The function should take a string of text as input and replace occurrences of certain abbreviations with predefined expanded for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_abbreviations('Python is often abbreviated as Py.') == 'Python is often abbreviated as Python.'\", \"assert process_abbreviations('I love AI and ML.') == 'I love Artificial Intelligence and Machine Learning.'\", \"assert process_abbreviations('The da...
{ "split": "train", "index": 62787, "acecode_id": "oss_3430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, replace all punctuation marks with their corresponding ASCII values and return the modified string. A punctuation mark is defined as any character that is not an alphanumeric character (i.e., not a letter or a digit).\nPlease reason step by step, then write a se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_punctuation_with_ascii('Hello, World!') == 'Hello44 World33'\", \"assert replace_punctuation_with_ascii('What a day?') == 'What a day63'\", \"assert replace_punctuation_with_ascii('Good morning!') == 'Good morning33'\", \"assert replace_punctuation_w...
{ "split": "train", "index": 62788, "acecode_id": "evol_1044", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function that takes in a musician's name, age, instrument, and genre as parameters and returns a dictionary representation of the musician with the keys 'name', 'age', 'instrument', and 'genre'.\nPlease reason step by step, then write a self-contained Python solution. G...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_musician('John Doe', 30, 'Guitar', 'Rock') == {'name': 'John Doe', 'age': 30, 'instrument': 'Guitar', 'genre': 'Rock'}\", \"assert create_musician('Jane Smith', 25, 'Violin', 'Classical') == {'name': 'Jane Smith', 'age': 25, 'instrument': 'Violin', 'g...
{ "split": "train", "index": 62789, "acecode_id": "evol_27470", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integer arrays of the same length, create a function that swaps the elements of the first array with the corresponding elements of the second array in reverse order. The first element of the first array should swap with the last element of the second array, the second...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_elements([1], [2]) == ([2], [1])\", \"assert swap_elements([1, 2], [3, 4]) == ([4, 3], [2, 1])\", \"assert swap_elements([5, 6, 7], [8, 9, 10]) == ([10, 9, 8], [7, 6, 5])\", \"assert swap_elements([-1, -2, -3], [3, 2, 1]) == ([1, 2, 3], [-3, -2, -1])\",...
{ "split": "train", "index": 62790, "acecode_id": "evol_26314", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a collection of elements in a geographical data format. Write a function `merge_geographical_data(jsons: List[Dict]) -> Dict` that merges all the elements from the input dictionaries into a single dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_geographical_data([]) == {'elements': []}\", \"assert merge_geographical_data([{'elements': []}]) == {'elements': []}\", \"assert merge_geographical_data([{'elements': [{'id': 1}], 'other_key': 'value'}]) == {'elements': [{'id': 1}]}\", \"assert merge_...
{ "split": "train", "index": 62791, "acecode_id": "bigcode_python_fns_32690", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of neurons represented by dictionaries, where each dictionary contains information about whether a neuron is lateralized and whether it is fully connected. Write a function `filter_neurons(neurons)` that takes a list of neuron dictionaries and returns a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_neurons([{'id': 1, 'lateralized': True, 'fully_connected': True}, {'id': 2, 'lateralized': False, 'fully_connected': True}]) == [{'id': 1, 'lateralized': True, 'fully_connected': True}]\", \"assert filter_neurons([{'id': 3, 'lateralized': True, 'fully...
{ "split": "train", "index": 62792, "acecode_id": "oss_9933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of non-negative integers representing the amount of money of each house arranged in a circle, where the first house is adjacent to the last house. You cannot rob adjacent houses, meaning you cannot rob two directly neighboring houses. Write a function `maxR...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxRobbery([0]) == 0\", \"assert maxRobbery([1]) == 1\", \"assert maxRobbery([0, 0, 0]) == 0\", \"assert maxRobbery([5, 10]) == 10\", \"assert maxRobbery([10, 5]) == 10\", \"assert maxRobbery([2, 3, 2]) == 3\", \"assert maxRobbery([1, 2, 3, 1]) == 4\", \"ass...
{ "split": "train", "index": 62793, "acecode_id": "oss_24761", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a string representing a dimension in the format 'key:value'. Implement a function called `is_valid_dimension` that checks if the dimension is valid. A dimension is considered valid if the key is a non-empty string and the value is a positive integer. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_dimension('length:10') == True\", \"assert is_valid_dimension('width:5') == True\", \"assert is_valid_dimension('height:0') == False\", \"assert is_valid_dimension('depth:-3') == False\", \"assert is_valid_dimension('volume:abc') == False\", \"asser...
{ "split": "train", "index": 62794, "acecode_id": "bigcode_python_fns_29364", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, replace every instance of a specific character c within its string representation with another character d. Implement a function `replace_instance(n: int, c: str, d: str) -> int` that performs this operation and returns the modified integer.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_instance(123456789, '3', '7') == 127456789\", \"assert replace_instance(987654321, '8', '0') == 907654321\", \"assert replace_instance(1111111, '1', '2') == 2222222\", \"assert replace_instance(246824682468, '2', '9') == 946894689468\", \"assert repl...
{ "split": "train", "index": 62795, "acecode_id": "evol_6542", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function `sum_even_fibonacci(n)` that calculates the sum of all even Fibonacci numbers up to n (inclusive). The Fibonacci sequence starts with 0 and 1, and the next number is found by adding the two previous numbers. Your function should return the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_even_fibonacci(0) == 0\", \"assert sum_even_fibonacci(1) == 0\", \"assert sum_even_fibonacci(2) == 2\", \"assert sum_even_fibonacci(3) == 2\", \"assert sum_even_fibonacci(4) == 2\", \"assert sum_even_fibonacci(5) == 2\", \"assert sum_even_fibonacci(8) ==...
{ "split": "train", "index": 62796, "acecode_id": "bigcode_python_fns_37118", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that extracts the copyright information from a given string. The copyright information is typically found at the beginning of the string and follows a specific format. The copyright notice includes the copyright symbol ('©'), the year of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_copyright_info('# Copyright (C) 2015. OpenAI. All rights reserved.') == (2015, 'OpenAI')\", \"assert extract_copyright_info('Some random text before the copyright notice.') == 'No copyright notice found.'\", \"assert extract_copyright_info('No copyri...
{ "split": "train", "index": 62797, "acecode_id": "oss_4518", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of annotations, where each annotation has a category name and an associated category ID. Your task is to replace the category names in the annotations with their corresponding sub-category names based on a given mapping. If a category name does not have a c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_categories([{'category_name': 'foo', 'category_id': 1}, {'category_name': 'bak', 'category_id': 2}], {'foo': 'foo_1', 'bak': 'bak_1'}) == [{'category_name': 'foo_1', 'category_id': 1}, {'category_name': 'bak_1', 'category_id': 2}]\", \"assert replace...
{ "split": "train", "index": 62798, "acecode_id": "bigcode_python_fns_20580", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two integers, `residues` and `conformations`, representing the number of residues in a model and the maximum number of conformations available, respectively. Your task is to implement a function that returns a list of slices based on specific keys. The keys can be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_slices(5, 3, 'PED_ID') == [slice(0, 1)]\", \"assert extract_slices(5, 3, 'RD') == [slice(1, 4)]\", \"assert extract_slices(5, 3, 'EN') == [slice(4, 9)]\", \"assert extract_slices(5, 3, 'MED_ASA') == [slice(9, 14)]\", \"assert extract_slices(5, 3, 'ME...
{ "split": "train", "index": 62799, "acecode_id": "bigcode_python_fns_10595", "num_tests": 13 }