data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the balance change of a specific account after simulating a contract deployment on a blockchain network. The function will take three parameters: `hex_accounts`, a list of hexadecimal account addresses, `account_ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_balance_change_after_deployment(['0x1', '0x2', '0x3'], 0, 50) == -50\", \"assert calculate_balance_change_after_deployment(['0x1', '0x2', '0x3'], 1, 30) == -30\", \"assert calculate_balance_change_after_deployment(['0x1', '0x2', '0x3'], 2, 10) == -... | {
"split": "train",
"index": 63600,
"acecode_id": "oss_9495",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple Bayesian Binary Sensor for a home automation system. This sensor uses a prior probability and a threshold to make a binary decision about a binary event, such as motion detection or door opening. Your task is to implement a function `ba... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bayesian_sensor_decision({'prior_probability': 0.5, 'threshold': 0.6}, 0.7) == True\", \"assert bayesian_sensor_decision({'prior_probability': 0.3, 'threshold': 0.4}, 0.7) == True\", \"assert bayesian_sensor_decision({'prior_probability': 0.8, 'threshold': 0... | {
"split": "train",
"index": 63601,
"acecode_id": "oss_32193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `test_filter`, write a function `has_positive_patterns` that returns `True` if the string contains a positive pattern, defined as having a length greater than 0 and not starting with a '-' character. Otherwise, return `False`. The input string can contain any cha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_positive_patterns('') == False\", \"assert has_positive_patterns('-abc') == False\", \"assert has_positive_patterns('abc') == True\", \"assert has_positive_patterns('-') == False\", \"assert has_positive_patterns('1') == True\", \"assert has_positive_pat... | {
"split": "train",
"index": 63602,
"acecode_id": "bigcode_python_fns_44700",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `convert_base(num: int, base: int) -> str` that converts a given integer `num` from base 10 to a specified base between 2 and 16 (inclusive). The function should also handle negative numbers and return the appropriate sign with the converted number. The output ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_base(13, 8) == '15'\", \"assert convert_base(-13, 8) == '-15'\", \"assert convert_base(0, 2) == '0'\", \"assert convert_base(255, 16) == 'FF'\", \"assert convert_base(-255, 16) == '-FF'\", \"assert convert_base(10, 2) == '1010'\", \"assert convert_ba... | {
"split": "train",
"index": 63603,
"acecode_id": "evol_2626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple pipeline runner. The function takes a pipeline name and an optional context input, and it returns a string indicating the status of the pipeline execution. If the pipeline name is 'smoke', it should return 'Pip... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pipeline_runner('smoke', None) == 'Pipeline executed successfully.'\", \"assert pipeline_runner('smoke', 'test_context') == 'Pipeline executed successfully.'\", \"assert pipeline_runner('data_processing', None) == 'Pipeline not found.'\", \"assert pipeline_r... | {
"split": "train",
"index": 63604,
"acecode_id": "bigcode_python_fns_45769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, count the number of unique words in the string, considering case sensitivity and excluding punctuation. Implement a function `count_unique_words(string: str) -> int` that returns the count of unique words. For example, in the string 'Hello, Hello world!', the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_words('Hello, Hello world!') == 2\", \"assert count_unique_words('Python is great and Python is fun.') == 5\", \"assert count_unique_words('Unique words are unique.') == 4\", \"assert count_unique_words('The quick brown fox jumps over the lazy d... | {
"split": "train",
"index": 63605,
"acecode_id": "evol_17406",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `ts` and `ys`, where `ts` contains timestamps (as integers) and `ys` contains corresponding values representing the number of publications at those timestamps, write a function `format_data(ts: List[int], ys: List[int]) -> List[Tuple[str, int]]` that formats th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_data([1609459200, 1612137600], [10, 20]) == [('2021-01-01 00:00:00', 10), ('2021-02-01 00:00:00', 20)]\", \"assert format_data([1633046400], [5]) == [('2021-10-01 00:00:00', 5)]\", \"assert format_data([1609459200, 1612137600, 1614556800], [1, 2, 3]) ... | {
"split": "train",
"index": 63606,
"acecode_id": "bigcode_python_fns_40931",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `merge_sort` that takes a list of integers as input and returns a new list that contains all the elements from the input list sorted in ascending order using the merge sort algorithm.\nPlease reason step by step, then write a self-contained Python so... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == [1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]\", \"assert merge_sort([]) == []\", \"assert merge_sort([2]) == [2]\", \"assert merge_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert merge_sort([1, 2, 3, 4, 5]) == [1, 2... | {
"split": "train",
"index": 63607,
"acecode_id": "evol_29946",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `filter_maximum_value(data, maximum_value)` that filters a list of integers, returning only those integers that are less than or equal to a specified `maximum_value`. Your function should take in the following parameters: a list of in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_maximum_value([1, 5, 10], 5) == [1, 5]\", \"assert filter_maximum_value([1, 2, 3, 4], 0) == []\", \"assert filter_maximum_value([-1, 0, 1], 1) == [-1, 0, 1]\", \"assert filter_maximum_value([10, 20, 30, 25], 25) == [10, 20, 25]\", \"assert filter_maxi... | {
"split": "train",
"index": 63608,
"acecode_id": "bigcode_python_fns_37097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of strings and returns a new list containing the same strings sorted in lexicographical order. The input list may contain strings of varying lengths and characters. Do not modify the original list.\nPlease reason step by step, then write a sel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_strings(['cat', 'dog', 'bird', 'fish']) == ['bird', 'cat', 'dog', 'fish']\", \"assert organize_strings(['apple', 'banana', 'cherry']) == ['apple', 'banana', 'cherry']\", \"assert organize_strings(['zebra', 'antelope', 'lion', 'tiger']) == ['antelope... | {
"split": "train",
"index": 63609,
"acecode_id": "evol_7051",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings that represent pairs of book titles and author names alternately. However, the list may contain faulty entries where either the author's name is missing or there are consecutive book titles or author names. Your task is to implement a function th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert alphabetize_books_authors(['To Kill a Mockingbird', 'Harper Lee', 'Moby Dick', 'Herman Melville']) == (['Harper Lee', 'Herman Melville'], ['Moby Dick', 'To Kill a Mockingbird'])\", \"assert alphabetize_books_authors(['The Catcher in the Rye', 'J.D. Salinger'... | {
"split": "train",
"index": 63610,
"acecode_id": "evol_31944",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `houses` representing the locations of houses along a street, and an integer `k` representing the number of mailboxes to be allocated, implement a function that returns the minimum total distance between each house and its nearest mailbox. The mailbox... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minDistance([1, 4, 8, 10, 20], 3) == 5\", \"assert minDistance([2, 3, 5, 12, 18], 2) == 9\", \"assert minDistance([7, 4, 6, 1], 1) == 8\", \"assert minDistance([3, 6, 14, 10], 4) == 0\", \"assert minDistance([1, 2, 3, 4, 5], 2) == 3\", \"assert minDistance([... | {
"split": "train",
"index": 63611,
"acecode_id": "evol_11029",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function in Python to calculate the sum of integers within any given list without using any built-in sum function or for/while loops. The list may contain integers, lists, or other data types, and your function should only sum the integers. If the list is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recursive_sum([]) == 0\", \"assert recursive_sum([1, 2, 3]) == 6\", \"assert recursive_sum([1, 'a', 3]) == 4\", \"assert recursive_sum([[1, 2], [3, 4]]) == 10\", \"assert recursive_sum([1, [2, [3, 4]], 5]) == 15\", \"assert recursive_sum([1.5, 2, 3.5]) == 2\... | {
"split": "train",
"index": 63612,
"acecode_id": "evol_5498",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers. Your function should take in a list of integers and return a new list containing only the even integers from the original list, preserving the order of their first appearance. Create a function ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([0, -1, -2, -3, 4]) == [0, -2, 4]\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([1,... | {
"split": "train",
"index": 63613,
"acecode_id": "oss_35948",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a specific user's feed based on their user ID from a list of user objects. Each user object contains an ID and a list of feed items. Your function should return the feed items for the specified user ID. If the user ID does ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_feed([{'id': 1, 'feed': ['post1', 'post2']}, {'id': 2, 'feed': ['post3']}], 1) == ['post1', 'post2']\", \"assert get_user_feed([{'id': 1, 'feed': ['post1', 'post2']}, {'id': 2, 'feed': ['post3']}], 2) == ['post3']\", \"assert get_user_feed([{'id': 1... | {
"split": "train",
"index": 63614,
"acecode_id": "oss_35894",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `character_tracker(input_string: str) -> Tuple[Dict[str, Dict[str, Union[int, int]]], List[str]]` that takes a string as input and returns a tuple containing two elements. The first element is a dictionary where each key is a character from the input string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert character_tracker('abcABC') == ({'a': {'Count': 2, 'First Position': 0}, 'b': {'Count': 2, 'First Position': 1}, 'c': {'Count': 2, 'First Position': 2}}, ['a', 'b', 'c'])\", \"assert character_tracker('!@#$%^&*()') == ({'!': {'Count': 1, 'First Position': 0}... | {
"split": "train",
"index": 63615,
"acecode_id": "evol_34118",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given two strings, s1 and s2, and a third string, s3. Your task is to determine whether s3 can be formed by interleaving the characters of s1 and s2 in a way that maintains the left-to-right order of the characters from each string. Write a function `isInterleave(s1, s2... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isInterleave('aabcc', 'dbbca', 'aadbbcbcac') == True\", \"assert isInterleave('aabcc', 'dbbca', 'aadbbbaccc') == False\", \"assert isInterleave('aabc', 'abad', 'aabadabc') == True\", \"assert isInterleave('ab', 'bc', 'babc') == True\", \"assert isInterleave(... | {
"split": "train",
"index": 63616,
"acecode_id": "oss_21732",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `hello()` that returns the string 'Hello, World!'. This function does not take any parameters and should simply return the greeting message when called.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hello() == 'Hello, World!'\", \"assert hello() is not None\", \"assert isinstance(hello(), str)\", \"assert len(hello()) == 13\", \"assert hello().startswith('Hello')\", \"assert hello().endswith('World!')\", \"assert ' ' in hello()\", \"assert hello().count... | {
"split": "train",
"index": 63617,
"acecode_id": "evol_30918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a file path as input and returns the filename extracted from that path. Write a function named `get_filename` that implements this functionality. The input will be a string representing the file path, and the output should be a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_filename('/user/home/document.txt') == 'document.txt'\", \"assert get_filename('document.txt') == 'document.txt'\", \"assert get_filename('folder') == 'folder'\", \"assert get_filename('/user/home/.hiddenfile') == '.hiddenfile'\", \"assert get_filename('... | {
"split": "train",
"index": 63618,
"acecode_id": "oss_3919",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of video files by processing their file extensions. Write a function `process_video_files(dirs: List[str]) -> Tuple[int, int]` that takes in a list of file names represented as strings in the `dirs` variable. The function should count and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_video_files(['video1.mp4', 'video2.h264', 'video3.mp4', 'video4.mov']) == (2, 1)\", \"assert process_video_files(['clip1.mp4', 'clip2.mp4', 'clip3.mp4']) == (3, 0)\", \"assert process_video_files(['movie.h264', 'document.txt', 'image.png']) == (0, 1)... | {
"split": "train",
"index": 63619,
"acecode_id": "oss_18972",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a user joining a group in a social networking application. The function should take two inputs: a group ID (an integer) and a user ID (also an integer). The function will return a confirmation message as a string in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert join_group(1, 100) == 'User 100 has joined group 1.'\", \"assert join_group(2, 200) == 'User 200 has joined group 2.'\", \"assert join_group(3, 300) == 'User 300 has joined group 3.'\", \"assert join_group(4, 400) == 'User 400 has joined group 4.'\", \"asser... | {
"split": "train",
"index": 63620,
"acecode_id": "bigcode_python_fns_40911",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a mass spectrum with various properties, including an optional 'precursor_mz' key and a 'pepmass' key. Your task is to implement a function `add_precursor_mz(spectrum: dict) -> dict` that modifies the input dictionary in the following way... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_precursor_mz({'precursor_mz': '100.5', 'pepmass': [120.0]}) == {'precursor_mz': 100.5, 'pepmass': [120.0]}\", \"assert add_precursor_mz({'pepmass': [150.0]}) == {'pepmass': [150.0], 'precursor_mz': 150.0}\", \"assert add_precursor_mz({'precursor_mz': '50... | {
"split": "train",
"index": 63621,
"acecode_id": "bigcode_python_fns_34772",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `scale_list(nums: List[int], scale_ratio: float) -> List[int]` that scales each element in the list by a given scale ratio. The function should return a new list containing the scaled values. The scale ratio will be a float, and the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scale_list([1, 2, 3], 2.0) == [2, 4, 6]\", \"assert scale_list([-1, -2, -3], 3.0) == [-3, -6, -9]\", \"assert scale_list([100, 200, 300], 0.5) == [50.0, 100.0, 150.0]\", \"assert scale_list([10, 20], 2.5) == [25.0, 50.0]\", \"assert scale_list([1], 10.0) == ... | {
"split": "train",
"index": 63622,
"acecode_id": "bigcode_python_fns_5369",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `prime_numbers(n)` that takes a single integer `n` and returns a list of all prime numbers between 1 and `n`, inclusive. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. If there are no prim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_numbers(1) == []\", \"assert prime_numbers(2) == [2]\", \"assert prime_numbers(3) == [2, 3]\", \"assert prime_numbers(4) == [2, 3]\", \"assert prime_numbers(5) == [2, 3, 5]\", \"assert prime_numbers(6) == [2, 3, 5]\", \"assert prime_numbers(10) == [2, ... | {
"split": "train",
"index": 63623,
"acecode_id": "evol_35501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2-D array (matrix) of integers, implement a function `matrix_sums(matrix)` that returns a dictionary containing the total sum of all elements, the row-wise sums, the column-wise sums, and the sums of both diagonals (main and secondary). The output should be structured a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_sums([[1,2,3], [4,5,6], [7,8,9]]) == {'total_sum': 45, 'row_sums': [6, 15, 24], 'column_sums': [12, 15, 18], 'main_diagonal_sum': 15, 'secondary_diagonal_sum': 15}\", \"assert matrix_sums([[0,0,0], [0,0,0], [0,0,0]]) == {'total_sum': 0, 'row_sums': [0... | {
"split": "train",
"index": 63624,
"acecode_id": "evol_8757",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of strings representing file names. Your function should remove all duplicate file names from the list and return a new list containing only unique file names in the order they first appeared. Write a function `r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates(['file1.txt', 'file2.txt', 'file1.txt', 'file3.txt']) == ['file1.txt', 'file2.txt', 'file3.txt']\", \"assert remove_duplicates(['document.pdf', 'image.png', 'document.pdf', 'image.png']) == ['document.pdf', 'image.png']\", \"assert remove_d... | {
"split": "train",
"index": 63625,
"acecode_id": "oss_6286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates if a given set of user credentials is correct for accessing a secure resource. The function should take in three parameters: a username (string), a password (string), and a dictionary of valid credentials (where the keys ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_credentials('user1', 'pass1', {'user1': 'pass1', 'user2': 'pass2'}) == True\", \"assert is_valid_credentials('user1', 'wrongpass', {'user1': 'pass1', 'user2': 'pass2'}) == False\", \"assert is_valid_credentials('nonexistent', 'pass1', {'user1': 'pas... | {
"split": "train",
"index": 63626,
"acecode_id": "bigcode_python_fns_34952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a specific member's email address from a list of members based on two input parameters: the list address and the member's address. Your function should take two strings as input: the 'list_address' and the 'member_address',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_member_email('everyone@mailgun.zeefarmer.com', 'zerreissen@hotmail.com') == 'zerreissen@hotmail.com'\", \"assert get_member_email('everyone@mailgun.zeefarmer.com', 'john.doe@example.com') == 'Member not found'\", \"assert get_member_email('test_list@mail... | {
"split": "train",
"index": 63627,
"acecode_id": "bigcode_python_fns_7215",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a grid of size m x n, write a function that calculates the number of unique paths from the top-left corner to the bottom-right corner. You can only move either down or right at any point in time. Implement the function `find_unique_paths(m: int, n: int) -> int` where m is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unique_paths(1, 1) == 1\", \"assert find_unique_paths(2, 2) == 2\", \"assert find_unique_paths(3, 3) == 6\", \"assert find_unique_paths(3, 4) == 10\", \"assert find_unique_paths(4, 4) == 20\", \"assert find_unique_paths(1, 5) == 1\", \"assert find_uniqu... | {
"split": "train",
"index": 63628,
"acecode_id": "evol_35334",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists where each inner list contains numerical values, implement a function that calculates the mean and standard deviation of each column across all inner lists. The function should return a tuple containing two lists: the first list contains the column means, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_statistics([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == ([4.0, 5.0, 6.0], [2.449489742783178, 2.449489742783178, 2.449489742783178])\", \"assert aggregate_statistics([[1], [2], [3], [4], [5]]) == ([3.0], [1.4142135623730951])\", \"assert aggregate_statist... | {
"split": "train",
"index": 63629,
"acecode_id": "bigcode_python_fns_21848",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a URL from the LeetCode website. Your task is to implement a function that validates whether the URL is correctly formatted. The URL should start with 'https://leetcode.com/' and should end with a specific problem identifier which consists of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_leetcode_url('https://leetcode.com/problems/two-sum?') == True\", \"assert validate_leetcode_url('https://leetcode.com/problems/valid-parentheses?') == True\", \"assert validate_leetcode_url('https://leetcode.com/explore/featured/card/') == False\",... | {
"split": "train",
"index": 63630,
"acecode_id": "bigcode_python_fns_21961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and an integer 'n', implement a function that returns the 'n' largest integers from the list in descending order. If 'n' exceeds the number of integers in the list, return the entire list sorted in descending order. The function should satisfy a time co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_n_largest_nums([3, 1, 4, 1, 5, 9], 3) == [9, 5, 4]\", \"assert find_n_largest_nums([10, 20, 30, 40, 50], 2) == [50, 40]\", \"assert find_n_largest_nums([1, 2, 3, 4, 5], 5) == [5, 4, 3, 2, 1]\", \"assert find_n_largest_nums([7, 8, 5, 6], 10) == [8, 7, 6,... | {
"split": "train",
"index": 63631,
"acecode_id": "evol_9425",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given four floating-point numbers representing the parameters of two Lennard-Jones (LJ) potential molecules: epsilon_1, epsilon_2, sigma_1, and sigma_2. Implement a function that applies the Lorentz-Berthelot mixing rules to compute the mixed epsilon and sigma values fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lorentz_berthelot(1.0, 1.0, 1.0, 1.0) == (1.0, 1.0)\", \"assert lorentz_berthelot(1.0, 4.0, 1.0, 3.0) == (2.0, 2.0)\", \"assert lorentz_berthelot(0.5, 0.5, 2.0, 2.0) == (0.5, 2.0)\", \"assert lorentz_berthelot(2.0, 3.0, 1.0, 4.0) == (2.449489742783178, 2.5)\... | {
"split": "train",
"index": 63632,
"acecode_id": "bigcode_python_fns_6540",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of integers in ascending order. The list may contain both positive and negative integers. Your function should handle lists of varying lengths efficiently. The function should take a list of integers as input and return a new list containi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quickSort([-7, -5, 0, 2, 10, -3, 5]) == [-7, -5, -3, 0, 2, 5, 10]\", \"assert quickSort([3, -1, 0, 2]) == [-1, 0, 2, 3]\", \"assert quickSort([5, 3, 8, 6, 2]) == [2, 3, 5, 6, 8]\", \"assert quickSort([]) == []\", \"assert quickSort([1]) == [1]\", \"assert qu... | {
"split": "train",
"index": 63633,
"acecode_id": "evol_1931",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sum_of_squares_of_primes(n)` that takes an integer `n` as input and returns the sum of the squares of all prime numbers from 1 to `n`. For example, if `n` is 5, the function should return the sum of squares of prime numbers 2, 3, and 5, which is 4 + 9 + 25... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares_of_primes(1) == 0\", \"assert sum_of_squares_of_primes(2) == 4\", \"assert sum_of_squares_of_primes(3) == 13\", \"assert sum_of_squares_of_primes(4) == 13\", \"assert sum_of_squares_of_primes(5) == 38\", \"assert sum_of_squares_of_primes(6) ==... | {
"split": "train",
"index": 63634,
"acecode_id": "evol_8265",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a room in a dungeon represented as a `Room` object, implement a function `change_room(room: Room, direction: str) -> Room` that takes the current room and a direction as input. The function should return the room in the specified direction if it exists; otherwise, return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert change_room(Room('Room1', Room('Room2')), 'north') == Room('Room2')\", \"assert change_room(Room('Room1', Room('Room2', None, None), None), 'north') == Room('Room2')\", \"assert change_room(Room('Room1', Room('Room2'), Room('Room3')), 'north') == Room('Room2... | {
"split": "train",
"index": 63635,
"acecode_id": "evol_25587",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that returns the sum of all the even numbers in the list. If there are no even numbers, the function should return 0. Write a function called `sum_of_evens` that takes a list of integers as input and returns... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([-2, -4, 1, 3]) == -6\", \"assert sum_of_evens([0, 1, 2, 3]) == 2\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"ass... | {
"split": "train",
"index": 63636,
"acecode_id": "oss_29504",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of strings and a target string, and returns a list of all the strings from the input list that start with the target string. The function should only include unique strings in the output list. The function signatu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_unique_strings_by_prefix(['car', 'cat', 'bus', 'bicycle', 'car'], 'c') == ['car', 'cat']\", \"assert filter_unique_strings_by_prefix(['python', 'java', 'javascript', 'csharp', 'java'], 'ja') == ['java', 'javascript']\", \"assert filter_unique_strings_... | {
"split": "train",
"index": 63637,
"acecode_id": "oss_22383",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_secrecy_capacity(arr)` that calculates the maximum difference between any two numbers in the list. The function should return this maximum difference. If the list has fewer than two numbers, return 0 since no difference can be cal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_secrecy_capacity([1, 2, 3, 4, 5]) == 4\", \"assert max_secrecy_capacity([5, 1, 9, 3]) == 8\", \"assert max_secrecy_capacity([10, 10, 10, 10]) == 0\", \"assert max_secrecy_capacity([-1, -2, -3, -4]) == 3\", \"assert max_secrecy_capacity([0, 0, 0, 0]) == 0... | {
"split": "train",
"index": 63638,
"acecode_id": "bigcode_python_fns_31918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting a mass measured in grams to its equivalent in centigrams. Implement a function `gram_to_centigram(g: float) -> float` that takes a mass in grams and returns the equivalent mass in centigrams. Note that 1 gram is equal to 100 centigrams.\nPlease re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gram_to_centigram(0.32) == 32.0\", \"assert gram_to_centigram(1) == 100.0\", \"assert gram_to_centigram(0) == 0.0\", \"assert gram_to_centigram(2.5) == 250.0\", \"assert gram_to_centigram(10) == 1000.0\", \"assert gram_to_centigram(0.1) == 10.0\", \"assert g... | {
"split": "train",
"index": 63639,
"acecode_id": "evol_3491",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D binary matrix (list of lists) representing a grid where 1s represent filled pixels and 0s represent empty pixels. Your task is to implement a function that grows the filled regions (represented by 1s) by one pixel in all 8 possible directions (up, down, left,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert grow_masked_regions([[0,0,0],[0,1,0],[0,0,0]]) == [[1,1,1],[1,1,1],[1,1,1]]\", \"assert grow_masked_regions([[0,0,0],[0,0,0],[0,0,0]]) == [[0,0,0],[0,0,0],[0,0,0]]\", \"assert grow_masked_regions([[1,1,1],[1,0,1],[1,1,1]]) == [[1,1,1],[1,1,1],[1,1,1]]\", \"a... | {
"split": "train",
"index": 63640,
"acecode_id": "bigcode_python_fns_31908",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given two integer values, `min` and `max`, write a function `check_equal(min: int, max: int) -> bool` that returns `True` if both values are defined and equal to each other. If either value is `None` or they are not equal, the function should return `False`.\nPlease reason step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_equal(5, 5) == True\", \"assert check_equal(10, 20) == False\", \"assert check_equal(-1, -1) == True\", \"assert check_equal(0, 0) == True\", \"assert check_equal(None, 5) == False\", \"assert check_equal(5, None) == False\", \"assert check_equal(None,... | {
"split": "train",
"index": 63641,
"acecode_id": "bigcode_python_fns_39929",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer number, write a function called `greeting` that prints different messages based on the divisibility of the number. If the number is divisible by both 5 and 7, it should print \"Good Evening\". If the number is only divisible by 5, it should print \"Good Day\". ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greeting(35) == 'Good Evening'\", \"assert greeting(10) == 'Good Day'\", \"assert greeting(14) == 'Good Night'\", \"assert greeting(0) == 'Good Evening'\", \"assert greeting(5) == 'Good Day'\", \"assert greeting(7) == 'Good Night'\", \"assert greeting(21) ==... | {
"split": "train",
"index": 63642,
"acecode_id": "evol_4012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of positive integers and returns the total sum of all even integers in the list. Additionally, include only those odd integers in the sum that are less than or equal to 10. Odd integers larger than 10 should be excluded from the sum. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens_and_valid_odds([2, 4, 6, 8, 10]) == 30\", \"assert sum_of_evens_and_valid_odds([11, 12, 13, 14]) == 26\", \"assert sum_of_evens_and_valid_odds([0, 2, 4]) == 6\", \"assert sum_of_evens_and_valid_odds([15, 20, 25]) == 20\", \"assert sum_of_evens_a... | {
"split": "train",
"index": 63643,
"acecode_id": "evol_6407",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the initialization of a database connection for a web application. The function should take a single parameter, `db`, which is an instance of a custom `Database` class. If `db` is not an instance of `Database`, the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_database(Database()).connect() == 'Database is connected'\", \"assert initialize_database(Database()).connect != None\", \"assert initialize_database(Database()).connect.__doc__ is None\", \"assert isinstance(initialize_database(Database()), Datab... | {
"split": "train",
"index": 63644,
"acecode_id": "bigcode_python_fns_21021",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `inputBatch` and `targetBatch`, where each list represents a sequence of predicted and actual integer values, respectively, write a function `compute_metrics(inputBatch, targetBatch)` that calculates the following metrics: 1. The Mean Absolute Error... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_metrics([1, 2, 3], [1, 2, 3]) == (0.0, 3)\", \"assert compute_metrics([1, 2, 3], [4, 5, 6]) == (3.0, 0)\", \"assert compute_metrics([1, 2, 3], [1, 5, 3]) == (1.0, 2)\", \"assert compute_metrics([1, 3, 5], [1, 3, 5]) == (0.0, 3)\", \"assert compute_me... | {
"split": "train",
"index": 63645,
"acecode_id": "bigcode_python_fns_44164",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing mesh names and a string representing a new mesh name, write a function that checks if the new mesh name already exists in the list. If it exists, the function should return a tuple with the original mesh name and a modified name by appending... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_mesh_name(['mesh1', 'mesh2', 'mesh3'], 'mesh1') == ('mesh1', 'mesh1_1')\", \"assert check_mesh_name(['mesh1', 'mesh2', 'mesh3'], 'mesh4') == ('mesh4', 'mesh4')\", \"assert check_mesh_name(['mesh1', 'mesh1_1', 'mesh1_2'], 'mesh1') == ('mesh1', 'mesh1_3'... | {
"split": "train",
"index": 63646,
"acecode_id": "bigcode_python_fns_25075",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 's', write a function that extracts and returns a list of unique URLs present in the string. A URL is defined as a sequence of characters that starts with 'http://', 'https://', 'ftp://', or 'smtp://', or optionally starts with 'www.', followed by a valid domain ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findurls('Check this link: http://example.com and this one: https://foo.bar') == ['http://example.com', 'https://foo.bar']\", \"assert findurls('No URLs here! Just some text.') == []\", \"assert findurls('Visit https://www.test.com for more info and http://t... | {
"split": "train",
"index": 63647,
"acecode_id": "bigcode_python_fns_10449",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_duplicates(input_list)` that returns a list of integers that appear more than once in the input list. The returned list should contain only the duplicated numbers, with no specific order. If there are no duplicates, return an emp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 2, 3, 4, 5]) == [2, 3]\", \"assert find_duplicates([1, 1, 1, 1]) == [1]\", \"assert find_duplicates([1, 2, 3, 4, 5]) == []\", \"assert find_duplicates([0, -1, -1, 0, 2]) == [0, -1]\", \"assert find_duplicates([10, 20, 10, 30, 20]) =... | {
"split": "train",
"index": 63648,
"acecode_id": "evol_17808",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a Python function that processes a list of holiday events and returns a dictionary containing the count of holidays for each month. Each holiday event is represented as a dictionary with the following keys: 'date' (in the format 'YYYY-MM-DD'), 'descr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_holidays_by_month([]) == {}\", \"assert count_holidays_by_month([{'date': '2022-06-25', 'description': 'Event1', 'locale': 'en-US', 'notes': '', 'region': '', 'type': 'NV'}]) == {'2022-06': 1}\", \"assert count_holidays_by_month([{'date': '2022-06-25',... | {
"split": "train",
"index": 63649,
"acecode_id": "oss_31070",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing various document processing actions as boolean flags. Each key in the dictionary corresponds to a specific action that can be performed on documents, such as processing images, converting files, and extracting text. Implement a function `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_documents({'process_inbox_directory': True, 'process_convert_pdf_2_image': False}) == ['Processed documents from inbox directory.']\", \"assert process_documents({'process_convert_image_2_pdf': True, 'process_extract_text_from_pdf': True}) == ['Conve... | {
"split": "train",
"index": 63650,
"acecode_id": "bigcode_python_fns_13403",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a Python function to validate the runtime memory configuration for a service. The function should take in a `config_data` dictionary, which contains the configuration details for a service. The specific configuration of interest is `config_data['s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_runtime_memory({'service': {'runtime_memory': 512}}, 1024) == {'service': {'runtime_memory': 512}}\", \"assert validate_runtime_memory({'service': {'runtime_memory': 2048}}, 1024) == {'service': {'runtime_memory': 1024}}\", \"assert validate_runtime... | {
"split": "train",
"index": 63651,
"acecode_id": "oss_20392",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of players in a game. Your task is to implement a function that determines the total score of the players. The function should take in a list of integers and return the sum of all scores. If the list is empty, the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_score([10, 20, 30]) == 60\", \"assert calculate_total_score([-5, 5]) == 0\", \"assert calculate_total_score([0, 0, 0]) == 0\", \"assert calculate_total_score([]) == 0\", \"assert calculate_total_score([1]) == 1\", \"assert calculate_total_sco... | {
"split": "train",
"index": 63652,
"acecode_id": "oss_4863",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numerical values representing cell data. Your task is to implement a function `predict(celldata: List[float]) -> List[float]` that simulates a prediction model by returning a new list where each element is the square of the corresponding element in the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict([1.0, 2.0, 3.0]) == [1.0, 4.0, 9.0]\", \"assert predict([-1.0, -2.0, -3.0]) == [1.0, 4.0, 9.0]\", \"assert predict([0.0, 0.0, 0.0]) == [0.0, 0.0, 0.0]\", \"assert predict([10.0, 20.0, 30.0]) == [100.0, 400.0, 900.0]\", \"assert predict([-10.0, -20.0,... | {
"split": "train",
"index": 63653,
"acecode_id": "bigcode_python_fns_13026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Define a Python function named `create_person` that takes two parameters: a string `name` and an integer `age`. The function should return a dictionary representation of a person with keys 'name' and 'age' corresponding to the provided parameters. If the age is negative, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_person('Alice', 30) == {'name': 'Alice', 'age': 30}\", \"assert create_person('Bob', 25) == {'name': 'Bob', 'age': 25}\", \"assert create_person('Charlie', 0) == {'name': 'Charlie', 'age': 0}\", \"assert create_person('Diana', 45) == {'name': 'Diana',... | {
"split": "train",
"index": 63654,
"acecode_id": "evol_24307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the penalty for speeding based on a given speed and a minimum speed limit. The penalty is defined as the square of the amount by which the speed exceeds the minimum speed limit. If the speed is less than or equal to the mi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_speed_penalty(70, 60) == 100\", \"assert calculate_speed_penalty(40, 40) == 0\", \"assert calculate_speed_penalty(80, 75) == 25\", \"assert calculate_speed_penalty(90, 85) == 25\", \"assert calculate_speed_penalty(100, 90) == 100\", \"assert calcul... | {
"split": "train",
"index": 63655,
"acecode_id": "bigcode_python_fns_1851",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_user_email(oauth_token: str) -> Optional[str]` that retrieves a user's email address based on the provided OAuth token. If the token is valid and the user is authenticated, the function should return the user's email address as a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_email('valid_token') == 'user@example.com'\", \"assert get_user_email('random_invalid_token') == None\", \"assert get_user_email('') == None\", \"assert get_user_email('another_invalid_token') == None\", \"assert get_user_email('valid_token') == 'us... | {
"split": "train",
"index": 63656,
"acecode_id": "bigcode_python_fns_13348",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a URL and a non-negative integer n, write a function that returns the URL after going up n levels in its path. If n is greater than the number of path segments, return the root URL (domain only). The function should take a single string parameter representing the URL and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert go_up_n_levels('http://www.example.com/the/multi/part/path/file.ext', 3) == 'http://www.example.com/the/multi'\", \"assert go_up_n_levels('http://www.example.com/the/multi/part/path/file.ext', 5) == 'http://www.example.com'\", \"assert go_up_n_levels('https:... | {
"split": "train",
"index": 63657,
"acecode_id": "evol_7294",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given two non-empty lists of integers, lst1 and lst2, your task is to determine whether it is possible to swap any number of elements between the two lists such that all elements in lst1 become prime numbers. You must ensure that the total sum of both lists remains unchanged af... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swapPrimes([1, 2, 3, 4], [1, 2, 3, 4]) == 'YES'\", \"assert swapPrimes([1, 2, 3, 4], [1, 5, 3, 4]) == 'NO'\", \"assert swapPrimes([10, 12], [1, 1]) == 'NO'\", \"assert swapPrimes([2, 4], [3, 5]) == 'YES'\", \"assert swapPrimes([1, 1, 1], [2, 2, 2]) == 'NO'\"... | {
"split": "train",
"index": 63658,
"acecode_id": "evol_21352",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple quiz scoring system based on a list of questions and the user's answers. Each question has multiple-choice answers with one correct answer. Your function should take in two parameters: a list of tuples representing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_score([('What is the capital of France?', 0), ('What is the largest planet in the solar system?', 0), ('Who wrote \\\"Romeo and Juliet\\\"?', 0)], [0, 0, 0]) == 3\", \"assert calculate_score([('What is the capital of France?', 0), ('What is the lar... | {
"split": "train",
"index": 63659,
"acecode_id": "oss_22922",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer `n` that represents the size of a list. Your task is to create a function `generate_sequence(n)` that returns a list of integers starting from 1 up to `n`, where each integer is multiplied by 2. For example, if the input is 3, the output should be [2, 4... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_sequence(1) == [2]\", \"assert generate_sequence(2) == [2, 4]\", \"assert generate_sequence(3) == [2, 4, 6]\", \"assert generate_sequence(0) == []\", \"assert generate_sequence(-5) == []\", \"assert generate_sequence(4) == [2, 4, 6, 8]\", \"assert g... | {
"split": "train",
"index": 63660,
"acecode_id": "bigcode_python_fns_20792",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings called `samples` and an integer `max_len` that represents the maximum length allowed for each sample. Your task is to implement a function `get_sample_index(samples: List[str], max_len: int, idx: int) -> int`. This function should return the inde... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sample_index(['abc', 'defg', 'hijkl'], 4, 0) == 0\", \"assert get_sample_index(['abc', 'defg', 'hijkl'], 4, 10) == 2\", \"assert get_sample_index(['a', 'b', 'c', 'd'], 1, 3) == 3\", \"assert get_sample_index(['hello', 'world'], 5, 0) == 0\", \"assert get... | {
"split": "train",
"index": 63661,
"acecode_id": "oss_27383",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a web application loader. The function `load_web_app` takes in a configuration string `config_uri`, an optional dictionary `request` that simulates WSGI request parameters, and an optional dictionary `option... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_web_app('config.ini#my_app') == {'app': 'my_app', 'root': 'root_resource', 'closer': 'closer called', 'request': {}, 'registry': 'app_registry'}\", \"assert load_web_app('config.ini') == {'app': 'main', 'root': 'root_resource', 'closer': 'closer called'... | {
"split": "train",
"index": 63662,
"acecode_id": "bigcode_python_fns_3728",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates fetching data for every month of the year. The function should take in a list of integers representing the months (from 1 to 12), and for each month in the list, it should return a string indicating that the data for th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_data([1, 2, 3]) == ['Fetched data for month 1', 'Fetched data for month 2', 'Fetched data for month 3']\", \"assert fetch_data([1, 1, 2, 3]) == ['Fetched data for month 1', 'Fetched data for month 2', 'Fetched data for month 3']\", \"assert fetch_data(... | {
"split": "train",
"index": 63663,
"acecode_id": "bigcode_python_fns_35428",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n)` that generates the first N numbers in the Fibonacci sequence, starting from 0 and 1, where each subsequent number is the sum of the previous two. The function should return a list containing these numbers.\nPlease reason step by step, then wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",... | {
"split": "train",
"index": 63664,
"acecode_id": "evol_14864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating an audio buffer that can store audio data. You need to implement a function `add_audio_data` that accepts a buffer type and a bytes object. The buffer type can either be 'wakeword' or 'command'. If the buffer type is 'wakeword', it can store a max... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_audio_data('wakeword', b'abc') == 'Audio data added successfully'\", \"assert add_audio_data('wakeword', b'a' * 40000) == 'Audio data added successfully'\", \"assert add_audio_data('wakeword', b'a' * 40001) == 'Exceeds maximum buffer length'\", \"assert ... | {
"split": "train",
"index": 63665,
"acecode_id": "oss_31815",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that accepts a sequence of integers as input and returns a dictionary with each integer as the key and its square as a value. The function should be implemented using recursion and should not utilize in-built Python functions or features like list comprehension... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cubed_dict([1, 2, 3]) == {1: 1, 2: 4, 3: 9}\", \"assert cubed_dict([4, 5, 6]) == {4: 16, 5: 25, 6: 36}\", \"assert cubed_dict([0, -1, -2]) == {0: 0, -1: 1, -2: 4}\", \"assert cubed_dict([10]) == {10: 100}\", \"assert cubed_dict([]) == {}\", \"assert cubed_di... | {
"split": "train",
"index": 63666,
"acecode_id": "evol_18382",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a player's event in a role-playing game. The function should handle a specific event type and generate a response based on the event and player's clan ID. Implement the function `process_event(event: str, clan_id: int) -> s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_event('9001-01.htm', 1) == '9001-01.htm'\", \"assert process_event('9001-01.htm', 2) == '9001-01.htm'\", \"assert process_event('9001-01.htm', 0) == '9001-01.htm'\", \"assert process_event('8001-01.htm', 1) == 'Invalid event'\", \"assert process_even... | {
"split": "train",
"index": 63667,
"acecode_id": "oss_22007",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing dataset IDs. Your task is to write a function that takes this list and returns a sorted list of unique dataset IDs. The function should remove any duplicates and return the IDs in ascending order. Implement the function `get_unique_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_sorted_ids([3, 1, 2, 3, 2]) == [1, 2, 3]\", \"assert get_unique_sorted_ids([5, 5, 5, 5]) == [5]\", \"assert get_unique_sorted_ids([10, 2, 3, 1, 4, 3]) == [1, 2, 3, 4, 10]\", \"assert get_unique_sorted_ids([]) == []\", \"assert get_unique_sorted_id... | {
"split": "train",
"index": 63668,
"acecode_id": "bigcode_python_fns_39899",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a valid Python expression. Your task is to write a Python function, `evaluate_expression`, that takes this string as input and returns the result of evaluating the expression. The input string will consist of a single line containing a valid ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('True') == True\", \"assert evaluate_expression('False') == False\", \"assert evaluate_expression('2 + 2') == 4\", \"assert evaluate_expression('3 * 4') == 12\", \"assert evaluate_expression('10 / 2') == 5.0\", \"assert evaluate_expressio... | {
"split": "train",
"index": 63669,
"acecode_id": "oss_25794",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a dataset containing performance metrics and returns a list of incremental metrics. Each row in the dataset is a dictionary with various performance attributes including 'time', 'throughput', and a set of latency... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_metrics([{'time': '1.5', 'throughput': '100', 'pattern1': '0.5', 'pattern2': '1.0'}, {'time': '2.5', 'throughput': '200', 'pattern1': '0.6', 'pattern2': '1.1'}]) == [{'time': 1.5, 'throughput': 100.0, 'latency': {'attribute1': 0.5, 'attribute2': 1.0}... | {
"split": "train",
"index": 63670,
"acecode_id": "oss_6183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the average age of students in a school. A student is represented by a dictionary containing their name (string), age (integer), and grade (integer). Write a function `calculate_average_age(students: List[Dict[str, Uni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_age([{'name': 'Alice', 'age': 15, 'grade': 10}, {'name': 'Bob', 'age': 16, 'grade': 11}, {'name': 'Charlie', 'age': 14, 'grade': 9}]) == 15.0\", \"assert calculate_average_age([{'name': 'David', 'age': 17, 'grade': 12}, {'name': 'Eva', 'age... | {
"split": "train",
"index": 63671,
"acecode_id": "oss_17211",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of elements, write a function `filter_out_nones(data)` that filters out all falsey values (like `None`, `False`, `0`, `''`, etc.) from the list and returns a new list containing only the truthy values. The input list may contain a mix of data types. Your function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_out_nones([1, None, 2, '', 3, False, 4]) == [1, 2, 3, 4]\", \"assert filter_out_nones([None, 0, False, '', [], {}, 'Hello', 42]) == ['Hello', 42]\", \"assert filter_out_nones([None, None, None]) == []\", \"assert filter_out_nones([0, False, '', [], {}... | {
"split": "train",
"index": 63672,
"acecode_id": "bigcode_python_fns_27500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of stock tickers represented as strings. Your task is to implement a function that returns a dictionary where each key is a ticker and the corresponding value is a string indicating whether the stock is 'valid' or 'invalid'. A stock is considered 'valid' if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_stock_tickers(['AAPL', 'GOOGL', 'MSFT']) == {'AAPL': 'valid', 'GOOGL': 'valid', 'MSFT': 'valid'}\", \"assert validate_stock_tickers(['A', 'AB', 'XYZ', 'INVALID$', '123']) == {'A': 'valid', 'AB': 'valid', 'XYZ': 'valid', 'INVALID$': 'invalid', '123':... | {
"split": "train",
"index": 63673,
"acecode_id": "bigcode_python_fns_20232",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given two floating-point numbers a and b, write a function that returns the larger of the two numbers. You are not allowed to use the built-in max function. The input will always be valid and will not be NaN or infinity. Implement the function `find_larger(a: float, b: float) -... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_larger(1.5, 2.5) == 2.5\", \"assert find_larger(-1.5, -2.5) == -1.5\", \"assert find_larger(0.0, 0.0) == 0.0\", \"assert find_larger(3.14, 2.72) == 3.14\", \"assert find_larger(-5.5, -5.5) == -5.5\", \"assert find_larger(100.0, 99.9) == 100.0\", \"asser... | {
"split": "train",
"index": 63674,
"acecode_id": "bigcode_python_fns_10968",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the behavior of electrons in a material based on energy values and density of states. You need to implement a function `simulate_electron_behavior(grid_energies, ados, dope, dos_grid_size)` that calculates the number of electrons based on the foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_electron_behavior([-1, 0, 1], [0.5, 1.0, 1.5], 0, 3) == 1.0\", \"assert simulate_electron_behavior([-2, 0, 2], [0.0, 1.0, 2.0], -0.5, 3) == 0.5\", \"assert simulate_electron_behavior([-1, 0, 1], [0.0, 0.4, 0.7], 0.1, 3) == 0.5\", \"assert simulate_e... | {
"split": "train",
"index": 63675,
"acecode_id": "oss_36608",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of template names and their corresponding URLs for histology file downloads. Your task is to implement a function that takes a list of template names as input and returns a dictionary containing the template names as keys and their corresponding URLs as val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_template_urls(['fsaverage', 'fsaverage5']) == {'fsaverage': 'https://box.bic.mni.mcgill.ca/s/znBp7Emls0mMW1a/download', 'fsaverage5': 'https://box.bic.mni.mcgill.ca/s/N8zstvuRb4sNcSe/download'}\", \"assert get_template_urls(['fs_LR_64k']) == {'fs_LR_64k'... | {
"split": "train",
"index": 63676,
"acecode_id": "bigcode_python_fns_29241",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of flag names and returns a dictionary of those flag names paired with their corresponding values. The function should enforce that all flag names are strings and that they must exist in a predefined set of flags. If any... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lookup_flag_values(['flag1', 'flag2']) == {'flag1': 10, 'flag2': 20}\", \"assert lookup_flag_values(['flag3']) == {'flag3': 30}\", \"assert lookup_flag_values(['flag1', 'flag3']) == {'flag1': 10, 'flag3': 30}\", \"assert lookup_flag_values(['flag2', 'flag1']... | {
"split": "train",
"index": 63677,
"acecode_id": "bigcode_python_fns_7428",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of strings and a keyword as input. The function should return a new list containing only the strings that contain the keyword, but in reverse order of their appearance in the input list. Do not use any built-in Python functions for reversing s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_lines_with_keyword(['Just another line', 'Testing Python', 'Python is fun'], 'Python') == ['Python is fun', 'Testing Python']\", \"assert reverse_lines_with_keyword(['No keyword here', 'Nope', 'Not this either'], 'Python') == []\", \"assert reverse_l... | {
"split": "train",
"index": 63678,
"acecode_id": "evol_19399",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified version of a history storage system for HTTP requests and responses. Your goal is to create a function that can store historical data and retrieve it based on specific criteria. Implement the function `history_storage(requests: List... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert history_storage([{'method': 'GET'}, {'method': 'POST'}], [{'status_code': 200}, {'status_code': 404}], [['api'], ['web']], {'tag': 'api'}) == [{'method': 'GET', 'status_code': 200, 'tags': ['api']}]\", \"assert history_storage([{'method': 'GET'}, {'method': ... | {
"split": "train",
"index": 63679,
"acecode_id": "oss_22558",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, return a dictionary containing the cumulative count of all unique continuous sub-arrays formed by sorting the characters of the string in alphabetical order. The keys of the dictionary should be the unique sorted sub-arrays, and the values should be their respec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subarray_count('aaa') == {'a': 3, 'aa': 2, 'aaa': 1}\", \"assert subarray_count('zz') == {'z': 2, 'zz': 1}\", \"assert subarray_count('') == {}\", \"assert subarray_count('a') == {'a': 1}\", \"assert subarray_count('ab') == {'a': 1, 'b': 1, 'ab': 1}\", \"ass... | {
"split": "train",
"index": 63680,
"acecode_id": "evol_26961",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the age of a product in days given its manufacturing date. Write a function `calculate_product_age(dateMade: str) -> int` that takes the manufacturing date of the product as a string in the format 'YYYY-MM-DD' and returns ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_product_age('2021-05-15') == (datetime.date.today() - datetime.date(2021, 5, 15)).days\", \"assert calculate_product_age('2023-01-01') == (datetime.date.today() - datetime.date(2023, 1, 1)).days\", \"assert calculate_product_age('2022-12-25') == (d... | {
"split": "train",
"index": 63681,
"acecode_id": "oss_11890",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a log format string based on a specific pattern. The function `log_format()` should take no arguments and return a string that represents the log format. The required log format string should include the following component... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_format() == '%(asctime)s [%(levelname)s] %(message)s'\", \"assert log_format() is not None\", \"assert isinstance(log_format(), str)\", \"assert len(log_format()) > 0\", \"assert '%(asctime)s' in log_format()\", \"assert '[%(levelname)s]' in log_format()... | {
"split": "train",
"index": 63682,
"acecode_id": "oss_7087",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given five floating-point numbers tau7, tau8, tau9, tau10, and tau11, and a floating-point number s9, implement a function that calculates and returns the result of the following equation: tau7 + 2 * tau8 - |tau9 + tau10 + tau11| - s9^2. Additionally, return a dictionary contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_g9(3.0, 3.0, 0.0, 0.0, 0.0, 0.0) == (3.0 + 2 * 3.0 - abs(0.0 + 0.0 + 0.0) - 0.0**2, {'tau7': 1.0, 'tau8': 2.0, 'tau9': 1.0, 'tau10': 1.0, 'tau11': 1.0, 's9': 0.0})\", \"assert evaluate_g9(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) == (0.0 + 2 * 0.0 - abs(0.0 + 0... | {
"split": "train",
"index": 63683,
"acecode_id": "bigcode_python_fns_25724",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of asset identifiers and two date strings representing a minimum and maximum date, implement a function `load_assets_data` that returns a list of asset identifiers filtered between the min_date and max_date. If the assets list is empty or None, return an empty list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_assets_data(['asset1', 'asset2'], '2023-10-01', '2023-10-05') == ['asset1', 'asset2']\", \"assert load_assets_data(['asset1', 'asset2', 'asset1'], '2023-10-01', '2023-10-05') == ['asset1', 'asset2']\", \"assert load_assets_data([], '2023-10-01', '2023-1... | {
"split": "train",
"index": 63684,
"acecode_id": "bigcode_python_fns_35647",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that identifies and returns all isogram words from a given sentence. An isogram is a word in which no letter occurs more than once. For example, the words 'Subdermatoglyphic', 'uncopyrightable', and 'dermatoglyphics' are considered isograms. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_isograms('abc def ghi') == ['abc', 'def', 'ghi']\", \"assert find_isograms('a b c d e f g') == ['a', 'b', 'c', 'd', 'e', 'f', 'g']\", \"assert find_isograms('noon racecar') == []\", \"assert find_isograms('python programming') == ['python']\", \"assert ... | {
"split": "train",
"index": 63685,
"acecode_id": "evol_7461",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_entity(head: Node, target: int) -> bool` that takes the head of a monosublinked list and an integer target value. The function should return True if the target value exists in the linked list, and False otherwise.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_entity(None, 5) == False\", \"assert find_entity(Node(1), 1) == True\", \"assert find_entity(Node(1), 2) == False\", \"assert find_entity(Node(1), 1) == True\", \"assert find_entity(Node(1), 2) == False\"]}"
} | {
"split": "train",
"index": 63686,
"acecode_id": "evol_15903",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of spectral distribution data points where each data point is a tuple containing a wavelength (in nm) and its corresponding intensity value. Your task is to implement a function that takes this list as input and returns a new list of tuples, where each tupl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_spectral_distribution([(400, 0), (500, 0), (600, 0)]) == [(400, 0), (500, 0), (600, 0)]\", \"assert normalize_spectral_distribution([(400, 1), (500, 2), (600, 3)]) == [(400, 0.3333333333333333), (500, 0.6666666666666666), (600, 1.0)]\", \"assert no... | {
"split": "train",
"index": 63687,
"acecode_id": "bigcode_python_fns_44958",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Develop a function in Python that accepts either an integer or a list of integers as input and returns the corresponding Fibonacci sequence values for each of the provided integers. If the input is not an integer or a list of integers, raise a TypeError. Optimize the function t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibo(7) == 13\", \"assert fibo([3]) == [2]\", \"assert fibo([5]) == [5]\", \"assert fibo([0]) == [0]\", \"assert fibo([1]) == [1]\", \"assert fibo([2]) == [1]\", \"assert fibo([0, 1, 2, 3, 4, 5]) == [0, 1, 1, 2, 3, 5]\", \"assert fibo([10]) == [55]\", \"asse... | {
"split": "train",
"index": 63688,
"acecode_id": "evol_17684",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `power(x: int, y: int) -> int` that computes the power of a specific integer `x` raised to another specific integer `y` using recursion. The function should raise a ValueError if either `x` or `y` are not integers or if they are negative values. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert power(2, 3) == 8\", \"assert power(5, 0) == 1\", \"assert power(10, 2) == 100\", \"assert power(7, 1) == 7\", \"assert power(3, 4) == 81\", \"assert power(1, 10) == 1\", \"assert power(0, 5) == 0\", \"assert power(6, 2) == 36\", \"assert power(4, 3) == 64\",... | {
"split": "train",
"index": 63689,
"acecode_id": "evol_23179",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that transposes a given 3x3 matrix and provides an option to flip it horizontally or vertically after transposition. The function should accept the matrix and a string input ('h' for horizontal flip, 'v' for vertical flip). If the string input is neither 'h' no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_transformations([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 'x') == [[1, 4, 7], [2, 5, 8], [3, 6, 9]]\", \"assert perform_transformations([[0, 0, 0], [0, 0, 0], [0, 0, 0]], 'h') == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\", \"assert perform_transformations([[1, 2, ... | {
"split": "train",
"index": 63690,
"acecode_id": "evol_5239",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of objects, implement a function that returns a list of their memory addresses as integers. The function should take a list of objects as input and return a list of integers representing the memory addresses of each object. You may assume that the input will always... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_memory_addresses([1, 'string', 3.14]) == [id(1), id('string'), id(3.14)]\", \"assert get_memory_addresses(['apple', 'banana', 'cherry']) == [id('apple'), id('banana'), id('cherry')]\", \"assert get_memory_addresses([None, True, False]) == [id(None), id(T... | {
"split": "train",
"index": 63691,
"acecode_id": "bigcode_python_fns_6780",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `monotonic(l: list, strict: bool = False)` that validates if the elements of the list are monotonically increasing or decreasing. If the `strict` parameter is set to True, successive elements must be distinct; otherwise, they can be the same. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monotonic([1, 2, 4, 10]) == True\", \"assert monotonic([10, 4, 2, 1]) == True\", \"assert monotonic([1, 1, 2, 3], strict=False) == True\", \"assert monotonic([1, 2, 2, 3], strict=False) == True\", \"assert monotonic([1, 2, 2, 3], strict=True) == False\", \"a... | {
"split": "train",
"index": 63692,
"acecode_id": "evol_15363",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two containers, `container1` and `container2`, which can be lists of any type of elements, implement a function `calculate_diff(container1, container2)` that returns two lists: the first list contains elements that are present in `container2` but not in `container1` (adde... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_diff([1, 2, 3], [3, 4, 5]) == ([4, 5], [1, 2])\", \"assert calculate_diff([], [1, 2]) == ([1, 2], [])\", \"assert calculate_diff([1, 2], []) == ([], [1, 2])\", \"assert calculate_diff([1, 2, 3], [1, 2, 3]) == ([], [])\", \"assert calculate_diff([Tr... | {
"split": "train",
"index": 63693,
"acecode_id": "evol_21418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_unique_numbers` that generates a list of 50 unique random integers between 50 and 99 (inclusive). The function should return this list of integers. Ensure that there are no duplicates in the list. If it is not possible to generate 50 unique integers i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert all(50 <= x <= 99 for x in generate_unique_numbers())\", \"assert len(set(generate_unique_numbers())) == len(generate_unique_numbers())\", \"assert generate_unique_numbers() != generate_unique_numbers()\", \"assert generate_unique_numbers() != []\", \"assert... | {
"split": "train",
"index": 63694,
"acecode_id": "evol_3487",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_passcode(length: int) -> str` that generates a random alphanumeric passcode of a specified length. The passcode must contain at least one uppercase letter from the alphabet and one distinct numeric digit. The function should return the generated passc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_passcode(10)) == 10\", \"assert any(c.isupper() for c in generate_passcode(10))\", \"assert any(c.isdigit() for c in generate_passcode(10))\", \"assert len(set(generate_passcode(10)) & set('0123456789')) > 0\", \"assert len(set(generate_passcode... | {
"split": "train",
"index": 63695,
"acecode_id": "evol_8125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a user is eligible based on their registration status and access level. The eligibility criteria are as follows: a user is considered eligible if their access level is greater than or equal to a specified minimum access lev... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_user_eligible(1, 3, 2) == True\", \"assert is_user_eligible(2, 2, 2) == True\", \"assert is_user_eligible(3, 1, 2) == False\", \"assert is_user_eligible(4, 5, 3) == True\", \"assert is_user_eligible(-1, 4, 2) == False\", \"assert is_user_eligible(5, 0, 1)... | {
"split": "train",
"index": 63696,
"acecode_id": "bigcode_python_fns_38994",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given three lists of integers: `nums`, `index`, and `operations`. Your task is to create a target array by performing operations based on the values in these lists. Initially, the target array is empty. For each index `i`, you will perform the following operations based... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert createTargetArray([0,1,2,3,4], [0,1,2,2,1], [0,0,0,0,0]) == [0,4,1,3,2]\", \"assert createTargetArray([1,2,3,4,0], [0,1,2,3,0], [0,0,0,0,1]) == [0,2,3,4]\", \"assert createTargetArray([1], [0], [0]) == [1]\", \"assert createTargetArray([5,6,7], [0,1,0], [0,0... | {
"split": "train",
"index": 63697,
"acecode_id": "evol_32789",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes binary numbers. Your function should take in three parameters: `a`, `b`, and `d`. Parameter `a` is a string representing a binary number, `b` is an integer, and `d` is another string representing a binary number. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_binary('0', 0, '0') == {'a': '0', 'b': 0, 'c': 0}\", \"assert process_binary('000', 1, '111') == {'a': '000', 'b': 1, 'c': 8}\", \"assert process_binary('10', 7, '110') == {'a': '10', 'b': 7, 'c': 15}\", \"assert process_binary('1', 1, '1') == {'a': ... | {
"split": "train",
"index": 63698,
"acecode_id": "oss_29356",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function `word_frequency(string: str) -> dict` that takes a string as input and returns a dictionary containing individual words as keys and their respective frequency of appearances as values. The function should ignore case, meaning that 'Hey', 'HEY', and 'hey' should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('hey hey hello hello hell oh hello!') == {'hey': 2, 'hello': 3, 'hell': 1, 'oh': 1}\", \"assert word_frequency('Hello, world! Hello? World.') == {'hello': 2, 'world': 2}\", \"assert word_frequency('Python; python: PYTHON') == {'python': 3}\", ... | {
"split": "train",
"index": 63699,
"acecode_id": "evol_30107",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.