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 given a string `name` that represents the name of a shader. Your task is to return a string that represents the shader code. For this problem, you will use a predefined mapping of shader names to their corresponding shader codes. Implement a function `get_shader_code(na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_shader_code('basic') == 'void main() { gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); }'\", \"assert get_shader_code('phong') == 'void main() { gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); }'\", \"assert get_shader_code('texture') == 'void main() { gl_FragColor = ... | {
"split": "train",
"index": 74500,
"acecode_id": "bigcode_python_fns_20403",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that analyzes a list of integers and returns a new list containing only the unique integers from the input list in ascending order. Your function should handle the following cases: 1. If the input list is empty, return an empty list. 2. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_sorted_integers([5, 5, 5, 5]) == []\", \"assert unique_sorted_integers([]) == []\", \"assert unique_sorted_integers([7, 8, 9]) == [7, 8, 9]\", \"assert unique_sorted_integers([1, 1, 2, 2, 3, 4]) == [3, 4]\", \"assert unique_sorted_integers([2, 2, 3, 4... | {
"split": "train",
"index": 74501,
"acecode_id": "oss_31119",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of drafted players and a list of available players, write a function that returns a new list of available players after excluding any players that have been drafted. The function should ensure that if a drafted player does not exist in the available players list, i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exclude_players(['Alice', 'Bob', 'Charlie'], ['Bob', 'Diana']) == ['Alice', 'Charlie']\", \"assert exclude_players(['John', 'Paul', 'George', 'Ringo'], ['George']) == ['John', 'Paul', 'Ringo']\", \"assert exclude_players(['Lionel', 'Cristiano', 'Neymar'], ['... | {
"split": "train",
"index": 74502,
"acecode_id": "bigcode_python_fns_48399",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that performs basic mathematical operations based on the input parameters. The function should accept three arguments: an operation string (\"add\", \"subtract\", \"multiply\", or \"divide\") and two numeric values (num1 and num2). Depend... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate('add', 5, 3) == 8\", \"assert calculate('subtract', 10, 4) == 6\", \"assert calculate('multiply', 2, 3) == 6\", \"assert calculate('divide', 9, 3) == 3.0\", \"assert calculate('add', 1.5, 2.5) == 4.0\", \"assert calculate('subtract', -1, -1) == 0\"... | {
"split": "train",
"index": 74503,
"acecode_id": "oss_33624",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking operation. Implement a function `bank_operations` that accepts a list of operations on a single bank account. Each operation is represented as a tuple where the first element is a string indicating the operation type ('deposit', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations([('deposit', 100), ('get_balance', None)]) == [100]\", \"assert bank_operations([('withdraw', 50)]) == ['Invalid operation']\", \"assert bank_operations([('withdraw', 100), ('deposit', 50), ('get_balance', None)]) == ['Invalid operation', 50]... | {
"split": "train",
"index": 74504,
"acecode_id": "oss_27756",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string `val`, write a function `count_doubles` that counts the number of consecutive double letters in the string. A consecutive double letter is defined as two identical letters appearing next to each other. For example, in the string 'helloo there', there are two sets... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_doubles('helloo there') == 2\", \"assert count_doubles('aabbcc') == 3\", \"assert count_doubles('abcd') == 0\", \"assert count_doubles('') == 0\", \"assert count_doubles('a') == 0\", \"assert count_doubles('aa') == 1\", \"assert count_doubles('aabbccdd... | {
"split": "train",
"index": 74505,
"acecode_id": "oss_16765",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a collection of numbers. Your task is to implement a function that returns the maximum sum of any contiguous subarray within the list. A contiguous subarray is defined as a sequence of adjacent elements in the array. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, -3, -1]) == -1\", \"assert max_subarray_sum([0, 0, 0, 0]) == 0\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"assert max... | {
"split": "train",
"index": 74506,
"acecode_id": "oss_11002",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a circular buffer data structure in Python. A circular buffer is a fixed-size buffer that overwrites the oldest data with new data when the buffer is full. Your task is to create a function `circular_buffer_operations(operations: List[Tuple[str,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert circular_buffer_operations([('write', 1), ('write', 2), ('read', None)], 3) == [1]\", \"assert circular_buffer_operations([('write', 1), ('write', 2), ('clear', None), ('read', None)], 3) == [None]\", \"assert circular_buffer_operations([('write', 1), ('read... | {
"split": "train",
"index": 74507,
"acecode_id": "oss_20140",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that can convert a given string into leetspeak or revert it back to regular English. The function should accept two parameters: a string to convert and a string indicating the operation ('TO_LEET' to convert to leetspeak or 'FROM_LEET' to convert from leetspea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert leetspeak_converter('4 8 C D', 'FROM_LEET') == 'A B C D'\", \"assert leetspeak_converter('!@#$%', 'TO_LEET') == '!@#$%'\", \"assert leetspeak_converter('!@#$%', 'FROM_LEET') == '!@#$%'\", \"assert leetspeak_converter('Invalid char: #', 'FROM_LEET') == 'Inval... | {
"split": "train",
"index": 74508,
"acecode_id": "evol_14787",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two integers `n` and `m`, and a character `c`, implement a function `create_frame(n, m, c)` that returns a list of strings representing a frame of dimensions `n`x`m` using the character `c`. The frame should have a border made of the character `c`, and the inside of the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_frame(5, 8, '*') == ['********', '* *', '* *', '* *', '********']\", \"assert create_frame(3, 4, '#') == ['####', '# #', '####']\", \"assert create_frame(0, 5, '$') == []\", \"assert create_frame(5, 0, '%') == []\", \"assert create_fra... | {
"split": "train",
"index": 74509,
"acecode_id": "oss_34757",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are working on a genetic algorithm for optimizing a set of parameters for a complex task. The algorithm maintains a population of parameter sets and iteratively updates them based on their performance. Your task is to implement a function that takes the current population a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert drop_individuals([{'uid': 1}, {'uid': 2}, {'uid': 3}], 0.0) == [{'uid': 1}, {'uid': 2}, {'uid': 3}]\", \"assert drop_individuals([{'uid': 1}, {'uid': 2}, {'uid': 3}], 1.0) == []\", \"assert drop_individuals([{'uid': 1}], 0.5) in [[{'uid': 1}], []]\", \"asser... | {
"split": "train",
"index": 74510,
"acecode_id": "oss_3980",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simplified training process for a machine learning model. The function will take in six parameters: `data_batch` (a list of input data), `labels_batch` (a list of corresponding labels), `steps` (an integer represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_training([1, 2, 3], [0, 1, 0], 50, 2, 10, 3) == 'Evaluating: 50 steps of 60 items'\", \"assert simulate_training([1], [1], 10, 1, 1, 1) == 'Evaluating: 10 steps of 1 items'\", \"assert simulate_training([0, 0, 0, 0], [1, 1, 1, 1], 100, 5, 4, 2) == '... | {
"split": "train",
"index": 74511,
"acecode_id": "oss_23951",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list representing a binary max heap, implement a function `modify_second_to_last_element(heap: List[int], new_value: int) -> List[int]` that replaces the second-to-last element of the heap with `new_value`, and then reheapifies the heap to maintain the max-heap property... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_second_to_last_element([10, 5, 3, 2], 4) == [10, 5, 4, 2]\", \"assert modify_second_to_last_element([30, 20, 25, 10, 5], 18) == [30, 20, 25, 18, 5]\", \"assert modify_second_to_last_element([100, 90, 80, 70, 60], 75) == [100, 90, 80, 75, 60]\", \"asse... | {
"split": "train",
"index": 74512,
"acecode_id": "evol_28776",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `find_palindromes` that returns a list of all the strings that are palindromes. A string is considered a palindrome if it reads the same backward as forward. For example, 'abba' is a palindrome while 'abc' is not. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_palindromes(['level', 'world', 'rotor', 'python']) == ['level', 'rotor']\", \"assert find_palindromes(['madam', 'racecar', 'hello']) == ['madam', 'racecar']\", \"assert find_palindromes(['noon', 'apple', 'deified']) == ['noon', 'deified']\", \"assert fi... | {
"split": "train",
"index": 74513,
"acecode_id": "evol_28004",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing numerical values, some of which may be empty. Write a function `calculate_average(nums: List[str]) -> float` that computes the average of all the non-empty numerical values in the list. If there are no non-empty numerical values, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([r'3', r'', r'5.0', r'']) == 4.0\", \"assert calculate_average([r'', r'', r'']) == 0\", \"assert calculate_average([r'10', r'20', r'30']) == 20.0\", \"assert calculate_average([r'0', r'0', r'0']) == 0.0\", \"assert calculate_average([r'1.5'... | {
"split": "train",
"index": 74514,
"acecode_id": "oss_30796",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples where each tuple contains the following information about Challenge-Handshake Authentication Protocol (CHAP) credentials for an iSCSI target: (TargetARN, SecretToAuthenticateInitiator, InitiatorName, SecretToAuthenticateTarget). Write a function `extract_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_chap_credentials([('arn:aws:target:1', 'secret1', 'initiator1', 'targetsecret1'), ('arn:aws:target:2', 'secret2', 'initiator2', 'targetsecret2')]) == [{'TargetARN': 'arn:aws:target:1', 'SecretToAuthenticateInitiator': 'secret1', 'InitiatorName': 'ini... | {
"split": "train",
"index": 74515,
"acecode_id": "bigcode_python_fns_15513",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a Unix timestamp, write a function that converts it into an ISO 8601 formatted date string in UTC. The function should take an integer representing the Unix timestamp as input and return a string formatted according to the ISO 8601 standard. The returned string should inc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isotime(0) == '1970-01-01T00:00:00Z'\", \"assert isotime(1609459200) == '2021-01-01T00:00:00Z'\", \"assert isotime(1633046400) == '2021-10-01T00:00:00Z'\", \"assert isotime(-1) == '1969-12-31T23:59:59Z'\", \"assert isotime(3600) == '1970-01-01T01:00:00Z'\", ... | {
"split": "train",
"index": 74516,
"acecode_id": "bigcode_python_fns_20463",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `initialize_motor_controller(mc)` that initializes a motor controller to an 'initial state' by applying common settings. The motor controller can be represented as a dictionary with the following keys: 'is_simulation', 'factory_default_ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_motor_controller({'is_simulation': False, 'factory_default_called': False, 'sticky_faults_cleared': False, 'safety_enabled': True, 'neutral_mode': 'Coast'}) == {'is_simulation': False, 'factory_default_called': True, 'sticky_faults_cleared': True,... | {
"split": "train",
"index": 74517,
"acecode_id": "bigcode_python_fns_22553",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function called `generate_fibonacci(n)` that takes an integer `n` as input and returns a list containing the first `n` numbers of the Fibonacci sequence. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(0) == []\", \"assert generate_fibonacci(1) == [0]\", \"assert generate_fibonacci(2) == [0, 1]\", \"assert generate_fibonacci(3) == [0, 1, 1]\", \"assert generate_fibonacci(4) == [0, 1, 1, 2]\", \"assert generate_fibonacci(5) == [0, 1, 1, 2... | {
"split": "train",
"index": 74518,
"acecode_id": "evol_10626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integer arrays, `arr1` and `arr2`, write a function `shared_elements(arr1, arr2)` that returns a list of elements that are present in both arrays. The returned list should contain only the elements found in `arr1` that also exist in `arr2`, and the order of elements i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shared_elements([1,2,3,4,5], [3,4,5,6,7]) == [3, 4, 5]\", \"assert shared_elements([10, 20, 30], [30, 40, 50]) == [30]\", \"assert shared_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert shared_elements([], [1, 2, 3]) == []\", \"assert shared_elements([1, 2,... | {
"split": "train",
"index": 74519,
"acecode_id": "evol_29760",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a production rule represented by two components: a list of variables and a list of production options (each option is a list of symbols), determine if all symbols in the production options are part of a predefined set of literal values. Implement a function `isProductionV... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isProductionValid(['A'], [['\\\"a\\\"', '\\\"b\\\"'],['\\\"cde\\\"']], ['a', 'b']) == False\", \"assert isProductionValid(['A'], [['\\\"x\\\"', '\\\"y\\\"'],['\\\"z\\\"']], ['x', 'y', 'z']) == True\", \"assert isProductionValid(['A'], [['\\\"x\\\"', '\\\"y\\... | {
"split": "train",
"index": 74520,
"acecode_id": "bigcode_python_fns_42254",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a usage message for a command line interface. The function should take in a program name and a list of arguments, and return a formatted usage string that indicates how the program should be executed. The usage message shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_usage('my_program', ['arg1', 'arg2']) == '[INFO] Usage: my_program arg1 arg2'\", \"assert generate_usage('my_program', ['arg1', 'arg2', 'arg3']) == '[INFO] Usage: my_program arg1 arg2 arg3'\", \"assert generate_usage('my_program', ['arg1', 'arg2', '... | {
"split": "train",
"index": 74521,
"acecode_id": "bigcode_python_fns_6575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a stock code in a specific format. The format consists of two parts separated by a dot: the stock number and the market identifier. The market identifier can be either 'XSHG' for the Shanghai Stock Exchange or 'XSHE' for the Shenzhen Stock Ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_stock_code('600000.XSHG') == 'SH600000'\", \"assert convert_stock_code('000001.XSHG') == 'SH000001'\", \"assert convert_stock_code('300001.XSHE') == 'SZ300001'\", \"assert convert_stock_code('002001.XSHE') == 'SZ002001'\", \"assert convert_stock_code... | {
"split": "train",
"index": 74522,
"acecode_id": "bigcode_python_fns_9191",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a grid represented as a list of lists of integers, where each integer represents the height of a unit in that cell, implement a function `generate_matrix(grid: List[List[int]], unit_grid: int) -> List[List[int]]` that generates a new grid by applying a specified unit size... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_matrix([[1, 2], [3, 4]], 2) == [[4]]\", \"assert generate_matrix([[1, 1], [1, 1]], 1) == [[1, 1], [1, 1]]\", \"assert generate_matrix([[1, 3, 2], [4, 6, 5], [7, 8, 9]], 3) == [[9]]\", \"assert generate_matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11,... | {
"split": "train",
"index": 74523,
"acecode_id": "bigcode_python_fns_34327",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Design a function `get_memory_info()` that simulates retrieving memory configuration data of a debugged process. The function should return a tuple containing the following information: (start_ea, end_ea, name, sclass, sbase, bitness, perm). If no debugger is active, return Non... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_memory_info(True) == (4096, 8192, 'main_memory', 'heap', 0, 64, 'rw')\", \"assert get_memory_info(False) == None\", \"assert get_memory_info(False) == None\", \"assert get_memory_info(False) == None\", \"assert get_memory_info(False) == None\", \"assert ... | {
"split": "train",
"index": 74524,
"acecode_id": "bigcode_python_fns_27307",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a string that contains citations in the form of '[number]', implement a function that processes the citations and expands any range of citations that are represented as '[m]-[n]' into individual citations '[m]', '[m+1]', ..., '[n]'. The input will be a single string with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert expand_citations('This is a citation [1] and another [3]') == 'This is a citation [1] and another [3]'\", \"assert expand_citations('This is a citation [1]-[3]') == 'This is a citation [1] [2] [3]'\", \"assert expand_citations('Citations [2]-[5] [6]') == 'Ci... | {
"split": "train",
"index": 74525,
"acecode_id": "bigcode_python_fns_40695",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `nums`, write a function `minSubsequence(nums)` that returns the smallest subsequence of `nums` such that the sum of the elements in the subsequence is strictly greater than the sum of the non-included elements. If there are multiple solutions, return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minSubsequence([6]) == [6]\", \"assert minSubsequence([1, 2, 3, 4, 5]) == [5, 4]\", \"assert minSubsequence([100, 1, 1, 1, 1]) == [100]\", \"assert minSubsequence([3, 5, 8, 2, 1]) == [8, 5]\", \"assert minSubsequence([1, 3, 2, 6, 4]) == [6, 4]\", \"assert mi... | {
"split": "train",
"index": 74526,
"acecode_id": "evol_26371",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents a game and its associated genres, separated by commas. Your task is to implement a function that takes this list as input and returns a set of unique genres extracted from the list of games. Each game string follows t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_genres(['Game1: Action, Adventure', 'Game2: Action, RPG', 'Game3: Puzzle, Adventure']) == {'Action', 'Adventure', 'RPG', 'Puzzle'}\", \"assert extract_unique_genres(['GameA: RPG, Strategy', 'GameB: Simulation', 'GameC: RPG']) == {'RPG', 'Strat... | {
"split": "train",
"index": 74527,
"acecode_id": "bigcode_python_fns_49007",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `string_xor(a: str, b: str) -> str` that takes two binary strings `a` and `b`, each consisting solely of '0's and '1's. The function should perform a binary exclusive OR (XOR) operation on the two strings and return the result as a binary string. The output... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_xor('010', '110') == '100'\", \"assert string_xor('1010', '0011') == '1001'\", \"assert string_xor('1111', '0000') == '1111'\", \"assert string_xor('0000', '0000') == '0'\", \"assert string_xor('111', '111') == '0'\", \"assert string_xor('001', '110')... | {
"split": "train",
"index": 74528,
"acecode_id": "evol_20858",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks for configuration changes between two lists of configurations. Each configuration is represented by a dictionary containing the keys 'project_id', 'config_digest', and 'perms_rev'. Your function should take three arguments... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_config_changes([{'project_id': '1', 'config_digest': 'abc', 'perms_rev': 1}], [{'project_id': '1', 'config_digest': 'abc', 'perms_rev': 1}], 1) == []\", \"assert check_config_changes([], [{'project_id': '1', 'config_digest': 'abc', 'perms_rev': 1}], 1)... | {
"split": "train",
"index": 74529,
"acecode_id": "bigcode_python_fns_39775",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that manages software release information for a software project. The function should take three parameters: `readme_url`, `changelog_url`, and `runner_version`. The function should return a dictionary containing the keys 'readme_u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_software_release() == {'readme_url': 'https://default.readme', 'changelog_url': 'https://default.changelog', 'runner_version': '0.0'}\", \"assert manage_software_release('https://my.readme') == {'readme_url': 'https://my.readme', 'changelog_url': 'htt... | {
"split": "train",
"index": 74530,
"acecode_id": "oss_8195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the saving and retrieval of peak data in a scientific data analysis application. The function `processPeakData` takes three parameters: `filename` (a string representing the name of the file), `start_frame` (an integer ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert processPeakData('test_file.h5', 0, 10) == {'filename': 'test_file.h5', 'start_frame': 0, 'total_peaks': 10}\", \"assert processPeakData('example.hdf5', 5, 20) == {'filename': 'example.hdf5', 'start_frame': 5, 'total_peaks': 20}\", \"assert processPeakData('d... | {
"split": "train",
"index": 74531,
"acecode_id": "oss_23726",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `calculate_sum` that takes a list of integers as input and returns the sum of all the elements in the list. The function should handle lists of varying lengths, including an empty list. Your implementation should ensure that th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum([]) == 0\", \"assert calculate_sum([1]) == 1\", \"assert calculate_sum([-1]) == -1\", \"assert calculate_sum([1, 2, 3]) == 6\", \"assert calculate_sum([0, 0, 0]) == 0\", \"assert calculate_sum([-1, 1]) == 0\", \"assert calculate_sum([10, 20]) =... | {
"split": "train",
"index": 74532,
"acecode_id": "oss_36883",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a user's email subscriptions and models based on their email address. The function will accept an email address and return a dictionary containing two lists: one for queries and one for models. Each query in the list sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_subscriptions('user1@example.com') == {'queries': [('Check weather for model WeatherForecast', 'check_weather', 'qh123')], 'models': [('model1', 'WeatherForecast')]}\", \"assert get_subscriptions('user2@example.com') == {'queries': [('Get stock prices fo... | {
"split": "train",
"index": 74533,
"acecode_id": "bigcode_python_fns_43849",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that checks if a given integer is a palindromic prime number. A palindromic number is a number that remains the same when its digits are reversed. A prime number is a number greater than 1 that has no positive divisors other than 1 and itself. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindromic_prime(2) == True\", \"assert is_palindromic_prime(3) == True\", \"assert is_palindromic_prime(11) == True\", \"assert is_palindromic_prime(101) == True\", \"assert is_palindromic_prime(131) == True\", \"assert is_palindromic_prime(151) == True... | {
"split": "train",
"index": 74534,
"acecode_id": "evol_33325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the number of batches required for training a machine learning model based on the total number of training examples and the batch size. The function should take two parameters: the total number of training examples (nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_num_batches(10, 3) == 4\", \"assert calculate_num_batches(10, 0) == 0\", \"assert calculate_num_batches(5, 2) == 3\", \"assert calculate_num_batches(0, 5) == 0\", \"assert calculate_num_batches(15, 5) == 3\", \"assert calculate_num_batches(1, 1) ==... | {
"split": "train",
"index": 74535,
"acecode_id": "oss_17185",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a command-line argument parser that accepts a list of integers and returns the sum of those integers. The function should take a single argument, which is a list of integers, and return an integer representing the sum of the provided integers. If th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_integers([1, 2, 3]) == 6\", \"assert sum_of_integers([-1, -2, -3]) == -6\", \"assert sum_of_integers([0, 0, 0]) == 0\", \"assert sum_of_integers([]) == 0\", \"assert sum_of_integers([10, 20, 30, 40]) == 100\", \"assert sum_of_integers([5]) == 5\", \"a... | {
"split": "train",
"index": 74536,
"acecode_id": "bigcode_python_fns_31966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function named `shorten_lines` that takes a string, a maximum number of characters per line, and a maximum number of lines as input. The function should return a modified string where each line does not exceed the specified number of character... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shorten_lines('Short line.', 20, 1) == 'Short line.'\", \"assert shorten_lines('Line 1\\\\nLine 2\\\\nLine 3\\\\nLine 4', 10, 2) == 'Line 1\\\\nLine 2'\", \"assert shorten_lines('One\\\\ntwo\\\\nthree\\\\nfour\\\\nfive', 4, 3) == 'One\\\\ntwo\\\\nthree'\", \... | {
"split": "train",
"index": 74537,
"acecode_id": "oss_1301",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the area and perimeter of a square based on its side length. The function should take an integer parameter `side_length`, which represents the length of one side of the square. The area of the square is defined as the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_square_properties(0) == (0, 0)\", \"assert calculate_square_properties(1) == (1, 4)\", \"assert calculate_square_properties(2) == (4, 8)\", \"assert calculate_square_properties(3) == (9, 12)\", \"assert calculate_square_properties(4) == (16, 16)\",... | {
"split": "train",
"index": 74538,
"acecode_id": "oss_30799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_operations` that takes four parameters: `base`, `exponent`, `modulus_divisor`, and `root_degree`. The function should return a tuple containing the results of the following operations: exponentiation of `base` raised to `exponent`, the modulus of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_operations(2, 3, 5, 2) == (8, 2, 1.4142135623730951)\", \"assert calculate_operations(4, 2, 3, 4) == (16, 1, 1.4142135623730951)\", \"assert calculate_operations(10, 0, 3, 3) == (1, 1, 2.154434690031884)\", \"assert calculate_operations(9, 2, 7, 2)... | {
"split": "train",
"index": 74539,
"acecode_id": "evol_5042",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a given list of integers into a TensorRT-compatible format. The function should take the following input: a list of integers, where each integer represents a model configuration parameter. The output should be a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_trt_format([]) == []\", \"assert convert_to_trt_format([0]) == [0.0]\", \"assert convert_to_trt_format([2]) == [3.0]\", \"assert convert_to_trt_format([-2]) == [-3.0]\", \"assert convert_to_trt_format([1, 2, 3]) == [1.5, 3.0, 4.5]\", \"assert conv... | {
"split": "train",
"index": 74540,
"acecode_id": "oss_12160",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total quantity of items received from a specific supplier within a given date range. Implement a function `get_total_received_items(supplier_name: str, start_date: str, end_date: str, received_items: List[Tuple[str, str, int]]) -> int` that t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_received_items('Supplier A', '2023-01-01', '2023-01-31', [('Supplier A', '2023-01-10', 5), ('Supplier A', '2023-01-15', 10), ('Supplier B', '2023-01-20', 7)]) == 15\", \"assert get_total_received_items('Supplier A', '2023-01-01', '2023-01-31', [('S... | {
"split": "train",
"index": 74541,
"acecode_id": "bigcode_python_fns_37477",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that extracts the country code and sub-number segments from a list of international telephone contact numbers. Each telephone number follows a format that includes a country code prefixed by a '+', followed by a space or hyphen, and then t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_parts(['+49 30 123456', '+33 1 23 45 67 89', '+81-3-1234-5678']) == {'+49 30 123456': {'Country Code': '49', 'Sub Number': '30123456'}, '+33 1 23 45 67 89': {'Country Code': '33', 'Sub Number': '123456789'}, '+81-3-1234-5678': {'Country Code': '81', ... | {
"split": "train",
"index": 74542,
"acecode_id": "evol_35625",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates a simple in-memory database storage system. Your function should take no parameters and return a dictionary that represents a database with predefined tables and some initial data. The database should include the following t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store() == {'users': [{'id': 1, 'name': 'Alice', 'age': 30}, {'id': 2, 'name': 'Bob', 'age': 25}, {'id': 3, 'name': 'Charlie', 'age': 35}], 'products': [{'product_id': 1, 'product_name': 'Laptop', 'price': 999.99}, {'product_id': 2, 'product_name': 'Phone', ... | {
"split": "train",
"index": 74543,
"acecode_id": "bigcode_python_fns_26910",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom validation function that checks if a given string meets specific criteria. Your function should ensure that the string contains only alphabetic characters (A-Z, a-z) and does not start with a digit. If the validation fails, it should raise ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_string('Hello') is None\", \"assert validate_string('world') is None\", \"assert validate_string('Python') is None\", \"assert validate_string('Django') is None\", \"assert validate_string('A') is None\", \"assert validate_string('abc') is None\", \... | {
"split": "train",
"index": 74544,
"acecode_id": "oss_30965",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that takes three integers as input and returns their product. The function should be named `multiply_three_numbers` and should accept three parameters: `a`, `b`, and `c`, which are the integers to be multiplied together. The function should return a sin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_three_numbers(1, 2, 3) == 6\", \"assert multiply_three_numbers(0, 5, 10) == 0\", \"assert multiply_three_numbers(-1, -2, -3) == -6\", \"assert multiply_three_numbers(-1, 2, 3) == -6\", \"assert multiply_three_numbers(3, 3, 3) == 27\", \"assert multi... | {
"split": "train",
"index": 74545,
"acecode_id": "evol_18575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that analyzes and tracks the betting behavior in a poker game. The function `update_betting_flags(street_dict: dict) -> dict` takes a dictionary that represents the number of bets made on each street during a poker game. The keys of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_betting_flags({'FLOP': 1, 'TURN': 0, 'RIVER': 0}) == {'has_two_bet': False, 'opponent_has_two_bet': False, 'has_three_bet': False, 'opponent_has_three_bet': False, 'has_four_bet': False, 'opponent_has_four_bet': False, 'has_bet_aggressively': True}\",... | {
"split": "train",
"index": 74546,
"acecode_id": "oss_21529",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers as input and returns the sum of all prime numbers present in the list. For example, given the input list [2, 3, 4, 5, 6, 7], the function should return 17, since 2, 3, 5, and 7 are prime numbers and their sum is 17.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_prime_numbers([2, 3, 4, 5, 6, 7]) == 17\", \"assert sum_prime_numbers([1, 4, 6, 8]) == 0\", \"assert sum_prime_numbers([11, 13, 17, 19]) == 60\", \"assert sum_prime_numbers([0, -1, -3]) == 0\", \"assert sum_prime_numbers([29, 15, 30, 17]) == 46\", \"asse... | {
"split": "train",
"index": 74547,
"acecode_id": "evol_5727",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Your task is to implement a function that determines if there is at least one person in the group who is 18 years or older. The function should return True if there is at least one eligible person, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_anyone_eligible([15, 12, 17]) == False\", \"assert is_anyone_eligible([20, 16, 18]) == True\", \"assert is_anyone_eligible([17, 21]) == True\", \"assert is_anyone_eligible([10]) == False\", \"assert is_anyone_eligible([19]) == True\", \"assert is_anyone_e... | {
"split": "train",
"index": 74548,
"acecode_id": "bigcode_python_fns_43402",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_product_prime(numbers)` that takes a list of whole numbers as input and returns a binary value (True or False) indicating whether the cumulative product of the numerical values in the list is a prime number. A prime number is defined as a natural number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_product_prime([1, 1, 1]) == False\", \"assert is_product_prime([4, 6, 8]) == False\", \"assert is_product_prime([2, 2, 2]) == False\", \"assert is_product_prime([13]) == True\", \"assert is_product_prime([0]) == False\", \"assert is_product_prime([]) == F... | {
"split": "train",
"index": 74549,
"acecode_id": "evol_1619",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a directed graph represented as an adjacency list. Your task is to implement a function that returns the number of nodes that can be reached from a given starting node. The graph is represented as a dictionary where the keys are node identifiers and the values are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reachable_nodes({1: [2, 3], 2: [4], 3: [], 4: []}, 1) == 4\", \"assert reachable_nodes({1: [2], 2: [3], 3: [4], 4: []}, 1) == 4\", \"assert reachable_nodes({1: [], 2: [], 3: []}, 1) == 1\", \"assert reachable_nodes({1: [2], 2: [1]}, 1) == 2\", \"assert reach... | {
"split": "train",
"index": 74550,
"acecode_id": "bigcode_python_fns_16764",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `monotonic_advanced_prime_fi(l: list, strict: bool = False, zero_cross: bool = False, progression: str = None, fibonacci: bool = False, prime: bool = False) -> bool` that checks if a given list satisfies several conditions. The function should verify if the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monotonic_advanced_prime_fi([1, 2, 3, 4], strict=True) == True\", \"assert monotonic_advanced_prime_fi([1, 2, 3, 3], strict=True) == False\", \"assert monotonic_advanced_prime_fi([3, 2, 1], strict=True) == True\", \"assert monotonic_advanced_prime_fi([-1, 1,... | {
"split": "train",
"index": 74551,
"acecode_id": "evol_9398",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a Python dictionary containing a key \"sp_parts\" with a value of a list of ranges. Each range represents a specific range of spare parts in a warehouse. Your task is to write a function that takes this dictionary as input and returns the total count of spare part... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_spare_parts({\\\"sp_parts\\\": [range(20, 43), range(50, 60)]}) == 33\", \"assert count_spare_parts({\\\"sp_parts\\\": [range(1, 5), range(10, 15)]}) == 9\", \"assert count_spare_parts({\\\"sp_parts\\\": [range(0, 1)]}) == 1\", \"assert count_spare_par... | {
"split": "train",
"index": 74552,
"acecode_id": "oss_21610",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and uses regular expressions to extract all valid email addresses from it. A valid email address must follow the standard format: local-part@domain. The local part can contain letters, digits, dots, underscores, percentages, pluses,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_emails('Contact us at support@example.com for assistance.') == ['support@example.com']\", \"assert extract_emails('Invalid emails: user@, @example.com, user@.com') == []\", \"assert extract_emails('Emails: test.email@domain.com, another_email@domain.... | {
"split": "train",
"index": 74553,
"acecode_id": "evol_28997",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the recording of a point cloud by processing a series of raw byte streams. The function should accept a target device's hostname or IP address and a file name for the output. The function will simulate receiving a fixed num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert record_point_cloud('192.168.1.1', 'output.pcd') == 8192\", \"assert record_point_cloud('localhost', 'test.pcd') == 8192\", \"assert record_point_cloud('192.168.0.10', 'data.pcd') == 8192\", \"assert record_point_cloud('10.0.0.1', 'cloud.pcd') == 8192\", \"as... | {
"split": "train",
"index": 74554,
"acecode_id": "bigcode_python_fns_20193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `vector_dot_product(v1: List[float], v2: List[float]) -> float` that calculates the dot product of two 3-dimensional vectors represented as lists of three float numbers. The function should return a single float number representing the dot product. If the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vector_dot_product([1.0, 2.0, 3.0], [4.0, 5.0, 6.0]) == 32.0\", \"assert vector_dot_product([0.0, 0.0, 0.0], [1.0, 2.0, 3.0]) == 0.0\", \"assert vector_dot_product([1.0, 2.0, 3.0], [-1.0, -2.0, -3.0]) == -14.0\", \"assert vector_dot_product([1.0, 0.0, 0.0], ... | {
"split": "train",
"index": 74555,
"acecode_id": "evol_15284",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple function that simulates a thread pool's task execution. The function should take two parameters: an integer `num_threads` representing the number of worker threads available to execute tasks, and a list of `tasks`, where each task is a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_tasks(1, [lambda: 'a', lambda: 'b']) == ['a', 'b']\", \"assert execute_tasks(1, [lambda: None, lambda: None]) == [None, None]\", \"assert execute_tasks(1, [lambda: 'foo', lambda: 'bar', lambda: 'baz']) == ['foo', 'bar', 'baz']\", \"assert execute_tas... | {
"split": "train",
"index": 74556,
"acecode_id": "oss_10939",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing role information of a party, create a function that constructs a new role object with specific attributes. The role information dictionary contains the following keys: 'roleType', 'appointmentDate', and 'cessationDate'. The 'roleType' must be con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_role({'roleType': 'admin', 'appointmentDate': '2021-01-01', 'cessationDate': '2022-01-01'}) == {'role': 'Administrator', 'appointment_date': '2021-01-01', 'cessation_date': '2022-01-01'}\", \"assert create_role({'roleType': 'member', 'appointmentDate'... | {
"split": "train",
"index": 74557,
"acecode_id": "bigcode_python_fns_42918",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a file path for saving model weights based on a specified training directory and epoch number. The generated file path should follow the template: '{train_dir}/weights/{epoch:04d}.domain.pt'. Your function should take i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_file_path('path/to/train_dir', 0) == 'path/to/train_dir/weights/0000.domain.pt'\", \"assert generate_file_path('path/to/train_dir', 1) == 'path/to/train_dir/weights/0001.domain.pt'\", \"assert generate_file_path('path/to/train_dir', 10) == 'path/to/... | {
"split": "train",
"index": 74558,
"acecode_id": "oss_14177",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps as strings in the format 'YYYY-MM-DD' and two date strings, 'start_date' and 'end_date'. Your task is to implement a function that filters the list of timestamps to only include those that fall within the range from 'start_date' to 'end_date',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_dates(['2023-01-01', '2023-01-02', '2023-01-03'], '2023-01-01', '2023-01-02') == ['2023-01-01', '2023-01-02']\", \"assert filter_dates(['2023-01-01', '2023-01-02', '2023-01-03'], '2023-01-02', None) == ['2023-01-02', '2023-01-03']\", \"assert filter_d... | {
"split": "train",
"index": 74559,
"acecode_id": "bigcode_python_fns_33577",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of items. Your task is to implement a function `calculate_average_weight(weights: List[int]) -> float` that calculates the average weight of the items in the list. The average should be computed as the sum of all weights... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_weight([10, 20, 30]) == 20.0\", \"assert calculate_average_weight([5, 15, 25, 35]) == 20.0\", \"assert calculate_average_weight([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average_weight([100]) == 100.0\", \"assert calculate_average_weigh... | {
"split": "train",
"index": 74560,
"acecode_id": "bigcode_python_fns_8952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to convert a given integer value into its equivalent representation in a specified base. The function `convert_to_val` takes two parameters: `value` (an integer) and `base` (an integer representing the base to which the value should b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_val(13, 2) == '1101'\", \"assert convert_to_val(255, 16) == 'FF'\", \"assert convert_to_val(10, 10) == '10'\", \"assert convert_to_val(0, 5) == '0'\", \"assert convert_to_val(31, 16) == '1F'\", \"assert convert_to_val(7, 8) == '7'\", \"assert conv... | {
"split": "train",
"index": 74561,
"acecode_id": "oss_13145",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a blog post submission. The function should take in two strings: the title of the blog post and the content of the post. Both the title and content must be non-empty strings. The function should return True if both fields a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_blog_post('My First Blog', 'This is the content of my first blog post.') == True\", \"assert validate_blog_post('Hello World', '') == False\", \"assert validate_blog_post('', 'This is a valid content.') == False\", \"assert validate_blog_post('A Tit... | {
"split": "train",
"index": 74562,
"acecode_id": "oss_33034",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user activity records, where each record is a tuple containing a username, a timestamp, and a link. Your task is to implement a function `store_user_activity(records: List[Tuple[str, str, str]]) -> Dict[str, str]` that processes these records and stores ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_user_activity([('user1', '2023-01-01T12:00:00', 'http://example.com/1'), ('user2', '2023-01-01T12:01:00', 'http://example.com/2')]) == {'subreddit|user1': '2023-01-01T12:00:00|http://example.com/1', 'subreddit|user2': '2023-01-01T12:01:00|http://exampl... | {
"split": "train",
"index": 74563,
"acecode_id": "oss_1295",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `nums`, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them in decreasing order. If multiple values have the same frequency and the same value, sort them in increasing order of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert frequencySort([1,1,2,2,2,3]) == [3,1,1,2,2,2]\", \"assert frequencySort([-1,1,-6,4,5,-6,1,4,1]) == [5,-1,4,4,-6,-6,1,1,1]\", \"assert frequencySort([1]) == [1]\", \"assert frequencySort([2,2,3,3,3,1,1,1,1]) == [2,2,3,3,3,1,1,1,1]\", \"assert frequencySort([]... | {
"split": "train",
"index": 74564,
"acecode_id": "evol_23664",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_missing_number(nums)` that finds and returns the only missing number from the list. The list contains integers from 0 to n, where n is the length of the list. There will always be one missing number in the list. If the list is em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_missing_number([0, 1, 2, 4]) == 3\", \"assert find_missing_number([1, 2, 3, 4, 5, 0]) == 6\", \"assert find_missing_number([0]) == 1\", \"assert find_missing_number([]) == 0\", \"assert find_missing_number([0, 2, 3]) == 1\", \"assert find_missing_number... | {
"split": "train",
"index": 74565,
"acecode_id": "bigcode_python_fns_39439",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a namespaced XML tag based on a given namespace and tag name. The function should take two inputs: a namespace (which is a string that represents a predefined XML namespace) and a tag (which is a string representing the tag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_namespaced_tag('example', 'item') == '{http://www.example.com}item'\", \"assert generate_namespaced_tag('test', 'element') == '{http://www.test.com}element'\", \"assert generate_namespaced_tag('demo', 'data') == '{http://www.demo.com}data'\", \"asse... | {
"split": "train",
"index": 74566,
"acecode_id": "bigcode_python_fns_35179",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dictionary representing environment variables and generates a list of patches for a specific API. Your function should filter out any environment variables with a `None` value and then construct a list of patches usin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_patches({'key1': 'value1', 'key2': None, 'key3': 'value3'}) == [{'key1': 'value1'}, {'key3': 'value3'}]\", \"assert generate_patches({'keyA': 'valueA', 'keyB': 'valueB', 'keyC': None}) == [{'keyA': 'valueA'}, {'keyB': 'valueB'}]\", \"assert generate... | {
"split": "train",
"index": 74567,
"acecode_id": "oss_34046",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a Python function called `analyze_url` that takes a single string parameter `url`. The function should return a tuple containing three elements: the protocol used (either 'http' or 'https'), the domain type (like 'com', 'org', 'edu', etc.), and a boolean indicating wheth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_url('https://www.example.com') == ('https', 'com', False)\", \"assert analyze_url('http://example.org') == ('http', 'org', False)\", \"assert analyze_url('https://example.com/login') == ('https', 'com', False)\", \"assert analyze_url('http://example.... | {
"split": "train",
"index": 74568,
"acecode_id": "evol_24814",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of various plants in a garden. Your task is to implement a function that will calculate the median height of these plants. The median is defined as the middle value when the heights are sorted. If there is an even number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_median_heights([1, 3, 2]) == 2.0\", \"assert calculate_median_heights([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_median_heights([5, 1, 3, 2, 4]) == 3.0\", \"assert calculate_median_heights([7, 8, 9, 10]) == 8.5\", \"assert calculate_median_heigh... | {
"split": "train",
"index": 74569,
"acecode_id": "oss_12531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that contains a chunk of CSV data. The CSV data may be on a single line or across multiple lines, separated by commas and possibly containing leading or trailing whitespace. Your task is to implement a function that extracts this CSV data and returns it a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_csv_data('name, age, city\\\\nJohn, 30, New York\\\\nJane, 25, Los Angeles') == [['name', 'age', 'city'], ['John', '30', 'New York'], ['Jane', '25', 'Los Angeles']]\", \"assert extract_csv_data('product, price\\\\nApple, 1.0\\\\nBanana, 0.5') == [['p... | {
"split": "train",
"index": 74570,
"acecode_id": "bigcode_python_fns_16975",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates dealing a specified number of cards from a standard deck of playing cards. A standard deck contains 52 cards, consisting of 4 suits (Hearts, Diamonds, Clubs, Spades) and 13 ranks (2 through 10, Jack, Queen, King, Ace). ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deal_cards(5) == [{'suit': 'Hearts', 'rank': '2'}, {'suit': 'Hearts', 'rank': '3'}, {'suit': 'Hearts', 'rank': '4'}, {'suit': 'Hearts', 'rank': '5'}, {'suit': 'Hearts', 'rank': '6'}]\", \"assert deal_cards(0) == []\", \"assert len(deal_cards(52)) == 52\", \"... | {
"split": "train",
"index": 74571,
"acecode_id": "oss_560",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that extracts the value associated with the key 'percent_rsrzoutliers' from a given dictionary. If the key exists in the dictionary, the function should return its corresponding value as a float. If the key does not exist, the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_percent_rsrzoutliers({'mean': 10, 'std_dev': 2, 'percent_rsrzoutliers': 3.5}) == 3.5\", \"assert extract_percent_rsrzoutliers({'mean': 10, 'std_dev': 2}) == 0\", \"assert extract_percent_rsrzoutliers({'percent_rsrzoutliers': 0}) == 0\", \"assert extr... | {
"split": "train",
"index": 74572,
"acecode_id": "oss_13533",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a storage bucket for a cloud project. The function should accept three parameters: the project ID (a string), the bucket name (a string), and a boolean flag indicating if the bucket should have versioning en... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_storage_bucket('project-123', 'my-bucket', True) == {'name': 'my-bucket', 'project_id': 'project-123', 'versioning_enabled': True}\", \"assert create_storage_bucket('project-456', 'another-bucket', False) == {'name': 'another-bucket', 'project_id': 'p... | {
"split": "train",
"index": 74573,
"acecode_id": "bigcode_python_fns_25065",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `strange_sort_list_bst(lst)` that sorts the list in a specific order. The function should alternate between the smallest and largest remaining elements in the list until all elements are sorted. If there are duplicates, they should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert strange_sort_list_bst([1, 2, 3, 4]) == [1, 4, 2, 3]\", \"assert strange_sort_list_bst([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert strange_sort_list_bst([2, 1, 3, -1]) == [-1, 3, 1, 2]\", \"assert strange_sort_list_bst([10, 20, 30, 40]) == [10, 40, 20, 30]\", \... | {
"split": "train",
"index": 74574,
"acecode_id": "evol_11390",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that identifies the type of quadrilateral characterized by the angles A, B, C, and D. The function should be able to handle any four angles given as inputs, validate whether those angles form a valid quadrilateral, and return the type of the quadrilateral. Con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_quad(90, 90, 90, 90) == 'Square'\", \"assert determine_quad(100, 80, 100, 80) == 'Parallelogram'\", \"assert determine_quad(80, 80, 100, 100) == 'Other'\", \"assert determine_quad(91.5, 91.5, 91.5, 85.5) == 'Other'\", \"assert determine_quad(60, 12... | {
"split": "train",
"index": 74575,
"acecode_id": "evol_10061",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a user's authentication token. The function should take three parameters: an integer `http_status_code`, a string `message`, and a string `token`. It returns a JSON response containing the status code, message, and toke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_token(200, 'Token is valid', 'valid_token') == {'status_code': 200, 'message': 'Token is valid', 'token': 'valid_token'}\", \"assert validate_token(401, 'Invalid token', '') == {'status_code': 401, 'message': 'Invalid token', 'token': ''}\", \"asser... | {
"split": "train",
"index": 74576,
"acecode_id": "oss_16868",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_unique_and_recurring_items(list_items)` that takes a list of integers `list_items` as input and returns a dictionary containing two keys: 'unique' and 'recurring'. The 'unique' key should map to a list of elements that appear exactly once in the inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_and_recurring_items([1, 2, 3, 2, 3]) == {'unique': [1], 'recurring': {2: 2, 3: 2}}\", \"assert count_unique_and_recurring_items([4, 5, 4, 6, 6, 6]) == {'unique': [5], 'recurring': {4: 2, 6: 3}}\", \"assert count_unique_and_recurring_items([7, 8,... | {
"split": "train",
"index": 74577,
"acecode_id": "evol_6363",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a user account management system using Python. You need to create a function `manage_users(operations: List[Tuple[str, Union[str, None]]]) -> Tuple[int, List[str]]` that processes a list of user operations and returns the total number of registe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_users([('register', 'alice', 'alice@example.com'), ('register', 'bob', 'bob@example.com')]) == (2, [])\", \"assert manage_users([('register', 'charlie', 'charlie@example.com'), ('get', 'charlie')]) == (1, ['charlie@example.com'])\", \"assert manage_us... | {
"split": "train",
"index": 74578,
"acecode_id": "oss_37737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a Python function `get_sum_of_numbers(list_numbers: List[int]) -> Union[int, str]` that accepts a single parameter in the form of a list of integers. If the list is empty, it should return an appropriate error message. If the list contains integers, it should return the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sum_of_numbers([]) == 'List not set yet.'\", \"assert get_sum_of_numbers([1, 2, 3]) == 6\", \"assert get_sum_of_numbers([-1, -2, -3]) == -6\", \"assert get_sum_of_numbers([0]) == 0\", \"assert get_sum_of_numbers([10, 20, 30]) == 60\", \"assert get_sum_of... | {
"split": "train",
"index": 74579,
"acecode_id": "evol_13322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of integers and returns a new list containing only the even numbers from the original list. The function should also maintain the order of the even numbers as they appeared in the original list. Write a function calle... | 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, -4, -1]) == [0, -2, -4]\", \"assert filter_even_numbers([5, 7, 9]) == []\", \"assert filter_even_numbers([]) ... | {
"split": "train",
"index": 74580,
"acecode_id": "oss_5682",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the process of splitting a dataset into training and testing subsets based on a specified proportion. The input will be a list of samples (represented as tuples of feature values) and a list of corresponding labels. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_dataset([(1,), (2,), (3,), (4,), (5,)], ['a', 'b', 'c', 'd', 'e'], 0.6) == ([(1,), (2,), (3,)], ['a', 'b', 'c'], [(4,), (5,)], ['d', 'e'])\", \"assert split_dataset([(1,), (2,), (3,), (4,), (5,)], ['a', 'b', 'c', 'd', 'e'], 0.8) == ([(1,), (2,), (3,), ... | {
"split": "train",
"index": 74581,
"acecode_id": "bigcode_python_fns_962",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `create_resnet101_model(num_classes: int) -> str` that constructs a description of a ResNet-101 model. The function takes an integer `num_classes`, which represents the number of output classes for the model. The function should return a string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_resnet101_model(10) == 'ResNet-101 with 10 classes'\", \"assert create_resnet101_model(5) == 'ResNet-101 with 5 classes'\", \"assert create_resnet101_model(100) == 'ResNet-101 with 100 classes'\", \"assert create_resnet101_model(50) == 'ResNet-101 wit... | {
"split": "train",
"index": 74582,
"acecode_id": "bigcode_python_fns_14623",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if two persons have the same ID. The function should take in two dictionaries representing persons, each containing attributes 'name', 'age', and 'id'. The function should return True if the IDs are equal, and False otherwise.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_persons_equal({'name': 'Alice', 'age': 25, 'id': 123}, {'name': 'Bob', 'age': 30, 'id': 123}) == True\", \"assert are_persons_equal({'name': 'Charlie', 'age': 28, 'id': 456}, {'name': 'David', 'age': 35, 'id': 789}) == False\", \"assert are_persons_equal... | {
"split": "train",
"index": 74583,
"acecode_id": "oss_7728",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, determine which integers among them must be factors of a specific integer that terminates with the digit zero and whose sum of digits is a multiple of 3. Implement a function `find_factors` that accepts a list of integers and returns a list of those in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_factors([2, 3, 4, 5, 6, 8, 9]) == [2, 3, 5, 6]\", \"assert find_factors([9, 6]) == [6]\", \"assert find_factors([6, 8, 10, 11]) == [6, 10]\", \"assert find_factors([11, 13, 17]) == []\", \"assert find_factors([18, 24, 30]) == [30]\", \"assert find_facto... | {
"split": "train",
"index": 74584,
"acecode_id": "evol_19326",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and two integer values, minval and maxval, implement a function that checks whether all integers in the list fall within the inclusive range defined by minval and maxval. The function should return True if all integers are within the range, and False ot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_bounds([1, 2, 3, 4, 5], 1, 5) == True\", \"assert check_bounds([1, 2, 3, 4, 5], 0, 5) == True\", \"assert check_bounds([1, 2, 3, 4, 5], 1, 6) == True\", \"assert check_bounds([1, 2, 3, 4, 5], 2, 4) == False\", \"assert check_bounds([7, 8, 9], 5, 10) ==... | {
"split": "train",
"index": 74585,
"acecode_id": "bigcode_python_fns_4457",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, implement a function `cumulative_factorial_sum(n)` that computes the cumulative total of the factorial values of all prime numbers within the range of 1 through to and including n. The function should return this total as an integer.\nPlease reason step by s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cumulative_factorial_sum(1) == 0\", \"assert cumulative_factorial_sum(2) == 2\", \"assert cumulative_factorial_sum(3) == 8\", \"assert cumulative_factorial_sum(4) == 8\", \"assert cumulative_factorial_sum(5) == 128\", \"assert cumulative_factorial_sum(6) == ... | {
"split": "train",
"index": 74586,
"acecode_id": "evol_17117",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the first n prime numbers without using the standard library or any in-built methods for prime calculations. The function should accept an integer n and return a list containing the first n prime numbers. If n is less than 1, the function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_first_n_primes(1) == [2]\", \"assert get_first_n_primes(2) == [2, 3]\", \"assert get_first_n_primes(3) == [2, 3, 5]\", \"assert get_first_n_primes(4) == [2, 3, 5, 7]\", \"assert get_first_n_primes(5) == [2, 3, 5, 7, 11]\", \"assert get_first_n_primes(6) ... | {
"split": "train",
"index": 74587,
"acecode_id": "evol_33308",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `lowest_prime(numbers)` that returns the lowest prime number in the list. If there are no prime numbers, the function should return None.\nPlease reason step by step, then write a self-contained Python solution. Give your final pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lowest_prime([33, 49, 9, 5, 99]) == 5\", \"assert lowest_prime([4, 6, 8, 10]) == None\", \"assert lowest_prime([2, 3, 5, 7]) == 2\", \"assert lowest_prime([10, 15, 20, 21]) == None\", \"assert lowest_prime([11, 13, 17, 19]) == 11\", \"assert lowest_prime([50... | {
"split": "train",
"index": 74588,
"acecode_id": "evol_23967",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `greet_to(name)` that takes a single parameter `name`. The function should validate that `name` is a string. If `name` is not a string, it should raise a ValueError with the message 'name must be a string'. If `name` is a string, the function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet_to('Alice') == 'Hello, Alice!'\", \"assert greet_to('Bob') == 'Hello, Bob!'\", \"assert greet_to('Charlie') == 'Hello, Charlie!'\", \"assert greet_to('Diana') == 'Hello, Diana!'\", \"assert greet_to('Eve') == 'Hello, Eve!'\", \"assert greet_to('Frank')... | {
"split": "train",
"index": 74589,
"acecode_id": "evol_18942",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, return a vocabulary dictionary that contains words as keys and their frequencies as values. The function should filter out words that occur less than a specified minimum frequency. The output should be sorted first by frequency (in descending order) and t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_vocab(['apple', 'banana', 'apple', 'orange', 'banana', 'banana'], 2, 0) == {'banana': 3, 'apple': 2}\", \"assert build_vocab(['apple', 'banana', 'apple', 'orange', 'banana', 'banana'], 4, 0) == {}\", \"assert build_vocab(['apple', 'banana', 'apple', 'o... | {
"split": "train",
"index": 74590,
"acecode_id": "bigcode_python_fns_4574",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_sum(numbers: List[int]) -> int` that takes a list of integers as input and returns the sum of all the integers in the list using a traditional for loop. Additionally, implement a mechanism to emulate a do-while loop to achieve the same result. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum([0, 0, 0]) == 0\", \"assert calculate_sum([]) == 0\", \"assert calculate_sum(['a', 'b']) == 0\", \"assert calculate_sum([1, 'two', 3]) == 0\", \"assert calculate_sum([1, 2, None]) == 0\", \"assert calculate_sum([1, 2, 3, 4, 5, 6, 'x', 7]) == 0\... | {
"split": "train",
"index": 74591,
"acecode_id": "evol_13421",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of URL patterns and returns a dictionary mapping each URL path to its corresponding template name. The URL patterns are represented as a list of tuples, where each tuple contains the path and the template name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_template_mapping([('', 'index.html'), ('formulario/', 'form.html')]) == {'': 'index.html', 'formulario/': 'form.html'}\", \"assert extract_template_mapping([('/about/', 'about.html'), ('/contact/', 'contact.html')]) == {'/about/': 'about.html', '/con... | {
"split": "train",
"index": 74592,
"acecode_id": "oss_2442",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Least Recently Used (LRU) caching system in Python. Your goal is to create a function named `lru_cache` that simulates the behavior of an LRU cache. The function should take two arguments: `operations` (a list of strings representing cache ope... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lru_cache(['put 1 1', 'put 1 2', 'get 1', 'put 2 2', 'get 2'], 2) == [2, 2]\", \"assert lru_cache(['put 1 1', 'put 2 2', 'put 3 3', 'put 4 4', 'put 5 5', 'put 6 6', 'get 5', 'get 1'], 5) == [5, -1]\", \"assert lru_cache(['put 1 1', 'put 2 2', 'put 3 3', 'put... | {
"split": "train",
"index": 74593,
"acecode_id": "oss_13104",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries, `dct` and `merge_dct`. Your task is to merge `merge_dct` into `dct` recursively. If a key exists in both dictionaries and the values are also dictionaries, you should merge them recursively. If the key exists in both dictionaries but the values a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dict_merge({'a': 1, 'b': {'c': 2}}, {'b': {'d': 3}, 'e': 4}) == None and {'a': 1, 'b': {'c': 2, 'd': 3}, 'e': 4} == {'a': 1, 'b': {'c': 2, 'd': 3}, 'e': 4}\", \"assert dict_merge({'x': {'y': 1}}, {'x': {'z': 2}}) == None and {'x': {'y': 1, 'z': 2}} == {'x': ... | {
"split": "train",
"index": 74594,
"acecode_id": "bigcode_python_fns_24876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of items in different workspaces. Your task is to implement a function that takes this list and an integer 'operation_id', and returns the total number of items in the first 'operation_id' workspaces. If 'operation_id' ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_items([1, 2, 3, 4], 2) == 3\", \"assert get_total_items([10, 20, 30], 1) == 10\", \"assert get_total_items([5], 0) == 0\", \"assert get_total_items([1, 1, 1, 1, 1], 5) == 5\", \"assert get_total_items([], 2) == 0\", \"assert get_total_items([4, 5, ... | {
"split": "train",
"index": 74595,
"acecode_id": "bigcode_python_fns_29552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `simulate_queue(operations: List[Tuple[str, Optional[int]]]) -> List[Union[int, str]]` that simulates a queue based on a list of operations. The `operations` list contains tuples where the first element is a string representing the operation ('e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_queue([('enqueue', 1), ('enqueue', 2), ('size', None)]) == [None, None, 2]\", \"assert simulate_queue([('dequeue', None)]) == ['Queue is empty']\", \"assert simulate_queue([('enqueue', 3), ('size', None)]) == [None, 1]\", \"assert simulate_queue([('... | {
"split": "train",
"index": 74596,
"acecode_id": "oss_24587",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating SQL create table statements for a blogging application. Implement a function called `generate_create_statements()` that creates two SQL statements: one for creating an 'articles' table and another for creating a 'category' table. The 'articles' ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_create_statements() == ['CREATE TABLE articles (id INTEGER PRIMARY KEY AUTOINCREMENT, slug CHAR(100) NOT NULL UNIQUE, cat_id INT, title NCHAR(100) NOT NULL, md_content TEXT NOT NULL, html_content TEXT NOT NULL, author NCHAR(30) NOT NULL, time TIMEST... | {
"split": "train",
"index": 74597,
"acecode_id": "bigcode_python_fns_38054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `check_if_factorial(input_number: int) -> bool` that checks if the given `input_number` can be expressed as the factorial of a non-negative integer. Return `True` if it can be expressed as a factorial, otherwise return `False`. For example, `check_if_factorial(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_if_factorial(1) == True\", \"assert check_if_factorial(2) == True\", \"assert check_if_factorial(6) == True\", \"assert check_if_factorial(24) == True\", \"assert check_if_factorial(120) == True\", \"assert check_if_factorial(720) == True\", \"assert c... | {
"split": "train",
"index": 74598,
"acecode_id": "evol_14209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `u` and an integer `N`, write a function `closest_product(u, N)` that finds the pair of distinct elements in the array `u` whose product is closest to the integer `N`. If there are multiple pairs with the same absolute difference from `N`, return the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert closest_product([1, 2, 3, 4, 5], 10) == [2, 5]\", \"assert closest_product([1, 2, 3, 4, 5], 12) == [3, 4]\", \"assert closest_product([10, 15, 20, 25], 300) == [15, 20]\", \"assert closest_product([1, 3, 5, 7], 20) == [3, 7]\", \"assert closest_product([1, 1... | {
"split": "train",
"index": 74599,
"acecode_id": "oss_32658",
"num_tests": 15
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.