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": "Implement a function that takes a string as input and returns a dictionary where the keys are the unique characters in the string (considering case sensitivity) and the values are the counts of each character's occurrences in the string. The function should ignore spaces and pu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_chars('') == {}\", \"assert count_unique_chars('abc') == {'a': 1, 'b': 1, 'c': 1}\", \"assert count_unique_chars('aabbcc') == {'a': 2, 'b': 2, 'c': 2}\", \"assert count_unique_chars('Hello') == {'H': 1, 'e': 1, 'l': 2, 'o': 1}\", \"assert count_... | {
"split": "train",
"index": 84600,
"acecode_id": "evol_10553",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, implement a function `generate_cubes(n)` that returns a list of the cubes of all integers from 0 to n-1, inclusive. The function should use list comprehension for generating the list of cubes.\nPlease reason step by step, then write a self-contained ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_cubes(0) == []\", \"assert generate_cubes(1) == [0]\", \"assert generate_cubes(2) == [0, 1]\", \"assert generate_cubes(3) == [0, 1, 8]\", \"assert generate_cubes(4) == [0, 1, 8, 27]\", \"assert generate_cubes(5) == [0, 1, 8, 27, 64]\", \"assert gene... | {
"split": "train",
"index": 84601,
"acecode_id": "evol_9304",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a Bazel build rule for a custom test target based on the provided parameters. The function should take four arguments: `name` (a string representing the name of the test target), `tags` (a list of strings representin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_bazel_rule('test1', ['tag1']) == \\\"native.sh_test(\\\\n name = 'test1',\\\\n srcs = ['@bazel_rules//build_test:blank.sh'],\\\\n data = ['test1_gen.out'],\\\\n visibility = ['//visibility:private'],\\\\n tags = ['tag1'],\\\\n)\\\"\",... | {
"split": "train",
"index": 84602,
"acecode_id": "oss_17301",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_fibonacci_series(n: int, t1: int = 0, t2: int = 1) -> List[int]` that generates a modified Fibonacci sequence. The function takes three parameters: an integer `n` representing the number of terms to generate, and two optional integers `t1` and `t2... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci_series(1) == [0]\", \"assert generate_fibonacci_series(2) == [0, 1]\", \"assert generate_fibonacci_series(5) == [0, 1, 1, 2, 3]\", \"assert generate_fibonacci_series(5, 2, 3) == [2, 3, 5, 8, 13]\", \"assert generate_fibonacci_series(3, 4, ... | {
"split": "train",
"index": 84603,
"acecode_id": "evol_35709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the RADIUS server name based on a given TestCaseID and the type of connection method (either 'TLS' or 'Other'). The function should take two parameters: a string TestCaseID and a string DUTEAPMethod. If DUTEAPMethod is 'TL... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_server_name('test1', 'TLS') == 'TLS_Server_test1'\", \"assert get_server_name('test2', 'Other') == 'Other_Server_test2'\", \"assert get_server_name('case123', 'TLS') == 'TLS_Server_case123'\", \"assert get_server_name('case123', 'HTTP') == 'Other_Server_... | {
"split": "train",
"index": 84604,
"acecode_id": "bigcode_python_fns_30504",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement the function `numsManipulation` that takes a positive integer n and returns the product of the cubes of its odd digits plus the sum of the squares of its even digits. If all digits are even, return the product of the cubes of the first half of these even digits. If al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numsManipulation(2468) == 512\", \"assert numsManipulation(1111) == 2\", \"assert numsManipulation(2222) == 64\", \"assert numsManipulation(999) == 81\", \"assert numsManipulation(5555) == 50\", \"assert numsManipulation(777) == 49\"]}"
} | {
"split": "train",
"index": 84605,
"acecode_id": "evol_1540",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_mod_updates()` that simulates querying a database for modifications (mods) related to scientific publications. The function should return a list of modification identifiers (mod IDs) that are associated with the latest updates. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_mod_updates() == [101, 102, 103, 104, 105]\", \"assert type(get_mod_updates()) == list\", \"assert len(get_mod_updates()) == 5\", \"assert 101 in get_mod_updates()\", \"assert 105 in get_mod_updates()\", \"assert all(isinstance(mod_id, int) for mod_id in... | {
"split": "train",
"index": 84606,
"acecode_id": "bigcode_python_fns_20165",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that formats a given article title string according to specific capitalization rules. The function should capitalize the first letter of each significant word, except for certain functional words (like 'and', 'the', 'of', etc.), which should remain in lower... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fmt_title('google killing annoying browsing feature') == 'Google Killing Annoying Browsing Feature'\", \"assert fmt_title('the quick brown fox jumps over the lazy dog') == 'The Quick Brown Fox Jumps Over the Lazy Dog'\", \"assert fmt_title('the and the') == ... | {
"split": "train",
"index": 84607,
"acecode_id": "bigcode_python_fns_4921",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a file path. The file path can be in any format and may end with a '.jpeg' extension. Your task is to write a function that extracts and returns the name of the file without the extension from the provided file path. The file name is defined ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_file_name('folder/subfolder/image.jpeg') == 'image'\", \"assert extract_file_name('folder/image.jpeg') == 'image'\", \"assert extract_file_name('/image.jpeg') == 'image'\", \"assert extract_file_name('folder/subfolder/image.png') == 'image.png'\", \"... | {
"split": "train",
"index": 84608,
"acecode_id": "bigcode_python_fns_11531",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that takes a variable number of strings as input. If no strings are provided, the function should return 'No input provided'. If at least one string is provided, the function should return a list of the provided strings in alphabetical order. Wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_strings() == 'No input provided'\", \"assert sort_strings('apple') == ['apple']\", \"assert sort_strings('banana', 'apple') == ['apple', 'banana']\", \"assert sort_strings('grape', 'apple', 'banana') == ['apple', 'banana', 'grape']\", \"assert sort_stri... | {
"split": "train",
"index": 84609,
"acecode_id": "bigcode_python_fns_32698",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `caesar_encrypt(text: str, shift: int) -> str` that encrypts a given string using a Caesar Cipher algorithm. The function should take a string `text` which may contain uppercase letters, lowercase letters, and other characters (like punctuation and whitespa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert caesar_encrypt('Hello, World!', 3) == 'Khoor, Zruog!'\", \"assert caesar_encrypt('Python 3.8', 5) == 'Udymts 3.8'\", \"assert caesar_encrypt('12345!', 10) == '12345!'\", \"assert caesar_encrypt('A B C', 3) == 'D E F'\", \"assert caesar_encrypt('Z Y X', 3) ==... | {
"split": "train",
"index": 84610,
"acecode_id": "evol_24995",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of 3D coordinates represented as a list of tuples (i, j, k) and an affine transformation matrix (4x4) represented as a list of lists, implement a function that converts the list of matrix subscripts (ijk) into corresponding coordinates in image-space. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_coordinates([(1, 2, 3), (4, 5, 6)], [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) == [(1, 2, 3), (4, 5, 6)]\", \"assert convert_coordinates([(0, 0, 0)], [[1, 0, 0, 1], [0, 1, 0, 2], [0, 0, 1, 3], [0, 0, 0, 1]]) == [(1, 2, 3)]\", \"assert ... | {
"split": "train",
"index": 84611,
"acecode_id": "bigcode_python_fns_47971",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary with string keys and integer values, implement a function `printDictionary(dictionary)` that returns a formatted string representation of the dictionary. The string should list each key-value pair on a new line in the format 'key: value'. If the dictionary is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert printDictionary({'a': 1, 'b': 2, 'c': 3}) == 'a: 1\\\\nb: 2\\\\nc: 3'\", \"assert printDictionary({'x': 10, 'y': 20}) == 'x: 10\\\\ny: 20'\", \"assert printDictionary({'name': 42, 'age': 25}) == 'name: 42\\\\nage: 25'\", \"assert printDictionary({'key1': 100... | {
"split": "train",
"index": 84612,
"acecode_id": "bigcode_python_fns_49280",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a positive integer n (greater than 0 and less than 100000) as input and returns the square of n. If the input is not a positive integer within the specified range, the function should raise a ValueError with the message \"Input must be a posit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_number(1) == 1\", \"assert square_number(5) == 25\", \"assert square_number(9) == 81\", \"assert square_number(10) == 100\", \"assert square_number(9999) == 99980001\", \"assert square_number(100) == 10000\", \"assert square_number(25) == 625\", \"ass... | {
"split": "train",
"index": 84613,
"acecode_id": "evol_30213",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given an array of strings, implement a function `get_longest_strings` that returns a list of all strings with the maximum length from the array. If there are multiple strings with the same maximum length, return them in the order they appear in the array.\nPlease reason step by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_longest_strings(['a', 'ab', 'abc', 'abcd', 'abcde']) == ['abcde']\", \"assert get_longest_strings(['one', 'two', 'three', 'four', 'five']) == ['three']\", \"assert get_longest_strings(['apple', 'banana', 'pear', 'grape']) == ['banana']\", \"assert get_lo... | {
"split": "train",
"index": 84614,
"acecode_id": "evol_34169",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a point represented by its coordinates (x, y) and a circle represented by its center coordinates (cx, cy) and its radius r, write a function that calculates the Euclidean distance between the point and the center of the circle. The function should return a boolean value i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_point_within_circle((1, 1), (0, 0, 2)) == True\", \"assert is_point_within_circle((3, 3), (0, 0, 2)) == False\", \"assert is_point_within_circle((0, 0), (0, 0, 1)) == True\", \"assert is_point_within_circle((2, 2), (1, 1, 1)) == False\", \"assert is_point... | {
"split": "train",
"index": 84615,
"acecode_id": "bigcode_python_fns_49467",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `char_str`, an integer `bits`, and a list of characters `alphabet`, write a function `build_binary_value(char_str: str, bits: int, alphabet: List[str]) -> str` that converts the string `char_str` into its binary representation. Each character in `char_str` is rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_binary_value('A', 7, []) == '1000001'\", \"assert build_binary_value('ABC', 7, []) == '100000110000101000011'\", \"assert build_binary_value('A', 5, ['A', 'B', 'C', 'D', 'E']) == '00000'\", \"assert build_binary_value('B', 5, ['A', 'B', 'C', 'D', 'E'])... | {
"split": "train",
"index": 84616,
"acecode_id": "bigcode_python_fns_20612",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that simulates the recording of images from a virtual webcam. The function, `record_images`, should take a parameter `num_frames` which specifies the number of frames to simulate capturing. Each frame should be represented as a string f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert record_images(1) == ['frame_{}.png'.format(int(time.time()))]\", \"assert record_images(2) == ['frame_{}.png'.format(int(time.time())), 'frame_{}.png'.format(int(time.time()) + 1)]\", \"assert record_images(3) == ['frame_{}.png'.format(int(time.time())), 'fr... | {
"split": "train",
"index": 84617,
"acecode_id": "bigcode_python_fns_36668",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Write a function `filter_ages(ages: List[int], min_age: int, max_age: int) -> List[int]` that filters the ages based on a specified minimum and maximum age. The function should return a new list contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_ages([15, 22, 30, 45, 60], 20, 50) == [22, 30, 45]\", \"assert filter_ages([5, 10, 15, 20, 25], 10, 20) == [10, 15, 20]\", \"assert filter_ages([1, 2, 3, 4, 5, 6], 6, 6) == [6]\", \"assert filter_ages([21, 22, 23, 24, 25], 30, 40) == []\", \"assert fi... | {
"split": "train",
"index": 84618,
"acecode_id": "bigcode_python_fns_3201",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of items in different categories. Your task is to implement a function that returns a tuple containing the total count of items and the category with the maximum number of items. If there are multiple categories with the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_category_stats([1, 2, 3, 4]) == (10, 3)\", \"assert get_category_stats([5, 5, 5]) == (15, 0)\", \"assert get_category_stats([]) == (0, -1)\", \"assert get_category_stats([1]) == (1, 0)\", \"assert get_category_stats([10, 1, 10]) == (21, 0)\", \"assert ge... | {
"split": "train",
"index": 84619,
"acecode_id": "bigcode_python_fns_11161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents a glossed example in a specific format. Your task is to parse these glossed examples and merge the glosses into a single string for each example. A gloss is defined as a substring contained within square brackets '[]'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_glossed_examples(['This is an example [gloss1] and [gloss2].']) == [{'example': 'This is an example [gloss1] and [gloss2].', 'merged_glosses': 'gloss1, gloss2'}]\", \"assert parse_glossed_examples(['No glosses here.', '[single_gloss]']) == [{'example':... | {
"split": "train",
"index": 84620,
"acecode_id": "bigcode_python_fns_23833",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a command launcher that takes a set of command-line options and outputs a formatted command string. The command launcher should accept a list of options, where each option can be a string that starts with a dash ('-') or a non-option string. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert launch_command(['-X', 'file1', '-P', 'folder1', '-S', 'file2']) == '-X file1 -P folder1 -S file2'\", \"assert launch_command(['-A', 'test', '-B']) == '-A test -B'\", \"assert launch_command(['-X']) == '-X'\", \"assert launch_command(['file1', 'file2', '-X'])... | {
"split": "train",
"index": 84621,
"acecode_id": "bigcode_python_fns_17761",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working with a dataset that represents a simple graph consisting of nodes and edges. Each node is identified by a unique integer ID, and each edge connects two nodes. Your task is to implement a function `transform_graph` that takes a list of edges and converts it into ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_graph([(1, 2), (2, 3), (1, 3)]) == {'nodes': [1, 2, 3], 'edges': [(1, 2), (2, 3), (1, 3)]}\", \"assert transform_graph([(0, 1), (1, 2), (2, 0)]) == {'nodes': [0, 1, 2], 'edges': [(0, 1), (1, 2), (2, 0)]}\", \"assert transform_graph([(5, 6), (6, 7),... | {
"split": "train",
"index": 84622,
"acecode_id": "oss_89",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the generation of a horizontal bar plot by returning a dictionary representing the plot's parameters instead of creating an actual plot. The function should take the following parameters: \n- `data`: A list of dictio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_horizontal_bar_plot([{'category': 'A', 'value': 10}, {'category': 'B', 'value': 20}], 'value', 'category', 5, 'bar', 'Blues', True, 'h') == {'x': 'value', 'y': 'category', 'height': 5, 'kind': 'bar', 'palette': 'Blues', 'legend': True, 'orient': 'h'... | {
"split": "train",
"index": 84623,
"acecode_id": "oss_3297",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a number `num`, implement a function that checks if the number is an integer. An integer is a whole number without any fractional or decimal component. The function should return `True` if `num` is an integer and `False` otherwise. The input will be a floating-point numbe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_integer(5.0) == True\", \"assert is_integer(3.14) == False\", \"assert is_integer(-2.0) == True\", \"assert is_integer(0.0) == True\", \"assert is_integer(1.999999) == False\", \"assert is_integer(-5.5) == False\", \"assert is_integer(10.0) == True\", \"a... | {
"split": "train",
"index": 84624,
"acecode_id": "bigcode_python_fns_13386",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the data splitting process based on the type of telescope. The function should determine how to split the telescope data based on the provided parameters. Your function should take the following parameters: \n- `telesco... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_telescope_data('fact', None) == 'Single telescope data split operation'\", \"assert split_telescope_data('fact', 10) == 'Chunked telescope data split operation'\", \"assert split_telescope_data('other', None) == 'Other telescope operation'\", \"assert ... | {
"split": "train",
"index": 84625,
"acecode_id": "oss_30758",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_valid_number(x)` that returns True if the input 'x' is a numeric value and is greater than or equal to 5. The function should return False if 'x' is less than 5 or if 'x' is a non-numeric value (including strings, lists, etc.).\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_number(5) == True\", \"assert is_valid_number(10) == True\", \"assert is_valid_number(4) == False\", \"assert is_valid_number(0) == False\", \"assert is_valid_number(-1) == False\", \"assert is_valid_number('5') == False\", \"assert is_valid_number(... | {
"split": "train",
"index": 84626,
"acecode_id": "evol_3787",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of required packages, each defined by a string that may include a version number in the format 'package==version'. You are also given a dictionary representing installed packages, where the key is the package name and the value is the installed version. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_missing_packages(['numpy==1.21.0', 'scipy', 'matplotlib==3.4.3'], {'numpy': '1.21.0', 'scipy': '1.7.0'}) == ['matplotlib==3.4.3']\", \"assert find_missing_packages(['pandas==1.2.0', 'seaborn', 'scikit-learn==0.24.0'], {'pandas': '1.2.0', 'seaborn': '0.1... | {
"split": "train",
"index": 84627,
"acecode_id": "bigcode_python_fns_14198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `classify_numbers(num_list: List[int]) -> Tuple[List[int], List[int], List[int], float, float]` that takes a list of positive integers and returns a tuple containing: 1) a list of prime numbers, 2) a list of perfect squares, 3) a list of perfect cubes, 4) t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_numbers([10, 20, 30, 40]) == ([], [], [], 0.0, 0.0)\", \"assert classify_numbers([2, 3, 5, 7, 11, 13, 17, 19]) == ([2, 3, 5, 7, 11, 13, 17, 19], [], [], 0.0, 0.0)\", \"assert classify_numbers([49, 100, 121]) == ([], [49, 100, 121], [], 1.0, 0.0)\", ... | {
"split": "train",
"index": 84628,
"acecode_id": "evol_7565",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a dictionary of parsed arguments against a set of mandatory and optional parameters specified for a given operation. The function should take in two arguments: a dictionary `parsedArgs` containing user input parameters and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_parameters({'rotation': 60}, {'mandatoryparameters': {'rotation': {}, 'inputmaskname': {}}, 'optionalparameters': {}}) == {}\", \"assert validate_parameters({'rotation': 60, 'inputmaskname': 'mask1'}, {'mandatoryparameters': {'rotation': {}, 'inputm... | {
"split": "train",
"index": 84629,
"acecode_id": "bigcode_python_fns_18704",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that logs an error message along with contextual information based on a provided stack trace. The function `log_error` takes a message and a stack trace as parameters. The stack trace is a list of lists, where each inner list contains... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_error('An error occurred', [['info', 'file1.py', 10, 'method1', 'print()'], ['info', 'file2.py', 20, 'method2', 'log_error()']]) == '{\\\"method\\\": \\\"method2\\\", \\\"file\\\": \\\"file2.py\\\", \\\"line\\\": 20, \\\"source_code\\\": \\\"log_error()\... | {
"split": "train",
"index": 84630,
"acecode_id": "oss_262",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a configuration dictionary 'cfg' that contains the details of a network application, your task is to implement a function `get_application_interface(cfg)` that returns the name of the application interface associated with that configuration. The 'cfg' dictionary will have... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_application_interface({'name': 'app1'}) == 'app1_interface'\", \"assert get_application_interface({'name': 'serviceA'}) == 'serviceA_interface'\", \"assert get_application_interface({'name': 'webApp'}) == 'webApp_interface'\", \"assert get_application_in... | {
"split": "train",
"index": 84631,
"acecode_id": "bigcode_python_fns_3901",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate(expression: str) -> float` that evaluates a simple arithmetic expression given as a string. The expression will consist of non-negative integers and the operators `+`, `-`, `*`, and `/`, which should be evaluated with standard operator precedence... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate('10-2*3') == 4.0\", \"assert calculate('5+2') == 7.0\", \"assert calculate('8/4') == 2.0\", \"assert calculate('7*3-5') == 16.0\", \"assert calculate('4+5*6-2/1') == 32.0\", \"assert calculate('2*2*2') == 8.0\", \"assert calculate('12/4*3+1') == 10... | {
"split": "train",
"index": 84632,
"acecode_id": "evol_12026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of prefixes and a message string, write a function that identifies the first prefix that appears at the start of the message. The function should return a tuple containing the identified prefix and the index in the message where the prefix ends. If no prefix is fou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_prefix(['!', '#', '$'], '!hello world') == ('!', 1)\", \"assert find_prefix(['!', '#', '$'], '#hello world') == ('#', 1)\", \"assert find_prefix(['!', '#', '$'], 'hello world!') == (None, -1)\", \"assert find_prefix(['abc', 'def'], 'abcdefg') == ('abc',... | {
"split": "train",
"index": 84633,
"acecode_id": "bigcode_python_fns_42289",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function called `get_stats` that takes a list of dictionaries as input, where each dictionary represents a person's details including their name, age, and gender. The function should calculate the average age of females while filtering out invalid entries (such as those... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_stats([]) == {'male_avg_age': None, 'female_avg_age': None, 'male_count': 0, 'female_count': 0}\", \"assert get_stats([{'name': 'Tom', 'age': 26, 'gender': 'male'}]) == {'male_avg_age': 26.0, 'female_avg_age': None, 'male_count': 1, 'female_count': 0}\",... | {
"split": "train",
"index": 84634,
"acecode_id": "evol_18531",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that counts the total number of vowel characters in a given string. The function should take a single string parameter and return the count of vowels. Vowels are defined as the characters 'a', 'e', 'i', 'o', 'u' (case insensitive).\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels('Hello World') == 3\", \"assert count_vowels('LeetCode') == 4\", \"assert count_vowels('Vowels are important') == 7\", \"assert count_vowels('ABCDEF') == 2\", \"assert count_vowels('') == 0\", \"assert count_vowels('abcdefghijklmnopqrstuvwxyz') ... | {
"split": "train",
"index": 84635,
"acecode_id": "evol_33132",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple logging system for a service. Your service has three main operations: 'start', 'process', and 'stop'. Every time an operation is called, it should be recorded in a list called 'logs'. Implement a function called `log_operations` that simula... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_operations(1) == ['start', 'process', 'stop']\", \"assert log_operations(2) == ['start', 'process', 'stop', 'start', 'process', 'stop']\", \"assert log_operations(0) == []\", \"assert log_operations(3) == ['start', 'process', 'stop', 'start', 'process', ... | {
"split": "train",
"index": 84636,
"acecode_id": "bigcode_python_fns_43602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that formats a given email address for communication. The function should take a single parameter, `email`, which is a string representing an email address. The function should return a string in the format 'Communication Type: <em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_communication_type('test@example.com') == 'Communication Type: test@example.com'\", \"assert format_communication_type('user@domain.com') == 'Communication Type: user@domain.com'\", \"assert format_communication_type('') == 'Communication Type: No ema... | {
"split": "train",
"index": 84637,
"acecode_id": "oss_35915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given three integers, `start`, `limit`, and `delta`, implement a function `iterate_range` that generates a list of integers starting from `start` and ending before `limit`, incrementing by `delta`. If `delta` is positive, the generated numbers should be from `start` to less tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert iterate_range(0, 10, 2) == [0, 2, 4, 6, 8]\", \"assert iterate_range(10, 0, -2) == [10, 8, 6, 4, 2]\", \"assert iterate_range(5, 5, 1) == []\", \"assert iterate_range(5, 15, 5) == [5, 10]\", \"assert iterate_range(5, 5, -1) == []\", \"assert iterate_range(-5... | {
"split": "train",
"index": 84638,
"acecode_id": "bigcode_python_fns_6367",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function in Python that replaces all occurrences of a specified entity in a nested list structure with a new entity. The function should handle cases where the input is not a list, and it should return an empty list if the input is an empty list. Additionally, ensure ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_entity([1, 2, 3, 4], 2, 5) == [1, 5, 3, 4]\", \"assert replace_entity([1, [2, 3], 4], 2, 5) == [1, [5, 3], 4]\", \"assert replace_entity([], 1, 2) == []\", \"assert replace_entity([1, 2, 3], 4, 5) == [1, 2, 3]\", \"assert replace_entity([[1, 2], [3, ... | {
"split": "train",
"index": 84639,
"acecode_id": "evol_18075",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes two integers as parameters, adds them together, converts the sum to a hexadecimal string, and returns the string formatted as 'The total is (hexadecimal result)'.\nPlease reason step by step, then write a self-contained Python solution. Give your fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hexadecimal_addition(0, 0) == 'The total is 0x0'\", \"assert hexadecimal_addition(15, 16) == 'The total is 0x1f'\", \"assert hexadecimal_addition(-5, 5) == 'The total is 0x0'\", \"assert hexadecimal_addition(255, 1) == 'The total is 0x100'\", \"assert hexade... | {
"split": "train",
"index": 84640,
"acecode_id": "evol_30966",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of application configurations. Implement a function `manage_app_configurations(commands: List[str]) -> List[str]` that takes a list of commands as strings and returns a list of strings representing the output of each command. The comman... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_app_configurations(['create app1 manifest1']) == ['']\", \"assert manage_app_configurations(['create app1 manifest1', 'get app1']) == ['','manifest1']\", \"assert manage_app_configurations(['create app1 manifest1', 'list']) == ['','app1']\", \"assert ... | {
"split": "train",
"index": 84641,
"acecode_id": "bigcode_python_fns_48511",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `greet_user(language: str) -> str` that takes a string representing a language code (e.g., 'en', 'es') and returns a greeting message in the specified language. If the language code is not supported, return a default message in English: 'Greetings, Universe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet_user('en') == 'Greetings, Universe!'\", \"assert greet_user('es') == '\\u00a1Saludos, Universo!'\", \"assert greet_user('fr') == 'Greetings, Universe!'\", \"assert greet_user('de') == 'Greetings, Universe!'\", \"assert greet_user('') == 'Greetings, Uni... | {
"split": "train",
"index": 84642,
"acecode_id": "evol_3513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_fibonacci` that generates the Fibonacci sequence within a specified range [start, end]. The function should take two integers as inputs: `start` and `end`. It should return a list of Fibonacci numbers that fall within the specified range, inclusive of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(0, 0) == [0]\", \"assert generate_fibonacci(1, 8) == [1, 1, 2, 3, 5, 8]\", \"assert generate_fibonacci(5, 21) == [5, 8, 13, 21]\", \"assert generate_fibonacci(10, 10) == []\", \"assert generate_fibonacci(13, 34) == [13, 21, 34]\", \"assert... | {
"split": "train",
"index": 84643,
"acecode_id": "evol_35266",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Create a Python function named `create_employee` that takes three parameters: `name` (a string), `age` (an integer), and `salary` (a float). The function should return a dictionary representing an employee, where the keys are 'name', 'age', and 'salary', and their corresponding... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_employee('Alice', 30, 50000.0) == {'name': 'Alice', 'age': 30, 'salary': 50000.0}\", \"assert create_employee('Bob', 45, 75000.5) == {'name': 'Bob', 'age': 45, 'salary': 75000.5}\", \"assert create_employee('Charlie', 25, 30000.0) == {'name': 'Charlie... | {
"split": "train",
"index": 84644,
"acecode_id": "evol_19665",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a bidimensional grid consisting of integer elements, implement a function that identifies and extracts the sub-grid with the maximum cumulative total. The function should return the sub-grid as a list of lists. The input grid will be a non-empty list of lists where each i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subgrid([[1,2],[3,4]]) == [[1,2],[3,4]]\", \"assert max_subgrid([[-1,-2],[-3,-4]]) == [[-1]]\", \"assert max_subgrid([[5,5],[5,5]]) == [[5,5],[5,5]]\", \"assert max_subgrid([[0,0],[0,0]]) == [[0]]\", \"assert max_subgrid([[1]]) == [[1]]\", \"assert max_s... | {
"split": "train",
"index": 84645,
"acecode_id": "evol_3131",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting unique dependencies from a string that represents the content of a `setup.py` file for a Python package. The `install_requires` list is always present and may contain duplicate dependencies. Your goal is to write a function `parse_dependencies` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_dependencies(\\\"install_requires=['requests', 'requests', 'numpy']\\\") == ['requests', 'numpy']\", \"assert parse_dependencies(\\\"install_requires=['requests', 'numpy', 'pandas', 'requests']\\\") == ['requests', 'numpy', 'pandas']\", \"assert parse_... | {
"split": "train",
"index": 84646,
"acecode_id": "oss_6325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings and a distinct target string, implement a function that identifies and returns the indices of two distinct strings from the list whose total character count equals the character count of the target string. It is guaranteed that there will be a unique sol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_indices(['a', 'bc', 'def'], 'defbc') == [1, 2]\", \"assert find_indices(['hello', 'world', 'python', 'rocks'], 'helloworld') == [0, 1]\", \"assert find_indices(['small', 'medium', 'large'], 'smallmedium') == [0, 1]\", \"assert find_indices(['quick', 'br... | {
"split": "train",
"index": 84647,
"acecode_id": "evol_15013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a list of integers and filters out any numbers that are either divisible by 3 or that are perfect squares (if the `cycle` parameter is set to True, filter out Fibonacci numbers instead). The resulting list should then be sorted initially by the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_map_remove([10, 15, 17, 21], False, True) == [17, 10]\", \"assert advanced_map_remove([2, 9, 11, 15]) == [11, 2]\", \"assert advanced_map_remove([100, 101, 102]) == [101]\", \"assert advanced_map_remove([3, 5, 7, 9, 11], False, True) == [11, 7, 5]\"... | {
"split": "train",
"index": 84648,
"acecode_id": "evol_31710",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns the URL of a JavaScript library given its name. Implement a function called `get_js_library_url(library_name: str) -> str` that takes a string `library_name` as input and returns the corresponding URL of the JavaScript librar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_js_library_url('Select2') == 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js'\", \"assert get_js_library_url('jQuery') == 'https://code.jquery.com/jquery-3.6.0.min.js'\", \"assert get_js_library_url('React') == 'https://unpkg.com... | {
"split": "train",
"index": 84649,
"acecode_id": "bigcode_python_fns_35382",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a 2D array of numerical data to generate a binary mask. Implement a function `process_mask(data)` that takes a 2D list of integers as input and returns a binary mask based on the following rules: 1. If the minimum non-zero value in the `data` arra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_mask([[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert process_mask([[1, 1], [1, 1]]) == [[1, 1], [1, 1]]\", \"assert process_mask([[0, 2], [3, 4]]) == [[0, 0], [0, 0]]\", \"assert process_mask([[2, 2], [2, 2]]) == [[0, 0], [0, 0]]\", \"assert proces... | {
"split": "train",
"index": 84650,
"acecode_id": "oss_6000",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts specific information from a given package's metadata represented as a dictionary. The metadata dictionary contains information such as the package's license, author, author email, and description. Your goal is to write a fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_package_metadata({'license': 'Apache2.0', 'author': 'jarbasAi', 'author_email': '<EMAIL>', 'description': 'metal archives, dark lyrics api'}) == {'license': 'Apache2.0', 'author': 'jarbasAi', 'author_email': '<EMAIL>', 'description': 'metal archives, d... | {
"split": "train",
"index": 84651,
"acecode_id": "oss_4479",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates a simple image segmentation algorithm. The function should partition a 2D grayscale image represented as a list of lists into regions with relatively homogeneous intensity based on a given threshold value. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert segment_image([[255, 255, 255], [255, 255, 255], [255, 255, 255]], 0) == [[1, 1, 1], [1, 1, 1], [1, 1, 1]]\", \"assert segment_image([[20, 21], [22, 23]], 2) == [[1, 1], [1, 1]]\", \"assert segment_image([[10, 20], [30, 40]], 15) == [[1, 1], [2, 2]]\", \"ass... | {
"split": "train",
"index": 84652,
"acecode_id": "oss_1275",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a set of unique prime numbers, implement a function that determines if the sum of any two primes in the set results in a composite number. The function should return True if such a pair exists, and False otherwise. Assume the input will contain prime numbers only and can ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_composite([2, 3, 5]) == True\", \"assert check_composite([2, 3, 7]) == True\", \"assert check_composite([3, 5, 13]) == True\", \"assert check_composite([2, 3, 11, 17]) == True\", \"assert check_composite([3, 5, 7]) == True\", \"assert check_composite([... | {
"split": "train",
"index": 84653,
"acecode_id": "evol_21183",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a basic banking system. Implement a function `calculate_monthly_interest(balance: float, interest_rate: float) -> float` that calculates the monthly interest based on the given account balance and an interest rate. The function should take two par... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_monthly_interest(1000, 12) == 10.0\", \"assert calculate_monthly_interest(0, 5) == 0.0\", \"assert calculate_monthly_interest(5000, 0) == 0.0\", \"assert calculate_monthly_interest(2000, 24) == 40.0\", \"assert calculate_monthly_interest(1500, 6) =... | {
"split": "train",
"index": 84654,
"acecode_id": "oss_8099",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates the closing tag for an HTML form. The function should take a string as input, which represents the name of the form, and return a string that contains the closing tag for that form in the format '</form>'. Your function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert close_form('myForm') == '</form>'\", \"assert close_form('userForm') == '</form>'\", \"assert close_form('dataEntry') == '</form>'\", \"assert close_form('registration') == '</form>'\", \"assert close_form('login') == '</form>'\", \"assert close_form('feedba... | {
"split": "train",
"index": 84655,
"acecode_id": "bigcode_python_fns_34988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a dataset in the format 'rcp_var_model_year'. Your task is to extract the 'rcp', 'var', 'model', and 'year' from the string and return them as a tuple. The string will always be formatted correctly. Implement a function `extract_dataset_info(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_dataset_info('rcp85_temperature_modelA_2023') == ('rcp85', 'temperature', 'modelA', 2023)\", \"assert extract_dataset_info('rcp60_precipitation_modelB_2020') == ('rcp60', 'precipitation', 'modelB', 2020)\", \"assert extract_dataset_info('rcp45_humidi... | {
"split": "train",
"index": 84656,
"acecode_id": "bigcode_python_fns_25744",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that computes the sum of the values of a given dictionary containing string keys and integer values. The function should take one parameter: a dictionary. Return the total sum of all the integer values in the dictionary.\nPlease reason step by step, then write ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_values({'A':5, 'B':6, 'C':10}) == 21\", \"assert sum_of_values({'X':1, 'Y':2, 'Z':3}) == 6\", \"assert sum_of_values({'key1':10, 'key2':20, 'key3':30}) == 60\", \"assert sum_of_values({'a':0, 'b':0, 'c':0}) == 0\", \"assert sum_of_values({'one':1, 'tw... | {
"split": "train",
"index": 84657,
"acecode_id": "evol_6393",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to create a function `generate_xml_output(edgeList)` that takes a dictionary `edgeList`, where the keys are edge IDs and the values are the counts of each edge. The function should return a string that represents the XML output containing network statistics. The output... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_xml_output({'edge1': 10, 'edge2': 5}) == '<netstats>\\\\n\\\\t<interval begin=\\\"0\\\" end=\\\"899\\\" id=\\\"dump_900\\\">\\\\n\\\\t\\\\t<edge id=\\\"edge1\\\" no=\\\"10\\\" color=\\\"1.0\\\"/>\\\\n\\\\t\\\\t<edge id=\\\"edge2\\\" no=\\\"5\\\" col... | {
"split": "train",
"index": 84658,
"acecode_id": "oss_22439",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a decorator function called `use_context` that takes a function as an argument and ensures that a specific context is initialized before executing that function. The context to be initialized is a simple dictionary that contains a key-value pair wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert my_function() == 'active'\", \"assert my_function() == 'active'\", \"assert my_function() == 'active'\", \"assert my_function() == 'active'\", \"assert my_function() == 'active'\", \"assert my_function() == 'active'\", \"assert my_function() == 'active'\", \... | {
"split": "train",
"index": 84659,
"acecode_id": "bigcode_python_fns_14138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, write a function that determines whether n is divisible by all prime numbers from 2 to 19 (inclusive). The function should return a list of boolean values, where each boolean corresponds to whether n is divisible by the respective prime number in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divisible_by_primes(30) == [True, True, True, False, False, False, False, False]\", \"assert divisible_by_primes(1) == [False, False, False, False, False, False, False, False]\", \"assert divisible_by_primes(210) == [True, True, True, True, False, False, Fal... | {
"split": "train",
"index": 84660,
"acecode_id": "evol_15637",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents a group of students. Each student is represented by their full name, email, and an ID in the format: 'fullname, email, id, fullname, email, id, ...'. Your task is to implement a function that parses this list and retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_student_groups(['John Doe, john@example.com, 12345, Jane Smith, jane@example.com, 67890']) == [[{'fullname': 'John Doe', 'email': 'john@example.com', 'id': '12345'}, {'fullname': 'Jane Smith', 'email': 'jane@example.com', 'id': '67890'}]]\", \"assert p... | {
"split": "train",
"index": 84661,
"acecode_id": "bigcode_python_fns_22426",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a dictionary of parameters for a clustering algorithm. The function should validate the parameters to ensure that they meet certain criteria. Specifically, the parameter dictionary must contain a key 'n_clusters' with a valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_clustering_params({'n_clusters': 3}) is None\", \"assert validate_clustering_params({'n_clusters': 1, 'max_iter': 100}) is None\", \"assert validate_clustering_params({'n_clusters': 5, 'max_iter': 50}) is None\", \"assert validate_clustering_params(... | {
"split": "train",
"index": 84662,
"acecode_id": "bigcode_python_fns_23023",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a file path. The file path may contain key-value pairs in the format of 'key=value', separated by slashes or underscores. Your task is to extract all key-value pairs from the file path and return them as a dictionary. The keys will always be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_path_kvs('/path/to/file/height=180_weight=75_age=30') == {'height': 180, 'weight': 75, 'age': 30}\", \"assert parse_path_kvs('/path/to/file/name=John_doe=25.5_name=Jane') == {'name': 'Jane', 'doe': 25.5}\", \"assert parse_path_kvs('/assets/img/image=ca... | {
"split": "train",
"index": 84663,
"acecode_id": "bigcode_python_fns_22994",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a logging system for a workload processing application. The application processes workloads and logs the completion of each workload. Your task is to implement a function `log_workload_completion` that takes a `request_id` (a string) as a parame... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_workload_completion('req1') is None\", \"assert log_workload_completion('req2') is None\", \"assert log_workload_completion('req3') is None\", \"assert log_workload_completion('req4') is None\", \"assert log_workload_completion('req5') is None\", \"asser... | {
"split": "train",
"index": 84664,
"acecode_id": "oss_17537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the ranges of data being processed for a specific dataset divided into blocks. You are given the following parameters: `N_st` (the starting index of the data), `N_cut` (the total number of data points), `Nt_block` (the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_data_range(0, 100, 25, 4) == ['from 0 to 25', 'from 25 to 50', 'from 50 to 75', 'from 75 to 100']\", \"assert calculate_data_range(0, 50, 10, 5) == ['from 0 to 10', 'from 10 to 20', 'from 20 to 30', 'from 30 to 40', 'from 40 to 50']\", \"assert cal... | {
"split": "train",
"index": 84665,
"acecode_id": "oss_16295",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a string of elements separated by spaces. The function should count the occurrences of each element, treating lower-case and upper-case letters as the same. It should return a dictionary where the keys are the elements in lower case and the val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert comprehensive_element_counter('Cats 123 # $') == {'cats': 1, '123': 1, '#': 1, '$': 1}\", \"assert comprehensive_element_counter('') == {}\", \"assert comprehensive_element_counter('hello Hello HELLO') == {'hello': 3}\", \"assert comprehensive_element_counte... | {
"split": "train",
"index": 84666,
"acecode_id": "evol_22951",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Develop a function that checks if the second-last character of a given string is the vowel 'o' and if the string contains an even number of consonants. The function should return True only if both conditions are met.\nPlease reason step by step, then write a self-contained Pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_condition('hello') == False\", \"assert check_condition('hello!') == False\", \"assert check_condition('abocde') == False\", \"assert check_condition('onomatopoeia') == False\", \"assert check_condition('co') == False\", \"assert check_condition('schoo... | {
"split": "train",
"index": 84667,
"acecode_id": "evol_7718",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to generate a random password for new users in an admin panel. The function should generate a random password that meets the following requirements: \n\n- The function should be named `generate_password` and should take no arguments. \n- ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_password()) >= 8 and len(generate_password()) <= 12\", \"assert any(c.isupper() for c in generate_password())\", \"assert any(c.islower() for c in generate_password())\", \"assert any(c.isdigit() for c in generate_password())\", \"assert generat... | {
"split": "train",
"index": 84668,
"acecode_id": "oss_10355",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, return a new list that contains all the elements from both lists, including duplicates. The order of elements in the returned list should follow the order they appear in the original lists. Implement a function called `union(a: List[int], b: List[in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert union([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert union([], []) == []\", \"assert union([1, 2], []) == [1, 2]\", \"assert union([], [3, 4]) == [3, 4]\", \"assert union([1, 1, 2], [1, 3, 4]) == [1, 1, 2, 1, 3, 4]\", \"assert union([5, 6, 7], [8, 9... | {
"split": "train",
"index": 84669,
"acecode_id": "bigcode_python_fns_25918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a floating-point number `x`. Your task is to implement a function `round_number(x: float) -> int` that takes this number as input and returns it rounded to the nearest integer. If the decimal part of `x` is 0.5 or greater, round up to the next integer. Otherwise, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_number(3.5) == 4\", \"assert round_number(2.3) == 2\", \"assert round_number(-2.7) == -3\", \"assert round_number(0.4) == 0\", \"assert round_number(10.49) == 10\", \"assert round_number(-10.5) == -10\", \"assert round_number(-10.51) == -11\", \"assert... | {
"split": "train",
"index": 84670,
"acecode_id": "bigcode_python_fns_22821",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a JSON response against a predefined schema. The schema specifies the expected structure of the response based on its type (object, array, string, boolean, or integer). Your function should take in a JSON object and a schem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_json_against_schema({'name': 'Bob', 'age': '30'}, {'type': 'object', 'properties': {'name': {'type': 'string'}, 'age': {'type': 'integer'}}}) == False\", \"assert validate_json_against_schema([1, 'two', 3], {'type': 'array', 'items': {'type': 'integ... | {
"split": "train",
"index": 84671,
"acecode_id": "bigcode_python_fns_14376",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function that calculates the cumulative sum of all elements in a given 2-dimensional array. The function should take a 2-dimensional list of integers with dimensions n x m (where n is the number of rows and m is the number of columns) as input. The values ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recursive_sum([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 45\", \"assert recursive_sum([[10, 20], [30, 40]]) == 100\", \"assert recursive_sum([[0]]) == 0\", \"assert recursive_sum([[-1, -2, -3], [-4, -5, -6]]) == -21\", \"assert recursive_sum([[100, 200], [300, 40... | {
"split": "train",
"index": 84672,
"acecode_id": "evol_32595",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python generator function `gen_prime()` that yields prime numbers one by one, starting from 2. A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. After implementing the generator function, write a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_nth_prime(1) == 2\", \"assert find_nth_prime(2) == 3\", \"assert find_nth_prime(3) == 5\", \"assert find_nth_prime(4) == 7\", \"assert find_nth_prime(5) == 11\", \"assert find_nth_prime(6) == 13\", \"assert find_nth_prime(7) == 17\", \"assert find_nth_p... | {
"split": "train",
"index": 84673,
"acecode_id": "oss_1378",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of real numbers, which represent the values of some attribute. Your task is to implement a function that estimates the mean (miu) and standard deviation (sigma) of these values based on the normal distribution. The mean should be calculated as the average o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert estimate_distribution_parameters([0.46, 0.376, 0.264, 0.318, 0.215, 0.237, 0.149, 0.211]) == (0.27875, 0.10092394590553255)\", \"assert estimate_distribution_parameters([1.0, 2.0, 3.0, 4.0, 5.0]) == (3.0, 1.5811388300841898)\", \"assert estimate_distribution... | {
"split": "train",
"index": 84674,
"acecode_id": "bigcode_python_fns_6451",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes XML data related to resolutions proposed in a meeting. Write a function `process_resolution_xml(xml)` that takes an XML element `xml` as input and returns a dictionary with the following keys: - 'resolution_text': The u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_resolution_xml('<WA><RESOLUTION><DESC><Sample Resolution></DESC><PROPOSED_BY>John Doe</PROPOSED_BY></RESOLUTION></WA>') == {'resolution_text': '<Sample Resolution>', 'resolution_author': 'John Doe', 'valid_resolution': True}\", \"assert process... | {
"split": "train",
"index": 84675,
"acecode_id": "oss_13794",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a set of required parameters for initiating a compute job. The function should take a dictionary containing the parameters and check if all required attributes are present. The required attributes are 'serviceAgreementI... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_compute_job_parameters({'serviceAgreementId': '123', 'consumerAddress': 'abc', 'signature': 'xyz', 'workflowDID': 'did:example:123'}) == ('Success', 200)\", \"assert validate_compute_job_parameters({'serviceAgreementId': '123', 'consumerAddress': 'a... | {
"split": "train",
"index": 84676,
"acecode_id": "bigcode_python_fns_23686",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if all chromosome IDs in a provided list match the chromosome IDs present in a given genome FASTA string. The function should take two arguments: a list of chromosome IDs and a string representing the genome in FASTA forma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_chromosomes(['chr1', 'chr2'], '>chr1\\\\n...\\\\n>chr2\\\\n...') == True\", \"assert check_chromosomes(['chr1', 'chr3'], '>chr1\\\\n...\\\\n>chr2\\\\n...') == False\", \"assert check_chromosomes(['chr2'], '>chr1\\\\n...\\\\n>chr2\\\\n...') == True\", \... | {
"split": "train",
"index": 84677,
"acecode_id": "oss_34389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a SQL query with placeholders and a set of values, and returns a formatted SQL query string with the provided values inserted into the query. The function should handle different types of SQL queries and value types, ens... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_sql_query('SELECT * FROM users WHERE username = %s AND age > %s', ('john_doe', 25)) == \\\"SELECT * FROM users WHERE username = 'john_doe' AND age > 25\\\"\", \"assert format_sql_query('DELETE FROM users WHERE id = %s', (1,)) == \\\"DELETE FROM users ... | {
"split": "train",
"index": 84678,
"acecode_id": "oss_9453",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tokens representing numbers in string format, write a function `compute_placevalues(tokens: List[str]) -> List[int]` that computes the place values of each token. The place value is defined as follows: if the token is 'point', it should return 0. Otherwise, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_placevalues(['point', '1']) == [0, 1]\", \"assert compute_placevalues(['0', 'point']) == [0, 0]\", \"assert compute_placevalues(['invalid', '4']) == [-1, 4]\", \"assert compute_placevalues(['point', 'point', 'point']) == [0, 0, 0]\", \"assert compute... | {
"split": "train",
"index": 84679,
"acecode_id": "bigcode_python_fns_17352",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calc_det(matrix)` that calculates the determinant of a given square matrix. The input to the function will be a list of lists, where each inner list represents a row of the matrix. You need to handle matrices of any size (n x n). For a 2x2 matrix, the dete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_det([[1, 2], [3, 4]]) == -2\", \"assert calc_det([[5]]) == 5\", \"assert calc_det([[1, 2, 3], [0, 1, 4], [5, 6, 0]]) == 1\", \"assert calc_det([[3, 8], [4, 6]]) == -14\", \"assert calc_det([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == 1\", \"assert calc_det([[0... | {
"split": "train",
"index": 84680,
"acecode_id": "evol_29690",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that masks and unmasks sensitive information. Given a string `data` that represents sensitive information and a character `mask_char`, your function should perform the following operations: 1. Create a masked version of the `data` by repl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mask_and_unmask('123456789', '#') == {'masked': '#########', 'unmasked': '123456789'}\", \"assert mask_and_unmask('password', 'x') == {'masked': 'xxxxxxxx', 'unmasked': 'password'}\", \"assert mask_and_unmask('HelloWorld', '-') == {'masked': '----------', 'u... | {
"split": "train",
"index": 84681,
"acecode_id": "oss_26430",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a singly-linked list, implement a function that reverses the linked list in-place without using extra space. The function should also handle erroneous inputs like null values and return the same erroneous value as output. You need to implement the function `reverseLinkedL... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverseLinkedList(None) == None\", \"assert reverseLinkedList(ListNode(1)).val == 1\", \"assert reverseLinkedList(ListNode(1)).next == None\", \"assert reverseLinkedList(ListNode(1, ListNode(2))).val == 2\", \"assert reverseLinkedList(ListNode(1, ListNode(2)... | {
"split": "train",
"index": 84682,
"acecode_id": "evol_2159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of files based on their attributes. Your task is to implement the `process_files` function, which takes in three parameters: \n\n- `files`: a dictionary containing file names as keys and their attributes as va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_files({'file3.txt': {'static': True}}, 'AppX', '/documents') == ['Copying file3.txt to /documents/file3.txt']\", \"assert process_files({'file5.md': {'static': True}, 'file6.md': {'static': True}}, 'MarkdownApp', '/notes') == ['Copying file5.md to /n... | {
"split": "train",
"index": 84683,
"acecode_id": "oss_24148",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function 'multi_dimensional_input' that accepts a list of dictionaries, where each dictionary consists of two keys: 'numbers' (a list of integers) and 'types' (a string that can be either 'odd' or 'even'). The function should return a dictionary with keys 'odd' and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multi_dimensional_input([{'numbers': [2, -4, 1, 3, 5, 7], 'types': 'even'}, {'numbers': [1, 3, 5, 7, 9], 'types': 'odd'}]) == {'even': (2, -2, 20), 'odd': (5, 25, 165)}\", \"assert multi_dimensional_input([{'numbers': [2, 4, 6], 'types': 'even'}, {'numbers':... | {
"split": "train",
"index": 84684,
"acecode_id": "evol_17560",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a lambda function based on the given input. The lambda function should accept any number of arguments and return a list of ones with the length specified by the input. Write a function `generate_ones_lambda` that tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_ones_lambda(0)() == []\", \"assert generate_ones_lambda(1)() == [1]\", \"assert generate_ones_lambda(2)() == [1, 1]\", \"assert generate_ones_lambda(3)() == [1, 1, 1]\", \"assert generate_ones_lambda(4)() == [1, 1, 1, 1]\", \"assert generate_ones_la... | {
"split": "train",
"index": 84685,
"acecode_id": "oss_3732",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that finds the shortest path from a given starting point to a target point in a 2D grid-based environment. The environment consists of a grid with obstacles that cannot be crossed. The function `shortest_path` takes in the dime... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_path(10, 10, (0, 0), (0, 1), [(0, 1)]) == []\", \"assert shortest_path(10, 10, (0, 0), (0, 0), []) == [(0, 0)]\", \"assert shortest_path(10, 10, (0, 0), (1, 0), [(1, 0)]) == []\", \"assert shortest_path(10, 10, (0, 0), (9, 9), [(0, 1), (1, 0)]) == [... | {
"split": "train",
"index": 84686,
"acecode_id": "oss_2334",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a specific word and a string of text, and calculates the frequency of that word in the provided text. The search should be case-insensitive and should only count whole word occurrences (i.e., it should not count substrings). Im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_word_frequency('love', 'Love is a beautiful thing. Love is all you need.') == 2\", \"assert calculate_word_frequency('hello', 'Hello world! hello there.') == 2\", \"assert calculate_word_frequency('apple', 'An apple a day keeps the doctor away.') =... | {
"split": "train",
"index": 84687,
"acecode_id": "evol_13682",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two arrays of integers, write a function `sum_of_squared_differences(arr1, arr2)` that computes the sum of squared differences between corresponding elements of the arrays. The function takes in two arrays `arr1` and `arr2` of equal length, and returns the sum of squared ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squared_differences([3, 5, 7], [2, 6, 8]) == 3\", \"assert sum_of_squared_differences([1, 2], [1, 2]) == 0\", \"assert sum_of_squared_differences([0], [0]) == 0\", \"assert sum_of_squared_differences([10, 20], [20, 10]) == 200\", \"assert sum_of_squar... | {
"split": "train",
"index": 84688,
"acecode_id": "oss_17621",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of slices represented as dictionaries, where each dictionary contains a key 'ImagePositionPatient' that holds a list of three float values representing the position of the slice, write a function that splits the input list into multiple lists if the distance betwee... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_slices([{ 'ImagePositionPatient': [0, 0, 0] }, { 'ImagePositionPatient': [0, 0, 1] }, { 'ImagePositionPatient': [0, 0, 2] }]) == [[{ 'ImagePositionPatient': [0, 0, 0] }, { 'ImagePositionPatient': [0, 0, 1] }, { 'ImagePositionPatient': [0, 0, 2] }]]\", ... | {
"split": "train",
"index": 84689,
"acecode_id": "bigcode_python_fns_35027",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes two parameters: a string representing a list name and a string representing a list description. The function should return a dictionary with two keys: 'name' and 'description', holding the respective input values. The list name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_list_dict('Grocery List', 'A list of items to buy at the supermarket.') == {'name': 'Grocery List', 'description': 'A list of items to buy at the supermarket.'}\", \"assert create_list_dict('Work Tasks', 'Tasks to complete for my job.') == {'name': 'W... | {
"split": "train",
"index": 84690,
"acecode_id": "oss_7635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts two strings, `substring` and `main_string`, and returns the number of times `substring` appears in `main_string`. The function should count overlapping occurrences as well. For example, if `substring` is 'ana' and `main_string` is 'banana', it ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences('ab', 'abcabcabc') == 3\", \"assert count_occurrences('ana', 'banana') == 2\", \"assert count_occurrences('abc', 'abcabcabc') == 3\", \"assert count_occurrences('a', 'aaaaaa') == 6\", \"assert count_occurrences('xyz', 'xyzxyzxyz') == 3\", \... | {
"split": "train",
"index": 84691,
"acecode_id": "evol_36120",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of test case results, and your task is to write a function that counts how many of these test cases pass certain conditions. A test case is considered to pass if it is a string that starts with the prefix 'pass_' and is followed by a non-empty sequence of a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_passing_test_cases(['pass_abc', 'fail_xyz', 'pass_def', 'pass_123']) == 3\", \"assert count_passing_test_cases(['fail_123', 'fail_xyz']) == 0\", \"assert count_passing_test_cases(['pass_1', 'pass_test', 'pass_case']) == 3\", \"assert count_passing_test... | {
"split": "train",
"index": 84692,
"acecode_id": "oss_23411",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_standard_score(hours_worked: int) -> float` that takes an integer representing the total hours worked by a worker in a week and returns a standardized score based on a typical workweek of 40 hours. The score should be calculated as (hours_worked / 40... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_standard_score(0) == 0.0\", \"assert calculate_standard_score(20) == 50.0\", \"assert calculate_standard_score(40) == 100.0\", \"assert calculate_standard_score(60) == 150.0\", \"assert calculate_standard_score(80) == 200.0\", \"assert calculate_st... | {
"split": "train",
"index": 84693,
"acecode_id": "evol_15249",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `calculate_sensitivity` that takes in a list of parameters and a target value, and calculates the sensitivity based on a given metric. The sensitivity S is defined as S = log(y) / log(x), where y is the signaling metric and x is the p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sensitivity([2.0, 4.0, 8.0], 'initial_condition') == 0.0\", \"assert calculate_sensitivity([4.0, 2.0, 1.0], 'reaction') == 0.0\", \"assert calculate_sensitivity([10.0, 5.0, 1.0], 'initial_condition') == 0.0\", \"assert calculate_sensitivity([3.0, 1... | {
"split": "train",
"index": 84694,
"acecode_id": "bigcode_python_fns_7580",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing key-value pairs, where the keys are strings and the values are integers. Your task is to write a function `unpack_dict(value: dict) -> List[Tuple[str, int]]` that iterates through the dictionary and returns a list of tuples, each containing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unpack_dict({'a': 1, 'b': 2, 'c': 3}) == [('a', 1), ('b', 2), ('c', 3)]\", \"assert unpack_dict({'x': 10, 'y': 20}) == [('x', 10), ('y', 20)]\", \"assert unpack_dict({'name': 'Alice', 'age': 30}) == [('name', 'Alice'), ('age', 30)]\", \"assert unpack_dict({'... | {
"split": "train",
"index": 84695,
"acecode_id": "oss_32939",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that sorts these strings in ascending alphabetical order without using any built-in sorting functions. The function should handle edge cases such as empty input lists or lists containing non-string elements (which should be ignored)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort([]) == []\", \"assert merge_sort(['zebra', 'zebra', 'apple']) == ['apple', 'zebra', 'zebra']\", \"assert merge_sort(['hello', 'world', 'python']) == ['hello', 'python', 'world']\", \"assert merge_sort(['mango', 'kiwi', 'orange', 'banana', 'apple']... | {
"split": "train",
"index": 84696,
"acecode_id": "evol_17580",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if all required settings are defined in a given dictionary of settings. The function should raise a `SettingsNotDefinedError` if any required setting is missing. The required settings are defined as a list: ['setting1', 's... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_settings_defined({'setting1': 'value1', 'setting2': 'value2', 'setting3': 'value3'}) is None\", \"assert check_settings_defined({'setting1': 'value1', 'setting2': 'value2', 'setting3': 'value3', 'extra_setting': 'value4'}) is None\", \"assert check_set... | {
"split": "train",
"index": 84697,
"acecode_id": "oss_30812",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function `check_divisible(num1, num2)` that checks whether two numbers are divisible by each other. The function should return True if either number is divisible by the other, and False otherwise. Additionally, handle potential errors such as ZeroDivisionError and TypeE... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_divisible(8, 4) == True\", \"assert check_divisible(4, 8) == True\", \"assert check_divisible(5, 25) == True\", \"assert check_divisible(25, 5) == True\", \"assert check_divisible(7, 3) == False\", \"assert check_divisible(5, 0) == False\", \"assert ch... | {
"split": "train",
"index": 84698,
"acecode_id": "evol_24220",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a map and a list of base stations arranged in a hexagonal structure. Each base station has a unique identifier and a position represented by coordinates (x, y). The function should take a parameter called `sharing_model`, w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_large_map([1, 2, 3, 4, 5, 6, 7]) == ({'width': 230, 'height': 260}, [{'id': 'A', 'position': (115, 130), 'sharing': 1}, {'id': 'B', 'position': (30, 80), 'sharing': 2}, {'id': 'C', 'position': (115, 30), 'sharing': 3}, {'id': 'D', 'position': (200, 80... | {
"split": "train",
"index": 84699,
"acecode_id": "bigcode_python_fns_44000",
"num_tests": 15
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.