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 function `median(l: list, _cmp_func: callable) -> float` that calculates the median of a list of numbers based on a custom comparison function. The function should first eliminate duplicate values from the list, then determine the median. If the length of the list i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([1, 2, 4, 5], lambda a, b: a - b) == 3.0\", \"assert median([3, 1, 2], lambda a, b: a - b) == 2.0\", \"assert median([5, 3, 1, 2, 4], lambda a, b: a - b) == 3.0\", \"assert median([1, 1, 1, 1], lambda a, b: a - b) == 1.0\", \"assert median([1, 3, 5, 2... | {
"split": "train",
"index": 63400,
"acecode_id": "evol_24027",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes an encoded string containing JSON data and returns a dictionary of the decoded information. The encoded data is provided as a string. Your function should handle potential errors, such as invalid JSON format or decod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_keyfile('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}') == {'name': 'Alice', 'age': 30}\", \"assert process_keyfile('{\\\"city\\\": \\\"New York\\\", \\\"population\\\": 8500000}') == {'city': 'New York', 'population': 8500000}\", \"assert process_... | {
"split": "train",
"index": 63401,
"acecode_id": "oss_13962",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the time difference in seconds between a given datetime and the current datetime, which you will simulate using a fixed datetime. The function `calculate_time_difference(given_datetime)` will take a datetime object as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_time_difference(datetime.datetime(2023, 5, 15, 11, 0, 0)) == 3600\", \"assert calculate_time_difference(datetime.datetime(2023, 5, 15, 12, 0, 0)) == 0\", \"assert calculate_time_difference(datetime.datetime(2023, 5, 14, 12, 0, 0)) == 86400\", \"ass... | {
"split": "train",
"index": 63402,
"acecode_id": "oss_9533",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of file names (including their extensions) as input and returns a list of all the Python files (.py extension) present in that list. Create a function `filter_python_files` that takes a single argument:\n- `file_l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_python_files(['file1.py', 'file2.txt', 'file3.py', 'file4.py', 'file5.java']) == ['file1.py', 'file3.py', 'file4.py']\", \"assert filter_python_files(['script.py', 'document.pdf', 'image.png', 'setup.py']) == ['script.py', 'setup.py']\", \"assert filt... | {
"split": "train",
"index": 63403,
"acecode_id": "oss_17321",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing a mesh with various components (vertices, edges, and faces), write a function `mesh_summary_count(mesh: Dict[str, Any]) -> Tuple[int, int, int]` that returns a tuple containing the total counts of points (PT), triangles (T3), and quadrilaterals (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mesh_summary_count({'vert2': {'size': 2}, 'vert3': {'size': 3}, 'tria3': {'size': 1}, 'quad4': {'size': 2}}) == (5, 1, 2)\", \"assert mesh_summary_count({'vert2': {'size': 0}, 'tria3': {'size': 0}, 'quad4': {'size': 0}}) == (0, 0, 0)\", \"assert mesh_summary... | {
"split": "train",
"index": 63404,
"acecode_id": "bigcode_python_fns_49813",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples where each tuple contains a patient's ID, a filename, and a class label ('positive' or 'negative'), write a function that organizes these filenames into a nested dictionary structure. The keys of the dictionary should be the class labels, and the values s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_files([('1', 'img1.png', 'negative'), ('2', 'img2.png', 'positive'), ('3', 'img3.png', 'negative')]) == {'negative': ['img1.png', 'img3.png'], 'positive': ['img2.png']}\", \"assert organize_files([('4', 'img4.png', 'positive'), ('5', 'img5.png', 'po... | {
"split": "train",
"index": 63405,
"acecode_id": "bigcode_python_fns_9609",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the distance between two points in a 2D plane. Write a Python function `calculate_distance` that takes four parameters: `x1`, `y1`, `x2`, and `y2`, representing the coordinates of the two points (x1, y1) and (x2, y2) resp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distance(1, 2, 4, 6) == 5.0\", \"assert calculate_distance(0, 0, 3, 4) == 5.0\", \"assert calculate_distance(1, 1, 1, 1) == 0.0\", \"assert calculate_distance(-1, -1, -4, -5) == 5.0\", \"assert calculate_distance(3, 4, 0, 0) == 5.0\", \"assert calc... | {
"split": "train",
"index": 63406,
"acecode_id": "oss_5460",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that processes a list of integers by downsampling the values based on a given downsampling factor. The downsampling operation divides each integer in the list by the downsampling factor and returns a new list containing the downsampled val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert downsample_data([10, 20, 30], 2) == [5, 10, 15]\", \"assert downsample_data([10, 20, 30], 3) == [3, 6, 10]\", \"assert downsample_data([10, 20, 30], 1) == [10, 20, 30]\", \"assert downsample_data([], 2) == []\", \"assert downsample_data([5], 5) == [1]\", \"a... | {
"split": "train",
"index": 63407,
"acecode_id": "oss_34399",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of error messages and returns a report containing the count of unique error messages and a list of those unique messages. Each error message is a string. Your function should output a dictionary with two fields: 'count',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_error_report(['Error A', 'Error B', 'Error A']) == {'count': 2, 'messages': ['Error A', 'Error B']}\", \"assert generate_error_report(['Error C', 'Error C', 'Error C']) == {'count': 1, 'messages': ['Error C']}\", \"assert generate_error_report(['Err... | {
"split": "train",
"index": 63408,
"acecode_id": "bigcode_python_fns_44074",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates the type of a target in a cloud environment. The valid target types are as follows: 'AWS::RDS::DBInstance', 'AWS::RDS::DBCluster', 'AWS::Redshift::Cluster', 'AWS::DocDB::DBInstance', 'AWS::DocDB::DBCluster'. Your function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_target_types('AWS::RDS::DBInstance') == 'AWS::RDS::DBInstance'\", \"assert validate_target_types('AWS::RDS::DBCluster') == 'AWS::RDS::DBCluster'\", \"assert validate_target_types('AWS::Redshift::Cluster') == 'AWS::Redshift::Cluster'\", \"assert vali... | {
"split": "train",
"index": 63409,
"acecode_id": "bigcode_python_fns_28092",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a secure authentication system for a web application. The system should generate authentication data for a user that includes an account ID and three tokens: an access token, a refresh token, and a device token. Each of these tokens is represented b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_auth_data(1, 'access123', 'refresh123', 'device123') == {'account_id': 1, 'access_token': 'access123', 'refresh_token': 'refresh123', 'device_token': 'device123'}\", \"assert generate_auth_data(2, 'access456', 'refresh456', 'device456') == {'account... | {
"split": "train",
"index": 63410,
"acecode_id": "oss_31509",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that returns all distinct triplets (three numbers) that add up to a specific target value. The triplets should be returned as a list of lists, and no triplet should contain duplicate values. The order of the triplets and the order of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert three_number_sum([0, 0, 0, 0], 0) == [[0, 0, 0]]\", \"assert three_number_sum([-1, 0, 1, 2, -1, -4], 0) == [[-1, -1, 2], [-1, 0, 1]]\", \"assert three_number_sum([1, 1, 1, 1, 1], 3) == [[1, 1, 1]]\", \"assert three_number_sum([], 0) == []\", \"assert three_n... | {
"split": "train",
"index": 63411,
"acecode_id": "evol_16587",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of packages. Your task is to find the maximum weight that can be achieved by combining any two distinct packages. The weight of a combination is defined as the sum of the weights of the two packages. If there are fewer t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_combination_weight([1, 2, 3, 4, 5]) == 9\", \"assert max_combination_weight([10, 20, 30]) == 50\", \"assert max_combination_weight([5]) == 0\", \"assert max_combination_weight([]) == 0\", \"assert max_combination_weight([1, 1, 1, 1]) == 2\", \"assert max... | {
"split": "train",
"index": 63412,
"acecode_id": "bigcode_python_fns_33034",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an iterable containing a mix of integers and strings, implement a function that returns an array where each unique string is replaced by its corresponding index in the sorted list of unique values. If there are no strings, return the original iterable as an array. The out... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert discretize_categories(['apple', 'banana', 'apple', 'orange']) == [0, 1, 0, 2]\", \"assert discretize_categories([1, 2, 3]) == [1, 2, 3]\", \"assert discretize_categories(['cat', 'dog', 'cat', 'bird']) == [1, 2, 1, 0]\", \"assert discretize_categories(['orang... | {
"split": "train",
"index": 63413,
"acecode_id": "bigcode_python_fns_48074",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes two dictionaries as input and returns a new dictionary that contains all the key-value pairs from both input dictionaries. If a key exists in both dictionaries, the value from the second dictionary should take precedence.\nPlease reason step b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unify_dicts({'x': 1, 'y': 2}, {'y': 3, 'z': 4}) == {'x': 1, 'y': 3, 'z': 4}\", \"assert unify_dicts({'a': 1}, {'a': 2, 'b': 3}) == {'a': 2, 'b': 3}\", \"assert unify_dicts({}, {'a': 1}) == {'a': 1}\", \"assert unify_dicts({'x': 1}, {}) == {'x': 1}\", \"asser... | {
"split": "train",
"index": 63414,
"acecode_id": "evol_5536",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a configuration dictionary that contains information about deployment and upgrade processes, implement a function `get_polarion_id(config: dict) -> str` that returns the polarion_id based on the following rules: 1. If the 'upgrade' key in the 'UPGRADE' section of the conf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_polarion_id({'REPORTING': {'polarion': {'upgrade_manual_id': 'U_MANUAL', 'upgrade_auto_id': 'U_AUTO', 'deployment_id': 'D_DEPLOY'}}, 'UPGRADE': {'upgrade': True}, 'DEPLOYMENT': {'subscription_plan_approval': 'Manual'}}) == 'U_MANUAL'\", \"assert get_pola... | {
"split": "train",
"index": 63415,
"acecode_id": "bigcode_python_fns_12537",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating a similarity score between two addresses represented as strings. The similarity score is defined as the percentage of words that are common between the two addresses, divided by the total number of unique words in both addresses. Write a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_similarity('123 Maple Rd', '123 Maple Rd') == 1.0\", \"assert calculate_similarity('5th Avenue', '5th Avenue') == 1.0\", \"assert calculate_similarity('1 Infinite Loop', '2 Infinite Loop') == 0.5\", \"assert calculate_similarity('500 Fifth Ave', '6... | {
"split": "train",
"index": 63416,
"acecode_id": "bigcode_python_fns_38959",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of objects, where each object is represented as a dictionary with two keys: 'name' (a string) and 'deleted' (a boolean). Your task is to implement a function `filter_active_objects(objects)` that takes a list of these objects and returns a new list containi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_active_objects([{'name': 'Object1', 'deleted': False}, {'name': 'Object2', 'deleted': True}, {'name': 'Object3', 'deleted': False}]) == [{'name': 'Object1', 'deleted': False}, {'name': 'Object3', 'deleted': False}]\", \"assert filter_active_objects([{... | {
"split": "train",
"index": 63417,
"acecode_id": "oss_30193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `perform_operation(num1: float, num2: float, operation: str) -> float` that simulates basic arithmetic operations. The function should take two numbers and a string representing an arithmetic operation ('+', '-', '*', '/'). It should return the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_operation(1, 2, '+') == 3\", \"assert perform_operation(5, 3, '-') == 2\", \"assert perform_operation(4, 2, '*') == 8\", \"assert perform_operation(8, 2, '/') == 4\", \"assert perform_operation(10, 5, '/') == 2\", \"assert perform_operation(3.5, 2.5,... | {
"split": "train",
"index": 63418,
"acecode_id": "oss_174",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of strings, implement a function that determines the length of the longest common subsequence (LCS) between the two lists. The longest common subsequence is defined as the maximum length of a sequence that appears in both lists in the same order, but not necessa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_subsequence(['A', 'B', 'C'], ['D', 'E', 'F']) == 0\", \"assert longest_common_subsequence(['A', 'B', 'C'], ['A', 'B', 'C']) == 3\", \"assert longest_common_subsequence(['X', 'Y', 'Z'], ['A', 'B', 'C']) == 0\", \"assert longest_common_subsequen... | {
"split": "train",
"index": 63419,
"acecode_id": "evol_19945",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to find the longest common prefix among a set of strings. The longest common prefix is the longest string that is a prefix of all strings in the set. Implement the function `longest_common_prefix(strings)` that takes a list of strings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\", \"assert longest_common_prefix(['dog', 'racecar', 'car']) == ''\", \"assert longest_common_prefix(['a', 'a', 'a']) == 'a'\", \"assert longest_common_prefix(['']) == ''\", \"assert longest_common_... | {
"split": "train",
"index": 63420,
"acecode_id": "oss_22290",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two 3-dimensional vectors v and w represented as lists of three integers, implement a function that calculates the signed length of the projection of vector v on vector w. The projection length is defined as the dot product of vectors v and w divided by the length of vect... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert projection_length([3, 4, 0], [1, 0, 0]) == 3.0\", \"assert projection_length([0, 0, 0], [1, 1, 1]) == 0.0\", \"assert projection_length([10, 0, 0], [0, 10, 0]) == 0.0\", \"assert projection_length([1, 1, 1], [0, 0, 1]) == 1.0\", \"assert projection_length([1... | {
"split": "train",
"index": 63421,
"acecode_id": "bigcode_python_fns_16738",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and an integer value, implement a function that returns the index of the first occurrence of the integer in the array. If the integer is not found, return -1. The function should be named `find_first_index` and take two parameters: an array of integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_first_index([1, 7, 9, 8, 5], 9) == 2\", \"assert find_first_index([1, 7, 9, 8, 5], 1) == 0\", \"assert find_first_index([1, 7, 9, 8, 5], 5) == 4\", \"assert find_first_index([1, 7, 9, 8, 5], 8) == 3\", \"assert find_first_index([1, 7, 9, 8, 5], 7) == 1\... | {
"split": "train",
"index": 63422,
"acecode_id": "evol_18311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that compiles a given template string by replacing placeholders with actual values. The template string may contain multiple placeholders, and you need to replace all occurrences of the placeholders with the corresponding actual values fro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compile_template('Hello, {{name}}!', {'name': 'John'}) == 'Hello, John!'\", \"assert compile_template('Your balance is {{balance}}.', {'balance': '$100'}) == 'Your balance is $100.'\", \"assert compile_template('Welcome, {{user}}. Your role is {{role}}.', {'... | {
"split": "train",
"index": 63423,
"acecode_id": "oss_28428",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates fetching the system description and contact information from a remote SNMP agent. The function should take two parameters: `system_description` (a string representing the system description) and `contact_information` (a str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_snmp_info('Linux Server 1', 'admin@example.com') == 'System Description: Linux Server 1, Contact Information: admin@example.com'\", \"assert fetch_snmp_info('Router 2020', 'support@example.com') == 'System Description: Router 2020, Contact Information:... | {
"split": "train",
"index": 63424,
"acecode_id": "oss_22757",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the dimensions of several multi-dimensional arrays, and a corresponding list of point types that indicate the expected dimensions for those arrays. Your task is to determine if you can squeeze out the first dimension (dimension 0) f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_squeeze_output_dim_0([1, 1, 1], ['a', 'b', 'c']) == True\", \"assert can_squeeze_output_dim_0([2, 1, 2], ['a', 'b', 'c']) == False\", \"assert can_squeeze_output_dim_0([3, 2, 1], ['a', 'b', 'c']) == False\", \"assert can_squeeze_output_dim_0([1], ['a']) ... | {
"split": "train",
"index": 63425,
"acecode_id": "bigcode_python_fns_43435",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of SummerVoucher objects and performs specific operations based on the attributes of each object. Each SummerVoucher object has attributes such as id, amount, and status. Your function should iterate through t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_summer_vouchers([SummerVoucher(1, 50, 'active')]) == None\", \"assert process_summer_vouchers([SummerVoucher(2, 150, 'redeemed')]) == None\", \"assert process_summer_vouchers([SummerVoucher(None, 75, 'active')]) == None\", \"assert process_summer_vou... | {
"split": "train",
"index": 63426,
"acecode_id": "oss_20106",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a set of rules for a simplified query language. Each rule can have a name and a set of arguments, which can be either integers (representing the index of other rules) or references to other rules. Your task is to implement a function that takes a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unique_rules([('rule1', [1, 'rule2']), ('rule2', []), ('rule1', [2])]) == ['rule2']\", \"assert find_unique_rules([('ruleA', []), ('ruleB', []), ('ruleC', [])]) == ['ruleA', 'ruleB', 'ruleC']\", \"assert find_unique_rules([('rule1', [1]), ('rule2', [2])... | {
"split": "train",
"index": 63427,
"acecode_id": "oss_23298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries `resource_list` and a dictionary `default_values`, write a function `merge_default_values(resource_list, default_values)` that merges each dictionary in `resource_list` with `default_values`. If a key from `default_values` already exists in a dictio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_default_values([{'x': 5}], {'x': 10, 'y': 20}) == [{'x': 5, 'y': 20}]\", \"assert merge_default_values([{'name': 'Alice'}, {'name': 'Bob'}], {'age': 30}) == [{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 30}]\", \"assert merge_default_values([],... | {
"split": "train",
"index": 63428,
"acecode_id": "bigcode_python_fns_2649",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of mixed data types, implement a function that filters out all non-integer values and returns a new list containing only the integer values sorted in descending order. The function should take a single parameter, which is the list to be processed, and should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_descending([2, '3', 4.5, 5, 'abc', 6]) == [6, 5, 2]\", \"assert print_descending([1, 2, 3]) == [3, 2, 1]\", \"assert print_descending([]) == []\", \"assert print_descending(['a', 'b', 'c']) == []\", \"assert print_descending([5, 5, 5]) == [5, 5, 5]\", ... | {
"split": "train",
"index": 63429,
"acecode_id": "evol_26495",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a collection of numbers. Your task is to implement a function that takes this list and returns the sum of all unique numbers in the list. A unique number is defined as a number that appears exactly once in the list. If there are no ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_unique_numbers([5, 5, 5, 5]) == 0\", \"assert sum_of_unique_numbers([0, 0, 0, 0]) == 0\", \"assert sum_of_unique_numbers([-1, -2, -3, -2, -1]) == -3\", \"assert sum_of_unique_numbers([1]) == 1\", \"assert sum_of_unique_numbers([2, 3, 4, 2, 4]) == 3\",... | {
"split": "train",
"index": 63430,
"acecode_id": "bigcode_python_fns_42872",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the balance of an address at different heights, implement a function `address_balance_history(heights: List[int], balances: List[int], timestamps: Optional[List[int]] = None, flat: bool = True) -> Union[Dict[str, List[int]], List[Dict[str, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert address_balance_history([3, 2, 1], [300, 200, 100]) == {'heights': [3, 2, 1], 'balances': [300, 200, 100]}\", \"assert address_balance_history([3, 2, 1], [300, 200, 100], [10, 20, 30]) == {'heights': [3, 2, 1], 'timestamps': [10, 20, 30], 'balances': [300, 2... | {
"split": "train",
"index": 63431,
"acecode_id": "bigcode_python_fns_25371",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Design a function `create_person` that takes two parameters: a string `name` and an integer `age`. The function should return a dictionary representing a person, where the keys are 'name' and 'age' with their corresponding values. The name should be a string and the age should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_person('Alice', 30) == {'name': 'Alice', 'age': 30}\", \"assert create_person('Bob', 25) == {'name': 'Bob', 'age': 25}\", \"assert create_person('Charlie', 0) == {'name': 'Charlie', 'age': 0}\", \"assert create_person('Diana', 18) == {'name': 'Diana',... | {
"split": "train",
"index": 63432,
"acecode_id": "evol_9924",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating-point numbers and a threshold value, write a function that determines if there are any two distinct elements in the list whose absolute difference is less than the given threshold. The function should return True if such a pair exists, and False otherwi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_close_elements([1.0, 2.0, 3.0], 0.5) == False\", \"assert has_close_elements([1.0, 1.4, 1.5], 0.5) == True\", \"assert has_close_elements([1.1, 1.2, 1.3, 1.4], 0.3) == True\", \"assert has_close_elements([100.0, 100.1, 100.5], 0.4) == True\", \"assert ha... | {
"split": "train",
"index": 63433,
"acecode_id": "evol_19627",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an uncompressed public key represented as a byte array of length 65. The first byte of the array indicates the format of the key (which should be 0x04 for uncompressed keys). The next 64 bytes represent the x and y coordinates of the key. Your task is to write a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compress_public_key(bytes([0x04] + [1]*64)) == bytes([0x03] + [1]*32)\", \"assert compress_public_key(bytes([0x04] + [255]*64)) == bytes([0x03] + [255]*32)\", \"assert compress_public_key(bytes([0x04] + [10]*32 + [11]*32)) == bytes([0x03] + [10]*32)\", \"ass... | {
"split": "train",
"index": 63434,
"acecode_id": "bigcode_python_fns_38917",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floating point numbers. Write a Python function that identifies the number(s) with the least occurrences in the list. In case of multiple numbers having the least occurrences, return them in the order of their first appearance in the list. If the list is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_least_occurrences([1.0, 2.0, 2.0, 3.0, 3.0, 4.0]) == [1.0, 4.0]\", \"assert find_least_occurrences([5.5, 6.6, 5.5, 7.7, 6.6, 8.8]) == [7.7, 8.8]\", \"assert find_least_occurrences([1.5]) == [1.5]\", \"assert find_least_occurrences([]) == []\", \"assert ... | {
"split": "train",
"index": 63435,
"acecode_id": "evol_21711",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers as input and returns a new list containing only the even numbers from the input list. The function should not modify the original list and should maintain the order of the even numbers as they appeared in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert get_even_numbers([7, 8, 10, 12, 15]) == [8, 10, 12]\", \"assert get_even_numbers([0, -1, -2, -3, 4]) == [0, -2, 4]\", \"assert get_even_numbers([1, 3, 5, 7]) == []\", \"assert get_even_numbers([-2... | {
"split": "train",
"index": 63436,
"acecode_id": "oss_32666",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the color representation of a numerical value based on its sign. The function should return 'green' if the input value is non-negative (greater than or equal to zero) and 'red' if the input value is negative. Implement a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_color(5) == 'green'\", \"assert get_color(0) == 'green'\", \"assert get_color(-1) == 'red'\", \"assert get_color(-10) == 'red'\", \"assert get_color(100) == 'green'\", \"assert get_color(-50) == 'red'\", \"assert get_color(42) == 'green'\", \"assert get_... | {
"split": "train",
"index": 63437,
"acecode_id": "bigcode_python_fns_45960",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries representing energy values for different types. Each dictionary contains an entry for a specific energy type, 'Potential'. The input dictionary represents the initial energy, while the output dictionary represents the final energy after some proce... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert potential_energy_diff({'Potential': 100}, {'Potential': 150}) == 50\", \"assert potential_energy_diff({'Potential': 200}, {'Potential': 100}) == -100\", \"assert potential_energy_diff({'Potential': 500}, {'Potential': 500}) == 0\", \"assert potential_energy_... | {
"split": "train",
"index": 63438,
"acecode_id": "bigcode_python_fns_26741",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of depth ranges represented as a list of two floats [min_depth, max_depth] and a float col_height representing the height of a column, implement a function `expected_tops_bases(depth_range: List[float], col_height: float) -> Tuple[List[float], List[float]]` that co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert expected_tops_bases([1.0, 2.0], 1.0) == ([1.0], [2.0])\", \"assert expected_tops_bases([0.0, 3.0], 2.0) == ([0.0, 1.0, 2.0], [2.0, 3.0, 4.0])\", \"assert expected_tops_bases([5.0, 7.0], 0.5) == ([5.0, 6.0], [5.5, 6.5])\", \"assert expected_tops_bases([2.0, 2... | {
"split": "train",
"index": 63439,
"acecode_id": "bigcode_python_fns_38657",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function called `calculate_difference` that takes two parameters, `x` and `y`. The function should return the absolute difference between the two integers. If either `x` or `y` is not an integer, the function should raise a ValueError with the message 'Both i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_difference(10, 5) == 5\", \"assert calculate_difference(5, 10) == 5\", \"assert calculate_difference(-10, -5) == 5\", \"assert calculate_difference(-5, -10) == 5\", \"assert calculate_difference(0, 0) == 0\", \"assert calculate_difference(3, 3) == ... | {
"split": "train",
"index": 63440,
"acecode_id": "evol_26420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a specific sequence of characters, invert the case of the letters, round the numeric parts to the nearest even number, double the special symbols, and tally the frequency of each character post transformation in the sequence. Implement the function `twofold_transmutation(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert twofold_transmutation('aBc123!@') == ('AbC124!!@@', {'A': 1, 'b': 1, 'C': 1, '1': 1, '2': 1, '4': 1, '!': 2, '@': 2})\", \"assert twofold_transmutation('!@#') == ('!!@@##', {'!': 2, '@': 2, '#': 2})\", \"assert twofold_transmutation('') == ('', {})\", \"asse... | {
"split": "train",
"index": 63441,
"acecode_id": "evol_13699",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `trinarySearch(arr: List[int], x: int) -> int` that performs a trinary search to find the index of the element `x` in the sorted list `arr`. If `x` is found, return its index; otherwise, return -1. The list `arr` is guaranteed to be sorted in ascending orde... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trinarySearch([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 8) == 7\", \"assert trinarySearch([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 1) == 0\", \"assert trinarySearch([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 12) == 11\", \"assert trinarySearch([1, 2, 3, 4, 5, 6... | {
"split": "train",
"index": 63442,
"acecode_id": "evol_12344",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` composed of both lower and upper case English alphabets, write a function `makeGood(s)` that transforms the string into a 'good' string. A string is considered 'good' if it does not contain two consecutive characters `s[i]` and `s[i + 1]` such that `s[i]` is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert makeGood('leEeetcode') == 'leetcode'\", \"assert makeGood('abBAcC') == ''\", \"assert makeGood('s') == 's'\", \"assert makeGood('aA') == ''\", \"assert makeGood('Pp') == ''\", \"assert makeGood('abcde') == 'abcde'\", \"assert makeGood('rR') == ''\", \"assert... | {
"split": "train",
"index": 63443,
"acecode_id": "evol_13770",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a Python function called `sort_tuples` that accepts a list of tuples as input. Each tuple contains two integers and one string. The function should sort the list based on the following criteria: first by the first integer in ascending order, then by the second integer in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_tuples([(2, 5, 'aba'), (2, 5, 'ab'), (3, 1, 'abc'), (1, 7, 'abcd'), (4, 3, 'abcde')]) == [(1, 7, 'abcd'), (2, 5, 'aba'), (2, 5, 'ab'), (3, 1, 'abc'), (4, 3, 'abcde')]\", \"assert sort_tuples([(1, 2, 'hello'), (1, 2, 'world'), (2, 3, 'foo'), (2, 1, 'bar'... | {
"split": "train",
"index": 63444,
"acecode_id": "evol_18060",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of Sample objects, each containing a unique identifier called 'nagim_id'. Your task is to implement a function `populate_qc_values(samples: List[Sample], namespace: str) -> List[Tuple[str, str]]` that populates the 'qc_values' attribute of each Sample objec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert populate_qc_values([Sample('sample1'), Sample('sample2'), Sample('sample3'), Sample('sample4')], 'test_namespace') == [('sample1', 'high'), ('sample2', 'medium'), ('sample3', 'low'), ('sample4', '')]\", \"assert populate_qc_values([Sample('sample1'), Sample(... | {
"split": "train",
"index": 63445,
"acecode_id": "bigcode_python_fns_14085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing an adjacency list of a graph. Each key in the dictionary is a node, and its corresponding value is another dictionary where keys are neighboring nodes and values are lists of elements connected to those neighbors. Your task is to implemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements({'A': {'B': [1, 2], 'C': [3]}, 'B': {'A': [2, 4], 'C': [1]}, 'C': {'A': [3]}}) == {1, 2, 3, 4}\", \"assert unique_elements({'X': {'Y': [5, 6], 'Z': [7]}, 'Y': {'X': [6, 8], 'Z': [5]}, 'Z': {'X': [7], 'Y': [8]}}) == {5, 6, 7, 8}\", \"assert un... | {
"split": "train",
"index": 63446,
"acecode_id": "bigcode_python_fns_13447",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes two lists of strings as input: 'input_list' and 'output_list'. The function should replace each string in 'input_list' with its corresponding string from 'output_list' based on their indices. If a string in 'input_list' does not have a corresp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert substitute_strings(['apple', 'banana'], ['fruit', 'tasty']) == ['fruit', 'tasty']\", \"assert substitute_strings(['a', 'b', 'c'], ['x', 'y']) == ['x', 'y', 'c']\", \"assert substitute_strings(['one', 'two', 'three'], ['uno', 'dos']) == ['uno', 'dos', 'three'... | {
"split": "train",
"index": 63447,
"acecode_id": "evol_3361",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a tuple named 'my_tuple' that contains three distinct prime numbers less than 10. Implement a function 'validate_arithmetic_theorem(t: Tuple[int], n: int) -> List[int]' that takes this tuple and a composite number 'n' as parameters. The function should return a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_arithmetic_theorem((2, 3, 5), 30) == [2, 3, 5]\", \"assert validate_arithmetic_theorem((2, 3, 5), 18) == [2, 3, 3]\", \"assert validate_arithmetic_theorem((2, 3, 5), 8) == [2, 2, 2]\", \"assert validate_arithmetic_theorem((2, 3, 5), 15) == [3, 5]\",... | {
"split": "train",
"index": 63448,
"acecode_id": "evol_22081",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates writing messages to a buffer and flushing the buffered data. Implement the function `custom_write` that takes a list of messages and returns a single string that represents the concatenated output of all messages in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_write(['Hello', 'world']) == 'Hello world'\", \"assert custom_write(['Python', 3.8, 'is', 'fun']) == 'Python 3.8 is fun'\", \"assert custom_write([]) == ''\", \"assert custom_write(['LeetCode', 'is', 'great!']) == 'LeetCode is great!'\", \"assert cust... | {
"split": "train",
"index": 63449,
"acecode_id": "oss_23561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n)` that returns the nth number in the Fibonacci sequence using recursion. The function should start the sequence with 0 and 1 (i.e., Fibonacci(1) = 0, Fibonacci(2) = 1, Fibonacci(3) = 1, Fibonacci(4) = 2, ...). The function should handle possibl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == 0\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 1\", \"assert fibonacci(4) == 2\", \"assert fibonacci(5) == 3\", \"assert fibonacci(6) == 5\", \"assert fibonacci(7) == 8\", \"assert fibonacci(8) == 13\", \"assert fibonacci(9) == 2... | {
"split": "train",
"index": 63450,
"acecode_id": "evol_9769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of folders, where each folder contains a list of image filenames. Each filename is a string that may or may not end with the '.jpg' extension. Your task is to implement a function `count_images(folders: List[List[str]]) -> Tuple[int, int]` that takes a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_images([['image1.jpg'], [], ['image2.jpg', 'image3.jpg']]) == (3, 3)\", \"assert count_images([['image1.png', 'image2.png'], ['image3.png']]) == (0, 2)\", \"assert count_images([[], [], []]) == (0, 3)\", \"assert count_images([[''], ['image.jpg']]) == ... | {
"split": "train",
"index": 63451,
"acecode_id": "oss_19913",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string in the format '{chrom}__substr__{start}_{end}', where '{chrom}' is a chromosome name, '{start}' is the starting position, and '{end}' is the ending position, write a function `get_chrom_start_end_from_string(s)` that extracts and returns the chromosome name as a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_chrom_start_end_from_string('chr01__substr__11838_13838') == ('chr01', 11838, 13838)\", \"assert get_chrom_start_end_from_string('chr02__substr__2000_3000') == ('chr02', 2000, 3000)\", \"assert get_chrom_start_end_from_string('chrX__substr__500_1500') ==... | {
"split": "train",
"index": 63452,
"acecode_id": "bigcode_python_fns_40476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a list of URL patterns and extracts the view names associated with each URL. The URL patterns are represented as a list of strings, where each string contains the path and view name separated by a comma. The view name i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_view_names(['path(\\\"home/\\\", views.home_view, name=\\\"home\\\")']) == {'home/': 'home'}\", \"assert extract_view_names(['path(\\\"about/\\\", views.about_view, name=\\\"about\\\")']) == {'about/': 'about'}\", \"assert extract_view_names(['path(\... | {
"split": "train",
"index": 63453,
"acecode_id": "oss_3994",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that splits a list of ranges into two halves and returns the second half in reverse order. The ranges are represented as tuples of integers, where each tuple contains two elements: the start and end of the range (inclusive). The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_half_ranges([(1, 5), (6, 10), (11, 15), (16, 20)]) == [(16, 20), (11, 15)]\", \"assert split_half_ranges([(1, 1), (2, 2), (3, 3)]) == [(3, 3)]\", \"assert split_half_ranges([(1, 3), (4, 6), (7, 9), (10, 12), (13, 15), (16, 18)]) == [(16, 18), (13, 15),... | {
"split": "train",
"index": 63454,
"acecode_id": "oss_8509",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list that can contain various types of elements, including integers, strings, booleans, None, and nested lists. Your task is to implement a function that transforms this input list into a new list based on the following rules: \n\n1. If an element is None, it sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_list([]) == []\", \"assert transform_list([7, 8, [9, [10, 11]], 'nested']) == ['7', '8', ['9', ['10', '11']], 'NESTED']\", \"assert transform_list([None, None, None]) == [None, None, None]\", \"assert transform_list(['a', 'b', 'c']) == ['A', 'B', '... | {
"split": "train",
"index": 63455,
"acecode_id": "bigcode_python_fns_8309",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked to implement a function `getInheritanceOrder(kingName: str, births: List[Tuple[str, str]], deaths: List[str], exiles: List[str]) -> List[str]` that simulates the inheritance order in a monarchy. Given the name of the king, a list of births (where each birth speci... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getInheritanceOrder('king', [('king', 'andy'), ('king', 'bob'), ('andy', 'matthew')], ['bob'], []) == ['king', 'andy', 'matthew']\", \"assert getInheritanceOrder('king', [('king', 'andy'), ('king', 'bob')], [], []) == ['king', 'andy', 'bob']\", \"assert getI... | {
"split": "train",
"index": 63456,
"acecode_id": "evol_26387",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a basic in-memory database for a generic model in a Python application. The function, `base_repository`, should handle basic CRUD (Create, Read, Update, Delete) operations for the specified model. The function should ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert base_repository([('create', {'id': 1, 'name': 'test1'}), ('read_all',), ('read_by_id', 1)]) == [{'id': 1, 'name': 'test1'}]\", \"assert base_repository([('create', {'id': 1, 'name': 'test1'}), ('read_by_id', 2)]) == None\", \"assert base_repository([('read_a... | {
"split": "train",
"index": 63457,
"acecode_id": "oss_11245",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates downloading files from an FTP server or copying them from a local file system based on given parameters. Implement a function `download_files_by_name(accession: str, file_name: str, ftp_download_enabled: bool, input_folder:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_files_by_name('ACC123', 'file1.txt', True, '/input', '/output') == 'Data will be downloaded from FTP to /output'\", \"assert download_files_by_name('ACC456', 'file2.txt', False, '/input', '/output') == 'Data will be copied from /input to /output'\",... | {
"split": "train",
"index": 63458,
"acecode_id": "bigcode_python_fns_14533",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves all the values from a specific column in a given dataset. The dataset is represented as a list of dictionaries, where each dictionary contains key-value pairs corresponding to column names and their respective row value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_column_values([{'Name': 'Alice', 'Age': 25}, {'Name': 'Bob', 'Age': 30}], 'Name') == ['Alice', 'Bob']\", \"assert get_column_values([{'Name': 'Alice', 'Age': 25}, {'Name': 'Bob', 'Age': 30}], 'Age') == [25, 30]\", \"assert get_column_values([{'City': 'Ne... | {
"split": "train",
"index": 63459,
"acecode_id": "oss_31343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are asked to implement a function that generates a custom user registration form. The function should take the user's first name, last name, email, username, password1, and password2 as input parameters. It should validate the email and ensure that the first name and last n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user_form('John', 'Doe', 'john.doe@example.com', 'johndoe', 'password123', 'password123') == {'first_name': 'John', 'last_name': 'Doe', 'email': 'john.doe@example.com', 'username': 'johndoe', 'password1': 'password123', 'password2': 'password123'}\", ... | {
"split": "train",
"index": 63460,
"acecode_id": "oss_28116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that computes the factorial of a non-negative integer n using recursion. The function should take a single integer n as input and return the factorial of n. The factorial of a number n is defined as the product of all positive integers less than or e... | 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": 63461,
"acecode_id": "evol_21539",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that compares the scores of long and short answers in a natural language processing task. The function takes in two dictionaries: `gold_annotation_dict` and `pred_dict`. Each dictionary maps an example ID to a list of NQLabels, where ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_answer_scores({}, {}) == ([], [])\", \"assert compare_answer_scores({'1': [NQLabel('1', 3, 2)]}, {'1': [NQLabel('1', 4, 2)]}) == ([1.0], [0.0])\", \"assert compare_answer_scores({'1': [NQLabel('1', 5, 5)]}, {'1': [NQLabel('1', 5, 5)]}) == ([0.0], [0.... | {
"split": "train",
"index": 63462,
"acecode_id": "oss_26801",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a Python function that takes a list of integers as input and returns a new list containing only the unique integers from the original list, maintaining the order of their first appearance. Write a function `get_unique_integers(nums: List[int]) -> Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 3, 1, 2, 4]) == [1, 2, 3, 4]\", \"assert get_unique_integers([5, 5, 5, 5]) == [5]\", \"assert get_unique_integers([10, 20, 10, 30, 20]) == [10, 20, 30]\", \"assert get_unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert... | {
"split": "train",
"index": 63463,
"acecode_id": "oss_3495",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string containing JSON formatted data as input and returns the data as a Python dictionary. Your function should handle any potential errors that may occur during the JSON decoding process and return an appropriate error ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_json_string('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}') == {'name': 'John', 'age': 30}\", \"assert parse_json_string('{\\\"city\\\": \\\"New York\\\", \\\"country\\\": \\\"USA\\\"}') == {'city': 'New York', 'country': 'USA'}\", \"assert parse_json... | {
"split": "train",
"index": 63464,
"acecode_id": "oss_362",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function that accepts two lists of integers and returns the smallest absolute difference between any two elements from the two lists. The function should take two parameters, list1 and list2, which are both arrays of integers. If either list is empty, return -1.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_diff([2, 4, 7, 13], [3, 8, 9, 14]) == 1\", \"assert min_diff([100, 200, 300], [150, 250]) == 50\", \"assert min_diff([5, 10, 15], [1, 2, 3]) == 2\", \"assert min_diff([-1, -5, -10], [0, 2, 3]) == 1\", \"assert min_diff([0], [0]) == 0\", \"assert min_diff... | {
"split": "train",
"index": 63465,
"acecode_id": "evol_32183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that conditionally applies one of two given functions based on a boolean predicate. The function takes a boolean `pred`, a value `true_operand`, a callable `true_fun`, a value `false_operand`, and a callable `false_fun`. If `pred` is True, the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert conditional_apply(True, 5, lambda x: x + 2, 10, lambda y: y * 2) == 7\", \"assert conditional_apply(False, 5, lambda x: x + 2, 10, lambda y: y * 2) == 20\", \"assert conditional_apply(True, 'Hello', lambda x: x + ' World', 'Goodbye', lambda y: y) == 'Hello W... | {
"split": "train",
"index": 63466,
"acecode_id": "bigcode_python_fns_13905",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given dictionary of options and returns the appropriate 'cms_text_length' based on the value of 'cms'. The function should take in a dictionary called 'options' which contains the following keys: 'cms', 'int_max_le... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_cms_text_length({'cms': 'int', 'int_max_len': 100, 'eff_max_len': 150, 'att_max_len': 120}) == 100\", \"assert get_cms_text_length({'cms': 'eff', 'int_max_len': 100, 'eff_max_len': 150, 'att_max_len': 120}) == 150\", \"assert get_cms_text_length({'cms': ... | {
"split": "train",
"index": 63467,
"acecode_id": "oss_32974",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `inspect_for_none(t: tuple) -> Union[str, List[List[int]]]` that inspects a provided tuple to identify all occurrences of None values. The function should return the positions of None values in a nested structure as a list of lists, where each inner list re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inspect_for_none(((1, 2, None), (4, 5, 6), (None, 8, 9))) == [[0, 2], [2, 0]]\", \"assert inspect_for_none((None, (1, None), 3)) == [[0], [1, 1]]\", \"assert inspect_for_none((1, 2, 3)) == 'No None values found'\", \"assert inspect_for_none(((None, 1), (None... | {
"split": "train",
"index": 63468,
"acecode_id": "evol_4619",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a dictionary that contains the count of each unique integer in the list. The function should process the list and construct the dictionary where the keys are the unique integers and the values are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_integers([1, 2, 2, 3, 1, 4]) == {1: 2, 2: 2, 3: 1, 4: 1}\", \"assert count_unique_integers([]) == {}\", \"assert count_unique_integers([5, 5, 5]) == {5: 3}\", \"assert count_unique_integers([10, 20, 10, 20, 30]) == {10: 2, 20: 2, 30: 1}\", \"ass... | {
"split": "train",
"index": 63469,
"acecode_id": "oss_13581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `divide(num1, num2)` that takes two parameters, `num1` and `num2`. Your function should return the result of the division `num1 / num2`. If `num2` is zero, raise a `ValueError` with the message 'Division by zero is not allowed.' If either `num1` or `num2` i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide(10, 2) == 5.0\", \"assert divide(9, 3) == 3.0\", \"assert divide(7, 1) == 7.0\", \"assert divide(0, 5) == 0.0\", \"assert divide(15, 5) == 3.0\", \"assert divide(5, 2) == 2.5\", \"assert divide(20, 4) == 5.0\", \"assert divide(8, 2) == 4.0\", \"assert... | {
"split": "train",
"index": 63470,
"acecode_id": "evol_28082",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two lists of strings, `FIRST_NAMES` and `LAST_NAMES`, implement a function `generate_random_name` that randomly generates a Chinese name consisting of either two or three characters. The first character should always be selected from `FIRST_NAMES`. If the generated name h... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_random_name()) in [2, 3]\", \"assert generate_random_name()[0] in FIRST_NAMES\", \"assert isinstance(generate_random_name(), str)\", \"assert len(generate_random_name()) >= 2\", \"assert len(generate_random_name()) <= 3\", \"assert generate_rand... | {
"split": "train",
"index": 63471,
"acecode_id": "bigcode_python_fns_4035",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a dataset management system. Given a list of overlay names, your function should return a list of unique overlay names present in the dataset. If the list of overlay names is empty or contains duplicates, return an empt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_unique_overlays(['overlay1', 'overlay1', 'overlay2']) == []\", \"assert list_unique_overlays([]) == []\", \"assert list_unique_overlays(['overlay1', 'overlay2', 'overlay1']) == []\", \"assert list_unique_overlays(['overlayA', 'overlayB', 'overlayC', 'ov... | {
"split": "train",
"index": 63472,
"acecode_id": "bigcode_python_fns_426",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `top_list_prev` and `top_list`, compute the weighted Kendall's Tau correlation between the two lists. The lists represent rankings of items, and they must be sorted according to their values. Return the computed correlation as a float. If the length... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert weighted_kendall_tau([1, 2, 3, 4], [1, 2, 3, 4]) == 1.0\", \"assert weighted_kendall_tau([5, 5, 5], [5, 5, 5]) == 1.0\", \"assert weighted_kendall_tau([1, 2], [1, 2]) == 1.0\", \"assert weighted_kendall_tau([3, 2, 1], [1, 2, 3]) == -1.0\", \"assert weighted_... | {
"split": "train",
"index": 63473,
"acecode_id": "bigcode_python_fns_8914",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that removes all elements except those that occur exactly once (unique elements). After obtaining the array of unique elements, sort them in ascending order and calculate the sum of the first half of the sorted unique elements. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_sum([2, 3, 6, 8, 3, 8, 6, 2]) == 0\", \"assert calc_sum([3, 5, 7, 11, 3, 7]) == 5\", \"assert calc_sum([2, 4, 5, 4, 6, 7]) == 7\", \"assert calc_sum([6, 6, 6, 6]) == 0\", \"assert calc_sum([0, 0, 0, 0]) == 0\", \"assert calc_sum([]) == 0\", \"assert cal... | {
"split": "train",
"index": 63474,
"acecode_id": "evol_2901",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of noun phrases along with their frequencies, implement a function that aggregates the frequencies for each unique noun phrase and returns a dictionary where the keys are the unique noun phrases and the values are their total frequencies. The input will be a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_frequencies([('Phrase', 2), ('phrase', 3), ('Another Phrase', 1)]) == {'phrase': 5, 'another phrase': 1}\", \"assert aggregate_frequencies([('test', 1), ('Test', 2), ('TEST', 3)]) == {'test': 6}\", \"assert aggregate_frequencies([('apple', 1), ('ba... | {
"split": "train",
"index": 63475,
"acecode_id": "bigcode_python_fns_23296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary data structure, implement a function that counts and returns the number of items (key-value pairs) present in the dictionary. The function should be able to handle dictionaries of any size and content.\nPlease reason step by step, then write a self-contained ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_items({'name': 'John', 'age': 30}) == 2\", \"assert count_items({'a': 1, 'b': 2, 'c': 3}) == 3\", \"assert count_items({'x': 10}) == 1\", \"assert count_items({}) == 0\", \"assert count_items({'key1': 'value1', 'key2': 'value2', 'key3': 'value3', 'key4... | {
"split": "train",
"index": 63476,
"acecode_id": "evol_2924",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the product of all elements in a two-dimensional matrix. The function should take a matrix as input and return the product of all of its elements. If the matrix is empty, return 1.\nPlease reason step by step, then write a self-contained Python ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_matrix([[1, 2], [3, 4]]) == 24\", \"assert multiply_matrix([[0, 2], [3, 4]]) == 0\", \"assert multiply_matrix([[1]]) == 1\", \"assert multiply_matrix([[1, 1], [1, 1]]) == 1\", \"assert multiply_matrix([[1, 2, 3], [4, 5, 6]]) == 720\", \"assert multi... | {
"split": "train",
"index": 63477,
"acecode_id": "evol_2307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of buildings. Your task is to implement a function `max_height(heights: List[int]) -> int` that returns the maximum height among the given buildings. If the list is empty, the function should return 0. \n\nFo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_height([3, 1, 4, 1, 5, 9]) == 9\", \"assert max_height([1, 2, 3, 4, 5]) == 5\", \"assert max_height([5, 4, 3, 2, 1]) == 5\", \"assert max_height([10, 20, 30, 40, 50]) == 50\", \"assert max_height([]) == 0\", \"assert max_height([0]) == 0\", \"assert max_... | {
"split": "train",
"index": 63478,
"acecode_id": "oss_29992",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are developing a file processing application that needs to handle different file types. Your task is to implement a function `process_file` that takes two parameters: `file_name` (string) and `file_type` (string). The function should perform the following actions: If the `f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_file('data.raw', '.raw') == 'Processing raw file: data.raw. File size: 1024 bytes'\", \"assert process_file('document.pdf', '.pdf') == 'Processing non-raw file: document.pdf. File size: 2048 bytes'\", \"assert process_file('image.raw', '.raw') == 'Pr... | {
"split": "train",
"index": 63479,
"acecode_id": "oss_25694",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that compares two lists of integers and returns a summary of their differences. The function should take two lists as input and output a dictionary summarizing the discrepancies between the two lists. Specifically, the summary shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_integer_lists([1, 2, 3], [3, 4, 5]) == {'missing_in_list2': 2, 'missing_in_list1': 2, 'differing_rows': 0}\", \"assert compare_integer_lists([1, 2, 3], [1, 2, 3]) == {'missing_in_list2': 0, 'missing_in_list1': 0, 'differing_rows': 0}\", \"assert comp... | {
"split": "train",
"index": 63480,
"acecode_id": "oss_2870",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the lengths of various sticks. Your task is to write a function `cut_sticks(sticks: List[int]) -> int` that counts how many sticks are left after performing a series of cut operations. In each operation, you cut all the sticks down ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cut_sticks([5, 4, 4, 2, 2, 8]) == 0\", \"assert cut_sticks([1, 2, 3]) == 0\", \"assert cut_sticks([5, 5, 5]) == 0\", \"assert cut_sticks([3, 3, 2, 2, 1]) == 0\", \"assert cut_sticks([1]) == 0\", \"assert cut_sticks([2]) == 0\", \"assert cut_sticks([7, 4, 8, ... | {
"split": "train",
"index": 63481,
"acecode_id": "bigcode_python_fns_6065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates statistical measures for the red, green, and blue color channels of an image. The input to the function is a dictionary containing lists of pixel values for the red, green, and blue color channels. The keys are 'reds',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_statistics({'reds': [255, 0, 0], 'greens': [0, 255, 0], 'blues': [0, 0, 255]}, 'means') == (85.0, 85.0, 85.0)\", \"assert calculate_statistics({'reds': [255, 255, 255], 'greens': [255, 255, 255], 'blues': [255, 255, 255]}, 'means') == (255.0, 255.0... | {
"split": "train",
"index": 63482,
"acecode_id": "oss_23725",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer representing an IPv4 address in decimal format, write a function that determines whether the integer represents a valid IPv4 address. A valid IPv4 address in decimal must be an integer between 0 and 4294967295 (inclusive). Your function should return True if th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_ipv4(0) == True\", \"assert is_valid_ipv4(4294967295) == True\", \"assert is_valid_ipv4(4294967296) == False\", \"assert is_valid_ipv4(-1) == False\", \"assert is_valid_ipv4(1234567890) == True\", \"assert is_valid_ipv4(256) == True\", \"assert is_v... | {
"split": "train",
"index": 63483,
"acecode_id": "bigcode_python_fns_7992",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that emulates the behavior of a 16-bit Intel 8086 processor by calculating virtual memory addresses using segment and offset registers. The function should take two integers as inputs: the segment value and the offset value. It should return the calculated vir... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_virtual_address(0x0000, 0x0000) == 0\", \"assert calculate_virtual_address(0x0001, 0x0001) == 17\", \"assert calculate_virtual_address(0x000F, 0x000F) == 255\", \"assert calculate_virtual_address(0x0000, 0xFFFF) == 65535\", \"assert calculate_virtu... | {
"split": "train",
"index": 63484,
"acecode_id": "evol_31569",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, write a function that calculates the product of its digits. The function should return 0 if n has any digit equal to 0, as multiplying by zero results in zero. Implement the function `prodDigits(n)` that takes an integer n as input and returns th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prodDigits(145) == 20\", \"assert prodDigits(123) == 6\", \"assert prodDigits(999) == 729\", \"assert prodDigits(101) == 0\", \"assert prodDigits(56) == 30\", \"assert prodDigits(7) == 7\", \"assert prodDigits(45) == 20\", \"assert prodDigits(1001) == 0\", \... | {
"split": "train",
"index": 63485,
"acecode_id": "evol_28268",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing state information from a scientific instrument. The function `process_instrument_state(info)` takes a dictionary `info` containing the instrument's state data. The dictionary includes a key 'high tension' which has a float value, and may or may no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_instrument_state({'high tension': 100.0, 'stage a': 45.0}) == {'high tension': 100.0, 'stage position': {'x': 0.0, 'y': 0.0, 'z': 0.0, 'a': 45.0}}\", \"assert process_instrument_state({'high tension': 50.0}) == {'high tension': 50.0, 'stage position'... | {
"split": "train",
"index": 63486,
"acecode_id": "oss_4791",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates saving an image to a specified file path. The function should take in two parameters: a string `file_path` representing the file path where the image should be saved, and a 2D list `image` representing the pixel values ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_image('output.png', [[255, 0, 0], [0, 255, 0], [0, 0, 255]]) == 'Image successfully saved to output.png'\", \"assert save_image('test_image.jpg', [[0, 0, 0], [255, 255, 255]]) == 'Image successfully saved to test_image.jpg'\", \"assert save_image('image... | {
"split": "train",
"index": 63487,
"acecode_id": "bigcode_python_fns_35093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of event details and returns a list of formatted event strings. Each event detail is a dictionary containing the keys 'id', 'name', and 'date'. Your function should format each event into a string with the follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_events([{'id': 1, 'name': 'Meeting', 'date': '2023-10-01'}, {'id': 2, 'name': 'Conference', 'date': '2023-10-02'}]) == ['Event ID: 1, Name: Meeting, Date: 2023-10-01', 'Event ID: 2, Name: Conference, Date: 2023-10-02']\", \"assert format_events([{'id'... | {
"split": "train",
"index": 63488,
"acecode_id": "oss_36471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of locations on a 2D plane, where each location is represented as a list of two integers [x, y]. Your task is to implement a function that calculates the Euclidean distance between each pair of locations and returns a distance matrix. The distance matrix sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_distance_matrix([[0, 0], [0, 0], [0, 0]]) == {0: {0: 0.0, 1: 0.0, 2: 0.0}, 1: {0: 0.0, 1: 0.0, 2: 0.0}, 2: {0: 0.0, 1: 0.0, 2: 0.0}}\", \"assert generate_distance_matrix([[1, 2], [3, 4], [5, 6]]) == {0: {0: 0.0, 1: 2.8284271247461903, 2: 5.656854249... | {
"split": "train",
"index": 63489,
"acecode_id": "bigcode_python_fns_42455",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with verifying the correctness of hourly work records for a single day. Given a string representing the work hours in the format 'NAME=DAYSTART-HOUR:END-HOUR', where 'NAME' is a string identifier, 'DAY' is a two-letter abbreviation for the day of the week (e.g., ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_daily_hour_pairs_worked('ANA=MO16:00-12:00') == {'MO': [[0.0, 0.0]]}\", \"assert get_daily_hour_pairs_worked('ANA=TU09:00-17:00') == {}\", \"assert get_daily_hour_pairs_worked('ANA=WE08:00-15:00') == {}\", \"assert get_daily_hour_pairs_worked('ANA=TH20:0... | {
"split": "train",
"index": 63490,
"acecode_id": "bigcode_python_fns_4353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `extract_scalar` that returns the first positive integer from the list. If there are no positive integers in the list, the function should return None. The input list can contain both positive and negative integers as well as zero.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_scalar([0, -1, -2, 3, 4]) == 3\", \"assert extract_scalar([-5, -3, -1, 0]) == None\", \"assert extract_scalar([2, 5, 1, -1]) == 2\", \"assert extract_scalar([-10, -20, 0, -30]) == None\", \"assert extract_scalar([7, 8, -3, 4, 1]) == 7\", \"assert ext... | {
"split": "train",
"index": 63491,
"acecode_id": "bigcode_python_fns_32282",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that generates a new list containing the next perfect square number for each perfect square in the input list that does not already exist in the input list. A perfect square is defined as an integer that is the square of another intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_squares([1, 1, 1, 1]) == [4]\", \"assert next_squares([16, 25, 36]) == [49]\", \"assert next_squares([100, 101, 102]) == [121]\", \"assert next_squares([8, 9, 10]) == [16]\", \"assert next_squares([49, 64, 81]) == [100]\", \"assert next_squares([36, 49]... | {
"split": "train",
"index": 63492,
"acecode_id": "evol_18660",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a floating-point number into a fixed-point representation. The fixed-point representation is defined by a string which indicates the number of bits for the integer part and the fractional part in the format 'Qm.n', where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fixed_point(0.1, 'Q0.4') == 1\", \"assert fixed_point(0.5, 'Q0.2') == 2\", \"assert fixed_point(0.75, 'Q0.4') == 12\", \"assert fixed_point(0.25, 'Q0.3') == 2\", \"assert fixed_point(0.0625, 'Q0.4') == 1\", \"assert fixed_point(0.3, 'Q1.3') == 2\", \"assert ... | {
"split": "train",
"index": 63493,
"acecode_id": "bigcode_python_fns_9142",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `gcd(x: int, y: int) -> int` that computes the largest common divisor (greatest common divisor) of two given positive integers using the Euclidean algorithm. Your implementation should correctly handle cases when one or both numbers are prime. For example, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gcd(4, 12) == 4\", \"assert gcd(13, 17) == 1\", \"assert gcd(18, 24) == 6\", \"assert gcd(100, 25) == 25\", \"assert gcd(7, 13) == 1\", \"assert gcd(21, 14) == 7\", \"assert gcd(28, 35) == 7\", \"assert gcd(12, 15) == 3\", \"assert gcd(1, 1) == 1\", \"assert... | {
"split": "train",
"index": 63494,
"acecode_id": "evol_33102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of integers and returns a new list containing only the unique integers from the input list, preserving the order of their first appearance. Implement the function `get_unique_integers(nums: List[int]) -> List[int]`, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 3, 1, 2, 4]) == [1, 2, 3, 4]\", \"assert get_unique_integers([5, 5, 5]) == [5]\", \"assert get_unique_integers([10, 20, 10, 30, 20]) == [10, 20, 30]\", \"assert get_unique_integers([]) == []\", \"assert get_unique_integers([1, 2, 3... | {
"split": "train",
"index": 63495,
"acecode_id": "bigcode_python_fns_25310",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of migration operations represented as tuples, where each tuple contains an operation type and a model name. The operation types can either be 'CreateModel' or 'DeleteModel'. Your task is to implement a function `find_deleted_models(migrations)` that proces... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_deleted_models([('CreateModel', 'User'), ('DeleteModel', 'Transaction')]) == {'CreateModel': ['User'], 'DeleteModel': ['Transaction']}\", \"assert find_deleted_models([('DeleteModel', 'Transaction'), ('DeleteModel', 'UserProfile')]) == {'CreateModel': [... | {
"split": "train",
"index": 63496,
"acecode_id": "oss_17174",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two strings as input and determines if they are anagrams of each other. An anagram is defined as 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 r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'papel') == True\", \"assert are_anagrams('rat', 'car') == False\", \"assert are_anagrams('night', 'thing') == True\", \"asser... | {
"split": "train",
"index": 63497,
"acecode_id": "evol_27275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates transactions on a simple bank account. The function should take an initial balance, a list of transactions, and return the final balance after applying all transactions. Transactions can be deposits (positive values) or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_balance(1000, [200, -100, 50, -300]) == 850\", \"assert final_balance(1000, [-1000, 200]) == 200\", \"assert final_balance(1500, [300, -400, 200, -500]) == 1100\", \"assert final_balance(300, [-50, -250, 100]) == 100\", \"assert final_balance(400, [-10... | {
"split": "train",
"index": 63498,
"acecode_id": "oss_15732",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that finds the smallest possible sum of any contiguous subarray within the list. The function should take a single parameter, a list of integers, and return the smallest sum. For example, for the input [-7, 1, -2, 10, 0, 5, -2, -1,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_subarray_sum([1, 2, 3, 4, 5]) == 1\", \"assert min_subarray_sum([-1, -2, -3, -4, -5]) == -15\", \"assert min_subarray_sum([5, 4, 3, -10, 2]) == -10\", \"assert min_subarray_sum([0]) == 0\", \"assert min_subarray_sum([-1, 0, 1]) == -1\", \"assert min_suba... | {
"split": "train",
"index": 63499,
"acecode_id": "evol_13063",
"num_tests": 13
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.