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 tasked with simulating the behavior of a simple LED (Light Emitting Diode) display. Your goal is to implement a function that takes an initial state of an LED (either 'on' or 'off') and a list of commands to execute. The commands can either be 'turn_on', 'turn_off', or ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert led_display('off', ['turn_on', 'check_state']) == 'on'\", \"assert led_display('on', ['turn_off', 'check_state']) == 'off'\", \"assert led_display('off', ['turn_on', 'turn_on', 'check_state']) == 'on'\", \"assert led_display('on', ['turn_off', 'turn_off', 'c... | {
"split": "train",
"index": 77900,
"acecode_id": "oss_2178",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the surface area of a cube given the length of its sides. Write a function `calculate_surface_area(side_length: int) -> int` that takes a single integer parameter `side_length`, which represents the length of one side of the cube. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_surface_area(0) == 0\", \"assert calculate_surface_area(1) == 6\", \"assert calculate_surface_area(2) == 24\", \"assert calculate_surface_area(3) == 54\", \"assert calculate_surface_area(4) == 96\", \"assert calculate_surface_area(5) == 150\", \"as... | {
"split": "train",
"index": 77901,
"acecode_id": "oss_17922",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns all the modes (the numbers that appear most frequently) in the list. If there are multiple modes, return them as a list. The order of the modes in the returned list does not matter.\nPlease reason step by step, then wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_mode([1, 1, 2, 2, 3]) == [1, 2]\", \"assert find_mode([1, 1, 1, 2, 2, 2]) == [1, 2]\", \"assert find_mode([5, 5, 5, 1, 1, 1, 2]) == [5, 1]\", \"assert find_mode([4, 5, 6, 4, 5, 4, 6, 6]) == [4, 6]\", \"assert find_mode([10, 20, 10, 30, 20, 10, 20]) == [... | {
"split": "train",
"index": 77902,
"acecode_id": "evol_6062",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `disable_feature(partial_name: str, partial_name_field: str, force: bool) -> str:` that simulates disabling a feature in a system based on its partial name. The function takes three parameters: `partial_name`, which is a string repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert disable_feature('featureA', 'name', False) == 'Feature disabled'\", \"assert disable_feature('featureB', 'name', True) == 'Feature forced to disable'\", \"assert disable_feature('featureC', 'name', False) == 'Feature disabled'\", \"assert disable_feature('fe... | {
"split": "train",
"index": 77903,
"acecode_id": "bigcode_python_fns_23932",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that parses a list of package requirements and filters out any requirements that contain 'git+'. Additionally, the function should receive a list of native extensions and return a dictionary containing the filtered requirements and the li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_requirements_and_extensions(['requests==2.25.1', 'numpy==1.20.1', 'git+https://github.com/somepackage.git'], ['demo.c', 'example.c']) == {'requirements': ['requests==2.25.1', 'numpy==1.20.1'], 'extensions': ['demo.c', 'example.c']}\", \"assert parse_re... | {
"split": "train",
"index": 77904,
"acecode_id": "oss_28203",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple logging system that provides functionality to log information, messages, and warnings. Your goal is to implement a single function called `log_message` which takes a log level and a message as input and returns a formatted string based on t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_message('info', 'System initialized') == 'INFO: System initialized'\", \"assert log_message('message', 'This is a log message') == 'MESSAGE: This is a log message'\", \"assert log_message('warning', 'This is a warning') == 'WARNING: This is a warning'\",... | {
"split": "train",
"index": 77905,
"acecode_id": "oss_10948",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a duration string into the total number of seconds. The duration string is formatted as 'XXhXXmXXs', where 'XX' can be one or more digits representing hours, minutes, and seconds. Your function should return the total time i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_duration_to_seconds('1h0m0s') == 3600\", \"assert convert_duration_to_seconds('0h1m0s') == 60\", \"assert convert_duration_to_seconds('0h0m1s') == 1\", \"assert convert_duration_to_seconds('1h1m1s') == 3661\", \"assert convert_duration_to_seconds('2h... | {
"split": "train",
"index": 77906,
"acecode_id": "bigcode_python_fns_23541",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sentence consisting of words separated by spaces and a positive integer n, write a function `duplicate_words(sentence: str, n: int) -> str` that returns a new sentence where each distinct word from the original sentence is repeated n times, while preserving the order of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert duplicate_words('hello world', 2) == 'hello hello world world'\", \"assert duplicate_words('code', 3) == 'code code code'\", \"assert duplicate_words('python programming', 4) == 'python python python python programming programming programming programming'\",... | {
"split": "train",
"index": 77907,
"acecode_id": "evol_6033",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a multi-sector design with the following structure: {'unpacked_designation': <string>, 'sectors': [<dict1>, <dict2>, ...]}. Each sector dictionary can contain any key-value pairs. Your task is to implement a function `process_designation(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_designation({'unpacked_designation': 'Design A', 'sectors': [{'sector_id': 1}, {'sector_id': 2}]}) == [('Design A', {'sector_id': 1}), ('Design A', {'sector_id': 2})]\", \"assert process_designation({'unpacked_designation': 'Design B', 'sectors': []}... | {
"split": "train",
"index": 77908,
"acecode_id": "bigcode_python_fns_12571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_project_manager(name: str, num_years_experience: int, department: str) -> dict` that takes the name, number of years of experience, and department of a project manager and returns a dictionary representing the project manager's details. The dictiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_project_manager('Alice', 10, 'Marketing') == {'Name': 'Alice', 'Experience': 10, 'Department': 'Marketing', 'Unique ID': hash(('Alice', 10, 'Marketing')), 'Projects Managed': []}\", \"assert create_project_manager('Bob', 2, 'Sales') == {'Name': 'Bob',... | {
"split": "train",
"index": 77909,
"acecode_id": "evol_26806",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two sorted lists of integers, write a function to find the number of unique common elements in both lists. The function should return the count of these common elements. For example, if list1 = [1, 2, 3, 4] and list2 = [2, 3, 4, 5], the function should return 3, since the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert common_elements([1, 2, 3, 4], [2, 3, 4, 5]) == 3\", \"assert common_elements([1, 2, 3], [4, 5, 6]) == 0\", \"assert common_elements([], [1, 2, 3]) == 0\", \"assert common_elements([1, 2, 3], []) == 0\", \"assert common_elements([1, 2, 3, 4, 5], [5, 4, 3, 2, ... | {
"split": "train",
"index": 77910,
"acecode_id": "evol_27318",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that receives a list of integers (which can be both positive and negative) and returns a list of pairs of elements that yield the maximum product. If there are multiple pairs with the same maximum product, return all such pairs in the order they appear ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product_pairs([1, 2, 3, 4]) == [[3, 4]]\", \"assert max_product_pairs([5]) == []\", \"assert max_product_pairs([]) == []\", \"assert max_product_pairs([0, -5, -6, 5, 6]) == [[-5, -6], [5, 6]]\", \"assert max_product_pairs([-10, 2, 5, 10, -5]) == [[-10, -... | {
"split": "train",
"index": 77911,
"acecode_id": "evol_10607",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target integer. Your task is to determine if there are two distinct indices in the list such that the sum of the integers at those indices equals the target integer. Implement a function `find_two_sum(nums: List[int], target: int) -> bool`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_two_sum([2, 7, 11, 15], 9) == True\", \"assert find_two_sum([3, 2, 4], 6) == True\", \"assert find_two_sum([1, 5, 3, 4], 7) == True\", \"assert find_two_sum([1, 2, 3, 4], 8) == False\", \"assert find_two_sum([0, -1, 2, -3], -1) == True\", \"assert find_... | {
"split": "train",
"index": 77912,
"acecode_id": "bigcode_python_fns_229",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that generates a list of numbers within a specified range, with a given step size. Your function should take three parameters: `start` (the starting value of the range), `end` (the ending value of the range), and `step` (the st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_range(0, 10, 2) == [0, 2, 4, 6, 8]\", \"assert generate_range(1, 5, 1) == [1, 2, 3, 4]\", \"assert generate_range(10, 1, -1) == [10, 9, 8, 7, 6, 5, 4, 3, 2]\", \"assert generate_range(5, 5, 1) == []\", \"assert generate_range(5, 10, 0) == []\", \"as... | {
"split": "train",
"index": 77913,
"acecode_id": "oss_18783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a sine wave array for a specified duration and sampling rate. Implement the function `generate_sine_wave(duration: float, srate: int) -> List[float]` that takes in the duration of the sine wave in seconds and the sampling rate in Hz, and returns a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_sine_wave(0.5, 22050)) == 11025\", \"assert len(generate_sine_wave(0.1, 8000)) == 800\", \"assert len(generate_sine_wave(0.2, 12000)) == 2400\", \"assert len(generate_sine_wave(1.0, 22050)) == 22050\", \"assert len(generate_sine_wave(0.75, 48000... | {
"split": "train",
"index": 77914,
"acecode_id": "bigcode_python_fns_49996",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple database operation. The function should take two parameters: a database URL (a string) and a list of changes (a list of strings). The function should print a message indicating that it has connected to the database... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_database_operations('example.com/database', ['change1', 'change2']) == ['Connected to example.com/database', 'Changes committed to the database', 'Connection to the database closed']\", \"assert simulate_database_operations('test.com/db', []) == ['C... | {
"split": "train",
"index": 77915,
"acecode_id": "oss_12984",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `transform_list(lst: List[int]) -> List[int]` that returns a new list where each element is the absolute value of the corresponding element in the input list multiplied by 3. The input list can have a length ranging from 0 to 1000 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_list([1, -2, 3]) == [3, 6, 9]\", \"assert transform_list([-1, -1, -1]) == [3, 3, 3]\", \"assert transform_list([0, 0, 0]) == [0, 0, 0]\", \"assert transform_list([]) == []\", \"assert transform_list([10, -20, 30]) == [30, 60, 90]\", \"assert transf... | {
"split": "train",
"index": 77916,
"acecode_id": "bigcode_python_fns_6677",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates accessing a vehicle's odometer. The odometer function raises a SmartcarException when the user does not have the necessary permissions to access the odometer data. The SmartcarException class has the following attributes: status_code (int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_odometer_permission() == True\", \"assert check_odometer_permission() == True\", \"assert check_odometer_permission() == True\", \"assert check_odometer_permission() == True\", \"assert check_odometer_permission() == True\", \"assert check_odometer_per... | {
"split": "train",
"index": 77917,
"acecode_id": "bigcode_python_fns_33681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings. Your task is to find the largest rectangular area that can be formed by consecutive buildings in this list. Each building has a width of 1, and the height of the rectangle is determined by the height of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largestRectangleArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert largestRectangleArea([1, 1, 1, 1, 1]) == 5\", \"assert largestRectangleArea([0, 0, 0, 0]) == 0\", \"assert largestRectangleArea([5, 4, 1, 2]) == 8\", \"assert largestRectangleArea([1, 3, 2, 1, 2]) ==... | {
"split": "train",
"index": 77918,
"acecode_id": "oss_6824",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a segment type and a list of values and returns a representation based on the segment type. The segment type can be either 'sequence' or 'set'. If the segment type is 'sequence', the function should return the values joined by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert represent_segment('sequence', [1, 2, 3]) == '3_2_1'\", \"assert represent_segment('set', [1, 2, 2, 3]) == {1, 2, 3}\", \"assert represent_segment('sequence', [5, 10, 15]) == '15_10_5'\", \"assert represent_segment('set', [5, 5, 5]) == {5}\", \"assert represe... | {
"split": "train",
"index": 77919,
"acecode_id": "oss_31747",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of virtual network interface controller (vnic) management IP addresses. The function should take the list of IP addresses as input and return a new list containing the results of a specific operation performed... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_vnic_ips(['192.168.1.1', '10.0.0.1', '256.1.1.1', 'abc.def.ghi.jkl']) == ['1.1.168.192', '1.0.0.10', 'Invalid IP', 'Invalid IP']\", \"assert process_vnic_ips(['0.0.0.0', '255.255.255.255', '1.2.3.4']) == ['0.0.0.0', '255.255.255.255', '4.3.2.1']\", \... | {
"split": "train",
"index": 77920,
"acecode_id": "oss_5176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `lucas(n: int) -> int` that returns the nth Lucas number. The Lucas numbers are defined as follows: L(0) = 2, L(1) = 1, and for n > 1, L(n) = L(n - 1) + L(n - 2). Write the function to compute the nth Lucas number for a given non-negative integer n.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lucas(0) == 2\", \"assert lucas(1) == 1\", \"assert lucas(2) == 3\", \"assert lucas(3) == 4\", \"assert lucas(4) == 7\", \"assert lucas(5) == 11\", \"assert lucas(6) == 18\", \"assert lucas(7) == 29\", \"assert lucas(8) == 47\", \"assert lucas(9) == 76\", \"... | {
"split": "train",
"index": 77921,
"acecode_id": "evol_12721",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples, where each tuple contains two datetime objects (start and end) and a string representing the timezone ('CET' or 'CEST'), write a function `convert_to_gas_day(transitions: List[Tuple[datetime, datetime, str]]) -> List[Tuple[timedelta, timedelta, str]]` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_gas_day([(datetime(2023, 3, 26, 1, 0), datetime(2023, 3, 26, 2, 0), 'CET')]) == [(timedelta(hours=19), timedelta(hours=20), 'CET')]\", \"assert convert_to_gas_day([(datetime(2023, 6, 1, 1, 0), datetime(2023, 6, 1, 2, 0), 'CEST')]) == [(timedelta(h... | {
"split": "train",
"index": 77922,
"acecode_id": "bigcode_python_fns_25620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sales events, where each event is represented as a dictionary containing the following keys: 'Txid' (an integer representing the transaction ID), 'productname' (a string representing the name of the product), 'qty' (an integer representing the quantity s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_sales([]) == 0.0\", \"assert total_sales([{ 'Txid': 1, 'productname': 'Product 1', 'qty': 1, 'sales': 100.0 }]) == 100.0\", \"assert total_sales([{ 'Txid': 1, 'productname': 'Product A', 'qty': 3, 'sales': 300.0 }, { 'Txid': 2, 'productname': 'Product ... | {
"split": "train",
"index": 77923,
"acecode_id": "bigcode_python_fns_25871",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the accuracy of a machine learning model based on the predictions and actual results. The function `calculate_accuracy` takes two parameters: `predictions`, a list of integers representing the predicted labels (0 or 1), a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_accuracy([1, 0, 1, 1], [1, 0, 1, 0]) == 75.0\", \"assert calculate_accuracy([1, 1, 1], [1, 1, 1]) == 100.0\", \"assert calculate_accuracy([0, 0, 0, 0], [0, 0, 0, 1]) == 75.0\", \"assert calculate_accuracy([0, 1, 0, 1], [1, 0, 1, 0]) == 0.0\", \"ass... | {
"split": "train",
"index": 77924,
"acecode_id": "oss_24407",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a Pfam clan accession key. Your task is to extract the associated PDB IDs from a predefined list of structures. Each PDB ID in the list has the format of four uppercase letters or digits. Implement a function that takes a clan accession key a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_pdb_ids('CL001') == ['1ABC', '2DEF']\", \"assert get_pdb_ids('CL002') == ['3GHI', '4JKL']\", \"assert get_pdb_ids('CL003') == ['5MNO']\", \"assert get_pdb_ids('CL004') == []\", \"assert get_pdb_ids('CL001') == ['1ABC', '2DEF']\", \"assert get_pdb_ids('CL... | {
"split": "train",
"index": 77925,
"acecode_id": "bigcode_python_fns_1968",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a calendar week in the format `<year>-KW<week>`, where `<year>` is a four-digit year and `<week>` is a one or two-digit week number (1-53). Your task is to implement a function that takes this string as input and returns a tuple containing tw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_year_week('2023-KW01') == (2023, 1)\", \"assert parse_year_week('2020-KW52') == (2020, 52)\", \"assert parse_year_week('1999-KW53') == (1999, 53)\", \"assert parse_year_week('2022-KW10') == (2022, 10)\", \"assert parse_year_week('2021-KW01') == (2021, ... | {
"split": "train",
"index": 77926,
"acecode_id": "bigcode_python_fns_22143",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a vote counting system for a local election. The system should be able to process votes cast by constituents and return the candidate with the highest number of votes. If there is a tie, return any one of the candidates with the highest votes. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_winner(['Candidate A', 'Candidate B', 'Candidate A']) == 'Candidate A'\", \"assert find_winner(['Candidate A', 'Candidate A', 'Candidate B', 'Candidate B']) in ['Candidate A', 'Candidate B']\", \"assert find_winner(['Candidate C', 'Candidate C', 'Candid... | {
"split": "train",
"index": 77927,
"acecode_id": "oss_25457",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of dictionaries representing geolocations. Each dictionary contains the keys 'latitude' and 'longitude' with corresponding numerical values. Your function should calculate the distance between the first ge... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distances([{'latitude': 52.2296756, 'longitude': 21.0122287}]) == [0.0]\", \"assert calculate_distances([{'latitude': 90, 'longitude': 0}, {'latitude': -90, 'longitude': 0}]) == [0.0, 20015]\", \"assert calculate_distances([{'latitude': 75, 'longit... | {
"split": "train",
"index": 77928,
"acecode_id": "oss_26931",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function that sorts an array of integers in ascending order without using a pre-defined sort function and returns the minimum difference between two consecutive elements in the sorted array. Additionally, return the count of total pairs that have this minimal difference... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_difference([4, 2, 7, 5, 1]) == (1, 2)\", \"assert min_difference([10, 20, 30]) == (10, 2)\", \"assert min_difference([5, 3, 1, 2, 4]) == (1, 4)\", \"assert min_difference([9, 8, 7, 6, 5]) == (1, 4)\", \"assert min_difference([1, 3, 4, 6, 8]) == (1, 1)\",... | {
"split": "train",
"index": 77929,
"acecode_id": "evol_15593",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, return a list containing the elements that are common to both lists, without any duplicates. The order of the elements in the resulting list should be the same as they appear in the second list. You may assume that the input lists will not contain a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersection([1, 2, 3], [2, 3, 4]) == [2, 3]\", \"assert intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\", \"assert intersection([1, 1, 1], [1, 2, 3]) == [1]\", \"assert intersection([], [1, 2, 3]) == []\", \"assert intersection([1, 2, 3], []) == []\", \"as... | {
"split": "train",
"index": 77930,
"acecode_id": "bigcode_python_fns_38315",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given emotion label and returns the corresponding numerical code. The emotion labels and their numerical codes are defined in a dictionary. Write a Python function `get_emotion_code(emotion_label)` that takes a str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_emotion_code('Angry') == 0\", \"assert get_emotion_code('Disgusted') == 1\", \"assert get_emotion_code('Fearful') == 2\", \"assert get_emotion_code('Happy') == 3\", \"assert get_emotion_code('Sad') == 4\", \"assert get_emotion_code('Surprised') == 5\", \... | {
"split": "train",
"index": 77931,
"acecode_id": "oss_17493",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the lengths of videos in seconds. Your task is to write a function `prepare_video_data(video_lengths: List[int]) -> List[str]` that takes in this list and prepares a list of strings which indicate whether each video is short (< 10 s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prepare_video_data([5, 15, 65]) == ['Video 5s: short', 'Video 15s: medium', 'Video 65s: long']\", \"assert prepare_video_data([8, 10, 20, 60, 90]) == ['Video 8s: short', 'Video 10s: medium', 'Video 20s: medium', 'Video 60s: medium', 'Video 90s: long']\", \"a... | {
"split": "train",
"index": 77932,
"acecode_id": "bigcode_python_fns_4547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating and processing data from a serialized CRM project. The serialized CRM project has the following fields: 'slug_field' (a string), 'crm_project' (a read-only serialized representation), 'links' (optional JSON field), 'past_deadline' (a boolean), 'wa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_crm_project({'slug_field': 'project-abc', 'crm_project': {}, 'links': None, 'past_deadline': False, 'warn_deadline': False, 'deadline_extensions': []}) == {'slug_field': 'project-abc', 'crm_project': {}, 'links': None, 'past_deadline': False, 'warn_... | {
"split": "train",
"index": 77933,
"acecode_id": "oss_15408",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given two sentences, A and B, each consisting of words separated by spaces. Your task is to implement a function `uncommonWords(A: str, B: str) -> List[str]` that returns a list of words that are uncommon between the two sentences. A word is considered uncommon if it ap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert uncommonWords('this apple is sweet', 'this apple is sour') == ['sweet', 'sour']\", \"assert uncommonWords('apple apple', 'banana') == ['banana']\", \"assert uncommonWords('hello world', 'hello everyone') == ['world', 'everyone']\", \"assert uncommonWords('a ... | {
"split": "train",
"index": 77934,
"acecode_id": "evol_29315",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_third_largest` that takes an array of integers and returns the third largest unique number in the array. If the array has fewer than three unique numbers, return None. The function should not modify the original array.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_third_largest([4, 5, 1, 3, 9, 11]) == 5\", \"assert find_third_largest([1, 2, 3, 4, 5]) == 3\", \"assert find_third_largest([5, 5, 5]) == None\", \"assert find_third_largest([1, 2]) == None\", \"assert find_third_largest([10, 20, 30, 10, 20]) == 10\", \... | {
"split": "train",
"index": 77935,
"acecode_id": "evol_1165",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that represents a genomic region in the format 'chr:start-stop' or 'chr:start..stop', write a function that parses this string and returns a tuple containing the chromosome name as a string, the start position as an integer, and the stop position as an integer or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert str2range('chr2:300..400') == ('chr2', 300, 400)\", \"assert str2range('chrX:500..') == ('chrX', 500, None)\", \"assert str2range('chr4:800..1000') == ('chr4', 800, 1000)\", \"assert str2range('chr6:400..600') == ('chr6', 400, 600)\", \"assert str2range('chr... | {
"split": "train",
"index": 77936,
"acecode_id": "bigcode_python_fns_14197",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of integers and returns a new list containing only the even numbers from the original list. Your function should take a list of integers as input and return a list of even integers. If there are no even integers, ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([0]) == [0]\", \"assert... | {
"split": "train",
"index": 77937,
"acecode_id": "oss_17255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of CIDR blocks and an IP address, and returns True if the IP address falls within any of the CIDR blocks, and False otherwise. A CIDR block is represented as a string in the format 'x.x.x.x/n', where 'x' represents a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_ip_in_cidrs('192.168.1.1', ['192.168.1.0/24']) == True\", \"assert is_ip_in_cidrs('10.0.0.5', ['10.0.0.0/8']) == True\", \"assert is_ip_in_cidrs('172.16.0.10', ['172.16.0.0/12']) == True\", \"assert is_ip_in_cidrs('192.168.2.5', ['192.168.1.0/24']) == Fal... | {
"split": "train",
"index": 77938,
"acecode_id": "bigcode_python_fns_35541",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the training process of a simple neural network. The function should take in a list of tuples where each tuple contains an input tensor (represented as a list of floats) and a target value (represented as a float). The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert train_network([([1.0, 2.0, 3.0], 6.0)]) == 0.0\", \"assert train_network([([0.0, 0.0], 0.0)]) == 0.0\", \"assert train_network([([1.0, 1.0], 3.0)]) == 1.0\", \"assert train_network([([2.0, 2.0, 2.0], 7.0)]) == 1.0\", \"assert train_network([([10.0, 20.0, 30.... | {
"split": "train",
"index": 77939,
"acecode_id": "bigcode_python_fns_19053",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to generate big rules from frequent itemsets. Given a list of frequent itemsets `L`, a dictionary `support_data` containing the support for each itemset, and a minimal confidence `min_conf`, you need to generate all big rules. Each bi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_big_rules([('A', 'B'), ('C', 'D', 'E')], {('A', 'B'): 200, ('C', 'D', 'E'): 100}, 0.6) == []\", \"assert generate_big_rules([('A', 'B')], {('A', 'B'): 30}, 0.5) == []\", \"assert generate_big_rules([('X', 'Y', 'Z')], {('X', 'Y', 'Z'): 150}, 0.6) == ... | {
"split": "train",
"index": 77940,
"acecode_id": "oss_8603",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_nth_largest_even_divisible(x: int, y: int, z: int, n: int) -> int` that takes four positive integers, x, y, z, and n as input. This function should return the nth largest even number in the range [x, y] (inclusive of both x and y) that is divisible by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_nth_largest_even_divisible(12, 15, 2, 1) == 14\", \"assert find_nth_largest_even_divisible(13, 12, 3, 2) == -1\", \"assert find_nth_largest_even_divisible(10, 20, 4, 2) == 16\", \"assert find_nth_largest_even_divisible(20, 30, 5, 1) == 30\", \"assert fi... | {
"split": "train",
"index": 77941,
"acecode_id": "evol_15122",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `run_query(query: str) -> List[Tuple]` that takes a SQL query as input and simulates executing it against a database. The function should return the results of the query as a list of tuples. If the query is erroneous, it should automatically correct it by r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_query('SELECT col1, col2 FROM customer_details WHERE condition1, condition2') == [('value1', 'value2')]\", \"assert run_query('SELECT * FROM customer_details WHERE id = 1') == [('John Doe', 'johndoe@example.com')]\", \"assert run_query('SELECT * FROM cus... | {
"split": "train",
"index": 77942,
"acecode_id": "evol_18912",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string of Python code that may contain a function definition. Write a function `check_function_exists(code: str, func_name: str) -> bool` that checks if the specified function can be found in the provided code string. The function should return True if the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_function_exists('def my_function(): pass', 'my_function') == True\", \"assert check_function_exists('def anotherFunc(): pass', 'my_function') == False\", \"assert check_function_exists('def my_function(param): return param', 'my_function') == True\", \... | {
"split": "train",
"index": 77943,
"acecode_id": "bigcode_python_fns_29196",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a nested dictionary and an attribute name as input. The function should split the attribute name by underscores and return the corresponding value from the nested dictionary based on the split parts. If any part does not ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_nested_value({'data': {'person': {'name': 'John Doe', 'age': 30}, 'location': {'city': 'New York', 'country': 'USA'}}}, 'data_person_name') == 'John Doe'\", \"assert get_nested_value({'data': {'person': {'name': 'John Doe', 'age': 30}, 'location': {'city... | {
"split": "train",
"index": 77944,
"acecode_id": "oss_25279",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `download_page(url: str, user_agent: str = 'default_agent', num_retries: int = 2) -> Union[str, None]`. The function should simulate the behavior of downloading a webpage. It takes a URL and an optional user agent string, and attempts to downloa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_page('http://example.com', 'my_agent', 2) == 'Downloaded content from http://example.com with user agent my_agent'\", \"assert download_page('http://example.com', 'test_agent', 0) == 'Downloaded content from http://example.com with user agent test_a... | {
"split": "train",
"index": 77945,
"acecode_id": "bigcode_python_fns_25149",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a date or a datetime object, return a new datetime object that represents the start of that day (i.e., with the time set to 00:00:00). If the input is a date object, convert it to a datetime object with the time set to midnight. Implement a function 'start_of_day(val)' th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert start_of_day(datetime(2023, 10, 1, 15, 30, 45)) == datetime(2023, 10, 1, 0, 0, 0)\", \"assert start_of_day(datetime(2023, 10, 15, 9, 45, 0)) == datetime(2023, 10, 15, 0, 0, 0)\", \"assert start_of_day(datetime(2023, 1, 1, 23, 59, 59)) == datetime(2023, 1, 1,... | {
"split": "train",
"index": 77946,
"acecode_id": "bigcode_python_fns_29693",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a button click in a simple button application. The function will take two parameters, `current_label` (an integer representing the current label of the button) and `prev_label` (an integer representing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_button_label(1, None) == 2\", \"assert update_button_label(2, None) == 4\", \"assert update_button_label(3, None) == 6\", \"assert update_button_label(4, None) == 8\", \"assert update_button_label(1, 1) == 2\", \"assert update_button_label(2, 1) == 3\... | {
"split": "train",
"index": 77947,
"acecode_id": "oss_4247",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that can handle predictions using either padding or tiling, but not both simultaneously. Write a function `predict_with_padding_and_tiling` that takes in the following parameters: `prediction_pipeline`, `inputs`, `outputs`, `padding`,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_with_padding_and_tiling('pipeline1', 'input1', 'output1', True, None, None, False) is None\", \"assert predict_with_padding_and_tiling('pipeline2', 'input2', 'output2', False, [(2, 2)], [(1, 1)], True) is None\", \"assert predict_with_padding_and_til... | {
"split": "train",
"index": 77948,
"acecode_id": "oss_25263",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes multiple lists of integers and aggregates them into a single string. Each integer should be separated by a semicolon, and each list should be separated by a vertical bar. For example, given the lists [1, 2, 3], [4, 5, 6, 7], and [8, 9], the outpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_arrays([1, 2, 3], [4, 5, 6, 7], [8, 9]) == '1;2;3|4;5;6;7|8;9'\", \"assert aggregate_arrays([], [1, 2, 3]) == '1;2;3'\", \"assert aggregate_arrays([1, 2, 3], []) == '1;2;3'\", \"assert aggregate_arrays([], []) == ''\", \"assert aggregate_arrays([10... | {
"split": "train",
"index": 77949,
"acecode_id": "evol_7943",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tensor represented as a list of integers, write a function `add_empty_dims_right(tensor: List[int], ndims: int, right_indent: int) -> List[int]` that adds `ndims` number of empty dimensions to the right of the tensor's shape. Each empty dimension is represented by an ad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_empty_dims_right([1, 2, 3], 2, 1) == [1, 2, 3, None, None, None]\", \"assert add_empty_dims_right([1, 2, 3], 0, 0) == [1, 2, 3]\", \"assert add_empty_dims_right([1], 1, 0) == [1, None]\", \"assert add_empty_dims_right([], 3, 0) == [None, None, None]\", \... | {
"split": "train",
"index": 77950,
"acecode_id": "bigcode_python_fns_38903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of Ethereum addresses, implement a function `ens_reverse_lookup(addresses: List[str]) -> Dict[str, Optional[str]]` that returns a dictionary mapping each Ethereum address to its corresponding ENS (Ethereum Name Service) name. If an address does not have a correspon... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ens_reverse_lookup(['0x71C7656EC7ab88b098defB751B7401B5f6d8976', '0x1234567890abcdef1234567890abcdef12345678']) == {'0x71C7656EC7ab88b098defB751B7401B5f6d8976': None, '0x1234567890abcdef1234567890abcdef12345678': 'lefteris.eth'}\", \"assert ens_reverse_looku... | {
"split": "train",
"index": 77951,
"acecode_id": "bigcode_python_fns_1658",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, write a function that calculates the sum of all even integers from 0 to n (inclusive). Implement a function called `sum_of_evens(n)` that takes an integer n as input and returns the cumulative total of all even integers within the range of 0 to n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens(0) == 0\", \"assert sum_of_evens(1) == 0\", \"assert sum_of_evens(2) == 2\", \"assert sum_of_evens(3) == 2\", \"assert sum_of_evens(4) == 6\", \"assert sum_of_evens(5) == 6\", \"assert sum_of_evens(6) == 12\", \"assert sum_of_evens(7) == 12\", \... | {
"split": "train",
"index": 77952,
"acecode_id": "evol_3890",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing daily temperatures. Your task is to write a function `average_temperature(temperatures: List[int]) -> float` that calculates the average temperature for the given list. The average temperature should be calculated using the formula:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_temperature([30, 40, 50]) == 40.0\", \"assert average_temperature([-10, 0, 10]) == 0.0\", \"assert average_temperature([25, 35, 45, 55]) == 40.0\", \"assert average_temperature([100, 100, 100]) == 100.0\", \"assert average_temperature([-100, -50, 0, ... | {
"split": "train",
"index": 77953,
"acecode_id": "bigcode_python_fns_16970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_user_playlists` that takes a list of user emails and a list of corresponding playlist names, and returns a dictionary where each user's email is a key and the value is a list of their associated playlist names. If a user has no pl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user_playlists(['user1@example.com'], ['Playlist1']) == {'user1@example.com': ['Playlist1']}\", \"assert create_user_playlists(['user1@example.com', 'user2@example.com'], ['Playlist1', 'Playlist2']) == {'user1@example.com': ['Playlist1'], 'user2@examp... | {
"split": "train",
"index": 77954,
"acecode_id": "bigcode_python_fns_33471",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary of options for deploying endpoints, write a function `verify_options(options: dict) -> bool` that verifies the provided options based on the following criteria: 1. If 'endpoints_service' is present, 'openapi_template' must also be present. 2. If 'openapi_temp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_options({'endpoints_service': 'my-service', 'openapi_template': 'my-template', 'project_id': 'my'}) == True\", \"assert verify_options({'endpoints_service': 'my-service', 'project_id': 'my'}) == False\", \"assert verify_options({'openapi_template': 'm... | {
"split": "train",
"index": 77955,
"acecode_id": "bigcode_python_fns_36461",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a data type represented as a string and a frequency represented as an optional string. Your task is to validate if the provided frequency matches the expected frequency for the given data type. The valid data types and their corresponding frequencies are as follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_data_type_freq('Daily', '1D') == '1D'\", \"assert validate_data_type_freq('Weekly', '1W') == '1W'\", \"assert validate_data_type_freq('Monthly', '1M') == '1M'\", \"assert validate_data_type_freq('Yearly', '1Y') == '1Y'\", \"assert validate_data_type... | {
"split": "train",
"index": 77956,
"acecode_id": "bigcode_python_fns_1026",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a grid representing a 2D area, where each cell in the grid can be either empty or occupied. The grid is represented as a 2D list of integers, where 0 represents an empty cell and 1 represents an occupied cell. Your task is to implement a function that calculates t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_empty_area([[0, 1], [1, 0]]) == 1\", \"assert largest_empty_area([[0, 0], [0, 0]]) == 4\", \"assert largest_empty_area([[1, 1], [1, 1]]) == 0\", \"assert largest_empty_area([[1, 0, 1], [0, 0, 0], [1, 0, 1]]) == 5\", \"assert largest_empty_area([[1, 1... | {
"split": "train",
"index": 77957,
"acecode_id": "oss_4507",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `calculate_score` that takes a list of integers as input. Each integer represents a score. The function should return the total score, which is the sum of all integers in the list. However, if any integer is negative, the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_score([10, 20, 30]) == 60\", \"assert calculate_score([0, 0, 0]) == 0\", \"assert calculate_score([-1, 10, 20]) == -1\", \"assert calculate_score([5, -5, 10]) == -1\", \"assert calculate_score([100]) == 100\", \"assert calculate_score([1, 2, 3, 4, ... | {
"split": "train",
"index": 77958,
"acecode_id": "oss_34909",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a specific integer 'k' is present in any of the provided tuples. The function should return a list of indices where 'k' is found. If 'k' is not found in any tuple, return a message indicating that no tuples contain 'k'. Additionally, the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_indices([(1, 2, 3), (4, 5, 6), (7, 8, 9)], 5) == [1]\", \"assert find_indices([(1, 2), (3, 4), (5, 6)], 1) == [0]\", \"assert find_indices([(1, 2), (3, 4)], 4) == [1]\", \"assert find_indices([(1,), (2,), (3,)], 3) == [2]\", \"assert find_indices([(7, 8... | {
"split": "train",
"index": 77959,
"acecode_id": "evol_28143",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a message handling system for a communication protocol. The system receives messages as a list of byte values and needs to determine if a complete message has been received. A complete message is denoted by the presence of a specific byte value,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_complete([1, 2, 3, 4]) == True\", \"assert is_complete([1, 2, 3]) == False\", \"assert is_complete([4]) == True\", \"assert is_complete([]) == False\", \"assert is_complete([0, 1, 2, 3, 4, 5]) == True\", \"assert is_complete([1, 2, 3, 5]) == False\", \"as... | {
"split": "train",
"index": 77960,
"acecode_id": "oss_31843",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that modifies the list to include the factorial of all prime numbers present in the list, while keeping the composite numbers unchanged. The final list should be sorted in descending order. You need to identify prime numbers, compu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_and_sort([1, 2, 3, 4, 5]) == [120, 6, 4, 2, 1]\", \"assert modify_and_sort([4, 6, 8, 10]) == [10, 8, 6, 4]\", \"assert modify_and_sort([20, 21, 22]) == [22, 21, 20]\", \"assert modify_and_sort([2, 3, 5, 7, 11]) == [39916800, 5040, 120, 6, 2]\", \"asse... | {
"split": "train",
"index": 77961,
"acecode_id": "evol_13524",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a database containing product information as a dictionary, implement a function that fetches details for a list of product names. The function should return a list of formatted strings for each product, including its name, price, and release date. If a product does not ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_product_details({'HTC U12+': {'price': '$800', 'release_date': '2018'}, 'iPhone X': {'price': '$1000', 'release_date': '2017'}}, ['HTC U12+']) == ['HTC U12+: Price: $800, Release Date: 2018']\", \"assert fetch_product_details({'HTC U12+': {'price': '$8... | {
"split": "train",
"index": 77962,
"acecode_id": "evol_5759",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_string_type(input_parameter)` that takes a single parameter `input_parameter`. The function should check if the parameter is of string type. If it is a string, return the string in uppercase. If it is not a string, raise a ValueError with the message... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_string_type('hello') == 'HELLO'\", \"assert check_string_type('LeetCode') == 'LEETCODE'\", \"assert check_string_type('123') == '123'\", \"assert check_string_type('') == ''\", \"assert check_string_type('Python') == 'PYTHON'\", \"assert check_string_t... | {
"split": "train",
"index": 77963,
"acecode_id": "evol_15214",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function that generates the Fibonacci sequence up to the nth Fibonacci number and returns a list of all prime numbers found in that sequence. The function should have the signature `def fibonacci_primes(n: int) -> List[int]:` where n is the position ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_primes(0) == []\", \"assert fibonacci_primes(1) == []\", \"assert fibonacci_primes(3) == [2]\", \"assert fibonacci_primes(4) == [2, 3]\", \"assert fibonacci_primes(6) == [2, 3, 5]\", \"assert fibonacci_primes(9) == [2, 3, 5, 13]\", \"assert fibonac... | {
"split": "train",
"index": 77964,
"acecode_id": "evol_22961",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a string of filters formatted as 'name=<name1>,value=<value1>,comparison=<comparison1>;name=<name2>...', write a function `parse_filter_field(string_filters: str) -> dict` that parses this string and returns a dictionary. The keys of the dictionary should be the filter na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_filter_field('name=age,value=25,comparison=>;name=salary,value=50000,comparison=<') == {'age': [{'Value': '25', 'Comparison': '>'}], 'salary': [{'Value': '50000', 'Comparison': '<'}]}\", \"assert parse_filter_field('name=height,value=180,comparison=>='... | {
"split": "train",
"index": 77965,
"acecode_id": "bigcode_python_fns_49909",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `nums`, write a function `maximum_gap(nums)` that computes and returns the largest gap between two consecutive elements when the array is sorted in ascending order. If the array has less than two elements, the function should return `0`. The length of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximum_gap([3,6,9,1]) == 3\", \"assert maximum_gap([10]) == 0\", \"assert maximum_gap([1,2,3,4,5]) == 1\", \"assert maximum_gap([5,10,15]) == 5\", \"assert maximum_gap([1,100,200,300]) == 100\", \"assert maximum_gap([]) == 0\", \"assert maximum_gap([7,7,7,7... | {
"split": "train",
"index": 77966,
"acecode_id": "evol_11510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `remove_duplicate_characters(string: str) -> str` that takes a string as an argument and removes all duplicate characters from it, returning the modified string with the first occurrences of the characters in the order of their appearance. For example, give... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicate_characters('banana') == 'ban'\", \"assert remove_duplicate_characters('aabbcc') == 'abc'\", \"assert remove_duplicate_characters('abcde') == 'abcde'\", \"assert remove_duplicate_characters('') == ''\", \"assert remove_duplicate_characters('a... | {
"split": "train",
"index": 77967,
"acecode_id": "evol_28960",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of strings, `pred_data` and `ref_data`, where each list contains sentences with words separated by spaces. Your task is to compute the average word-level accuracy between the predicted sentences and the reference sentences. The word-level accuracy for ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_accuracy(['hello world', 'goodbye'], ['hello world', 'goodbye']) == 100.0\", \"assert word_accuracy(['hello world', 'goodbye'], ['hello', 'goodbye']) == 75.0\", \"assert word_accuracy(['hello there', 'goodbye'], ['hello there', 'farewell']) == 50.0\", \... | {
"split": "train",
"index": 77968,
"acecode_id": "bigcode_python_fns_9744",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a sample user based on given email and password parameters. The function should take two optional parameters: `email` (default value: 'user@test.com') and `password` (default value: 'Test123'). The function should return a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_sample_user() == {'email': 'user@test.com', 'password': 'Test123'}\", \"assert create_sample_user('test@example.com') == {'email': 'test@example.com', 'password': 'Test123'}\", \"assert create_sample_user(password='SecurePass!') == {'email': 'user@tes... | {
"split": "train",
"index": 77969,
"acecode_id": "bigcode_python_fns_38613",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with finding all unique pairs of integers from a given list that sum up to a specific target value. The function should return a list of tuples, where each tuple contains two integers that form a unique pair. The order of the tuples in the output does not matter,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pairs_with_sum([1, 1, 1, 1], 2) == [(1, 1)]\", \"assert find_pairs_with_sum([1, 2, 3, 4, 5, 6], 7) == [(1, 6), (2, 5), (3, 4)]\", \"assert find_pairs_with_sum([], 5) == []\", \"assert find_pairs_with_sum([0, 0, 0], 0) == [(0, 0)]\", \"assert find_pairs_... | {
"split": "train",
"index": 77970,
"acecode_id": "bigcode_python_fns_11400",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a list of region details and creates a list of dictionaries representing the regions. Each region is defined by its code, name, timezone, and two boolean attributes indicating whether it supports listing and pricing.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_regions([('es_MX', 'M\\u00e9xico', 'America/Los_Angeles', True, True)]) == [{'code': 'es_MX', 'name': 'M\\u00e9xico', 'netinfo_TZ': 'America/Los_Angeles', 'supports_listing': True, 'supports_pricing': True}]\", \"assert create_regions([('pt_BR', 'Bras... | {
"split": "train",
"index": 77971,
"acecode_id": "oss_16948",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a custom object that can hold three attributes: 'value_float', 'value_int', and 'value_str'. Write a function `flexible_set_value(object, value, attr=True, null_others=True)` that sets the appropriate attribute based on the type of the provided value. If the value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flexible_set_value(obj, 5, True, True) == {'value_float': None, 'value_int': 5, 'value_str': None}\", \"assert flexible_set_value(obj, 3.14, True, True) == {'value_float': 3.14, 'value_int': None, 'value_str': None}\", \"assert flexible_set_value(obj, 'Hello... | {
"split": "train",
"index": 77972,
"acecode_id": "bigcode_python_fns_2380",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that encodes a provided input string using the ROT13 substitution cipher method. The function should handle potential errors gracefully, ensuring that the input is a non-empty string. If the input is invalid (not a string or empty), the function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rot13('Python 3.8') == 'Clguba 3.8'\", \"assert rot13('abcdefg') == 'nopqrst'\", \"assert rot13('12345') == '12345'\", \"assert rot13('!@#$%^&*()') == '!@#$%^&*()'\", \"assert rot13('What is this?') == 'Jung vf guvf?'\", \"assert rot13('ABCDEFGHIJKLMNOPQRSTU... | {
"split": "train",
"index": 77973,
"acecode_id": "evol_12644",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a floating-point number x, implement a function that calculates the Gamma function value using a fixed gamma of 2, following the formula: gamma(x) = (x * exp(-x)) / TAU_2, where TAU_2 is a constant equal to 2. The function should round the result to 14 decimal places. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gamma_dis(0) == 0.0\", \"assert gamma_dis(100) == 0.0\", \"assert gamma_dis(50) == 0.0\", \"assert gamma_dis(150) == 0.0\", \"assert gamma_dis(250) == 0.0\", \"assert gamma_dis(999) == 0.0\"]}"
} | {
"split": "train",
"index": 77974,
"acecode_id": "bigcode_python_fns_41701",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a quantum device that can handle a specified number of subsystems. Write a function `gaussian_device(n_subsystems: int) -> str` that takes an integer `n_subsystems` representing the number of subsystems (or qubits) and returns a string indicating th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gaussian_device(1) == 'DummyDevice(wires=1)'\", \"assert gaussian_device(2) == 'DummyDevice(wires=2)'\", \"assert gaussian_device(3) == 'DummyDevice(wires=3)'\", \"assert gaussian_device(4) == 'DummyDevice(wires=4)'\", \"assert gaussian_device(5) == 'DummyDe... | {
"split": "train",
"index": 77975,
"acecode_id": "bigcode_python_fns_27795",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that merges two lists of the same length into a dictionary, where the first list contains the keys and the second list contains the corresponding values. If the lists are of different lengths, ignore the excess elements in the longer list. Additionally, handle ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_lists([], []) == {}\", \"assert merge_lists([], [1, 2, 3]) == {}\", \"assert merge_lists(['a', 'b'], []) == {}\", \"assert merge_lists(['a'], [1]) == {'a': 1}\", \"assert merge_lists(['key1', 'key2'], [10, 20]) == {'key1': 10, 'key2': 20}\", \"assert m... | {
"split": "train",
"index": 77976,
"acecode_id": "evol_32260",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a 3D matrix of p height, m rows, and n columns, which may contain integers and nested lists. Your task is to implement a function that flattens this 3D matrix into a single list while preserving the order of elements. You cannot use any built-in functions for flat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten([[[1, 2], [3]], [[4], [5, [6]]]]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten([[[1], [2, 3]], [[4, [5]], [6, [7, 8]]]]) == [1, 2, 3, 4, 5, 6, 7, 8]\", \"assert flatten([[[[]]]]) == []\", \"assert flatten([[[1, [2]], [3]], [[4], [5]]]) == [1, 2, 3, 4, 5... | {
"split": "train",
"index": 77977,
"acecode_id": "evol_22894",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of strings. The function should take in a list of strings and perform the following operations: 1. Sort the list in ascending order. 2. Remove any duplicate elements from the list. Your task is to write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string_list(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert process_string_list(['dog', 'cat', 'dog']) == ['cat', 'dog']\", \"assert process_string_list(['zebra', 'lion', 'tiger', 'lion']) == ['lion', 'tiger', 'ze... | {
"split": "train",
"index": 77978,
"acecode_id": "oss_905",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of tuples, where each tuple consists of a pathway name and its corresponding pathway ID. Your function should return a dictionary that maps each pathway name to its pathway ID. Implement the function 'get_pathway_id_name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_pathway_id_names_dict([]) == {}\", \"assert get_pathway_id_names_dict([('Pathway A', 1)]) == {'Pathway A': 1}\", \"assert get_pathway_id_names_dict([('Pathway A', 1), ('Pathway B', 2)]) == {'Pathway A': 1, 'Pathway B': 2}\", \"assert get_pathway_id_names... | {
"split": "train",
"index": 77979,
"acecode_id": "bigcode_python_fns_16080",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `licks_ice_cream()` that simulates a playful action. The function should return a specific string when called. Specifically, the function should return the string '*licks ice cream cone*'. Implement the function such that it does n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert licks_ice_cream() == '*licks ice cream cone*'\", \"assert licks_ice_cream() == '*licks ice cream cone*'\", \"assert licks_ice_cream() == '*licks ice cream cone*'\", \"assert licks_ice_cream() == '*licks ice cream cone*'\", \"assert licks_ice_cream() == '*lic... | {
"split": "train",
"index": 77980,
"acecode_id": "bigcode_python_fns_35081",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a directed graph represented by an adjacency list, where each edge has an associated metadata represented as a dictionary containing 'change' and two integers, determine if the length of the video represented by the edge from a source node 'frm' to a destination node 'to'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_video_length({'A': [('B', {'metadatadiff.video.nb_frames': ('change', 100, 50)}), ('C', {'metadatadiff.video.nb_frames': ('change', 120, 80)})]}, 'A', 'B') == ('OK', 'Length of video is shorter')\", \"assert check_video_length({'A': [('B', {'metadatadi... | {
"split": "train",
"index": 77981,
"acecode_id": "bigcode_python_fns_15853",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and a target integer. Your function should return a new list containing only the integers from the original list that are less than the target integer. Implement the function `filter_less_than(nums: List[int]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_less_than([1, 2, 3, 4, 5], 3) == [1, 2]\", \"assert filter_less_than([10, 20, 30, 40], 25) == [10, 20]\", \"assert filter_less_than([-1, 0, 1, 2], 0) == [-1]\", \"assert filter_less_than([5, 10, 15, 20], 5) == []\", \"assert filter_less_than([100, 200... | {
"split": "train",
"index": 77982,
"acecode_id": "oss_15685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the daily stock prices of a company. Write a function `max_profit(prices: List[int]) -> int` that calculates the maximum profit that can be obtained by buying and selling the stock at most once. If it is not possible to make any pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([3, 2, 6, 5, 0, 3]) == 4\", \"assert max_profit([1, 2]) == 1\", ... | {
"split": "train",
"index": 77983,
"acecode_id": "oss_3920",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a value from a given dictionary by its key. The function should return the value as a string, and if the key does not exist in the dictionary, it should raise a KeyError with a message indicating that the required varia... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_value_as_string('name', {'name': 'Alice'}) == 'Alice'\", \"assert get_value_as_string('age', {'age': 30}) == '30'\", \"assert get_value_as_string('city', {'city': 'New York'}) == 'New York'\", \"assert get_value_as_string('country', {'country': 'USA'}) =... | {
"split": "train",
"index": 77984,
"acecode_id": "bigcode_python_fns_27783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of object information, implement a function that generates a formatted string for each object. Each object is represented as a list containing six elements: a string for the classification (e.g., 'cat'), two float values representing the upper left coordinates of a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_object_strings([['cat', 0.1, 0.2, 0.4, 0.5, 0.95], ['dog', 0.2, 0.3, 0.5, 0.6, 0.85]]) == ['cat (95%)', 'dog (85%)']\", \"assert generate_object_strings([['chair', 0.0, 0.0, 1.0, 1.0, 0.5]]) == ['chair (50%)']\", \"assert generate_object_strings([['... | {
"split": "train",
"index": 77985,
"acecode_id": "bigcode_python_fns_35699",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of organization names and their display names. The function should return a list of unique organization IDs derived from the organization names. Each organization ID is extracted by removing all non-digit charact... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_organizations([{'name': 'org-123', 'displayName': 'Organization One'}, {'name': 'org-456', 'displayName': 'Organization Two'}]) == ['123', '456']\", \"assert process_organizations([{'name': 'org-001', 'displayName': 'Org A'}, {'name': 'org-002', 'dis... | {
"split": "train",
"index": 77986,
"acecode_id": "bigcode_python_fns_29177",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a directed weighted graph with N nodes represented by an adjacency matrix dp, where dp[i][j] represents the weight of the edge from node i to node j. If there is no edge from node i to node j, dp[i][j] is set to infinity. Additionally, the diagonal elements dp[i][... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_adjacency_matrix([[0, 1], [float('inf'), 0]], 2) == [[0, 1], [float('inf'), 0]]\", \"assert update_adjacency_matrix([[0, 2, float('inf')], [float('inf'), 0, 3], [float('inf'), float('inf'), 0]], 3) == [[0, 2, 5], [float('inf'), 0, 3], [float('inf'), f... | {
"split": "train",
"index": 77987,
"acecode_id": "oss_20842",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps, each representing the number of seconds since the epoch. Your task is to create a function `get_most_recent_timestamp(timestamps: List[int]) -> str` that returns the most recent timestamp formatted as 'YYYY-MM-DD HH:MM:SS'. If the input list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_most_recent_timestamp([1609459200, 1612137600]) == '2021-02-01 00:00:00'\", \"assert get_most_recent_timestamp([1622505600, 1625097600, 1627689600]) == '2021-07-31 00:00:00'\", \"assert get_most_recent_timestamp([1577836800]) == '2020-01-01 00:00:00'\", ... | {
"split": "train",
"index": 77988,
"acecode_id": "oss_7506",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of integers and a target integer. Your function should return a list of all unique pairs of integers from the input list that sum up to the target integer. Each pair should be returned as a tuple in ascending order. The i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pairs_with_sum([1, 2, 3, 4, 5], 10) == []\", \"assert find_pairs_with_sum([1, 1, 2, 2, 3], 4) == [(1, 3), (2, 2)]\", \"assert find_pairs_with_sum([0, 0, 0, 0], 0) == [(0, 0)]\", \"assert find_pairs_with_sum([], 5) == []\", \"assert find_pairs_with_sum([... | {
"split": "train",
"index": 77989,
"acecode_id": "bigcode_python_fns_30076",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a binary string, convert it to its hexadecimal representation. The input will be a string consisting solely of '0's and '1's, representing a binary number. Your task is to implement a function that takes this binary string as input and returns its hexadecimal representati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bin_to_hex('1010') == 'a'\", \"assert bin_to_hex('1111') == 'f'\", \"assert bin_to_hex('100000') == '20'\", \"assert bin_to_hex('0') == '0'\", \"assert bin_to_hex('0000') == '0'\", \"assert bin_to_hex('1111111111111111') == 'ffff'\", \"assert bin_to_hex('111... | {
"split": "train",
"index": 77990,
"acecode_id": "bigcode_python_fns_439",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_customer_info(customer_id: int) -> dict` that takes a customer's ID as input and returns a dictionary containing the customer's information. If the customer ID does not exist, return a dictionary with a message indicating that no customer was found. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_customer_info(1) == {'customer': {'id': 1, 'name': 'Alice'}}\", \"assert get_customer_info(2) == {'customer': {'id': 2, 'name': 'Bob'}}\", \"assert get_customer_info(4) == {'message': 'No customer found!'}\", \"assert get_customer_info(6) == {'message': ... | {
"split": "train",
"index": 77991,
"acecode_id": "evol_7209",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing role-based access control (RBAC) in a web application. The RBAC system is enabled through a boolean variable `rbac_authentication_enabled`. When `rbac_authentication_enabled` is set to `True`, the application should enforce RBAC rules for user a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_access('admin', 'any_resource') == True\", \"assert check_access('manager', 'reports') == True\", \"assert check_access('manager', 'dashboard') == True\", \"assert check_access('manager', 'profile') == False\", \"assert check_access('employee', 'dashbo... | {
"split": "train",
"index": 77992,
"acecode_id": "oss_2738",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that translocates all occurrences of the integer zero and its equivalents (like '0', '0.0', and objects with an is_zero() method returning True) to the end of a designated list. This function should also handle nested lists, maintaining the sequential o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert zero_to_end([1, 0, 2, 0, 3]) == [1, 2, 3, 0, 0]\", \"assert zero_to_end([0, 0, 0]) == [0, 0, 0]\", \"assert zero_to_end([]) == []\", \"assert zero_to_end(['0', 1, '2', 0]) == [1, '2', '0', 0]\", \"assert zero_to_end([{0: 1}, {0: 0}, 2]) == [{0: 1}, {0: 0}, 2... | {
"split": "train",
"index": 77993,
"acecode_id": "evol_14935",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a function `capitalize_first_and_last(s: str) -> str` that takes a string `s` as input and returns a new string where the first and last letters of each word are capitalized, while all other characters in the word are converted to lowercase. Words are defined as sequences... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert capitalize_first_and_last('hello world') == 'HellO WorlD'\", \"assert capitalize_first_and_last('a b c') == 'A B C'\", \"assert capitalize_first_and_last('Python programming') == 'PythoN ProgramminG'\", \"assert capitalize_first_and_last('test case') == 'Tes... | {
"split": "train",
"index": 77994,
"acecode_id": "evol_20384",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given an integer value, implement a function that returns a string indicating the CSS property for text color. The function should return 'color: red' if the integer is negative, and 'color: black' if the integer is zero or positive. Your function should handle any integer inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert color_negative_red(-5) == 'color: red'\", \"assert color_negative_red(0) == 'color: black'\", \"assert color_negative_red(3) == 'color: black'\", \"assert color_negative_red(-1) == 'color: red'\", \"assert color_negative_red(10) == 'color: black'\", \"assert... | {
"split": "train",
"index": 77995,
"acecode_id": "bigcode_python_fns_29679",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps in seconds since the Unix epoch (January 1, 1970). Write a function `get_unix_timestamp_info(timestamps: List[int], index: int) -> int` that returns the timestamp at the given index rounded to the nearest integer. If the index is out of bounds... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unix_timestamp_info([1599832400, 1599832405, 1599832410], 1) == 1599832405\", \"assert get_unix_timestamp_info([1599832400, 1599832405, 1599832410], 0) == 1599832400\", \"assert get_unix_timestamp_info([1599832400, 1599832405, 1599832410], -1) == 1599832... | {
"split": "train",
"index": 77996,
"acecode_id": "bigcode_python_fns_3138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an angle in radians, write a function `rot_x` that computes the rotation matrix around the X-axis. The rotation matrix should be returned as a 2D tuple of shape (3, 3). The rotation matrix for an angle theta can be defined as follows: \n\n$$\nR_x(θ) = \\begin{bmatrix} \n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rot_x(0) == ((1, 0, 0), (0, 1, 0), (0, 0, 1))\", \"assert rot_x(1) == ((1, 0, 0), (0, 0.5403023058681398, -0.8414709848078965), (0, 0.8414709848078965, 0.5403023058681398))\", \"assert rot_x(-1) == ((1, 0, 0), (0, 0.5403023058681398, 0.8414709848078965), (0,... | {
"split": "train",
"index": 77997,
"acecode_id": "bigcode_python_fns_18877",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of tuples containing strings and integers. Each tuple represents a file name and a version number. The function should return a dictionary where the keys are the file names and the values are lists of version num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_files([('report', 3), ('document', 5), ('report', 1), ('document', 2)]) == {'report': [3, 1], 'document': [5, 2]}\", \"assert process_files([('fileA', 1), ('fileB', 2), ('fileA', 3)]) == {'fileA': [3, 1], 'fileB': [2]}\", \"assert process_files([('te... | {
"split": "train",
"index": 77998,
"acecode_id": "oss_3854",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 's' and two lists of distinct words 'words1' and 'words2', implement a function that replaces all occurrences of elements in 'words1' with the corresponding elements in 'words2' within the string 's'. The words in 'words1' can be single words or phrases. Your fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_replace_context('The quick brown fox jumps over the late evening star.', ['quick', 'fox', 'star'], ['fast', 'wolf', 'moon']) == 'The fast brown wolf jumps over the late evening moon.'\", \"assert search_replace_context('The sun rises in the east.', ['... | {
"split": "train",
"index": 77999,
"acecode_id": "evol_18181",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.