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 working on a project that requires customizing properties for UI components in a graphical application. Your task is to write a Python function that generates a code snippet to set the length of a slider in a specific format. Write a function `generate_slider_code(slide... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_slider_code(0.01) == 'slider.length = 0.01'\", \"assert generate_slider_code(0.5) == 'slider.length = 0.5'\", \"assert generate_slider_code(1.0) == 'slider.length = 1.0'\", \"assert generate_slider_code(2.5) == 'slider.length = 2.5'\", \"assert gene... | {
"split": "train",
"index": 72900,
"acecode_id": "oss_640",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines if two file objects are equivalent based on their SHA hash and filename. Write a function named `are_files_equal` that takes in two dictionaries representing file objects. Each dictionary will have the keys 'url', 'sha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_files_equal({'url': 'http://example.com/file1', 'sha_hash': 'abc123', 'filename': 'file1.txt'}, {'url': 'http://example.com/file2', 'sha_hash': 'abc123', 'filename': 'file1.txt'}) == True\", \"assert are_files_equal({'url': 'http://example.com/file1', 's... | {
"split": "train",
"index": 72901,
"acecode_id": "oss_1709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a logging function that formats a log message based on provided parameters. The function should accept the following parameters: 'function_name' (a string), 'validation_value' (a string), 'row_number' (an optional integer), 'column' (an optional str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_log_message('my_function', 'value_x') == 'my_function - failed to meet this value : value_x'\", \"assert format_log_message('my_function', 'value_x', row_number=1) == 'my_function - failed to meet this value : value_x - Row#: 1'\", \"assert format_log... | {
"split": "train",
"index": 72902,
"acecode_id": "bigcode_python_fns_3665",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_least_earners_and_avg_salaries()` that retrieves the names of the workers earning the least within their respective departments from a predefined list of employees, along with the average salary of each department. The function should return a list of tupl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_least_earners_and_avg_salaries() == [('IT', 'Betty', 23000, 24000.0), ('Finance', 'Mary', 28000, 29000.0), ('Marketing', 'Sam', 23000, 24500.0), ('HR', 'Randy', 32000, 33000.0)]\", \"assert get_least_earners_and_avg_salaries() != [('IT', 'John', 25000, 2... | {
"split": "train",
"index": 72903,
"acecode_id": "evol_3612",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dictionary containing package dependencies and their corresponding requirements. The function should extract and return the unique set of all requirements across different dependency categories. You are given a dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_requirements({'dev': ['bumpversion', 'pytest'], 'test': ['pytest', 'coverage'], 'prod': ['requests', 'pytest']}) == {'bumpversion', 'pytest', 'coverage', 'requests'}\", \"assert extract_unique_requirements({'lib': ['numpy', 'scipy'], 'data': [... | {
"split": "train",
"index": 72904,
"acecode_id": "oss_26055",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file paths and a list of hash values. Your task is to create a function that identifies which hash values are present in the file paths and returns a list of those hashes that were found. The function should take in two parameters: a list of strings `fil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_hashes_in_files(['path/to/file1_abc123.bin', 'path/to/file2_def456.bin'], ['abc123', 'ghi789']) == ['abc123']\", \"assert find_hashes_in_files(['file_1.txt', 'file_2.txt'], ['h1', 'h2', 'h3']) == []\", \"assert find_hashes_in_files(['data/hash_abc123.bi... | {
"split": "train",
"index": 72905,
"acecode_id": "bigcode_python_fns_13035",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents the file path of an application, and you need to check if the file has a valid extension. The only valid file extension is '.apk'. Implement a function `is_valid_file_extension(file_path: str) -> bool` that returns `True` if the file has a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_file_extension('app.apk') == True\", \"assert is_valid_file_extension('app.APK') == True\", \"assert is_valid_file_extension('app.exe') == False\", \"assert is_valid_file_extension('my_app.apk') == True\", \"assert is_valid_file_extension('my_app.ap... | {
"split": "train",
"index": 72906,
"acecode_id": "bigcode_python_fns_231",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine whether a user has permission to see employee pages in a web application. The function should take a user object as input and return a boolean value indicating whether the user has the necessary permissions. The user obje... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _see_employee_pages({'is_superuser': True, 'is_staff': False}) == True\", \"assert _see_employee_pages({'is_superuser': False, 'is_staff': True}) == True\", \"assert _see_employee_pages({'is_superuser': False, 'is_staff': False}) == False\", \"assert _see_em... | {
"split": "train",
"index": 72907,
"acecode_id": "oss_30856",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional array (matrix) of integers, write a function that computes the sum of all unique elements present in the matrix. The function should return the computed sum.\nPlease reason step by step, then write a self-contained Python solution. Give your final progra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 45\", \"assert compute_array([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == 1\", \"assert compute_array([[1, 2], [2, 3], [4, 4]]) == 10\", \"assert compute_array([[0, 0], [0, 0]]) == 0\", \"assert compute_array([[5,... | {
"split": "train",
"index": 72908,
"acecode_id": "evol_35676",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `custom_base_arithmetic_operations(n: int, m: int, base: int, operation: str, precision: int) -> str` that performs arithmetic operations on a range of integers from n to m (inclusive) and returns the result in a specified base. The function should support ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_base_arithmetic_operations(1, 5, 10, 'sum', 0) == '15'\", \"assert custom_base_arithmetic_operations(5, 5, 16, 'median', 0) == '5'\", \"assert custom_base_arithmetic_operations(1, 10, 10, 'average', 1) == '5.5'\", \"assert custom_base_arithmetic_opera... | {
"split": "train",
"index": 72909,
"acecode_id": "evol_15931",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a collection of plots for a data visualization library. The function should be able to add new plots and retrieve existing plots based on their names. The function should enforce a unique naming convention for the plots. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_plots([('add', 'plot1'), ('get', 'plot1')]) == ['True', 'plot1']\", \"assert manage_plots([('add', 'plot2'), ('get', 'plot3')]) == ['True', 'None']\", \"assert manage_plots([('add', 'plot1'), ('add', 'plot1')]) == ['True', 'False']\", \"assert manage_... | {
"split": "train",
"index": 72910,
"acecode_id": "oss_36249",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string of text. Your task is to create a function that removes all punctuation marks from the string, splits the string into individual words, and returns them as a list. The words should not contain any whitespace or punctuation. Implement the function `extract... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_words('Machine learning stands as a subfield of artificial intelligence (AI), characterised by granting computing systems the capacity to independently assimilate knowledge and enhance their operational efficiency through experience, without any need... | {
"split": "train",
"index": 72911,
"acecode_id": "evol_16350",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_rectangle_properties(length: int, width: int) -> Tuple[int, int]` that takes the length and width of a rectangle as inputs and returns a tuple containing the area and the perimeter of the rectangle. The area is calculated as length multiplied by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_rectangle_properties(5, 10) == (50, 30)\", \"assert calculate_rectangle_properties(1, 1) == (1, 4)\", \"assert calculate_rectangle_properties(0, 5) == (0, 10)\", \"assert calculate_rectangle_properties(3, 4) == (12, 14)\", \"assert calculate_rectan... | {
"split": "train",
"index": 72912,
"acecode_id": "evol_29909",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that returns the maximum element in the array. The array can contain both positive and negative integers, including zeros. You can assume that the array will always have at least one element.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([1, 10, 5, 33, 4]) == 33\", \"assert find_max([-1, -5, -3, -4]) == -1\", \"assert find_max([0, 0, 0, 0]) == 0\", \"assert find_max([7]) == 7\", \"assert find_max([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == 9\", \"assert find_max([-10, -20, -30, -40]) == -... | {
"split": "train",
"index": 72913,
"acecode_id": "evol_11203",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a given configuration entry is already present in a configuration system. The function should take two arguments: a list of existing configuration entries and a new configuration entry. Each configuration entry is repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_config_entry([{'domain': 'home', 'unique_id': '1.1.1.1'}], {'domain': 'home', 'unique_id': '1.1.1.1'}) == {'type': 'abort', 'reason': 'already_configured'}\", \"assert check_config_entry([{'domain': 'home', 'unique_id': '1.1.1.1'}], {'domain': 'work', ... | {
"split": "train",
"index": 72914,
"acecode_id": "bigcode_python_fns_15909",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a matrix of predicted scores for a series of entities and their corresponding labels indicating which scores should be ignored. Your task is to implement a function that calculates the rank of a specific entity's predicted score, considering only the scores that a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_ranks(0, [[False, True], [False, False]], [[0.9, 0.1], [0.6, 0.7]]) == 1\", \"assert calc_ranks(1, [[True, False], [False, False]], [[0.8, 0.2], [0.5, 0.4]]) == 2\", \"assert calc_ranks(0, [[False, False], [True, False]], [[0.5, 0.9], [0.8, 0.3]]) == 2\... | {
"split": "train",
"index": 72915,
"acecode_id": "bigcode_python_fns_40627",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of weights and a dictionary of prune ratios for certain indices. Implement a function `hard_prune(weights: List[float], prune_ratios: Dict[int, float]) -> List[float]` that prunes the weights at the given indices according to the specified prune ratios. Pru... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hard_prune([5, 15, 25, 35], {1: 1.0}) == [5, 0, 25, 35]\", \"assert hard_prune([7, 14, 21, 28], {3: 0.75}) == [7, 14, 21, 0]\", \"assert hard_prune([0, 0, 0, 0], {0: 0.5}) == [0, 0, 0, 0]\", \"assert hard_prune([10, 20, 30], {}) == [10, 20, 30]\", \"assert h... | {
"split": "train",
"index": 72916,
"acecode_id": "bigcode_python_fns_24771",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates sending promotional messages to users. The function `send_promotional_messages(promo_message: str, user_ids: List[int]) -> List[str]` takes a promotional message and a list of user IDs. Each user ID corresponds to a unique ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_promotional_messages('Buy one get one free!', [1, 2, 3]) == ['Message sent to user 1: Buy one get one free!', 'Message sent to user 2: Buy one get one free!', 'Message sent to user 3: Buy one get one free!']\", \"assert send_promotional_messages('', [1,... | {
"split": "train",
"index": 72917,
"acecode_id": "bigcode_python_fns_4006",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `primes(n)` that returns a list of all prime numbers from 1 to `n`, inclusive. The function should utilize the Sieve of Eratosthenes algorithm for efficient prime number discovery. The input parameter `n` will be a positive integer (1 <= n <= 1000).\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert primes(1) == []\", \"assert primes(2) == [2]\", \"assert primes(3) == [2, 3]\", \"assert primes(4) == [2, 3]\", \"assert primes(5) == [2, 3, 5]\", \"assert primes(10) == [2, 3, 5, 7]\", \"assert primes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert primes(3... | {
"split": "train",
"index": 72918,
"acecode_id": "evol_3326",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `filter_special_chars(text: str) -> str` that takes a string `text` as input and returns a new string with all special characters and emojis removed. The function should preserve the order of the remaining characters and should not consider whitespace chara... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_special_chars('Hello, World!') == 'Hello World'\", \"assert filter_special_chars('Python3.8 is great!') == 'Python38 is great'\", \"assert filter_special_chars('I love programming \\ud83d\\ude0a') == 'I love programming '\", \"assert filter_special_ch... | {
"split": "train",
"index": 72919,
"acecode_id": "evol_24889",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of points represented as tuples of (x, y) coordinates, along with their associated color, marker style, and marker size. Your task is to group the points based on their color, marker style, and marker size, and then sort the grouped points lexicographically... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_and_sort_points([((1, 2), 'red', 'circle', 'small'), ((1, 3), 'red', 'circle', 'small')]) == [[((1, 2), 'red', 'circle', 'small'), ((1, 3), 'red', 'circle', 'small')]]\", \"assert group_and_sort_points([((1, 2), 'red', 'circle', 'small'), ((3, 4), 'red... | {
"split": "train",
"index": 72920,
"acecode_id": "oss_28829",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, return the maximum sum of any non-empty subarray. A subarray is a contiguous part of the array. You must implement a function called `max_subarray_sum(arr: List[int]) -> int` that takes a list of integers `arr` as input and returns an integer represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, -2, 3, 4, -1]) == 7\", \"assert max_subarray_sum([-2, -3, -1]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"asser... | {
"split": "train",
"index": 72921,
"acecode_id": "bigcode_python_fns_16935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `preprocess_data` that simulates a data preprocessing operation. The function takes an input string representing a file path and performs a mock data preprocessing task. If the input string contains the word 'error', the function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert preprocess_data('input_data.csv', []) == 'Preprocessing Successful'\", \"assert preprocess_data('data.txt', []) == 'Preprocessing Successful'\", \"assert preprocess_data('test_data.json', []) == 'Preprocessing Successful'\", \"assert preprocess_data('good_da... | {
"split": "train",
"index": 72922,
"acecode_id": "oss_2219",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of quizzes, where each quiz consists of a title, description, and a list of questions. Each question contains a text and a list of answers. Your function should return a dictionary where the keys are quiz titles and the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_quiz_questions([{'title': 'Math Quiz', 'description': 'A quiz about math.', 'questions': [{'text': 'What is 2 + 2?', 'answers': ['3', '4']}, {'text': 'What is 5 * 6?', 'answers': ['30', '25']}]}, {'title': 'Science Quiz', 'description': 'A quiz about... | {
"split": "train",
"index": 72923,
"acecode_id": "oss_12523",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `numbers` and an integer `target`, implement a function `find_last_position(numbers, target)` that returns the index of the last occurrence of `target` in `numbers`. If `target` does not exist in the list, return -1. The index should be zero-based.\nPle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_last_position([1, 2, 3, 4, 3, 2, 1], 3) == 4\", \"assert find_last_position([1, 2, 3, 4, 5], 5) == 4\", \"assert find_last_position([1, 2, 3, 4, 5], 1) == 0\", \"assert find_last_position([1, 2, 3, 4, 5], 6) == -1\", \"assert find_last_position([5, 5, 5... | {
"split": "train",
"index": 72924,
"acecode_id": "evol_35353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries called 'mappings' where each dictionary represents a mapping of key-value pairs. Write a function 'lwhere' that takes in this list of mappings and a variable number of keyword arguments (**cond). The function should return a list of dictiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lwhere([{'a': 1, 'b': 2}, {'a': 1, 'b': 3}, {'a': 2, 'b': 2}], a=1) == [{'a': 1, 'b': 2}, {'a': 1, 'b': 3}]\", \"assert lwhere([{'x': 10, 'y': 20}, {'x': 10, 'y': 30}, {'x': 20, 'y': 20}], x=10) == [{'x': 10, 'y': 20}, {'x': 10, 'y': 30}]\", \"assert lwhere(... | {
"split": "train",
"index": 72925,
"acecode_id": "bigcode_python_fns_18582",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function called `get_classroom_components` that returns a set of unique classroom components. The components must include the following items: 'Desk', 'Chair', 'Blackboard', and 'Projector'.\nPlease reason step by step, then write a self-contained Python solution. Give... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_classroom_components() == {'Desk', 'Chair', 'Blackboard', 'Projector'}\", \"assert len(get_classroom_components()) == 4\", \"assert 'Desk' in get_classroom_components()\", \"assert 'Chair' in get_classroom_components()\", \"assert 'Blackboard' in get_cla... | {
"split": "train",
"index": 72926,
"acecode_id": "evol_16023",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting metadata information from a code file represented as a string. The metadata information is embedded as comments at the beginning of the string and follows a specific format. The metadata includes the author's name, email, copyright, license, and d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_metadata('__author__ = \\\"John Doe\\\"\\\\n__email__ = \\\"john.doe@example.com\\\"\\\\n__copyright__ = \\\"Copyright 2022 John Doe\\\"\\\\n__license__ = \\\"MIT License, https://opensource.org/licenses/MIT\\\"\\\\n__date__ = \\\"2022/10/15\\\"\\\\n... | {
"split": "train",
"index": 72927,
"acecode_id": "oss_21368",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simplified function that generates a model configuration based on given parameters. Write a function `generate_model_config` that accepts the following parameters: \n\n- `dataset` (str): a string representing the name of the dataset to be used for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_model_config('dataset1', 'label', 30, True) == {'dataset': 'dataset1', 'target': 'label', 'time_limit': 30, 'memory_tuning': True}\", \"assert generate_model_config('dataset2', ['label1', 'label2'], 45, False) == {'dataset': 'dataset2', 'target': ['... | {
"split": "train",
"index": 72928,
"acecode_id": "bigcode_python_fns_48567",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `find_primes(arr)` that returns a list of all prime numbers present in the input list. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. The input list may contain up to ten... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes([3, 6, 9, 12, 13, 17, 21, 23]) == [3, 13, 17, 23]\", \"assert find_primes([1, 4, 6, 8, 10, 12]) == []\", \"assert find_primes([2, 3, 5, 7, 11, 13]) == [2, 3, 5, 7, 11, 13]\", \"assert find_primes([14, 15, 16, 18]) == []\", \"assert find_primes([1... | {
"split": "train",
"index": 72929,
"acecode_id": "evol_4144",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a member of a server is a staff member based on their roles. You will be given a list of role IDs that a member possesses and a staff role ID. Your function should return True if the staff role ID is present in the member's... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_staff([1, 2, 3], 2) == True\", \"assert is_staff([1, 2, 3], 4) == False\", \"assert is_staff([], 1) == False\", \"assert is_staff([5, 6, 7, 8], 5) == True\", \"assert is_staff([0, 1, 2, 3], 3) == True\", \"assert is_staff([10, 20, 30], 10) == True\", \"as... | {
"split": "train",
"index": 72930,
"acecode_id": "oss_16490",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the performance score of a swarm based on a given 2D grid of numerical data. Each cell in the grid represents a measurement associated with a specific feature of the swarm. Your task is to implement a function `calculate_performance_score(grid: L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_performance_score([[5]]) == 0.0\", \"assert calculate_performance_score([[1, 1], [1, 1]]) == 0.0\", \"assert calculate_performance_score([[0, 0], [0, 0]]) == 0.0\", \"assert calculate_performance_score([[0, 1], [1, 0]]) == 0.0\", \"assert calculate... | {
"split": "train",
"index": 72931,
"acecode_id": "bigcode_python_fns_44508",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `dec_to_bin(num)` that converts a user-provided decimal integer (ranging from 1 to 1000) into its binary representation. The function should also return the binary representation in reverse order and provide the 8-bit binary format (with leading zeros where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dec_to_bin(1) == ('1', '00000001', '1')\", \"assert dec_to_bin(2) == ('10', '00000010', '01')\", \"assert dec_to_bin(3) == ('11', '00000011', '11')\", \"assert dec_to_bin(4) == ('100', '00000100', '001')\", \"assert dec_to_bin(5) == ('101', '00000101', '101'... | {
"split": "train",
"index": 72932,
"acecode_id": "evol_33890",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `prod_signs(arr)` that takes an array of non-zero integers and returns the cumulative sum of the absolute values of unique integers, each multiplied by the product of their respective signs (1 for positive, -1 for negative). If the array is empty or contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prod_signs([0, 1]) == None\", \"assert prod_signs([]) == None\", \"assert prod_signs([-1, -2, -3]) == -6\", \"assert prod_signs([2, 3, 4]) == 9\", \"assert prod_signs([1, 1, 1]) == 1\", \"assert prod_signs([-1, -1, -1]) == -1\", \"assert prod_signs([-1, 0, 1... | {
"split": "train",
"index": 72933,
"acecode_id": "evol_6560",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `nums` and an integer `k`, write a function that returns the number of continuous subarrays that are considered 'nice'. A subarray is 'nice' if it contains exactly `k` odd numbers, the sum of the elements in the subarray is divisible by `k`, and its l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert number_of_nice_subarrays([2,4,6], 1) == 0\", \"assert number_of_nice_subarrays([3,3,3,3], 1) == 4\", \"assert number_of_nice_subarrays([2,2,2,2], 1) == 0\", \"assert number_of_nice_subarrays([1,2,3,4,5,6,7,8,9,10], 5) == 2\", \"assert number_of_nice_subarray... | {
"split": "train",
"index": 72934,
"acecode_id": "evol_23838",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a logging system for a bot application. Your job is to implement a function `log_cog_load(cog_name: str) -> str` that takes in the name of a cog (a modular component of the bot) as a string and returns a log message indicating that the cog has been ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_cog_load('Sync') == 'Cog loaded: Sync'\", \"assert log_cog_load('Admin') == 'Cog loaded: Admin'\", \"assert log_cog_load('User') == 'Cog loaded: User'\", \"assert log_cog_load('Music') == 'Cog loaded: Music'\", \"assert log_cog_load('Games') == 'Cog load... | {
"split": "train",
"index": 72935,
"acecode_id": "bigcode_python_fns_21222",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers and a threshold value, implement a function called `remove_duplicates` that filters out integers from the list based on their frequency and primality. If an integer appears at least as many times as the threshold, it should be included in the output list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates(['apple', 'banana', 'apple', 6, 6], 2) == ['apple', 'banana', 6]\", \"assert remove_duplicates([10, 10, 10, 'test', 11], 3) == [10, 'test']\", \"assert remove_duplicates([1, 'x', 'y', 1, 1], 2) == [1, 'x', 'y']\", \"assert remove_duplicates... | {
"split": "train",
"index": 72936,
"acecode_id": "evol_7387",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates an order processing system. Your task is to implement a function `process_order` that takes an `order` (a string) and returns the string 'No Order' if the order is empty or simply returns the order string if it contains any characters. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_order('') == 'No Order'\", \"assert process_order(' ') == 'No Order'\", \"assert process_order('Pizza') == 'Pizza'\", \"assert process_order('Burger') == 'Burger'\", \"assert process_order(' Sushi ') == ' Sushi '\", \"assert process_order(... | {
"split": "train",
"index": 72937,
"acecode_id": "bigcode_python_fns_35798",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of speech intervals, each defined by a start time and an end time in seconds. Your task is to implement a function that processes each interval and generates metadata for saving these intervals as WAV files. The metadata should include the following fields:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_metadata([(0.0, 1.5), (2.0, 3.0)], 'video1') == [{'filename': 'video1_0_1500.wav', 'video_id': 'video1', 'start_time': 0, 'end_time': 1500, 'duration': 1500}, {'filename': 'video1_2000_3000.wav', 'video_id': 'video1', 'start_time': 2000, 'end_time':... | {
"split": "train",
"index": 72938,
"acecode_id": "bigcode_python_fns_45959",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer 'number', implement a function 'cube' that returns the cube of the given number. The cube of a number is defined as the number multiplied by itself three times (number * number * number).\nPlease reason step by step, then write a self-contained Python solution.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cube(0) == 0\", \"assert cube(1) == 1\", \"assert cube(-1) == -1\", \"assert cube(2) == 8\", \"assert cube(-2) == -8\", \"assert cube(3) == 27\", \"assert cube(-3) == -27\", \"assert cube(4) == 64\", \"assert cube(-4) == -64\", \"assert cube(5) == 125\", \"a... | {
"split": "train",
"index": 72939,
"acecode_id": "evol_31201",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_questionnaire(mcc: str, mnc: str, download: bool, upgrade: bool, export: bool, blitz: bool)`. This function takes in the following parameters: a string `mcc` representing the Mobile Country Code, a string `mnc` representing the Mo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_questionnaire('310', '260', True, False, False, True) == {'mcc': '310', 'mnc': '260', 'device': 'unknown', 'download': True, 'upgrade': False, 'export': False, 'blitz': True}\", \"assert create_questionnaire('310', '260', False, True, True, False) == ... | {
"split": "train",
"index": 72940,
"acecode_id": "bigcode_python_fns_14110",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to serialize and deserialize geographical map data. The map data includes its dimensions, a range, and the actual data itself. Write a function `manage_map_data` that takes the following parameters: `action` (a string which can be either ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_map_data('serialize', 'test_map.bin', (100, 100), (0, 100), [[0]*100 for _ in range(100)]) is None\", \"assert manage_map_data('deserialize', 'test_map.bin', None, None, None) == ((100, 100), (0, 100), [[0]*100 for _ in range(100)])\", \"assert manage... | {
"split": "train",
"index": 72941,
"acecode_id": "oss_14433",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that selects an optimizer based on its type and given parameters. The function should take the following inputs: a string `optim_type` which can be one of 'adamw', 'adam', or 'sgd'; a float `lr` representing the learning rate; a float `we... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_optimizer('sgd', 0.01, 0.1, momentum=0.9) == 'sgd optimizer with lr=0.01, weight_decay=0.1, momentum=0.9'\", \"assert select_optimizer('sgd', 0.01, 0.1, momentum=0.8) == 'sgd optimizer with lr=0.01, weight_decay=0.1, momentum=0.8'\", \"assert select_o... | {
"split": "train",
"index": 72942,
"acecode_id": "bigcode_python_fns_26507",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two strings representing large non-negative integers, each up to 100 digits long, and returns their summation as a string. The function should handle the addition without using any inbuilt functions or libraries for big integers. If either input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_big_numbers('123', '456') == '579'\", \"assert add_big_numbers('99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999', '1') == '10000000000000000000000000000000000000000000000000000000000000000000000000... | {
"split": "train",
"index": 72943,
"acecode_id": "evol_15021",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an even-length integer array `arr`, determine if it is possible to rearrange the array such that for every index `i` (where `0 <= i < len(arr) / 2`), the condition `arr[2 * i + 1] = 2 * arr[2 * i]` holds true. If such an arrangement is possible, return the number of diffe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numPairs([3,1,3,6]) == -1\", \"assert numPairs([2,1,2,6]) == -1\", \"assert numPairs([1,2,4,16,8,4]) == -1\", \"assert numPairs([0,0,0,0]) == 1\", \"assert numPairs([1,2,3,4,5,10]) == -1\", \"assert numPairs([1,1,2,2]) == 2\"]}"
} | {
"split": "train",
"index": 72944,
"acecode_id": "evol_32613",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of chat messages in the format of tuples, where each tuple contains a timestamp (string in 'YYYY-MM-DD HH:MM:SS' format), a username (string), and a message (string). Your function should return a tuple containing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_chat_messages([('2023-10-01 12:00:00', 'Alice', 'Hello!'), ('2023-10-01 12:05:00', 'Bob', 'Hi there!'), ('2023-10-01 12:10:00', 'Alice', 'How are you?')]) == (3, {'Alice': 2, 'Bob': 1}, 'Alice', 12)\", \"assert analyze_chat_messages([('2023-10-01 13:... | {
"split": "train",
"index": 72945,
"acecode_id": "oss_5029",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string consisting of parentheses, and your task is to determine if the input string is valid. A string of parentheses is considered valid if every opening parenthesis has a corresponding closing parenthesis and they are properly nested. Implement a function name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_parentheses('()') == True\", \"assert is_valid_parentheses(')()') == False\", \"assert is_valid_parentheses('(()())') == True\", \"assert is_valid_parentheses('(()') == False\", \"assert is_valid_parentheses('()()') == True\", \"assert is_valid_pare... | {
"split": "train",
"index": 72946,
"acecode_id": "oss_27859",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python to search for a given word in a multiline string document. The function should return the line number (1-based index) of the first occurrence of the word in the document. If the word is not found, return -1. The document is represented as a string whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_search('Hello world\\\\nThis is the first line\\\\nThis is the second line', 'first') == 2\", \"assert word_search('Line one\\\\nLine two\\\\nLine three', 'two') == 2\", \"assert word_search('One\\\\nTwo\\\\nThree\\\\nFour', 'Five') == -1\", \"assert wo... | {
"split": "train",
"index": 72947,
"acecode_id": "evol_14519",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to analyze the scores of individuals in a data science team. The program will take a list of dictionaries as input, where each dictionary contains information about a team member's name, role, and their scores in two categories. Your task ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_team_data([{'Name': 'Grace', 'Role': 'domain expert', 'Score1': 100, 'Score2': 100}, {'Name': 'Heidi', 'Role': 'automl researcher', 'Score1': 90, 'Score2': 95}]) == [('Grace', 'domain expert', 500.0), ('Heidi', 'automl researcher', 462.5)]\", \"asser... | {
"split": "train",
"index": 72948,
"acecode_id": "oss_11672",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function `count_words` that counts the occurrences of each word in the list, returning a dictionary where the keys are the words and the values are the respective counts. Words are defined as sequences of alphabetic characters, and should be cas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words(['hello', 'world', 'hello']) == {'hello': 2, 'world': 1}\", \"assert count_words(['Hello', 'hello', 'HELLO']) == {'hello': 3}\", \"assert count_words(['word1', 'word2', 'word3']) == {'word': 3}\", \"assert count_words(['']) == {}\", \"assert coun... | {
"split": "train",
"index": 72949,
"acecode_id": "bigcode_python_fns_26337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function called `process_string` that extracts specific information from a given string based on a set of predefined patterns. The function should take a single parameter, `input_string`, which is a string containing information about a med... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string('v1.0 Episode 1-Action-3') == {'version': '1.0', 'episode_format': None, 'episodes': [{'episode': '1', 'words': 'Action', 'count': '3'}]}\", \"assert process_string('Episode 2-Drama-5 v2.1') == {'version': '2.1', 'episode_format': None, 'episo... | {
"split": "train",
"index": 72950,
"acecode_id": "oss_36550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `send_notification(message_id: str) -> str` that takes a message ID as an argument and returns a string notification indicating that a new message has been received. The notification string should be of the format: 'A new message with ID {message_id} was pu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_notification('1234') == 'A new message with ID 1234 was published.'\", \"assert send_notification('5678') == 'A new message with ID 5678 was published.'\", \"assert send_notification('abcd') == 'A new message with ID abcd was published.'\", \"assert sen... | {
"split": "train",
"index": 72951,
"acecode_id": "evol_13446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing various infrastructure elements for a transportation network. Each infrastructure element is represented as a tuple containing the following information: (type, id, length, width, height). The 'type' is a string representing the type of infrastruct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_dimensions([('guard rail', 1, 100, 50, 25)]) == {'guard rail': (100.0, 50.0, 25.0)}\", \"assert average_dimensions([('bridge', 1, 200, 100, 50), ('bridge', 2, 300, 150, 75)]) == {'bridge': (250.0, 125.0, 62.5)}\", \"assert average_dimensions([('tunne... | {
"split": "train",
"index": 72952,
"acecode_id": "oss_24482",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a date in the format 'YYYY-MM-DD', write a function that returns the start and end dates of the quarter that the given date falls into. The quarters are defined as follows: Q1 (January 1 - March 31), Q2 (April 1 - June 30), Q3 (July 1 - September 30), and Q4 (October 1 - ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quarter('2023-01-15') == ('2023-01-01', '2023-03-31')\", \"assert quarter('2023-04-10') == ('2023-04-01', '2023-06-30')\", \"assert quarter('2023-07-25') == ('2023-07-01', '2023-09-30')\", \"assert quarter('2023-10-05') == ('2023-10-01', '2023-12-31')\", \"a... | {
"split": "train",
"index": 72953,
"acecode_id": "bigcode_python_fns_233",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to manage fiber smoothness measurements. You need to implement a function that takes a list of smoothness values (floats) and returns the average smoothness value of the fibers. The input list will contain at least one value and can contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_smoothness([2.5, 3.0, 4.0, 5.5]) == 3.75\", \"assert calculate_average_smoothness([-1.0, 0.0, 1.0]) == 0.0\", \"assert calculate_average_smoothness([1.5]) == 1.5\", \"assert calculate_average_smoothness([0.0, 0.0, 0.0, 0.0]) == 0.0\", \"ass... | {
"split": "train",
"index": 72954,
"acecode_id": "oss_26527",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a Python dictionary representing data from different workflows. Each workflow contains a 'data' key with a nested dictionary of timestamps and corresponding values, a 'tool' key with the name of the tool used, and a 'total avg' key with the average value for the w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert workflow_info({'wf2': {'data': {}, 'tool': 'another_tool', 'total avg': 0}}) == {'wf2': {'total_timestamps': 0, 'average_value': 0, 'tool_used': 'another_tool'}}\", \"assert workflow_info({'wf3': {'data': {'2021-03-17T20:05:17Z': 100.0, '2022-03-17T20:05:17Z... | {
"split": "train",
"index": 72955,
"acecode_id": "oss_9256",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a string representation of a tuple into an actual tuple of integers. The input string is guaranteed to be in the format '(x1, x2, ..., xn)' where x1, x2, ..., xn are integers. Your function should return the corresponding tuple of integers.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_tuple('(1, 2, 3)') == (1, 2, 3)\", \"assert string_to_tuple('(-1, -2, -3)') == (-1, -2, -3)\", \"assert string_to_tuple('(0)') == (0,)\", \"assert string_to_tuple('(10, 20, 30, 40)') == (10, 20, 30, 40)\", \"assert string_to_tuple('(5)') == (5,)\",... | {
"split": "train",
"index": 72956,
"acecode_id": "evol_35862",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of calendars and a request for events. Your function should return a list of events that are present in the calendars and match the request criteria. Each calendar is represented as a list of events, where each e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_checked([[('Meeting', 900), ('Lunch', 1200)], [('Conference', 1000), ('Meeting', 1400)]], ('Meeting', (800, 1300))) == [('Meeting', 900)]\", \"assert list_checked([[('Event1', 500), ('Event2', 600)], [('Event1', 700), ('Event2', 800)]], ('Event1', (400,... | {
"split": "train",
"index": 72957,
"acecode_id": "oss_18698",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `sentence` and a string `MASK`. Write a function that returns the index of the first occurrence of `MASK` in `sentence`. If `MASK` is not found in `sentence`, return -1. The search should be case-sensitive. For example, if `sentence` is 'Hello MASK world'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert index_of_masked_word('Hello MASK world', 'MASK') == 6\", \"assert index_of_masked_word('This is a test', 'test') == 10\", \"assert index_of_masked_word('No mask here', 'MASK') == -1\", \"assert index_of_masked_word('Caps lock should be on', 'on') == 20\", \"... | {
"split": "train",
"index": 72958,
"acecode_id": "bigcode_python_fns_34592",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Design a function in Python that takes an array of triple key tuples and creates a third layer nested dictionary from them. Each tuple consists of three string elements: the first element is the main key, the second is a subkey, and the third is a sub-subkey. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_nested_dict([('key1', 'subkey1', 'subsubkey1')]) == {'key1': {'subkey1': {'subsubkey1': None}}}\", \"assert create_nested_dict([('key1', 'subkey1', 'subsubkey1'), ('key1', 'subkey2', 'subsubkey2')]) == {'key1': {'subkey1': {'subsubkey1': None}, 'subke... | {
"split": "train",
"index": 72959,
"acecode_id": "evol_15945",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages student data. The function, named `get_student_data`, should take three parameters: `name` (a string representing the student's name), `age` (an integer representing the student's age), and `grade` (a string representing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_student_data('Alice', 20, 'A') == 'Name: Alice\\\\nAge: 20\\\\nGrade: A'\", \"assert get_student_data('Bob', 22, 'B+') == 'Name: Bob\\\\nAge: 22\\\\nGrade: B+'\", \"assert get_student_data('Charlie', 19, 'C') == 'Name: Charlie\\\\nAge: 19\\\\nGrade: C'\"... | {
"split": "train",
"index": 72960,
"acecode_id": "oss_13811",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simplified version of a mail delivery system. The function should accept a list of mail items and process them according to specific rules. Each mail item is represented as a dictionary with the following keys: 're... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_mail_items([{ 'recipient': 'Alice', 'weight': 0.5, 'postage_paid': False }]) == [{'recipient': 'Alice', 'weight': 0.5, 'postage_paid': True}]\", \"assert process_mail_items([{ 'recipient': 'Bob', 'weight': 1.5, 'postage_paid': False }]) == [{'recipie... | {
"split": "train",
"index": 72961,
"acecode_id": "oss_13830",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves information based on a given `eon_id`. The function should process the `eon_id` and return a string that indicates the status of the eon resource. If the `eon_id` is valid (an integer greater than 0), return the message 'Eo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_eon_status(1) == 'Eon resource is available for ID: 1'\", \"assert get_eon_status(5) == 'Eon resource is available for ID: 5'\", \"assert get_eon_status(10) == 'Eon resource is available for ID: 10'\", \"assert get_eon_status(0) == 'Invalid eon ID provid... | {
"split": "train",
"index": 72962,
"acecode_id": "oss_18928",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function that takes a list of strings, where each string represents a post's body text. Your function should calculate the word count for each post, considering words as sequences of non-space characters, which could also include punctuation. Aft... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_count_and_sort(['Hello, world!', 'This is a test.']) == [('This is a test.', 4), ('Hello, world!', 2)]\", \"assert word_count_and_sort(['SingleWord']) == [('SingleWord', 1)]\", \"assert word_count_and_sort([]) == []\", \"assert word_count_and_sort(['A q... | {
"split": "train",
"index": 72963,
"acecode_id": "evol_35598",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `validate_cidr(cidr: str) -> bool` that checks if a given string is a valid CIDR notation. A valid CIDR notation consists of an IP address (IPv4 or IPv6) followed by a slash and a prefix length. The function should return True if the input is a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_cidr('192.168.1.1/24') == True\", \"assert validate_cidr('10.0.0.1/8') == True\", \"assert validate_cidr('172.16.0.0/12') == True\", \"assert validate_cidr('0.0.0.0/0') == True\", \"assert validate_cidr('255.255.255.255/32') == True\", \"assert vali... | {
"split": "train",
"index": 72964,
"acecode_id": "bigcode_python_fns_19860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simplified version of the classic game Battleship. In this version, you will be given a 5x5 grid representing the ocean, where each cell can either contain a ship or be empty. The player will input coordinates to target a cell, and the program w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert battleship_game('E', {'A1': 3, 'B2': 2}, 2, ['Hit!', 'Miss!', 'Hit again!', 'Sunk!']) == ({'A1': 3, 'B2': 2}, 2)\", \"assert battleship_game('A1', {'A1': 3, 'B2': 2}, 2, ['Hit!', 'Miss!', 'Hit again!', 'Sunk!']) == ({'A1': 2, 'B2': 2}, 2)\", \"assert battles... | {
"split": "train",
"index": 72965,
"acecode_id": "oss_12859",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that authenticates a user based on their email and password. The function should accept two parameters: an email string and a password string. The email should be validated to ensure it is in a proper format and does not exceed 30 charact... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user('user1@example.com', 'password123') == 'success'\", \"assert authenticate_user('user2@example.com', 'mypassword') == 'Account disabled'\", \"assert authenticate_user('user3@example.com', 'wrongpassword') == 'Invalid username or password'\",... | {
"split": "train",
"index": 72966,
"acecode_id": "bigcode_python_fns_24427",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s that can represent a boolean value, convert it to its corresponding boolean type. The string can be one of the following: 'true', 'false', 'yes', 'no'. Your task is to implement a function that takes this string as input and returns the associated boolean value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert strToBool('true') == True\", \"assert strToBool('false') == False\", \"assert strToBool('yes') == True\", \"assert strToBool('no') == False\", \"assert strToBool('True') == None\", \"assert strToBool('FALSE') == None\", \"assert strToBool('Yes') == None\", \... | {
"split": "train",
"index": 72967,
"acecode_id": "bigcode_python_fns_25395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple network configuration loader. The function `load_and_generate(configID: int) -> str` takes an integer `configID` as input. It then simulates loading a network configuration based on the `configID`, and returns ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_and_generate(389) == 'Configuration for ID: 389 has been successfully loaded and processed.'\", \"assert load_and_generate(0) == 'Configuration for ID: 0 has been successfully loaded and processed.'\", \"assert load_and_generate(1001) == 'Configuration ... | {
"split": "train",
"index": 72968,
"acecode_id": "oss_29497",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines whether a given string is a valid JSON document. A JSON document is valid if it can be parsed into a JSON object or array. Your function should return True if the input string is a valid JSON document, and False otherwise.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_json('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30, \\\"city\\\": \\\"New York\\\"}') == True\", \"assert is_valid_json('{name: John, age: 30, city: New York}') == False\", \"assert is_valid_json('[1, 2, 3, 4, 5]') == True\", \"assert is_valid_json(... | {
"split": "train",
"index": 72969,
"acecode_id": "bigcode_python_fns_5747",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of currency values and their corresponding exchange rates against a base currency (e.g., USD). Your function should return a new list of values converted to the base currency using the provided exchange rates. The input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_base_currency([(100, 1.2), (200, 0.5)]) == [120.0, 100.0]\", \"assert convert_to_base_currency([(50, 2.0), (75, 0.8)]) == [100.0, 60.0]\", \"assert convert_to_base_currency([(0, 1.0), (100, 0.0)]) == [0.0, 0.0]\", \"assert convert_to_base_currency... | {
"split": "train",
"index": 72970,
"acecode_id": "oss_829",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python `setup.py` file for a package named 'ddls3utils'. The `setup.py` file should include the following specifications: the package name should be 'ddls3utils', the version should be '0.0.6', the description should be 'S3 utils', the author shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_setup_metadata() == {'name': 'ddls3utils', 'version': '0.0.6', 'description': 'S3 utils', 'author': 'nedlitex', 'author_email': 'your_email@example.com', 'url': 'https://github.com/Nedlitex/s3utils', 'keywords': ['s3'], 'license': 'MIT', 'install_requ... | {
"split": "train",
"index": 72971,
"acecode_id": "oss_37070",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `cuboid_properties(length: int, width: int, height: int) -> Tuple[int, int]` that takes the dimensions of a cuboid (length, width, height) as arguments and returns a tuple containing the volume and the surface area of the cuboid. The volume is calculated as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cuboid_properties(1, 1, 1) == (1, 6)\", \"assert cuboid_properties(5, 5, 5) == (125, 150)\", \"assert cuboid_properties(0, 1, 1) == (0, 2)\", \"assert cuboid_properties(10, 20, 30) == (6000, 2200)\", \"assert cuboid_properties(3, 4, 5) == (60, 94)\", \"asser... | {
"split": "train",
"index": 72972,
"acecode_id": "evol_17897",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves JSON data from a specified resource URL using a mock API request. The function should accept two parameters: `resource_path`, a string representing the path to the resource, and `api_key`, a string representing the API ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_json_data('/path/to/resource', 'api_key') == {'status': 'success', 'data': 'public'}\", \"assert get_json_data('/another/path', 'api_key') == {'status': 'success', 'data': 'private'}\", \"assert get_json_data('/error/path', 'api_key') == {'status': 'erro... | {
"split": "train",
"index": 72973,
"acecode_id": "oss_37569",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `reverse_linked_list(head)` that takes the head of a singly linked list as input and returns the head of the reversed linked list. The linked list is defined by nodes containing integer values. You cannot use any built-in functions to reverse the linked lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_linked_list(Node(10)).data == 10\", \"assert reverse_linked_list(Node(10, Node(20))).data == 20\", \"assert reverse_linked_list(Node(10, Node(20, Node(30)))).data == 30\", \"assert reverse_linked_list(Node(1, Node(2, Node(3, Node(4))))).data == 4\", ... | {
"split": "train",
"index": 72974,
"acecode_id": "evol_11908",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named 'point_position' that determines the position of a given point (a, b) relative to a circle defined by its center coordinates (x, y) and its radius. The function should return one of the following strings: 'The point is inside the circle.', 'The point ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert point_position(0, 0, 0, 0) == 'The point is on the edge of the circle.'\", \"assert point_position(0, 0, 2, 0) == 'The point is outside of the circle.'\", \"assert point_position(1, 1, 0, 0) == 'The point is outside of the circle.'\", \"assert point_position... | {
"split": "train",
"index": 72975,
"acecode_id": "evol_22296",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that takes a deeply nested list as input and decompresses it into a single-level sequence. Your function should be able to handle lists that are nested arbitrarily deep. For example, given the input [[1,2], [3,[4,[5,6]]]], the output should be [1, 2, 3... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flat_list([[1,2], [3,[4,[5,6]]]]) == [1, 2, 3, 4, 5, 6]\", \"assert flat_list([1, [2, 3], [4, [5]]]) == [1, 2, 3, 4, 5]\", \"assert flat_list([[[1]], 2, [3, [[4]]]]) == [1, 2, 3, 4]\", \"assert flat_list([]) == []\", \"assert flat_list([[[[[[[1]]]]]]]) == [1... | {
"split": "train",
"index": 72976,
"acecode_id": "evol_30863",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a login request for a user through a simulated WeChat authentication system. The function will take a single input, 'code', which represents the authorization code received from the WeChat app. The function should return a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login_wechat('valid_code_1') == {'access_token': 'mock_access_token', 'refresh_token': 'mock_refresh_token'}\", \"assert login_wechat('valid_code_2') == {'access_token': 'mock_access_token', 'refresh_token': 'mock_refresh_token'}\", \"assert login_wechat('va... | {
"split": "train",
"index": 72977,
"acecode_id": "bigcode_python_fns_45860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `next_palindrome(n: int) -> int` that takes an integer N and returns the smallest palindrome greater than N. A palindrome is a number that reads the same backward as forward. For example, the next palindrome after 187 is 191.\nPlease reason step by step, then w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_palindrome(187) == 191\", \"assert next_palindrome(0) == 1\", \"assert next_palindrome(9) == 11\", \"assert next_palindrome(10) == 11\", \"assert next_palindrome(99) == 101\", \"assert next_palindrome(100) == 101\", \"assert next_palindrome(121) == 131\... | {
"split": "train",
"index": 72978,
"acecode_id": "evol_619",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that replaces every instance of spaces, commas, or periods in a given string with a colon character. The function should accept a single string argument and return the modified string.\nPlease reason step by step, then write a self-contained Python solution... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_with_colon('This is a test.') == 'This:is:a:test:'\", \"assert replace_with_colon('No punctuation here') == 'No:punctuation:here'\", \"assert replace_with_colon('A,B,C,D') == 'A:B:C:D'\", \"assert replace_with_colon('Spaces here') == 'Spaces:::here... | {
"split": "train",
"index": 72979,
"acecode_id": "evol_13334",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes query parameters for an API endpoint and returns a modified dictionary with specific transformations applied. The function should take a dictionary of query parameters as input and return a new dictionary with the fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_query_params({'include': 'true', 'cascading': 'true'}) == {'include': True, 'cascading': True}\", \"assert process_query_params({'include': 'TRUE', 'cascading': 'FALSE'}) == {'include': True, 'cascading': False}\", \"assert process_query_params({'inc... | {
"split": "train",
"index": 72980,
"acecode_id": "oss_1791",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `probability_at_least_two_heads(num_trials: int) -> float` that simulates flipping three coins `num_trials` times and returns the probability of getting at least two heads in a single trial. A coin flip results in either heads (1) or tails (0).\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert probability_at_least_two_heads(10) >= 0.0 and probability_at_least_two_heads(10) <= 1.0\", \"assert probability_at_least_two_heads(100) >= 0.0 and probability_at_least_two_heads(100) <= 1.0\", \"assert probability_at_least_two_heads(1000) >= 0.0 and probabil... | {
"split": "train",
"index": 72981,
"acecode_id": "evol_15786",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of directed edges representing a graph, where each edge is a tuple containing a source node, a destination node, and a weight. Your task is to implement a function that converts this directed graph into an adjacency matrix. The adjacency matrix should repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjacency_matrix([]) == ([], [])\", \"assert adjacency_matrix([('A', 'B', 1)]) == (['A', 'B'], [[0, 1], [float('Inf'), 0]])\", \"assert adjacency_matrix([('A', 'B', 2), ('B', 'C', 3)]) == (['A', 'B', 'C'], [[0, 2, float('Inf')], [float('Inf'), 0, 3], [float(... | {
"split": "train",
"index": 72982,
"acecode_id": "bigcode_python_fns_2633",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words and a mapping of some words to their corresponding lemmas (base forms). Your task is to implement a function that takes a list of words and a dictionary as input, and returns a new list where each word is replaced by its lemma according to the mapp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_lemmas(['foo', 'hello'], {'foo': 'bar', 'hello': 'world'}) == ['bar', 'world']\", \"assert get_lemmas(['foo', 'baz'], {'foo': 'bar', 'hello': 'world'}) == ['bar', 'baz']\", \"assert get_lemmas(['hello', 'world'], {'foo': 'bar', 'hello': 'hi'}) == ['hi', ... | {
"split": "train",
"index": 72983,
"acecode_id": "bigcode_python_fns_20389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a directory path. The function should accept a directory path as an argument. If the directory path is not provided (i.e., it is None), the function should default to using the directory path '/usr/local'. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_install_directory(None) == '/usr/local'\", \"assert get_install_directory('/home/user') == '/home/user'\", \"assert get_install_directory('/opt/software') == '/opt/software'\", \"assert get_install_directory('/usr/bin') == '/usr/bin'\", \"assert get_inst... | {
"split": "train",
"index": 72984,
"acecode_id": "oss_3027",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and returns the smallest even number from the list. If there are no even numbers, return 'No even number found'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smallest_even([1, 3, 5, 7]) == 'No even number found'\", \"assert smallest_even([2, 4, 6, 8]) == 2\", \"assert smallest_even([45, 22, 11, 90, 33]) == 22\", \"assert smallest_even([15, 21, 33]) == 'No even number found'\", \"assert smallest_even([10, 20, 30, ... | {
"split": "train",
"index": 72985,
"acecode_id": "evol_21665",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Dice's Coefficient for two given sentences. The Dice's Coefficient is a statistic used to gauge the similarity between two sets, defined as the size of the intersection divided by the average size of the two sets. Your function should ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(dice_coefficient('hello world', 'hello there') - 0.5) < 1e-9\", \"assert abs(dice_coefficient('data science', 'data analysis') - 0.5) < 1e-9\", \"assert abs(dice_coefficient('hello', 'world') - 0.0) < 1e-9\", \"assert abs(dice_coefficient('test case', 'c... | {
"split": "train",
"index": 72986,
"acecode_id": "evol_35824",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string containing a mix of uppercase letters, lowercase letters, and special characters, rearrange the string so that the first part contains only uppercase letters, the second part contains only lowercase letters, and the last part contains only special characters. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_string('abc!@#XYZDEF') == 'XYZDEFabc!@#'\", \"assert rearrange_string('!@#abcXYZ') == 'XYZabc!@#'\", \"assert rearrange_string('AAAA!@!@aaaaaaa') == 'AAAAaaaaaaa!@!@'\", \"assert rearrange_string('aaAA!@#') == 'AAaa!@#'\", \"assert rearrange_string... | {
"split": "train",
"index": 72987,
"acecode_id": "evol_32039",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings `components`, implement a function that creates a nested dictionary structure from the components. The first element of the list should become the key of the outer dictionary, and the subsequent elements in the list should create nested dictionaries, wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert put_path(['a', 'b', 'c'], 5) == {'a': {'b': {'c': 5}}}\", \"assert put_path(['x', 'y'], 10) == {'x': {'y': 10}}\", \"assert put_path(['level1', 'level2', 'level3', 'level4'], 0) == {'level1': {'level2': {'level3': {'level4': 0}}}}\", \"assert put_path(['key1... | {
"split": "train",
"index": 72988,
"acecode_id": "bigcode_python_fns_23325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a stack data structure in Python. A stack is a Last-In-First-Out (LIFO) data structure where elements are added and removed from the same end, known as the top. Your task is to implement a function `stack_operations(operations: List[Tuple[str, i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stack_operations([('push', 1), ('push', 2), ('pop', -1), ('push', 3)], 3) == [2]\", \"assert stack_operations([('push', 1), ('pop', -1), ('pop', -1)], 2) == [1, None]\", \"assert stack_operations([('push', 1), ('push', 2), ('push', 3), ('push', 4)], 3) == []... | {
"split": "train",
"index": 72989,
"acecode_id": "oss_31470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a string and a list as input parameters and returns a tuple containing the string followed by the elements of the list in the same order. The returned tuple should have the string as the first element, followed by each element of the list as i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_tuple('hello', [1, 2, 3]) == ('hello', 1, 2, 3)\", \"assert construct_tuple('test', ['a', 'b', 'c']) == ('test', 'a', 'b', 'c')\", \"assert construct_tuple('', [5, 10]) == ('', 5, 10)\", \"assert construct_tuple('data', [True, False]) == ('data', T... | {
"split": "train",
"index": 72990,
"acecode_id": "evol_2275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with formatting a list of employee salaries represented as strings. Each salary is formatted as a string with a dollar sign and commas, for example: '$1,200.56' or '$3,405.00'. Your goal is to create a function `format_salaries(salaries: List[str]) -> List[int]` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_salaries(['$1,200.56', '$2,500.00', '$3,405.00']) == [1201, 2500, 3405]\", \"assert format_salaries(['$0.99', '$1,000.00', '$3.50']) == [1, 1000, 4]\", \"assert format_salaries(['$10.00', '$20', '$30.00']) == [10, 20, 30]\", \"assert format_salaries([... | {
"split": "train",
"index": 72991,
"acecode_id": "oss_10770",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that updates a given workflow dictionary by extracting specified parameters from a provided list of strings. The function `extract_parameters` takes in three arguments: `wf`, a dictionary representing the workflow; `params_to_c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_parameters({'key1': 'value1'}, ['param1'], 'param1=value1\\\\nparam2=value2') == {'key1': 'value1', 'param1': 'value1'}\", \"assert extract_parameters({'key1': 'value1'}, ['param1', 'param2'], 'param1=value1\\\\nparam2=value2') == {'key1': 'value1', ... | {
"split": "train",
"index": 72992,
"acecode_id": "oss_5410",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a dictionary representation of an employee request. The function should take two parameters: a unique request ID (a string) and an employee ID (a string). The output should be a dictionary containing two keys: 'reqID' f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_request_dict('R001', 'E001') == {'reqID': 'R001', 'empID': 'E001'}\", \"assert generate_request_dict('R002', 'E002') == {'reqID': 'R002', 'empID': 'E002'}\", \"assert generate_request_dict('R003', 'E003') == {'reqID': 'R003', 'empID': 'E003'}\", \"a... | {
"split": "train",
"index": 72993,
"acecode_id": "oss_16549",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `is_valid_email` that takes a single string argument, `email`, and returns `True` if the email is in a valid format, and `False` otherwise. A valid email address follows the format: one or more characters (letters, digits, dots, underscores, percent ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_email('test@example.com') == True\", \"assert is_valid_email('user.name+tag+sorting@example.com') == True\", \"assert is_valid_email('user@subdomain.example.com') == True\", \"assert is_valid_email('user.name@example.co.uk') == True\", \"assert is_v... | {
"split": "train",
"index": 72994,
"acecode_id": "evol_15155",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a format name or its abbreviation. Your task is to implement a function that returns the canonical format name from a predefined dictionary of canonical formats. If the given format name is not recognized, the function should return None. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_canonical_format_name('pdf') == 'Portable Document Format'\", \"assert get_canonical_format_name('jpg') == 'JPEG Image'\", \"assert get_canonical_format_name('png') == 'Portable Network Graphics'\", \"assert get_canonical_format_name('ppt') == 'Microsoft... | {
"split": "train",
"index": 72995,
"acecode_id": "bigcode_python_fns_17499",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Least Common Multiple (LCM) of three distinct positive integers. The function should be able to handle large integers efficiently. The function signature is as follows: `def lcm_of_three_numbers(a: int, b: int, c: int) -> int:` where `a`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm_of_three_numbers(2, 3, 5) == 30\", \"assert lcm_of_three_numbers(4, 9, 12) == 36\", \"assert lcm_of_three_numbers(7, 14, 21) == 42\", \"assert lcm_of_three_numbers(1, 2, 3) == 6\", \"assert lcm_of_three_numbers(8, 12, 16) == 48\", \"assert lcm_of_three_n... | {
"split": "train",
"index": 72996,
"acecode_id": "evol_31361",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of software packages for a package manager. The package manager maintains a list of installed packages and their versions. You are given a list of packages in the format of a dictionary where the keys are the package names and the value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_packages({'numpy': '1.16.4', 'pandas': '0.25.0'}) == [('numpy', '1.16.4'), ('pandas', '0.25.0')]\", \"assert sort_packages({'numpy': '1.19.5', 'scikit-learn': '0.23.2', 'pandas': '1.1.5'}) == [('numpy', '1.19.5'), ('pandas', '1.1.5'), ('scikit-learn', '... | {
"split": "train",
"index": 72997,
"acecode_id": "oss_34903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function `to_hexadecimal(sequence)` that takes a list of numerical inputs and converts each valid number into its corresponding hexadecimal notation. The function should handle negative numbers by using two's complement representation. If an input is not a valid number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_hexadecimal([10, 255, -1]) == ['0xa', '0xff', '0xffffffff']\", \"assert to_hexadecimal([-10, 0, 16]) == ['0xfffffff6', '0x0', '0x10']\", \"assert to_hexadecimal(['abc', 15, 30.5]) == ['0xf']\", \"assert to_hexadecimal([]) == []\", \"assert to_hexadecimal(... | {
"split": "train",
"index": 72998,
"acecode_id": "evol_35763",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of credit card numbers. Your task is to validate this list based on the following criteria: 1) The list must contain between 1 and 5 credit card numbers, inclusive. 2) Each credit card number must be exactly 16 characters long. 3) Each credit card number mu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_credit_cards(['1234567812345678']) == (True, None)\", \"assert validate_credit_cards(['1234567812345678', '8765432187654321']) == (True, None)\", \"assert validate_credit_cards(['1234567812345678', '8765432187654321', '1234567812345678', '8765432187... | {
"split": "train",
"index": 72999,
"acecode_id": "bigcode_python_fns_36585",
"num_tests": 5
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.