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 sentence `text`, which is a string of words separated by spaces, with the first letter capitalized. Your task is to reorder the words in `text` in ascending order based on their lengths. If two words have the same length, they should maintain their original orde... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert arrangeWords('Leetcode is cool') == 'Is cool leetcode'\", \"assert arrangeWords('Keep calm and code on') == 'On and keep calm code'\", \"assert arrangeWords('To be or not to be') == 'To be or to be not'\", \"assert arrangeWords('A b c d e f g h') == 'A b c d... | {
"split": "train",
"index": 65700,
"acecode_id": "evol_3446",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You have a list of template sizes, and you need to create a unique identifier for each template size in the format 'template_name_sizeX', where 'template_name' is a given string and 'sizeX' is the size followed by its index in the list. Write a function `create_template_identif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_template_identifiers('myTemplate', [1, 2, 3]) == ['myTemplate_size0', 'myTemplate_size1', 'myTemplate_size2']\", \"assert create_template_identifiers('projectA', [5, 10]) == ['projectA_size0', 'projectA_size1']\", \"assert create_template_identifiers(... | {
"split": "train",
"index": 65701,
"acecode_id": "bigcode_python_fns_3831",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a field specification in a specific format. The format is as follows: the string begins with a field name followed by an optional range enclosed in square brackets. The range can be in the form 'start..end', where 'start' and 'end' are int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_field('temperature[10..20]') == {'field': 'temperature', 'start': 10, 'end': 20}\", \"assert decode_field('temperature[5..15]') == {'field': 'temperature', 'start': 5, 'end': 15}\", \"assert decode_field('humidity[]') == {'field': 'humidity'}\", \"ass... | {
"split": "train",
"index": 65702,
"acecode_id": "bigcode_python_fns_6658",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a learning rate adjustment function for a neural network training process. The function should take two parameters: the initial learning rate (`base_lr`) and the current epoch (`epoch`). Your function will return the adjusted learning rate based... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_learning_rate(0.1, 0) == 0.1\", \"assert adjust_learning_rate(0.1, 5) == 0.1\", \"assert adjust_learning_rate(0.1, 10) == 0.01\", \"assert adjust_learning_rate(0.1, 15) == 0.01\", \"assert adjust_learning_rate(0.1, 25) == 0.001\", \"assert adjust_lear... | {
"split": "train",
"index": 65703,
"acecode_id": "oss_31452",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that converts a time given in 24-hour format to its corresponding 12-hour format with the appropriate suffix 'AM' or 'PM'. Write a function `convert_to_12_hour_format` that takes a string representing the time in the format 'HH:MM:SS' (24-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_12_hour_format('00:00:00') == '12:00:00 AM'\", \"assert convert_to_12_hour_format('01:00:00') == '1:00:00 AM'\", \"assert convert_to_12_hour_format('11:59:59') == '11:59:59 AM'\", \"assert convert_to_12_hour_format('12:00:00') == '12:00:00 PM'\", ... | {
"split": "train",
"index": 65704,
"acecode_id": "oss_6944",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of items. Your task is to implement a function that computes the weighted sum of all the items in the list. The weighted sum is calculated by multiplying each item by its corresponding weight (its index in the list) and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_weighted_sum([1, 2, 3, 4]) == 20\", \"assert calculate_weighted_sum([0, 0, 0, 0]) == 0\", \"assert calculate_weighted_sum([-1, -2, -3]) == -8\", \"assert calculate_weighted_sum([10]) == 0\", \"assert calculate_weighted_sum([]) == 0\", \"assert calc... | {
"split": "train",
"index": 65705,
"acecode_id": "bigcode_python_fns_38350",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that removes all leading Unicode extended whitespace characters from a given string. Unicode extended whitespace characters include a variety of non-breaking spaces and other similar characters beyond the standard ASCII whitespace. Impleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert strip_unicode_whitespace('\\\\u2000Hello World') == 'Hello World'\", \"assert strip_unicode_whitespace('\\\\u2001\\\\u2002 Test String') == 'Test String'\", \"assert strip_unicode_whitespace(' Leading spaces') == 'Leading spaces'\", \"assert strip_unicod... | {
"split": "train",
"index": 65706,
"acecode_id": "bigcode_python_fns_17809",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numerical values representing flux measurements. Your task is to implement a function that replaces all occurrences of zero in the list with 'NaN' (Not a Number). The function should return the modified list. Note that 'NaN' can be represented as a strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_zeros_with_nan([1.0, 0.0, 2.5, 0.0]) == [1.0, 'NaN', 2.5, 'NaN']\", \"assert replace_zeros_with_nan([0.0, 0.0, 0.0]) == ['NaN', 'NaN', 'NaN']\", \"assert replace_zeros_with_nan([3.14, 2.71, 0.0, 1.0]) == [3.14, 2.71, 'NaN', 1.0]\", \"assert replace_z... | {
"split": "train",
"index": 65707,
"acecode_id": "bigcode_python_fns_153",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing term mappings in a table format. Each string corresponds to a row in the table containing a 'Term ID', 'Label', 'Parent Term', and 'GECKO Category' separated by tabs. Your task is to validate this table according to the following rul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_term_mapping(['COHORT:0000001\\tLabelA\\t\\tValidCategory', 'COHORT:0000002\\tLabelB\\tLabelA\\tValidCategory'], ['ValidCategory', 'AnotherCategory']) == []\", \"assert validate_term_mapping(['COHORT:0000007\\tLabelH\\t\\tValidCategory'], ['ValidCat... | {
"split": "train",
"index": 65708,
"acecode_id": "bigcode_python_fns_43846",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `to_one_hot` that transforms multi-class labels into a binary one-hot encoded format. The function should take a list of integers where each integer represents a class label (0-indexed) and return a tuple. The first element of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_one_hot([0, 1, 2]) == ([[1, 0, 0], [0, 1, 0], [0, 0, 1]], [0, 1, 2])\", \"assert to_one_hot([1, 0, 1, 2]) == ([[0, 1, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]], [0, 1, 2])\", \"assert to_one_hot([2, 2, 0, 1]) == ([[0, 0, 1], [0, 0, 1], [1, 0, 0], [0, 1, 0]], [... | {
"split": "train",
"index": 65709,
"acecode_id": "bigcode_python_fns_38369",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_geometric_sequence(start: int, ratio: int, length: int) -> List[int]` that generates a unique geometric sequence of numbers. The sequence must be increasing, have at least `length` elements, and cannot include any negative numbers or fractions. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_geometric_sequence(1, 2, 10) == [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]\", \"assert generate_geometric_sequence(3, 3, 5) == [3, 9, 27, 81, 243]\", \"assert generate_geometric_sequence(5, 1, 6) == [5, 5, 5, 5, 5, 5]\", \"assert generate_geometric_seq... | {
"split": "train",
"index": 65710,
"acecode_id": "evol_23470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D matrix of integers `gene_values` representing the expression levels of different genes across several experiments. Your task is to write a function `generate_heatmap(gene_values: List[List[int]]) -> List[List[int]]` that returns a new 2D matrix representing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_heatmap([[3, 1, 2], [6, 5, 4]]) == [[1, 2, 3], [4, 5, 6]]\", \"assert generate_heatmap([[5, 3, 2], [8, 7, 9], [1, 6, 4]]) == [[2, 3, 5], [7, 8, 9], [1, 4, 6]]\", \"assert generate_heatmap([[1]]) == [[1]]\", \"assert generate_heatmap([[1, 2, 3], [3, ... | {
"split": "train",
"index": 65711,
"acecode_id": "bigcode_python_fns_27985",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function to manage a simple user system for a social media platform. The function should accept a list of user details, where each user is represented as a dictionary containing their ID, username, and email. Your function should return a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_users_by_email_domain([{'id': 1, 'username': 'user1', 'email': 'user1@example.com'}, {'id': 2, 'username': 'user2', 'email': 'user2@example.com'}], 'example.com') == ['user1', 'user2']\", \"assert get_users_by_email_domain([{'id': 3, 'username': 'user3',... | {
"split": "train",
"index": 65712,
"acecode_id": "oss_37168",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of statistics where each item is a list containing a spectrum (spw), field, correlation (corr), and several measurements for different y-axes, implement a function `create_stats_table(stats: List[List[Union[int, float]]], yaxes: List[str]) -> Dict[str, List[Union[i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_stats_table([[1, 'A', 0.9, 10, 20], [1, 'B', 0.7, 30, 40], [1, 'C', 0.6, 50, 60]], ['y1', 'y2']) == {'y1': [30.0], 'y2': [40.0]}\", \"assert create_stats_table([[1, 'A', 0.5, 5], [1, 'B', 0.5, 15], [1, 'C', 0.5, 25]], ['y1']) == {'y1': [15.0]}\", \"as... | {
"split": "train",
"index": 65713,
"acecode_id": "bigcode_python_fns_20616",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a rule-based access control system. The rules are represented as a list of tuples, where each tuple contains a condition (a function that takes an integer key as input and returns True or False) and a permission (a string indicating the access l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_access([(lambda key: key > 100, 'admin'), (lambda key: key > 50, 'user'), (lambda key: key > 10, 'guest')], 75) == 'user'\", \"assert check_access([(lambda key: key > 100, 'admin'), (lambda key: key > 50, 'user'), (lambda key: key > 10, 'guest')], 150)... | {
"split": "train",
"index": 65714,
"acecode_id": "oss_33261",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with exporting activity data in different formats. Given an activity represented as a tuple (id, starttime) and a list of export formats, write a function `export_activity(activity: Tuple[int, datetime], export_formats: List[str]) -> List[str]` that returns a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert export_activity((1, '2023-10-01 12:00:00'), ['json_summary', 'json_details']) == ['activity_1_json_summary.json', 'activity_1_json_details.json']\", \"assert export_activity((2, '2023-10-02 15:30:00'), ['gpx', 'fit']) == ['activity_2_gpx.gpx', 'activity_2_fi... | {
"split": "train",
"index": 65715,
"acecode_id": "bigcode_python_fns_30783",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates an HTTP response status for a web server. The function should accept an integer representing a new status code and set the response status code accordingly. You need to implement the function `set_http_status(new_status... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_http_status(200) == 200\", \"assert set_http_status(404) == 404\", \"assert set_http_status(500) == 500\", \"assert set_http_status(403) == 403\", \"assert set_http_status(301) == 200\", \"assert set_http_status(100) == 200\", \"assert set_http_status(40... | {
"split": "train",
"index": 65716,
"acecode_id": "oss_19321",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive or negative integer, implement a function `convert_num(num)` that converts the number to its opposite sign using the bitwise NOT operator. The function should return the converted integer.\nPlease reason step by step, then write a self-contained Python solution... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_num(5) == -5\", \"assert convert_num(-3) == 3\", \"assert convert_num(0) == 0\", \"assert convert_num(1) == -1\", \"assert convert_num(-1) == 1\", \"assert convert_num(10) == -10\", \"assert convert_num(-10) == 10\", \"assert convert_num(100) == -100... | {
"split": "train",
"index": 65717,
"acecode_id": "evol_16049",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of cards where each card is represented as a dictionary with the following keys: 'id', 'name', and 'status'. Your task is to implement a function that takes in a player's name and returns a list of all card names that are currently in the player's hand. A c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_cards_in_hand_names('Alice', [{'id': 1, 'name': 'Ace of Spades', 'status': 'HAND'}, {'id': 2, 'name': 'King of Hearts', 'status': 'DISCARD'}, {'id': 3, 'name': 'Queen of Diamonds', 'status': 'HAND'}]) == ['Ace of Spades', 'Queen of Diamonds']\", \"assert... | {
"split": "train",
"index": 65718,
"acecode_id": "bigcode_python_fns_42716",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function named `merge_configs` that merges two dictionaries representing configuration settings. The first dictionary, `defaults`, contains default configuration settings, while the second dictionary, `loaded`, contains configuration settings ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_configs({'a': 1, 'b': 2}, {'b': 3, 'c': 4}) == {'a': 1, 'b': 3, 'c': 4}\", \"assert merge_configs({'x': 10, 'y': 20}, {}) == {'x': 10, 'y': 20}\", \"assert merge_configs({}, {'m': 5, 'n': 6}) == {'m': 5, 'n': 6}\", \"assert merge_configs({}, {}) == {}\... | {
"split": "train",
"index": 65719,
"acecode_id": "oss_20719",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function called `process_arguments` that takes any number of positional arguments and keyword arguments. The function should return a list where each element is a string. The first part of the list should contain each positional argument as a separate string, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_arguments('a', 'b', key1='val1', key2='val2') == ['a', 'b', 'key1: val1', 'key2: val2']\", \"assert process_arguments(1, 2, 3, keyA='alpha', keyB='beta') == ['1', '2', '3', 'keyA: alpha', 'keyB: beta']\", \"assert process_arguments() == []\", \"asser... | {
"split": "train",
"index": 65720,
"acecode_id": "oss_34167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates all prime Fibonacci numbers less than a given integer n. The function should return a list of these prime Fibonacci numbers in ascending order. Please optimize your solution for time and space complexities.\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibo_primes(10) == [2, 3, 5]\", \"assert fibo_primes(20) == [2, 3, 5, 13]\", \"assert fibo_primes(100) == [2, 3, 5, 13, 89]\", \"assert fibo_primes(150) == [2, 3, 5, 13, 89]\", \"assert fibo_primes(1) == []\", \"assert fibo_primes(2) == []\", \"assert fibo_p... | {
"split": "train",
"index": 65721,
"acecode_id": "evol_14347",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a command string and a JSON formatted data string as input. Your task is to implement a function that simulates the execution of a command by checking if the command is valid and if the provided data is in the correct format. The function should return 'Success' i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command('GET /api/data', '{\\\"key\\\": \\\"value\\\"}') == 'Success'\", \"assert execute_command('POST /api/data', '{\\\"key\\\": \\\"value\\\"}') == 'Success'\", \"assert execute_command('GET /api/data', '{key: value}') == 'Error'\", \"assert execu... | {
"split": "train",
"index": 65722,
"acecode_id": "bigcode_python_fns_5170",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the maximum number of group calls that can be initiated based on the estimated consumption of a single group call. The function should take the consumption as an optional parameter and return the maximum number of g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_group_calls(1) == 1000\", \"assert max_group_calls(2) == 500\", \"assert max_group_calls(3) == 333\", \"assert max_group_calls(4) == 250\", \"assert max_group_calls(5) == 200\", \"assert max_group_calls(10) == 100\", \"assert max_group_calls(20) == 50\",... | {
"split": "train",
"index": 65723,
"acecode_id": "oss_25103",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `quick_sort(arr: List[int]) -> List[int]` that sorts a given list of integers in ascending order using the quick sort algorithm. You should not modify the input list; instead, return a new sorted list. The function should efficiently handle large datasets a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quick_sort([8, 7, 2, 1, 0, 9, 6]) == [0, 1, 2, 6, 7, 8, 9]\", \"assert quick_sort([3, 6, 8, 10, 1, 2, 1]) == [1, 1, 2, 3, 6, 8, 10]\", \"assert quick_sort([]) == []\", \"assert quick_sort([1]) == [1]\", \"assert quick_sort([2, 1]) == [1, 2]\", \"assert quick... | {
"split": "train",
"index": 65724,
"acecode_id": "evol_16956",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of node names, return a dictionary that maps each unique node type to a list of the corresponding node names. If a node is a 'transform' type, you should check if it has associated shapes and if so, replace its type with the type of the first shape. Nodes that have... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_node_types(['node1', 'node2', 'node3']) == {'transform': ['node1', 'node2', 'node3']}\", \"assert get_node_types(['nodeA', 'nodeB', 'nodeC']) == {'transform': ['nodeA', 'nodeB', 'nodeC']}\", \"assert get_node_types([]) == {}\", \"assert get_node_types(['... | {
"split": "train",
"index": 65725,
"acecode_id": "bigcode_python_fns_24811",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of bounding boxes represented as tuples, where each tuple contains four integers (x1, y1, x2, y2) representing the coordinates of the top-left and bottom-right corners of the box. Write a function `filter_boxes(boxes: List[Tuple[int, int, int, int]], min_ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_boxes([(1, 1, 4, 4), (2, 2, 3, 3), (0, 0, 5, 5)], 5) == [(1, 1, 4, 4), (0, 0, 5, 5)]\", \"assert filter_boxes([(0, 0, 1, 1), (1, 1, 2, 2)], 2) == []\", \"assert filter_boxes([(0, 0, 2, 2), (1, 1, 3, 3)], 1) == [(0, 0, 2, 2), (1, 1, 3, 3)]\", \"assert ... | {
"split": "train",
"index": 65726,
"acecode_id": "bigcode_python_fns_13774",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists, where each inner list represents a solution with numeric values. You also have a dictionary representing the state of a game, where each key is a state identifier and the value is another dictionary containing 'value' (another dictionary with 'whi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_survival_probabilities([[0.0, 0.0, 0.0]], {'state2': {'value': {'white': 5, 'black': 5}, 'games': 10}}) == [0.0]\", \"assert evaluate_survival_probabilities([[0.2, 0.4]], {'state4': {'value': {'white': 7, 'black': 3}, 'games': 10}}) == [0.0]\", \"as... | {
"split": "train",
"index": 65727,
"acecode_id": "bigcode_python_fns_4988",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the winner of a Tic-Tac-Toe game played on a 3x3 grid. The grid is represented by a list of lists, where each inner list corresponds to a row on the grid. The elements of the inner lists can be 'X', 'O', or an empty st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tictactoe_winner([['X', 'X', 'X'], ['O', 'O', ''], ['', '', '']]) == 'X'\", \"assert tictactoe_winner([['O', 'X', 'X'], ['O', 'O', 'O'], ['X', 'O', '']]) == 'O'\", \"assert tictactoe_winner([['X', 'X', 'O'], ['O', 'X', 'O'], ['O', 'X', '']]) == 'X'\", \"asse... | {
"split": "train",
"index": 65728,
"acecode_id": "oss_23503",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `median(l: list) -> float` that returns the median of elements in the list `l` without sorting or using built-in functions. The function should handle collections including negative numbers and floating point numbers using the QuickSelect algorithm for line... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5]) == 3.0\", \"assert median([1, 3, 3, 6, 7, 8, 9]) == 6.0\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([3]) == 3.0\", \"assert median([1, 2]) == 1.5\", \"assert median([2, 1]) == 1.5\", \"assert median([5, 2, 1, 3, 4]) == ... | {
"split": "train",
"index": 65729,
"acecode_id": "evol_18089",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of bibliographic entries, where each entry is a string formatted as '@entry_id'. Write a function `generate_bibliography(year: int, entries: List[str]) -> str` that takes a year and a list of bibliographic entries for that year. The function should return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_bibliography(2021, ['entry1', 'entry2', 'entry3']) == '---\\\\nbibliography: bibliography.bib\\\\nnocite: \\\"@entry1,@entry2,@entry3\\\"\\\\n...\\\\n# 2021'\", \"assert generate_bibliography(2020, ['entry4']) == '---\\\\nbibliography: bibliography.... | {
"split": "train",
"index": 65730,
"acecode_id": "bigcode_python_fns_31201",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an image represented as a list of tuples, where each tuple represents an RGB color in the image. Write a function `compute_snes_color_score(img: List[Tuple[int, int, int]]) -> float` that calculates the ratio of SNES colors to the total number of colors in the ima... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_snes_color_score([(0, 0, 0), (255, 255, 255), (32, 64, 128)]) == 0.6666666666666666\", \"assert compute_snes_color_score([(255, 0, 0), (0, 255, 0), (0, 0, 255)]) == 0.0\", \"assert compute_snes_color_score([(0, 0, 0), (1, 1, 0), (1, 0, 1)]) == 0.3333... | {
"split": "train",
"index": 65731,
"acecode_id": "bigcode_python_fns_26657",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `perform_operations` that takes a list of operations to perform on a DynamoDB table. Each operation is a dictionary that can specify either 'write', 'read', or 'update'. For 'write', it should contain the item to add to the table. For 'read', it should spec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_operations([{'write': {'message_id': '001', 'message': 'Hello'}}, {'read': {'message_id': '001'}}, {'update': {'message_id': '001', 'attr_updates': {'message': {'Value': 'Hi', 'Action': 'PUT'}}}}]) == ['success', 'success', 'success']\", \"assert per... | {
"split": "train",
"index": 65732,
"acecode_id": "evol_58",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a URL string that points to a database. Your task is to implement a function named `dump_file_name` that extracts the database name from the URL and returns it as a string. The database name is defined as the last segment of the URL after the final '/' character, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dump_file_name('http://example.com/db_one') == 'db_one.sql'\", \"assert dump_file_name('http://example.com/db_two') == 'db_two.sql'\", \"assert dump_file_name('http://example.com/another_db') == 'another_db.sql'\", \"assert dump_file_name('http://example.com... | {
"split": "train",
"index": 65733,
"acecode_id": "bigcode_python_fns_35667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_rectangle(length: float, width: float, color: str) -> dict` that takes the length, width, and color of a rectangle as input and returns a dictionary containing the rectangle's area, perimeter, and color. The area is calculated as length multiplied b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_rectangle(5.0, 10.0, 'blue') == {'area': 50.0, 'perimeter': 30.0, 'color': 'blue'}\", \"assert create_rectangle(3.5, 4.5, 'red') == {'area': 15.75, 'perimeter': 16.0, 'color': 'red'}\", \"assert create_rectangle(1.0, 1.0, 'green') == {'area': 1.0, 'pe... | {
"split": "train",
"index": 65734,
"acecode_id": "evol_33677",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that evaluates the strength of a given password. The strength should be classified as 'Poor', 'Average', or 'Strong'. A password is considered 'Poor' if its length is less than 6 characters. A password is classified as 'Average' if it has at least 6 cha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_password('abc') == 'Poor'\", \"assert evaluate_password('abcdef') == 'Poor'\", \"assert evaluate_password('Abc123') == 'Average'\", \"assert evaluate_password('Abc1234') == 'Average'\", \"assert evaluate_password('Abc123456') == 'Average'\", \"asser... | {
"split": "train",
"index": 65735,
"acecode_id": "evol_16538",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, modify the list such that if any integer is 0, it should be replaced by 1. The function should return the modified list. Write a function `replace_zero_with_one(arr: List[int]) -> List[int]` that takes an input list `arr` and outputs the modified list.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_zero_with_one([0, 2, 3]) == [1, 2, 3]\", \"assert replace_zero_with_one([1, 0, 0, 4]) == [1, 1, 1, 4]\", \"assert replace_zero_with_one([5, 6, 7]) == [5, 6, 7]\", \"assert replace_zero_with_one([0]) == [1]\", \"assert replace_zero_with_one([0, 0, 0])... | {
"split": "train",
"index": 65736,
"acecode_id": "bigcode_python_fns_315",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integer coordinates representing points on a 2D plane. Your task is to implement a function that returns the total number of unique points that are marked by the given coordinates. A point is considered unique if it appears at least once in the list of c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_points([(1, 2), (2, 3), (1, 2), (4, 5)]) == 3\", \"assert count_unique_points([(0, 0), (0, 0), (0, 0)]) == 1\", \"assert count_unique_points([(1, 1), (1, 1), (2, 2), (2, 2), (3, 3)]) == 3\", \"assert count_unique_points([(10, 10), (20, 20), (30,... | {
"split": "train",
"index": 65737,
"acecode_id": "oss_5107",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given stack has reached a specified maximum capacity. The function should return True if the stack is full (i.e., its current size equals the maximum size) and False otherwise. Implement the following function: \n\n``... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_full([], 5) == False\", \"assert is_full([1, 2, 3], 3) == True\", \"assert is_full([1, 2, 3], 4) == False\", \"assert is_full([1, 2, 3, 4, 5], 5) == True\", \"assert is_full([1, 2, 3, 4], 5) == False\", \"assert is_full([1], 1) == True\", \"assert is_full... | {
"split": "train",
"index": 65738,
"acecode_id": "evol_3248",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages traffic data for observed vehicles. The function, named `update_traffic_data`, takes in information about newly observed vehicles and updates the traffic data accordingly. The function should ensure that the data for each... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_traffic_data(3, [1, 2], [50, 60], [10, 20], [1, 2]) == ([[50, 60, 1]], [[10, 20, 1]], [[1, 2, 0]])\", \"assert update_traffic_data(2, [1], [40], [15], [1]) == ([[40, 1]], [[15, 1]], [[1, 0]])\", \"assert update_traffic_data(5, [1, 2, 3], [30, 45, 55],... | {
"split": "train",
"index": 65739,
"acecode_id": "oss_37564",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names in a directory. Your task is to convert all files with the '.msg' extension to have a '.h' extension while keeping the original file names unchanged. If a file with the same name already exists in the output directory, it should not be overwri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_files(['doc.msg', 'image.png', 'script.msg'], ['doc.h']) == ['script.h']\", \"assert convert_files(['data1.msg', 'data2.msg'], ['data1.h', 'data2.h']) == []\", \"assert convert_files(['message1.msg', 'message2.msg'], ['message1.h', 'message3.h']) == ... | {
"split": "train",
"index": 65740,
"acecode_id": "bigcode_python_fns_21313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of dictionaries (representing data entries) and returns a filtered list based on a search query and a limit. The function will take in three parameters: a list of dictionaries `data`, a search query `search_qu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_data([{'field': 'value1', 'other_field': 'other_value1'}, {'field': 'value2', 'other_field': 'other_value2'}], {'field': 'value1'}, 10) == [{'field': 'value1', 'other_field': 'other_value1'}]\", \"assert filter_data([{'field': 'value1'}, {'field': 'va... | {
"split": "train",
"index": 65741,
"acecode_id": "oss_29983",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of numbers as input and returns a tuple containing the smallest number, the biggest number, and a sorted list of the numbers. The function should validate that the input is a list and that all elements are either integers or floats. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([5, 9, -10, 12, 3, 8, -15, 1]) == (-15, 12, [-15, -10, 1, 3, 5, 8, 9, 12])\", \"assert process_numbers([1.5, 2.5, -3.0, 0.0]) == (-3.0, 2.5, [-3.0, 0.0, 1.5, 2.5])\", \"assert process_numbers([100, -50, 0]) == (-50, 100, [-50, 0, 100])\", \"a... | {
"split": "train",
"index": 65742,
"acecode_id": "evol_14158",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `launch_subprocess(cmd: str) -> str` that simulates launching a subprocess with the given command string `cmd`. The function should return a string indicating the command that would have been executed. The command string will consist ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert launch_subprocess('ls -la') == 'Executing: ls with arguments: -la'\", \"assert launch_subprocess('python script.py arg1 arg2') == 'Executing: python with arguments: script.py, arg1, arg2'\", \"assert launch_subprocess(' echo Hello World ') == 'Executin... | {
"split": "train",
"index": 65743,
"acecode_id": "bigcode_python_fns_40312",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a person's age. The function should take an integer `initial_age` as a parameter and ensure that the age is not negative. If the `initial_age` is negative, the function should return 0. Additionally, the function should hav... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_age(5, 2) == 7\", \"assert calculate_age(0, 1) == 1\", \"assert calculate_age(-3, 2) == 2\", \"assert calculate_age(10, 0) == 10\", \"assert calculate_age(20, 5) == 25\", \"assert calculate_age(-1, 10) == 10\", \"assert calculate_age(30, 1) == 31\"... | {
"split": "train",
"index": 65744,
"acecode_id": "oss_8804",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing lines of text. Each line may contain comments (which start with a '#' character) or may be blank. Your task is to implement a function that filters out the comments and blank lines from the list. The function should return a new list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_lines(['# This is a comment', '', 'Line 1', 'Line 2', '# Another comment', 'Line 3']) == ['Line 1', 'Line 2', 'Line 3']\", \"assert filter_lines(['', '', '', '#', 'Line 1']) == ['Line 1']\", \"assert filter_lines(['Hello', '#Comment', 'World', '']) ==... | {
"split": "train",
"index": 65745,
"acecode_id": "bigcode_python_fns_38394",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the final score of a game based on specific scoring rules. The game involves throwing a ball at a target that is divided into concentric circles, each with a different score value. You are provided with the coordinates... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculateScore(0, 0, 10, 0, 2) == 10\", \"assert calculateScore(0, 0, 10, 0, 8) == 2\", \"assert calculateScore(0, 0, 10, 0, 9) == 1\", \"assert calculateScore(0, 0, 10, 11, 0) == 0\", \"assert calculateScore(0, 0, 20, 1, 1) == 10\", \"assert calculateScore(... | {
"split": "train",
"index": 65746,
"acecode_id": "oss_20278",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a list of permission names based on a list of user roles and a corresponding list of model names in a web application. Each permission name should be generated in the format 'can_<action>_<model>', where `<action>` is a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_permissions(['admin', 'editor'], ['post', 'comment']) == ['can_view_post', 'can_add_post', 'can_change_post', 'can_delete_post', 'can_view_comment', 'can_add_comment', 'can_change_comment', 'can_delete_comment']\", \"assert generate_permissions(['us... | {
"split": "train",
"index": 65747,
"acecode_id": "oss_7306",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a tree-like data structure represented as a list of lists, where each element is a node and its children are represented as nested lists. Write a function `get_all_children(tree: List[List], index: int) -> List[int]` that returns a flat list of all child nodes of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_all_children([[1, 2], [3, 4], []], 0) == [1, 2]\", \"assert get_all_children([[1], [3, 4], []], 1) == [3, 4]\", \"assert get_all_children([[5, 6], [], [7]], 2) == [7]\", \"assert get_all_children([[], [8, 9, 10]], 1) == [8, 9, 10]\", \"assert get_all_chi... | {
"split": "train",
"index": 65748,
"acecode_id": "bigcode_python_fns_10863",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an `m x n` matrix `grid` where each cell is either a wall `'W'`, an enemy `'E'`, or empty `'0'`. Your task is to implement a function `maxKills(grid, r)` that returns the maximum number of enemies you can kill using one bomb. The bomb can only be placed in an empt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxKills([['0', 'E', '0', '0'], ['E', '0', 'W', 'E'], ['0', 'E', '0', '0']], 1) == 3\", \"assert maxKills([['0', 'E'], ['E', 'W'], ['0', '0']], 1) == 2\", \"assert maxKills([['0', '0'], ['E', 'W']], 1) == 1\", \"assert maxKills([['W', '0', '0'], ['0', 'E', '... | {
"split": "train",
"index": 65749,
"acecode_id": "evol_16644",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `wait_for_condition(condition_function, timeout, interval)` that repeatedly checks the result of a condition function until it either returns True or the specified timeout is reached. The function should check the condition every `interva... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert wait_for_condition(lambda: True, 1, 0.1) == True\", \"assert wait_for_condition(lambda: 1 + 1 == 2, 5, 0.1) == True\", \"assert wait_for_condition(lambda: True, 10, 1) == True\", \"assert wait_for_condition(lambda: True, 0.5, 0.1) == True\", \"assert wait_fo... | {
"split": "train",
"index": 65750,
"acecode_id": "bigcode_python_fns_8206",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_application_id` that returns a fixed application ID as a string. The application ID should be a constant value that uniquely identifies the application. You are not allowed to access any external services or databases. Your function should simply retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_application_id() == 'app-12345'\", \"assert get_application_id() == 'app-12345'\", \"assert get_application_id() == 'app-12345'\", \"assert get_application_id() == 'app-12345'\", \"assert get_application_id() == 'app-12345'\", \"assert get_application_id... | {
"split": "train",
"index": 65751,
"acecode_id": "bigcode_python_fns_5134",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `print_primes_in_range(start: int, end: int, increment: int) -> List[int]` that prints all prime numbers starting from `start` to `end` (inclusive), incrementing by `increment` with each iteration. The function should check for valid input ranges, ensuring ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_primes_in_range(10, 100, 1) == [11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\", \"assert print_primes_in_range(10, 100, 0) == []\", \"assert print_primes_in_range(100, 10, 4) == []\", \"assert print_primes_in_rang... | {
"split": "train",
"index": 65752,
"acecode_id": "evol_5473",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple window management system. Your function should take in the width and height of a window, a title for the window, and a list of buttons to draw on that window. Each button is represented by a dictionary containi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert draw_buttons(400, 300, 'Sample Window', [{'label': 'Click me', 'position': (50, 50)}, {'label': 'Or me', 'position': (150, 50)}, {'label': 'Maybe me', 'position': (250, 50)}]) == ['Button drawn at (50, 50) with label: Click me', 'Button drawn at (150, 50) wi... | {
"split": "train",
"index": 65753,
"acecode_id": "oss_29226",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a file path in a specific format. Your task is to implement a function that returns the content of the file specified by that path. The content of the file is represented as a predefined dictionary where the keys are file paths and the val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_file_content('file1.txt') == 'Hello, World!'\", \"assert get_file_content('file2.txt') == 'This is a sample file.'\", \"assert get_file_content('file10.txt') == ''\", \"assert get_file_content('file11.txt') == ''\", \"assert get_file_content('file12.txt'... | {
"split": "train",
"index": 65754,
"acecode_id": "bigcode_python_fns_18826",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of command names based on a specified prefix. Given a list of command names and a prefix, your function should return a new list containing only those command names that start with the given prefix. If no command n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_commands(['start', 'stop', 'restart', 'status'], 'st') == ['start', 'stop', 'status']\", \"assert filter_commands(['run', 'test', 'execute', 'run_test'], 'run') == ['run', 'run_test']\", \"assert filter_commands(['build', 'deploy', 'build_image', 'tes... | {
"split": "train",
"index": 65755,
"acecode_id": "bigcode_python_fns_33316",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a command line interface (CLI) that can execute different commands. One of the commands available is 'show-servers', which should return a success exit code when executed. Additionally, the CLI should support a help command ('--help') that provides ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command('show-servers') == 0\", \"assert execute_command('--help') == 0\", \"assert execute_command('list-users') == -1\", \"assert execute_command('start-server') == -1\", \"assert execute_command('stop-server') == -1\", \"assert execute_command('st... | {
"split": "train",
"index": 65756,
"acecode_id": "bigcode_python_fns_30019",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a filename (lfn) and a scope, create a function that constructs a redirect URL. The redirect URL should be formatted as 'http://redirect.example.com/redirect/{scope}/{filename}'. You need to write a function `get_redirect_url(lfn: str, scope: str) -> str` that takes two p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_redirect_url('user.gangarbt.62544955._2108356106.log.tgz', 'user.gangarbt') == 'http://redirect.example.com/redirect/user.gangarbt/user.gangarbt.62544955._2108356106.log.tgz'\", \"assert get_redirect_url('file.txt', 'valid1') == 'http://redirect.example.... | {
"split": "train",
"index": 65757,
"acecode_id": "bigcode_python_fns_3227",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of different buildings in a row. Write a function `max_visible_buildings(heights: List[int]) -> int` that returns the maximum number of buildings that can be seen from the left side of the row. A building can only be see... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_visible_buildings([1, 3, 2, 5, 4]) == 3\", \"assert max_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert max_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_buildings([3, 1, 4, 1, 5, 9]) == 4\", \"assert max_visible_buildings([10, 20, ... | {
"split": "train",
"index": 65758,
"acecode_id": "bigcode_python_fns_37240",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the average of a series of numbers. The function should take a list of numbers as input and return the average of those numbers. If the list is empty, the function should return 0. Implement the function `calculate_ave... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([10, 20, 30]) == 20.0\", \"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([-1, -2, -3]) == -2.0\", \"assert calculate_average([0, 0, 0]) == 0.0\", \"assert calculate_average([10]) == 10.0\", \"assert calculat... | {
"split": "train",
"index": 65759,
"acecode_id": "oss_4730",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary containing user credentials with keys 'username' and 'password', write a function `process_user_credentials(credentials: Dict[str, str]) -> Dict[str, str]` that processes these credentials. The function should return a new dictionary with the keys 'title' and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_user_credentials({'username': 'user@host.com', 'password': '123abc'}) == {'title': 'user@host.com', 'data': {'username': 'user@host.com', 'password': '123abc'}}\", \"assert process_user_credentials({'username': 'john@doe.com', 'password': 'mypassword... | {
"split": "train",
"index": 65760,
"acecode_id": "bigcode_python_fns_17292",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates processing a payment transaction based on an event object that contains transaction details. The event object is a dictionary with the following structure: {'event': {'data': {'metadata': {'user_id': int}, 'code': str, 'loc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_transaction({'event': {'data': {'metadata': {'user_id': 1}, 'code': 'TX123', 'local': {'amount': 100.0}}, 'type': 'transaction:pending'}}) == 'Transaction is pending. Awaiting confirmation.'\", \"assert process_transaction({'event': {'data': {'metada... | {
"split": "train",
"index": 65761,
"acecode_id": "bigcode_python_fns_44509",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries, `dct1` and `dct2`, where the keys are strings and the values are integers. Write a function `merge_dictionaries(dct1: Dict[str, int], dct2: Dict[str, int]) -> Dict[str, int]` that merges the two dictionaries into a new dictionary. If a key exists... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_dictionaries({'a': 1, 'b': 2}, {'b': 3, 'c': 4}) == {'a': 1, 'b': 3, 'c': 4}\", \"assert merge_dictionaries({}, {'a': 1}) == {'a': 1}\", \"assert merge_dictionaries({'x': 10}, {}) == {'x': 10}\", \"assert merge_dictionaries({'a': 1}, {'a': 2}) == {'a':... | {
"split": "train",
"index": 65762,
"acecode_id": "bigcode_python_fns_8218",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary, a list of worker output logs, a list of endpoint output logs, and a list of container names. Your task is to implement a function that processes these logs and returns two lists: one containing metrics for worker nodes and another conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gather_metrics({'mode': 'cloud'}, [['log1', 'log2'], ['log3']], [['log4', 'ERROR log5'], ['log6']], ['container1', 'container2']) == ([{'container_name': 'container1', 'log_count': 2}, {'container_name': 'container2', 'log_count': 1}], [{'container_name': 'c... | {
"split": "train",
"index": 65763,
"acecode_id": "bigcode_python_fns_24661",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing changesets in a version control repository. Your task is to implement a function that determines if there are any new incoming changesets compared to a reference list of changesets. The function should return a list of incoming chan... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_incoming_changesets([1, 2, 3], [3, 4, 5]) == [1, 2]\", \"assert find_incoming_changesets([10, 20, 30], [30, 40, 50]) == [10, 20]\", \"assert find_incoming_changesets([1, 2, 3, 4, 5], [1, 2]) == [3, 4, 5]\", \"assert find_incoming_changesets([], [1, 2, 3... | {
"split": "train",
"index": 65764,
"acecode_id": "bigcode_python_fns_22453",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a floating-point number `value` and a floating-point `tolerance`, implement a function that returns a new floating-point number which is within the range of `value ± (value * tolerance)`. The returned value should be randomly generated within this range. If the tolerance ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert 0.99 <= random_tolerance(1.0, 0.01) <= 1.01\", \"assert 3.0 <= random_tolerance(4.0, 0.25) <= 5.0\", \"assert random_tolerance(10.0, 0.1) >= 9.0\", \"assert random_tolerance(10.0, 0.1) <= 11.0\", \"assert random_tolerance(100.0, 0.2) >= 80.0\", \"assert rand... | {
"split": "train",
"index": 65765,
"acecode_id": "bigcode_python_fns_45673",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a library of electronic components and their associated footprints. The function should take a list of footprints and a keyword as input and return a list of footprints that contain the keyword in their name (case-insensitive... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_footprints([{'name': 'Resistor'}, {'name': 'Capacitor'}, {'name': 'Inductor'}], 'cap') == [{'name': 'Capacitor'}]\", \"assert search_footprints([{'name': 'Diode'}, {'name': 'LED'}, {'name': 'Transistor'}], 'o') == [{'name': 'Diode'}, {'name': 'Transis... | {
"split": "train",
"index": 65766,
"acecode_id": "oss_25492",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `store_data(data: str) -> None` that takes a string `data`, and stores it into a file named 'datafile.txt'. The function should write the provided string directly into this file without any additional formatting or processing. Ensure that the function handl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_data('Hello, World!') is None\", \"assert store_data('Data for testing.') is None\", \"assert store_data('Sample log entry 1') is None\", \"assert store_data('Sample log entry 2') is None\", \"assert store_data('Another test') is None\", \"assert store... | {
"split": "train",
"index": 65767,
"acecode_id": "evol_25921",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `message` that you need to send to a specific `node` using a defined set of parameters including `username`, `password`, `resource`, and the maximum number of `max_attempts` (default is 1). Implement a function `send_message(message: str, node: str, usern... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_message('Hello, World!', 'node1', 'user1', 'pass1', 'resource1') == 0\", \"assert send_message('Test Message', 'node2', 'user2', 'pass2', 'resource2', 3) == 0\", \"assert send_message('Another test message', 'node3', 'user3', 'pass3', 'resource3', 5) ==... | {
"split": "train",
"index": 65768,
"acecode_id": "bigcode_python_fns_17754",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that maps an action to a specific intervention based on a given time. The function should take two parameters: an integer `action` (where `0 <= action <= 3`) and a float `time`. Each action corresponds to a specific intervention defined b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_intervention(0, 1.0) == Intervention(time=1.0, epsilon_1=0.0, epsilon_2=0.0)\", \"assert get_intervention(1, 2.5) == Intervention(time=2.5, epsilon_1=0.0, epsilon_2=0.3)\", \"assert get_intervention(2, 3.3) == Intervention(time=3.3, epsilon_1=0.7, epsilo... | {
"split": "train",
"index": 65769,
"acecode_id": "bigcode_python_fns_46",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of floating-point numbers and returns a new list containing the same numbers sorted in descending order. The input list will not be empty and will only contain valid floating-point numbers. For example, given the input [7.1, -2.6, 4.0, 21.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_array_descending([7.1, -2.6, 4.0, 21.8, 0.0]) == [21.8, 7.1, 4.0, 0.0, -2.6]\", \"assert sort_array_descending([-1.5, 3.2, 0.0]) == [3.2, 0.0, -1.5]\", \"assert sort_array_descending([2.5, 2.5, 2.5]) == [2.5, 2.5, 2.5]\", \"assert sort_array_descending(... | {
"split": "train",
"index": 65770,
"acecode_id": "evol_260",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that counts the number of lowercase consonants located at odd index positions in a given string. The function should only consider lowercase letters, and consonants are defined as letters that are not vowels (a, e, i, o, u). Return the count of such consona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_lower('ABCDEF') == 0\", \"assert count_lower('zxyA') == 1\", \"assert count_lower('aeiou') == 0\", \"assert count_lower('zebra') == 1\", \"assert count_lower('12345!@#$%') == 0\", \"assert count_lower('') == 0\", \"assert count_lower('abcdefg') == 3\",... | {
"split": "train",
"index": 65771,
"acecode_id": "evol_34130",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that performs string substitution based on a given dictionary of key-value pairs. The function should take in a string and a dictionary, and replace any occurrences of the keys in the string with their corresponding values from... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_substitution('Hello, my name is {name}.', {'{name}': 'Alice'}) == 'Hello, my name is Alice.'\", \"assert perform_substitution('Good morning! {greeting}', {'{greeting}': 'Have a nice day'}) == 'Good morning! Have a nice day'\", \"assert perform_substi... | {
"split": "train",
"index": 65772,
"acecode_id": "oss_4255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that constructs an object from a dictionary. The class, `LinecodeRMatrix`, represents a line code R matrix and has an attribute `_phase_t`. Implement the function `from_dict` that takes a dictionary as input and returns an instance of `Li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert LinecodeRMatrix.from_dict({'_phase_t': 5})._phase_t == 5\", \"assert LinecodeRMatrix.from_dict({'_phase_t': 3.14})._phase_t == 3.14\", \"assert LinecodeRMatrix.from_dict({'_phase_t': 'test'})._phase_t == 'test'\", \"assert LinecodeRMatrix.from_dict({'_phase_... | {
"split": "train",
"index": 65773,
"acecode_id": "oss_5390",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_average(myList)` that takes a list of elements and returns the average of the numeric values in the list. The function should be able to handle lists of different lengths and data types, including integers, floats, and numeric strings. Non-numeric va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average(['a', 'b', 'c']) == 0\", \"assert calculate_average([1, 2, 3]) == 2.0\", \"assert calculate_average([1.5, 2.5, 3.5]) == 2.5\", \"assert calculate_average(['1', '2', '3']) == 2.0\", \"assert calculate_average([True, False, 1, '0']) == 0.5\",... | {
"split": "train",
"index": 65774,
"acecode_id": "evol_13810",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a directory path and associated tags for a data request. Implement a function `validate_directory(dqroot: str, dqtag: str, dqpath: str) -> bool` that checks the following conditions: 1. If `dqpath` is None, check if `dqroot` is a valid root direct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_directory('valid_root', 'valid_tag', None) == True\", \"assert validate_directory('valid_root', None, None) == True\", \"assert validate_directory('', 'valid_tag', None) == False\", \"assert validate_directory('valid_root', 'invalid tag', None) == F... | {
"split": "train",
"index": 65775,
"acecode_id": "bigcode_python_fns_42574",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if two given strings are anagrams of each other. An anagram is a rearrangement of the letters in one string to form the other string. Your function should take two strings as input and return True if they are anagrams, and Fal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('Listen', 'Silent') == True\", \"assert are_anagrams('hello', 'world') == False\", \"assert are_anagrams('anagram', 'nagaram') == True\", \"assert are_anagrams('rat', 'car') == False\", \"asse... | {
"split": "train",
"index": 65776,
"acecode_id": "bigcode_python_fns_8784",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a Python list that may contain strings and integers, write a function that converts the list into an XML string representation. Each list element should be wrapped in an `<item>` tag, and all integers should be converted to strings. The function should take two parameters... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_to_xml(['apple', 'banana', 5], 'Fruits') == '<Fruits><item>apple</item><item>banana</item><item>5</item></Fruits>'\", \"assert list_to_xml(['cat', 1, 'dog'], 'Animals') == '<Animals><item>cat</item><item>1</item><item>dog</item></Animals>'\", \"assert l... | {
"split": "train",
"index": 65777,
"acecode_id": "evol_34383",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns the maximum sum of any contiguous subarray within the list. A contiguous subarray is defined as a sequence of elements that are adjacent to each other in the list. Your function should handle ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([]) == 0\", \"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([2, 1]) == 3\", \"assert max_s... | {
"split": "train",
"index": 65778,
"acecode_id": "oss_37393",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of images, each containing a list of objects with associated names, write a function `extract_top_k_objects` that returns a set of the top `k` most common object names and a dictionary containing the count of each of these top object names. The function should take... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_top_k_objects([], 3) == (set(), {})\", \"assert extract_top_k_objects([{'objects': [{'names': []}]}], 3) == (set(), {})\", \"assert extract_top_k_objects([{'objects': [{'names': ['cat', 'dog']}, {'names': ['cat']}]}], 2) == (set(['cat', 'dog']), {'ca... | {
"split": "train",
"index": 65779,
"acecode_id": "bigcode_python_fns_7355",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two numerical sequential arrays, `arr1` and `arr2`, each containing unique elements ranging from 1 to 100. The first array, `arr1`, has one missing numeral from the set, while the second array, `arr2`, contains one extraneous numeral not from the set. Your task is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_missing_and_extraneous([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]) == (13, 13)\", \"assert find_missing_and_extraneous([2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6, 8]) == (1, 8)\", \"assert find_missing_and_extraneous([1... | {
"split": "train",
"index": 65780,
"acecode_id": "evol_17965",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique elements from the original list, preserving the order of their first occurrence. Write a function named `get_unique_elements` that accomplishes this. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 2, 3, 4, 3, 5]) == [1, 2, 3, 4, 5]\", \"assert get_unique_elements([1, 1, 1, 1]) == [1]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([5, 5, 6, 7, 7, 8]) == [5, 6, 7, 8]\", \"assert get_unique_elements([... | {
"split": "train",
"index": 65781,
"acecode_id": "oss_13740",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `sparse_coding_algorithm` that performs sparse coding based on the provided input parameters. The function should take the following parameters: \n- `X`: a 2D list representing the input data matrix with dimensions (m, n) \n- `W`: a 2... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sparse_coding_algorithm([[1, 2], [3, 4]], [[0.1, 0.2], [0.3, 0.4]], [[0.01]], 0.1, 1.0, 1, 4, True, True, 0.01, 100) == 'Dummy Output'\", \"assert sparse_coding_algorithm([[5, 6]], [[0.5, 0.6]], [[0.02]], 0.2, 2.0, 2, 2, False, False, 0.02, 50) == 'Dummy Out... | {
"split": "train",
"index": 65782,
"acecode_id": "oss_31075",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of events represented as strings. Each event is either 'before' or 'after'. Your task is to implement a function that counts the number of 'before' events that occur before the first 'after' event in the list. If there are no 'after' events, return the tota... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_before_events(['before', 'before', 'after', 'before']) == 2\", \"assert count_before_events(['before', 'after', 'before', 'after']) == 1\", \"assert count_before_events(['before', 'before', 'before']) == 3\", \"assert count_before_events(['after', 'bef... | {
"split": "train",
"index": 65783,
"acecode_id": "bigcode_python_fns_22721",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates user preferences provided in a dictionary format. The preferences will be passed as a JSON-like dictionary, and you need to ensure that the data adheres to specific requirements. The preferences should contain the following... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_preferences({'theme': 'light', 'notifications': True, 'language': 'en'}) == {'ok': True}\", \"assert validate_user_preferences({'theme': 'dark', 'notifications': False, 'language': 'fr'}) == {'ok': True}\", \"assert validate_user_preferences({'... | {
"split": "train",
"index": 65784,
"acecode_id": "bigcode_python_fns_27579",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that extracts a specific portion of a byte array and returns it as a new byte array. The function `get_bytes(byte_string: bytes, start_position: int, size: int) -> bytes` should take three parameters: `byte_string` (a bytes object), `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_bytes(b'hello world', 0, 5) == b'hello'\", \"assert get_bytes(b'hello world', 6, 5) == b'world'\", \"assert get_bytes(b'hello world', 0, 11) == b'hello world'\", \"assert get_bytes(b'hello world', 5, 6) == b' world'\", \"assert get_bytes(b'hello world', ... | {
"split": "train",
"index": 65785,
"acecode_id": "oss_19217",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries representing the public interfaces of two different feature classes, `c_feature_interface` and `py_feature_interface`. Each dictionary contains the names of features as keys and a set of attributes associated with each feature as values. Your task... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_feature_interfaces({'feature1': {'attr1', 'attr2'}, 'feature2': {'attr3'}}, {'feature1': {'attr1', 'attr2'}, 'feature2': {'attr3'}}) == True\", \"assert compare_feature_interfaces({'feature1': {'attr1', 'attr2'}, 'feature2': {'attr3'}}, {'feature1': ... | {
"split": "train",
"index": 65786,
"acecode_id": "bigcode_python_fns_46278",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a list of states from a predefined list. Your function `get_states()` should not connect to any database but rather return a hardcoded list of state names. The function should return the states in the order they are lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_states() == ['California', 'New York', 'Texas']\", \"assert get_states() == ['California', 'New York', 'Texas']\", \"assert len(get_states()) == 3\", \"assert 'California' in get_states()\", \"assert 'Texas' in get_states()\", \"assert 'New York' in get_... | {
"split": "train",
"index": 65787,
"acecode_id": "oss_25348",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with modifying a list of included directory paths represented as a list of strings. Your goal is to create a function that takes an existing list of directory paths and a new directory path as inputs, and adds the new directory path to the list of included direct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_directory(['directory1', 'directory2'], 'new_directory') == ['directory1', 'directory2', 'new_directory']\", \"assert add_directory([], 'new_directory') == ['new_directory']\", \"assert add_directory(['dirA', 'dirB'], 'dirC') == ['dirA', 'dirB', 'dirC']\... | {
"split": "train",
"index": 65788,
"acecode_id": "oss_25915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates loading a list of tasks from a source. The function should take a list of tasks, each represented as a string, and return a new list that contains only the tasks that are unique (i.e., no duplicates). The input list can... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_unique_tasks(['task1', 'task2', 'task1', 'task3']) == ['task1', 'task2', 'task3']\", \"assert load_unique_tasks(['task1', 'task1', 'task1']) == ['task1']\", \"assert load_unique_tasks([]) == []\", \"assert load_unique_tasks(['task1', 'task2', 'task3', '... | {
"split": "train",
"index": 65789,
"acecode_id": "bigcode_python_fns_22911",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to calculate the average rate of change of a function given two points in time and their corresponding function values. Write a function `average_rate_of_change(f1: float, f0: float, t1: float, t0: float) -> float` that takes in fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_rate_of_change(30.0, 10.0, 5.0, 0.0) == 4.0\", \"assert average_rate_of_change(50.0, 20.0, 10.0, 5.0) == 6.0\", \"assert average_rate_of_change(10.0, 5.0, 5.0, 0.0) == 1.0\", \"assert average_rate_of_change(-10.0, -20.0, 2.0, 1.0) == 10.0\", \"assert... | {
"split": "train",
"index": 65790,
"acecode_id": "oss_12063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list (matrix) of integers and a target integer. Your task is to implement a function that returns the size of the smallest subset of the matrix elements whose sum equals the target value. If no such subset exists, return -1. The subset can include elements fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smallest_subset([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 15) == 2\", \"assert smallest_subset([[1, 1, 1], [1, 1, 1]], 3) == 3\", \"assert smallest_subset([[10, 20, 30], [40, 50]], 70) == 2\", \"assert smallest_subset([[5, 5, 5], [5, 5]], 10) == 2\", \"assert small... | {
"split": "train",
"index": 65791,
"acecode_id": "evol_16063",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that returns a new list containing only the unique integers from the input list, preserving the original order of their first occurrence. Duplicate integers should only appear once in the output list. Write ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([1, 1, 1, 1]) == [1]\", \"assert unique_integers([]) == []\", \"assert unique_integers([5, 3, 5, 2, 3, 1]) == [5, 3, 2, 1]\", \"assert unique_integers([7, 8, 9, 7, 9, 8]) =... | {
"split": "train",
"index": 65792,
"acecode_id": "bigcode_python_fns_11629",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple function that takes a list of integers and returns the sum of all even numbers in the list. If there are no even numbers, the function should return 0. Your function should be named `sum_of_evens(nums: List[int]) -> int`. The input will... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([-2, -4, -6, 1]) == -12\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([0]) == 0\", \"assert sum_... | {
"split": "train",
"index": 65793,
"acecode_id": "oss_20277",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that generates a specific string based on a given list of words and a template string containing placeholders. Write a function `replace_placeholders(words, template)` where: - `words` is a list of strings representing the words to be used... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_placeholders([\\\"apple\\\", \\\"banana\\\", \\\"cherry\\\"], \\\"I have {0} and {1}, but I want {2}.\\\") == \\\"I have apple and banana, but I want cherry.\\\"\", \"assert replace_placeholders([\\\"dog\\\", \\\"cat\\\", \\\"fish\\\"], \\\"My {0} is... | {
"split": "train",
"index": 65794,
"acecode_id": "oss_37739",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of strings, each representing lines from two different textual manuscripts. Write a function `find_matching_lines(file1_lines: List[str], file2_lines: List[str]) -> List[str]` that returns a list of lines that are identical in both manuscripts. The outpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_matching_lines(['Hello World', 'Python is great', 'Goodbye'], ['Python is great', 'Hello World', 'See you']) == ['Hello World', 'Python is great']\", \"assert find_matching_lines(['Line one', 'Line two', 'Line three'], ['Line two', 'Line four', 'Line on... | {
"split": "train",
"index": 65795,
"acecode_id": "evol_21892",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_numeric_sequence(s: str) -> bool` that checks if a provided string consists solely of numerical characters (0-9). The function should return True if the string is purely numerical, and False otherwise. An empty string should be considered non-numerical.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_numeric_sequence('12345') == True\", \"assert is_numeric_sequence('0') == True\", \"assert is_numeric_sequence('67890') == True\", \"assert is_numeric_sequence('123.45') == False\", \"assert is_numeric_sequence('abc123') == False\", \"assert is_numeric_se... | {
"split": "train",
"index": 65796,
"acecode_id": "evol_10087",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the capacities of various memory levels in a computing architecture. Your task is to determine if it is possible to allocate a given number of variables across these memory levels such that the capacity constraints are satisfied. Ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_allocate_memory([10, 20, 30], 15) == True\", \"assert can_allocate_memory([5, 10, 15], 25) == True\", \"assert can_allocate_memory([1, 2, 3], 7) == False\", \"assert can_allocate_memory([0, 0, 0], 1) == False\", \"assert can_allocate_memory([10, 10, 10],... | {
"split": "train",
"index": 65797,
"acecode_id": "bigcode_python_fns_31999",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function `median_calculation(data)` that calculates the median value from an input list of integers. If the input list is empty, the function should raise a ValueError with the message 'The input list is empty.' If the input list contains any non-integer values, the fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median_calculation([1, 2, 3, 4, 5]) == 3\", \"assert median_calculation([1, 2, 3, 4]) == 2.5\", \"assert median_calculation([5, 3, 1, 4, 2]) == 3\", \"assert median_calculation([10, 20, 30]) == 20\", \"assert median_calculation([1, 3, 5, 7, 9, 11]) == 6\", \... | {
"split": "train",
"index": 65798,
"acecode_id": "evol_19184",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer base length `b`, find the hypotenuse `H` of a right-angled triangle such that the perpendicular `p` satisfies the condition `p = b + 1` or `p = b - 1`. The relationship between `b`, `p`, and `H` is given by the Pythagorean theorem: `H = sqrt(b^2 + p^2`.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_hypotenuse(20) == 29\", \"assert find_hypotenuse(119) == 169\", \"assert find_hypotenuse(1) == 1\", \"assert find_hypotenuse(3) == 5\", \"assert find_hypotenuse(4) == 5\"]}"
} | {
"split": "train",
"index": 65799,
"acecode_id": "evol_35205",
"num_tests": 5
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.