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 dictionary that represents HTTP request parameters. Your task is to implement a function that retrieves the value of a specific key, denoted by `affiliate_code_key`, from the dictionary if it exists. If the key does not exist, return None. Additionally, if the r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_affiliate_code({'method': 'GET', 'GET': {'affiliate_code': 'ABC123'}}, 'affiliate_code') == 'ABC123'\", \"assert get_affiliate_code({'method': 'GET', 'GET': {'affiliate_code': 'XYZ789'}}, 'affiliate_code') == 'XYZ789'\", \"assert get_affiliate_code({'met... | {
"split": "train",
"index": 4900,
"acecode_id": "bigcode_python_fns_26185",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a plugin registration system for a media streaming service. The service allows various plugins to be registered, each serving a specific purpose such as content filtering, recommendation algorithms, etc. Your task is to implement a function `reg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_and_reject_plugins([('imdb_required', 'FilterImdbRequired', 2)]) == []\", \"assert register_and_reject_plugins([('video_filter', 'ContentFilter', 1)]) == [('video_filter', 'ContentFilter', 1)]\", \"assert register_and_reject_plugins([('audio_filter'... | {
"split": "train",
"index": 4901,
"acecode_id": "oss_9013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that computes the variance of the elements in the list. The variance is defined as the average of the squared differences from the mean. Implement a function `calculate_variance(nums: List[int]) -> float` that takes a list of integers ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_variance([1, 2, 3, 4, 5]) == 2.0\", \"assert calculate_variance([1, 1, 1, 1, 1]) == 0.0\", \"assert calculate_variance([5, 5, 5, 5, 5]) == 0.0\", \"assert calculate_variance([0]) == 0.0\", \"assert calculate_variance([1, 2]) == 0.25\", \"assert cal... | {
"split": "train",
"index": 4902,
"acecode_id": "bigcode_python_fns_28739",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `increase(rank: int) -> int` that increases a user's rank in a gaming application. The function should take the user's current rank as input and return the new rank after increasing it by 5. Your implementation should not require any ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert increase(0) == 5\", \"assert increase(1) == 6\", \"assert increase(5) == 10\", \"assert increase(10) == 15\", \"assert increase(100) == 105\", \"assert increase(-5) == 0\", \"assert increase(-10) == -5\", \"assert increase(3) == 8\", \"assert increase(20) ==... | {
"split": "train",
"index": 4903,
"acecode_id": "oss_31065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two binary strings as input and returns their sum as a binary string. The function should not use any built-in binary conversion functions. The binary strings may be of different lengths.\nPlease reason step by step, then write a self-contained P... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binarySum('101', '110') == '1011'\", \"assert binarySum('0', '0') == '0'\", \"assert binarySum('1', '1') == '10'\", \"assert binarySum('111', '1') == '1000'\", \"assert binarySum('1010', '1011') == '10101'\", \"assert binarySum('1111', '1111') == '11110'\", ... | {
"split": "train",
"index": 4904,
"acecode_id": "evol_20792",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two DNA sequences represented as strings, implement a function that aligns the two sequences using global alignment with the following scoring scheme: a match score of 5, a mismatch score of -4, a gap opening penalty of 10, and a gap extension penalty of 1. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert global_align('ACGT', 'ACG') == ('ACGT', 'ACG-')\", \"assert global_align('A', 'A') == ('A', 'A')\", \"assert global_align('AA', 'AA') == ('AA', 'AA')\", \"assert global_align('A', '') == ('A', '-')\", \"assert global_align('', 'A') == ('-', 'A')\", \"assert ... | {
"split": "train",
"index": 4905,
"acecode_id": "bigcode_python_fns_45143",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the login process of a user to a social media platform. The function `login_user` takes in a username, a password, a user agent, a client secret, and a client ID as input parameters. It should return a string that indicates... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login_user('user123', 'pass456', 'my_user_agent', 'my_client_secret', 'my_client_id') == 'Login successful as user123'\", \"assert login_user('user123', 'wrong_password', 'my_user_agent', 'my_client_secret', 'my_client_id') == 'Login failed'\", \"assert logi... | {
"split": "train",
"index": 4906,
"acecode_id": "bigcode_python_fns_27396",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement the function `find_palindromes(strings: List[str]) -> List[str]` that returns a new list containing only the strings that are palindromes. A palindrome is a sequence of characters that reads the same forward and backward, ignoring spaces, punc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_palindromes(['level', 'radar', 'hello', '12321']) == ['level', 'radar', '12321']\", \"assert find_palindromes(['A man, a plan, a canal, Panama', 'not a palindrome', 'Was it a car or a cat I saw?']) == ['A man, a plan, a canal, Panama', 'Was it a car or ... | {
"split": "train",
"index": 4907,
"acecode_id": "oss_27616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a session management system for a web application. The system needs to compare a list of scraped session IDs with a list of existing session IDs and return a list of unaccounted session IDs. If there are no unaccounted sessions, return an empty ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_sessions(['session1', 'session2', 'session3'], ['session2', 'session3', 'session4'], 'module1') == (['session1'], 'Jurisdiction A')\", \"assert manage_sessions(['session1'], ['session1'], 'module2') == ([], 'Jurisdiction B')\", \"assert manage_session... | {
"split": "train",
"index": 4908,
"acecode_id": "oss_27690",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_fibonacci(n)` that computes the Fibonacci series up to the 'n' terms. The function should handle various types of invalid inputs, including strings, negative integers, and special characters, by returning an error message. The function should als... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_fibonacci('a') == 'Error: Invalid input'\", \"assert calculate_fibonacci(-10) == 'Error: Number cannot be negative'\", \"assert calculate_fibonacci(0) == []\", \"assert calculate_fibonacci(1) == [0]\", \"assert calculate_fibonacci(2) == [0, 1]\", \... | {
"split": "train",
"index": 4909,
"acecode_id": "evol_14635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 3x3 board represented as a list of lists, where each cell can either be an integer (representing a player's move) or a string 'EMPTY' (indicating that the cell is unoccupied). Your task is to implement a function `find_empty_positions(board)` that returns a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_empty_positions([[1, 2, 'EMPTY'], [3, 'EMPTY', 5], ['EMPTY', 7, 8]]) == [(0, 2), (1, 1), (2, 0)]\", \"assert find_empty_positions([['EMPTY', 'EMPTY', 'EMPTY'], ['EMPTY', 0, 1], [2, 3, 4]]) == [(0, 0), (0, 1), (0, 2), (1, 0)]\", \"assert find_empty_posit... | {
"split": "train",
"index": 4910,
"acecode_id": "bigcode_python_fns_47735",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple registry system for components in a Python application. The system should allow components to be registered with a unique name and then retrieve the registered name for a given component. You need to implement a function `register_and_g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_and_get('component1', 'comp1') == 'comp1'\", \"assert register_and_get('component2', 'comp2') == 'comp2'\", \"assert register_and_get('component1', 'comp2') == 'comp2'\", \"assert register_and_get('component3', 'comp3') == 'comp3'\", \"assert regist... | {
"split": "train",
"index": 4911,
"acecode_id": "oss_32765",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words and a dictionary that maps words to their corresponding IDs. Your task is to create a function that converts this list of words into a list of IDs. If a word is not found in the dictionary, it is considered an out-of-vocabulary (OOV) word. Each OOV... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_words_to_ids(['hello', 'world'], {'hello': 1, 'world': 2}, 100, 2, 0) == ([1, 2], [])\", \"assert map_words_to_ids(['hello', 'unknown'], {'hello': 1}, 100, 1, 0) == ([1, 100], ['unknown'])\", \"assert map_words_to_ids(['test', 'test', 'test'], {'test': 5... | {
"split": "train",
"index": 4912,
"acecode_id": "bigcode_python_fns_23548",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python that determines if a given integer is a palindrome. A palindrome is a number that reads the same backward as forward. Your function should consider only the numeric characters of the number and ignore any potential negative sign. For example, -121... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome(121) == True\", \"assert is_palindrome(-121) == True\", \"assert is_palindrome(10) == False\", \"assert is_palindrome(12321) == True\", \"assert is_palindrome(12345) == False\", \"assert is_palindrome(0) == True\", \"assert is_palindrome(-1) ==... | {
"split": "train",
"index": 4913,
"acecode_id": "evol_26576",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `y1` and `y2`, each representing a series of values, implement a function that returns a tuple of two lists. The first list should contain the maximum values at each index between `y1` and `y2`, and the second list should contain the minimum values ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_min_series([1, 3, 2], [2, 1, 4]) == ([2, 3, 4], [1, 1, 2])\", \"assert max_min_series([5, 10, 15], [10, 5, 20]) == ([10, 10, 20], [5, 5, 15])\", \"assert max_min_series([0, -1, -2], [-1, 0, -3]) == ([0, 0, -2], [-1, -1, -3])\", \"assert max_min_series([]... | {
"split": "train",
"index": 4914,
"acecode_id": "bigcode_python_fns_39729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a command string for opening a user prompt. The function should take in a message string, a boolean indicating whether sound should be enabled, and an integer for the timeout duration. The output should be a specific format... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_user_prompt('Hello', True, 10) == b'B;UserPrompt(\\\"Hello\\\",1,10);'\", \"assert generate_user_prompt('Goodbye', False, 5) == b'B;UserPrompt(\\\"Goodbye\\\",0,5);'\", \"assert generate_user_prompt('Alert', True, -1) == b'B;UserPrompt(\\\"Alert\\\"... | {
"split": "train",
"index": 4915,
"acecode_id": "bigcode_python_fns_25925",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to place a snake in a simple snake game. The function `place_snake(x: int, y: int) -> List[int]` takes two integers as input, representing the coordinates of the snake's head on a 2D grid. The function should return a list containing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert place_snake(3, 4) == [3, 4]\", \"assert place_snake(-1, -2) == [-1, -2]\", \"assert place_snake(0, 0) == [0, 0]\", \"assert place_snake(5, 10) == [5, 10]\", \"assert place_snake(100, 200) == [100, 200]\", \"assert place_snake(-50, 25) == [-50, 25]\", \"asser... | {
"split": "train",
"index": 4916,
"acecode_id": "oss_12713",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing each integer doubled. The function should maintain the order of the input list. Implement the function `double_values(nums: List[int]) -> List[int]` where `nums` is a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert double_values([1, 2, 3]) == [2, 4, 6]\", \"assert double_values([-1, -2, -3]) == [-2, -4, -6]\", \"assert double_values([0, 0, 0]) == [0, 0, 0]\", \"assert double_values([100]) == [200]\", \"assert double_values([]) == []\", \"assert double_values([5]) == [1... | {
"split": "train",
"index": 4917,
"acecode_id": "oss_3520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that checks if a given string ends with the word 'Goodbye' and contains a date in the format 'dd-mm-yyyy' anywhere before the ending word. The function should return True if both conditions are met, and False otherwise.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_string('Today is 31-12-2021 and then we say Goodbye') == True\", \"assert match_string('The date is 15-08-2020. Goodbye') == True\", \"assert match_string('This is not a date but ends with Goodbye') == False\", \"assert match_string('Goodbye 20-10-2022... | {
"split": "train",
"index": 4918,
"acecode_id": "evol_8670",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a game environment where the outcome depends on a seed value. Write a function that takes an integer seed value and returns a string representing the initial state of the game after resetting the environment with the given seed. The initial state ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_initial_state(0) == 'State A'\", \"assert get_initial_state(1) == 'State B'\", \"assert get_initial_state(2) == 'State C'\", \"assert get_initial_state(3) == 'State D'\", \"assert get_initial_state(4) == 'State Unknown'\", \"assert get_initial_state(5) =... | {
"split": "train",
"index": 4919,
"acecode_id": "oss_28193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing a full system configuration, implement a function `map_zones(full_system: Dict[str, Any]) -> List[Dict[str, Any]]` that extracts and maps the zones from the full system. Each zone is represented as a dictionary and is found under the key 'zones' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_zones({'body': {'zones': [{'id': 1}, {'id': 2}]}}) == [{'id': 1}, {'id': 2}]\", \"assert map_zones({'body': {'zones': [{'id': 1}, None, {'id': 3}]}}) == [{'id': 1}, {'id': 3}]\", \"assert map_zones({'body': {}}) == []\", \"assert map_zones({'body': {'zon... | {
"split": "train",
"index": 4920,
"acecode_id": "bigcode_python_fns_47405",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a JSON object, implement a function that extracts the value of a nested key specified by the user. This JSON object may contain nested keys at various depths. If the key is not found, the function should return 'Key not found'. If the key exists multiple times, return a l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_values({'a': 1, 'b': {'c': 2, 'd': 3}}, 'c') == [2]\", \"assert extract_values({'a': 1, 'b': {'c': {'d': 4}}}, 'd') == [4]\", \"assert extract_values({'x': {'y': {'z': 5}}}, 'a') == 'Key not found'\", \"assert extract_values({'key': 'value', 'nested'... | {
"split": "train",
"index": 4921,
"acecode_id": "evol_19275",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a new software version is available based on the current installed version and the latest available version. Your function should take two parameters: `installed_version` (a string representing the currently installed versi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_version_update('1.0.0', '1.0.1') == True\", \"assert check_version_update('1.0.0', '1.0.0') == False\", \"assert check_version_update('1.0.1', '1.0.0') == False\", \"assert check_version_update('1.2.0', '1.3.0') == True\", \"assert check_version_update... | {
"split": "train",
"index": 4922,
"acecode_id": "bigcode_python_fns_13642",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a new string with the characters in reverse order. The function should handle empty strings and strings containing special characters correctly.\nPlease reason step by step, then write a self-contained Python solutio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('ab') == 'ba'\", \"assert reverse_string('abc') == 'cba'\", \"assert reverse_string('Hello, World!') == '!dlroW ,olleH'\", \"assert reverse_string('12345') == '54321'\... | {
"split": "train",
"index": 4923,
"acecode_id": "evol_35145",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of arrays, where each array contains integers. Write a function that merges all the arrays into a single sorted array in ascending order. The function should take a single parameter, which is a list of arrays, and return a new sorted array containing all th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_sort_array([[3, 2, 9], [8, 5, 1], [7, 6, 4]]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert merge_and_sort_array([[1, 3], [2, 4], [5]]) == [1, 2, 3, 4, 5]\", \"assert merge_and_sort_array([[5, 2], [2, 5], [5]]) == [2, 2, 5, 5, 5]\", \"assert merge_and... | {
"split": "train",
"index": 4924,
"acecode_id": "evol_20255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an n x n matrix where each of the rows and columns are sorted in ascending order, return the kth smallest element in the matrix after removing duplicates. Note that the kth smallest element is determined from the unique elements in sorted order, not the duplicates. You ma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert kthSmallest([[1,5,9],[10,11,13],[12,13,15]], 8) == 15\", \"assert kthSmallest([[1,1,1],[2,2,2],[3,3,3]], 2) == 2\", \"assert kthSmallest([[1,2,3],[4,5,6],[7,8,9]], 5) == 5\", \"assert kthSmallest([[1,3,3],[2,4,4],[5,5,5]], 4) == 4\", \"assert kthSmallest([[5... | {
"split": "train",
"index": 4925,
"acecode_id": "evol_28445",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of metadata entries and extracts specific information from them. Each metadata entry is represented as a string in the format 'key :: value'. Your function should specifically extract unique programming languages and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_languages_and_versions(['Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9']) == {'Python': '3.9'}\", \"assert extract_languages_and_versions(['Programming Language :: Java :: 11', 'Programming Language :: Java :: 8']) ==... | {
"split": "train",
"index": 4926,
"acecode_id": "oss_12638",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `ind` that contains a key 'lhn', which holds a list of lists containing nested IDs. Your task is to write a function `find_nested_ids(ind)` that takes the dictionary `ind` as input and returns a list of all the nested IDs within the 'lhn' key. If ther... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_nested_ids({'lhn': [[1001, 1002], [1003]]}) == [1001, 1002, 1003]\", \"assert find_nested_ids({'lhn': [[]]}) == []\", \"assert find_nested_ids({'lhn': []}) == []\", \"assert find_nested_ids({'lhn': [[1001]]}) == [1001]\", \"assert find_nested_ids({'lhn'... | {
"split": "train",
"index": 4927,
"acecode_id": "oss_28555",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the fitness scores for a set of genomes based on their scores and a maximum distance. Each genome is represented as a string, and the fitness score is computed by dividing the genome's score by a given maximum distance... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fitness_score(['A', 'B', 'C'], [10, 20, 30], 30) == [0.3333333333333333, 0.6666666666666666, 1.0]\", \"assert fitness_score(['A', 'B', 'C'], [0, 0, 0], 10) == [0.0, 0.0, 0.0]\", \"assert fitness_score(['A', 'B', 'C'], [10, 20, 30], 0) == [0.0, 0.0, 0.0]\", \... | {
"split": "train",
"index": 4928,
"acecode_id": "oss_3794",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_file_contents(directory: str, text: str, filename: str) -> str` that simulates creating a file in a given directory with specified content. The function should return a string that describes the action taken rather than actually c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_file_contents('/home/user', 'Hello, World!', 'notes.txt') == 'Created file notes.txt in /home/user with contents: Hello, World!'\", \"assert create_file_contents('/tmp', 'Sample text', 'data.txt') == 'Created file data.txt in /tmp with contents: Sampl... | {
"split": "train",
"index": 4929,
"acecode_id": "bigcode_python_fns_30425",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the volume and surface area of a rectangular prism given its length, width, and height. The function should take three parameters: length, width, and height, which can be any decimal value between 0.1 and 100. If any of the parameters are outsid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_volume_surf(3.0, 4.0, 5.0) == (60.0, 94.0, 3.0, 7.0710678118654755)\", \"assert calc_volume_surf(1.0, 2.0, 3.0) == (6.0, 22.0, 1.0, 3.7416573867739413)\", \"assert calc_volume_surf(100.0, 100.0, 100.0) == (1000000.0, 60000.0, 100.0, 173.20508075688772)\... | {
"split": "train",
"index": 4930,
"acecode_id": "evol_9872",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function called `date_to_unix` that takes a string date in the format 'YYYY-MM-DD' and converts it to a UNIX timestamp. The function should handle leap years correctly. If the input date is invalid, the function should return an error message indicating that the date fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert date_to_unix('2023-10-01') == 1696118400\", \"assert date_to_unix('2000-02-29') == 951782400\", \"assert date_to_unix('2016-02-29') == 1456704000\", \"assert date_to_unix('2020-12-31') == 1609372800\", \"assert date_to_unix('1970-01-01') == 0\", \"assert dat... | {
"split": "train",
"index": 4931,
"acecode_id": "evol_22316",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of integers and returns the difference between the maximum and minimum integer values in the list. If the list is empty, the function should return None.\nPlease reason step by step, then write a self-contained Python solution. Give you... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert difference_max_min([3, 5, 1, 9, 2]) == 8\", \"assert difference_max_min([10, 15, 30, 25]) == 20\", \"assert difference_max_min([-1, -5, -3]) == 4\", \"assert difference_max_min([0]) == 0\", \"assert difference_max_min([]) == None\", \"assert difference_max_m... | {
"split": "train",
"index": 4932,
"acecode_id": "evol_1549",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_xml_tags` that takes a list of strings and returns a list of strings where each input string is wrapped in XML tags. Each string should be encapsulated with the same tag name, '<tag>'. For example, if the input is ['string1', 'string2'], the output sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_xml_tags(['string1', 'string2', 'string3']) == ['<tag>string1</tag>', '<tag>string2</tag>', '<tag>string3</tag>']\", \"assert generate_xml_tags(['hello', 'world']) == ['<tag>hello</tag>', '<tag>world</tag>']\", \"assert generate_xml_tags([]) == []\"... | {
"split": "train",
"index": 4933,
"acecode_id": "evol_9455",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `canFormWord(word: str, wordSet: List[str]) -> bool` that determines if a given word can be formed by concatenating one or more words from a provided set of words. The function should take two parameters: a string `word` and a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert canFormWord('applepen', ['apple', 'pen', 'applepen', 'pine', 'pineapple']) == True\", \"assert canFormWord('pineapplepenapple', ['apple', 'pen', 'applepen', 'pine', 'pineapple']) == True\", \"assert canFormWord('apple', ['apple', 'pen', 'pine', 'pineapple'])... | {
"split": "train",
"index": 4934,
"acecode_id": "oss_7928",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing the geometry of a cylinder, implement a function `construct_capsule(geom)` that converts this geometry into a dictionary representation of a collider object. The input dictionary `geom` contains two keys: 'radius' (a float representing the radius... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_capsule({'radius': 1.0, 'length': 2.0}) == {'capsule': {'radius': 1.0, 'length': 4.0}, 'rotation': [0, 0, 0]}\", \"assert construct_capsule({'radius': 2.0, 'length': 5.0}) == {'capsule': {'radius': 2.0, 'length': 9.0}, 'rotation': [0, 0, 0]}\", \"a... | {
"split": "train",
"index": 4935,
"acecode_id": "bigcode_python_fns_22506",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of theme file names and checks if each theme name matches its corresponding file name (without the '.theme' extension). The function should take a list of strings as input, where each string is a theme file name.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_themes(['Theme.theme', 'Test.theme']) == {'theme': True, 'test': True}\", \"assert process_themes(['Example.theme', 'example.THEME']) == {'example': True}\", \"assert process_themes(['Theme1.theme', 'theme2.theme']) == {'theme1': True, 'theme2': True... | {
"split": "train",
"index": 4936,
"acecode_id": "bigcode_python_fns_24904",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with updating the properties of an isotropic plate material in a simulation program. Implement a function `update_plate_material(uid: int, propnum: int, value: float, propname: str = 'modulus') -> None` that takes in four parameters: a unique identifier for the p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_plate_material(1, 1, 200.0, 'modulus') is None\", \"assert update_plate_material(2, 2, 150.5, 'density') is None\", \"assert update_plate_material(3, 1, 300.75) is None\", \"assert update_plate_material(4, 3, 450.0, 'strength') is None\", \"assert upd... | {
"split": "train",
"index": 4937,
"acecode_id": "bigcode_python_fns_26604",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a deck of cards. Your task is to implement a function `gen_cards(deck: List[int], bottom_up: bool) -> List[int]` that generates a list of integers in the order they are removed from the deck. If `bottom_up` is True, remove cards fro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gen_cards([1, 2, 3, 4, 5], True) == [5, 4, 3, 2, 1]\", \"assert gen_cards([1, 2, 3, 4, 5], False) == [1, 2, 3, 4, 5]\", \"assert gen_cards([], True) == []\", \"assert gen_cards([], False) == []\", \"assert gen_cards([10, 20, 30], True) == [30, 20, 10]\", \"a... | {
"split": "train",
"index": 4938,
"acecode_id": "bigcode_python_fns_18737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a protein sequence, which consists of a series of characters where each character represents an amino acid. Write a function `extract_protein_sequence(protein_string: str) -> str` that takes this string as input and returns the same string as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_protein_sequence('ACDEFGHIKLMNPQRSTVWY') == 'ACDEFGHIKLMNPQRSTVWY'\", \"assert extract_protein_sequence('A') == 'A'\", \"assert extract_protein_sequence('') == ''\", \"assert extract_protein_sequence('AC') == 'AC'\", \"assert extract_protein_sequence... | {
"split": "train",
"index": 4939,
"acecode_id": "bigcode_python_fns_45543",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of transformations that need to be applied to a given list of dictionaries. Each dictionary represents a record with keys as linguistic features. Each transformation is represented as a tuple, where the first element is a transformation function, the second... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert applyTransforms([{'token': 'apple', 'count': 5}], [(lambda x: x * 2, 'doubleCount', 'count')]) == [{'token': 'apple', 'count': 10}]\", \"assert applyTransforms([{'token': 'banana', 'count': 3}], [(lambda x: x + 1, 'incrementCount', 'count')]) == [{'token': '... | {
"split": "train",
"index": 4940,
"acecode_id": "oss_23226",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `traverse_array(arr)` that takes a multi-dimensional array (list) as input and returns a flat list containing all the elements from the input array, regardless of the depth of the nested lists. The function should be able to handle arrays of arbitrary depth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert traverse_array([[1,2],[3,4,[5,6,7],8],9]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert traverse_array([1, [2, [3, 4]], 5]) == [1, 2, 3, 4, 5]\", \"assert traverse_array([[[]]]) == []\", \"assert traverse_array([[[[1]]]]) == [1]\", \"assert traverse_array([1, 2... | {
"split": "train",
"index": 4941,
"acecode_id": "evol_20099",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the definition for a singly-linked list in Python, write a function `is_palindrome` that takes in the head of a singly-linked list and returns a boolean indicating whether the linked list is a palindrome. A linked list is considered a palindrome if the values read the sam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome(ListNode(1, ListNode(2, ListNode(2, ListNode(1))))) == True\", \"assert is_palindrome(ListNode(1, ListNode(2, ListNode(3, ListNode(4))))) == False\", \"assert is_palindrome(ListNode(1, ListNode(2, ListNode(1)))) == True\", \"assert is_palindrom... | {
"split": "train",
"index": 4942,
"acecode_id": "oss_13599",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an input list of integers called `src` and a lookup table (LUT) called `lut` which is also a list of integers. Your task is to create a function `LUT(src, lut)` that returns a new list `dst` where each element in `src` is replaced by the corresponding value in `lu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert LUT([0, 2, 1, 4], [10, 20, 30]) == [10, 30, 20, -1]\", \"assert LUT([1, 3, 2], [0, 5, 10, 15]) == [5, 15, 10]\", \"assert LUT([0, 1, 2], []) == [-1, -1, -1]\", \"assert LUT([], [1, 2, 3]) == []\", \"assert LUT([5, 1, 0], [100, 200, 300]) == [-1, 200, 100]\",... | {
"split": "train",
"index": 4943,
"acecode_id": "bigcode_python_fns_37699",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining if a cached file has expired based on its last updated time and the expiration period specified. Write a function `is_expired(updated_at: str, expire_days: int) -> bool` that takes the last updated time of a cached file as a string in ISO 8601 fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_expired('2023-09-01T12:00:00', 30) == True\", \"assert is_expired('2023-09-01T12:00:00', 0) == True\", \"assert is_expired('2023-10-01T12:00:00', -1) == False\", \"assert is_expired('2023-01-01T12:00:00', 365) == True\", \"assert is_expired('2022-10-01T12... | {
"split": "train",
"index": 4944,
"acecode_id": "oss_21897",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `mux_selector(sel: bool, val1: int, val0: int) -> int` that chooses between two integer values based on a boolean selector. If `sel` is True, the function should return `val1`. If `sel` is False, it should return `val0`. The inputs are: a boolean `sel` (Tru... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mux_selector(True, 10, 5) == 10\", \"assert mux_selector(False, 10, 5) == 5\", \"assert mux_selector(True, 0, -1) == 0\", \"assert mux_selector(False, 0, -1) == -1\", \"assert mux_selector(True, 100, 200) == 100\", \"assert mux_selector(False, 100, 200) == 2... | {
"split": "train",
"index": 4945,
"acecode_id": "bigcode_python_fns_14897",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function to replace all punctuation characters in a given string with their respective ASCII values. The function should maintain the order of occurrence of these characters. For example, given the input \"hello! world?\", the output should be \"hello33 world63\"... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_special_characters('hello! world?') == 'hello33 world63'\", \"assert replace_special_characters('abc#def$ghi%') == 'abc35def36ghi37'\", \"assert replace_special_characters('') == ''\", \"assert replace_special_characters('hello, world') == 'hello44 w... | {
"split": "train",
"index": 4946,
"acecode_id": "evol_26245",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement the following function:\n\ndef can_it_soar(arr, max_weight, unique_count):\n '''\n Create a function to determine if the array 'arr', consisting of integers, can achieve flight status. For 'arr' to be able to soar, it must satisfy the following conditions: it sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_it_soar([1, 2], 5, 2) == False\", \"assert can_it_soar([3, 2, 3], 1, 2) == False\", \"assert can_it_soar([3, 2, 3], 9, 2) == True\", \"assert can_it_soar([3], 5, 1) == True\", \"assert can_it_soar([1, 1, 1, 1], 4, 1) == True\", \"assert can_it_soar([1, 2... | {
"split": "train",
"index": 4947,
"acecode_id": "evol_11563",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that removes duplicate elements and returns a list of tuples, where each tuple contains a distinct element and its count, while maintaining the original order of their first occurrences. For example, given the list [3, 4, 4, 6, 7, 7, 9... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_distinct_elements([3, 4, 4, 6, 7, 7, 9]) == [(3, 1), (4, 2), (6, 1), (7, 2), (9, 1)]\", \"assert count_distinct_elements([1, 1, 1, 1]) == [(1, 4)]\", \"assert count_distinct_elements([5, 5, 5, 6, 6, 7]) == [(5, 3), (6, 2), (7, 1)]\", \"assert count_dis... | {
"split": "train",
"index": 4948,
"acecode_id": "evol_11014",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple contains two elements: a color (represented as a string) and a label (also a string). Your task is to create a function that takes this list as input and returns a dictionary that maps each color to its corresponding label. If a c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_color_label_map([('blue', 'commercial'), ('green', 'regular broadcast'), ('#fcba03', 'playing through'), ('black', 'segment')]) == {'blue': 'commercial', 'green': 'regular broadcast', '#fcba03': 'playing through', 'black': 'segment'}\", \"assert creat... | {
"split": "train",
"index": 4949,
"acecode_id": "bigcode_python_fns_36520",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a simple web server handling GET requests. The function should accept a string input representing a URL path and return a specific text response based on the path. If the input path is the root path ('/'), t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_request('/') == 'Hello, World!'\", \"assert handle_request('/user') == 'You requested: user'\", \"assert handle_request('/item/123') == 'You requested: item/123'\", \"assert handle_request('/test') == 'You requested: test'\", \"assert handle_request('... | {
"split": "train",
"index": 4950,
"acecode_id": "oss_37201",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a configuration for a device. Write a function `create_device_config(name: str, address: str, *services: str) -> dict` that takes a device name, an address, and a variable number of service names. The function should return a dictionary containing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_device_config('Apple TV', '123 Apple St', 'Netflix', 'Hulu') == {'name': 'Apple TV', 'address': '123 Apple St', 'services': ['Netflix', 'Hulu']}\", \"assert create_device_config('Smart TV', '456 Smart Ave', 'YouTube') == {'name': 'Smart TV', 'address'... | {
"split": "train",
"index": 4951,
"acecode_id": "bigcode_python_fns_24303",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing animations in a user interface. Implement a function `manage_animations` that takes a list of commands and processes them. Each command is represented as a tuple where the first element is a string indicating the command type ('create' or 'cancel'),... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_animations([('create', 'fade', 1.5), ('create', 'slide', 2.0), ('cancel', 'fade')]) == {'slide': 2.0}\", \"assert manage_animations([('create', 'bounce', 0.5), ('cancel', 'bounce')]) == {}\", \"assert manage_animations([('cancel', 'zoom')]) == {}\", \... | {
"split": "train",
"index": 4952,
"acecode_id": "oss_15399",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes an XML string representing a bookstore inventory and parses it to extract details about the books. Each book contains a bookID, title, authors, price, currency, year of publication, and language. The function should create a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_bookstore('<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><bookstore><book bookID=\\\"b1\\\"><title>A Game of Thrones</title><authors><author primary=\\\"true\\\">George R. R. Martin</author></authors><price currency=\\\"USD\\\">9.99</price><publica... | {
"split": "train",
"index": 4953,
"acecode_id": "evol_28115",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an integer array `nums`, find the maximum product that can be obtained by multiplying any two distinct elements in the array. You must implement a function `max_product(nums: List[int]) -> int` that takes in the array and returns the maximum product. If the array contains... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product([1, 2, 3, 4]) == 12\", \"assert max_product([-1, -2, -3, -4]) == 12\", \"assert max_product([-1, 2, 3, 4]) == 12\", \"assert max_product([5, 1, 2, 3]) == 15\", \"assert max_product([0, 1]) == 0\", \"assert max_product([1]) == 0\", \"assert max_pr... | {
"split": "train",
"index": 4954,
"acecode_id": "bigcode_python_fns_24350",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples representing the dimensions of geometric objects (width, height, depth). Each tuple contains three positive integers. Your task is to compute the total volume of the geometric objects that have a volume greater than a threshold value, which is als... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_volume([(2, 2, 2), (3, 3, 3)], 20) == 27\", \"assert total_volume([(1, 1, 1), (1, 1, 1)], 1) == 0\", \"assert total_volume([(5, 5, 5), (2, 2, 2)], 100) == 125\", \"assert total_volume([], 10) == 0\", \"assert total_volume([(1, 2, 3), (1, 2, 3)], 5) == ... | {
"split": "train",
"index": 4955,
"acecode_id": "bigcode_python_fns_33682",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates sending a message to a user. The function will take three parameters: a service name (a string), a user ID (a string), and the message content (a string). The function should return a dictionary representing the sent messag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_message('Gmail', 'user@example.com', 'Hello!') == {'service': 'Gmail', 'user_id': 'user@example.com', 'message': 'Hello!'}\", \"assert send_message('Slack', 'user123', 'Good morning!') == {'service': 'Slack', 'user_id': 'user123', 'message': 'Good morni... | {
"split": "train",
"index": 4956,
"acecode_id": "bigcode_python_fns_1738",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing different coverage layers for a store. Each dictionary contains the name of the store and its corresponding coverage details. Your task is to implement a function `get_coverage(store_name: str, coverage_list: List[Dict[str, Any]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_coverage('StoreA', [{'name': 'StoreA', 'details': {'coverage': 'Full'}}]) == {'name': 'StoreA', 'details': {'coverage': 'Full'}}\", \"assert get_coverage('StoreB', [{'name': 'StoreA', 'details': {'coverage': 'Full'}}, {'name': 'StoreB', 'details': {'cove... | {
"split": "train",
"index": 4957,
"acecode_id": "bigcode_python_fns_22520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a given list of integers into a list of their squares. The function should take a list of integers as input and return a new list containing the squares of each integer in the same order as they appeared in the input lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_numbers([1, 2, 3]) == [1, 4, 9]\", \"assert square_numbers([-1, -2, -3]) == [1, 4, 9]\", \"assert square_numbers([0, 1, 2]) == [0, 1, 4]\", \"assert square_numbers([0]) == [0]\", \"assert square_numbers([]) == []\", \"assert square_numbers([-5, 0, 5])... | {
"split": "train",
"index": 4958,
"acecode_id": "oss_4138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates making HTTP requests. Write a function named `make_request` that takes two parameters: `consumer` (an object with a method `_request(endpoint)` that may or may not raise an exception) and `endpoint` (a string representi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_request(consumer_with_success, 'valid/endpoint') == 'response'\", \"assert make_request(consumer_with_failure, 'invalid/endpoint') == None\", \"assert make_request(consumer_with_failure, 'yet/another/invalid/endpoint') == None\", \"assert make_request(c... | {
"split": "train",
"index": 4959,
"acecode_id": "oss_531",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that transforms each integer in the list by applying a provided transformation function. The transformation function takes a single integer as input and returns a new transformed integer. Your function should return a new list cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_list([1, 2, 3], lambda x: x * 2) == [2, 4, 6]\", \"assert transform_list([1, 2, 3], lambda x: x + 1) == [2, 3, 4]\", \"assert transform_list([4, 5, 6], lambda x: x ** 2) == [16, 25, 36]\", \"assert transform_list([], lambda x: x * 10) == []\", \"as... | {
"split": "train",
"index": 4960,
"acecode_id": "bigcode_python_fns_25563",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that contains words separated by various punctuation marks, your task is to implement a function `uniq_words(s: str, min_length: int) -> Set[str]` that extracts unique words from the string. A word is defined as a sequence of alphabetic characters, and it should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert uniq_words('?foo, \\\"bar\\\", FOO: $fa,', 0) == {'foo', 'bar', 'fa'}\", \"assert uniq_words('?foo, \\\"bar\\\", FOO: $fa,', 3) == {'foo', 'bar'}\", \"assert uniq_words('%Apple.; -Pear. ;bANAna!!!', 0) == {'apple', 'pear', 'banana'}\", \"assert uniq_words('%... | {
"split": "train",
"index": 4961,
"acecode_id": "bigcode_python_fns_42186",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function `find_maximum_sum(arr: List[int]) -> int` that returns the maximum possible sum of any contiguous subarray within the given list. A contiguous subarray is defined as a sequence of elements that are adjacent in the array. Your f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum_sum([1, 2, 3, 4]) == 10\", \"assert find_maximum_sum([-1, -2, -3, -4]) == -1\", \"assert find_maximum_sum([1, -2, 3, 4, -1]) == 7\", \"assert find_maximum_sum([5, -1, 2, 3, -4, 2]) == 9\", \"assert find_maximum_sum([0, 0, 0, 0]) == 0\", \"assert... | {
"split": "train",
"index": 4962,
"acecode_id": "bigcode_python_fns_49581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that computes the geometric mean of two ordered sequences, which may contain integers, decimals, and None values. The function should exclude any None values before calculating the geometric mean. If both sequences are empty or contain only None values, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert geometric_mean([], [1.5, None, 2.5]) == 1.9364916731037085\", \"assert geometric_mean([None, None], [None, None]) == None\", \"assert geometric_mean([1, 2, None], []) == 1.4142135623730951\", \"assert geometric_mean([3, 6], [None, None, None]) == 4.242640687... | {
"split": "train",
"index": 4963,
"acecode_id": "evol_28787",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given an integer 'code' that represents various sensor statuses in a system. Each status is represented by a specific bit in the integer. Your task is to implement a function 'get_sensor_status' that returns a string indicating which sensors are active based on the prov... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sensor_status(0x00) == 'No active sensors'\", \"assert get_sensor_status(0x01) == 'A/d sensor read'\", \"assert get_sensor_status(0x02) == 'Temperature sensor read'\", \"assert get_sensor_status(0x60) == 'Water present'\", \"assert get_sensor_status(0x05... | {
"split": "train",
"index": 4964,
"acecode_id": "bigcode_python_fns_24485",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that generates all possible subsequences of a specified length from a given list of integers. A subsequence is defined as a sequence derived from another sequence where elements are selected without changing the order but not n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_subsequences([1, 2, 3, 4], 2) == [(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)]\", \"assert generate_subsequences([5, 6, 7], 1) == [(5,), (6,), (7,)]\", \"assert generate_subsequences([1, 2, 3], 3) == [(1, 2, 3)]\", \"assert generate_subsequences(... | {
"split": "train",
"index": 4965,
"acecode_id": "oss_18711",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numerical values representing measurements for different entities. Each measurement is associated with a specific entity and a key. Your task is to implement a function that calculates the average measurement for each entity based on the provided list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_measurements([('A', 'temp', 20.0), ('A', 'temp', 30.0), ('B', 'temp', 25.0)]) == {'A': 25.0, 'B': 25.0}\", \"assert calculate_average_measurements([('A', 'temp', 10.0), ('A', 'temp', 10.0), ('A', 'temp', 10.0)]) == {'A': 10.0}\", \"assert c... | {
"split": "train",
"index": 4966,
"acecode_id": "bigcode_python_fns_4084",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that determines the relationship between two given integers. Write a Python function `compare_numbers(num1, num2)` that takes two integer parameters, `num1` and `num2`, and returns one of the following messages based on their relationship:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_numbers(5, 3) == 'Primeiro valor MAIOR.'\", \"assert compare_numbers(2, 7) == 'Segundo valor MAIOR.'\", \"assert compare_numbers(4, 4) == 'Os dois valores s\\u00e3o iguais.'\", \"assert compare_numbers(10, 10) == 'Os dois valores s\\u00e3o iguais.'\"... | {
"split": "train",
"index": 4967,
"acecode_id": "oss_17936",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid representing a geographical area where each cell can either be land or sea. The grid is represented as a list of lists of boolean values, where True indicates land and False indicates sea. Your task is to implement a function `get_land_sea_mask(grid: Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_land_sea_mask([[True, False], [False, True]]) == [[True, False], [False, True]]\", \"assert get_land_sea_mask([[False, False], [False, False]]) == [[False, False], [False, False]]\", \"assert get_land_sea_mask([[True, True], [True, True]]) == [[True, Tru... | {
"split": "train",
"index": 4968,
"acecode_id": "bigcode_python_fns_26739",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string or an iterable of strings and returns a single string where each individual string is separated by a newline character. If the input is a callable that returns an iterable of strings, the function should call this call... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_strings('Hello World') == 'Hello World'\", \"assert combine_strings(['Hello', 'World']) == 'Hello\\\\nWorld'\", \"assert combine_strings(lambda: iter(['Hello', 'World'])) == 'Hello\\\\nWorld'\", \"assert combine_strings([]) == ''\", \"assert combine_... | {
"split": "train",
"index": 4969,
"acecode_id": "bigcode_python_fns_17917",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function `execute_query(db_filename: str, query: str) -> List[Tuple]:` that takes a database filename and a SQL query as input, executes the query on the SQLite database located at the provided filename, and returns the results of the query as a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_query('mydb.sqlite', 'SELECT * FROM mytable') == []\", \"assert execute_query('mydb.sqlite', 'SELECT * FROM mytable WHERE name = ?',['John']) == []\", \"assert execute_query('mydb.sqlite', 'SELECT id, name FROM mytable WHERE address = ?',['Invalid Ad... | {
"split": "train",
"index": 4970,
"acecode_id": "evol_4631",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function to remove all duplicate strings while maintaining the original order of occurrence. Additionally, return a dictionary containing the strings that were removed and their counts. The function should return a tuple containing the new list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates(['a', 'b', 'c', 'a', 'b', 'c', 'd']) == (['a', 'b', 'c', 'd'], {'a': 1, 'b': 1, 'c': 1})\", \"assert remove_duplicates(['apple', 'banana', 'apple', 'orange', 'banana', 'kiwi']) == (['apple', 'banana', 'orange', 'kiwi'], {'apple': 1, 'banana... | {
"split": "train",
"index": 4971,
"acecode_id": "evol_25017",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an input that can be a single numeric value, a tuple, or an iterable (like list), implement a function that converts this input into a list of floating-point numbers according to the following rules: \n\n1. If the input is a single numeric value, return a list containing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unpack_condition(5) == [5.0]\", \"assert unpack_condition((3,)) == [3.0]\", \"assert unpack_condition((1, 5)) == [1.0, 2.0, 3.0, 4.0]\", \"assert unpack_condition((2, 10, 2)) == [2.0, 4.0, 6.0, 8.0]\", \"assert unpack_condition([1, 2, 3]) == [1.0, 2.0, 3.0]\... | {
"split": "train",
"index": 4972,
"acecode_id": "bigcode_python_fns_22942",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the maximum sum of any contiguous subarray of the list. A contiguous subarray is defined as any subsequence of the array where all elements are consecutive. For example, for the input list [1, -2, 3, 4, -1], the maximum su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, -2, 3, 4, -1]) == 7\", \"assert max_subarray_sum([-2, -3, -1]) == -1\", \"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]) == 10\", \"assert m... | {
"split": "train",
"index": 4973,
"acecode_id": "bigcode_python_fns_30483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `all_current_members` that returns a list of strings representing the members of a group. Each member's name must be unique and should be returned in lexicographical order. The function should not accept any parameters. Your implementatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert all_current_members() == ['Alice', 'Bob', 'Charlie', 'Diana', 'Ethan']\", \"assert all_current_members() != ['Ethan', 'Diana', 'Charlie', 'Bob', 'Alice']\", \"assert len(all_current_members()) == 5\", \"assert 'Alice' in all_current_members()\", \"assert 'Bo... | {
"split": "train",
"index": 4974,
"acecode_id": "bigcode_python_fns_10750",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a bounding box represented by its coordinates in the form of a list [x_min, y_min, x_max, y_max] and a list of prior bounding boxes, each represented in the same format, calculate the Intersection over Union (IoU) for the given bounding box with respect to each of the pri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_intersection_over_union([0, 0, 1, 1], [[1, 1, 2, 2]]) == [0.0]\", \"assert calculate_intersection_over_union([1, 1, 2, 2], [[0, 0, 1, 1], [1, 1, 2, 2]]) == [0.0, 1.0]\", \"assert calculate_intersection_over_union([0, 0, 1, 1], [[0, 0, 1, 2]]) == [0... | {
"split": "train",
"index": 4975,
"acecode_id": "bigcode_python_fns_13617",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function `find_next_mersenne_prime(n)` that returns the next Mersenne prime number greater than n. A Mersenne prime is defined as a prime number that can be expressed in the form 2^p - 1, where p is a prime number. If there is no Mersenne prime great... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_next_mersenne_prime(2) == 3\", \"assert find_next_mersenne_prime(3) == 7\", \"assert find_next_mersenne_prime(4) == 7\", \"assert find_next_mersenne_prime(7) == 31\", \"assert find_next_mersenne_prime(15) == 31\", \"assert find_next_mersenne_prime(31) =... | {
"split": "train",
"index": 4976,
"acecode_id": "evol_3164",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of instructions related to loading configurations for a graphical user interface (GUI). Each instruction is represented as a string in the format 'key=value', where 'key' is one of the following: 'FP', 'FT', 'PE'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_instructions(['FP=10', 'NC=1', 'FP=20', 'CROP=5:5']) == {'FP': [10, 20], 'NC': [1], 'CROP': ['5:5'], 'FT': [], 'PE': [], 'ES': [], 'CO': [], 'CBG': [], 'SBG': []}\", \"assert process_instructions(['FT=5', 'PE=3', 'ES=4']) == {'FP': [], 'NC': [], 'CRO... | {
"split": "train",
"index": 4977,
"acecode_id": "bigcode_python_fns_763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two 2D points represented as tuples (x1, y1) and (x2, y2), write a function that calculates the squared distance between the two points. The squared distance is defined as (x2 - x1)^2 + (y2 - y1)^2. Implement the function `calc_squared_distance(point1: Tuple[int, int], po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_squared_distance((0, 0), (3, 4)) == 25\", \"assert calc_squared_distance((1, 1), (1, 1)) == 0\", \"assert calc_squared_distance((-1, -1), (1, 1)) == 8\", \"assert calc_squared_distance((2, 3), (5, 7)) == 25\", \"assert calc_squared_distance((10, 10), (1... | {
"split": "train",
"index": 4978,
"acecode_id": "bigcode_python_fns_40000",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that determines the country of a given latitude and longitude tuple based on predefined coordinate boundaries for several countries. The function should take in the latitude and longitude as input parameters and return the correspo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_country_from_coordinates(37.0902, -95.7129) == 'USA'\", \"assert get_country_from_coordinates(56.1304, -106.3468) == 'Canada'\", \"assert get_country_from_coordinates(23.6345, -102.5528) == 'Mexico'\", \"assert get_country_from_coordinates(20.0, -70.0) =... | {
"split": "train",
"index": 4979,
"acecode_id": "oss_20197",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Create a function that accepts two lists of strings. The function should return the list with the lesser total count of characters across all the strings in each list (excluding blank spaces), while preserving the original sequence of elements in the lists. Additionally, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enhanced_match([], []) == []\", \"assert enhanced_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) == ['hi', 'admin']\", \"assert enhanced_match(['apple', 'banana'], ['Banana', 'APPLE', 'mango']) == ['apple', 'banana']\", \"assert enhanced_match(['ca... | {
"split": "train",
"index": 4980,
"acecode_id": "evol_8023",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a dictionary of values and returns a formatted string. The function should take in two parameters: `values`, a dictionary containing key-value pairs, and `show_all`, a boolean value. If `show_all` is `True`, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_values({'a': 1, 'b': 2, 'c': 3}, True) == '[Values]\\\\n a = 1\\\\n b = 2\\\\n c = 3'\", \"assert format_values({'x': 10, 'y': 20}, True) == '[Values]\\\\n x = 10\\\\n y = 20'\", \"assert format_values({'name': 'Alice'}, True) == '... | {
"split": "train",
"index": 4981,
"acecode_id": "oss_1705",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `format_host` that takes a string `host` representing a hostname and formats it to ensure it follows specific rules. The rules are: 1) If the string does not contain 'http' and '//' but has a trailing '/', prepend 'http://' to the string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_host('example.com/') == 'http://example.com'\", \"assert format_host('example.com') == 'http://example.com'\", \"assert format_host('http://example.com/') == 'http://example.com'\", \"assert format_host('http://example.com') == 'http://example.com'\",... | {
"split": "train",
"index": 4982,
"acecode_id": "bigcode_python_fns_16318",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_max_product(nums: List[int]) -> int` that returns the maximum product that can be obtained by multiplying any two distinct integers from the list. If the list contains fewer than two integers, return 0. The function should handle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_product([1, 2, 3, 4]) == 12\", \"assert find_max_product([0, 0, 0]) == 0\", \"assert find_max_product([1]) == 0\", \"assert find_max_product([5, 20]) == 100\", \"assert find_max_product([-5, -1, 0, 1, 2]) == 5\", \"assert find_max_product([3, 7, 1, ... | {
"split": "train",
"index": 4983,
"acecode_id": "bigcode_python_fns_12701",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given two rectangles defined by their bottom-left and top-right corners, calculate the Intersection over Union (IoU) of these two rectangles. Each rectangle is represented as a tuple of two tuples: the first tuple is the coordinates of the bottom-left corner, and the second tup... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert iou(((0, 0), (2, 2)), ((1, 1), (3, 3))) == 0.14285714285714285\", \"assert iou(((0, 0), (1, 1)), ((1, 1), (2, 2))) == 0.0\", \"assert iou(((0, 0), (4, 4)), ((1, 1), (3, 3))) == 0.25\", \"assert iou(((0, 0), (2, 2)), ((2, 2), (4, 4))) == 0.0\", \"assert iou((... | {
"split": "train",
"index": 4984,
"acecode_id": "bigcode_python_fns_15767",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of generation projects represented by tuples containing the following information: (generation_project, gen_min_load_fraction, gen_startup_fuel, gen_startup_om). Your task is to write a function that processes this list and returns a new list where each ele... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_generation_projects([('ProjectA', 0.5, 100.0, 20.0), ('ProjectB', 0.3, None, 15.0), ('ProjectC', 0.7, 50.0, None)]) == [{'generation_project': 'ProjectA', 'startup_costs': {'gen_startup_fuel': 100.0, 'gen_startup_om': 20.0}}, {'generation_project': '... | {
"split": "train",
"index": 4985,
"acecode_id": "bigcode_python_fns_10921",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes an original name and a list of aliases, returning a dictionary that maps each alias to the original name. An alias is considered valid if it is a case-insensitive match to the original name and contains the original ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_aliases('ctr', ['ctr', 'ctr_plugin', 'CtrFileNamePlugin', 'plugin_ctr']) == {'ctr': 'ctr', 'ctr_plugin': 'ctr', 'CtrFileNamePlugin': 'ctr', 'plugin_ctr': 'ctr'}\", \"assert find_aliases('abc', ['abc', 'abc_def', 'AbcXYZ', 'def_abc']) == {'abc': 'abc', '... | {
"split": "train",
"index": 4986,
"acecode_id": "oss_7927",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple directed graph. Your task is to implement a function `dfs_traversal` that takes a list of edges and a starting node as inputs and returns the order of nodes visited during a depth-first search (DFS) traversal of the graph starting from th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dfs_traversal([('A', 'B'), ('B', 'C'), ('C', 'A')], 'A') == ['A', 'B', 'C']\", \"assert dfs_traversal([('A', 'B'), ('B', 'C'), ('C', 'A')], 'B') == ['B', 'C', 'A']\", \"assert dfs_traversal([('A', 'B'), ('B', 'C'), ('C', 'D')], 'C') == ['C', 'D']\", \"assert... | {
"split": "train",
"index": 4987,
"acecode_id": "oss_25411",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the lengths of URLs. Your task is to create a function that determines if a URL is potentially phishing based on its length. A URL is considered potentially phishing if its length is greater than 75 characters. Write a function `is_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_phishing([60, 80, 75, 90]) == [False, True, False, True]\", \"assert is_phishing([100, 50, 80]) == [True, False, True]\", \"assert is_phishing([70, 75, 74, 76]) == [False, False, False, True]\", \"assert is_phishing([101, 102, 103]) == [True, True, True]\... | {
"split": "train",
"index": 4988,
"acecode_id": "oss_9280",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates rendering an HTML template for a web application. Write a function `render_template(template_name: str, context: dict) -> str` that takes in a string `template_name` representing the name of the HTML template and a dictiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_template('home.html', {'title': 'Welcome', 'user': 'Alice'}) == 'home.html'\", \"assert render_template('home.html', {}) == 'home.html'\", \"assert render_template('greeting.html', {'name': 'Bob'}) == 'greeting.html'\", \"assert render_template('templ... | {
"split": "train",
"index": 4989,
"acecode_id": "bigcode_python_fns_34308",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the capacities of containers. Your task is to implement a function `maxContainerVolume(containers: List[int]) -> int` that finds the maximum volume of water that can be contained between two containers. The volume is defined by the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxContainerVolume([1,8,6,2,5,4,8,3,7]) == 49\", \"assert maxContainerVolume([1,1]) == 1\", \"assert maxContainerVolume([4,3,2,1,4]) == 16\", \"assert maxContainerVolume([1,2,1]) == 2\", \"assert maxContainerVolume([1,2,4,3]) == 4\", \"assert maxContainerVol... | {
"split": "train",
"index": 4990,
"acecode_id": "bigcode_python_fns_28431",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a geometric shape with a specific type and coordinates. The dictionary has a key 'type' which can only be 'Point', 'LineString', or 'Polygon', and a key 'coordinates' which is a list of numbers representing the coordinates of the shape... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_wkt({'type': 'Point', 'coordinates': [10.2, 56.1]}) == 'POINT (10.2 56.1)'\", \"assert to_wkt({'type': 'LineString', 'coordinates': [10.2, 56.1, 20.5, 30.6]}) == 'LINESTRING (10.2 56.1, 20.5 30.6)'\", \"assert to_wkt({'type': 'Polygon', 'coordinates': [10... | {
"split": "train",
"index": 4991,
"acecode_id": "bigcode_python_fns_16827",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and an integer `n`. Your task is to implement a function that returns a new list containing every `n`-th element from the given list, starting from the first element. If `n` is greater than the length of the list, return an empty list. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_every_nth_element([1, 2, 3, 4, 5], 1) == [1, 2, 3, 4, 5]\", \"assert select_every_nth_element([1, 2, 3, 4, 5], 2) == [1, 3, 5]\", \"assert select_every_nth_element([1, 2, 3, 4, 5], 3) == [1, 4]\", \"assert select_every_nth_element([1, 2, 3, 4, 5], 4) ... | {
"split": "train",
"index": 4992,
"acecode_id": "bigcode_python_fns_20886",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_total_ram_info()` that returns the total amount of RAM installed in the system in megabytes. The function should simulate the output of the command 'free -m' which typically provides memory information in Linux. For the purpose of this function, you can as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_ram_info() == 'Total RAM: 8000 MB'\", \"assert get_total_ram_info() == 'Total RAM: 8000 MB'\", \"assert get_total_ram_info() == 'Total RAM: 8000 MB'\", \"assert get_total_ram_info() == 'Total RAM: 8000 MB'\", \"assert get_total_ram_info() == 'Total... | {
"split": "train",
"index": 4993,
"acecode_id": "evol_10513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of strings that represent messages. Each message may contain newline characters ('\\n') that should be removed. Write a function `clean_messages(messages: List[str]) -> List[str]` that takes a list of strings and returns a new list where al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_messages(['Hello\\\\nWorld', 'This is a test\\\\nmessage.']) == ['HelloWorld', 'This is a testmessage.']\", \"assert clean_messages(['Line1\\\\nLine2', 'Another line\\\\n']) == ['Line1Line2', 'Another line']\", \"assert clean_messages(['No new lines he... | {
"split": "train",
"index": 4994,
"acecode_id": "bigcode_python_fns_9247",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a dictionary representing a player's data and returns a Player object with the corresponding attributes. The Player object should contain the following attributes: id, name, is_active, level, attack, defense, speed, health, max... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_player_from_data({'id': 1, 'name': 'Alice', 'is_active': True, 'level': 5, 'attack': 10, 'defense': 8, 'speed': 12, 'health': 30, 'max_health': 30, 'experience': 100}) == Player(1, 'Alice', True, 5, 10, 8, 12, 30, 30, 100)\", \"assert create_player_fr... | {
"split": "train",
"index": 4995,
"acecode_id": "oss_17012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of skills represented as strings, and your task is to implement a function called `process_skills` that takes in this list of skills and an optional boolean parameter `table`. If `table` is set to True, the function should return a string representation of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_skills(['a', 'bb', 'ccc'], True) == 'a\\\\nbb\\\\nccc'\", \"assert process_skills(['a', 'bb', 'ccc'], False) == 'a,bb,ccc'\", \"assert process_skills(['abcd', 'def', 'a', 'xyz'], True) == 'a\\\\ndef\\\\nxyz\\\\nabcd'\", \"assert process_skills(['abcd... | {
"split": "train",
"index": 4996,
"acecode_id": "oss_7502",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with integrating financial bar data. Implement a function `integrate_bars(period: int, bars: List[Bar]) -> Bar` that takes two parameters: an integer `period` representing the period of integration and a list of `Bar` instances representing the financial bars. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert integrate_bars(1, [Bar(10, 15, 20, 100)]) == Bar(10, 15, 20, 0)\", \"assert integrate_bars(5, [Bar(10, 15, 20, 100), Bar(12, 18, 25, 50), Bar(8, 12, 22, 30), Bar(14, 20, 28, 10)]) == Bar(0, 0, 0, 0)\", \"assert integrate_bars(1, []) == Bar(0, 0, 0, 0)\", \"a... | {
"split": "train",
"index": 4997,
"acecode_id": "oss_25455",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user records where each record contains a user's ID, name, username, password, avatar URL, status, telephone, last login IP, last login time, creator ID, creation time, deletion status, role ID, and token. Your task is to implement a function that retrie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_user_by_username([{'id':'1','name':'Alice','username':'alice123','password':'pass','avatar':'url1','status':1,'telephone':'1234567890','lastLoginIp':'192.168.1.1','lastLoginTime':1634800000000,'creatorId':'admin','createTime':1634750000000,'deleted':0,'... | {
"split": "train",
"index": 4998,
"acecode_id": "bigcode_python_fns_6815",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a grid with m rows and n columns, and you are initially located at the top-left corner of the grid. Your goal is to determine the total number of unique paths to reach the bottom-right corner of the grid. In each step, you can either move down or to the right. Wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert uniquePaths(1, 1) == 1\", \"assert uniquePaths(2, 2) == 2\", \"assert uniquePaths(2, 3) == 3\", \"assert uniquePaths(3, 2) == 3\", \"assert uniquePaths(3, 3) == 6\", \"assert uniquePaths(4, 4) == 20\", \"assert uniquePaths(5, 5) == 70\", \"assert uniquePaths... | {
"split": "train",
"index": 4999,
"acecode_id": "oss_2949",
"num_tests": 14
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.