data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a list of integers representing the temperatures recorded over a period of time. Your task is to write a function that finds the length of the longest contiguous subarray of temperatures where the difference between any two consecutive temperatures is at most 1. W...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longestContiguousSubarray([1, 2, 3, 2, 1]) == 5\", \"assert longestContiguousSubarray([1, 1, 1, 1, 1]) == 5\", \"assert longestContiguousSubarray([1, 2, 3, 5, 6]) == 3\", \"assert longestContiguousSubarray([1, 3, 5, 7]) == 1\", \"assert longestContiguousSuba...
{ "split": "train", "index": 76900, "acecode_id": "oss_29670", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a record with various attributes (key-value pairs). Your task is to implement a function that filters this list based on specific criteria. The function should take the following parameters: \n1. `records`: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_records([{'a': 1, 'b': 2}, {'a': 2, 'b': 3}], 'a', (1, 3), ['b'], (2,)) == [{'a': 1, 'b': 2}]\", \"assert filter_records([{'a': 1, 'b': 2}, {'a': 2, 'b': 3}], 'a', (2, 3), ['b'], (3,)) == [{'a': 2, 'b': 3}]\", \"assert filter_records([{'a': 1, 'b': 2}...
{ "split": "train", "index": 76901, "acecode_id": "bigcode_python_fns_36353", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a transaction record based on given parameters. The function, `create_transaction`, should take two arguments: a string `income_account` representing the income account for the business and a float `total_amount` representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_transaction('Sales', 1500.00) == {'account': 'Sales', 'account_type': 'Income', 'profit': 1500.00, 'credit_amount': 1500.00}\", \"assert create_transaction('Service', 2500.50) == {'account': 'Service', 'account_type': 'Income', 'profit': 2500.50, 'cre...
{ "split": "train", "index": 76902, "acecode_id": "oss_31323", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a URL for a given code system based on its description, status, and version. The URL should always follow the format: 'http://terminology.hl7.org/ValueSet/{description}_{status}_{version}'. Create a function called `generat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_code_system_url('Codes representing possible states of a RoleLink', 'active', '2018-08-12') == 'http://terminology.hl7.org/ValueSet/Codes representing possible states of a RoleLink_active_2018-08-12'\", \"assert generate_code_system_url('RoleLink St...
{ "split": "train", "index": 76903, "acecode_id": "oss_23126", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that formats a registration string for new environments in a reinforcement learning framework. Write a Python function called `format_registration` that takes in two parameters: 1. `env_id` (string) - The ID of the new environment....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_registration('CartPole-v1', 'cartpole:CartPoleEnv') == 'register(id=CartPole-v1, entry_point=cartpole:CartPoleEnv)'\", \"assert format_registration('MountainCar-v0', 'mountaincar:MountainCarEnv') == 'register(id=MountainCar-v0, entry_point=mountaincar...
{ "split": "train", "index": 76904, "acecode_id": "oss_2398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that checks whether all integers in the list are unique. The function should return True if all integers are unique, and False otherwise. You are required to implement a single function called `are_all_uniqu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_all_unique([]) == True\", \"assert are_all_unique([1]) == True\", \"assert are_all_unique([1, 2, 3]) == True\", \"assert are_all_unique([1, 2, 2]) == False\", \"assert are_all_unique([1, -1, 2]) == True\", \"assert are_all_unique([-1, -2, -3]) == True\",...
{ "split": "train", "index": 76905, "acecode_id": "bigcode_python_fns_31197", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a numerical value and a label as input and represents a priority level. The priority level should be stored as a string in the format 'PriorityLevel(value, label)'. Additionally, you need to define a constant named HIGH wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_priority_level(3, 'Medium') == 'PriorityLevel(3, Medium)'\", \"assert create_priority_level(1, 'Low') == 'PriorityLevel(1, Low)'\", \"assert create_priority_level(0, 'None') == 'PriorityLevel(0, None)'\", \"assert create_priority_level(-1, 'Negative')...
{ "split": "train", "index": 76906, "acecode_id": "oss_35121", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define a function named 'intersperse' that accepts a list of integers ('numbers') and an integer ('delimeter'). The function should return a list with the 'delimeter' scattered between elements of the 'numbers' list. If the 'delimeter' is negative, interpret its absolute value ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([10, 20, 30], 0) == [10, 0, 20, 0, 30]\", \"assert intersperse([5], 3) == [5]\", \"assert intersperse([8, 9], -1) == [8, 9]\", \"assert intersperse([1, ...
{ "split": "train", "index": 76907, "acecode_id": "evol_29355", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that returns the first quintet (five) of elements from the input array, but only if they are prime numbers. If there are less than five prime numbers, return all the primes. Implement the function with the signature `def find_primes(...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_primes([2, 4, 6, 8, 10, 12, 14]) == [2]\", \"assert find_primes([3, 5, 7, 11, 13, 17]) == [3, 5, 7, 11, 13]\", \"assert find_primes([4, 6, 8, 10]) == []\", \"assert find_primes([2, 3, 5, 7, 11, 13, 17, 19]) == [2, 3, 5, 7, 11]\", \"assert find_primes([1...
{ "split": "train", "index": 76908, "acecode_id": "evol_29387", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_primes_in_range(start: int, end: int) -> List[int]` that generates a list of all prime numbers within a specified numerical range defined by `start` and `end` (inclusive). You should not use any built-in math or prime generating libraries in Pytho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_primes_in_range(15, 30) == [17, 19, 23, 29]\", \"assert generate_primes_in_range(1, 10) == [2, 3, 5, 7]\", \"assert generate_primes_in_range(10, 20) == [11, 13, 17, 19]\", \"assert generate_primes_in_range(20, 30) == [23, 29]\", \"assert generate_pr...
{ "split": "train", "index": 76909, "acecode_id": "evol_29200", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integer arrays, your task is to implement a function that finds a pair of values, one from each array, that can be exchanged to make the sums of both arrays equal. If no such pair exists, return None. The function should have the following signature: `def find_swap_va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_swap_values([2, 4], [1, 3]) == (2, 1)\", \"assert find_swap_values([], [1, 2]) == None\", \"assert find_swap_values([5, 7], [3, 1]) == (5, 1)\", \"assert find_swap_values([1, 2, 3], [4, 5, 6, 7]) == None\", \"assert find_swap_values([1, 1, 1], [2, 2, 2]...
{ "split": "train", "index": 76910, "acecode_id": "evol_5942", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Design a function that verifies if a given mathematical expression in string format is correctly formatted with balanced parentheses and correct operator precedence. The function should also identify potential mathematical errors such as division by zero. The function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_expression('3 + 5 * (2 - 8)') == (True, 'No Error')\", \"assert validate_expression('10 / (2 + 3)') == (True, 'No Error')\", \"assert validate_expression('(2 + 3) * (5 - 2)') == (True, 'No Error')\", \"assert validate_expression('5 + (3 * (2 - 1))')...
{ "split": "train", "index": 76911, "acecode_id": "evol_14723", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of addons for a software application. The function should take a list of addons as input and return a modified version of the list. If the input list is not empty, the function should convert any non-list input t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_addons('addon3') == ['a', 'd', 'd', 'o', 'n', '3']\", \"assert process_addons([]) == []\", \"assert process_addons('') == []\", \"assert process_addons(['a']) == ['a']\", \"assert process_addons('test') == ['t', 'e', 's', 't']\", \"assert process_add...
{ "split": "train", "index": 76912, "acecode_id": "oss_21140", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You need to implement a function `get_default_config()` that returns the default configuration file location for an application. The location should be constructed by taking the user's home directory and appending the path '/.config/discogstagger/discogs_tagger.conf'. For the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_default_config('/home/user') == '/home/user/.config/discogstagger/discogs_tagger.conf'\", \"assert get_default_config('/Users/john') == '/Users/john/.config/discogstagger/discogs_tagger.conf'\", \"assert get_default_config('/home/guest') == '/home/guest/...
{ "split": "train", "index": 76913, "acecode_id": "bigcode_python_fns_3108", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a dictionary containing information about different types of workflow actions. Each action is represented by a key-value pair in the dictionary, where the key is the action type and the value is another dictionar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_actions({'alfred.workflow.action.applescript': {'config': {}, 'version': 0}}) == 1\", \"assert count_unique_actions({'alfred.workflow.action.applescript': {'config': {}, 'version': 0}, 'alfred.workflow.action.terminalcommand': {'config': {}, 've...
{ "split": "train", "index": 76914, "acecode_id": "oss_3185", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string input representing a sequence of characters and returns the name of the class used to process regular expressions. The function should have the following signature: `def regex_engine_class_name(input_sequence_curre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert regex_engine_class_name('abc123') == 'RegexProcessor'\", \"assert regex_engine_class_name('!@#$%^&*()') == 'RegexProcessor'\", \"assert regex_engine_class_name('') == 'RegexProcessor'\", \"assert regex_engine_class_name('a') == 'RegexProcessor'\", \"assert r...
{ "split": "train", "index": 76915, "acecode_id": "oss_4340", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string s. Your task is to check if the string is a palindrome or not. A string is a palindrome if it reads the same backward as forward. However, in this task, refrain from using any string manipulation functions and apply the Floyd's Tortoise and Hare algorithm...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('a') == True\", \"assert is_palindrome('aa') == True\", \"assert is_palindrome('ab') == False\", \"assert is_palindrome('abc') == False\", \"assert is_palindrome('abba') == True\", \"assert is_palindrome('abcba') == True\", \"assert is_palindro...
{ "split": "train", "index": 76916, "acecode_id": "evol_11682", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple messaging system. The function, named `message_system`, should accept a string input representing a message and return a boolean value. The function should store the input message and always return `True` to in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert message_system('Hello, World!') == True\", \"assert message_system('Test message') == True\", \"assert message_system('Another test case') == True\", \"assert message_system('Message 1') == True\", \"assert message_system('Message 2') == True\", \"assert mes...
{ "split": "train", "index": 76917, "acecode_id": "oss_13573", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that contains information about a country, including its name, capital, and population. Implement a function called `get_population` that retrieves the population from the given dictionary and returns it as a string. If the population key is not found...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_population({'country': 'Brazil', 'capital': 'Bras\\u00edlia', 'population': '208 million'}) == '208 million'\", \"assert get_population({'country': 'USA', 'capital': 'Washington D.C.', 'population': '331 million'}) == '331 million'\", \"assert get_popula...
{ "split": "train", "index": 76918, "acecode_id": "evol_22988", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with a problem titled \"Count Node Pairs Above a Degree Threshold\". The problem is described as follows: You are provided with an undirected graph, represented by an integer `n` which signifies the number of nodes, and `edges`, where each `edges[i] = [ui, vi]` d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_pairs(4, [[1,2],[2,4],[1,3],[2,3],[2,1]], [2,3]) == [6, 5]\", \"assert count_pairs(5, [[1,5],[1,5],[3,4],[2,5],[1,3],[5,1],[2,3],[2,5]], [1,2,3,4,5]) == [10, 10, 9, 8, 6]\", \"assert count_pairs(3, [[1,2],[2,3],[1,3]], [0]) == [3]\", \"assert count_pai...
{ "split": "train", "index": 76919, "acecode_id": "evol_16497", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of CPU utilization measurements from a virtual machine monitor (VMM) and its virtual CPUs (VCPUs). Your task is to implement a function that consumes these measurements and returns a dictionary containing the average CPU utilization of the VMM and the VCPUs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_average_cpu_utilization([(10, 20), (30, 40), (50, 60)]) == {'avg_vmm': 30.0, 'avg_vcpus': 40.0}\", \"assert compute_average_cpu_utilization([(5, 10), (15, 20)]) == {'avg_vmm': 10.0, 'avg_vcpus': 15.0}\", \"assert compute_average_cpu_utilization([(0, ...
{ "split": "train", "index": 76920, "acecode_id": "bigcode_python_fns_2516", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a directory containing several files with the same structure, and you need to write a function that reads the content of a specified file and extracts certain necessary information from it. The files contain lines in the format 'key:value', and you must collect th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_values(['name:John', 'age:30', 'name:Jane'], 'name') == ['John', 'Jane']\", \"assert extract_values(['name:John', 'age:30', 'city:NewYork'], 'age') == ['30']\", \"assert extract_values(['name:John', 'age:30', 'city:NewYork'], 'city') == ['NewYork']\"...
{ "split": "train", "index": 76921, "acecode_id": "bigcode_python_fns_17039", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a configuration object which contains information about users and their team memberships. Each user can be a member of multiple teams. Implement a function `get_user_teams(config: Config, email: str) -> List[str]` that takes in a configuration object `config` and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_teams(Config({'by_member': {'user1@example.com': [], 'user2@example.com': ['Team C'], 'user3@example.com': []}}), 'user1@example.com') == []\", \"assert get_user_teams(Config({'by_member': {'user1@example.com': ['Team D', 'Team E'], 'user2@example.c...
{ "split": "train", "index": 76922, "acecode_id": "bigcode_python_fns_21896", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function that converts a pressure value from Pascal to Bar. The function should take a single floating-point parameter representing the pressure in Pascal and return the equivalent pressure in Bar. The conversion formula is: 1 Bar = 100,000 Pascals.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pascal_to_bar(0) == 0.0\", \"assert pascal_to_bar(100000) == 1.0\", \"assert pascal_to_bar(50000) == 0.5\", \"assert pascal_to_bar(250000) == 2.5\", \"assert pascal_to_bar(1000000) == 10.0\", \"assert pascal_to_bar(75000) == 0.75\", \"assert pascal_to_bar(15...
{ "split": "train", "index": 76923, "acecode_id": "evol_10214", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function in Python that computes the Fibonacci number at a given position 'n'. The function should return 0 for n = 1, 1 for n = 2, and for n > 2, it should return the sum of the two preceding Fibonacci numbers. If the input 'n' is less than or equal to 0,...
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": 76924, "acecode_id": "evol_14659", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two integers, `length` and `width`, representing the dimensions of a rectangle. Your task is to write a function `calculate_rectangle_area(length: int, width: int) -> int` that calculates the area of the rectangle using the formula: area = length * width. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rectangle_area(5, 3) == 15\", \"assert calculate_rectangle_area(10, 2) == 20\", \"assert calculate_rectangle_area(7, 4) == 28\", \"assert calculate_rectangle_area(1, 1) == 1\", \"assert calculate_rectangle_area(15, 10) == 150\", \"assert calculate_...
{ "split": "train", "index": 76925, "acecode_id": "oss_12410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tiles represented by their coordinates in a 2D space, where each tile is represented as a tuple (x, y). Your task is to implement a function that checks if a specific tile, given by its coordinates (x, y), is located in the leftmost column of the 2D grid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_tile_leftmost((0, 5)) == True\", \"assert is_tile_leftmost((0, 0)) == True\", \"assert is_tile_leftmost((1, 2)) == False\", \"assert is_tile_leftmost((2, 3)) == False\", \"assert is_tile_leftmost((-1, 4)) == False\", \"assert is_tile_leftmost((0, -1)) == ...
{ "split": "train", "index": 76926, "acecode_id": "bigcode_python_fns_31177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a byte string representing the contents of a file, implement a function `find_mz_offsets(data: bytes) -> List[int]` that identifies all the offsets where the byte sequence 'MZ' occurs. The function should return a list of integers, each representing the start index of an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_mz_offsets(b'This is a test MZ file.') == [15]\", \"assert find_mz_offsets(b'MZ at the start') == [0]\", \"assert find_mz_offsets(b'No matches here.') == []\", \"assert find_mz_offsets(b'\\\\x00\\\\x00\\\\x00') == []\", \"assert find_mz_offsets(b'MZ') =...
{ "split": "train", "index": 76927, "acecode_id": "bigcode_python_fns_26942", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the sizes of different files in bytes. Implement a function `calculate_total_size(file_sizes: List[int]) -> int` that calculates the total size of all files. The function should return the total size as an integer. If the input list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_size([]) == 0\", \"assert calculate_total_size([100]) == 100\", \"assert calculate_total_size([100, 200]) == 300\", \"assert calculate_total_size([10, 20, 30]) == 60\", \"assert calculate_total_size([1, 2, 3, 4, 5]) == 15\", \"assert calculat...
{ "split": "train", "index": 76928, "acecode_id": "bigcode_python_fns_13961", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a nested dictionary that represents the status of collections in a Solr cloud instance. The structure of the input dictionary is as follows: the root contains keys for 'live_nodes' and 'collections', where 'collections' is another dictionary with keys for each col...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_collection_info({'live_nodes': 3, 'collections': {'collection1': {'shards': {'shard1': {'replicas': [{'node_name': 'node1', 'base_url': 'http://node1', 'state': 'active', 'leader': True}, {'node_name': 'node2', 'base_url': 'http://node2', 'state': 'ina...
{ "split": "train", "index": 76929, "acecode_id": "bigcode_python_fns_6695", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing dimensions for a set of variables and a list of strings representing variable names. Your task is to implement a function `generate_sequences(dims: List[int], cvars: List[str]) -> Tuple[List[str], List[str]]` that generates sequence...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sequences([2, 3], ['input', 'output', 'temp']) == (['temp[0][0]', 'temp[0][1]', 'temp[0][2]', 'temp[1][0]', 'temp[1][1]', 'temp[1][2]'], [])\", \"assert generate_sequences([1], ['input', 'output', 'var']) == (['var[0]'], [])\", \"assert generate_seq...
{ "split": "train", "index": 76930, "acecode_id": "oss_34326", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of strings that may represent hexadecimal numbers or undefined values, write a function `optimise_values` that converts all valid hexadecimal strings (starting with '0x') to their decimal integer equivalents. Any undefined values (represented as the string 'undefin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimise_values(['0x1', '0xA', 'undefined', '0xFF', '5']) == [1, 10, None, 255, '5']\", \"assert optimise_values(['0x0', '0x2', 'undefined']) == [0, 2, None]\", \"assert optimise_values(['0x1F4', 'undefined', '0x3E8', '8']) == [500, None, 1000, '8']\", \"ass...
{ "split": "train", "index": 76931, "acecode_id": "evol_35645", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple banking operation. Implement a function `bank_operations(operations: List[Tuple[str, float]]) -> float` where `operations` is a list of tuples. Each tuple represents an operation in the banking system with the first element being a string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_operations([('deposit', 100)]) == 100.0\", \"assert bank_operations([('deposit', 50), ('withdraw', 20)]) == 30.0\", \"assert bank_operations([('withdraw', 10)]) == 0.0\", \"assert bank_operations([('deposit', 200), ('withdraw', 250)]) == 200.0\", \"asse...
{ "split": "train", "index": 76932, "acecode_id": "oss_22839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with building a function that generates a standardized HTTP request for putting a big decimal value. The function should accept an optional 'content_type' header and an optional 'json' parameter. If the 'json' parameter is not provided, it should default to -9999...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_http_request() == {'method': 'PUT', 'url': '/number/big/decimal/-99999999.99', 'headers': {'Accept': 'application/json'}, 'json': -99999999.99}\", \"assert build_http_request(content_type='application/json') == {'method': 'PUT', 'url': '/number/big/dec...
{ "split": "train", "index": 76933, "acecode_id": "bigcode_python_fns_815", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing amino acid types in a protein sequence. Each amino acid type is represented by an integer from 0 to 21 (inclusive). Your task is to reorder these integers according to a predefined mapping that transforms the input type to a new typ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert correct_amino_acid_order([0, 1, 2, 3]) == [0, 1, 2, 3]\", \"assert correct_amino_acid_order([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert correct_amino_acid_order([20, 21, 0, 1]) == [20, 21, 0, 1]\", \"assert correct_amino_acid_order([3, 2, 1, 0]) == [3, 2, 1, 0...
{ "split": "train", "index": 76934, "acecode_id": "bigcode_python_fns_12044", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function called `remove_spaces` that takes a single string argument `myStr` and returns a new string with all leading and trailing whitespace removed. The function should not modify the spaces between words in the string. For example, if `myStr` is ' hello ', the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_spaces(' hello ') == 'hello'\", \"assert remove_spaces(' hello world ') == 'hello world'\", \"assert remove_spaces(' python code ') == 'python code'\", \"assert remove_spaces(' leading and trailing spaces ') == 'leading and trailin...
{ "split": "train", "index": 76935, "acecode_id": "evol_20894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a description. Your task is to find the first string in the list that matches a given target description. If a match is found, return that string; if no match is found, return None. Write a function `find_matching_de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_matching_description('text to match', ['no match', 'another text', 'text to match', 'text again']) == 'text to match'\", \"assert find_matching_description('missing', ['no match', 'another text', 'text to match', 'text again']) == None\", \"assert find_...
{ "split": "train", "index": 76936, "acecode_id": "bigcode_python_fns_17313", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages virtual machine memory allocation. Given a virtual machine instance represented by a dictionary containing the keys 'uuid' (a unique identifier for the virtual machine) and 'memory_mb' (the amount of RAM in MB that the virtua...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_memory({'uuid': 'vm-123', 'memory_mb': 2048}, {'available_memory': 4096}) == 'Memory allocated successfully.'\", \"assert set_memory({'uuid': 'vm-456', 'memory_mb': 8192}, {'available_memory': 8192}) == 'Memory allocated successfully.'\", \"assert set_me...
{ "split": "train", "index": 76937, "acecode_id": "bigcode_python_fns_28161", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of countries and a new region name as input. The function should validate the region name to ensure it is not empty and does not already exist in the list of countries. If the region name is valid, return a success messa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_region(['USA', 'Canada'], 'Mexico') == 'Region added successfully.'\", \"assert add_region(['USA', 'Canada'], 'Canada') == 'Invalid region name: Region name already exists.'\", \"assert add_region(['USA', 'Canada'], '') == 'Invalid region name: Region na...
{ "split": "train", "index": 76938, "acecode_id": "bigcode_python_fns_45028", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the linear regression line using the least squares method for given data points represented by two lists, X and Y. Additionally, calculate the R-squared value to measure how well the linear regression model fits the data. The function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_regression([-1, 0, 1], [-3, 0, 3]) == (3.0, 0.0, 1.0)\", \"assert linear_regression([1, 2, 3, 4, 5, 6], [2, 4, 6, 8, 10, 12]) == (2.0, 0.0, 1.0)\", \"assert linear_regression([5, 6, 7], [20, 22, 24]) == (2.0, 10.0, 1.0)\", \"assert linear_regression([...
{ "split": "train", "index": 76939, "acecode_id": "evol_20129", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with validating email addresses. Write a function `is_valid_email(sender: str) -> bool` that checks if the provided `sender` email address is valid. An email address is considered valid if it is a non-empty string and does not appear in a predefined list of inval...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_email('user@example.com') == True\", \"assert is_valid_email('') == False\", \"assert is_valid_email('<EMAIL>') == False\", \"assert is_valid_email('t@e.c') == False\", \"assert is_valid_email('test@domain.com') == True\", \"assert is_valid_email('i...
{ "split": "train", "index": 76940, "acecode_id": "oss_21157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a stack represented as a list, write a function `reverse_stack` that reverses the stack in place without using any auxiliary stack, queue, or array for holding the data temporarily. The function should maintain its space complexity as O(1). The input stack will be provide...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_stack([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_stack([10, 20, 30]) == [30, 20, 10]\", \"assert reverse_stack([7]) == [7]\", \"assert reverse_stack(['a', 'b', 'c']) == ['c', 'b', 'a']\", \"assert reverse_stack([1, 2]) == [2, 1]\", \"ass...
{ "split": "train", "index": 76941, "acecode_id": "evol_32051", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that validates a given sample weight query parameter for a web API. The sample weight needs to be a string of comma-separated values that can all be converted to float. Your task is to write a function that takes the sample wei...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_sample_weight('1.2, 3.5, 2.0') == True\", \"assert validate_sample_weight('4.5, 5.0, 6.1') == True\", \"assert validate_sample_weight('10.0, 20.5, -5.2') == True\", \"assert validate_sample_weight('1.0, 2.0, 3.0, 4.0') == True\", \"assert validate_s...
{ "split": "train", "index": 76942, "acecode_id": "oss_20070", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers `position` representing the positions of `n` chips. Each chip can be moved to the left or right with varying costs. Moving a chip to `position[i] + 2` or `position[i] - 2` costs 0. However, moving a chip to `position[i] + 1` or `position[i] - ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minCostToMoveChips([1, 1, 1, 1]) == 0\", \"assert minCostToMoveChips([3, 6, 9]) == 0\", \"assert minCostToMoveChips([10, 11, 12]) == 1\", \"assert minCostToMoveChips([5, 5, 5, 5, 5]) == 0\", \"assert minCostToMoveChips([1]) == 0\"]}" }
{ "split": "train", "index": 76943, "acecode_id": "evol_26220", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of words, and your task is to extract a specific substring from each word. The substring to be extracted is located between the second and second-to-last characters of each word. Implement a function `extract_substrings(words: List[str]) -> List[str]` that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_substrings(['example', 'programming', 'problem']) == ['xampl', 'rogrammin', 'roble']\", \"assert extract_substrings(['a', 'longerword', 'cut']) == ['ongerwor']\", \"assert extract_substrings(['quick', 'brown', 'fox']) == ['uic', 'row']\", \"assert ex...
{ "split": "train", "index": 76944, "acecode_id": "oss_30469", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_hkr_state(eco_temp: float, comfort_temp: float) -> str` that determines the state of a thermostat based on its eco temperature and comfort temperature. The state can be one of the following: 'off', 'on', 'eco', or 'comfort', base...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_hkr_state(126.5, 72.0) == 'off'\", \"assert get_hkr_state(127.0, 72.0) == 'on'\", \"assert get_hkr_state(72.0, 72.0) == 'comfort'\", \"assert get_hkr_state(70.0, 72.0) == 'eco'\", \"assert get_hkr_state(72.0, 72.0) == 'comfort'\", \"assert get_hkr_state(...
{ "split": "train", "index": 76945, "acecode_id": "oss_25945", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that checks if the parentheses in a given expression are balanced. The expression can include alphabets, arithmetic operators, and parentheses. Additionally, the function should ensure that there are no more than 20 parentheses in total (both opening and closin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_parentheses('((A+B)-C)*D+((E-F)*G') == 'Expression is not balanced'\", \"assert check_parentheses('((A+B)-C)*D+((E-F)*G)') == 'Expression is balanced'\", \"assert check_parentheses('((A+B)C)') == 'Expression is balanced'\", \"assert check_parentheses('...
{ "split": "train", "index": 76946, "acecode_id": "evol_35380", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates drawing a trail based on a list of coordinates. The function should take a list of trail coordinates, a color represented as an RGB tuple, and a boolean indicating whether the drawing should be in 'vision' mode or not. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_agent_trail([(0, 0), (1, 1)], (255, 0, 0), True) == ['Line from (0, 0) to (1, 1) with color (255, 0, 0) and thickness 5']\", \"assert draw_agent_trail([(0, 0), (1, 1)], (0, 255, 0), False) == ['Line from (0, 0) to (1, 1) with color (0, 255, 0) and thick...
{ "split": "train", "index": 76947, "acecode_id": "bigcode_python_fns_37475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents a recipe for a climate dataset. The recipe contains metadata about the dataset such as the dataset name, project, product, domain, institute, driver, experiment, ensemble, version, start and end year, MIP type, and variables. Your task...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_filename({'diagnostics': {'test': {'additional_datasets': [{'dataset': 'MOHC-HadGEM3-RA', 'project': 'CORDEX', 'product': 'output', 'domain': 'AFR-44', 'institute': 'MOHC', 'driver': 'ECMWF-ERAINT', 'exp': 'evaluation', 'ensemble': 'r1i1p1', 'rcm_ve...
{ "split": "train", "index": 76948, "acecode_id": "bigcode_python_fns_2570", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of materials and their properties for a 3D rendering engine. Each material has a name, diffuse color, reflectivity, transparency, index of refraction, roughness, and shine value. Your goal is to create a function that takes a list of materi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_materials([{'name': 'Material1', 'diffuse_color': [0, 0, 0, 255], 'reflectivity': 0.5, 'transparency': 0.0, 'ior': 1.5, 'roughness': 0.5, 'shine': 200, 'reflection_color': [255, 255, 255, 255], 'transparent_color': [0, 0, 0, 0]}]) == {'Material1': {'...
{ "split": "train", "index": 76949, "acecode_id": "bigcode_python_fns_39720", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the perimeter of a rectangle defined by its upper left corner and lower right corner coordinates. The rectangle is defined by four floating-point numbers: left (x coordinate of the upper left corner), top (y coordinate of the upper left corner), ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_perimeter(0.0, 0.0, 2.0, 2.0) == 8.0\", \"assert calculate_perimeter(1.0, 1.0, 4.0, 3.0) == 10.0\", \"assert calculate_perimeter(-1.0, -1.0, 1.0, 1.0) == 8.0\", \"assert calculate_perimeter(-2.0, -2.0, -1.0, -1.0) == 4.0\", \"assert calculate_perim...
{ "split": "train", "index": 76950, "acecode_id": "bigcode_python_fns_14924", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Create a function that converts an amount from one currency to another using predefined conversion rates. The function should take three parameters: the amount to convert, the currency to convert from, and the currency to convert to. The conversion rates are as follows: 1 EUR =...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_currency(100, 'USD', 'EUR') == 90.0\", \"assert convert_currency(100, 'EUR', 'JPY') == 13000.0\", \"assert convert_currency(100, 'JPY', 'EUR') == 0.77\", \"assert convert_currency(0, 'EUR', 'JPY') == 0.0\", \"assert convert_currency(100, 'JPY', 'USD'...
{ "split": "train", "index": 76951, "acecode_id": "evol_26586", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `list1` and `list2`, along with a list of indices `common_indices` that represent the positions of elements in `list1` and `list2` that you need to compare. Your task is to write a function `get_different_indices(list1: List[int], list2: Lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_different_indices([1, 2, 3, 4], [1, 3, 2, 4], [0, 1, 2, 3]) == [1, 2]\", \"assert get_different_indices([5, 6, 7], [5, 6, 7], [0, 1, 2]) == []\", \"assert get_different_indices([1, 2, 3], [4, 5, 6], [0, 1, 2]) == [0, 1, 2]\", \"assert get_different_indic...
{ "split": "train", "index": 76952, "acecode_id": "bigcode_python_fns_31896", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of points represented as a list of tuples, where each tuple contains two integers (x, y) representing the coordinates of a point. Your task is to implement a function that simplifies the array of points using the Ramer-Douglas-Peucker algorithm. You need ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simplify_points([(0, 0), (1, 1), (2, 2), (3, 3)], 1.0) == [(0, 0), (3, 3)]\", \"assert simplify_points([(1, 1), (2, 2)], 0.1) == [(1, 1), (2, 2)]\", \"assert simplify_points([(0, 0), (1, 0), (2, 0), (3, 0)], 0.5) == [(0, 0), (3, 0)]\", \"assert simplify_poin...
{ "split": "train", "index": 76953, "acecode_id": "bigcode_python_fns_21574", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function in Python that takes an integer n as input and returns a list containing the Fibonacci sequence up to the value n. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(8) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(10) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fibonacci(11) == [0, 1...
{ "split": "train", "index": 76954, "acecode_id": "evol_35187", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `format_output(data: List[int], format: str) -> Union[int, float]` that takes a list of integers and a format string as parameters. The function should return a specific output based on the provided format. The supported formats are '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_output([1, 2, 3, 4, 5], 'sum') == 15\", \"assert format_output([1, 2, 3, 4, 5], 'mean') == 3.0\", \"assert format_output([1, 2, 3, 4, 5], 'median') == 3\", \"assert format_output([1, 3, 3, 6, 7, 8], 'sum') == 28\", \"assert format_output([1, 3, 3, 6, ...
{ "split": "train", "index": 76955, "acecode_id": "oss_1621", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of locations represented as tuples of (latitude, longitude). Your task is to return a list of the same locations with their corresponding elevations. You will receive the name of a data provider as a string, along with any necessary arguments for that provi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_elevations([(37.7749, -122.4194), (34.0522, -118.2437)], 'ors-online', {'APIkey': 'test_key'}) == [((37.7749, -122.4194), 15.0), ((34.0522, -118.2437), 30.0)]\", \"assert get_elevations([(40.7128, -74.0060)], 'usgs', {}) == [((40.7128, -74.0060), 10.0)]\...
{ "split": "train", "index": 76956, "acecode_id": "bigcode_python_fns_36366", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with managing a dataset of annotations that belong to different layers. Each annotation consists of a layer name, a start position, an end position, and optional labels. Implement a function `count_annotations(annotations: List[Tuple[str, int, int, List[str]]]) -...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_annotations([]) == {}\", \"assert count_annotations([('Layer1', 0, 10, ['label1'])]) == {'Layer1': 1}\", \"assert count_annotations([('Layer1', 0, 10, ['label1']), ('Layer1', 10, 20, ['label2'])]) == {'Layer1': 2}\", \"assert count_annotations([('Layer...
{ "split": "train", "index": 76957, "acecode_id": "oss_5295", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integer arrays, return an array of their intersection. Each element in the result must appear as many times as it shows in all arrays. You may return the result in any order. Implement a function that will return the intersection of k arrays.\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersectK([[1, 2, 2, 1], [2, 2], [2, 2]]) == [2, 2]\", \"assert intersectK([[4, 9, 5], [9, 4, 9, 8, 4]]) == [4, 9]\", \"assert intersectK([[0, 1, 2], [1, 2, 3], [2, 3, 4]]) == [2]\", \"assert intersectK([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == []\", \"assert i...
{ "split": "train", "index": 76958, "acecode_id": "evol_25294", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that preprocesses and tokenizes a given set of text data. The program should take a list of sentences as input, preprocess the text data by converting it to lowercase and removing punctuation, then tokenize the preprocessed text using a si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tokenize_text(['Python is fun.']) == ({'python': 1, 'is': 2, 'fun': 3}, [[1, 2, 3]])\", \"assert tokenize_text(['Machine Learning.']) == ({'machine': 1, 'learning': 2}, [[1, 2]])\", \"assert tokenize_text(['Web Development']) == ({'web': 1, 'development': 2}...
{ "split": "train", "index": 76959, "acecode_id": "oss_13325", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary contains information about a car. Each dictionary has the following keys: 'Meter Id', 'Marked Time', 'VIN', and 'Make'. Your task is to implement a function that removes any dictionaries that contain 'None' or missing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_car_data([{'Meter Id': 1, 'Marked Time': '2022-01-01', 'VIN': '123', 'Make': 'Toyota'}, {'Meter Id': 2, 'Marked Time': '2022-01-02', 'VIN': '456', 'Make': None}, {'Meter Id': 3, 'Marked Time': '2022-01-03', 'VIN': '789', 'Make': 'Honda'}]) == [{'Make':...
{ "split": "train", "index": 76960, "acecode_id": "bigcode_python_fns_38432", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, list_a and list_b, of the same length. Write a function `broadcast_lesser(list_a: List[int], list_b: List[int]) -> List[bool]` that returns a new list of boolean values where each element at index i is True if the element at index i in list_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert broadcast_lesser([1, 2, 3], [3, 2, 1]) == [True, False, False]\", \"assert broadcast_lesser([5, 5, 5], [5, 5, 5]) == [False, False, False]\", \"assert broadcast_lesser([1, 4, 3], [2, 4, 5]) == [True, False, True]\", \"assert broadcast_lesser([10, 20, 30], [1...
{ "split": "train", "index": 76961, "acecode_id": "bigcode_python_fns_2286", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing the content of a protocol buffer file that may contain multiple `@@protoc_insertion_point(class_scope:...)` annotations. Your task is to write a function `extract_class_scopes(proto_code: str) -> List[str]` that extracts the class scope infor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_class_scopes('''# @@protoc_insertion_point(class_scope:example.ClassOne)''') == ['example.ClassOne']\", \"assert extract_class_scopes('''# @@protoc_insertion_point(class_scope:example.ClassOne)\\n# @@protoc_insertion_point(class_scope:example.ClassTw...
{ "split": "train", "index": 76962, "acecode_id": "oss_29764", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are developing a text-based adventure game where a character moves through various locations, each with specific events. Your task is to implement a function that processes the character's events based on their current location. The function should take the character's loca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_events('d5', {'d5_event_1': True, 'd5_event_2': False}) == {'d5_event_1': False, 'd5_event_2': False}\", \"assert process_events('f6', {'f6_event_2': True, 'f6_event_3': False}) == {'f6_event_2': False, 'f6_event_3': False}\", \"assert process_events...
{ "split": "train", "index": 76963, "acecode_id": "oss_11390", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given an array of integers, determine the longest increasing subarray. An increasing subarray is defined as a contiguous part of the array where each element is greater than the previous element. Return the longest increasing subarray. If there are multiple longest increasing s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_increasing_subarray([1,2,3,4,5]) == [1,2,3,4,5]\", \"assert longest_increasing_subarray([5,4,3,2,1]) == [5]\", \"assert longest_increasing_subarray([1,3,2,4,5]) == [2,4,5]\", \"assert longest_increasing_subarray([5,1,2,3,4]) == [1,2,3,4]\", \"assert ...
{ "split": "train", "index": 76964, "acecode_id": "evol_17534", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing column names in a DataFrame. Some column names may be marked for removal by a special prefix 'drop_'. Your task is to implement a function that takes this list of column names and returns a new list with all the column names that do ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_columns(['num1', 'num2', 'char']) == ['num1', 'num2', 'char']\", \"assert filter_columns(['drop_num1', 'num2', 'char']) == ['num2', 'char']\", \"assert filter_columns(['drop_num1', 'drop_num2', 'drop_char']) == []\", \"assert filter_columns(['num1', '...
{ "split": "train", "index": 76965, "acecode_id": "bigcode_python_fns_31746", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a syslog server. The function should take two parameters: a string `host` and an integer `port`. The function should return a message indicating whether the server can start successfully based on the given `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_syslog_server('localhost', 514) == 'Server started at localhost:514'\", \"assert start_syslog_server('127.0.0.1', 8080) == 'Server started at 127.0.0.1:8080'\", \"assert start_syslog_server('my-host', 9999) == 'Server started at my-host:9999'\", \"asse...
{ "split": "train", "index": 76966, "acecode_id": "oss_14318", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating statistics for a given list of metatiles and their states in a game. Each metatile is represented as a string containing state names separated by commas. Your function should take in a list of these metatiles and return a string containing the to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_stats(['state1', 'state2'], False) == 'Num metatiles: 2\\\\nNum states: 2\\\\nMax states per metatile: 1\\\\nAvg states per metatile: 1'\", \"assert calculate_stats(['state1,state2,state3', 'state4,state5'], False) == 'Num metatiles: 2\\\\nNum stat...
{ "split": "train", "index": 76967, "acecode_id": "oss_6223", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function that finds the maximum and minimum values in the list and then calculates the difference between the maximum and minimum values. The function should return a tuple containing the maximum value, the minimum value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_min_diff([5, 8, 3, 12, 7]) == (12, 3, 9)\", \"assert find_max_min_diff([-1, -5, -3, -2]) == (-1, -5, 4)\", \"assert find_max_min_diff([0, 0, 0, 0]) == (0, 0, 0)\", \"assert find_max_min_diff([1]) == (1, 1, 0)\", \"assert find_max_min_diff([10, 20, 3...
{ "split": "train", "index": 76968, "acecode_id": "oss_25", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates URLs for specific views within a wine journal application. The base URL for the wine journal is 'https://winejournal.com'. The available view names are 'add_wine', 'edit_wine', and 'view_wine'. Write a function named `gener...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_wine_url('add_wine') == 'https://winejournal.com/wines/add'\", \"assert generate_wine_url('edit_wine') == 'https://winejournal.com/wines/edit'\", \"assert generate_wine_url('view_wine') == 'https://winejournal.com/wines/view'\", \"assert generate_wi...
{ "split": "train", "index": 76969, "acecode_id": "oss_23631", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a two-dimensional line represented by its endpoints in the form of a list of tuples, where each tuple contains the x and y coordinates of a point on the line. Your task is to convert this 2D line into a 3D line by adding a z-coordinate to each point on the line. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_line_to_3d([(1, 2), (3, 4)], 0) == [(1, 2, 0), (3, 4, 0)]\", \"assert convert_line_to_3d([(0, 0), (5, 5)], 1) == [(0, 0, 1), (5, 5, 1)]\", \"assert convert_line_to_3d([(2, 3)], 10) == [(2, 3, 10)]\", \"assert convert_line_to_3d([(0, 1), (1, 0), (2, 2...
{ "split": "train", "index": 76970, "acecode_id": "bigcode_python_fns_5599", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates the Fibonacci sequence up to the nth element, starting from 0. The function should return a list of integers representing the Fibonacci sequence, where the Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",...
{ "split": "train", "index": 76971, "acecode_id": "evol_17625", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a geographical point represented by its latitude and longitude. Your task is to determine if this point lies within a specified circular zone. The zone is defined by its center point (latitude, longitude) and a radius in meters. The function should return a boolea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_point_in_zone(32.880600, -117.237561, 32.880600, -117.237561, 250) == True\", \"assert is_point_in_zone(32.880600, -117.237561, 32.880600, -117.237561, 500) == True\", \"assert is_point_in_zone(32.880600, -117.237561, 32.885000, -117.235000, 100) == False...
{ "split": "train", "index": 76972, "acecode_id": "bigcode_python_fns_15358", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string token, write a function that checks if the token is not None and returns True if it is a valid token (i.e., it is a non-empty string), and returns False otherwise. A valid token should be a string with length greater than 0. Implement the function `is_valid_token...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_token('abc123') == True\", \"assert is_valid_token('') == False\", \"assert is_valid_token(None) == False\", \"assert is_valid_token(' ') == True\", \"assert is_valid_token('valid_token') == True\", \"assert is_valid_token('123') == True\", \"assert...
{ "split": "train", "index": 76973, "acecode_id": "bigcode_python_fns_49854", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that takes two integer parameters: `start` and `end`. Your task is to implement the function `perform_operation` which returns the product of `start` and `end` if they are equal. If `start` and `end` are not equal, the function should return 0. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_operation(5, 5) == 25\", \"assert perform_operation(0, 0) == 0\", \"assert perform_operation(10, 10) == 100\", \"assert perform_operation(-3, -3) == 9\", \"assert perform_operation(7, 7) == 49\", \"assert perform_operation(2, 2) == 4\", \"assert perf...
{ "split": "train", "index": 76974, "acecode_id": "oss_36486", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_api_app` that takes a dictionary `global_conf` and an arbitrary number of keyword arguments `local_conf`. The function should determine the API version from `global_conf` and return a dictionary of routes associated with their res...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_api_app({'api_version': 'v2.0'}) == {'/log/single': 'v2_logs.Logs()'}\", \"assert create_api_app({'api_version': 'v3.0'}) == {'/logs': 'v3_logs.Logs()'}\", \"assert create_api_app({'api_version': 'v4.0'}) == {}\", \"assert create_api_app({'api_version...
{ "split": "train", "index": 76975, "acecode_id": "bigcode_python_fns_16268", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a command-line tool that can be run with different options. Your task is to implement a function that simulates the output of this tool in normal mode and debug mode. The tool takes a list of command-line arguments and outputs a string based on the presence of cer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_tool(['pygclip', '-s', 'monokai', '-l', 'python', 'simple.py']) == 'Output with normal settings'\", \"assert simulate_tool(['pygclip', '-d', '-s', 'monokai', '-l', 'python', 'simple.py']) == 'Output with debug settings'\", \"assert simulate_tool(['p...
{ "split": "train", "index": 76976, "acecode_id": "bigcode_python_fns_12613", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of words and an integer `n`, and returns the most frequently occurring words in the list. If there are ties in the frequency of words, return all the tied words. The function should be defined as `most_frequen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_frequent_words(['apple', 'banana', 'apple', 'orange', 'banana', 'apple'], 3) == ['apple']\", \"assert most_frequent_words(['dog', 'cat', 'dog', 'fish', 'cat', 'dog'], 2) == ['dog']\", \"assert most_frequent_words(['a', 'b', 'c', 'a', 'b', 'd', 'e'], 2) ...
{ "split": "train", "index": 76977, "acecode_id": "oss_9426", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries and a specific key, write a function that returns a new list of dictionaries with distinct values based on the provided key. Each dictionary in the output list should be unique in terms of the value associated with the specified key. If there are mu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert return_unique_dicts([{'id': 1, 'name': 'Jane'}, {'id': 2, 'name': 'Jane'}, {'id': 3, 'name': 'Bob'}], 'name') == [{'id': 1, 'name': 'Jane'}, {'id': 3, 'name': 'Bob'}]\", \"assert return_unique_dicts([{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}, {'id...
{ "split": "train", "index": 76978, "acecode_id": "evol_21254", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, implement a function that returns the nth Fibonacci number. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding numbers. Your function should handle cases where n is 0 and 1 correctly, returning ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib(0) == 0\", \"assert fib(1) == 1\", \"assert fib(2) == 1\", \"assert fib(3) == 2\", \"assert fib(4) == 3\", \"assert fib(5) == 5\", \"assert fib(6) == 8\", \"assert fib(7) == 13\", \"assert fib(8) == 21\", \"assert fib(9) == 34\", \"assert fib(10) == 55\"...
{ "split": "train", "index": 76979, "acecode_id": "evol_11740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string representation of a number and corrects it to ensure that it has exactly four decimal places. If the number does not contain a decimal point, append '.0000' to the end. If it has more than four decimal places, truncate it to four decimal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert correct_decimal_places('123') == '123.0000'\", \"assert correct_decimal_places('45.678') == '45.6780'\", \"assert correct_decimal_places('12.34567') == '12.3456'\", \"assert correct_decimal_places('0.1') == '0.1000'\", \"assert correct_decimal_places('100.00...
{ "split": "train", "index": 76980, "acecode_id": "evol_2263", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function `find_maximum(numbers)` that returns the maximum integer from the list. If the list is empty, the function should return None. The input will always be a list of integers. Implement this function to solve the pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3, 4, 5]) == 5\", \"assert find_maximum([-1, -2, -3, -4, -5]) == -1\", \"assert find_maximum([0, 0, 0, 0]) == 0\", \"assert find_maximum([10, 20, 30, 20, 10]) == 30\", \"assert find_maximum([5]) == 5\", \"assert find_maximum([]) == None\"...
{ "split": "train", "index": 76981, "acecode_id": "bigcode_python_fns_45324", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the daily temperatures recorded for a month, write a function that returns a list of integers where each integer at index i represents the difference in temperature between the highest temperature recorded during that day and the temperatur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert temperature_difference([[30, 32, 31], [28, 29], [35, 36, 34], [], [25]]) == [2, 1, 1, -1, 0]\", \"assert temperature_difference([[10, 15], [12, 11], [], [8, 9], [5]]) == [5, 0, -1, 1, 0]\", \"assert temperature_difference([[0], [1, 2, 3], [4], [5, 6], []]) =...
{ "split": "train", "index": 76982, "acecode_id": "bigcode_python_fns_38346", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string that contains shell commands with potential variable expansions. Your task is to implement a function `expand_commands(commands: str) -> List[str]` that takes in a string of shell commands and returns a list of commands after expanding any variables. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert expand_commands('echo $USER and $HOME') == ['echo Alice and /home/alice']\", \"assert expand_commands('ls $DIR') == ['ls /usr/local']\", \"assert expand_commands('echo $UNKNOWN_VAR') == ['echo ']\", \"assert expand_commands('$FIRST_VAR is set') == [' is set'...
{ "split": "train", "index": 76983, "acecode_id": "bigcode_python_fns_46813", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given an array of integers and a function that computes a reduction operation (like sum, mean, or max) on the array. Your task is to implement a function `reduce_array(arr: List[int], func: Callable[[List[int]], Any]) -> Tuple[Any, Tuple[int]]` that takes an array `arr`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reduce_array([1, 2, 3], sum) == (6, (1,))\", \"assert reduce_array([10, 20, 30], sum) == (60, (1,))\", \"assert reduce_array([-1, -2, -3], sum) == (-6, (1,))\", \"assert reduce_array([1, 2, 3, 4, 5], max) == (5, (1,))\", \"assert reduce_array([5, 5, 5], min)...
{ "split": "train", "index": 76984, "acecode_id": "bigcode_python_fns_12302", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a model with various attributes. Your task is to write a function `extract_model_data(models: List[Dict[str, Any]]) -> List[Dict[str, Any]]` that extracts and returns a list of models that have the attribute...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_model_data([{'name': 'ModelA', 'version': '1.0', 'isActive': True}, {'name': 'ModelB', 'version': '1.2', 'isActive': False}, {'name': 'ModelC', 'version': '2.0'}]) == [{'name': 'ModelA', 'version': '1.0'}]\", \"assert extract_model_data([{'name': 'Mo...
{ "split": "train", "index": 76985, "acecode_id": "bigcode_python_fns_8054", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of routes in a transportation network, where each route is represented by a dictionary containing the following keys: 'route_id', 'start_location', 'end_location', 'distance', and 'estimated_time'. Your task is to modify this list by adding a new key, 'cost...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_route_costs([{'route_id': 'R1', 'start_location': 'A', 'end_location': 'B', 'distance': 10.0, 'estimated_time': 2.0}]) == [{'route_id': 'R1', 'start_location': 'A', 'end_location': 'B', 'distance': 10.0, 'estimated_time': 2.0, 'cost': 20.0}]\", \"a...
{ "split": "train", "index": 76986, "acecode_id": "oss_5385", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `custom_sort` that takes a list of numbers (which may include negative integers and decimal numbers) and sorts them in ascending order. The function should return a new list containing the sorted numbers. You should not use any built-in sorting funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_sort([5, -3, -1.6, 0, 7.3, 4]) == [-3, -1.6, 0, 4, 5, 7.3]\", \"assert custom_sort([-1, -2, -3, 0, 2, 1]) == [-3, -2, -1, 0, 1, 2]\", \"assert custom_sort([3.2, 2.1, 5.5, 1.0]) == [1.0, 2.1, 3.2, 5.5]\", \"assert custom_sort([0, -1, 1]) == [-1, 0, 1]\...
{ "split": "train", "index": 76987, "acecode_id": "evol_26805", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a specified number of random DNA sequences of a given length. The function should take the following parameters: `length` (an integer representing the length of each DNA sequence), and `count` (an integer representing the n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_dna_sequences(1, 5) == ['A', 'C', 'G', 'T', 'A'] or ['A', 'C', 'G', 'T', 'C'] or ['A', 'C', 'G', 'T', 'G'] or ['A', 'C', 'G', 'T', 'T']\", \"assert len(generate_random_dna_sequences(3, 10)) == 10\", \"assert all(len(seq) == 3 for seq in gener...
{ "split": "train", "index": 76988, "acecode_id": "bigcode_python_fns_34999", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a nested list representing a multi-dimensional space. Your task is to implement a function `ravel_space(space: List[List[int]]) -> int` that converts this nested list into a one-dimensional representation, returning the total number of elements in the flattened li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ravel_space([[1, 2], [3, 4, 5], [6]]) == 6\", \"assert ravel_space([[1], [2], [3], [4]]) == 4\", \"assert ravel_space([[], [], []]) == 0\", \"assert ravel_space([[1, 2, 3], [4, 5], [6]]) == 6\", \"assert ravel_space([[1]]) == 1\", \"assert ravel_space([]) ==...
{ "split": "train", "index": 76989, "acecode_id": "bigcode_python_fns_7737", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with defining a protocol for communication between different modules in a system. A protocol is defined by the following components: send semantics, a name identifier, and a body that contains the rules of the protocol. Implement a function `define_protocol(send_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert define_protocol('optional', 'MyProtocol', 'body rules') == {'sendSemantics': 'optional', 'name': 'MyProtocol', 'body': 'body rules'}\", \"assert define_protocol('', 'SimpleProtocol', 'simple body') == {'sendSemantics': '', 'name': 'SimpleProtocol', 'body': '...
{ "split": "train", "index": 76990, "acecode_id": "bigcode_python_fns_3558", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of lists, where each inner list represents a row of data, and a list of column names, implement a function that converts this data into a list of dictionaries. Each dictionary should map the corresponding column name to the values in the respective row. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_to_dict([[1, 'Alice'], [2, 'Bob']], ['id', 'name']) == [{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}]\", \"assert list_to_dict([[1, 2], [3, 4]], ['a', 'b']) == [{'a': 1, 'b': 2}, {'a': 3, 'b': 4}]\", \"assert list_to_dict([['a', 'b', 'c'], ['d',...
{ "split": "train", "index": 76991, "acecode_id": "bigcode_python_fns_43300", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `multiply` that takes two float numbers as parameters and returns their product. The function should handle both positive and negative numbers, as well as zero.\nPlease reason step by step, then write a self-contained Python solution. Give your final...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply(2.0, 3.0) == 6.0\", \"assert multiply(-1.0, 5.0) == -5.0\", \"assert multiply(0.0, 10.0) == 0.0\", \"assert multiply(-3.0, -4.0) == 12.0\", \"assert multiply(1.5, 2.5) == 3.75\", \"assert multiply(0.0, 0.0) == 0.0\", \"assert multiply(100.0, 0.5) ==...
{ "split": "train", "index": 76992, "acecode_id": "evol_31483", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function named 'check_prime_in_sequence' that takes two parameters: an integer 'length' and an integer 'num'. The function should generate a sequence of integers from 1 to 'length' and then check if 'num' is within this sequence. If 'num' is a prime number, return True...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_prime_in_sequence(10, 2) == True\", \"assert check_prime_in_sequence(10, 3) == True\", \"assert check_prime_in_sequence(10, 4) == False\", \"assert check_prime_in_sequence(10, 5) == True\", \"assert check_prime_in_sequence(10, 6) == False\", \"assert c...
{ "split": "train", "index": 76993, "acecode_id": "evol_12887", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of floating-point numbers representing pairwise distances. Your task is to implement a function `modify_distances(distances)` that modifies these distances according to the following guidelines: Any distance value smaller than 1e-18 should be replaced with ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_distances([1e-18, 1e-18, 1e-18]) == [1e-18, 1e-18, 1e-18]\", \"assert modify_distances([1e-5, 0.5, 1.5]) == [1e-5, 0.5, 1.5]\", \"assert modify_distances([1.0, 5.0, 10.0]) == [1.0, 5.0, 10.0]\", \"assert modify_distances([1e-18, 1e-18]) == [1e-18, 1e-...
{ "split": "train", "index": 76994, "acecode_id": "oss_25176", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given string is a palindrome. A palindrome is a string that reads the same forward and backward, ignoring spaces, punctuation, and capitalization. Your task is to implement a function called `is_palindrome` that takes a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('') == Tr...
{ "split": "train", "index": 76995, "acecode_id": "oss_26459", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified version of an assignment expression evaluator in a programming language. An assignment expression consists of a type, modifier, name, right-hand side (rhs) value, and an object (which is a dictionary). Your task is to implement a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_assignment_expression('int', '', 'a', 10, {}) is None\", \"assert evaluate_assignment_expression('str', '', 'name', 'Alice', {}) is None\", \"assert evaluate_assignment_expression('int', '', 'count', 5, {'count': 0}) is None\", \"assert evaluate_ass...
{ "split": "train", "index": 76996, "acecode_id": "oss_21046", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a stratified plume model for a fluid particle release. Your function should return the simulation parameters and initial conditions required to initialize the simulation. Specifically, the function should return a tuple containing the following el...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_simulation_parameters() == ('BM54 CTD Data', ['Dissolving Particle: [composition: oxygen, nitrogen, argon, Q_N: 150, de: 0.005, lambda_1: 0.85]', 'Insoluble Particle: [composition: inert, mb0: 50, de: 0.01, lambda_1: 0.8]'], 300.0, 0.15, 2, 0.2, 1.0)\", ...
{ "split": "train", "index": 76997, "acecode_id": "bigcode_python_fns_27660", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a sparse matrix, along with two lists: one containing the column indices of the non-zero elements and another containing the row pointers that indicate the start and end of each row in the sparse matrix. Implement a function `fetch(...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch(0, [1, 2, 3], [0, 1, 2], [0, 1, 3], 1) == ([1], [0], 0)\", \"assert fetch(0, [1, 2, 3], [0, 1, 2], [0, 1, 3], 0) == ([], [], 1)\", \"assert fetch(1, [1, 2, 3], [0, 1, 2], [0, 1, 3], 0) == ([], [], 1)\", \"assert fetch(2, [1, 2, 3], [0, 1, 2], [0, 1, 3]...
{ "split": "train", "index": 76998, "acecode_id": "bigcode_python_fns_42991", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `get_bool_value(s: str) -> Optional[bool]` that takes a string `s` as input and returns a boolean value based on the following rules: If `s` is 'true' (case insensitive) or '1', return True. If `s` is 'false' (case insensitive) or '0', return False. If `s` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_bool_value('true') == True\", \"assert get_bool_value('TRUE') == True\", \"assert get_bool_value('True') == True\", \"assert get_bool_value('1') == True\", \"assert get_bool_value('false') == False\", \"assert get_bool_value('FALSE') == False\", \"assert...
{ "split": "train", "index": 76999, "acecode_id": "bigcode_python_fns_526", "num_tests": 16 }