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 implementing a Python function `bijektivna(sez)` that takes in a list `sez` as input and determines whether the function represents a bijective function with respect to the integers in the list. A bijective function is defined such that each element in the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bijektivna([1, 2, 3, 4]) == True\", \"assert bijektivna([5, 6, 7]) == True\", \"assert bijektivna([-1, -2, -3]) == True\", \"assert bijektivna([0, 1, 2, 3]) == True\", \"assert bijektivna([10, 20, 30, 40]) == True\", \"assert bijektivna([1]) == True\", \"ass... | {
"split": "train",
"index": 82100,
"acecode_id": "oss_35261",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a method to manage chat passwords in a chat application. Your goal is to create a function `set_password` that takes two parameters: `chat_id` (a unique identifier for the chat session) and `password` (the password to be set for the chat session... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_password('chat1', 'pass1', {}) == {'chat1': 'pass1'}\", \"assert set_password('chat1', 'pass2', {'chat1': 'pass1'}) == {'chat1': 'pass1'}\", \"assert set_password('chat2', 'pass3', {}) == {'chat2': 'pass3'}\", \"assert set_password('chat2', 'pass4', {'ch... | {
"split": "train",
"index": 82101,
"acecode_id": "oss_9574",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_alpha_occurrences(*args)` that takes multiple alphanumeric strings as input and counts the occurrences of all distinct alphabetical characters present in these strings. The function should return a dictionary where keys are the unique characters (pre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_alpha_occurrences('123', '!!!', '@@@') == {}\", \"assert count_alpha_occurrences('abc', 'Def', 'GHI') == {'a': 1, 'b': 1, 'c': 1, 'D': 1, 'e': 1, 'f': 1, 'G': 1, 'H': 1, 'I': 1}\", \"assert count_alpha_occurrences('!@#$', 'abcd', 'efgh') == {'a': 1, 'b... | {
"split": "train",
"index": 82102,
"acecode_id": "evol_3374",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to write a function that takes this list and returns a new list containing only the unique elements from the original list, maintaining the original order. If the input list is empty, return an empty list. Implement the function `u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([10, 20, 10, 30, 20]) == [1... | {
"split": "train",
"index": 82103,
"acecode_id": "bigcode_python_fns_37741",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a position represented by a dictionary with two keys: 'line' and 'character'. The 'line' key represents a 0-indexed line number, and the 'character' key represents a 0-indexed character position within that line. Your task is to convert this position into a new fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_position({'line': 0, 'character': 0}) == {'line': 1, 'column': 0}\", \"assert convert_position({'line': 1, 'character': 10}) == {'line': 2, 'column': 10}\", \"assert convert_position({'line': 4, 'character': 2}) == {'line': 5, 'column': 2}\", \"asser... | {
"split": "train",
"index": 82104,
"acecode_id": "bigcode_python_fns_37913",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python package configuration using the `setuptools` library. Your goal is to write a single function named `create_setup()` that returns a dictionary containing the package metadata for a Django API gateway package. The metadata should include the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_setup() == {'name': 'django-api-gateway', 'version': '0.0.5', 'keywords': ['django', 'apigateway', 'dataproxy'], 'description': 'apigateway for django', 'license': 'MIT License'}\", \"assert create_setup()['name'] == 'django-api-gateway'\", \"assert c... | {
"split": "train",
"index": 82105,
"acecode_id": "oss_30216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a CSV formatted data, where each line corresponds to a row and values are separated by commas, write a function that converts this CSV string into a list of dictionaries. Each dictionary should represent a row from the CSV, with the keys being the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert csv_to_list('name,age\\\\nJohn,30\\\\nJane,25') == [{'name': 'John', 'age': '30'}, {'name': 'Jane', 'age': '25'}]\", \"assert csv_to_list('product,price\\\\nApple,1.2\\\\nBanana,0.5') == [{'product': 'Apple', 'price': '1.2'}, {'product': 'Banana', 'price': '... | {
"split": "train",
"index": 82106,
"acecode_id": "bigcode_python_fns_48954",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that converts references in a given text to a specific format. A reference is defined as a string that starts with the '@' symbol followed by a sequence of alphanumeric characters. Your function should take a string as input an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_references('Hello @world, this is a @test.') == 'Hello REF(world), this is a REF(test).'\", \"assert convert_references('@user1 went to @place2') == 'REF(user1) went to REF(place2)'\", \"assert convert_references('No references here.') == 'No referen... | {
"split": "train",
"index": 82107,
"acecode_id": "oss_23402",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a sentence consisting of words separated by spaces, implement a function that rearranges the words in the sentence into alphabetical order and returns the new sentence. The comparison of words should be case-insensitive.\nPlease reason step by step, then write a self-cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert alphabetize_sentence('Can you grab me an apple from the kitchen') == 'an apple Can from grab kitchen me the you'\", \"assert alphabetize_sentence('Hello world this is a test') == 'a Hello is test this world'\", \"assert alphabetize_sentence('Python is fun') ... | {
"split": "train",
"index": 82108,
"acecode_id": "evol_8602",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that determines whether a given membership decline request is valid based on specific criteria. The function receives a dictionary representing the decline request and checks the validity of the data within it. If the request c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_membership_decline_request({'membership_id': '12345', 'reason': 'User requested to decline'}) == 200\", \"assert validate_membership_decline_request({'membership_id': '12345', 'reason': ''}) == 403\", \"assert validate_membership_decline_request({'m... | {
"split": "train",
"index": 82109,
"acecode_id": "oss_17166",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines whether a given integer is a prime number. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your task is to complete the function is_prime(n) which returns True if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser... | {
"split": "train",
"index": 82110,
"acecode_id": "evol_5357",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function `manipulate_and_store_data(data: List[int]) -> List[int]` that takes this list as input, processes each integer by multiplying it by 2, and returns a new list containing the processed integers. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manipulate_and_store_data([1, 2, 3]) == [2, 4, 6]\", \"assert manipulate_and_store_data([0]) == [0]\", \"assert manipulate_and_store_data([-1, -2, -3]) == [-2, -4, -6]\", \"assert manipulate_and_store_data([]) == []\", \"assert manipulate_and_store_data([10,... | {
"split": "train",
"index": 82111,
"acecode_id": "evol_27284",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a pipeline of image stages based on specified tags. Your function should accept the following parameters: an `image_name` (string), a list of `skip_tags` (list of strings), and a list of `include_tags` (list of strings). Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_image('image0', ['tag0'], ['tag1']) == {'image0': {'stage0': {'skipping-stage': 'stage0'}}}\", \"assert process_image('image4', [], []) == {}\", \"assert process_image('image6', ['tag0'], ['tag0']) == {'image6': {'stage0': {'skipping-stage': 'stage0'... | {
"split": "train",
"index": 82112,
"acecode_id": "bigcode_python_fns_11196",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the costs of moving across a bridge. Each integer corresponds to the cost of moving to that position on the bridge. Your task is to implement a function that calculates the minimum cost to cross the bridge from the start to the end,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_cost_to_cross_bridge([10, 30, 20]) == 30\", \"assert min_cost_to_cross_bridge([0, 0, 0, 0]) == 0\", \"assert min_cost_to_cross_bridge([10]) == 10\", \"assert min_cost_to_cross_bridge([5, 5, 5, 5, 5, 5]) == 15\", \"assert min_cost_to_cross_bridge([1]) == ... | {
"split": "train",
"index": 82113,
"acecode_id": "bigcode_python_fns_20924",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, swap the first and last consonants in the string and return it. The consonants are all the alphabets excluding 'a', 'e', 'i', 'o', and 'u', and they can appear in both cases. If there are fewer than two consonants in the string, return the string unchanged.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swapConsonants('hello') == 'lelho'\", \"assert swapConsonants('a') == 'a'\", \"assert swapConsonants('aeiou') == 'aeiou'\", \"assert swapConsonants('xyz') == 'zyx'\", \"assert swapConsonants('b') == 'b'\", \"assert swapConsonants('bb') == 'bb'\", \"assert sw... | {
"split": "train",
"index": 82114,
"acecode_id": "evol_29320",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of affiliations and returns a modified list of named tuples. Each named tuple should represent an affiliation and contain the fields 'eid', 'name', 'variant', 'documents', 'city', 'country', and 'parent' in that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_affiliations([{'eid': '10-s2.0-60021784', 'name': 'University A', 'variant': 'Main Campus', 'documents': '5000', 'city': 'New York', 'country': 'USA', 'parent': 'None'}]) == [Affiliation(eid='10-s2.0-60021784', name='University A', variant='Main Camp... | {
"split": "train",
"index": 82115,
"acecode_id": "oss_7904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers 'arr' and an integer 'total', write a function called 'count_subset_sum' that returns the number of subsets of 'arr' that sum up to 'total'. A subset can be any combination of elements from the array, including the empty subset. The function should ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_subset_sum([1, 2, 3], 3) == 2\", \"assert count_subset_sum([1, 2, 3], 5) == 1\", \"assert count_subset_sum([1, 2, 3], 6) == 1\", \"assert count_subset_sum([1, 2, 3], 0) == 1\", \"assert count_subset_sum([], 0) == 1\", \"assert count_subset_sum([], 1) =... | {
"split": "train",
"index": 82116,
"acecode_id": "bigcode_python_fns_25931",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given an integer 'num_cubes' representing the number of cubes and an integer 'len_data' representing the length of data. Your task is to create a function 'combine_cubes(num_cubes: int, len_data: int) -> List[List[int]]' that generates a 2D list (a list of lists) where ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_cubes(1, 3) == [[0, 1, 2]]\", \"assert combine_cubes(2, 4) == [[0, 1, 2, 3], [0, 1, 2, 3]]\", \"assert combine_cubes(3, 5) == [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4]]\", \"assert combine_cubes(4, 2) == [[0, 1], [0, 1], [0, 1], [0, 1]]\", \... | {
"split": "train",
"index": 82117,
"acecode_id": "bigcode_python_fns_12040",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that sorts the list in ascending order. The function should handle both positive and negative integers, including duplicates. Your implementation should be able to sort an empty list as well. Write a function named `merge_sort` tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort([0, 5, 3, 2, 2]) == [0, 2, 2, 3, 5]\", \"assert merge_sort([]) == []\", \"assert merge_sort([-45, -5, -2]) == [-45, -5, -2]\", \"assert merge_sort([1, 1, 1, 1]) == [1, 1, 1, 1]\", \"assert merge_sort([3, -1, 4, 0, -2]) == [-2, -1, 0, 3, 4]\", \"as... | {
"split": "train",
"index": 82118,
"acecode_id": "bigcode_python_fns_9753",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a list of architecture parameters based on certain conditions. The function should take a list of parameter values and return two lists: one for warnings and another for errors. A parameter should generate a warning if ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_architecture_parameters([1, 2, 3]) == ([], [])\", \"assert validate_architecture_parameters([0, 1, 2]) == ([], ['0'])\", \"assert validate_architecture_parameters(['deprecated', -1, 'deprecated_value']) == (['deprecated', 'deprecated_value'], ['-1']... | {
"split": "train",
"index": 82119,
"acecode_id": "bigcode_python_fns_25938",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to detect potential stack overflow vulnerabilities in Python code snippets. Write a function `detect_stack_overflow_vulnerability(code: str) -> bool` that takes a string `code` representing a piece of Python code and returns `True` if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_stack_overflow_vulnerability('def infinite():\\\\n infinite()') == True\", \"assert detect_stack_overflow_vulnerability('def recursive():\\\\n recursive()') == True\", \"assert detect_stack_overflow_vulnerability('def base_case():\\\\n return... | {
"split": "train",
"index": 82120,
"acecode_id": "oss_6622",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing lines of text. Some lines may contain comments (starting with '#' or '!') or may be empty. Write a function `next_valid_line_index(lines: List[str], idx: int) -> int` that, starting from the index `idx`, returns the index of the next... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_valid_line_index(['# comment', ' ', 'valid line', '!', 'another valid line'], 0) == 2\", \"assert next_valid_line_index(['valid line', '# comment'], 0) == 0\", \"assert next_valid_line_index(['', '!', 'valid'], 1) == 2\", \"assert next_valid_line_index... | {
"split": "train",
"index": 82121,
"acecode_id": "bigcode_python_fns_17401",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates retrieving content from a web service based on a notebook ID. The function, `get_notebook_content`, should accept a notebook ID as a string and return the corresponding notebook content as a string. If the notebook ID is in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_notebook_content('12345') == '# Title\\\\n## Section 1\\\\nprint(\\\"Hello, world!\\\")'\", \"assert get_notebook_content('67890') == '# Another Notebook\\\\n## Section 2\\\\nfor i in range(5): print(i)'\", \"assert get_notebook_content('abcde') == '# Sa... | {
"split": "train",
"index": 82122,
"acecode_id": "oss_21850",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating the parameters for a video subtitle upload. Write a function `validate_upload_parameters(video_id: str, language: str, filename: str) -> Dict[str, Union[str, UUID]]` that takes in three parameters: `video_id`, `language`, and `filename`. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_upload_parameters('9734262d30144b8cbedb94a872158581', 'en', 'foo.vtt') == {'video': UUID('9734262d30144b8cbedb94a872158581'), 'language': 'en', 'filename': 'foo.vtt'}\", \"assert validate_upload_parameters('123e4567-e89b-12d3-a456-426614174000', 'fr... | {
"split": "train",
"index": 82123,
"acecode_id": "bigcode_python_fns_39607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function `median_scores` that takes a list of lists, where each inner list contains scores. The function should return a dictionary with two keys: 'medians' and 'highest_median_array'. The 'medians' key should contain a list of median values for each inner list, while... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median_scores([]) == {'medians': [], 'highest_median_array': []}\", \"assert median_scores([[], [1]]) == {'medians': ['Array Empty', 'Only one score: 1'], 'highest_median_array': []}\", \"assert median_scores([[10], [], [20, 30]]) == {'medians': ['Only one s... | {
"split": "train",
"index": 82124,
"acecode_id": "evol_34202",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a text normalization function that converts a given text to lowercase and replaces line breaks with spaces. The function should be able to handle various characters, including punctuation. Your task is to complete the `normalize_text` function a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_text('Hello World!') == 'hello world!'\", \"assert normalize_text('Mixed CASES and PUNCTUATION!!!') == 'mixed cases and punctuation!!!'\", \"assert normalize_text('Single line without breaks') == 'single line without breaks'\", \"assert normalize_t... | {
"split": "train",
"index": 82125,
"acecode_id": "oss_20657",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `get_sorted_python_repos(page_number: int) -> List[Dict[str, Any]]` that retrieves the most forked Python repositories on GitHub created in the last week, sorted by the number of stars. The function should take an integer `page_number` as input and retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sorted_python_repos(1) == [{'name': 'Repo1', 'stars': 150, 'forks': 200}, {'name': 'Repo2', 'stars': 100, 'forks': 150}]\", \"assert get_sorted_python_repos(2) == [{'name': 'Repo3', 'stars': 90, 'forks': 120}, {'name': 'Repo4', 'stars': 85, 'forks': 110}... | {
"split": "train",
"index": 82126,
"acecode_id": "evol_20518",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with evaluating a list of arithmetic expressions. Write a function named `evaluate_expressions` that takes a list of strings, where each string represents a valid arithmetic expression consisting of Python arithmetic operations (like +, -, *, /, **, etc.) and may... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expressions(['1 + 1', '5 * 5', '10 - 3']) == [2, 25, 7]\", \"assert evaluate_expressions(['(2 + 3) * (5 - 1)', '8 / 2', '9 ** 0']) == [20, 4.0, 1]\", \"assert evaluate_expressions(['(1 + 1) * (1 + 1)', '3 + 4 * 2', '7 - 8 + 3']) == [4, 11, 2]\", \"a... | {
"split": "train",
"index": 82127,
"acecode_id": "oss_27647",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of strings, `listA` and `listB`, each containing `n` sentences. Your task is to create a function `calculate_similarity_scores(listA: List[str], listB: List[str]) -> List[float]` that computes a similarity score for each pair of sentences from `listA` an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_similarity_scores(['Same words', 'Different words'], ['Same words', 'Different words']) == [1.0, 1.0]\", \"assert calculate_similarity_scores(['One two three', 'Four five'], ['Six seven', 'Eight nine']) == [0.0, 0.0]\", \"assert calculate_similarit... | {
"split": "train",
"index": 82128,
"acecode_id": "bigcode_python_fns_4658",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function to compute the sum of all integers from 1 to n (inclusive). The function should take a single integer n as its argument and return the computed sum.\nPlease reason step by step, then write a self-contained Python solution. Give your final program ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_recursive(1) == 1\", \"assert sum_recursive(2) == 3\", \"assert sum_recursive(3) == 6\", \"assert sum_recursive(4) == 10\", \"assert sum_recursive(5) == 15\", \"assert sum_recursive(6) == 21\", \"assert sum_recursive(7) == 28\", \"assert sum_recursive(8)... | {
"split": "train",
"index": 82129,
"acecode_id": "evol_22096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a command line input. Your task is to create a function that simulates the command line argument processing. The function should take a string as input, which represents the command and its arguments in the format 'command [arg1] [arg2] ... [... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_command('') == []\", \"assert process_command('start --debug') == ['start', ('debug', None)]\", \"assert process_command('remove --all') == ['remove', ('all', None)]\", \"assert process_command('run --silent') == ['run', ('silent', None)]\", \"assert... | {
"split": "train",
"index": 82130,
"acecode_id": "bigcode_python_fns_18419",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries containing user contact information, where each dictionary has a 'name' key and a 'contact' key, implement a function `normalize_contacts(contacts)` that normalizes the format of the contact information. The contact can either be an email or a phone... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_contacts([{ 'name': 'John', 'contact': 'john@example.com' }, { 'name': 'Jane', 'contact': '123-456-7890' }]) == [{'name': 'John', 'contact': 'john@example.com'}, {'name': 'Jane', 'contact': '(123) 456-7890'}]\", \"assert normalize_contacts([{ 'name... | {
"split": "train",
"index": 82131,
"acecode_id": "evol_12164",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with verifying the operational status of a group of servers in a network. Each server's status is represented as a boolean value in a list, where `True` indicates that the server is operational and `False` indicates it is not. You need to implement a function `ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_all_servers_operational([]) == True\", \"assert are_all_servers_operational([True]) == True\", \"assert are_all_servers_operational([False]) == False\", \"assert are_all_servers_operational([True, True, True]) == True\", \"assert are_all_servers_operatio... | {
"split": "train",
"index": 82132,
"acecode_id": "oss_3323",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the flood zone designation for a specific area based on its attributes. The function, `calc_floodzone`, takes a dictionary representing the attributes of the area and returns a string indicating the flood zone designation.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_floodzone({'FLD_ZONE': 'AO', 'DEPTH': 3.7}) == 'AO4'\", \"assert calc_floodzone({'FLD_ZONE': 'AH', 'STATIC_BFE': 5.2}) == 'AH5'\", \"assert calc_floodzone({'FLD_ZONE': 'A'}) == 'A'\", \"assert calc_floodzone({'FLD_ZONE': 'X', 'DEPTH': 2.9}) == 'X'\", \"... | {
"split": "train",
"index": 82133,
"acecode_id": "bigcode_python_fns_13126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary of parameters where the keys are string names of parameters and the values are their corresponding values, implement a function `make_params(params: Dict[str, Optional[str]]) -> Dict[str, str]` that processes the input dictionary to create a new dictionary. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_params({'name': 'John Doe', 'age': None, 'city': 'New York'}) == {'name': 'John%20Doe', 'city': 'New%20York'}\", \"assert make_params({'param1': 'hello!', 'param2': 'world?'}) == {'param1': 'hello%21', 'param2': 'world%3F'}\", \"assert make_params({'x':... | {
"split": "train",
"index": 82134,
"acecode_id": "bigcode_python_fns_29830",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the registration of a webhook for a Telegram bot. The function should take a string URL as an input and return a message indicating whether the webhook registration was successful or if there was an error. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_webhook('https://example.com') == 'Registered webhook: https://example.com'\", \"assert register_webhook('http://example.com') == 'Registered webhook: http://example.com'\", \"assert register_webhook('ftp://example.com') == 'Error: Invalid URL'\", \... | {
"split": "train",
"index": 82135,
"acecode_id": "oss_17532",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, list1 and list2, and a list of operations. Implement a function list_operations that performs a series of operations on list1 based on the given operations list. The supported operations are: 'merge', 'common_elements', 'unique_elements', 's... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_operations([1, 2, 3], [4, 5, 6], ['merge']) == [6, 5, 4, 3, 2, 1]\", \"assert list_operations([1, 2, 3], [], ['sort_in_descending']) == [3, 2, 1]\", \"assert list_operations([1, 2, 3], [], ['length_of_list']) == 3\", \"assert list_operations([1, 2, 3], ... | {
"split": "train",
"index": 82136,
"acecode_id": "evol_18038",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of probabilities where each probability is a float between 0 and 1, representing the likelihood of a binary outcome (e.g., success/failure). Your task is to compute the top k probabilities with the highest entropy. The entropy of a probability p is defined ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_top_k_entropy([0.0, 0.0, 0.0], 2) == [(0.0, 0), (0.0, 1)]\", \"assert get_top_k_entropy([1.0, 1.0, 1.0], 2) == [(1.0, 0), (1.0, 1)]\", \"assert get_top_k_entropy([], 2) == []\", \"assert get_top_k_entropy([0.0, 0.0, 0.0, 0.0], None) == [(0.0, 0), (0.0, 1... | {
"split": "train",
"index": 82137,
"acecode_id": "bigcode_python_fns_36038",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that optimally packs a byte string according to a specific message format. The function should take a byte string as input and return a packed byte string based on the following rules: If the length of the input byte string is less th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pack_bytes(b'') == b'\\\\xc4\\\\x00'\", \"assert pack_bytes(b'a') == b'\\\\xc4\\\\x01a'\", \"assert pack_bytes(b'abc') == b'\\\\xc4\\\\x03abc'\", \"assert pack_bytes(b'\\\\x00' * 255) == b'\\\\xc4\\\\xff' + b'\\\\x00' * 255\", \"assert pack_bytes(b'\\\\x00' ... | {
"split": "train",
"index": 82138,
"acecode_id": "bigcode_python_fns_48584",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing SQL queries provided in a list format. Write a function `analyze_sql_queries(queries: List[str]) -> Dict[str, Any]` that takes a list of SQL query strings and returns a dictionary containing the total number of queries analyzed and a list of detail... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_sql_queries(['SELECT * FROM users', 'DELETE FROM orders', 'invalid query']) == {'total': 3, 'rows': [{'sql': 'SELECT * FROM users', 'report': 'Valid SQL query'}, {'sql': 'DELETE FROM orders', 'report': 'Valid SQL query'}, {'sql': 'invalid query', 're... | {
"split": "train",
"index": 82139,
"acecode_id": "bigcode_python_fns_15482",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_parameter_value(parameter_reference: Union[Any, dict], expected_return_type: Optional[type] = None) -> Any` that retrieves a parameter value from a given input. The function takes two parameters: `parameter_reference`, which can be e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_parameter_value({'key': 'value'}, None) == {'key': 'value'}\", \"assert get_parameter_value(42, None) == 42\", \"assert get_parameter_value('hello', None) == 'hello'\", \"assert get_parameter_value({'key': 'value'}, dict) == {'key': 'value'}\", \"assert ... | {
"split": "train",
"index": 82140,
"acecode_id": "bigcode_python_fns_21437",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of complex numbers representing vectors in a vector space, and a matrix representing a linear transformation, implement a function that computes the resulting vectors after applying the transformation to each vector in the list. The function signature should be: de... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_transformation([0+0j], [[1, 0], [0, 0]]) == [0+0j]\", \"assert apply_transformation([], [[1, 0], [0, 1]]) == []\", \"assert apply_transformation([1+1j], [[0, 0], [0, 0]]) == [0+0j]\", \"assert apply_transformation([0+0j], [[1, 1], [1, 1]]) == [0+0j]\",... | {
"split": "train",
"index": 82141,
"acecode_id": "bigcode_python_fns_40219",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that calculates the value of Dirac's constant when given the value of Planck's constant. Validate the input value to ensure it is a positive non-zero number, and raise a ValueError if the input is not valid. The formula to calculate Dirac's constant is g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_diracs_constant(1) == 0.15915494309189535\", \"assert calculate_diracs_constant(2) == 0.3183098861837907\", \"assert calculate_diracs_constant(0.5) == 0.07957747154594767\", \"assert calculate_diracs_constant(10) == 1.5915494309189535\", \"assert c... | {
"split": "train",
"index": 82142,
"acecode_id": "evol_9925",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of coefficients and a transportation network represented as a graph. Each edge in the graph has a flow and a capacity associated with it. Your task is to implement a function that calculates the travel time for an edge between two nodes, given the coefficie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_travel_time([1.0, 2.0, 3.0], 10.0, 10.0, 0.0) == 6.0\", \"assert calculate_travel_time([0.0], 5.0, 5.0, 0.0) == 0.0\", \"assert calculate_travel_time([], 5.0, 5.0, 0.0) == 0.0\", \"assert calculate_travel_time([1.0], 5.0, 0.0, 0.0) == float('inf')\... | {
"split": "train",
"index": 82143,
"acecode_id": "bigcode_python_fns_2231",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function `average_word_length(sentence: str) -> float` that takes a sentence as input and returns the average length of the words in that sentence. A word is defined as a sequence of characters delimited by spaces. If there are no words in the sentence, the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_word_length('Hello world') == 5.0\", \"assert average_word_length('') == 0.0\", \"assert average_word_length('Multiple spaces') == 7.0\", \"assert average_word_length('One') == 3.0\", \"assert average_word_length('SingleWord') == 10.0\", \"assert ... | {
"split": "train",
"index": 82144,
"acecode_id": "evol_19914",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given time from one city to another city in a different timezone. The function should take the city names and the time in the first city as inputs, and return the corresponding local time in the second city. Please ensure that the function c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_time('Europe/London', datetime(2022, 1, 1, 2, 0), 'America/New_York') == datetime(2021, 12, 31, 21, 0)\", \"assert convert_time('America/New_York', datetime(2022, 3, 13, 2, 0), 'Europe/London') == datetime(2022, 3, 13, 7, 0)\", \"assert convert_time(... | {
"split": "train",
"index": 82145,
"acecode_id": "evol_11527",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the configuration settings for a shipping service. The function `get_shipping_config` should return a dictionary containing the configuration details for a shipping service. The dictionary should include the following field... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_shipping_config() == {'key': 'your_key', 'password': 'your_password', 'account_number': 'your_account', 'meter_number': 'your_meter', 'use_test_server': True}\", \"assert isinstance(get_shipping_config(), dict)\", \"assert 'key' in get_shipping_config()\... | {
"split": "train",
"index": 82146,
"acecode_id": "bigcode_python_fns_9046",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `repeat_string(s: str) -> List[str]` that takes a string `s` as input and returns a list containing the string `s` repeated 3 times. Each repetition should be a separate element in the list. For example, if the input is 'hello', the outpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_string('hello') == ['hello', 'hello', 'hello']\", \"assert repeat_string('world') == ['world', 'world', 'world']\", \"assert repeat_string('') == ['', '', '']\", \"assert repeat_string('A') == ['A', 'A', 'A']\", \"assert repeat_string('123') == ['123'... | {
"split": "train",
"index": 82147,
"acecode_id": "bigcode_python_fns_33127",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of plugins, where each plugin has a method `get_event_preprocessors(data)` that returns a list of processors for the given data. Write a function `should_process(data: Any, plugins: List[Plugin]) -> bool` that determines whether processing is needed based o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert should_process('some data', [MockPlugin([]), MockPlugin([])]) == False\", \"assert should_process('some data', [MockPlugin(['processor1']), MockPlugin([])]) == True\", \"assert should_process('some data', [MockPlugin([]), MockPlugin(['processor2'])]) == True... | {
"split": "train",
"index": 82148,
"acecode_id": "bigcode_python_fns_33855",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 3-dimensional vector `body_coords` representing coordinates in a body frame of reference and three Euler angles `theta`, `phi`, and `psi` representing pitch, bank, and yaw angles respectively, write a function `transform_to_horizon(body_coords, theta, phi, psi)` that tr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_to_horizon([1, 0, 0], 0, 0, 0) == [1.0, 0.0, 0.0]\", \"assert transform_to_horizon([0, 1, 0], 0, 0, 0) == [0.0, 1.0, 0.0]\", \"assert transform_to_horizon([0, 0, 1], 0, 0, 0) == [0.0, 0.0, 1.0]\", \"assert transform_to_horizon([0, 0, 1], 0, 0, 3.14... | {
"split": "train",
"index": 82149,
"acecode_id": "bigcode_python_fns_38180",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_prime(n)` that determines if a given integer n is a prime number. The function should return `True` if n is prime and `False` otherwise. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_prime(2) == True\", \"assert check_prime(3) == True\", \"assert check_prime(4) == False\", \"assert check_prime(5) == True\", \"assert check_prime(6) == False\", \"assert check_prime(7) == True\", \"assert check_prime(8) == False\", \"assert check_prim... | {
"split": "train",
"index": 82150,
"acecode_id": "evol_15227",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of upcoming programming contests and a string representing the name of a contest that has been completed. Your task is to implement a function that removes the completed contest from the list and returns the name of the next upcoming contest. Assume the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_upcoming_contest('Codeforces', ['CodeChef', 'AtCoder', 'Codeforces', 'TopCoder']) == 'TopCoder'\", \"assert next_upcoming_contest('Codeforces', ['ContestA', 'ContestB', 'Codeforces', 'ContestD']) == 'ContestD'\", \"assert next_upcoming_contest('ContestC... | {
"split": "train",
"index": 82151,
"acecode_id": "oss_22781",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that retrieves the associated color for a given rank from a predefined dictionary. The function should take in a dictionary containing rank-color mappings and a rank as input. If the rank is present in the dictionary, the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_rank_color({'bronze': 'brown', 'silver': 'grey', 'gold': 'yellow', 'platinum': 'light blue', 'diamond': 'white'}, 'gold') == 'yellow'\", \"assert get_rank_color({'bronze': 'brown', 'silver': 'grey', 'gold': 'yellow', 'platinum': 'light blue', 'diamond': ... | {
"split": "train",
"index": 82152,
"acecode_id": "oss_21625",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the downloading of a video. The function should take a video URL and a download path as input parameters. The function should return a string indicating whether the download was successful or if there was an error. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_video_download('http://example.com/video.mp4', '/path/to/download') == 'Download successful'\", \"assert simulate_video_download('http://example.com/video.mp4', '') == 'Download path not specified'\", \"assert simulate_video_download('', '/path/to/d... | {
"split": "train",
"index": 82153,
"acecode_id": "bigcode_python_fns_48812",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two 2D arrays, `logits` and `targets`, where both arrays have the same shape. Each array represents a set of predicted and target probability distributions for a certain number of samples. Your task is to implement a function `total_variation_divergence(logits: Li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_variation_divergence([[0.1, 0.9], [0.7, 0.3]], [[0.0, 1.0], [0.6, 0.4]], 'mean') == 0.1\", \"assert total_variation_divergence([[0.1, 0.9], [0.7, 0.3]], [[0.0, 1.0], [0.6, 0.4]], 'sum') == 0.2\", \"assert total_variation_divergence([[0.5, 0.5], [0.5, 0... | {
"split": "train",
"index": 82154,
"acecode_id": "bigcode_python_fns_5326",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a JSON object that represents a complex university schedule, write a function `get_course_info(course, schedule)` that retrieves a specific course's date, time, and professor. If the course does not exist in the schedule, the function should raise a `CourseNotFoundError` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_course_info('Physics', {'Physics': {'date': '12/01/2023', 'time': '9-11 AM', 'professor': 'Dr. Feynman'}, 'Maths': {'date': '13/01/2023', 'time': '11-1 PM', 'professor': 'Dr. Gauss'}, 'Computer Science': {'date': '14/01/2023', 'time': '1-3 PM', 'professo... | {
"split": "train",
"index": 82155,
"acecode_id": "evol_19506",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates logging messages with timestamps and different levels of severity for a fictional application. Your function should implement the following requirements:\n\n1. The function `log_message` accepts three parameters: `message` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_message('This is an informational message', 20, 30) == ''\", \"assert log_message('This is a debug message', 10, 20) == ''\", \"assert log_message('Disk space low', 20, 40) == ''\", \"assert log_message('File not found', 20, 30) == ''\", \"assert log_mes... | {
"split": "train",
"index": 82156,
"acecode_id": "oss_29392",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the factorial of a given non-negative integer n. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. Your function should return 1 if n is 0, as 0! is defined to b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 82157,
"acecode_id": "bigcode_python_fns_2044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of particles in different halos. Your task is to implement a function that returns the indices of halos that contain more than a specified number of particles, Ncut. Write a function `filter_halo_pnum(data: List[int], Ncu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_halo_pnum([1500, 800, 1200, 600, 2000], 1000) == [0, 2, 4]\", \"assert filter_halo_pnum([900, 500, 300, 400], 1000) == []\", \"assert filter_halo_pnum([1100, 2000, 1500], 1000) == [0, 1, 2]\", \"assert filter_halo_pnum([100, 200, 300, 400, 500], 500) ... | {
"split": "train",
"index": 82158,
"acecode_id": "bigcode_python_fns_22470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers, num1 and num2, implement a function `add_numbers(num1, num2)` that returns the sum of these two integers.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_numbers(4, 6) == 10\", \"assert add_numbers(0, 0) == 0\", \"assert add_numbers(-1, 1) == 0\", \"assert add_numbers(10, 5) == 15\", \"assert add_numbers(-5, -10) == -15\", \"assert add_numbers(100, 200) == 300\", \"assert add_numbers(1, 1) == 2\", \"asser... | {
"split": "train",
"index": 82159,
"acecode_id": "evol_22262",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_non_digit_string(s: str) -> bool` that determines if a given string consists exclusively of non-digit characters. The function should return True if the string contains only non-digit characters, and False otherwise.\nPlease reason step by step, then wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_non_digit_string('Hello, world!') == True\", \"assert is_non_digit_string('123Hello') == False\", \"assert is_non_digit_string('Hello123') == False\", \"assert is_non_digit_string('') == True\", \"assert is_non_digit_string('abcDEF') == True\", \"assert i... | {
"split": "train",
"index": 82160,
"acecode_id": "evol_12949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a Container class that can hold multiple Components. Implement a function `add_component(container: Container, component: Component) -> bool` that adds a newly constructed Component to the specified Container. The function should return True if the component was s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_component(Container(), Component('Component1')) == True\", \"assert add_component(Container(), Component('Component2')) == True\", \"assert add_component(Container(), Component('Component3')) == True\", \"assert add_component(Container(), Component('Comp... | {
"split": "train",
"index": 82161,
"acecode_id": "bigcode_python_fns_25152",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a given entity exists based on its attributes. Write a function `check_entity_existence(entity, query_field, query_value, block_attrs, create_attrs)` that takes the following parameters: \n- `entity` (dict): A dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_entity_existence({'attributes': {'name': 'Alice', 'age': 30}}, 'name', 'Alice', {}, {}) == ('Entity appears to already exist.', 409)\", \"assert check_entity_existence({'attributes': {'name': 'Alice', 'age': 30}}, 'name', 'Alice', {'age': 30}, {}) == (... | {
"split": "train",
"index": 82162,
"acecode_id": "oss_33578",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a record with key-value pairs. Write a function `generate_insert_statements(records: List[Dict[str, Union[str, int]]], table: str) -> List[str]` that generates SQL INSERT statements to insert these records i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_insert_statements([], 'users') == []\", \"assert generate_insert_statements([{'name': 'Alice', 'age': 30}], 'users') == ['INSERT INTO users (`name`, `age`) VALUES (\\\"Alice\\\", 30);']\", \"assert generate_insert_statements([{'name': 'Dave', 'age':... | {
"split": "train",
"index": 82163,
"acecode_id": "bigcode_python_fns_48621",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that generates a random number of GitHub stars for a repository within the range of 100 to 1000. Your program should also return a specific unit test description for a subpackage. Write a Python function named `generate_repo_info` that acc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_repo_info()[0] >= 100 and generate_repo_info()[0] <= 1000\", \"assert generate_repo_info()[1] == 'Unit tests for the pudl.transform subpackage.'\", \"assert isinstance(generate_repo_info(), tuple)\", \"assert len(generate_repo_info()) == 2\", \"asse... | {
"split": "train",
"index": 82164,
"acecode_id": "oss_24981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to calculate the discounted price of a product. The function should take two parameters: the original price of the product as a floating-point number and the discount percentage as a floating-point number. It should return the discounted ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_discounted_price(100.0, 20.0) == 80.0\", \"assert calculate_discounted_price(200.0, 50.0) == 100.0\", \"assert calculate_discounted_price(150.0, 10.0) == 135.0\", \"assert calculate_discounted_price(75.0, 25.0) == 56.25\", \"assert calculate_discou... | {
"split": "train",
"index": 82165,
"acecode_id": "oss_28922",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing team information, where the key is a unique team identifier (team_id) and the value is a dictionary with the team's details, including the team's name and members. Write a function `get_team_info(team_data: Dict[str, Dict[str, Any]], team_i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_team_info({'team1': {'name': 'Team Alpha', 'members': ['Alice', 'Bob']}, 'team2': {'name': 'Team Beta', 'members': ['Charlie']}}, 'team1') == {'name': 'Team Alpha', 'members': ['Alice', 'Bob']}\", \"assert get_team_info({'team1': {'name': 'Team Alpha', '... | {
"split": "train",
"index": 82166,
"acecode_id": "bigcode_python_fns_26803",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a given text string. Write a function `analyze_text` that takes a string as input and returns a dictionary containing the counts of Chinese characters, English letters, digits, and special symbols in the text. The input text can contain a mix of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_text('') == {'chinese_characters': 0, 'english_letters': 0, 'digits': 0, 'special_symbols': 0}\", \"assert analyze_text('12345') == {'chinese_characters': 0, 'english_letters': 0, 'digits': 5, 'special_symbols': 0}\", \"assert analyze_text('abcXYZ') ... | {
"split": "train",
"index": 82167,
"acecode_id": "oss_17313",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary `creds` that contains information about proxy settings, write a function `get_proxy_ips(creds)` that extracts and returns the IP addresses for both HTTP and HTTPS proxies. The dictionary will have a nested structure where the proxy settings are found under th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_proxy_ips({'proxy_env': {'http_proxy': 'http://192.168.1.1', 'https_proxy': 'https://192.168.1.2'}}) == ('192.168.1.1', '192.168.1.2')\", \"assert get_proxy_ips({'proxy_env': {'http_proxy': 'http://10.0.0.1'}}) == ('10.0.0.1', '0.0.0.0')\", \"assert get_... | {
"split": "train",
"index": 82168,
"acecode_id": "bigcode_python_fns_41551",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a padding function for byte strings. The padding function should add a specified number of padding bytes to the input byte string such that the value of each padding byte is equal to the number of padding bytes added. Your function should take a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pad(b'') == b'\\\\x10' * 16\", \"assert pad(b'Hello') == b'Hello' + b'\\\\x0b' * 11\", \"assert pad(b'1234567890123456') == b'1234567890123456' + b'\\\\x10' * 16\", \"assert pad(b'12345678901234567') == b'12345678901234567' + b'\\\\x0f' * 15\", \"assert pad(... | {
"split": "train",
"index": 82169,
"acecode_id": "oss_5312",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing ground truth names and a list of strings representing classes of interest, write a function `drop_irrelevant_names(gt_names: List[str], used_classes: List[str]) -> List[int]` that returns a list of indices of the ground truth names that are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert drop_irrelevant_names(['apple', 'banana', 'cherry'], ['BANANA', 'date']) == [0, 2]\", \"assert drop_irrelevant_names(['Dog', 'Cat', 'Bird'], ['cat', 'dog']) == [2]\", \"assert drop_irrelevant_names(['one', 'two', 'three'], ['One', 'THREE']) == [1]\", \"asser... | {
"split": "train",
"index": 82170,
"acecode_id": "bigcode_python_fns_26430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a variable, implement a function that returns the type of that variable as a string. The function should handle basic data types including integers, floats, strings, lists, tuples, and dictionaries.\nPlease reason step by step, then write a self-contained Python solution.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_variable_type(1) == 'int'\", \"assert check_variable_type(1.0) == 'float'\", \"assert check_variable_type('hello') == 'str'\", \"assert check_variable_type([1, 2, 3]) == 'list'\", \"assert check_variable_type((1, 2, 3)) == 'tuple'\", \"assert check_var... | {
"split": "train",
"index": 82171,
"acecode_id": "evol_29293",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `display(msg: str) -> None` that outputs a message to the user in a user-friendly format. The function should take a single argument `msg`, which is a string that may represent various types of messages such as informational messages,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display('Hello, World!') is None\", \"assert display('Error: File not found.') is None\", \"assert display('Warning: Low disk space.') is None\", \"assert display('Success: Operation completed successfully.') is None\", \"assert display('Info: Please check y... | {
"split": "train",
"index": 82172,
"acecode_id": "oss_28125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two sentences as input and returns two sets of unique words. The first set should contain words that are present in the first sentence but not in the second, and the second set should contain words that are present in the second sentence but not in t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_words('The quick brown fox jumps over the lazy dog', 'The lazy dog sleeps peacefully') == ({'quick', 'brown', 'fox', 'jumps', 'over'}, {'sleeps', 'peacefully'})\", \"assert get_unique_words('Python is fun', 'Python is great') == ({'fun'}, {'great'... | {
"split": "train",
"index": 82173,
"acecode_id": "evol_12671",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function `reverse_words(s: str) -> str` that takes a string `s` as input and reverses the order of the words in the string. The function should handle multiple spaces between words and ignore leading/trailing spaces. For example, if the input string is ' Hello World ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_words(' Hello World ') == 'World Hello'\", \"assert reverse_words('Python is fun') == 'fun is Python'\", \"assert reverse_words(' a b c ') == 'c b a'\", \"assert reverse_words('SingleWord') == 'SingleWord'\", \"assert reverse_words(' Leading... | {
"split": "train",
"index": 82174,
"acecode_id": "evol_30660",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a pagination feature for a web application that displays notices. Each page should display a maximum of 15 notices. Write a Python function `paginate_notices` that takes a list of notices (where each notice is represented as a dictionary with keys '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert paginate_notices([], 1) == ([], 0)\", \"assert paginate_notices([{'id': 1, 'title': 'Notice 1', 'content': 'Content 1'}], 1) == ([{'id': 1, 'title': 'Notice 1', 'content': 'Content 1'}], 1)\", \"assert paginate_notices([{'id': 1, 'title': 'Notice 1', 'conten... | {
"split": "train",
"index": 82175,
"acecode_id": "oss_7165",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with filtering a list of file paths based on a specified keyword. Implement a function called `filter_file_paths` that takes a list of strings representing file paths and a keyword as inputs. The function should return a new list containing only the file paths th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_file_paths(['/home/user/docs/file.txt', '/home/user/music/song.mp3'], 'docs') == ['/home/user/docs/file.txt']\", \"assert filter_file_paths(['/var/log/syslog', '/usr/bin/python3'], 'bin') == ['/usr/bin/python3']\", \"assert filter_file_paths(['/home/u... | {
"split": "train",
"index": 82176,
"acecode_id": "oss_3878",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of sentences, write a function that extracts all words that start with a specified letter, ignoring case and punctuation. The function should take two parameters: a list of sentences and a letter. It should return a list of unique words that start with the specifie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_words_starting_with(['Hello world!', 'Apples are awesome.'], 'a') == ['apples', 'are', 'awesome']\", \"assert extract_words_starting_with(['Just another test case.'], 'j') == ['just']\", \"assert extract_words_starting_with(['Can a cat catch a rat?']... | {
"split": "train",
"index": 82177,
"acecode_id": "evol_6430",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that checks if a given string contains only characters from a specified set and that it contains all characters from that set at least once. The function should return True if both conditions are met; otherwise, it should return False.\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_string('abcde', 'abcde') == True\", \"assert check_string('abcdeabcde', 'abcde') == True\", \"assert check_string('aabbccddeeff', 'abcdef') == True\", \"assert check_string('xyz', 'abc') == False\", \"assert check_string('abc', 'abcde') == False\", \"a... | {
"split": "train",
"index": 82178,
"acecode_id": "evol_14055",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_JSON(data: str, nestedobj: dict, add_data: str) -> str` that generates a JSON object in the following format: {\"response\": {\"data\": data, \"nested_object\": nestedobj, \"additional_data\": add_data}}. The function should validate its inputs su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_JSON('test', {}, 'done') == '{\\\"response\\\": {\\\"data\\\": \\\"test\\\", \\\"nested_object\\\": {}, \\\"additional_data\\\": \\\"done\\\"}}'\", \"assert generate_JSON('greeting', {'key': 'val'}, 'planet') == '{\\\"response\\\": {\\\"data\\\": \\... | {
"split": "train",
"index": 82179,
"acecode_id": "evol_6698",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given two parameters, an integer d and a float x, write a function `exp_tail(d: int, x: float) -> float` that calculates the tail of the exponential series starting at d. The exponential series is defined as the sum of the series e^x = sum(x^i / i! for i in range(0, infinity)).... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exp_tail(0, 0.0) == 1.0\", \"assert exp_tail(1, 0.0) == 0.0\", \"assert exp_tail(-1, 1.0) == 2.718281828459045\", \"assert exp_tail(-5, 1.0) == 2.718281828459045\", \"assert exp_tail(5, 0.0) == 0.0\", \"assert exp_tail(0, 10.0) == 22026.465794806718\"]}"
} | {
"split": "train",
"index": 82180,
"acecode_id": "bigcode_python_fns_42184",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a nested tuple as input and returns a new tuple containing only the even integers from the nested structure. The function should also eliminate any non-integer elements present in the tuple, including nested tuples. Your function should handle tuples... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_uneven_elements((1, 2, 3, 4)) == (2, 4)\", \"assert remove_uneven_elements(((1, 2), (3, 4))) == (2, 4)\", \"assert remove_uneven_elements((1, 'a', 3.4, (2, 5))) == (2,)\", \"assert remove_uneven_elements(((2, (3, (4, 'b'))), (1.2, 8))) == (2, 4, 8)\",... | {
"split": "train",
"index": 82181,
"acecode_id": "evol_9462",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the vertex normal of a vertex in a 3D model. Vertex normals are crucial for creating realistic lighting effects in computer graphics. You are given a dictionary that maps vertex indices to lists of face normals adjacent t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getVertexNormal(0, {0: [Vector(1, 0, 0), Vector(0, 1, 0)], 1: [Vector(0, 0, 1)]}) == Vector(0.5, 0.5, 0)\", \"assert getVertexNormal(1, {0: [Vector(1, 0, 0), Vector(0, 1, 0)], 1: [Vector(0, 0, 1)]}) == Vector(0, 0, 1)\", \"assert getVertexNormal(2, {0: [Vect... | {
"split": "train",
"index": 82182,
"acecode_id": "oss_2396",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of BMI values and returns a list of corresponding health status classifications based on the standard BMI classification. The classifications should be 'Underweight' if BMI < 18.5, 'Normal weight' if 18.5 <= BMI < 24.9, 'Overweight' if 25 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_bmi([10, 15, 20, 25, 31]) == ['Underweight', 'Underweight', 'Normal weight', 'Overweight', 'Obesity']\", \"assert classify_bmi([50, 49, 48, 47, 46]) == ['Obesity', 'Obesity', 'Obesity', 'Obesity', 'Obesity']\", \"assert classify_bmi([5, 20, 25]) == ... | {
"split": "train",
"index": 82183,
"acecode_id": "evol_20747",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a grid representing a game world where each cell can be empty (0), contain an obstacle (1), the player (P), or the goal (G). Your task is to implement a function that takes the grid, the current position of the player, and an action to be taken ('up', 'down', 'lef... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_player([[0, 0, 0, 0], [0, 1, 0, 0], [0, 'P', 0, 0], [0, 0, 0, 'G']], (2, 1), 'up') == (2, 1)\", \"assert move_player([[0, 0, 0, 0], [0, 1, 0, 0], [0, 'P', 0, 0], [0, 0, 0, 'G']], (2, 1), 'down') == (3, 1)\", \"assert move_player([[0, 0, 0, 0], [0, 1, 0,... | {
"split": "train",
"index": 82184,
"acecode_id": "oss_4789",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary named `params` that contains information about various projects. This dictionary has the following structure: `params` is a dictionary where `params['info']` is another dictionary containing a key 'projs', which is a list of project dictionaries. You ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_projects({'info': {'projs': [{'id': 1}, {'id': 2}, {'id': 3}]}}, [True, False, True]) == {'info': {'projs': [{'id': 1}, {'id': 3}]} }\", \"assert select_projects({'info': {'projs': [{'id': 1}, {'id': 2}]}}, [False, False]) == {'info': {'projs': []}}\"... | {
"split": "train",
"index": 82185,
"acecode_id": "bigcode_python_fns_46189",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `lookup_media(content_id: str, content_type: str) -> Tuple[List[str], str]` that simulates looking up media content from a Plex-like server. The function takes in two parameters: `content_id`, which is a JSON string containing informa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lookup_media('{\\\"plex_key\\\": 123, \\\"plex_server\\\": \\\"MyPlexServer\\\"}', 'movie') == (['MediaItem1', 'MediaItem2'], 'MyPlexServer')\", \"assert lookup_media('{\\\"playqueue_id\\\": 456, \\\"plex_server\\\": \\\"MyPlexServer\\\"}', 'show') == (['Med... | {
"split": "train",
"index": 82186,
"acecode_id": "bigcode_python_fns_36604",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages the playback of songs in a music player. Your function should handle two slots: a 'current' slot that plays the currently active song, and a 'queued' slot that holds a song waiting to play next. The function should accept... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_playback('song1.mp3') == 'Playing: song1.mp3', 'Test Case 1 Failed'\", \"assert manage_playback('song3.mp3') == 'Playing: song3.mp3', 'Test Case 3 Failed'\", \"assert manage_playback('song5.mp3') == 'Playing: song5.mp3', 'Test Case 5 Failed'\", \"asse... | {
"split": "train",
"index": 82187,
"acecode_id": "bigcode_python_fns_43907",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function that verifies if a given string starts with a Unicode character from the range 0370-03FF (Greek and Coptic block), followed by any combination of exactly 3 lower case vowels and consonants in any order. The string should then continue with a sequence of at leas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_string(' \\u0393\\u03b1\\u03b8123') == False\", \"assert verify_string('\\u0393\\u03b1\\u03b823571') == False\", \"assert verify_string('\\u0393\\u03b1\\u03b82 3 5') == False\", \"assert verify_string('\\u0393\\u03b1\\u03b8') == False\", \"assert veri... | {
"split": "train",
"index": 82188,
"acecode_id": "evol_10262",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that takes a list of integers as input and returns a list of integers that are greater than the average value of the list. For each of these integers, square them and return only those squares that are palindromic numbers. A palindromic number is one ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_square([1, 2, 3, 4, 5]) == []\", \"assert filter_and_square([0]) == []\", \"assert filter_and_square([9, 10, 11, 12]) == [121]\", \"assert filter_and_square([5, 6, 7, 8]) == []\", \"assert filter_and_square([2, 3, 4, 5, 6, 7, 8, 9]) == []\", \"ass... | {
"split": "train",
"index": 82189,
"acecode_id": "evol_26772",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing an HTML element, where the keys are parameter names and the values are their corresponding values. Implement a function `has_param(element: Dict[str, str], param: str) -> bool` that checks if the specified parameter `param` exists in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_param({'id': 'header', 'class': 'main'}, 'class') == True\", \"assert has_param({'id': 'header', 'class': 'main'}, 'id') == True\", \"assert has_param({'id': 'header', 'class': 'main'}, 'style') == False\", \"assert has_param({'id': 'header', 'class': 'm... | {
"split": "train",
"index": 82190,
"acecode_id": "bigcode_python_fns_38868",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple pagination function for a web application. The pagination system should allow users to navigate through a list of items by displaying a subset of items based on the page size and page number. Your task is to create a function `get_page_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_page_items([], 5, 1) == []\", \"assert get_page_items([1, 2, 3, 4, 5], 5, 1) == [1, 2, 3, 4, 5]\", \"assert get_page_items([1, 2, 3, 4, 5], 3, 1) == [1, 2, 3]\", \"assert get_page_items([1, 2, 3, 4, 5], 3, 2) == [4, 5]\", \"assert get_page_items([1, 2, 3... | {
"split": "train",
"index": 82191,
"acecode_id": "oss_17740",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates transactions in a simple banking system. The function should take an initial balance and a list of transactions. Each transaction can be either a deposit (indicated by a positive integer) or a withdrawal (indicated by a neg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_final_balance(500, [100, -50, -600]) == 550\", \"assert calculate_final_balance(0, [100, -50]) == 50\", \"assert calculate_final_balance(1000, [200, -500, -300, 100]) == 500\", \"assert calculate_final_balance(200, [100, -50, -100]) == 150\", \"ass... | {
"split": "train",
"index": 82192,
"acecode_id": "oss_3413",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of reviews as strings. Write a function called `classify_reviews` that takes in this list and returns a dictionary with two keys: 'positive' and 'negative'. Each key should map to a list of reviews classified as positive or negative based on their sentiment... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_reviews(['I love this product', 'This is the worst thing ever', 'Fantastic experience', 'I hate it', 'Good value for money']) == {'positive': ['I love this product', 'Fantastic experience', 'Good value for money'], 'negative': ['This is the worst th... | {
"split": "train",
"index": 82193,
"acecode_id": "evol_17802",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of user data and returns a dictionary containing the count of users with each unique role. Each user is represented as a dictionary with the keys 'name' and 'role'. The function should take a list of user diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_users_by_role([]) == {}\", \"assert count_users_by_role([{'name': 'Alice', 'role': 'admin'}]) == {'admin': 1}\", \"assert count_users_by_role([{'name': 'Alice', 'role': 'admin'}, {'name': 'Bob', 'role': 'user'}]) == {'admin': 1, 'user': 1}\", \"assert ... | {
"split": "train",
"index": 82194,
"acecode_id": "oss_24542",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `concatenate_strings(strings: List[str]) -> str` that concatenates all the strings in the list into a single string, separating each string with a space. If the input list is empty, return an empty string. Your function should handl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_strings(['Hello', 'world!']) == 'Hello world!'\", \"assert concatenate_strings(['Leet', 'Code', 'is', 'fun']) == 'Leet Code is fun'\", \"assert concatenate_strings(['This', 'is', 'a', 'test']) == 'This is a test'\", \"assert concatenate_strings([... | {
"split": "train",
"index": 82195,
"acecode_id": "bigcode_python_fns_46798",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that checks if an integer, num, is less than 20 and divisible by 5 without a remainder. The function should return different messages for different cases: 'Number is less than 20 and divisible by 5', 'Number is less than 20 but not divisible by 5', 'Number is e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_num(5) == 'Number is less than 20 and divisible by 5'\", \"assert check_num(10) == 'Number is less than 20 and divisible by 5'\", \"assert check_num(15) == 'Number is less than 20 and divisible by 5'\", \"assert check_num(3) == 'Number is less than 20 ... | {
"split": "train",
"index": 82196,
"acecode_id": "evol_6778",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "An integer set, denoted as S, is defined as 123-separable if the sets S, 2S, and 3S have no common elements. The sets 2S and 3S are derived by multiplying each element in S by 2 and 3 respectively. You are tasked to implement a function F(n), which represents the maximum count ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert F(1) == 1\", \"assert F(2) == 1\", \"assert F(4) == 2\", \"assert F(5) == 3\", \"assert F(7) == 5\"]}"
} | {
"split": "train",
"index": 82197,
"acecode_id": "evol_31099",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two sentences and determines if they are anagrams of each other. Ignore punctuations, spaces, and case sensitivity. The function should return True if they are anagrams and False otherwise. Additionally, the function should handle erroneous inputs gr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('A man, a plan, a canal.', 'A canal, a plan, a man.') == True\", \"assert are_anagrams('Listen', 'Silent') == True\", \"assert are_anagrams('Hello, World!', 'World! Hello') == True\", \"assert are_anagrams('Dormitory', 'Dirty Room') == True\", \... | {
"split": "train",
"index": 82198,
"acecode_id": "evol_21822",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to filter a list of files based on their last modified dates. The function should take two parameters: a list of tuples where each tuple contains a filename and its last modified date in the format 'YYYY-MM-DD HH:MM:SS', and a cuto... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_old_files([('file1.txt', '2023-01-01 12:00:00'), ('file2.txt', '2023-02-01 12:00:00')], '2023-01-15 00:00:00') == ['file1.txt']\", \"assert filter_old_files([('file3.txt', '2023-03-01 12:00:00'), ('file4.txt', '2022-12-31 12:00:00')], '2023-01-01 00:0... | {
"split": "train",
"index": 82199,
"acecode_id": "oss_36781",
"num_tests": 15
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.