data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a string representing the name of a period type. Your task is to implement a function that converts the period type name to a corresponding enum value. Your function should return the enum value if the provided name matches one of the predefined period types. If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert from_period_type_name('daily') == 'daily'\", \"assert from_period_type_name('weekly') == 'weekly'\", \"assert from_period_type_name('monthly') == 'monthly'\", \"assert from_period_type_name('quarterly') == 'quarterly'\", \"assert from_period_type_name('yearl...
{ "split": "train", "index": 75600, "acecode_id": "bigcode_python_fns_28645", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with processing experimental data for a materials science project. Write a function `process_experiment_data` that takes the following parameters: \n- `block` (dict): A dictionary containing key-value pairs representing crucial experimental metadata. The dictiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_experiment_data({'_sample_material_id': 'M1', '_units_loading': 'g', '_units_pressure': 'atm', '_exptl_adsorptive': 'Nitrogen', '_exptl_temperature': 77}, [1, 2], [0.1, 0.2], [1, 2], [0.05, 0.1]) == {'material_id': 'M1', 'adsorption_plot': ([1, 2], [...
{ "split": "train", "index": 75601, "acecode_id": "oss_32943", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `intricate_sort` that takes a string as input and returns a new string where the characters of each word are sorted in ascending ASCII value sequence, regardless of case sensitivity. The words in the string should maintain their original order and spacing. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intricate_sort('Hi') == 'Hi'\", \"assert intricate_sort('hello') == 'ehllo'\", \"assert intricate_sort('Hello World!!!') == 'Hello !!!Wdlor'\", \"assert intricate_sort('abc ABC 123') == 'abc ABC 123'\", \"assert intricate_sort('1a 2b 3c') == '1a 2b 3c'\", \"...
{ "split": "train", "index": 75602, "acecode_id": "evol_16637", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a nearest neighbor search algorithm for a given set of points in a two-dimensional space. The algorithm should efficiently find the nearest neighbor for each point in the set and return the distances between each point and its nearest neighbor. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nearest_neighbors([(1, 2), (3, 4), (5, 6), (7, 8)]) == [2.8284271247461903, 2.8284271247461903, 2.8284271247461903, 2.8284271247461903]\", \"assert nearest_neighbors([(0, 0), (1, 1), (2, 2)]) == [1.4142135623730951, 1.4142135623730951, 1.4142135623730951]\",...
{ "split": "train", "index": 75603, "acecode_id": "oss_22411", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of case IDs, each representing a unique case in a project. Your task is to implement a function that takes this list of case IDs and returns a list of case objects where each case object is a dictionary containing the case ID and a simple description indica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_case_objects([1, 2, 3]) == [{'id': 1, 'description': 'This is case number 1'}, {'id': 2, 'description': 'This is case number 2'}, {'id': 3, 'description': 'This is case number 3'}]\", \"assert get_case_objects([5, 10, 15]) == [{'id': 5, 'description': 'T...
{ "split": "train", "index": 75604, "acecode_id": "bigcode_python_fns_1725", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 1D list of integers `input`, a list of indices `index`, and a list of source values `src`, implement a function `scatter_add(input: List[int], index: List[int], src: List[int]) -> List[int]` that performs a scatter-add operation. This means that for each index in `index...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scatter_add([1, 2, 3], [0, 1], [10, 20]) == [11, 22, 3]\", \"assert scatter_add([5, 5, 5], [2, 2], [1, 2]) == [5, 5, 8]\", \"assert scatter_add([0, 0, 0, 0], [0, 1, 2, 3], [1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert scatter_add([7], [0], [3]) == [10]\", \"asse...
{ "split": "train", "index": 75605, "acecode_id": "bigcode_python_fns_44001", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function, `process_request(request_params)`, that processes a dictionary of request parameters as follows: If the parameter 'main_content_type' is set to 'time', the function should include the current time in seconds since the epoch in the re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_request({'path': 'home'}) == {'imported_request_path': 'home'}\", \"assert process_request({'imported': 'data'}) == {'imported_request_type': 'data'}\", \"assert process_request({'path': '', 'imported': 'data'}) == {'imported_request_type': 'data'}\"...
{ "split": "train", "index": 75606, "acecode_id": "oss_10709", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `guess_os(file_type: str) -> str` that determines the operating system based on the given file type. The function should return 'macos' if the file type is 'MACHO', 'linux' if the file type is 'ELF', 'AOUT', or 'COFF', 'windows' if the fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert guess_os('MACHO') == 'macos'\", \"assert guess_os('ELF') == 'linux'\", \"assert guess_os('AOUT') == 'linux'\", \"assert guess_os('COFF') == 'linux'\", \"assert guess_os('PE') == 'windows'\", \"assert guess_os('EXE') == 'windows'\", \"assert guess_os('EXE_old...
{ "split": "train", "index": 75607, "acecode_id": "bigcode_python_fns_24302", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that checks whether the list is in strictly increasing order. The function should return True if each element is greater than the previous element, and False otherwise. For example, for the input [3, 5, 7], the output should be Tru...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_progression([1, 2, 3, 4, 5]) == True\", \"assert check_progression([1, 1, 2, 3]) == False\", \"assert check_progression([5, 6, 7, 8]) == True\", \"assert check_progression([10, 9, 8, 7]) == False\", \"assert check_progression([1]) == True\", \"assert c...
{ "split": "train", "index": 75608, "acecode_id": "evol_20110", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates simple HTTP request handling. The function should accept a request method and a path, and return a specific response based on the request type and path. Implement the following logic in the function: 1. If the request metho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert http_request_handler('GET', '/hello') == 'Hello, World!'\", \"assert http_request_handler('POST', '/greet', {'name': 'Alice'}) == 'Hello, Alice!'\", \"assert http_request_handler('POST', '/greet', {'name': 'Bob'}) == 'Hello, Bob!'\", \"assert http_request_ha...
{ "split": "train", "index": 75609, "acecode_id": "oss_4074", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing stock prices for a series of days. Write a function `max_profit(prices: List[int]) -> int` that returns the maximum profit you can achieve from buying and selling one share of stock. You need to buy the stock on one day and sell it ...
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([2, 4, 1]) == 2\", \"assert max_profit([1]) == 0\", \"assert max_profit([]) == 0\", \"assert max_profit([3, 2, 6, 5, 0, 3]) == 4\", \"assert max_profit([1...
{ "split": "train", "index": 75610, "acecode_id": "bigcode_python_fns_3581", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of integers and returns the sum of all even numbers from that list. Your function should take a single parameter, which is a list of integers, and return a single integer that represents the sum of the even numbe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_numbers([10, 15, 20, 25]) == 30\", \"assert sum_of_even_numbers([-2, -4, 5, 7]) == -6\", \"assert sum_of_even_numbers([0, 1, 2, 3]) == 2\", \"assert sum_of_even_numbers([]) == 0\", \"assert su...
{ "split": "train", "index": 75611, "acecode_id": "oss_1916", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function `sort_alphanumerically` that sorts the strings in alphanumeric order. Alphanumeric sorting means that when comparing strings, numbers within those strings should be treated based on their numerical value rather than their lexicograp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_alphanumerically(['a10', 'a2', 'a1']) == ['a1', 'a2', 'a10']\", \"assert sort_alphanumerically(['b3', 'b1', 'b2']) == ['b1', 'b2', 'b3']\", \"assert sort_alphanumerically(['c20', 'c3', 'c1', 'c12']) == ['c1', 'c3', 'c12', 'c20']\", \"assert sort_alphanu...
{ "split": "train", "index": 75612, "acecode_id": "oss_24348", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of VLAN group dictionaries and returns a new list of VLAN group dictionaries with a specific format. Each input VLAN group dictionary contains the keys 'name', 'site', and 'state'. Your function should create a new dicti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_vlan_groups([{'name': 'VLAN 10', 'site': {'name': 'Site A'}, 'state': 'active'}]) == [{'name': 'VLAN 10', 'site': 'Site A', 'state': 'present'}]\", \"assert format_vlan_groups([{'name': 'VLAN 20', 'site': None, 'state': 'inactive'}]) == [{'name': 'VLA...
{ "split": "train", "index": 75613, "acecode_id": "bigcode_python_fns_17869", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a dictionary of contexts based on type codes. The function should have two main operations: `update_context(type_code: Union[str, Enum], context: dict) -> None` which updates the context for the given type code, and `get_cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_context('user') == {}\", \"assert get_context('guest') == {}\", \"assert get_context('manager') == {}\"]}" }
{ "split": "train", "index": 75614, "acecode_id": "oss_32875", "num_tests": 3 }
acecode
[ { "role": "user", "content": "Given a list of lists, where each inner list contains floating-point numbers, implement a function `find_median_of_medians(array_of_arrays)` that calculates and returns the median of the medians of the inner lists. The function should handle inputs of varying lengths and includ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_median_of_medians([[1.0, 3.0], [2.0, 4.0], [5.0]]) == 3.0\", \"assert find_median_of_medians([[1.0], [2.0], [3.0]]) == 2.0\", \"assert find_median_of_medians([[], [1.0, 2.0]]) == None\", \"assert find_median_of_medians([[1.0, 2.0], 'not a list']) == Non...
{ "split": "train", "index": 75615, "acecode_id": "evol_11790", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a command line interface parser for a dataset processing tool. The function `parse_arguments` should accept the following parameters: `bids_dir` (a string representing the root folder of a BIDS dataset), `ou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments('/path/to/bids', '/path/to/output', ['participant']) == {'bids_dir': '/path/to/bids', 'output_dir': '/path/to/output', 'analysis_level': ['participant'], 'participant_label': None, 'task': None, 'dir': None, 'acq': None, 'run': None, 'suffix'...
{ "split": "train", "index": 75616, "acecode_id": "bigcode_python_fns_9366", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple monitoring service that checks the heartbeat of a system. Implement a function `check_heartbeat` that takes a configuration dictionary and performs the following actions: 1. The configuration dictionary contains three keys: 'config', 'messa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_heartbeat({'config': 'config', 'messages': 'messages', 'freq': 5}) == 'Heartbeat is stable.'\", \"assert check_heartbeat({'config': 'config', 'messages': 'messages', 'freq': 10}) == 'Heartbeat is stable.'\", \"assert check_heartbeat({'config': 'config'...
{ "split": "train", "index": 75617, "acecode_id": "bigcode_python_fns_43671", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes an integer n as input and returns a list containing the squares of all integers from 1 to n (inclusive).\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_numbers(1) == [1]\", \"assert square_numbers(2) == [1, 4]\", \"assert square_numbers(3) == [1, 4, 9]\", \"assert square_numbers(4) == [1, 4, 9, 16]\", \"assert square_numbers(5) == [1, 4, 9, 16, 25]\", \"assert square_numbers(6) == [1, 4, 9, 16, 25, 3...
{ "split": "train", "index": 75618, "acecode_id": "evol_28383", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a URL that needs to be validated. Write a function `is_valid_url(url: str) -> bool` that checks if the given URL is valid according to the following criteria: 1. It must start with 'http://' or 'https://'. 2. It must contain a domain name tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_url('http://example.com/path/to/resource') == True\", \"assert is_valid_url('http://example.com') == False\", \"assert is_valid_url('https://example.com/path') == True\", \"assert is_valid_url('ftp://example.com/path') == False\", \"assert is_valid_...
{ "split": "train", "index": 75619, "acecode_id": "bigcode_python_fns_40994", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `primefactors(n)` that takes a positive integer n and returns a dictionary containing all the prime factors of n as keys and their respective powers as values. The algorithm should efficiently find these factors with a time complexity that does not exceed O...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert primefactors(1) == {}\", \"assert primefactors(2) == {2: 1}\", \"assert primefactors(3) == {3: 1}\", \"assert primefactors(4) == {2: 2}\", \"assert primefactors(5) == {5: 1}\", \"assert primefactors(6) == {2: 1, 3: 1}\", \"assert primefactors(12) == {2: 2, 3...
{ "split": "train", "index": 75620, "acecode_id": "evol_11584", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a smart thermostat device that can be set to different modes for energy savings. Implement a function `set_thermostat_mode(device: str, mode: str) -> str` that takes in the name of the device and the desired mode, and returns a string confirming the mode has been ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_thermostat_mode('Thermostat1', 'ECO') == 'Device set to ECO mode'\", \"assert set_thermostat_mode('Thermostat1', 'HEAT') == 'Device set to HEAT mode'\", \"assert set_thermostat_mode('Thermostat1', 'COOL') == 'Device set to COOL mode'\", \"assert set_ther...
{ "split": "train", "index": 75621, "acecode_id": "bigcode_python_fns_9873", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a Python function that identifies the optimal rightmost point of removal for a specific value from a list, while maintaining the overall sorted sequence. The function should handle various data types such as integers, floats, strings, tuples, and lists of lists. It shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_removal_point([5, 4, 3, 2, 1], 3) == 2\", \"assert find_removal_point([10, 20, 30, 40, 50], 25) == 2\", \"assert find_removal_point([2, 4, 6, 8], 10) == 4\", \"assert find_removal_point(['a', 'b', 'c'], 'd') == 3\", \"assert find_removal_point([3, 2, 1]...
{ "split": "train", "index": 75622, "acecode_id": "evol_8515", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a string that represents a command to set the replay gain mode for audio playback. The command can be either 'replay_gain_mode off', 'replay_gain_mode track', or 'replay_gain_mode album'. Your task is to implement a function that takes this command as input and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_replay_gain_mode('replay_gain_mode off') == 'off'\", \"assert set_replay_gain_mode('replay_gain_mode track') == 'track'\", \"assert set_replay_gain_mode('replay_gain_mode album') == 'album'\", \"assert set_replay_gain_mode('replay_gain_mode invalid') == ...
{ "split": "train", "index": 75623, "acecode_id": "bigcode_python_fns_47341", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a date in a human-readable format (e.g., 'Monday, April 7th, 2020'), transform it into the standardized ISO 8601 format (YYYY-MM-DD). The input date may contain ordinal suffixes (st, nd, rd, th) which should be removed before processing. Implement a function `convert_to_I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_ISO('Monday, April 7th, 2020') == '2020-04-07'\", \"assert convert_to_ISO('Wednesday, March 3rd, 2021') == '2021-03-03'\", \"assert convert_to_ISO('Friday, July 30th, 2021') == '2021-07-30'\", \"assert convert_to_ISO('Tuesday, December 1st, 2020')...
{ "split": "train", "index": 75624, "acecode_id": "evol_16580", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `u` and `h`, you need to implement a function `convolve_lti(u: List[int], h: List[int]) -> List[int]` that performs a convolution of the two lists. The convolution operation is defined as follows: for each index `n`, the output value at that index i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convolve_lti([1, 2, 3], [0, 1]) == [0, 1, 2, 3]\", \"assert convolve_lti([1, 2], [1, 2]) == [1, 4, 4]\", \"assert convolve_lti([0], [0]) == [0]\", \"assert convolve_lti([1, 1, 1], [1]) == [1, 1, 1]\", \"assert convolve_lti([1], [1, 1]) == [1, 1]\", \"assert ...
{ "split": "train", "index": 75625, "acecode_id": "bigcode_python_fns_23293", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Create a function that constructs a dictionary from two lists: one containing keys and the other containing corresponding values. The function should take two arguments, `list_keys` and `list_vals`, and return a dictionary where each key from `list_keys` maps to the correspondi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_dict(['a', 'b', 'c'], [1, 2, 3]) == {'a': 1, 'b': 2, 'c': 3}\", \"assert build_dict(['x', 'y'], [10, 20]) == {'x': 10, 'y': 20}\", \"assert build_dict([], []) == {}\", \"assert build_dict(['key1'], [100]) == {'key1': 100}\", \"assert build_dict(['a', '...
{ "split": "train", "index": 75626, "acecode_id": "evol_31335", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a string representing a file name and returns a formatted string indicating whether the file is a valid 'dbf' file or a 'zip' folder containing 'dbf' files. The input will be either 'CADMUN' or 'rl_municip_regsaud'. For 'CADMUN'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_format('CADMUN') == 'dbf file: CADMUN.DBF'\", \"assert file_format('rl_municip_regsaud') == 'zip folder: base_territorial.zip containing dbf file: rl_municip_regsaud.dbf'\", \"assert file_format('INVALID_NAME') == 'Invalid file name'\", \"assert file_fo...
{ "split": "train", "index": 75627, "acecode_id": "bigcode_python_fns_32842", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the command-line interface (CLI) tool for a simulation framework called \"vivarium.\" The function should accept a command as a string and return the corresponding output message based on the command provided. The supported...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_cli('run model.json') == 'Running simulation for model.json.'\", \"assert simulate_cli('test') == 'Running example simulation for installation test.'\", \"assert simulate_cli('run simulation.yaml') == 'Running simulation for simulation.yaml.'\", \"a...
{ "split": "train", "index": 75628, "acecode_id": "oss_9485", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing firmware data for a set of devices. Given a list of tuples representing device types and their corresponding firmware versions, your goal is to implement a function that calculates the average firmware version for a specified device type. If the de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_firmware_version('DeviceA', [('DeviceA', 1.0), ('DeviceA', 1.2), ('DeviceB', 2.1), ('DeviceB', 2.0)]) == 1.1\", \"assert average_firmware_version('DeviceB', [('DeviceA', 1.0), ('DeviceA', 1.2), ('DeviceB', 2.1), ('DeviceB', 2.0)]) == 2.05\", \"assert...
{ "split": "train", "index": 75629, "acecode_id": "oss_10357", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves a payment nonce for a PayPal payment. The function should accept two input parameters: a consent code and an access token, both of which are strings. Your function should simulate the retrieval of a payment nonce by usi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_payment_nonce('consent123', 'tokenABC') == 'nonceXYZ'\", \"assert get_payment_nonce('consent456', 'tokenDEF') == 'nonceLMN'\", \"assert get_payment_nonce('invalidConsent', 'tokenABC') == ''\", \"assert get_payment_nonce('consent123', 'invalidToken') == '...
{ "split": "train", "index": 75630, "acecode_id": "oss_34184", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_movie` that takes a user and an optional set of parameters to create a movie. The function should accept the following parameters: `title` (string), `duration` (in hours and minutes as a tuple), and `price` (float). If any of thes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_movie('user1') == {'title': 'A Walk to Remember', 'duration': (2, 15), 'price': 8.99}\", \"assert create_movie('user2', title='Inception') == {'title': 'Inception', 'duration': (2, 15), 'price': 8.99}\", \"assert create_movie('user3', duration=(1, 30)...
{ "split": "train", "index": 75631, "acecode_id": "bigcode_python_fns_8593", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `calculate_standard_deviation(numbers: List[float]) -> float` that calculates the standard deviation of a given list of numbers. Your implementation should not use any libraries such as numpy. The function should return the standard deviation rounded to three d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_standard_deviation([1.5, 2.5, 3.5, 4.5]) == 1.118\", \"assert calculate_standard_deviation([-1, 0, 1]) == 0.816\", \"assert calculate_standard_deviation([0]) == 0.000\", \"assert calculate_standard_deviation([5, 5, 5, 5]) == 0.000\", \"assert calcu...
{ "split": "train", "index": 75632, "acecode_id": "evol_16241", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates rendering a given name on a theoretical display using specified coordinates. The function should take in a name string, the x-coordinate, and the y-coordinate where the name should be rendered. The function should return a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert render_name('Alice', 5, 10) == 'Rendering name: Alice at coordinates (5, 10)'\", \"assert render_name('Bob', 0, 0) == 'Rendering name: Bob at coordinates (0, 0)'\", \"assert render_name('Charlie', 100, 50) == 'Rendering name: Charlie at coordinates (100, 50)...
{ "split": "train", "index": 75633, "acecode_id": "oss_26502", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s, determine if it consists of exactly four words and has a total length of 7 characters. A word is defined as a sequence of alphabetic characters (a-z, A-Z) separated by spaces. The function should return True if both conditions are met; otherwise, return False....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check('a b c d') == True\", \"assert check('abcd efg') == False\", \"assert check('a b c d e') == False\", \"assert check('a b c') == False\", \"assert check('a b c d e f g') == False\", \"assert check('abc defg') == False\", \"assert check('aa b b') == Fals...
{ "split": "train", "index": 75634, "acecode_id": "bigcode_python_fns_10171", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a distribution model for a one-dimensional space. Implement a function `simulate_distribution(n_dists: int, units_in_dist: int, unit_size: int, rounds: int) -> float` that takes the following parameters: \n- `n_dists` (1 <= n_dists <= 1000): the n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_distribution(3, 3, 1, 5) == 1.8\", \"assert simulate_distribution(9, 5, 10, 5) == 90.0\", \"assert simulate_distribution(27, 9, 100, 10) == 2430.0\", \"assert simulate_distribution(1, 1, 1, 1) == 1.0\", \"assert simulate_distribution(1000, 100, 1000...
{ "split": "train", "index": 75635, "acecode_id": "bigcode_python_fns_35521", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers and returns a new list containing only the even integers from the original list. The function should preserve the order of the even integers as they appear in the input list. Implement the function `fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([7, 8, 9, 10]) == [8, 10]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, ...
{ "split": "train", "index": 75636, "acecode_id": "oss_16120", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple represents a 2D point in the form (x, y). Your task is to implement a function that calculates the Euclidean distance between each pair of points and returns a list of distances rounded to two decimal places. Create a function `c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distances([(0, 0), (3, 4)]) == [5.0]\", \"assert calculate_distances([(1, 1), (1, 1), (1, 1)]) == [0.0, 0.0, 0.0]\", \"assert calculate_distances([(1, 1)]) == []\", \"assert calculate_distances([(2, 2), (3, 3), (5, 5)]) == [1.41, 4.24, 2.83]\", \"a...
{ "split": "train", "index": 75637, "acecode_id": "oss_35490", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a number in the form of an integer or a floating-point, write a function that formats the number by separating the thousands with spaces and rounding the decimal part to two decimal places if it exists. The function should also accept an optional parameter 'precision' whi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_number(1234.5678) == '1 234.57'\", \"assert format_number(1234.5678, precision=4) == '1 234.5678'\", \"assert format_number(1234.0, precision=4) == '1 234.0000'\", \"assert format_number(1234.0, precision=0) == '1 234'\", \"assert format_number(1000.9...
{ "split": "train", "index": 75638, "acecode_id": "bigcode_python_fns_6201", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates version numbers according to the Semantic Versioning (SemVer) specification. Semantic Versioning uses a three-part version number format: MAJOR.MINOR.PATCH. Each part is a non-negative integer that must follow these ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_semantic_version('1.0.0') == True\", \"assert validate_semantic_version('0.0.1') == True\", \"assert validate_semantic_version('2.10.5') == True\", \"assert validate_semantic_version('3.0.0') == True\", \"assert validate_semantic_version('0.1.0') ==...
{ "split": "train", "index": 75639, "acecode_id": "oss_32106", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_synopsis` that takes a string `text` and an integer `max_words`. The function should return a condensed version of the text that contains at most `max_words`, ensuring that the output does not exceed the specified limit. The output should be a plain s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_synopsis('Artificial Intelligence is a branch of computer science.', 10) == 'Artificial Intelligence is a branch of computer science.'\", \"assert generate_synopsis('Deep learning models are used for various applications.', 5) == 'Deep learning mode...
{ "split": "train", "index": 75640, "acecode_id": "evol_29872", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Create a function \"multiply_unique_integers\" that accepts three unique integers and returns their product. The function should also handle exceptions for non-integer inputs by returning a string message \"All inputs must be integers.\" if the inputs cannot be converted to int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_unique_integers(2, 3, 4) == 24\", \"assert multiply_unique_integers(1, 5, 6) == 30\", \"assert multiply_unique_integers(-1, -2, -3) == -6\", \"assert multiply_unique_integers(0, 2, 3) == 0\", \"assert multiply_unique_integers(10, 5, 1) == 50\", \"as...
{ "split": "train", "index": 75641, "acecode_id": "evol_31620", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of four tuples representing the vertices of a quadrilateral, determine if it is a parallelogram. A quadrilateral is a parallelogram if the lengths of opposite sides are equal. Implement the function `is_parallelogram(vertices)` that takes a list of four tuples `ver...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_parallelogram([(0, 0), (2, 0), (3, 2), (1, 2)]) == True\", \"assert is_parallelogram([(1, 1), (4, 1), (5, 5), (2, 5)]) == True\", \"assert is_parallelogram([(0, 0), (0, 2), (2, 2), (2, 0)]) == True\", \"assert is_parallelogram([(2, 3), (5, 3), (6, 6), (3,...
{ "split": "train", "index": 75642, "acecode_id": "oss_67", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns the string encrypted using the ROT13 cipher. The ROT13 cipher shifts each letter by 13 places in the alphabet, wrapping around if necessary. Non-alphabetical characters should remain unchanged.\nPlease reason step by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rot13('Hello World') == 'Uryyb Jbeyq'\", \"assert rot13('Uryyb Jbeyq') == 'Hello World'\", \"assert rot13('Python Programming!') == 'Clguba Cebtenzzvat!'\", \"assert rot13('This is a test.') == 'Guvf vf n grfg.'\", \"assert rot13('abcdefghijklmnopqrstuvwxyz'...
{ "split": "train", "index": 75643, "acecode_id": "evol_25528", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a dictionary that contains information about multiple frames in a video analysis task. Each frame's data includes the number of true positives, false positives, and false negatives. Your task is to implement a function that calculates the precision and recall from...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_precision_recall({'frame1': {'true_pos': 10, 'false_pos': 5, 'false_neg': 2}}) == (0.6666666666666666, 0.8333333333333334)\", \"assert calc_precision_recall({'frame1': {'true_pos': 0, 'false_pos': 0, 'false_neg': 0}}) == (0.0, 0.0)\", \"assert calc_prec...
{ "split": "train", "index": 75644, "acecode_id": "bigcode_python_fns_26177", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a generator function called `simple_generator` that yields the numbers from 0 up to a specified limit `n` (exclusive). The function should take an integer parameter `n` and yield values starting from 0 to n-1, one at a time, each time it is called. If `n` is less than...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(simple_generator(3)) == [0, 1, 2]\", \"assert list(simple_generator(5)) == [0, 1, 2, 3, 4]\", \"assert list(simple_generator(1)) == [0]\", \"assert list(simple_generator(0)) == []\", \"assert list(simple_generator(-2)) == []\", \"assert list(simple_gene...
{ "split": "train", "index": 75645, "acecode_id": "evol_1846", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of edges represented as tuples of two vertices and a target edge defined by a tuple of two vertices, write a function `find_edge_index(edges: List[Tuple[int, int]], target: Tuple[int, int]) -> int` that returns the index of the target edge in the list. If the targe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_edge_index([(1, 2), (2, 3), (3, 4)], (2, 3)) == 1\", \"assert find_edge_index([(1, 2), (2, 1), (3, 4)], (1, 2)) == 0\", \"assert find_edge_index([(1, 2), (2, 3), (2, 1)], (1, 2)) == 0\", \"assert find_edge_index([(1, 2), (2, 3), (1, 2)], (2, 3)) == 1\",...
{ "split": "train", "index": 75646, "acecode_id": "bigcode_python_fns_23966", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with extracting information from a JSON formatted string that describes a list of targets, each containing a target name and a list of source files. Write a function `extractTargetInfo(jsonData: str) -> List[Tuple[str, int]]` that takes a JSON string `jsonData` a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extractTargetInfo('{\\\"targets\\\":[{\\\"target_name\\\":\\\"lib/daemon\\\",\\\"sources\\\":[\\\"src/daemon.cc\\\"]},{\\\"target_name\\\":\\\"app/main\\\",\\\"sources\\\":[\\\"src/main.cc\\\",\\\"src/helper.cc\\\"]}]}') == [(\\\"lib/daemon\\\", 1), (\\\"app...
{ "split": "train", "index": 75647, "acecode_id": "oss_17053", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes two lists of integers, `a` and `b`, and returns a new list containing the element-wise sum of the two lists. If the lists are of different lengths, you should return a list that is the same length as the shorter list, wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert elementwise_sum([1, 2, 3], [4, 5, 6]) == [5, 7, 9]\", \"assert elementwise_sum([], [4, 5, 6]) == []\", \"assert elementwise_sum([1, 2, 3], []) == []\", \"assert elementwise_sum([1, 2], [4, 5, 6]) == [5, 7]\", \"assert elementwise_sum([1], [4, 5, 6]) == [5]\"...
{ "split": "train", "index": 75648, "acecode_id": "oss_14607", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers `indices` and an integer `size`, write a function `invert_indices` that returns a list of integers representing the indices that are not present in the given list of `indices`, up to the given `size`. The returned list should contain unique values in as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert invert_indices([0, 2, 4], 5) == [1, 3]\", \"assert invert_indices([], 5) == [0, 1, 2, 3, 4]\", \"assert invert_indices([1, 3], 6) == [0, 2, 4, 5]\", \"assert invert_indices([0, 1, 2, 3], 4) == []\", \"assert invert_indices([5, 6, 7], 8) == [0, 1, 2, 3, 4]\",...
{ "split": "train", "index": 75649, "acecode_id": "bigcode_python_fns_17378", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two IP address ranges in CIDR notation. Your task is to determine whether the first IP range is valid. An IP range is considered valid if its prefix length is between 0 and 32, inclusive. Write a function that takes two strings representing the IP ranges and retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_ip_range('192.168.0.0/24', '192.168.0.0/25') == True\", \"assert is_valid_ip_range('10.0.0.0/8', '10.0.0.0/16') == True\", \"assert is_valid_ip_range('172.16.0.0/12', '172.16.0.0/24') == True\", \"assert is_valid_ip_range('192.168.1.0/32', '192.168....
{ "split": "train", "index": 75650, "acecode_id": "bigcode_python_fns_37740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of eight distinct integers, implement a function `find_smallest_prime(numbers: List[int]) -> int` that returns the smallest prime number from the list. If no prime number exists, return -1.\nPlease reason step by step, then write a self-contained Python solution. G...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_smallest_prime([12, 27, 9, 11, 15, 3, 20, 5]) == 3\", \"assert find_smallest_prime([10, 14, 15, 20, 21, 22, 24, 25]) == -1\", \"assert find_smallest_prime([7, 8, 9, 10, 11, 12, 13, 14]) == 7\", \"assert find_smallest_prime([15, 18, 22, 24, 26, 28, 29, 3...
{ "split": "train", "index": 75651, "acecode_id": "evol_29886", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a user can edit a specific article based on its locked status and the user's role. The function should take two parameters: a boolean `is_locked` indicating whether the article is locked, and a boolean `is_staff` indica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_edit_article(False, False) == 'Edit allowed'\", \"assert can_edit_article(False, True) == 'Edit allowed'\", \"assert can_edit_article(True, False) == 'Edit forbidden'\", \"assert can_edit_article(True, True) == 'Edit allowed'\", \"assert can_edit_article...
{ "split": "train", "index": 75652, "acecode_id": "oss_630", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing the distribution of ratings from a list of products. Each product has a name and a rating. Your goal is to write a function that takes in a list of tuples, where each tuple contains a product name and its rating, and returns a dictionary that repre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rating_distribution([('Product A', 5), ('Product B', 4), ('Product C', 5)]) == {5: 2, 4: 1}\", \"assert rating_distribution([('Product A', 1), ('Product B', 2), ('Product C', 3), ('Product D', 1)]) == {1: 2, 2: 1, 3: 1}\", \"assert rating_distribution([('Pro...
{ "split": "train", "index": 75653, "acecode_id": "oss_28065", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sentence and a character, determine if the character appears more than once in the sentence. If it does, return the list of indices where the character appears. If it appears only once or not at all, return 'Appears once or not at all'. Write a function `find_char(sente...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_char('Hello World!', 'l') == [2, 3, 9]\", \"assert find_char('Test case with no repeating characters', 'z') == 'Appears once or not at all'\", \"assert find_char('No repeated characters here!', 'x') == 'Appears once or not at all'\", \"assert find_char(...
{ "split": "train", "index": 75654, "acecode_id": "evol_27822", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with validating article titles for a specific website. Write a function `validate_article_title(website: str, article_title: str) -> bool` that checks whether the given article title meets the following criteria: \n\n1. The article title must contain at least one...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_article_title('BuzzFeed', 'Breaking news on technology') == False\", \"assert validate_article_title('BuzzFeed', 'A guide for startups') == False\", \"assert validate_article_title('TechCrunch', 'Top 10 hacks to improve your code') == False\", \"ass...
{ "split": "train", "index": 75655, "acecode_id": "bigcode_python_fns_30179", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `insert_sorted(lst: List[int], element: int) -> List[int]` that takes a list of integers `lst` (which may not be sorted) and an integer `element`. The function should insert `element` into `lst` such that the resulting list remains sorted in ascending order...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_sorted([1, 2, 4, 5], 3) == [1, 2, 3, 4, 5]\", \"assert insert_sorted([1, 2, 2, 4], 2) == [1, 2, 2, 2, 4]\", \"assert insert_sorted([], 5) == [5]\", \"assert insert_sorted([1, 3, 4, 5], 2) == [1, 2, 3, 4, 5]\", \"assert insert_sorted([10, 20, 30], 25) ...
{ "split": "train", "index": 75656, "acecode_id": "evol_14252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines the majority class in a binary classification problem given a list of class labels. The input will be a list of integers where each integer represents a class label (0 or 1). Your function should return the majority cl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert majority_class([1, 1, 0, 0, 1]) == 1\", \"assert majority_class([0, 0, 1, 1]) == 0\", \"assert majority_class([1, 0, 1, 0, 0]) == 0\", \"assert majority_class([1, 1, 1]) == 1\", \"assert majority_class([0]) == 0\", \"assert majority_class([1]) == 1\", \"asse...
{ "split": "train", "index": 75657, "acecode_id": "oss_21674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that uses recursion to generate a list of strings. The function should print 'hello' followed by the current count of the number of times it has printed for the first 5 times, and after that it should print 'world' followed by the current count for the next 5 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_strings(5) == ['hello 1', 'hello 2', 'hello 3', 'hello 4', 'hello 5']\", \"assert generate_strings(0) == []\", \"assert generate_strings(1) == ['hello 1']\", \"assert generate_strings(2) == ['hello 1', 'hello 2']\", \"assert generate_strings(3) == [...
{ "split": "train", "index": 75658, "acecode_id": "evol_15528", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function `find_xy_words(text: str) -> List[str]` that takes a string as input and returns a list of words that contain the letters 'x' and 'y' in that order, regardless of what characters are between them. A word is defined as any sequence of alphanumeric characters. Wo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_xy_words('This text has no matching words.') == []\", \"assert find_xy_words('xy is a combination of letters') == ['xy']\", \"assert find_xy_words('There are examples like xylophone and extreme.') == ['xylophone']\", \"assert find_xy_words('An x and y i...
{ "split": "train", "index": 75659, "acecode_id": "evol_6916", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function that evaluates a given arithmetic expression containing the operators +, -, *, and /. The expression will contain at least three operands and two operators and may include whitespace and parentheses. Your function should return the result of the evaluation....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_expression('(2 + 3) * 4') == 20\", \"assert calc_expression('10 / 2 + 5') == 10.0\", \"assert calc_expression('5 * (3 + 2)') == 25\", \"assert calc_expression('100 - (50 / 2)') == 75.0\", \"assert calc_expression('2 + 3 * 4 - 5') == 9\", \"assert calc_e...
{ "split": "train", "index": 75660, "acecode_id": "evol_7085", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of 3D coordinates representing points in space. Your task is to implement a function `add_foci(coords: List[List[int]], color: str) -> List[str]` that takes in a list of coordinates and a color string. The function should return a list of strings where each...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_foci([[0, 0, 0]], 'blue') == ['Point at (0, 0, 0) added with color blue']\", \"assert add_foci([[1, 2, 3], [4, 5, 6]], 'red') == ['Point at (1, 2, 3) added with color red', 'Point at (4, 5, 6) added with color red']\", \"assert add_foci([[10, 10, 10], [-...
{ "split": "train", "index": 75661, "acecode_id": "bigcode_python_fns_10993", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of values that may contain various data types. Your task is to implement a function that processes this list and returns a new list containing only the string representations of the values that are of type string. If a value is not a string, convert it into...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_values(['apple', 'banana', 42, None]) == ['apple', 'banana', '42', 'None']\", \"assert process_values([]) == []\", \"assert process_values(['hello', 123, True]) == ['hello', '123', 'True']\", \"assert process_values(['single string']) == ['single str...
{ "split": "train", "index": 75662, "acecode_id": "bigcode_python_fns_9317", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that applies a given transformation to a list of integers. The function should take the list of integers, the transformation function to be applied, and a multiplier as parameters. The function should apply the given transformation functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_and_multiply([1, 2, 3], lambda x: x + 1, 2) == [4, 6, 8]\", \"assert transform_and_multiply([4, 5, 6], lambda x: x * 2, 3) == [24, 30, 36]\", \"assert transform_and_multiply([-1, 0, 1], lambda x: x ** 2, 1) == [1, 0, 1]\", \"assert transform_and_mu...
{ "split": "train", "index": 75663, "acecode_id": "oss_15023", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two inputs: `app`, a dictionary containing the properties of an application, and `project`, a string representing the name of the current project. Your task is to implement a function that retrieves the 'codeBucket' property from the `app` dictionary. If the 'code...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_code_bucket({'codeBucket': 'gs://my-bucket'}, 'my-project') == 'gs://my-bucket'\", \"assert get_code_bucket({'codeBucket': 'gs://another-bucket'}, 'test-project') == 'gs://another-bucket'\", \"assert get_code_bucket({'codeBucket': 'gs://bucket1'}, 'proje...
{ "split": "train", "index": 75664, "acecode_id": "bigcode_python_fns_12827", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `simulate_rough_surface(material: str, coverage: float, scale: float, depth: float) -> str` that simulates a Monte Carlo spectrum from a rough surface. The roughness of the surface is modeled as square pillars characterized by their height and width (scale)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_rough_surface('Aluminum', 0.5, 0.1, 1.0) == 'MC simulation of 100000.00 um 50% coverage rough surface of Aluminum at 20.0 keV'\", \"assert simulate_rough_surface('Copper', 0.75, 0.2, 2.0) == 'MC simulation of 200000.00 um 75% coverage rough surface ...
{ "split": "train", "index": 75665, "acecode_id": "bigcode_python_fns_4701", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_css` that takes two parameters, `background_color` and `text_color`, and returns a dictionary containing these CSS properties. The dictionary should have the keys 'background' and 'color' with their corresponding values set to the input parameters. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_css('#ff0000', '#00ff00') == {'background': '#ff0000', 'color': '#00ff00'}\", \"assert generate_css('#ffffff', '#000000') == {'background': '#ffffff', 'color': '#000000'}\", \"assert generate_css('#123456', '#654321') == {'background': '#123456', 'c...
{ "split": "train", "index": 75666, "acecode_id": "evol_34913", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts metadata information from a given code snippet. The metadata includes the purpose, author, creation date, copyright, and license information. The function should parse the given code snippet and return a dictionary co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_metadata('# Purpose: This is a test purpose\\\\n# Author: Test Author\\\\n# Created: 01/01/2023 10:00 AM\\\\n# Copyright: (c) \\\"Test Author\\\" \\\"01/01/2023 10:00 AM\\\"\\\\n# License: MIT License') == {'purpose': 'This is a te...
{ "split": "train", "index": 75667, "acecode_id": "oss_17638", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of an import hook for Python modules. Your function signature should be `def add_hook(transform_source: str, hook_name: str, extensions: List[str]) -> str:`. The function will receive three parameters: `transfo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_hook('source_transform', 'my_hook', ['.py', '.txt']) == 'Hook Name: my_hook, Extensions: .py, .txt'\", \"assert add_hook('transform', 'test_hook', ['.js']) == 'Hook Name: test_hook, Extensions: .js'\", \"assert add_hook('source_handler', 'data_hook', ['....
{ "split": "train", "index": 75668, "acecode_id": "bigcode_python_fns_5522", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages SSL certificates for a hypothetical database system. The function should take in a list of certificates, each represented by a dictionary containing 'instance_id', 'common_name', and 'sha1_fingerprint' fields. Your functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_certificate_common_names([{'instance_id': 'instance1', 'common_name': 'cert1', 'sha1_fingerprint': 'fingerprint1'}, {'instance_id': 'instance1', 'common_name': 'cert2', 'sha1_fingerprint': 'fingerprint2'}], 'instance1') == ['cert1', 'cert2']\", \"assert ...
{ "split": "train", "index": 75669, "acecode_id": "oss_17810", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `das` that takes an integer `var` and an optional integer `level` (defaulting to 0). The function should return a string response based on the value of `var` and `level`. If `var` is less than 0, return 'Negative number'. If `var` is equa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert das(-5, 0) == 'Level 0: Negative number'\", \"assert das(0, 0) == 'Level 0: Zero'\", \"assert das(5, 0) == 'Level 0: Positive number'\", \"assert das(-5, 1) == 'Level 1: Negative number'\", \"assert das(0, 1) == 'Level 1: Zero'\", \"assert das(5, 1) == 'Leve...
{ "split": "train", "index": 75670, "acecode_id": "bigcode_python_fns_40962", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of entries that can either be instances of a class FieldInfo or strings. Your task is to implement a function that returns a list of keys if all the entries are instances of FieldInfo. If the list is empty, return an empty list. If the list contains strings...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_key_list([]) == []\", \"assert create_key_list([FieldInfo('key1'), FieldInfo('key2')]) == ['key1', 'key2']\", \"assert create_key_list(['string1', 'string2']) == ['string1', 'string2']\", \"assert create_key_list([FieldInfo('key1')]) == ['key1']\", \"...
{ "split": "train", "index": 75671, "acecode_id": "bigcode_python_fns_7833", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a collection of boxes based on their unique identifiers and colors. Each box has a unique identifier (a string) and a color (a string). Your function should accept a list of operations and return the final state of the boxes ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_boxes([('add', 'box1', 'red'), ('add', 'box2', 'blue')]) == [('box1', 'red'), ('box2', 'blue')]\", \"assert manage_boxes([('add', 'box1', 'red'), ('add', 'box1', 'green')]) == [('box1', 'green')]\", \"assert manage_boxes([('add', 'box1', 'red'), ('get...
{ "split": "train", "index": 75672, "acecode_id": "oss_26817", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a URL pattern defined using regular expressions and extracts all the named groups from it. Named groups in a regular expression are defined using the syntax `(?P<name>...)`. Your function should return a list of all the named g...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_named_groups(r'^(?P<uid>\\\\w+)/$') == ['uid']\", \"assert extract_named_groups(r'^(?P<year>\\\\d{4})/(?P<month>\\\\d{2})/(?P<day>\\\\d{2})$') == ['year', 'month', 'day']\", \"assert extract_named_groups(r'^(?P<username>\\\\w+)/posts/(?P<post_id>\\\\...
{ "split": "train", "index": 75673, "acecode_id": "oss_27973", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a grid represented as a 2D list of integers, where each integer represents the elevation at that point on the grid. Your task is to implement a function that takes this grid and returns a new grid that represents the elevation cut of the original grid within a spe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert grdcut([[1,2,3],[4,5,6],[7,8,9]], 0, 0, 1, 1) == [[1, 2], [4, 5]]\", \"assert grdcut([[1,2,3],[4,5,6],[7,8,9]], 1, 1, 2, 2) == [[5, 6], [8, 9]]\", \"assert grdcut([[1,2,3],[4,5,6],[7,8,9]], 0, 0, 2, 2) == [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\", \"assert grdcut(...
{ "split": "train", "index": 75674, "acecode_id": "bigcode_python_fns_10202", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with logging transaction details in a simplified manner. Write a Python function `log_transaction` that takes two parameters: a string `transaction_id` representing the unique identifier of the transaction, and a dictionary `transaction_details` containing key-va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_transaction('TX001', {'amount': 100, 'date': '2023-10-01', 'status': 'completed'}) == \\\"Transaction ID: TX001, Details: {'amount': 100, 'date': '2023-10-01', 'status': 'completed'}\\\"\", \"assert log_transaction('TX002', {'amount': 250, 'date': '2023-...
{ "split": "train", "index": 75675, "acecode_id": "oss_11653", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing names of students. Write a function `update_student_names(names: List[str], new_names: List[str]) -> List[str]` that updates the list of student names by replacing the original names with the new names. The function should return the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_student_names(['Alice', 'Bob', 'Charlie'], ['David', 'Eva']) == ['David', 'Eva', 'Charlie']\", \"assert update_student_names(['Alice', 'Bob', 'Charlie'], ['David']) == ['David', 'Bob', 'Charlie']\", \"assert update_student_names([], ['David', 'Eva']) ...
{ "split": "train", "index": 75676, "acecode_id": "bigcode_python_fns_18681", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that checks if a given square matrix is a magic square. A magic square is defined as a square matrix in which the sums of the numbers in each row, each column, and both main diagonals are the same. The function should take a list of lists representing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_magic_square([[2, 7, 6], [9, 5, 1], [4, 3, 8]]) == True\", \"assert is_magic_square([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == False\", \"assert is_magic_square([[1]]) == True\", \"assert is_magic_square([[0, 0], [0, 0]]) == True\", \"assert is_magic_square([[...
{ "split": "train", "index": 75677, "acecode_id": "evol_15449", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `initialize_plugin` that initializes a plugin for processing payment routes. The function should take no parameters and return a dictionary that represents the initial state of the plugin. The dictionary should contain the foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_plugin() == {'routes_in_use': {}, 'queue': {}, 'payment_hash_to_route': {}, 'payment_hash_to_request': {}, 'beta': 1, 'alpha': 10}\", \"assert type(initialize_plugin()) == dict\", \"assert 'routes_in_use' in initialize_plugin()\", \"assert 'queue'...
{ "split": "train", "index": 75678, "acecode_id": "bigcode_python_fns_6958", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries representing genomic data, transform the data by re-keying it based on 'locus' and then by 'sample id'. Each dictionary in the list contains the following keys: 'locus' (a dictionary with 'contig' and 'position'), 'alleles' (a list of two alleles), ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rekey_by_sample([{'locus': {'contig': 'chr1', 'position': 100}, 'alleles': ['A', 'T'], 'samples': {'het_or_hom_or_hemi': 'het', 'HL': 30, 'S': 'sample1'}}, {'locus': {'contig': 'chr1', 'position': 200}, 'alleles': ['G', 'C'], 'samples': {'het_or_hom_or_hemi'...
{ "split": "train", "index": 75679, "acecode_id": "bigcode_python_fns_8734", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of integers as input and returns a list of integers that are both prime numbers and greater than 20. The function should only return unique values in the output list. Please implement the function `find_primes_above_20(nums: List[int]) -> List...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_primes_above_20([22, 29, 31, 40, 50]) == [29, 31]\", \"assert find_primes_above_20([15, 17, 19, 21, 23]) == [23]\", \"assert find_primes_above_20([10, 12, 14, 16]) == []\", \"assert find_primes_above_20([2, 3, 5, 7, 11, 13]) == []\", \"assert find_prime...
{ "split": "train", "index": 75680, "acecode_id": "evol_24769", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a list of CSV file names and their corresponding sizes. The function should take a list of CSV file names as input and return a tuple of two lists: the first list should contain the names of all the CSV files, and the second ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_csv_files(['file1.csv', 'file2.csv', 'file3.csv']) == (['file1.csv', 'file2.csv', 'file3.csv'], [100, 200, 0])\", \"assert manage_csv_files(['data.csv', 'report.csv']) == (['data.csv', 'report.csv'], [150, 300])\", \"assert manage_csv_files(['example....
{ "split": "train", "index": 75681, "acecode_id": "oss_20659", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function `binary_to_decimal(binaryNum: str) -> int` that converts a binary number represented as an ASCII character string into its decimal (base-10) integer value. The input string will only contain the characters '0' and '1'.\nPlease reason step by step, then write a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_to_decimal('0') == 0\", \"assert binary_to_decimal('1') == 1\", \"assert binary_to_decimal('10') == 2\", \"assert binary_to_decimal('11') == 3\", \"assert binary_to_decimal('110') == 6\", \"assert binary_to_decimal('111') == 7\", \"assert binary_to_de...
{ "split": "train", "index": 75682, "acecode_id": "evol_900", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of strings representing routes taken by two vehicles. Each route is a sequence of directions, where each direction is represented by a single uppercase letter: 'U' for up, 'D' for down, 'L' for left, and 'R' for right. The starting point for both vehicle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_shortest_manhattan_distance(['R', 'U'], ['U', 'R']) == 2\", \"assert find_shortest_manhattan_distance(['U', 'U', 'R', 'R'], ['D', 'D', 'L', 'L']) == -1\", \"assert find_shortest_manhattan_distance(['R', 'U', 'R', 'D'], ['U', 'R', 'D', 'L']) == 1\", \"as...
{ "split": "train", "index": 75683, "acecode_id": "oss_3771", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a record with various fields. Your task is to implement a function `filter_records(records: List[dict], fields: List[str], predicate: Callable) -> List[dict]` that filters the records based on a given condit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_records([{ 'id': 1, 'name': 'Alice', 'age': 30 }, { 'id': 2, 'name': 'Bob', 'age': 25 }], ['name'], lambda r: r['age'] > 28) == [{'name': 'Alice'}]\", \"assert filter_records([{ 'id': 1, 'name': 'Alice', 'age': 30 }, { 'id': 2, 'name': 'Bob', 'age': 2...
{ "split": "train", "index": 75684, "acecode_id": "bigcode_python_fns_23046", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `analyze_band_structure` that simulates the analysis of electronic band structures based on user-defined parameters. The function should accept multiple parameters that specify how the analysis should be conducted. The parameters are as f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_band_structure([1, 2, 3]) == {'orbitals': [1, 2, 3], 'efermi': 0.0, 'l_angular_momentum': None, 'procar_filename': 'PROCAR', 'scaling': 0.2, 'xscaling': False}\", \"assert analyze_band_structure([], l_angular_momentum='p') == {'orbitals': 'all', 'efe...
{ "split": "train", "index": 75685, "acecode_id": "oss_18846", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `calculate_cost(dt: int, input_param: int) -> int` that calculates the cost of a certain operation based on the given input parameters. The function should consider the following rules:\n- If the `input_param` is negative, the cost sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cost(5, -1) == 0\", \"assert calculate_cost(5, 0) == 10\", \"assert calculate_cost(5, 1) == 5\", \"assert calculate_cost(10, -5) == 0\", \"assert calculate_cost(10, 0) == 10\", \"assert calculate_cost(10, 3) == 10\", \"assert calculate_cost(0, 2) =...
{ "split": "train", "index": 75686, "acecode_id": "oss_36147", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_user_details(full_name: str, birth_date: str) -> str` that takes a user's full name and birth date as input and returns a formatted string containing the user's legal name and birth date in the format 'Name: {full_name}, Birth Date: {birth_date}'.\nPle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_details('Emma Watson', '15-04-1990') == 'Name: Emma Watson, Birth Date: 15-04-1990'\", \"assert get_user_details('John Doe', '01-01-1980') == 'Name: John Doe, Birth Date: 01-01-1980'\", \"assert get_user_details('Alice Smith', '22-07-1995') == 'Name...
{ "split": "train", "index": 75687, "acecode_id": "evol_33860", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two sets of points K and B, each represented as a 2D list of coordinates, implement a function `pairwise_radial_basis(K: List[List[float]], B: List[List[float]]) -> List[List[float]]` to compute a matrix P where each element P[i][j] corresponds to the evaluation of a radi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pairwise_radial_basis([[1, 1]], [[1, 1]]) == [[0.0]]\", \"assert pairwise_radial_basis([[0, 0], [0, 0]], [[0, 0], [0, 0]]) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert pairwise_radial_basis([[1, 1]], [[1, 0], [2, 1]]) == [[0.0, 0.0]]\", \"assert pairwise_radial_b...
{ "split": "train", "index": 75688, "acecode_id": "bigcode_python_fns_34534", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple bot class that requires a name and a token for initialization. Your task is to implement the `Bot` class with an `__init__` method that takes two parameters: `name` (a string representing the name of the bot) and `token` (a string represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_bot('Bot1', 'Token123').name == 'Bot1'\", \"assert create_bot('Bot1', 'Token123').token == 'Token123'\", \"assert create_bot('ChatBot', 'SecretToken').name == 'ChatBot'\", \"assert create_bot('ChatBot', 'SecretToken').token == 'SecretToken'\", \"asser...
{ "split": "train", "index": 75689, "acecode_id": "oss_15861", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that calculates the sum of the second smallest and the second largest integers in the list. If the list has fewer than four unique integers, return 0.\nPlease reason step by step, then write a self-contained Python solution. Give y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_penultimate([1, 2, 3, 4, 5]) == 6\", \"assert sum_penultimate([5, 5, 5, 5]) == 0\", \"assert sum_penultimate([10, 20, 30, 40]) == 50\", \"assert sum_penultimate([3, 1, 4, 2]) == 5\", \"assert sum_penultimate([100, 200, 300]) == 0\", \"assert sum_penultim...
{ "split": "train", "index": 75690, "acecode_id": "evol_7671", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a user account system. The function should take a username and an optional boolean parameter `is_active` (defaulting to True) and return a dictionary representing the user account. The dictionary should cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_account('user1') == {'username': 'user1', 'is_active': True}\", \"assert create_account('user2', False) == {'username': 'user2', 'is_active': False}\", \"assert create_account('user3', True) == {'username': 'user3', 'is_active': True}\", \"assert crea...
{ "split": "train", "index": 75691, "acecode_id": "oss_21047", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to determine the declarer in a card game based on the partnership with the most points. The function `agent_declarer(hands)` takes a list `hands` containing the points in each player's hand and returns a tuple `(agent_is_declarer, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert agent_declarer([10, 5, 15, 5]) == (True, 2)\", \"assert agent_declarer([8, 10, 6, 12]) == (False, -1)\", \"assert agent_declarer([7, 8, 9, 6]) == (True, 2)\", \"assert agent_declarer([5, 10, 5, 10]) == (False, -1)\", \"assert agent_declarer([6, 4, 9, 1]) == ...
{ "split": "train", "index": 75692, "acecode_id": "oss_25924", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested dictionary and a key or a list of keys, return the value associated with the key. The dictionary can contain other dictionaries as values, and you should be able to traverse through multiple keys to retrieve the final value. If a key is not found in the dictionar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_value({'a': 1, 'b': {'c': 2}}, 'a') == 1\", \"assert get_value({'a': 1, 'b': {'c': 2}}, 'b') == {'c': 2}\", \"assert get_value({'a': 1, 'b': {'c': 2}}, ['b', 'c']) == 2\", \"assert get_value({'a': {'x': 10}}, ['a', 'x']) == 10\", \"assert get_value({'a':...
{ "split": "train", "index": 75693, "acecode_id": "bigcode_python_fns_45525", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the sizes of multiple cells in a data structure. Your task is to implement a function that takes this list of sizes and returns a new list where each size is increased by one. The function should handle the case where the size is le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increase_cell_sizes([1, 2, 3]) == [2, 3, 4]\", \"assert increase_cell_sizes([]) == []\", \"assert increase_cell_sizes([10, 20, 30]) == [11, 21, 31]\", \"assert increase_cell_sizes([5, 5, 5]) == [6, 6, 6]\", \"assert increase_cell_sizes([2]) == [3]\"]}" }
{ "split": "train", "index": 75694, "acecode_id": "bigcode_python_fns_45838", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of frequencies in THz and a corresponding list of projected density of states (DOS) values, implement a function `create_projected_dos(frequencies: List[float], dos_values: List[List[float]]) -> Dict[str, Any]`. The function should return a dictionary with the foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_projected_dos([1.0, 2.0, 3.0], [[0.1, 0.2], [0.3, 0.4], [0.5, 0.6]]) == {'frequency_points': [1.0, 2.0, 3.0], 'projected_dos': [[0.1, 0.3, 0.5], [0.2, 0.4, 0.6]]}\", \"assert create_projected_dos([0.5, 1.5, 2.5], [[1.0], [2.0], [3.0]]) == {'frequency_...
{ "split": "train", "index": 75695, "acecode_id": "bigcode_python_fns_18171", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with developing a version update system for a software package. Your goal is to implement a function that checks if the supplied version of the software package is up to date compared to the latest version available. The function should take three parameters: `ve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_up_to_date('1.0.0', '1.0.0', '1.0.0') == True\", \"assert is_up_to_date('1.0.0', '1.0.1', '1.0.0') == False\", \"assert is_up_to_date('2.5.1', '2.5.1', '2.5.1') == True\", \"assert is_up_to_date('3.1.4', '3.1.3', '3.1.4') == False\", \"assert is_up_to_dat...
{ "split": "train", "index": 75696, "acecode_id": "bigcode_python_fns_23884", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates platform mappings and slugs based on a given dictionary. The dictionary contains mappings of platform identifiers to their respective names. Your task is to implement a function `validate_platforms` that takes the `P...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_platforms({'platform_map': {'cisco_ios': 'Cisco IOS', 'juniper_junos': 'Juniper Junos', 'arista_eos': 'Arista Eos'}}) == False\", \"assert validate_platforms({'platform_map': {'platform1': 'Platform One', 'platform2': 'Platform Two'}}) == False\", \...
{ "split": "train", "index": 75697, "acecode_id": "oss_35803", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that groups elements of a given list into sublists of a specified size. The function should take two parameters: the list to be grouped, which contains integers, and the size of each subgroup, which is a positive integer. If the list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert grouped([1, 2, 3, 4, 5, 6], 2) == [[1, 2], [3, 4], [5, 6]]\", \"assert grouped([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\", \"assert grouped([1, 2, 3], 1) == [[1], [2], [3]]\", \"assert grouped([1, 2, 3, 4, 5, 6, 7], 3) == [[1, 2, 3], [4, 5, 6], [7]]\", \...
{ "split": "train", "index": 75698, "acecode_id": "oss_25374", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the registration of new images against an existing model in a database. The function should take the following parameters: a string representing the path to the database file, a string representing the input path of the ima...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_image_registration_command('database.db', 'input/images', 'output/results', ['--option1', '--option2']) == 'image_registrator --database_path database.db --input_path input/images --output_path output/results --option1 --option2'\", \"assert generat...
{ "split": "train", "index": 75699, "acecode_id": "bigcode_python_fns_32398", "num_tests": 16 }