data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "Implement a Python function that processes a list of records where each record is a dictionary containing user data (like 'name', 'age', and 'city'). The function should convert this list of records into a list of tuples, where each tuple corresponds to a record and contains th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_user_data([{'name': 'Alice', 'age': 30, 'city': 'New York'}, {'name': 'Bob', 'age': 25, 'city': 'Los Angeles'}]) == [('Alice', 30, 'New York'), ('Bob', 25, 'Los Angeles')]\", \"assert process_user_data([{'name': 'Charlie', 'age': 35}, {'name': 'David...
{ "split": "train", "index": 61500, "acecode_id": "evol_17814", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string of 8 digits, where each digit corresponds to the state of a lamp (0-3). The lamp states are defined as follows: 0 means 'off', 1 means 'on', 2 means 'flashing', and 3 means 'broken'. Write a function `parse_lamp_flags(flags: str) -> Dict[str, Dict[str, st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_lamp_flags('00000000') == {'lamps': {'red': 'off', 'green': 'off', 'blue': 'off', 'yellow': 'off'}}\", \"assert parse_lamp_flags('11111111') == {'lamps': {'red': 'on', 'green': 'on', 'blue': 'on', 'yellow': 'on'}}\", \"assert parse_lamp_flags('22222222...
{ "split": "train", "index": 61501, "acecode_id": "bigcode_python_fns_31555", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates saving a model's weights during a training process. The function should take the following parameters: `verbose` (an integer representing the verbosity level), `monitor` (a string indicating the metric being monitored f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert save_model(1, 'accuracy', 0.85, 0.90, 'model_weights.h5', True) == 'Weights saved to model_weights.h5'\", \"assert save_model(1, 'accuracy', 0.85, 0.80, 'model_weights.h5', True) == 'No save operation performed.'\", \"assert save_model(1, 'accuracy', 0.85, 0...
{ "split": "train", "index": 61502, "acecode_id": "oss_926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that determines if a given integer is a perfect square. If the number is a perfect square, the function should also check if the square root of this number is a prime number. The function should return one of the following three strings: 'The number is n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_perfect_square(0) == 'The number is a perfect square and its square root is a prime number.'\", \"assert check_perfect_square(1) == 'The number is a perfect square and its square root is a prime number.'\", \"assert check_perfect_square(4) == 'The numb...
{ "split": "train", "index": 61503, "acecode_id": "evol_5483", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of movie similarity data and generates a dictionary that maps each movie ID to its corresponding similarity scores. The input is a list of dictionaries, where each dictionary contains three keys: 'movie_id', 'movie_i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_similarity_dict([{'movie_id': 1, 'movie_id2': 2, 'cos_sim': 0.9}, {'movie_id': 1, 'movie_id2': 3, 'cos_sim': 0.7}, {'movie_id': 2, 'movie_id2': 3, 'cos_sim': 0.8}]) == {1: {2: 0.9, 3: 0.7}, 2: {3: 0.8}}\", \"assert generate_similarity_dict([{'movie_...
{ "split": "train", "index": 61504, "acecode_id": "bigcode_python_fns_349", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing an angle in hours (in the format 'H:M:S', where H is hours, M is minutes, and S is seconds), write a function that validates the string and converts it to a float representing the angle in degrees. The hours can be in the range of 0 to 23, minutes an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_hms_to_degrees('12:30:00') == 187.5\", \"assert convert_hms_to_degrees('00:00:00') == 0.0\", \"assert convert_hms_to_degrees('06:15:00') == 93.75\", \"assert convert_hms_to_degrees('18:45:00') == 281.25\", \"assert convert_hms_to_degrees('15:00:00') ...
{ "split": "train", "index": 61505, "acecode_id": "bigcode_python_fns_5436", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a matrix multiplication function that incorporates quantification parameters. The quantification parameters are defined as follows: beta = 0.1, gamma = 2, delta = 100, th = 0.03. Your goal is to implement a function called `matrix_multiply` that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_multiply([[1]], [[1]]) == [[2.0]]\", \"assert matrix_multiply([[0, 0]], [[1, 1], [1, 1]]) == [[0.0, 0.0]]\", \"assert matrix_multiply([[1, 2], [3, 4]], [[0, 0], [0, 0]]) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert matrix_multiply([[1, 1], [1, 1]], [[1, 1]...
{ "split": "train", "index": 61506, "acecode_id": "oss_35058", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers representing card tags and a dictionary that maps each tag to a corresponding item number, write a function `update_card_items(tags: List[int], item_map: Dict[int, int]) -> List[int]` that updates the list of items associated with each tag. The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_card_items([0, 1, 2, 0, 1, 3], {0: 10, 1: 20, 2: 30, 3: 40}) == [10, 20, 30, 40]\", \"assert update_card_items([4, 5, 4, 6], {4: 100, 5: 200}) == [100, 200]\", \"assert update_card_items([7, 8, 9], {1: 11, 2: 22}) == []\", \"assert update_card_items([...
{ "split": "train", "index": 61507, "acecode_id": "bigcode_python_fns_36163", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fib_sequence(n)` that generates the Fibonacci sequence up to the n-th number. The Fibonacci sequence starts with 0 and 1, and every subsequent number is the sum of the two preceding ones. The function should cache previously computed sequences to optimize ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib_sequence(0) == []\", \"assert fib_sequence(1) == [0]\", \"assert fib_sequence(2) == [0, 1]\", \"assert fib_sequence(3) == [0, 1, 1]\", \"assert fib_sequence(4) == [0, 1, 1, 2]\", \"assert fib_sequence(5) == [0, 1, 1, 2, 3]\", \"assert fib_sequence(6) == ...
{ "split": "train", "index": 61508, "acecode_id": "evol_8703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_singleton(cls)` that takes a class `cls` as input and checks whether the class behaves like a singleton. A class is considered a singleton if it only allows one instance of itself to be created. The function should return True if the class is a singleto...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_singleton(Logger) == True\", \"assert is_singleton(Singleton) == True\", \"assert is_singleton(str) == False\", \"assert is_singleton(int) == False\", \"assert is_singleton(list) == False\", \"assert is_singleton(dict) == False\", \"assert is_singleton(se...
{ "split": "train", "index": 61509, "acecode_id": "evol_28167", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a response dictionary and returns a specific value based on the presence of certain keys. Write a Python function `extract_records(response: dict) -> dict` that takes a dictionary `response` as input and returns ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_records({'result': {'records': {'1': 'Record 1', '2': 'Record 2'}}}) == {'1': 'Record 1', '2': 'Record 2'}\", \"assert extract_records({'result': {'status': 'success'}}) == {}\", \"assert extract_records({'result': {}}) == {}\", \"assert extract_reco...
{ "split": "train", "index": 61510, "acecode_id": "oss_35187", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom dictionary-like data structure called `AttrDict` in Python. The `AttrDict` class should allow for attribute-style access to its keys, similar to accessing object attributes. When an attribute is accessed, it should return the correspond...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_attr_dict({'name': 'Alice'}).name == 'Alice'\", \"assert create_attr_dict({'age': 30}).age == 30\", \"assert create_attr_dict({'city': 'New York'}).city == 'New York'\", \"assert create_attr_dict({'person': {'name': 'Bob'}}).person.name == 'Bob'\", \"...
{ "split": "train", "index": 61511, "acecode_id": "oss_36217", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given three strings s1, s2, and s3, write a function that returns the longest common subsequence shared by all three strings. The common subsequence does not need to be contiguous but must maintain the order of characters as they appear in the original strings.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_subsequence('abcxyzdef', 'mnpqrxystuv', 'ghijklmnop') == ''\", \"assert find_common_subsequence('abc', 'abc', 'abc') == 'abc'\", \"assert find_common_subsequence('abc', 'def', 'ghi') == ''\", \"assert find_common_subsequence('a', 'a', 'a') == 'a'...
{ "split": "train", "index": 61512, "acecode_id": "evol_9634", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of challenge categories as input and returns a JSON array containing the names of these challenge categories. The input will be a list of dictionaries, where each dictionary represents a category with at least a key 'nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_category_names([{'name': 'Math'}, {'name': 'Science'}, {'name': 'History'}]) == ['Math', 'Science', 'History']\", \"assert get_category_names([{'name': 'Art'}, {'name': 'Music'}, {'name': 'Literature'}]) == ['Art', 'Music', 'Literature']\", \"assert get_...
{ "split": "train", "index": 61513, "acecode_id": "oss_33258", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a multi-line character string, write a function in Python that identifies and returns a list of palindrome words found in each sentence, along with the sentence number (indexed from 1) they appear in. The function should be case insensitive and should ignore punctuation. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert palindrome_sentences('Some random text with no palindromes.') == []\", \"assert palindrome_sentences('Civic duty or civic responsibility?') == [(1, ['civic', 'civic'])]\", \"assert palindrome_sentences('Can you see the level?') == [(1, ['level'])]\", \"asser...
{ "split": "train", "index": 61514, "acecode_id": "evol_16131", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a given string to extract specific information. The function should take a string `out` as input and perform the following tasks: 1. If the string contains the substring 'ansible_network_os=eos', set the variable `tr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_out('ansible_network_os=eos ansible_host=192.168.1.1 ansible_host=192.168.1.2') == ('https', 'devtype=eos', ['192.168.1.1', '192.168.1.2'])\", \"assert process_out('ansible_host=10.0.0.1') == ('ssh', '', ['10.0.0.1'])\", \"assert process_out('no rele...
{ "split": "train", "index": 61515, "acecode_id": "oss_33183", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested list representing a row of HTML-like elements, determine if the first element contains a specific style attribute indicating that the text is red. The first element is expected to be a list with at least one element, which in turn is also a list containing at lea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_red_header_row([[{'style': 'color: rgb(255,0,0);'}]]) == True\", \"assert is_red_header_row([[{'not_style': 'color: rgb(255,0,0);'}]]) == False\", \"assert is_red_header_row([[{'style': 'color: rgb(255,0,0);'}], []]) == True\", \"assert is_red_header_row(...
{ "split": "train", "index": 61516, "acecode_id": "bigcode_python_fns_41549", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a dictionary named `params` which contains a key called `preprocess_layers`. This key maps to another dictionary that may include a key called `formats`. Your task is to implement a function that checks if the `formats` key exists within the `preprocess_layers` di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_formats_layer({'preprocess_layers': {'formats': 'jpeg'}}) == True\", \"assert check_formats_layer({'preprocess_layers': {'other_key': 'value'}}) == False\", \"assert check_formats_layer({'preprocess_layers': {}}) == False\", \"assert check_formats_laye...
{ "split": "train", "index": 61517, "acecode_id": "bigcode_python_fns_29832", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `compare(x: float, y: float, operator: str) -> Union[bool, str]` that accepts two numerical values and an operator as parameters, and processes a comparison operation between them based on the operator. The function should return the result of the compariso...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare(5, 8, '>') == False\", \"assert compare(5, 8, '<') == True\", \"assert compare(5, 5, '==') == True\", \"assert compare(5, 8, '!=') == True\", \"assert compare(8, 5, '>=') == True\", \"assert compare(5, 5, '<=') == True\", \"assert compare(5, 8, '>=')...
{ "split": "train", "index": 61518, "acecode_id": "evol_3143", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of messages that need to be sent to multiple clients. Each message is represented as a string. Implement a function `send_messages_to_clients(messages: List[str], clients: List[str]) -> List[str]` that simulates sending messages to clients. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_messages_to_clients(['Hello', 'World'], ['Client1', 'Client2']) == ['Sent message: Hello to client: Client1', 'Sent message: Hello to client: Client2', 'Sent message: World to client: Client1', 'Sent message: World to client: Client2']\", \"assert send_...
{ "split": "train", "index": 61519, "acecode_id": "bigcode_python_fns_8300", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simplified version of the NegaMax algorithm for a two-player turn-based game involving a game state and valid moves. The game state can be represented as an integer value, where a higher value indicates a better posit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_best_move(0, [1, 2, 3], 1, -100, 100, 1) == 3\", \"assert find_best_move(5, [2, 3], 0, -100, 100, 1) == 5\", \"assert find_best_move(0, [5, 6], 1, -100, 100, -1) == -5\", \"assert find_best_move(0, [3], 0, -100, 100, 1) == 0\", \"assert find_best_move(6...
{ "split": "train", "index": 61520, "acecode_id": "bigcode_python_fns_36080", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a simple authentication provider in a version control system. The function `get_simple_provider` takes two arguments: `provider`, which is a string representing the authentication provider type, and `poo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_simple_provider('basic', 5) == 'Basic authentication enabled with pool size 5'\", \"assert get_simple_provider('token', 10) == 'Token authentication enabled with pool size 10'\", \"assert get_simple_provider('basic', 0) == 'Authentication provider not su...
{ "split": "train", "index": 61521, "acecode_id": "bigcode_python_fns_16719", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a simple HTML page template. The function, `generate_html_page(title: str, year: int) -> str`, receives a title and a year, and it should return a string that represents an HTML structure with the title in a header and the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_html_page('Production Adjustment', 2023) == '<html><head><title>Production Adjustment</title></head><body><h1>Production Adjustment</h1><footer>2023</footer></body></html>'\", \"assert generate_html_page('Home Page', 2022) == '<html><head><title>Hom...
{ "split": "train", "index": 61522, "acecode_id": "bigcode_python_fns_1356", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the sum of the squares of the even numbers in a given list of integers. Your function should take a list of integers as input and return the sum of the squares of the even numbers in the list. If the list is empty or d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_squares_of_even_numbers([1, 2, 3, 4, 5, 6]) == 56\", \"assert sum_of_squares_of_even_numbers([0, 1, 2, 3, 4]) == 20\", \"assert sum_of_squares_of_even_numbers([]) == 0\", \"assert sum_of_squares_of_even_numbers([1, 3, 5]) == 0\", \"assert sum_of_squar...
{ "split": "train", "index": 61523, "acecode_id": "oss_25995", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with storing calibration parameters for a 3D sensor. Write a function that takes in three lists of floats representing the offsets, slopes, and temperature slopes for the x, y, and z axes. The function should return a dictionary containing the formatted calibrati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert store_calibration_params([1.2345, 2.3456, 3.4567], [0.0001, 0.0002, 0.0003], [0.1, 0.2, 0.3]) == {'calibration-xOffset(g)': 1.2345, 'calibration-yOffset(g)': 2.3456, 'calibration-zOffset(g)': 3.4567, 'calibration-xSlope': 0.0001, 'calibration-ySlope': 0.0002...
{ "split": "train", "index": 61524, "acecode_id": "bigcode_python_fns_17571", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given three strings `word1`, `word2`, and `word3`. Interleave the strings by adding letters in a specific order, starting with `word1`, then `word2`, and finally `word3`. If a string is shorter than the others, skip to the next string once it's exhausted. If a string is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert interleaveStrings('', '', '') == ''\", \"assert interleaveStrings('a', 'b', 'c') == 'abc'\", \"assert interleaveStrings('a', 'b', '') == 'ab'\", \"assert interleaveStrings('', 'b', 'c') == 'bc'\", \"assert interleaveStrings('a', 'b', 'c') == 'abc'\", \"asser...
{ "split": "train", "index": 61525, "acecode_id": "evol_36084", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers, find the longest increasing subsequence consisting of consecutive elements without considering their indices. The list is considered cyclic, meaning that the last element is adjacent to the first element. Implement a function `longest_increasing_subseq...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_increasing_subsequence([1, 2, 3, 4, 5, 3, 2, 6]) == [1, 2, 3, 4, 5]\", \"assert longest_increasing_subsequence([1, 3, 2, 4, 5]) == [2, 4, 5]\", \"assert longest_increasing_subsequence([1, 2, 3, 5, 4]) == [1, 2, 3, 5]\", \"assert longest_increasing_su...
{ "split": "train", "index": 61526, "acecode_id": "evol_22224", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `generate_asterisk_string(n: int) -> str` that generates a string consisting of asterisk characters ('*') of length `n`. The function should raise a `ValueError` if `n` is not an integer or if `n` is negative. The function should return an empty string if `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_asterisk_string(0) == ''\", \"assert generate_asterisk_string(5) == '*****'\", \"assert generate_asterisk_string(10) == '**********'\", \"assert generate_asterisk_string(1) == '*'\", \"assert generate_asterisk_string(3) == '***'\", \"assert generate...
{ "split": "train", "index": 61527, "acecode_id": "evol_2611", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a group of students. Your task is to implement a function that calculates the average score of the students. The average should be rounded down to the nearest integer. If the list is empty, return 0. Implement the func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([90, 80, 70]) == 80\", \"assert calculate_average_score([100, 90, 80, 70]) == 85\", \"assert calculate_average_score([55, 60, 65, 70, 75]) == 65\", \"assert calculate_average_score([0, 0, 0]) == 0\", \"assert calculate_average_score([...
{ "split": "train", "index": 61528, "acecode_id": "bigcode_python_fns_4119", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a stream object which may have a specified encoding. Your task is to write a function `get_stream_encoding(stream)` that returns the encoding of the stream if it exists. If the encoding is not defined in the stream, the function should return the system's default ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_stream_encoding(type('Stream', (object,), {'encoding': 'utf-16'})) == 'utf-16'\", \"assert get_stream_encoding(type('Stream', (object,), {})) == 'utf-8'\", \"assert get_stream_encoding(type('Stream', (object,), {'encoding': 'ascii'})) == 'ascii'\", \"ass...
{ "split": "train", "index": 61529, "acecode_id": "bigcode_python_fns_47169", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three integers a, b, and c, where 0 < a, b, c <= N, implement a function M(a, b, c) that returns the maximum integer m such that the polynomial n^4 + an^3 + bn^2 + cn is a multiple of m for all integers n. For example, M(4, 2, 5) should return 6. You need to ensure that y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert M(1, 1, 1) == 1\", \"assert M(7, 8, 9) == 1\", \"assert M(3, 7, 4) == 1\", \"assert M(1, 2, 3) == 1\", \"assert M(2, 3, 4) == 1\", \"assert M(11, 13, 17) == 1\"]}" }
{ "split": "train", "index": 61530, "acecode_id": "evol_8690", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the results of a lottery draw, where the numbers are supposed to be in the range from 1 to n, inclusive, but one number is missing. Your task is to write a function `find_missing_number` that takes a list of integers as input and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_missing_number([3, 7, 1, 2, 8, 4, 5]) == 6\", \"assert find_missing_number([1, 2, 3, 5]) == 4\", \"assert find_missing_number([2, 3, 4, 5, 6]) == 1\", \"assert find_missing_number([5, 3, 2, 1, 4, 7]) == 6\", \"assert find_missing_number([1, 3, 4, 5, 6])...
{ "split": "train", "index": 61531, "acecode_id": "oss_8311", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the timestamps of different events, write a function `find_first_event_time(timestamps)` that returns the timestamp of the first event. If the list is empty, return -1. The timestamps are guaranteed to be unique.\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_first_event_time([1627890123, 1627890456, 1627890789]) == 1627890123\", \"assert find_first_event_time([1609459200]) == 1609459200\", \"assert find_first_event_time([1612137600, 1612224000, 1612310400]) == 1612137600\", \"assert find_first_event_time([]...
{ "split": "train", "index": 61532, "acecode_id": "bigcode_python_fns_12193", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `primeWithPrimeDigitSum(lst)` that returns a tuple containing the largest prime number from the list and the sum of its digits if the sum of the digits is also prime. If there are no such primes in the list, return None. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert primeWithPrimeDigitSum([4, 6, 8, 10]) == None\", \"assert primeWithPrimeDigitSum([29, 15, 9, 4]) == (29, 11)\", \"assert primeWithPrimeDigitSum([1, 4, 6, 8, 9]) == None\", \"assert primeWithPrimeDigitSum([13, 17, 19, 23]) == (23, 5)\", \"assert primeWithPrim...
{ "split": "train", "index": 61533, "acecode_id": "evol_31171", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with crafting a payload for a hypothetical FTP server vulnerability. The goal is to create a function named `craft_payload` that generates a byte string designed to exploit a buffer overflow. The function should take a single integer parameter, `length`, which sp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert craft_payload(1) == b'A'\", \"assert craft_payload(5) == b'AAAAA'\", \"assert craft_payload(10) == b'AAAAAAAAAA'\", \"assert craft_payload(100) == b'A' * 100\", \"assert craft_payload(256) == b'A' * 256\", \"assert craft_payload(512) == b'A' * 512\", \"asser...
{ "split": "train", "index": 61534, "acecode_id": "oss_26778", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a binary number input to its hexadecimal representation. The input will be a string of binary digits (e.g., '10100101'). Your function should return the hexadecimal result as a string (e.g., 'A5'). Ensure to handle leading zeros appropriately ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_to_hex('10100101') == 'A5'\", \"assert binary_to_hex('0000') == '0'\", \"assert binary_to_hex('11111111') == 'FF'\", \"assert binary_to_hex('1010') == 'A'\", \"assert binary_to_hex('110110101001') == 'DA9'\", \"assert binary_to_hex('0000000000000001')...
{ "split": "train", "index": 61535, "acecode_id": "evol_7482", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of integers as input and returns a new list containing only the unique elements from the original list, preserving their original order. You should not use any built-in Python functions or libraries for this t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 3, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert get_unique_elements([4, 3, 2, 1, 3, 2, 1, 5, 6, 7, 8, 9]) == [4, 3, 2, 1, 5, 6, 7, 8, 9]\", \"assert get_unique_elements([1, 1, 1, 1]) == [1]\", \"assert ...
{ "split": "train", "index": 61536, "acecode_id": "oss_28532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file operations to perform. Each operation is represented as a tuple where the first element is a string indicating the operation type ('upload', 'delete', or 'list'), and the second element is the name of the file (for 'upload' and 'delete' operations) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_file_operations([('upload', 'file1.txt'), ('upload', 'file2.txt'), ('list', None), ('delete', 'file1.txt'), ('list', None)]) == ['file2.txt']\", \"assert process_file_operations([('upload', 'file3.txt'), ('upload', 'file1.txt'), ('delete', 'file1.txt...
{ "split": "train", "index": 61537, "acecode_id": "bigcode_python_fns_1432", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to determine whether a given user-agent string indicates that a browser supports XHTML. Write a Python function called `supports_xhtml(user_agent)` that takes a string representing the user-agent as input. The function should return `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert supports_xhtml('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36') == False\", \"assert supports_xhtml('Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; AS; rv:11.0) like Gecko') == False\",...
{ "split": "train", "index": 61538, "acecode_id": "oss_6618", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that filters predictions based on a given probability threshold. You will receive a list of probabilities for various predictions and a threshold value. Your function should return a list where predictions with probabilities greater tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_predictions([0.1, 0.5, 0.9], 0.6) == [0, 0, 1]\", \"assert filter_predictions([0.0, 0.0, 0.0], 0.1) == [0, 0, 0]\", \"assert filter_predictions([0.2, 0.7, 0.4, 0.8], 0.5) == [0, 1, 0, 1]\", \"assert filter_predictions([0.1, 0.2, 0.3, 0.4, 0.5], 0.0) =...
{ "split": "train", "index": 61539, "acecode_id": "oss_8689", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of peers in an Open Messaging Protocol (OMP) system. The function should either pretty print the list of peers using the `pprint` module if a `json` parameter is set to `True`, or return the number of peer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_peers([], True) is None\", \"assert process_peers([], False) == 0\", \"assert process_peers(['peer1'], True) is None\", \"assert process_peers(['peer1'], False) == 1\", \"assert process_peers(['peer1', 'peer2'], True) is None\", \"assert process_peer...
{ "split": "train", "index": 61540, "acecode_id": "oss_19012", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given string represents a valid question. A valid question must end with a question mark ('?') and must not be empty. Write a function `is_valid_question` that takes a string `input_string` and returns `True` if it is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_question('Is this a question?') == True\", \"assert is_valid_question('This is not a question') == False\", \"assert is_valid_question('') == False\", \"assert is_valid_question('What time is it?') == True\", \"assert is_valid_question('How are you'...
{ "split": "train", "index": 61541, "acecode_id": "oss_707", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `first_n_primes(n: int) -> tuple` that takes an integer `n` as input and returns a tuple containing the first `n` prime numbers. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert first_n_primes(0) == ()\", \"assert first_n_primes(1) == (2,)\", \"assert first_n_primes(2) == (2, 3)\", \"assert first_n_primes(3) == (2, 3, 5)\", \"assert first_n_primes(4) == (2, 3, 5, 7)\", \"assert first_n_primes(5) == (2, 3, 5, 7, 11)\", \"assert first...
{ "split": "train", "index": 61542, "acecode_id": "evol_5368", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists, `freq` and `theta`, where `freq` represents the frequency of occurrences of each word in a corpus and `theta` represents the frequency of occurrences of each word in different topics. You are also given a list `lcandidat` containing candidate labels and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert top_candidates([100, 100, 100], [[10, 20, 30], [40, 50, 60]], ['alpha', 'beta'], 1) == ['beta', 'alpha']\", \"assert top_candidates([3, 6, 9], [[1, 2, 3], [4, 5, 6]], ['cat', 'dog'], 0) == ['cat', 'dog']\", \"assert top_candidates([20, 10], [[2, 4], [1, 5]],...
{ "split": "train", "index": 61543, "acecode_id": "bigcode_python_fns_1393", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines whether a given word should be fixed-case based on specific rules. The function should take a string `w` and an optional list of strings `truelist`. The function returns True if `w` should be fixed-case, None if uncert...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fixedcase_word('hello') == False\", \"assert fixedcase_word('A') == False\", \"assert fixedcase_word('K') == False\", \"assert fixedcase_word('N') == False\", \"assert fixedcase_word('X') == True\", \"assert fixedcase_word('A.', ['A.']) == True\", \"assert f...
{ "split": "train", "index": 61544, "acecode_id": "bigcode_python_fns_19236", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of elements, write a function that returns a new list containing the cube of each positive integer from the original list. Any non-integer values and negative integers should be excluded from the new list.\nPlease reason step by step, then write a self-contained Py...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert raise_to_power_three([1, 2, 3, 4, 5, -2, 'apple']) == [1, 8, 27, 64, 125]\", \"assert raise_to_power_three([-1, -2, -3]) == []\", \"assert raise_to_power_three(['a', 'b', 1, 2]) == [1, 8]\", \"assert raise_to_power_three([]) == []\", \"assert raise_to_power_...
{ "split": "train", "index": 61545, "acecode_id": "evol_1095", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples representing an Auxiliary Vector, where each tuple contains two integers (index, value). Your task is to implement a function that computes the hash of the Auxiliary Vector based on a given step value. The hash function should return a unique hash...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hash_from_e_step([(0, 2)], 0) == hash(((0, 2),))\", \"assert hash_from_e_step([(0, 1), (3, 1)], 0) == hash(((0, 1), (3, 1)))\", \"assert hash_from_e_step([(0, 1), (2, 1), (3, 1)], 0) == hash(((0, 1), (2, 1), (3, 1)))\", \"assert hash_from_e_step([(0, 1)], 0)...
{ "split": "train", "index": 61546, "acecode_id": "bigcode_python_fns_42207", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a receptor activity calculation function based on a given concentration generator. The function takes a string input representing a concentration generator and returns a callable function that computes receptor activity whe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_receptor_activity_function('linear')(10) == 10.0\", \"assert generate_receptor_activity_function('exponential')(1) == 2.718281828459045\", \"assert generate_receptor_activity_function('linear')(0) == 0.0\", \"assert generate_receptor_activity_functi...
{ "split": "train", "index": 61547, "acecode_id": "bigcode_python_fns_7570", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a dictionary `encoding` that maps characters (representing quality scores) to their corresponding integer values. You are also given an integer `min_qual` which represents the minimum required average quality score, and a string `qual_str` consisting of characters...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_average_quality({'A': 1, 'B': 1}, 1, 'AABBA') == True\", \"assert check_average_quality({'A': 10, 'B': 20, 'C': 30}, 20, 'ABC') == True\", \"assert check_average_quality({'A': 0, 'B': 1}, 1, 'ABAB') == False\", \"assert check_average_quality({'P': 3, '...
{ "split": "train", "index": 61548, "acecode_id": "bigcode_python_fns_1642", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a system with a specific number of resources and processes. Your task is to implement a deadlock detection algorithm to determine if the system is in a safe state or not. A safe state means that there is at least one sequence of processes that can be executed with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_deadlock([[0, 1, 0], [2, 0, 0], [3, 0, 2], [2, 1, 1], [0, 0, 2]], [[7, 5, 3], [3, 2, 2], [9, 0, 2], [2, 2, 2], [4, 3, 3]], [3, 3, 2]) == True\", \"assert detect_deadlock([[2, 0, 0], [0, 1, 1], [1, 0, 0]], [[3, 1, 1], [2, 1, 2], [2, 1, 1]], [1, 1, 1]) ...
{ "split": "train", "index": 61549, "acecode_id": "oss_24074", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a database configuration with the following keys: 'initialized', 'dbhost', 'dbpass', 'dbname', 'dbport', and 'dbuser'. The values associated with these keys can be any type. Write a function called `verify_db_config` that takes this dicti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_db_config({'initialized': True, 'dbhost': 'localhost', 'dbpass': 'password', 'dbname': 'test_db', 'dbport': 5432, 'dbuser': 'user'}) == True\", \"assert verify_db_config({'initialized': True, 'dbhost': None, 'dbpass': 'password', 'dbname': 'test_db', ...
{ "split": "train", "index": 61550, "acecode_id": "bigcode_python_fns_21502", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `optimize_model(num_agents: int, num_arms: int, num_iterations: int) -> List[BanditAgent]` that simulates a population-based training process using a multi-armed bandit approach. The function should create a population of agents, each with a deep learning m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimize_model(10, 5, 1000) is not None\", \"assert len(optimize_model(5, 3, 500)) == 5\", \"assert len(optimize_model(2, 10, 100)) == 2\", \"assert len(optimize_model(1, 1, 10)) == 1\", \"assert len(optimize_model(20, 15, 2000)) == 20\", \"assert optimize_m...
{ "split": "train", "index": 61551, "acecode_id": "evol_27483", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks whether a given list of job titles is empty or not. The function should take a single parameter, a list of strings representing job titles. If the list is empty, the function should return True. If the list contains any job ti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_job_list_empty([]) == True\", \"assert is_job_list_empty(['Engineer']) == False\", \"assert is_job_list_empty(['Manager', 'Developer']) == False\", \"assert is_job_list_empty(['Intern', 'Analyst', 'Designer']) == False\", \"assert is_job_list_empty(['']) ...
{ "split": "train", "index": 61552, "acecode_id": "bigcode_python_fns_11433", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string 'accept' representing the Accept header from an HTTP request, and a list of strings 'resource_types' representing available resource types. Your task is to implement a function 'choose_media_type(accept: str, resource_types: List[str]) -> str' that select...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert choose_media_type('text/html', ['text/html', 'application/json']) == 'text/html'\", \"assert choose_media_type('application/json', ['text/html', 'application/json']) == 'application/json'\", \"assert choose_media_type('application/xml;q=0.5, application/json...
{ "split": "train", "index": 61553, "acecode_id": "bigcode_python_fns_2719", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of numbers that can include both integers and floating point numbers, implement a function that checks whether the list is a palindrome. A palindrome is defined as a sequence that reads the same backward as forward. Your function should handle decimals and return T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome([1.1, 2.2, 3.3, 3.3, 2.2, 1.1]) == True\", \"assert is_palindrome([1, 2, 3, 3, 2, 1]) == True\", \"assert is_palindrome([1.0, 2.0, 3.0, 2.0, 1.0]) == True\", \"assert is_palindrome([1.5, 2.5, 3.5, 2.5, 1.5]) == True\", \"assert is_palindrome([1...
{ "split": "train", "index": 61554, "acecode_id": "evol_1910", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the cosine similarity between two vectors. Cosine similarity is a measure of similarity between two non-zero vectors of an inner product space. It is defined to equal the cosine of the angle between them, which is also...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cosine_similarity([1, 2, 3], [4, 5, 6]) == 0.9746318461970762\", \"assert calculate_cosine_similarity([1, 0], [0, 1]) == 0.0\", \"assert calculate_cosine_similarity([0, 0], [0, 0]) == 0.0\", \"assert calculate_cosine_similarity([1, 2, 3], [0, 0, 0]...
{ "split": "train", "index": 61555, "acecode_id": "oss_25762", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes in four parameters: `client_id`, `client_secret`, `username`, and `password`. The function should simulate the process of obtaining an access token, returning a string that represents the access token if the input creden...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_reddit_access_token('valid_client_id', 'valid_client_secret', 'valid_username', 'valid_password') == 'access_token_12345'\", \"assert get_reddit_access_token('invalid_client_id', 'valid_client_secret', 'valid_username', 'valid_password') == 'Invalid Cred...
{ "split": "train", "index": 61556, "acecode_id": "oss_36253", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `parse_nested_parens` that takes a string containing multiple groups of nested parentheses, each separated by a space. The function should determine the depth of the highest parenthetical nests within each group and return a list of these depths. If any gro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_nested_parens('() () ()') == [1, 1, 1]\", \"assert parse_nested_parens('(()())') == [2]\", \"assert parse_nested_parens('()()()()') == [1]\", \"assert parse_nested_parens('((((()))))') == [5]\", \"assert parse_nested_parens('(()()()) (()())') == [2, 2]...
{ "split": "train", "index": 61557, "acecode_id": "evol_9369", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a non-negative integer representing a number of seconds, write a function that converts this number into a string format representing hours, minutes, and seconds as 'H:M:S'. The output should be formatted such that each segment (hours, minutes, seconds) is represented by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert seconds_to_time(0) == '00:00:00'\", \"assert seconds_to_time(59) == '00:00:59'\", \"assert seconds_to_time(60) == '00:01:00'\", \"assert seconds_to_time(3600) == '01:00:00'\", \"assert seconds_to_time(3661) == '01:01:01'\", \"assert seconds_to_time(7200) == ...
{ "split": "train", "index": 61558, "acecode_id": "bigcode_python_fns_34398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer, implement a function `count_embedded_primes(num: int) -> int` that calculates the number of prime numbers that can be formed by the contiguous substrings of the integer. A substring is defined as any sequence of consecutive digits in the integer. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_embedded_primes(123) == 3\", \"assert count_embedded_primes(456) == 1\", \"assert count_embedded_primes(7) == 1\", \"assert count_embedded_primes(11) == 1\", \"assert count_embedded_primes(100) == 0\", \"assert count_embedded_primes(97) == 2\", \"asser...
{ "split": "train", "index": 61559, "acecode_id": "evol_12007", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given that half of a specific number equals 20, write a function to determine what three quarters of that number would be.\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 find_three_quarters() == 30\", \"assert find_three_quarters() == 30\", \"assert find_three_quarters() == 30\", \"assert find_three_quarters() == 30\", \"assert find_three_quarters() == 30\", \"assert find_three_quarters() == 30\", \"assert find_three_quarter...
{ "split": "train", "index": 61560, "acecode_id": "evol_33707", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that generates a 10 x 10 matrix filled with unique prime numbers such that each row and each column has a unique sum. The function should return the generated matrix.\nPlease reason step by step, then write a self-contained Python solution. Give your fin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_with_unique_sums(10) is not None\", \"assert len(matrix_with_unique_sums(10)) == 10\", \"assert all(len(row) == 10 for row in matrix_with_unique_sums(10))\", \"assert all(isinstance(matrix_with_unique_sums(10)[i][j], int) for i in range(10) for j in r...
{ "split": "train", "index": 61561, "acecode_id": "evol_3888", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of resources for an online learning management system. Each resource is represented as a dictionary containing the keys 'id', 'type', 'title', and 'content'. Your function should filter this list to include only ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_forum_resources([{'id': 1, 'type': 'forum', 'title': 'Intro'}, {'id': 2, 'type': 'assignment', 'title': 'Assignment 1'}, {'id': 3, 'type': 'forum', 'title': 'Discussion'}], {'forum': 1}) == [{'id': 1, 'title': 'Intro'}, {'id': 3, 'title': 'Discussion...
{ "split": "train", "index": 61562, "acecode_id": "oss_3708", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a file path, implement a function that checks if the path contains any NUL ('\\0') characters. If the path is valid (i.e., does not contain NUL characters), return the string 'Valid Path'. If the path contains NUL characters, return the string 'Inval...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_path('C:/Users/Example/Documents/file.txt') == 'Valid Path'\", \"assert check_path('C:/Users/Example/Documents/file\\\\0.txt') == 'Invalid Path'\", \"assert check_path('/home/user/file.txt') == 'Valid Path'\", \"assert check_path('\\\\\\\\server\\\\sha...
{ "split": "train", "index": 61563, "acecode_id": "bigcode_python_fns_30586", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_matrix()` that generates a 3D matrix of dimensions 64x64x64, where each element is initialized to -1. The matrix should be created such that each sublist is a distinct object in memory. Return the created matrix.\nPlease reason step by step, then wr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_matrix()[0][0][0] == -1\", \"assert create_matrix()[63][63][63] == -1\", \"assert len(create_matrix()) == 64\", \"assert len(create_matrix()[0]) == 64\", \"assert len(create_matrix()[0][0]) == 64\", \"assert create_matrix()[1][1][1] == -1\", \"assert ...
{ "split": "train", "index": 61564, "acecode_id": "evol_11851", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to validate search queries for a web application. The function should check if the search query meets certain criteria and return a boolean value indicating its validity. The criteria for a valid search query are as follows: 1. The qu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_search_query('') == False\", \"assert validate_search_query('hello world') == True\", \"assert validate_search_query('search123') == True\", \"assert validate_search_query('query') == True\", \"assert validate_search_query('validQuery') == True\", \...
{ "split": "train", "index": 61565, "acecode_id": "oss_10442", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, create a matrix where each row corresponds to the original array multiplied by increasing powers of 2, starting from 2^0 up to the length of the array. If the input array has fewer than 4 elements, pad the resulting matrix with zeroes at the end of e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_matrix([1, 4, 6, 8]) == [[1, 4, 6, 8], [2, 8, 12, 16], [4, 16, 24, 32], [8, 32, 48, 64]]\", \"assert create_matrix([10, 20, 30, 40]) == [[10, 20, 30, 40], [20, 40, 60, 80], [40, 80, 120, 160], [80, 160, 240, 320]]\", \"assert create_matrix([0, 0, 0, 0...
{ "split": "train", "index": 61566, "acecode_id": "evol_21551", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a recruitment process for a given recruiter. The function should take a recruiter object, which has a list of usernames representing the users hired by the recruiter, and a new username to be added to this list. Your fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_hiree([], 'user1') == ['user1']\", \"assert add_hiree(['user1'], 'user2') == ['user1', 'user2']\", \"assert add_hiree(['user1', 'user2'], 'user1') == ['user1', 'user2']\", \"assert add_hiree(['user1', 'user2'], 'user3') == ['user1', 'user2', 'user3']\", ...
{ "split": "train", "index": 61567, "acecode_id": "oss_21528", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function named `create_person` that takes two parameters: a string `name` and an integer `age`. The function should return a dictionary representing a person with the provided name and age. The age must not be a negative number; if it is, the function should raise a Va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_person('Alice', 30) == {'name': 'Alice', 'age': 30}\", \"assert create_person('Bob', 0) == {'name': 'Bob', 'age': 0}\", \"assert create_person('Charlie', 25) == {'name': 'Charlie', 'age': 25}\", \"assert create_person('Diana', 18) == {'name': 'Diana',...
{ "split": "train", "index": 61568, "acecode_id": "evol_29323", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a command to deploy an application on a Kubernetes cluster. The function should take the following parameters: a deployment name (string), a list of exposed ports (list of integers), and a boolean indicating whether to add ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_kubectl_command('my-app', [], False) == ['kubectl run', '--restart=Always', '--limits=cpu=100m,memory=256Mi', '--requests=cpu=25m,memory=64Mi', 'my-app']\", \"assert generate_kubectl_command('service-c', [], True) == ['kubectl run', '--restart=Alway...
{ "split": "train", "index": 61569, "acecode_id": "bigcode_python_fns_4709", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts the name of a subdirectory from a given directory path. Write a Python function `extract_subdirectory_name` that takes a directory path as input and returns the name of the last subdirectory. The function should adher...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_subdirectory_name('/parent_directory/extracted_directory') == 'extracted_directory'\", \"assert extract_subdirectory_name('/invalid_path') == None\", \"assert extract_subdirectory_name('/another/invalid/path/') == None\", \"assert extract_subdirector...
{ "split": "train", "index": 61570, "acecode_id": "oss_20913", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to sanitize output in a web application. Write a function `sanitize_render_output` that takes a single input `output` and returns a sanitized version of the input according to the following rules: - If the input is a string, it should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sanitize_render_output('Hello, World!') == b'Hello, World!'\", \"assert sanitize_render_output('') == b''\", \"assert sanitize_render_output('123') == b'123'\", \"assert sanitize_render_output(b'Hello') == b'Hello'\", \"assert sanitize_render_output(b'') == ...
{ "split": "train", "index": 61571, "acecode_id": "oss_6538", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a URL routing system for a web application. Your goal is to define URL patterns for two API endpoints: one for user login and another for user registration. Implement a function that takes in two URL paths as strings and returns a list of dictionari...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_url_patterns('^login/$', 'UserLoginAPIView', 'login_api') == [{'pattern': '^login/$', 'view': 'UserLoginAPIView', 'name': 'login_api'}, {'pattern': '^register/$', 'view': 'UserCreateAPIView', 'name': 'register_api'}]\", \"assert create_url_patterns('^...
{ "split": "train", "index": 61572, "acecode_id": "oss_22183", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_product_divided_by_gcd(a: int, b: int) -> int` that calculates the greatest common divisor (GCD) of two given integers `a` and `b`, and then returns the product of `a` and `b` divided by their GCD. The function should return an integer result.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_product_divided_by_gcd(10, 20) == 20\", \"assert calculate_product_divided_by_gcd(15, 5) == 15\", \"assert calculate_product_divided_by_gcd(8, 12) == 24\", \"assert calculate_product_divided_by_gcd(7, 3) == 21\", \"assert calculate_product_divided_...
{ "split": "train", "index": 61573, "acecode_id": "evol_22099", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of package dependencies and returns a dictionary representing the dependencies in a more structured format. The input list contains package names and their dependencies in a specific format. If a package has n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_dependencies(['numpy', 'pandas', 'numpy: pandas']) == {'numpy': ['pandas'], 'pandas': []}\", \"assert process_dependencies(['scikit-learn', 'numpy', 'scikit-learn: numpy']) == {'scikit-learn': ['numpy'], 'numpy': []}\", \"assert process_dependencies(...
{ "split": "train", "index": 61574, "acecode_id": "oss_23134", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing an entry that contains the path to an image and its associated label, separated by a comma. Your task is to implement a function that extracts the image path and label from this entry and returns a dictionary with the keys 'image_path' and 'l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_image_info('path/to/image.jpg,3') == {'image_path': 'path/to/image.jpg', 'label': 3}\", \"assert extract_image_info('another/path/to/image.png,5') == {'image_path': 'another/path/to/image.png', 'label': 5}\", \"assert extract_image_info('images/cat.j...
{ "split": "train", "index": 61575, "acecode_id": "bigcode_python_fns_36573", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of dictionaries representing students' information. Each dictionary contains the keys 'name', 'age', and 'grade'. Your function should filter out students who are below a certain age and have a grade lower...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_students([{'name': 'Alice', 'age': 20, 'grade': 88.0}], 18, 85.0) == ['Alice']\", \"assert filter_students([{'name': 'Bob', 'age': 17, 'grade': 92.5}], 18, 85.0) == []\", \"assert filter_students([{'name': 'Charlie', 'age': 19, 'grade': 75.0}], 18, 80...
{ "split": "train", "index": 61576, "acecode_id": "oss_2805", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that converts a given datetime string to a timestamp. The function should take a datetime string in the format 'YYYY-MM-DD HH:MM:SS' and return the corresponding timestamp as an integer. If the input string is not in the correct fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert datetime_str_timestamp('2020-01-01 00:00:00') == 1577836800\", \"assert datetime_str_timestamp('2023-02-28 23:59:59') == 1677628799\", \"assert datetime_str_timestamp('Invalid Date String') == -1\", \"assert datetime_str_timestamp('2020-04-31 12:00:00') == -...
{ "split": "train", "index": 61577, "acecode_id": "oss_36056", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a product with keys 'name', 'price', and 'rating'. Your task is to implement a function called `extract_best_sellers(products)` that takes this list as input and returns a list of product names that have a p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_best_sellers([{'name': 'Book A', 'price': 15, 'rating': 4.5}, {'name': 'Book B', 'price': 25, 'rating': 4.0}, {'name': 'Book C', 'price': 10, 'rating': 5.0}]) == ['Book A', 'Book C']\", \"assert extract_best_sellers([{'name': 'Book D', 'price': 5, 'r...
{ "split": "train", "index": 61578, "acecode_id": "oss_34776", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of plugin types represented as dictionaries, where each dictionary contains an 'id' key with a string value, write a function `get_plugin_type_ids(plugin_types: List[Dict[str, str]]) -> Set[str]` that returns a set of unique plugin IDs. Each plugin ID should appear...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_plugin_type_ids([{'id': 'ostree'}, {'id': 'python_package'}, {'id': 'ostree'}]) == {'ostree', 'python_package'}\", \"assert get_plugin_type_ids([{'id': 'plugin1'}, {'id': 'plugin2'}, {'id': 'plugin1'}]) == {'plugin1', 'plugin2'}\", \"assert get_plugin_ty...
{ "split": "train", "index": 61579, "acecode_id": "bigcode_python_fns_37467", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a two-dimensional matrix containing integers, implement a function `flatten(matrix)` that returns a one-dimensional list containing all the integers from the matrix in the same order they appear. For example, given the matrix [[1, 2], [3, 4]], the function should return [...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert flatten([[5, 6], [7, 8]]) == [5, 6, 7, 8]\", \"assert flatten([[0]]) == [0]\", \"assert flatten([[1, 2, 3], [4, 5, 6]]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten([[], []]) == []\", \"assert flatten([[1], ...
{ "split": "train", "index": 61580, "acecode_id": "evol_6572", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `current` and `previous`, representing the revenue values for the current quarter and the last quarter respectively. Write a function `calculate_changes(current: List[int], previous: List[int]) -> List[float]` that calculates the percentage ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_changes([100, 200, 300], [80, 160, 240]) == [25.0, 25.0, 25.0]\", \"assert calculate_changes([50, 75, 100], [0, 100, 200]) == ['Infinity', -25.0, -50.0]\", \"assert calculate_changes([0, 0, 0], [0, 0, 0]) == ['Infinity', 'Infinity', 'Infinity']\", ...
{ "split": "train", "index": 61581, "acecode_id": "bigcode_python_fns_48205", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that computes the sum of all even numbers in the list and returns it. If there are no even numbers, return 0. The function should be defined as follows: \n\n```python\ndef sum_of_evens(numbers: List[int]) ->...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([-2, -4, 1, 3]) == -6\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"a...
{ "split": "train", "index": 61582, "acecode_id": "bigcode_python_fns_30794", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that modifies user account information based on input data. The function should accept a dictionary representing the user's current account information, which includes their first name, last name, promotion year, and email address. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_account_info({'nom': 'doe', 'prenom': 'john', 'promo': '2023', 'email': 'john.doe@example.com'}, {'nom': 'smith', 'prenom': 'jane', 'promo': '2024', 'email': 'jane.smith@example.com'}) == 'Account successfully modified!'\", \"assert modify_account_inf...
{ "split": "train", "index": 61583, "acecode_id": "bigcode_python_fns_10910", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a non-negative integer `n`. Write a function `last_elements(lst, n)` that returns the last `n` elements of the list `lst`. If `n` is greater than the length of the list, return the string 'invalid'. If `n` is 0, return an empty list. Your fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert last_elements([4, 3, 9, 9, 7, 6], 3) == [9, 7, 6]\", \"assert last_elements([1, 2, 3, 4, 5], 7) == 'invalid'\", \"assert last_elements([1, 2, 3, 4, 5], 0) == []\", \"assert last_elements([], 0) == []\", \"assert last_elements([10, 20, 30], 1) == [30]\", \"as...
{ "split": "train", "index": 61584, "acecode_id": "oss_33930", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that maps status codes from different payment gateways to unified status descriptions. Implement a function `map_status_code(status_code, gateway)` that takes in a status code and a payment gateway name as input and returns the correspond...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_status_code(3, 'Unnamed') == 'Completed'\", \"assert map_status_code(2, 'Unnamed') == 'Processing'\", \"assert map_status_code(1, 'Unnamed') == 'Pending'\", \"assert map_status_code(4, 'Unnamed') == 'Failed'\", \"assert map_status_code(5, 'Robokassa') ==...
{ "split": "train", "index": 61585, "acecode_id": "oss_27172", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a command string for saving an image file based on given parameters. The function should take in three parameters: 'image_name' (a string representing the name of the image), 'filename' (a string representing the name of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_save_command('my_image') == 'docker save -o image.img my_image'\", \"assert generate_save_command('my_image', 'output.img') == 'docker save -o output.img my_image'\", \"assert generate_save_command('my_image', host='localhost') == 'docker save -o im...
{ "split": "train", "index": 61586, "acecode_id": "bigcode_python_fns_37496", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of products, where each product is represented by a dictionary containing its 'name' and 'price'. Your goal is to calculate the total value of the inventory based on the stock quantity and price of each product. Each pro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_inventory_value([]) == 0\", \"assert calculate_inventory_value([{'name': 'Product A', 'price': 10.0, 'stock_quantity': 5}]) == 50.0\", \"assert calculate_inventory_value([{'name': 'Product A', 'price': 10.0, 'stock_quantity': 5}, {'name': 'Product ...
{ "split": "train", "index": 61587, "acecode_id": "oss_2543", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of commit timestamps in chronological order, write a function `get_commits_in_reverse_order` that returns the list of timestamps in reverse chronological order. The input will be a list of strings representing commit timestamps in the format 'YYYY-MM-DD HH:MM:SS'. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_commits_in_reverse_order(['2022-01-01 12:00:00', '2022-01-02 13:30:00', '2022-01-03 14:45:00']) == ['2022-01-03 14:45:00', '2022-01-02 13:30:00', '2022-01-01 12:00:00']\", \"assert get_commits_in_reverse_order(['2021-05-01 09:00:00']) == ['2021-05-01 09:...
{ "split": "train", "index": 61588, "acecode_id": "bigcode_python_fns_20793", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns the current timestamp in UTC format if a given variable does not exist. If the variable exists, return its value instead. Implement the function `get_timestamp(logging_start_dt: Optional[str]) -> str`, where `logging_start_dt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_timestamp(None) is not None\", \"assert isinstance(get_timestamp(None), str)\", \"assert get_timestamp('2023-10-10T00:00:00Z') == '2023-10-10T00:00:00Z'\", \"assert get_timestamp('2023-10-10T12:00:00Z') == '2023-10-10T12:00:00Z'\", \"assert get_timestamp...
{ "split": "train", "index": 61589, "acecode_id": "bigcode_python_fns_36158", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with extracting main characters from a given anime dataset. Write a function `get_main_characters(data: dict) -> list` that takes in a dictionary representing an anime dataset and returns a list of main character names. The input dictionary will contain a key 'ma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_main_characters({'mainCharacters': {'nodes': [{'name': 'Naruto'}, {'name': 'Sakura'}]}}) == ['Naruto', 'Sakura']\", \"assert get_main_characters({'mainCharacters': {'nodes': [{'name': 'Luffy'}, {'name': 'Zoro'}, {'name': 'Nami'}]}}) == ['Luffy', 'Zoro', ...
{ "split": "train", "index": 61590, "acecode_id": "bigcode_python_fns_36826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that contains information about a passport in the format 'Country;PassportNumber;ExpiryDate', where 'Country' is made up of letters, 'PassportNumber' is a combination of letters and digits, and 'ExpiryDate' is in the format YYYY-MM-DD. Write a function th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_passport_info('USA;B1234567;2025-12-30') == {'country': 'USA', 'passport_number': 'B1234567', 'expiry_date': '2025-12-30'}\", \"assert parse_passport_info('Germany;C9876543;2023-05-15') == {'country': 'Germany', 'passport_number': 'C9876543', 'expiry_d...
{ "split": "train", "index": 61591, "acecode_id": "evol_35209", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the processing of an image by an external command-line tool. The function should take two string parameters: an input image path and an output image path. Instead of actually processing the image, the function will simply r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_image('input1.jpg', 'output1.jpg') == 'Processed image from input1.jpg and saved to output1.jpg'\", \"assert process_image('input2.png', 'output2.png') == 'Processed image from input2.png and saved to output2.png'\", \"assert process_image('input3.bm...
{ "split": "train", "index": 61592, "acecode_id": "oss_19897", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a report header for a table that shows the performance of various functions over multiple dimensions. Your function should take in an integer `dimension` (1 <= dimension <= 10) and a string `captionFormat`, which will be used to format the caption...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_report(2, 'Table Summary: %s') == ['Table showing the ERT in number of function evaluations divided by the best ERT measured during BBOB-2009 for dimension 2', '<!--pptablesf00102DHtml-->', '<!--pptablesf00202DHtml-->', '<!--pptablesf00302DHtml-->',...
{ "split": "train", "index": 61593, "acecode_id": "bigcode_python_fns_35555", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the longest increasing subsequence in an array. The function should return both the length of the longest increasing subsequence and the subsequence itself. The function should use dynamic programming principles to ensure efficiency. For exa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_increasing_subsequence([0, 1, 0, 3, 2, 3]) == (4, [0, 1, 2, 3])\", \"assert longest_increasing_subsequence([7, 7, 7, 7, 7]) == (1, [7])\", \"assert longest_increasing_subsequence([1, 2, 3, 4, 5]) == (5, [1, 2, 3, 4, 5])\", \"assert longest_increasing...
{ "split": "train", "index": 61594, "acecode_id": "evol_10861", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with parsing a simplified version of BGP attributes. Implement a function `parse_bgp_attr(atype: int, aval_buf: bytes) -> Tuple[str, Union[str, List[int]], int]` that takes in an attribute type and a value buffer. The function should return a tuple containing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_bgp_attr(1, b'\\\\x00') == ('ORIGIN', 'IGP', 1)\", \"assert parse_bgp_attr(1, b'\\\\x01') == ('ORIGIN', 'EGP', 1)\", \"assert parse_bgp_attr(1, b'\\\\x02') == ('ORIGIN', 'INCOMPLETE', 1)\", \"assert parse_bgp_attr(2, b'\\\\x00\\\\x02\\\\x00\\\\x00\\\\x...
{ "split": "train", "index": 61595, "acecode_id": "bigcode_python_fns_504", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `count_primes(array)` that takes a list of integers as input and returns the count of prime numbers in that list. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. For example, given the input array = [2...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_primes([2, 3, 4, 7, 11, 15, 16, 17]) == 5\", \"assert count_primes([1, 4, 6, 8, 9, 10]) == 0\", \"assert count_primes([2, 5, 11, 13, 17]) == 5\", \"assert count_primes([10, 12, 14, 15]) == 0\", \"assert count_primes([29, 31, 37, 41]) == 4\", \"assert c...
{ "split": "train", "index": 61596, "acecode_id": "evol_30923", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, implement a function that returns a list of characters that appear more than once in the string. Each character in the output list should only appear once, even if it appears multiple times in the input string. The order of characters in the output list should b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert duplicate_characters('hello') == ['l']\", \"assert duplicate_characters('abcdef') == []\", \"assert duplicate_characters('abca') == ['a']\", \"assert duplicate_characters('aabbcc') == ['a', 'b', 'c']\", \"assert duplicate_characters('') == []\", \"assert dup...
{ "split": "train", "index": 61597, "acecode_id": "evol_12630", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a two-dimensional list of integers, implement a function that counts the occurrences of each unique integer in the list and returns a list of tuples sorted by the frequency of occurrence in descending order. Each tuple should contain the integer and its frequency. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_occurrences([[1, 1, 1], [2, 2], [3]]) == [(1, 3), (2, 2), (3, 1)]\", \"assert count_occurrences([[0, 0, 0], [0, 0, 0]]) == [(0, 6)]\", \"assert count_occurrences([[1], [1], [1], [1], [1]]) == [(1, 5)]\", \"assert count_occurrences([[1, 2, 3], [4, 5, 6]...
{ "split": "train", "index": 61598, "acecode_id": "evol_35089", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that checks if two strings are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, using all the original letters exactly once. Your function should take two s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'pale') == False\", \"assert are_anagrams('Dormitory', 'Dirty room') == True\", \"assert are_anagrams('The Morse Code', 'Here ...
{ "split": "train", "index": 61599, "acecode_id": "oss_12326", "num_tests": 16 }