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": "Implement a function `unique_count(lst)` that takes a list of integers and returns the count of unique elements in that list. For example, given the list [5, 5, 2, 2, 2, 8, 8, 9, 9, 9, 9], the function should return 4 since the unique elements are 5, 2, 8, and 9.\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_count([5, 5, 2, 2, 2, 8, 8, 9, 9, 9, 9]) == 4\", \"assert unique_count([1, 1, 1, 1]) == 1\", \"assert unique_count([2, 3, 4, 5, 6]) == 5\", \"assert unique_count([]) == 0\", \"assert unique_count([7, 8, 8, 9, 10, 10]) == 4\", \"assert unique_count([1,... | {
"split": "train",
"index": 78200,
"acecode_id": "evol_30676",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a Server UUID, your task is to implement a function that returns a list of Storage UUIDs associated with that Server UUID. The input is a string, and you should return a list of strings. The Storage UUIDs are assumed to be predefined and associated w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_storage_uuids('server-1') == ['storage-a', 'storage-b']\", \"assert find_storage_uuids('server-2') == ['storage-c']\", \"assert find_storage_uuids('server-3') == []\", \"assert find_storage_uuids('server-4') == []\", \"assert find_storage_uuids('server-... | {
"split": "train",
"index": 78201,
"acecode_id": "bigcode_python_fns_32747",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two dates represented as lists of integers in the format [year, month, day], implement a function that compares the two dates. The function should return 1 if the first date is later than the second date, -1 if the first date is earlier than the second date, and 0 if both... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compareDates([2023, 10, 15], [2023, 10, 15]) == 0\", \"assert compareDates([2022, 5, 20], [2023, 1, 1]) == -1\", \"assert compareDates([2023, 1, 1], [2022, 12, 31]) == 1\", \"assert compareDates([2020, 2, 29], [2021, 2, 28]) == -1\", \"assert compareDates([2... | {
"split": "train",
"index": 78202,
"acecode_id": "bigcode_python_fns_27817",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the logging behavior of a command-line application. The function takes a boolean argument `verbose` which indicates whether verbose mode is enabled. If `verbose` is true, the function should return a list containing a debug... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_logging(False) == ['This is an info message']\", \"assert simulate_logging(True) == ['This is a debug message', 'This is an info message']\", \"assert simulate_logging(False) == ['This is an info message']\", \"assert simulate_logging(True) == ['Thi... | {
"split": "train",
"index": 78203,
"acecode_id": "oss_15914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers, denoted as `A`. Your task is to determine the largest integer in the array that occurs exactly once. If no such integer exists, return -1. The length of `A` will be between 1 and 2000, and each element will be a non-negative integer not excee... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largestUniqueNumber([5, 7, 3, 9, 4, 9, 8, 3, 1]) == 8\", \"assert largestUniqueNumber([9, 9, 8, 8]) == -1\", \"assert largestUniqueNumber([1, 2, 3, 4, 5]) == 5\", \"assert largestUniqueNumber([5, 5, 5, 5]) == -1\", \"assert largestUniqueNumber([1000, 999, 99... | {
"split": "train",
"index": 78204,
"acecode_id": "evol_13895",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two sets of points in a 2D space. Your task is to implement a function that finds the indices of the nearest neighbors of each point in the first set, within a specified maximum distance from the second set. The function should take the following parameters: two l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_nearest_neighbors([(0, 0)], [(1, 1)], 1.5) == [[0]]\", \"assert find_nearest_neighbors([(0, 0)], [(2, 2)], 1.5) == [[]]\", \"assert find_nearest_neighbors([(0, 0), (3, 3)], [(1, 1), (2, 2)], 1.5) == [[0], [1]]\", \"assert find_nearest_neighbors([(1, 1)]... | {
"split": "train",
"index": 78205,
"acecode_id": "bigcode_python_fns_23385",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given an integer array `nums`, reorder it such that `nums[0] <= nums[1] >= nums[2] <= nums[3]...`. You must ensure that adjacent elements are not equal whenever possible. If it is not feasible to avoid equal adjacent elements, return the array as is. Implement the function `wig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert wiggleSort([1,2,3,4,5]) == [1,3,2,5,4]\", \"assert wiggleSort([5,5,5,5,5]) == [5,5,5,5,5]\", \"assert wiggleSort([1,3,2]) == [1,3,2]\", \"assert wiggleSort([2,1,2,1]) == [1,2,1,2]\", \"assert wiggleSort([1]) == [1]\", \"assert wiggleSort([]) == []\", \"asser... | {
"split": "train",
"index": 78206,
"acecode_id": "evol_11316",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of usernames, write a function that returns a list of dictionaries representing fake user accounts. Each dictionary should contain the keys 'username', 'password', 'email', and 'is_active'. The 'username' should be the original username truncated to a maximum lengt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_fake_users(['user1']) == [{'username': 'user1', 'password': 'fakepassword', 'email': 'user1', 'is_active': True}]\", \"assert create_fake_users(['user1', 'user2']) == [{'username': 'user1', 'password': 'fakepassword', 'email': 'user1', 'is_active': Tr... | {
"split": "train",
"index": 78207,
"acecode_id": "bigcode_python_fns_15035",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given five integer variables named `T__1`, `T__2`, `T__3`, `T__4`, and `T__5`, each initialized with a different integer value. Your task is to write a Python function that takes these variables as input and returns their product. Write a function `calculate_product` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_product(1, 2, 3, 4, 5) == 120\", \"assert calculate_product(2, 3, 4, 5, 6) == 720\", \"assert calculate_product(-1, 2, -3, 4, -5) == -120\", \"assert calculate_product(0, 1, 2, 3, 4) == 0\", \"assert calculate_product(10, 10, 10, 10, 10) == 100000\... | {
"split": "train",
"index": 78208,
"acecode_id": "oss_29531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that accepts a list of unique numerical inputs and returns the number with the most unique digits. If multiple numbers have the same unique digit count, return the number that appears first in the list. The function should only return this number without... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([1234, 456, 789]) == 1234\", \"assert find_max([1112, 2223, 3334]) == 1112\", \"assert find_max([111111, 22, 33]) == 111111\", \"assert find_max([1, 22, 333, 4444]) == 1\", \"assert find_max([1000, 2000, 3000]) == 1000\", \"assert find_max([45678, 1... | {
"split": "train",
"index": 78209,
"acecode_id": "evol_21748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are meter names and the values are the regions associated with those meters. Write a function called `filter_meters_by_region` that takes two parameters: a dictionary `meter_dict` and a string `region`. The function should return a new ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_meters_by_region({'Standard IO': 'All Regions', 'Network Out': 'East US'}, 'All Regions') == {'Standard IO': 'All Regions'}\", \"assert filter_meters_by_region({'Standard IO': 'All Regions', 'Network Out': 'East US'}, 'East US') == {'Network Out': 'Ea... | {
"split": "train",
"index": 78210,
"acecode_id": "oss_4582",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of bars in a histogram. Write a function `max_area(heights: List[int]) -> int` that calculates the largest rectangular area that can be formed in the histogram. The function should return this maximum area. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_area([1, 1, 1, 1, 1]) == 5\", \"assert max_area([4, 2, 0, 3, 2, 5]) == 6\", \"assert max_area([1, 2, 3, 4, 5]) == 9\", \"assert max_area([5, 4, 3, 2, 1]) == 9\", \"assert max_area([0, 0, 0, 0]) == 0\", \"ass... | {
"split": "train",
"index": 78211,
"acecode_id": "bigcode_python_fns_43398",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `contains_float(sequence)` that takes a list called `sequence` as input and returns `True` if there is at least one floating-point number in the list. The list may contain various data types, including integers, strings, and floats. If there are no floating... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_float([1, 'a', 2, 3]) == False\", \"assert contains_float(['text', 10, 'another text']) == False\", \"assert contains_float([2.5, 'sample', 4]) == True\", \"assert contains_float(['hello', 42, 0.0]) == True\", \"assert contains_float([1, 2, 3]) == F... | {
"split": "train",
"index": 78212,
"acecode_id": "evol_1120",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of file paths and extracts specific information from each path to generate a new file name. The function should take in a list of file paths and return a list of corresponding new file names. The file paths ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_new_file_names(['/path/to/01_12_Trial1_20220101-123456_0001.avi']) == ['01_12_Trial1_20220101_123456_0000.avi']\", \"assert generate_new_file_names(['/path/to/02_01_Trial2_20220102-234567_0002.avi']) == ['02_01_Trial2_20220102_234567_0000.avi']\", \... | {
"split": "train",
"index": 78213,
"acecode_id": "oss_26176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that interacts with a remote service to retrieve the number of grids in a case. However, due to the nature of the service, sometimes it may throw an error indicating that the case was not found. Your task is to implement a function `get_grid_count()` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_grid_count('case_1') == 1\", \"assert get_grid_count('case_2') == 2\", \"assert get_grid_count('case_3') == 3\", \"assert get_grid_count('case_10') == 10\", \"assert get_grid_count('case_0') == 0\", \"assert get_grid_count('invalid_case') == 0\", \"asser... | {
"split": "train",
"index": 78214,
"acecode_id": "bigcode_python_fns_20542",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple banking transaction system. The function should perform a series of transactions on a bank account, which starts with a balance of 0. The transactions are given as a list of tuples, where each tuple contains a type... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_transaction([( 'deposit', 100), ('withdraw', 50)]) == (50, 2)\", \"assert bank_transaction([( 'deposit', 200), ('withdraw', 300)]) == (200, 2)\", \"assert bank_transaction([( 'withdraw', 50), ('deposit', 100)]) == (100, 2)\", \"assert bank_transaction([... | {
"split": "train",
"index": 78215,
"acecode_id": "oss_34872",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that parses and analyzes dates in the formats DD-MM-YYYY and DD-MMM-YYYY (where MMM represents the three-letter abbreviation of the month). The function should validate the dates for feasibility (disallowing dates like 30-Feb-2000 or 31-Apr-2022). If the date... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert date_analyzer('01-01-2020') == 'Wednesday, January 01, 2020'\", \"assert date_analyzer('29-Feb-2020') == 'Saturday, February 29, 2020'\", \"assert date_analyzer('31-Mar-2021') == 'Wednesday, March 31, 2021'\", \"assert date_analyzer('30-Apr-2021') == 'Friday... | {
"split": "train",
"index": 78216,
"acecode_id": "evol_21176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` consisting of lowercase English letters. A homogenous train is defined as a sequence of consecutive letters in the string that are all the same. Your task is to write a function `count_homogenous_trains` that counts the total number of homogenous trai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_homogenous_trains('a') == 1\", \"assert count_homogenous_trains('abc') == 3\", \"assert count_homogenous_trains('zzzzzz') == 21\", \"assert count_homogenous_trains('') == 0\", \"assert count_homogenous_trains('abcdefgh') == 8\", \"assert count_homogeno... | {
"split": "train",
"index": 78217,
"acecode_id": "oss_9354",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a session management system for an HTTP client. The function should be able to create sessions and return the count of live sessions. Each session should have a unique ID, a creation timestamp, and a return timestamp wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert session_manager([('create', None), ('create', None)]) == 2\", \"assert session_manager([('create', None), ('return', 1)]) == 1\", \"assert session_manager([('create', None), ('create', None), ('return', 3)]) == 2\", \"assert session_manager([('create', None)... | {
"split": "train",
"index": 78218,
"acecode_id": "oss_6527",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers representing the number of stars each Costume model has received on GitHub. Your function should update the stars for a given list of indices to a new integer value provided as input. Implement a function `up... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_github_stars([1, 2, 3, 4], [0, 2], 5) == [5, 2, 5, 4]\", \"assert update_github_stars([0, 0, 0], [1], 10) == [0, 10, 0]\", \"assert update_github_stars([10, 20, 30], [1, 1], 15) == [10, 15, 30]\", \"assert update_github_stars([5, 6, 7, 8], [3], 2) == ... | {
"split": "train",
"index": 78219,
"acecode_id": "oss_654",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that truncates a string if its length exceeds a certain limit. If the string is longer than the limit, it should be truncated to the first 40 characters and appended with an ellipsis ('...'). If the string is within the limit, it shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert truncate_string('This is a short string.') == 'This is a short string.'\", \"assert truncate_string('1234567890123456789012345678901234567890') == '1234567890123456789012345678901234567890'\", \"assert truncate_string('') == ''\", \"assert truncate_string('H... | {
"split": "train",
"index": 78220,
"acecode_id": "oss_27011",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a string of length N and an integer 'm', implement the function `dominant_substring_characters(string: str, m: int) -> List[str]`. This function should find the list of dominant characters for all substrings of size 'm'. A dominant character for a substring is defined as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dominant_substring_characters('aaaa', 2) == [['a'], ['a'], ['a']]\", \"assert dominant_substring_characters('abcde', 1) == [['a'], ['b'], ['c'], ['d'], ['e']]\", \"assert dominant_substring_characters('zzzzy', 5) == [['z']]\", \"assert dominant_substring_cha... | {
"split": "train",
"index": 78221,
"acecode_id": "evol_30708",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of Kubernetes object serializers and returns a comprehensive list of all the fields defined in those serializers. Each serializer is a class that inherits from a base serializer class, which includes a `Meta` inner class... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_all_fields([KubernetesVolumeMountSerializer, KubernetesNamespaceSerializer, KubernetesConfigMapSerializer]) == ['api_version', 'binary_data', 'data', 'exists', 'kind', 'metadata', 'mount_path', 'sub_path']\", \"assert get_all_fields([KubernetesNamespaceS... | {
"split": "train",
"index": 78222,
"acecode_id": "oss_18478",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function that determines if two given strings are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. The function should take two strings as input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_anagram('listen', 'silent') == True\", \"assert check_anagram('triangle', 'integral') == True\", \"assert check_anagram('apple', 'pale') == False\", \"assert check_anagram('rat', 'tar') == True\", \"assert check_anagram('evil', 'vile') == True\", \"ass... | {
"split": "train",
"index": 78223,
"acecode_id": "evol_31986",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the weight of a data point based on the confidence interval values provided in a statistics dictionary. The weight is defined as the inverse of the half-width of the confidence interval, specifically calculated as 2 divided by the absolute differ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_weight({'ci_99_a': 1, 'ci_99_b': 3}) == 1.0\", \"assert get_weight({'ci_99_a': 0, 'ci_99_b': 2}) == 1.0\", \"assert get_weight({'ci_99_a': 5, 'ci_99_b': 5}) == None\", \"assert get_weight({'ci_99_a': float('inf'), 'ci_99_b': 3}) == None\", \"assert get_w... | {
"split": "train",
"index": 78224,
"acecode_id": "bigcode_python_fns_22025",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function named `find_maximum_gap` that computes the maximum difference between two successive elements in the sorted version of the list. Your function should return this maximum gap. If the input list has fewer than two elements, it should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum_gap([3, 6, 9, 1]) == 3\", \"assert find_maximum_gap([10]) == 0\", \"assert find_maximum_gap([1, 2, 3, 4, 5]) == 1\", \"assert find_maximum_gap([1, 100, 200, 300]) == 100\", \"assert find_maximum_gap([1, 1, 1, 1]) == 0\", \"assert find_maximum_ga... | {
"split": "train",
"index": 78225,
"acecode_id": "bigcode_python_fns_23186",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_string(string: str) -> bool` that checks if a given string meets the following criteria: 1) It can only contain alphabets, numbers, and special characters. 2) Special characters cannot be the first or last character of the string. 3) The string mu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_string('Hello123!') == True\", \"assert validate_string('1A2b$') == True\", \"assert validate_string('abc123') == False\", \"assert validate_string('!abc123A!') == False\", \"assert validate_string('aA1!@#') == True\", \"assert validate_string('123a... | {
"split": "train",
"index": 78226,
"acecode_id": "evol_28771",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `word_count(text: str) -> int` that takes a single string as input and returns the number of words in that string. A word is defined as a sequence of characters separated by whitespace. Whitespace can include spaces, tabs, and newlines. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_count('Hello World') == 2\", \"assert word_count(' Hello World ') == 2\", \"assert word_count('') == 0\", \"assert word_count(' ') == 0\", \"assert word_count('Python is great') == 3\", \"assert word_count('SingleWord') == 1\", \"assert word_cou... | {
"split": "train",
"index": 78227,
"acecode_id": "evol_3603",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a Todo item is completed based on its attributes. The Todo item is identified by a unique identifier and has a title and a completion status. Your function should take in the unique identifier (as a string), the title (as a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_todo_completed('1', 'Buy groceries', True) == True\", \"assert is_todo_completed('2', 'Clean the house', False) == False\", \"assert is_todo_completed('3', 'Read a book', True) == True\", \"assert is_todo_completed('4', 'Walk the dog', False) == False\", ... | {
"split": "train",
"index": 78228,
"acecode_id": "oss_31485",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing a global environment, write a function `get_module_and_name(globals_dict)` that retrieves the name of the module and the module object associated with the provided dictionary. The dictionary will contain a key '__name__', which indicates the name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_module_and_name({'__name__': '__main__'}) == (sys.modules['__main__'], sys.argv[0])\", \"assert get_module_and_name({'__name__': 'math'}) == (sys.modules['math'], 'math')\", \"assert get_module_and_name({'__name__': 'os'}) == (sys.modules['os'], 'os')\",... | {
"split": "train",
"index": 78229,
"acecode_id": "bigcode_python_fns_27924",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers that may include negative values, implement a function `median_and_mode(l: list)` that calculates and returns a tuple containing the median and the mode of the integers in the list. The function should not use built-in sorting or automatic functions for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median_and_mode([3, 1, 2, 4, 5]) == (3, None)\", \"assert median_and_mode([1, 2, 2, 4, 5]) == (2, 2)\", \"assert median_and_mode([1, 1, 1, 1]) == (1, 1)\", \"assert median_and_mode([0, 0, 0, 0, 0]) == (0, 0)\", \"assert median_and_mode([-1, -1, -1, 0, 1]) ==... | {
"split": "train",
"index": 78230,
"acecode_id": "evol_20716",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary represents an image example with various attributes, including a unique identifier. Your task is to implement a function called `split` that groups these examples based on the unique values of a specified key. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split([], 'filename') == []\", \"assert split([{'filename': 'image1.jpg', 'label': 'cat'}], 'filename') == [[{'filename': 'image1.jpg', 'label': 'cat'}]]\", \"assert split([{'filename': 'image1.jpg', 'label': 'cat'}, {'filename': 'image2.jpg', 'label': 'dog'... | {
"split": "train",
"index": 78231,
"acecode_id": "oss_6720",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simplified instruction cycle for a hypothetical processor. The processor executes a series of instructions in a loop, where each instruction involves processing data from memory. You are given a memory represented as a list of integers, each int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert instruction_cycle([10, 20, 30, 40, 50], 2) == [12, 22, 32, 42, 52]\", \"assert instruction_cycle([0, 0, 0], 3) == [3, 3, 3]\", \"assert instruction_cycle([1, 2, 3], 1) == [2, 3, 4]\", \"assert instruction_cycle([5], 0) == [5]\", \"assert instruction_cycle([1... | {
"split": "train",
"index": 78232,
"acecode_id": "oss_26683",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that reads a string from a list of strings representing file contents and returns the content as a single string. The function should take two arguments: an integer index and a list of strings. The index represents the position of the stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_file_content(0, ['Hello, World!', 'This is a test file.']) == 'Hello, World!'\", \"assert read_file_content(1, ['Hello, World!', 'This is a test file.']) == 'This is a test file.'\", \"assert read_file_content(2, ['Hello, World!', 'This is a test file.'... | {
"split": "train",
"index": 78233,
"acecode_id": "bigcode_python_fns_38105",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 4x4 two-dimensional array (matrix), write a function that rotates the matrix 90 degrees clockwise in place. The function should modify the input matrix directly and return the rotated matrix. The input matrix will always be a 4x4 list of lists containing integers.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotate([[1,2,3,4],[5,6,7,8],[9,0,1,2],[3,4,5,6]]) == [[3,9,5,1],[4,0,6,2],[5,1,7,3],[6,2,8,4]]\", \"assert rotate([[0,1,2,3],[4,5,6,7],[8,9,10,11],[12,13,14,15]]) == [[12,8,4,0],[13,9,5,1],[14,10,6,2],[15,11,7,3]]\", \"assert rotate([[1,2,3,4],[5,6,7,8],[9,1... | {
"split": "train",
"index": 78234,
"acecode_id": "evol_11955",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the updated learning rate for a neural network optimizer after applying exponential decay based on the number of iterations completed. The function should take in four parameters: the current iteration step (an integer), ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exponential_lr_decay(0, 0.1, 0.9, 15000) == 0.1\", \"assert exponential_lr_decay(15000, 0.1, 0.9, 15000) == 0.1 * (0.9 ** 1)\", \"assert exponential_lr_decay(30000, 0.1, 0.9, 15000) == 0.1 * (0.9 ** 2)\", \"assert exponential_lr_decay(45000, 0.1, 0.9, 15000)... | {
"split": "train",
"index": 78235,
"acecode_id": "oss_34488",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `add_contact(contacts: Dict[str, Dict[str, str]], customer_id: str, first_name: str, last_name: str, phone: str, email: str) -> Dict[str, Dict[str, str]]` that adds a new contact to a dictionary of contacts. The `contacts` parameter is a dictionary where ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_contact({}, '1', 'John', 'Doe', '1234567890', 'john.doe@example.com') == {'1': {'first_name': 'John', 'last_name': 'Doe', 'phone': '1234567890', 'email': 'john.doe@example.com'}}\", \"assert add_contact({'1': {'first_name': 'John', 'last_name': 'Doe', 'p... | {
"split": "train",
"index": 78236,
"acecode_id": "evol_11924",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom exception class named `SiteAccessDeniedException` that inherits from the `Exception` class. Additionally, implement a function `check_site_access` that takes a website URL and a blacklist of websites as input. If the provided website URL is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_site_access('google.com', ['example.com', 'blockedsite.com']) == 'The website google.com is accessible.'\", \"assert check_site_access('example.org', ['example.com', 'blockedsite.com']) == 'The website example.org is accessible.'\", \"assert check_site... | {
"split": "train",
"index": 78237,
"acecode_id": "oss_28957",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a Python data structure into a dictionary. The function should be able to handle nested structures, including lists and tuples, and convert them into nested dictionaries. The function should be named `struct_to_dict` and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert struct_to_dict({'a': 1.0, 'b': []}) == {'a': 1.0, 'b': []}\", \"assert struct_to_dict({'x': [1, 2, 3], 'y': {'z': 4}}) == {'x': [1, 2, 3], 'y': {'z': 4}}\", \"assert struct_to_dict([{'a': 1}, {'b': 2}]) == [{'a': 1}, {'b': 2}]\", \"assert struct_to_dict({'ke... | {
"split": "train",
"index": 78238,
"acecode_id": "oss_12917",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the flattening of a multi-dimensional array, similar to how it is done in neural networks. Your goal is to create a function named `flatten_image` that takes a multi-dimensional array (representing an image) as input an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_image([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert flatten_image([[10, 20], [30, 40]]) == [10, 20, 30, 40]\", \"assert flatten_image([[1], [2], [3], [4]]) == [1, 2, 3, 4]\", \"assert flatten_image([[1, 2, 3]]) == [1, ... | {
"split": "train",
"index": 78239,
"acecode_id": "oss_36610",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two binary lists, `y_true` and `y_pred`, representing the true labels and predicted labels of a multi-label classification problem, respectively. Both lists have the same length and only contain values of 0 or 1. Your task is to implement a function `precision(y_t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert precision([1, 0, 1], [1, 0, 1]) == 1.0\", \"assert precision([1, 1, 1], [1, 1, 1]) == 1.0\", \"assert precision([1, 1, 0], [0, 1, 1]) == 0.5\", \"assert precision([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert precision([1, 0, 1], [0, 0, 0]) == 0.0\", \"assert pre... | {
"split": "train",
"index": 78240,
"acecode_id": "bigcode_python_fns_2055",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified payment processing system for an e-commerce website. Your goal is to create a function, `process_payment`, that simulates initiating a payment and handling the callback from a payment gateway. The function should take two inputs: an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_payment(100.00, 'success') == 'Payment successful. Thank you!'\", \"assert process_payment(100.00, 'failed') == 'Payment failed. Please try again.'\", \"assert process_payment(0, 'success') == 'Invalid payment amount.'\", \"assert process_payment(0, ... | {
"split": "train",
"index": 78241,
"acecode_id": "oss_24857",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines if a person is a minor or an adult based on their age. Implement a function `is_minor_or_adult` that takes three parameters: `name` (string), `age` (integer), and `grade` (string). The function should return a string indic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_minor_or_adult('Alice', 16, 'A') == 'Alice is a minor.'\", \"assert is_minor_or_adult('Bob', 20, 'B') == 'Bob is an adult.'\", \"assert is_minor_or_adult('Charlie', 17, 'C') == 'Charlie is a minor.'\", \"assert is_minor_or_adult('David', 18, 'D') == 'Davi... | {
"split": "train",
"index": 78242,
"acecode_id": "oss_7310",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that returns a new list containing only the even integers from the original list. The output list should maintain the order of the even integers as they appeared in the input list. Write a function named `fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([0, -2, -3, -4]) == [0, -2, -4]\", \"assert filter_even_numbers([-1, -3, -5]) == []\", \"assert filter_even_numbers([... | {
"split": "train",
"index": 78243,
"acecode_id": "oss_32511",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of contours represented as lists of tuples containing the coordinates of their points, write a function that calculates the center points of bounding boxes for each contour. The bounding box for each contour is defined as the smallest rectangle that can contain the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_center_points([[(1, 1), (1, 4), (4, 1)]]) == [(2.5, 2.5)]\", \"assert calculate_center_points([[(0, 0), (0, 1), (1, 0), (1, 1)]]) == [(0.5, 0.5)]\", \"assert calculate_center_points([[(-1, -1), (-1, 1), (1, -1)]]) == [(0.0, 0.0)]\", \"assert calcul... | {
"split": "train",
"index": 78244,
"acecode_id": "bigcode_python_fns_35124",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a given integer (up to 1 trillion) to its English word equivalent. The function should handle both positive and negative numbers, including proper usage of 'and' and commas in the output. The function should return the English words as a string.\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert large_number_to_words(0) == 'zero'\", \"assert large_number_to_words(1) == 'one'\", \"assert large_number_to_words(10) == 'ten'\", \"assert large_number_to_words(15) == 'fifteen'\", \"assert large_number_to_words(100) == 'one hundred'\", \"assert large_numbe... | {
"split": "train",
"index": 78245,
"acecode_id": "evol_28491",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that constructs a many-to-one relationship based on a given set of parameters. The function should accept a dictionary representing the relationship artifacts with the following keys: 'type', 'schema', 'required', 'description', 'sub_type... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_relationship({'type': 'RELATIONSHIP', 'schema': {}, 'required': False, 'description': None, 'sub_type': 'MANY_TO_ONE', 'parent': 'Parent', 'backref_property': None, 'kwargs': {'order_by': 'id'}, 'write_only': False, 'foreign_key_property': 'prop_1'... | {
"split": "train",
"index": 78246,
"acecode_id": "bigcode_python_fns_28443",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a visualization layout based on a media type. Implement a function `generate_visualization(media: str) -> str` that takes a media type as input, which can be either 'articles' or 'videos', and returns a string representing a layout for a Bokeh vis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_visualization('articles') == 'Article Visualization Layout'\", \"assert generate_visualization('videos') == 'Video Visualization Layout'\", \"assert generate_visualization('music') == 'Invalid media type'\", \"assert generate_visualization('') == 'I... | {
"split": "train",
"index": 78247,
"acecode_id": "bigcode_python_fns_33812",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a human-readable IPv4 address into its numeric representation. An IPv4 address is typically written in dot-decimal notation, which consists of four decimal numbers separated by dots. Each decimal number can range from 0 to 2... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ipv4_to_numeric('192.168.1.1') == 3232235777\", \"assert ipv4_to_numeric('255.255.255.255') == 4294967295\", \"assert ipv4_to_numeric('0.0.0.0') == 0\", \"assert ipv4_to_numeric('8.8.8.8') == 134744072\", \"assert ipv4_to_numeric('10.0.0.1') == 167772161\", ... | {
"split": "train",
"index": 78248,
"acecode_id": "bigcode_python_fns_6875",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of commands and returns the output based on the provided commands. The function should handle the following commands: \n\n1. Command: `--help` or `-h`\n - Description: Return the string 'Usage: Display usage in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_commands(['--help']) == 'Usage: Display usage information.'\", \"assert process_commands(['-h']) == 'Usage: Display usage information.'\", \"assert process_commands(['--version']) == 'Version 1.0.0'\", \"assert process_commands(['-v']) == 'Version 1.... | {
"split": "train",
"index": 78249,
"acecode_id": "oss_28423",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of paragraphs, write a function that returns a new array containing the paragraphs that feature the highest count of unique compound words. A compound word is defined as a word that contains a hyphen ('-'). You should exclude any compound words that are found wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_highest_compound_words(['Hello world!', 'A state-of-the-art solution.', 'This is a test scenario.']) == ['A state-of-the-art solution.']\", \"assert find_highest_compound_words(['This is a test.','This is a test with a compound-word.']) == ['This is a t... | {
"split": "train",
"index": 78250,
"acecode_id": "evol_12323",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple game of dice. The game involves rolling two dice and summing the values. The function should take the number of rounds to play as input and return the frequency of each possible sum from 2 to 12 after the sp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_dice_game(0) == {2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0, 10: 0, 11: 0, 12: 0}\", \"assert simulate_dice_game(1) == {2: 0, 3: 1, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0, 10: 0, 11: 0, 12: 0}\", \"assert simulate_dice_game(2) == {2: 0, 3: 2, 4: 0, ... | {
"split": "train",
"index": 78251,
"acecode_id": "oss_18466",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_anagram(s1: str, s2: str) -> bool` that determines whether two given strings are anagrams of each other. The function should ignore spaces, be case insensitive, and properly handle unicode characters. Two strings are considered anagrams if they contain ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_anagram('listen', 'silent') == True\", \"assert is_anagram('triangle', 'integral') == True\", \"assert is_anagram('The Morse Code', 'Here come dots') == True\", \"assert is_anagram('Astronomer', 'Moon starer') == True\", \"assert is_anagram('School master... | {
"split": "train",
"index": 78252,
"acecode_id": "evol_6071",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a TreeNode class representing a node in a tree structure. Each node has a `support` attribute and a `parent` attribute pointing to its parent node. The `support` attribute is an integer representing the support value of the node. The `parent` attribute is `None` f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_support_path(TreeNode(2, TreeNode(8, TreeNode(5)))) == [2, 8, 5]\", \"assert get_support_path(TreeNode(12, TreeNode(3, TreeNode(5)))) == [12, 3, 5]\", \"assert get_support_path(TreeNode(6, TreeNode(8, TreeNode(5)))) == [6, 8, 5]\", \"assert get_support_p... | {
"split": "train",
"index": 78253,
"acecode_id": "oss_6005",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_elements` that returns the total sum of all the integers in the list. For example, for the input [1, 2, 3, 4], the function should return 10.\nPlease reason step by step, then write a self-contained Python solution. Give your f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_elements([1, 2, 3, 4]) == 10\", \"assert sum_of_elements([-1, -2, -3, -4]) == -10\", \"assert sum_of_elements([0, 0, 0, 0]) == 0\", \"assert sum_of_elements([10, 20, 30]) == 60\", \"assert sum_of_elements([5]) == 5\", \"assert sum_of_elements([-5]) ==... | {
"split": "train",
"index": 78254,
"acecode_id": "evol_30219",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a representation of a function call with its positional arguments and keyword arguments, write a function `get_argument` that retrieves an argument by its position or by its keyword. The function should take in a dictionary representing the function call and return the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_argument({'args': ['a', 'b', 'c'], 'keywords': []}, position=1) == 'b'\", \"assert get_argument({'args': ['a', 'b', 'c'], 'keywords': []}, position=3) == None\", \"assert get_argument({'args': ['x', 'y'], 'keywords': [{'arg': 'z', 'value': 'value_z'}]}, ... | {
"split": "train",
"index": 78255,
"acecode_id": "bigcode_python_fns_19818",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of project categories and returns a formatted string listing all the categories. Each category should be listed on a new line, prefixed with a bullet point. The input will be a list of strings representing the project... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_project_categories(['Web Development', 'Data Science', 'Mobile Apps']) == '\\u2022 Web Development\\\\n\\u2022 Data Science\\\\n\\u2022 Mobile Apps'\", \"assert format_project_categories(['Design', 'Testing']) == '\\u2022 Design\\\\n\\u2022 Testing'\"... | {
"split": "train",
"index": 78256,
"acecode_id": "oss_24947",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function that creates a list of specifications for a building block. Each specification is represented as a tuple containing various attributes of the block, such as its type, size, and color. Your function should take an optional parameter, `blo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_block_specs() == [('TypeA', 10, 'Red'), ('TypeB', 20, 'Blue'), ('TypeC', 30, 'Green')]\", \"assert build_block_specs([('TypeD', 15, 'Yellow')]) == [('TypeD', 15, 'Yellow')]\", \"assert build_block_specs([('TypeE', 25, 'Black'), ('TypeF', 35, 'White')])... | {
"split": "train",
"index": 78257,
"acecode_id": "bigcode_python_fns_43092",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an unsorted list of integers and a new integer to insert, implement a function that inserts the new integer into the list while ensuring that the list contains no duplicates and maintains the order of insertion for unique elements. The function should return the updated l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_element([1, 2, 3, 1, 2, 3, 4, 5], 6) == [1, 2, 3, 4, 5, 6]\", \"assert insert_element([1, 2, 3], 2) == [1, 2, 3]\", \"assert insert_element([], 10) == [10]\", \"assert insert_element([5, 5, 5], 5) == [5]\", \"assert insert_element([10, 20, 30], 25) ==... | {
"split": "train",
"index": 78258,
"acecode_id": "evol_11999",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of tasks in a TodoList application. Each task is represented by a dictionary that contains the following fields: 'title' (a string), 'description' (a string), and 'due_date' (a string in the format 'YYYY-MM-DD HH:MM:SS' or None). Your goal is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_due_date([{'title': 'Task 1', 'description': 'First task'}]) == [{'title': 'Task 1', 'description': 'First task', 'due_date': None}]\", \"assert add_due_date([{'title': 'Task 1', 'description': 'First task', 'due_date': '2023-10-01 10:00:00'}]) == [{'tit... | {
"split": "train",
"index": 78259,
"acecode_id": "oss_36103",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples where each tuple contains two integers (x, y) representing points on a 2D plane, write a function that returns the number of unique lines that can be formed by those points. A line is defined by two distinct points. If the input list is empty or has fewer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_lines([(1, 2), (3, 4)]) == 1\", \"assert unique_lines([(1, 1)]) == 0\", \"assert unique_lines([]) == 0\", \"assert unique_lines([(0, 0), (0, 1), (1, 0)]) == 3\", \"assert unique_lines([(5, 5), (5, 6), (6, 5), (6, 6)]) == 6\", \"assert unique_lines([(1... | {
"split": "train",
"index": 78260,
"acecode_id": "bigcode_python_fns_19037",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `lcm_of_list(numbers)` that takes a list of integers and returns the least common multiple (LCM) of the numbers in the list. If the list contains any non-integer values or a zero, the function should return `None`. The function should handle edge cases such... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm_of_list([4, 6, 8]) == 24\", \"assert lcm_of_list([0, 5, 10]) == None\", \"assert lcm_of_list([3, 7, 1]) == 21\", \"assert lcm_of_list([5, 10, 15]) == 30\", \"assert lcm_of_list([12, 15, 35]) == 420\", \"assert lcm_of_list([-4, -6, -8]) == 24\", \"assert ... | {
"split": "train",
"index": 78261,
"acecode_id": "evol_8325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a command string for executing an image processing tool. The function should take the following parameters: \n- `aligntk_path`: a string representing the path to the alignment toolkit binaries. \n- `pairs`: a string rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_command_string('/path/to/aligntk', 'pairs.lst', 'images.lst', '/path/to/mask', '/path/to/output', (0, 360), 1024, (1, 10), -5, 5, '/path/to/summary') == '/path/to/aligntk/find_rst -pairs pairs.lst -tif -images images.lst -mask /path/to/mask -output ... | {
"split": "train",
"index": 78262,
"acecode_id": "bigcode_python_fns_34223",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers 'report', where each inner list represents a row of data, write a function 'transpose_report' that transposes the report. The transposition means converting rows into columns and vice versa. Your task is to implement the function without using any ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transpose_report([[1, 2], [3, 4]]) == [[1, 3], [2, 4]]\", \"assert transpose_report([[1]]) == [[1]]\", \"assert transpose_report([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]\", \"assert transpose_report([[1, 2], [3, 4], [5, 6]]) == [[1, 3, 5], [2, 4, ... | {
"split": "train",
"index": 78263,
"acecode_id": "bigcode_python_fns_27041",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a list of known users and a list of known IP addresses. Your function `manage_database` takes two lists as input: `usernames` and `ip_addresses`. The function should return a dictionary with two keys: 'knownUsers' and 'kn... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_database(['Alice', 'Bob', 'Alice'], ['192.168.1.1', '192.168.1.2']) == {'knownUsers': ['Alice', 'Bob'], 'knownIPs': ['192.168.1.1', '192.168.1.2']}\", \"assert manage_database([], ['192.168.1.1', '192.168.1.2']) == {'knownUsers': [], 'knownIPs': ['192... | {
"split": "train",
"index": 78264,
"acecode_id": "oss_6550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing emojis used in a realm. Each emoji is represented by its ID as the key and a sub-dictionary containing additional properties (including the ID itself) as the value. Your task is to implement a function that checks if every emoji in the di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_emoji_ids({'realm_emoji': {'emoji1': {'id': 'emoji1'}, 'emoji2': {'id': 'emoji2'}}}) == True\", \"assert check_emoji_ids({'realm_emoji': {'emoji1': {'id': 'emoji2'}, 'emoji2': {'id': 'emoji2'}}}) == False\", \"assert check_emoji_ids({'realm_emoji': {'e... | {
"split": "train",
"index": 78265,
"acecode_id": "bigcode_python_fns_35518",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers n and k, return the number of ways to choose k items from n items without repetition and with order. You can assume that 0 <= k <= n. The function should raise a ValueError if the inputs are not integers, or if k is greater than n. Implement the function `cou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_permutations(5, 2) == 20\", \"assert count_permutations(3, 1) == 3\", \"assert count_permutations(4, 0) == 1\", \"assert count_permutations(6, 3) == 120\", \"assert count_permutations(0, 0) == 1\", \"assert count_permutations(10, 5) == 30240\", \"asser... | {
"split": "train",
"index": 78266,
"acecode_id": "bigcode_python_fns_23617",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, return the sum of values of its rightmost leaves. A rightmost leaf is defined as a leaf node that is the right child of its parent node.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a singl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Solution().sumOfRightmostLeaves(TreeNode(1)) == 1\", \"assert Solution().sumOfRightmostLeaves(TreeNode(1, TreeNode(2), TreeNode(3))) == 3\", \"assert Solution().sumOfRightmostLeaves(TreeNode(1, TreeNode(2), TreeNode(3, None, TreeNode(5)))) == 5\", \"assert S... | {
"split": "train",
"index": 78267,
"acecode_id": "evol_26711",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes training data for a natural language processing (NLP) model. The function, `train_action_aware_blind`, takes in a list of training data and the name of the dataset as input. The training data is a list of tuples, where ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert train_action_aware_blind([(\\\"Hello world!\\\", \\\"greeting\\\")], \\\"dataset1\\\") == [[\\\"Hello\\\", \\\"world!\\\"]]\", \"assert train_action_aware_blind([(\\\"Python is fun.\\\", \\\"statement\\\")], \\\"dataset2\\\") == [[\\\"Python\\\", \\\"is\\\",... | {
"split": "train",
"index": 78268,
"acecode_id": "oss_27116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of predictions for a set of images, where each prediction is represented as a list of probabilities corresponding to different classes. Your task is to implement a function that returns the highest confidence value of the predictions for each image, the ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_classes([[0.1, 0.2, 0.7], [0.5, 0.4, 0.1]], ['cat', 'dog', 'rabbit']) == ([0.7, 0.5], [2, 0], ['rabbit', 'cat'])\", \"assert predict_classes([[0.9, 0.1], [0.3, 0.7], [0.2, 0.8]], ['apple', 'banana']) == ([0.9, 0.7, 0.8], [0, 1, 1], ['apple', 'banana'... | {
"split": "train",
"index": 78269,
"acecode_id": "bigcode_python_fns_47522",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to generate emotion names based on the number of emotion classes. The function `get_fer_names(num_classes)` takes an integer `num_classes` as input and returns a list of emotion names based on the number of classes. The emotion names ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_fer_names(5) == ['anger', 'fear', 'happy', 'sadness', 'surprise']\", \"assert get_fer_names(6) == ['anger', 'disgust', 'fear', 'happy', 'sadness', 'surprise']\", \"assert get_fer_names(7) == ['anger', 'contempt', 'disgust', 'fear', 'happy', 'sadness', 's... | {
"split": "train",
"index": 78270,
"acecode_id": "oss_23073",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, which may contain HTML-like line breaks represented as '<br>'. Your task is to implement a function that removes these line breaks and returns a single string with each line separated by a newline ('\\n'). Write a function `remove_html_line_brea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_html_line_breaks(['Hello<br>World']) == 'Hello\\\\nWorld'\", \"assert remove_html_line_breaks(['Line1<br>Line2<br>Line3']) == 'Line1\\\\nLine2\\\\nLine3'\", \"assert remove_html_line_breaks(['<br>First<br>', 'Second<br>', 'Third']) == '\\\\nFirst\\\\n... | {
"split": "train",
"index": 78271,
"acecode_id": "bigcode_python_fns_26718",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a string representing a scale configuration for super resolution and returns a list of integers. The input string contains integers separated by the '+' character, and your function should convert this string into a list of thos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_scale('2+3+4') == [2, 3, 4]\", \"assert parse_scale('1+1+1') == [1, 1, 1]\", \"assert parse_scale('10+20+30') == [10, 20, 30]\", \"assert parse_scale('100') == [100]\", \"assert parse_scale('5+15') == [5, 15]\", \"assert parse_scale('0+0+0') == [0, 0, ... | {
"split": "train",
"index": 78272,
"acecode_id": "bigcode_python_fns_16116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that modifies a list of menu items based on certain conditions. The function should take three parameters: a boolean `is_edit_mode`, a list of current `menu_items`, and a string `app_name`. The function should add a menu item labeled 'PLN... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_menu_items(True, [], 'My App') == ['Type List: pln_type_changelist', 'Add New PLN App Type: pln_type_add', 'PLN App List: pln_app_changelist']\", \"assert modify_menu_items(False, [], 'My App') == ['PLN App List: pln_app_changelist']\", \"assert modif... | {
"split": "train",
"index": 78273,
"acecode_id": "oss_35465",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing data scraped from a webpage, which contains a key 'date' indicating the current date. You are also given another dictionary representing a spreadsheet, where you can access the value of a specific cell using the 'cell' method. Your task i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_market_open({'date': '2023-10-01'}, {'cell': lambda row, column: '2023-10-01'}, 2) == True\", \"assert check_market_open({'date': '2023-10-02'}, {'cell': lambda row, column: '2023-10-01'}, 2) == False\", \"assert check_market_open({'date': '2023-10-03'... | {
"split": "train",
"index": 78274,
"acecode_id": "bigcode_python_fns_15525",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that verifies whether a list of strings is alphabetically arranged in descending order. The function should also check that each string in the list has a specified length. The function should handle potential unicode characters. The function signature is: d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_descending_order(['zebra', 'apple', 'banana'], 5) == False\", \"assert verify_descending_order(['zebra', 'banana', 'apple', 'kiwi'], 5) == False\", \"assert verify_descending_order(['zebra', 'zebra', 'zebra'], 5) == True\", \"assert verify_descending_... | {
"split": "train",
"index": 78275,
"acecode_id": "evol_31752",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a linear search on a given list of integers. The function should take two parameters: a list of integers 'arr' and an integer 'x'. It should return the index of the first occurrence of 'x' in 'arr'. If 'x' is not found, return -1.\nPlease reas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert linear_search([1, 2, 3, 4, 5], 3) == 2\", \"assert linear_search([10, 20, 30, 40, 50], 20) == 1\", \"assert linear_search([1, 1, 1, 1, 1], 1) == 0\", \"assert linear_search([5, 3, 2, 6, 1], 6) == 3\", \"assert linear_search([10, 20, 30, 40, 50], 60) == -1\",... | {
"split": "train",
"index": 78276,
"acecode_id": "evol_23571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an unweighted graph represented as an adjacency list, implement a function that performs a Breadth-First Search (BFS) to find the shortest path between two specific vertices. The function should take three parameters: a dictionary representing the graph, an integer start ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bfs({18: [14], 14: [22, 16], 16: [20], 20: [22]}, 18, 22) == [18, 14, 22]\", \"assert bfs({1: [2], 2: [3], 3: [4], 4: []}, 1, 4) == [1, 2, 3, 4]\", \"assert bfs({5: [6], 6: [7], 7: []}, 5, 7) == [5, 6, 7]\", \"assert bfs({10: [11], 11: [12], 12: []}, 10, 12)... | {
"split": "train",
"index": 78277,
"acecode_id": "evol_12470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a list of the first `n` prime numbers. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Your task is to complete the implementation of the `generate_n_primes` func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_n_primes(0) == []\", \"assert generate_n_primes(1) == [2]\", \"assert generate_n_primes(2) == [2, 3]\", \"assert generate_n_primes(3) == [2, 3, 5]\", \"assert generate_n_primes(4) == [2, 3, 5, 7]\", \"assert generate_n_primes(5) == [2, 3, 5, 7, 11]\... | {
"split": "train",
"index": 78278,
"acecode_id": "oss_9988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a python function that takes a string as input and returns a dictionary containing each unique special character in the string as keys and their frequencies as values. The function should be able to handle multilingual characters and special symbols, while ignoring alphab... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_special_characters('12345') == {}\", \"assert count_special_characters('abc@#123') == {'@': 1, '#': 1}\", \"assert count_special_characters('') == {}\", \"assert count_special_characters('Test with emojis \\ud83d\\ude0a\\ud83c\\udf89!') == {'\\ud83d\\u... | {
"split": "train",
"index": 78279,
"acecode_id": "evol_1477",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that parses a given git repository URL and categorizes it into its appropriate components. The URL can be in various formats, including SSH, HTTP(S), FTP(S), RSYNC, or file paths. Your function should take a string representing a git repo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_git_repo('ssh://user@host.xz:22/path/to/repo.git/') == {'scheme': 'ssh', 'netloc': 'user@host.xz:22', 'path': '/path/to/repo.git/'}\", \"assert parse_git_repo('git://host.xz/path/to/repo.git/') == {'scheme': 'git', 'netloc': 'host.xz', 'path': '/path/t... | {
"split": "train",
"index": 78280,
"acecode_id": "bigcode_python_fns_6120",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function that generates the architecture of a neural network based on specified configurations for its layers. The function should take a boolean parameter `use_bn` which indicates whether to include batch normalization in the network architectur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_network_architecture(True) == 'ConvTranspose2d(16, 16, kernel_size=2, stride=2) -> BatchNorm2d(16) -> Conv2d(16, 16, kernel_size=3, padding=1) -> BatchNorm2d(16) -> Conv2d(16, 1, kernel_size=1)'\", \"assert generate_network_architecture(False) == 'C... | {
"split": "train",
"index": 78281,
"acecode_id": "oss_9124",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a grid ID. Your task is to implement a function that checks if the provided grid ID is valid based on certain predefined criteria. The criteria for a valid grid ID are: it must start with 'grid_' followed by a number (e.g., 'grid_1', 'grid_42... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_grid_id('grid_1') == True\", \"assert is_valid_grid_id('grid_42') == True\", \"assert is_valid_grid_id('grid_0') == True\", \"assert is_valid_grid_id('grid_999') == True\", \"assert is_valid_grid_id('grid_a') == False\", \"assert is_valid_grid_id('g... | {
"split": "train",
"index": 78282,
"acecode_id": "bigcode_python_fns_24102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of physical addresses, implement a function that simulates the retrieval of geospatial coordinates. For each address in the list, return a tuple containing the latitude and longitude. If an address is not recognized, return (None, None) for that address. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_geolocation(['1600 Amphitheatre Parkway, Mountain View, CA']) == [(37.422, -122.084)]\", \"assert get_geolocation(['1 Infinite Loop, Cupertino, CA']) == [(37.33182, -122.03118)]\", \"assert get_geolocation(['123 Fake Street, Nowhere, XX']) == [(None, Non... | {
"split": "train",
"index": 78283,
"acecode_id": "evol_33653",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple drawing program. The function should take a list of commands as input and execute them to draw shapes on a canvas. Each command in the list will be a string representing a specific drawing action. The follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert draw_shapes(['fill((255, 153, 0))', 'ellipse(100, 100, 50, 50)']) == ['Draw ellipse at (100, 100) with width 50, height 50 and fill color (255, 153, 0)']\", \"assert draw_shapes(['fill((0, 255, 0))', 'rectangle(10, 20, 30, 40)']) == ['Draw rectangle at (10, ... | {
"split": "train",
"index": 78284,
"acecode_id": "oss_4402",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple access control system for files in a web application. The system determines whether a user has permission to access a file based on their username and the file's URI. Your task is to implement a function `check_file_access(username: str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_file_access('admin', '/user_uploads/file1.txt') == True\", \"assert check_file_access('guest', '/user_uploads/file2.txt') == True\", \"assert check_file_access('iago', '/user_uploads/file3.txt') == False\", \"assert check_file_access('admin', '/user_up... | {
"split": "train",
"index": 78285,
"acecode_id": "oss_7383",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether the signal handler for SIGCHLD is set to the default handler. Implement a function named `is_default_sigchld_handler()` that returns `True` if the current SIGCHLD signal handler is the default handler, and `False` othe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_default_sigchld_handler() in [True, False]\", \"assert is_default_sigchld_handler() == True or is_default_sigchld_handler() == False\", \"assert is_default_sigchld_handler() is not None\", \"assert isinstance(is_default_sigchld_handler(), bool)\", \"asser... | {
"split": "train",
"index": 78286,
"acecode_id": "bigcode_python_fns_1782",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that retrieves a user based on a provided token. The function should take a token as input and return a user object if the token is valid. If the token is invalid or does not correspond to any user, the function should return N... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_by_token('valid_token_1') == User(1, 'user1', 'user1@example.com')\", \"assert get_user_by_token('valid_token_2') == User(2, 'user2', 'user2@example.com')\", \"assert get_user_by_token('invalid_token') == None\", \"assert get_user_by_token('another_... | {
"split": "train",
"index": 78287,
"acecode_id": "oss_1623",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that receives a string and returns True if the length of the string is a prime number, and False otherwise. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_length('Hello') == True\", \"assert prime_length('abcdcba') == True\", \"assert prime_length('kittens') == True\", \"assert prime_length('orange') == False\", \"assert prime_length('a') == False\", \"assert prime_length('abc') == True\", \"assert prime... | {
"split": "train",
"index": 78288,
"acecode_id": "evol_8628",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sets user credentials based on the input provided. The function should take a single parameter `credentials` which can either be a dictionary or a JSON-encoded string. If the input is a string, it should be parsed into a dictionary. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_creds_data(None) == {}\", \"assert set_creds_data({}) == {}\", \"assert set_creds_data({'username': 'user1', 'password': 'pass1'}) == {'username': 'user1', 'password': 'pass1'}\", \"assert set_creds_data('{\\\"username\\\": \\\"user1\\\", \\\"password\\\... | {
"split": "train",
"index": 78289,
"acecode_id": "bigcode_python_fns_46627",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple calculation for a game loop in a 2D game. Your goal is to determine the time, in milliseconds, that should elapse between each frame in order to achieve a desired frame rate. Implement a function `calculateFrameTime(fps: int) -> float` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculateFrameTime(60) == 16.666666666666668\", \"assert calculateFrameTime(30) == 33.333333333333336\", \"assert calculateFrameTime(120) == 8.333333333333334\", \"assert calculateFrameTime(1) == 1000.0\", \"assert calculateFrameTime(0) == 0.0\", \"assert ca... | {
"split": "train",
"index": 78290,
"acecode_id": "oss_19222",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the generation of a package configuration based on given parameters. The function should take the following inputs: `root` (a string representing the root directory of the package), `version` (a string representing the vers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_pkg_command('/path/to/root', '1.0.0', 'output.pkg') == '/usr/bin/pkgbuild --root /path/to/root --install-location / --identifier com.example.pkg --version 1.0.0 --ownership recommended output.pkg'\", \"assert generate_pkg_command('/path/to/root', '2... | {
"split": "train",
"index": 78291,
"acecode_id": "bigcode_python_fns_32666",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_even_or_odd(num: int) -> str` that takes an integer `num` as input and returns 'even' if the number is even, and 'odd' if the number is odd.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ``... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_even_or_odd(0) == 'even'\", \"assert is_even_or_odd(1) == 'odd'\", \"assert is_even_or_odd(2) == 'even'\", \"assert is_even_or_odd(-1) == 'odd'\", \"assert is_even_or_odd(-2) == 'even'\", \"assert is_even_or_odd(3) == 'odd'\", \"assert is_even_or_odd(4) =... | {
"split": "train",
"index": 78292,
"acecode_id": "evol_15928",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of file paths, write a function that simulates deleting each file and returns a list of directories that would remain after all deletions. Each directory should only be included if it is empty after the deletions. The input will be a list of strings representing fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_empty_directories(['single_file.txt']) == []\", \"assert delete_empty_directories(['music/pop/song.mp3', 'music/rock/']) == ['music/rock']\", \"assert delete_empty_directories(['dir1/']) == ['dir1']\", \"assert delete_empty_directories([]) == []\", \"... | {
"split": "train",
"index": 78293,
"acecode_id": "bigcode_python_fns_26833",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a frequency range as a string in the format 'start_freq-end_freq', where start_freq and end_freq are integers representing the start and end of the frequency range (inclusive). Your task is to write a function that parses this string to return a list of integers t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_frequency_range('1-5') == [1, 2, 3, 4, 5]\", \"assert parse_frequency_range('10-15') == [10, 11, 12, 13, 14, 15]\", \"assert parse_frequency_range('0-0') == [0]\", \"assert parse_frequency_range('5-5') == [5]\", \"assert parse_frequency_range('3-7') ==... | {
"split": "train",
"index": 78294,
"acecode_id": "bigcode_python_fns_8419",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of pairs where each pair contains a purchase order (PO) number and a result code. The result code can be: 1 for disproved, 2 for proved, 3 for unresolved, and any number greater than 3 for other unresolved outputs. Write a function `remove_proved_and_dispro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_proved_and_disproved([(1, 1), (2, 2), (3, 3), (4, 4)]) == [3, 4]\", \"assert remove_proved_and_disproved([(5, 2), (6, 1), (7, 3), (8, 5)]) == [7, 8]\", \"assert remove_proved_and_disproved([(1, 1), (2, 1), (3, 1)]) == []\", \"assert remove_proved_and_... | {
"split": "train",
"index": 78295,
"acecode_id": "bigcode_python_fns_2815",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_api_version()` that returns the version of the API as a string in the format 'X.Y.Z', where X, Y, and Z are non-negative integers. For this specific problem, you need to return the fixed version '1.0.0'. Write this function witho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_api_version() == '1.0.0'\", \"assert get_api_version() == '1.0.0'\", \"assert get_api_version() == '1.0.0'\", \"assert get_api_version() == '1.0.0'\", \"assert get_api_version() == '1.0.0'\", \"assert get_api_version() == '1.0.0'\", \"assert get_api_vers... | {
"split": "train",
"index": 78296,
"acecode_id": "bigcode_python_fns_433",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the values of cards in a game. Each card can be either exposed (visible) or unexposed (hidden). Implement a function that takes a list of card values and a list of boolean values indicating whether each card is exposed or not. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_matching_pairs([1, 2, 3, 1, 2, 3], [True, False, True, True, False, True]) == 2\", \"assert count_matching_pairs([4, 5, 6, 4, 5, 6], [True, True, False, True, True, False]) == 2\", \"assert count_matching_pairs([1, 2, 3, 4, 5], [False, False, False, Fa... | {
"split": "train",
"index": 78297,
"acecode_id": "bigcode_python_fns_27873",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a catalog of objects in a 2D space, where each object has a unique identifier. Your task is to create a function that takes this list and returns a list of dictionaries. Each dictionary should contain the identifier of the object an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert catalog_to_markers([3, 4, 5]) == [{'id': 0, 'x': 0, 'y': 3}, {'id': 1, 'x': 1, 'y': 4}, {'id': 2, 'x': 2, 'y': 5}]\", \"assert catalog_to_markers([-1, 2, 0]) == [{'id': 0, 'x': 0, 'y': -1}, {'id': 1, 'x': 1, 'y': 2}, {'id': 2, 'x': 2, 'y': 0}]\", \"assert ca... | {
"split": "train",
"index": 78298,
"acecode_id": "bigcode_python_fns_36937",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the process of saving a dataset to a specified directory. The function should take in a dataset represented as a string and a target directory as another string. The context folder is optional and can be provided as a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_dataset('my_dataset', '/path/to/dir', 'context_folder') == 'Dataset saved to /path/to/dir with context folder context_folder'\", \"assert save_dataset('my_dataset', '/path/to/dir', None) == 'Dataset saved to /path/to/dir without context folder'\", \"ass... | {
"split": "train",
"index": 78299,
"acecode_id": "bigcode_python_fns_4877",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.