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": "Develop a function that takes a string as input and inserts underscores between words that end with punctuation marks. Words are defined as sequences of characters separated by spaces. The function should return the modified string with the underscores appropriately inserted.\n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_underscores('Hello, world!') == 'Hello,_world!'\", \"assert insert_underscores('It is a test.') == 'It is a test.'\", \"assert insert_underscores('No punctuation here') == 'No punctuation here'\", \"assert insert_underscores('Wow! Amazing.') == 'Wow!_...
{ "split": "train", "index": 75900, "acecode_id": "evol_20801", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `data` and `kernel`, implement a function `spatial_convolution(data, kernel, stride, padding)` that performs a basic 2D convolution operation on the `data` with the `kernel`. The function should take the following parameters: \n\n- `data`: a list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert spatial_convolution([[1, 2], [3, 4]], [[1]], 1, 0) == [[1, 2], [3, 4]]\", \"assert spatial_convolution([[1]], [[1]], 1, 0) == [[1]]\", \"assert spatial_convolution([[1, 1, 1], [1, 1, 1]], [[1]], 1, 0) == [[1, 1, 1], [1, 1, 1]]\", \"assert spatial_convolution...
{ "split": "train", "index": 75901, "acecode_id": "bigcode_python_fns_20627", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a 2D list of numbers representing temperature readings from a grid, implement a function `regrid_bilinear(cube_in: List[List[float]], cube_out_mask: List[List[bool]]) -> List[List[float]]` that performs bilinear interpolation to generate a new grid of temperature readings...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert regrid_bilinear([[1.0, 2.0], [3.0, 4.0]], [[True, True], [True, True]]) == [[1.0, 2.0], [3.0, 4.0]]\", \"assert regrid_bilinear([[0.0, 0.0], [0.0, 0.0]], [[True, True], [True, True]]) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert regrid_bilinear([[1.0, 4.0], [3.0,...
{ "split": "train", "index": 75902, "acecode_id": "bigcode_python_fns_18397", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a function that takes the list and returns a new list containing only the unique strings, preserving the original order of their first appearance. The function should ignore case when determining uniqueness. For example, 'Hello' and 'hello' are co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_strings(['apple', 'banana', 'Apple', 'orange', 'banana']) == ['apple', 'banana', 'orange']\", \"assert unique_strings(['Hello', 'world', 'hello', 'WORLD']) == ['Hello', 'world']\", \"assert unique_strings(['Python', 'python', 'JAVA', 'java', 'C++', 'C...
{ "split": "train", "index": 75903, "acecode_id": "bigcode_python_fns_28340", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a dictionary and a filename as inputs and simulates saving the dictionary's contents to a file in a specific format. The function should convert the dictionary into a string representation, where each key-value pair is represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert save_dict_to_string({'data': ['a', 'b']}, 'test.txt') == \\\"data:['a', 'b']\\\"\", \"assert save_dict_to_string({'name': 'Alice', 'age': 30}, 'info.txt') == \\\"name:Alice,age:30\\\"\", \"assert save_dict_to_string({'key1': 10, 'key2': 20}, 'numbers.txt') =...
{ "split": "train", "index": 75904, "acecode_id": "bigcode_python_fns_4601", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a user's password and token according to specific rules. The function should take two parameters: a string 'password' and a string 'token'. The 'password' must be at least 8 characters long, and the 'token' must not exc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_user_credentials('strongpassword', 'validtoken1234567890') == True\", \"assert validate_user_credentials('short', 'validtoken1234567890') == False\", \"assert validate_user_credentials('validpassword', 'a' * 255) == True\", \"assert validate_user_cr...
{ "split": "train", "index": 75905, "acecode_id": "oss_32427", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `generate_codebook()` that returns a list of five unique symbols along with their interpretive descriptions. Each symbol should be a string and should be accompanied by a description string that explains its meaning. The function should return the codebook as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_codebook() == [('\\u2625', 'Ankh: Ancient Egyptian symbol for life or breath of life'), ('\\ud80c\\udc80', 'Eye of Horus: Ancient Egyptian symbol for protection, royal power and good health'), ('\\u263d', 'First quarter moon: Symbol for reflection, ...
{ "split": "train", "index": 75906, "acecode_id": "evol_11388", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a tuple containing the smallest and largest integers from the list. The function should handle cases where the list is empty by returning (None, None).\nPlease reason step by step, then write a self-contained Python soluti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_difference([20, 3, 17, 12]) == (3, 20)\", \"assert largest_difference([-10, -20, -5, -15]) == (-20, -5)\", \"assert largest_difference([0, 0, 0, 0]) == (0, 0)\", \"assert largest_difference([5]) == (5, 5)\", \"assert largest_difference([]) == (None, ...
{ "split": "train", "index": 75907, "acecode_id": "evol_4493", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function `process_metrics_data` that takes in three parameters: 1. `aggregator` - a string representing the aggregator name. 2. `dd_run_check` - a function that simulates running a check against the monitoring service. 3. `mock_http_response` - a function that mo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_metrics_data('test_aggregator', lambda: None, lambda: '# HELP go_memstats_total_alloc_bytes Total bytes allocated by the process.\\\\ngo_memstats_total_alloc_bytes 300000') == {'go_memstats_total_alloc_bytes{aggregator=\\\"test_aggregator\\\"}': 3000...
{ "split": "train", "index": 75908, "acecode_id": "oss_27027", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that verifies if a given lease can be refreshed based on the lease owner's client ID and the provided lease details. The function will take the following parameters: a lease ID (string), a client ID (string), a lease holder (string), ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert refresh_lease('lease123', 'clientA', 'clientA', 30) == 'Lease refreshed'\", \"assert refresh_lease('lease124', 'clientB', 'clientB', 10) == 'Lease refreshed'\", \"assert refresh_lease('lease125', 'clientC', 'clientC', 20) == 'Lease refreshed'\", \"assert ref...
{ "split": "train", "index": 75909, "acecode_id": "bigcode_python_fns_13565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes user information and simulates the creation of a new user. The function should accept a dictionary containing user information, including the user's unique identifier (uid), email, first name, last name, and a flag indicati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_user({'uid': 'john_doe', 'mail': 'john.doe@example.com', 'givenName': 'John', 'sn': 'Doe'}) == {'user_name': 'john_doe', 'email': 'john.doe@example.com', 'first_name': 'John', 'last_name': 'Doe', 'is_external': True, 'roles': ['ANNOTATOR'], 'groups': ...
{ "split": "train", "index": 75910, "acecode_id": "oss_20360", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a configuration setup function for an application. The function `setup_app` takes three parameters: a `command` (a string representing the command to execute), a `conf` (a dictionary containing global and local configuration settings), and `vars` (a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_app('init', {'global_conf': {'host': 'localhost'}, 'local_conf': {'port': 8080}}, {}) == {'host': 'localhost', 'port': 8080}\", \"assert setup_app('start', {'global_conf': {'host': '0.0.0.0'}, 'local_conf': {'port': 3000}}, {}) == {'host': '0.0.0.0', '...
{ "split": "train", "index": 75911, "acecode_id": "bigcode_python_fns_2307", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a constant string key, implement a function `get_distribution_schema(key: str) -> dict` that returns a predefined schema associated with that key. The schema is represented as a dictionary with string keys and string values. If the key does not exist in the predefined sch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_distribution_schema('A') == {'type': 'uniform', 'range': '0-100'}\", \"assert get_distribution_schema('B') == {'type': 'normal', 'mean': '50', 'stddev': '15'}\", \"assert get_distribution_schema('C') == {'type': 'binomial', 'n': '10', 'p': '0.5'}\", \"as...
{ "split": "train", "index": 75912, "acecode_id": "bigcode_python_fns_10584", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an adjacency matrix represented as a 2D list, where each element indicates the weight of the edge between two nodes. Your task is to create a function `add_selfloops(adj_matrix: List[List[float]], fill_weight: float) -> List[List[float]]` that adds self-loops to t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_selfloops([[0, 1], [0, 0]], 1.0) == [[1.0, 1], [0, 1.0]]\", \"assert add_selfloops([[0, 0], [0, 0]], 2.0) == [[2.0, 0], [0, 2.0]]\", \"assert add_selfloops([[1, 2], [3, 4]], 0.5) == [[0.5, 2], [3, 0.5]]\", \"assert add_selfloops([[5, 0], [0, 3]], 3.5) ==...
{ "split": "train", "index": 75913, "acecode_id": "bigcode_python_fns_16769", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates restarting services on a server. The function will take a list of service names (strings) and return a list of strings indicating the status of each service after attempting to restart it. Each service should be formatted a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert restart_services(['nginx', 'apache', 'mysql']) == ['Service nginx restarted successfully', 'Service apache restarted successfully', 'Service mysql restarted successfully']\", \"assert restart_services(['']) == ['Service failed to restart']\", \"assert resta...
{ "split": "train", "index": 75914, "acecode_id": "bigcode_python_fns_34004", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of dictionaries representing data records. Each dictionary contains a 'Collection_Number' key along with other keys. Your task is to merge the two lists based on the 'Collection_Number' while ensuring that all records from both lists are included in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_records([], []) == []\", \"assert merge_records([{'Collection_Number': 1, 'Access_Notes_Regarding_Storage_Locations': 'Note A'}], []) == [{'Collection_Number': 1, 'Access_Notes_Regarding_Storage_Locations': 'Note A'}]\", \"assert merge_records([], [{'C...
{ "split": "train", "index": 75915, "acecode_id": "bigcode_python_fns_23597", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of electrons represented by a dictionary with the following keys: 'genPartIdx', 'pdgId', and 'genPartFlav'. Your task is to implement a function that processes an input electron and finds its lineage within a collection of generated particles. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linkElectron({'genPartIdx': 1, 'pdgId': 11, 'genPartFlav': 'flav1'}, 0, [{'genPartIdx': 1, 'pdgId': 11, 'genPartFlav': 'flav1'}, {'genPartIdx': 2, 'pdgId': 22, 'genPartFlav': 'flav2'}], []) == [('Electron', 0, 1, 11, -9999.786, 'flav1', {'genPartIdx': 1, 'pd...
{ "split": "train", "index": 75916, "acecode_id": "bigcode_python_fns_20352", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with processing a sentence to extract word-tag pairs. Implement a function `parse_sentence(sentence: str) -> List[Tuple[str, str]]` that takes a sentence in the format \"Word1_tag1 Word2_tag2 Word3_tag3...\" and returns a list of tuples where each tuple contains ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_sentence('hello_noun world_verb') == [('hello', 'noun'), ('world', 'verb')]\", \"assert parse_sentence('python_language java_programming') == [('python', 'language'), ('java', 'programming')]\", \"assert parse_sentence('cat_animal dog_pet') == [('cat',...
{ "split": "train", "index": 75917, "acecode_id": "oss_24599", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two matrices with integers, where the matrices are of size n x n (where 0 < n < 101), implement a function that adds the two matrices together based on the following rules: 1. If both numbers are even, multiply them before adding to the resulting matrix. 2. If both number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_add([[1,1],[1,1]], [[1,1],[1,1]], 2) == [[-1,-1],[-1,-1]]\", \"assert matrix_add([[2,2],[2,2]], [[2,2],[2,2]], 2) == [[4,4],[4,4]]\", \"assert matrix_add([[0,0],[0,0]], [[0,0],[0,0]], 2) == [[0,0],[0,0]]\", \"assert matrix_add([[10,12],[14,16]], [[18,...
{ "split": "train", "index": 75918, "acecode_id": "evol_20326", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that finds the longest progressively ascending subsequence in the list. The function should return a tuple containing the longest ascending subsequence and the indices of the elements forming that subsequence in the original list. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert corrected_sequence([10, 9, 2, 3, 4, 5]) == ([2, 3, 4, 5], [2, 3, 4, 5])\", \"assert corrected_sequence([1]) == ([1], [0])\", \"assert corrected_sequence([1, 2, 3, 4, 5]) == ([1, 2, 3, 4, 5], [0, 1, 2, 3, 4])\", \"assert corrected_sequence([5, 4, 3, 2, 1]) ==...
{ "split": "train", "index": 75919, "acecode_id": "evol_31575", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `getSum(arr)` that returns the sum of the elements in the list using a recursive method. You are not allowed to modify the given list during the computation. Use a helper function if needed.\nPlease reason step by step, then write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getSum([1, 2, 3]) == 6\", \"assert getSum([10, 20, 30, 40]) == 100\", \"assert getSum([5]) == 5\", \"assert getSum([]) == 0\", \"assert getSum([-1, -2, -3]) == -6\", \"assert getSum([100, -50, 50]) == 100\", \"assert getSum([0, 0, 0]) == 0\", \"assert getSum...
{ "split": "train", "index": 75920, "acecode_id": "evol_26475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a dictionary representing a data object and returns a serialized string representation of that object. The dictionary will contain the keys 'id', 'name', 'lang', and 'owner_id'. Your function should convert the dictionary i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_and_deserialize({'id': 1, 'name': 'Alice', 'lang': 'Python', 'owner_id': 101}) == ('id:1, name:Alice, lang:Python, owner_id:101', {'id': 1, 'name': 'Alice', 'lang': 'Python', 'owner_id': 101})\", \"assert serialize_and_deserialize({'id': 2, 'name':...
{ "split": "train", "index": 75921, "acecode_id": "oss_31688", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function named `copy_value(value, shared_types=None, memo=None)` that returns a deep copy of the input `value`, unless `value` is an instance of any type specified in `shared_types`. In that case, the function should return the original `value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert copy_value(10) == 10\", \"assert copy_value([1, 2, 3]) == [1, 2, 3]\", \"assert copy_value((1, 2, 3)) == (1, 2, 3)\", \"assert copy_value({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}\", \"assert copy_value('hello') == 'hello'\", \"assert copy_value(None) == None\",...
{ "split": "train", "index": 75922, "acecode_id": "bigcode_python_fns_14050", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of strings representing headers of a table, write a function `row_to_col_index_dict(headers: List[str]) -> Dict[str, int]` that returns a dictionary mapping each header string to its respective column index (0-based). The column index corresponds to the position of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert row_to_col_index_dict(['Name', 'Age', 'Country']) == {'Name': 0, 'Age': 1, 'Country': 2}\", \"assert row_to_col_index_dict(['A', 'B', 'C', 'D']) == {'A': 0, 'B': 1, 'C': 2, 'D': 3}\", \"assert row_to_col_index_dict(['Header1', 'Header2']) == {'Header1': 0, '...
{ "split": "train", "index": 75923, "acecode_id": "bigcode_python_fns_41656", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a representation for an energy bus in a simulation framework. Your job is to define a function that initializes a bus object based on a given label. Write a function called `initialize_energy_bus(label)` that takes a string `label` as input and retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_energy_bus('electricity_output') == {'label': 'electricity_output'}\", \"assert initialize_energy_bus('water_output') == {'label': 'water_output'}\", \"assert initialize_energy_bus('gas_output') == {'label': 'gas_output'}\", \"assert initialize_en...
{ "split": "train", "index": 75924, "acecode_id": "oss_5662", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a class named `BaseDocument` which has a method `has_field(field: str) -> bool`. This method checks if the given field is defined in the document. Your task is to implement a function `valid_field(obj: BaseDocument, field: str) -> bool` that returns `True` if the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert valid_field(BaseDocument(), 'title') == False\", \"assert valid_field(BaseDocument(), 'author') == False\", \"assert valid_field(BaseDocument(), 'date_created') == False\", \"assert valid_field(BaseDocument(), 'description') == False\", \"assert valid_field(...
{ "split": "train", "index": 75925, "acecode_id": "bigcode_python_fns_43751", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that simulates a simple file handler. The function takes a list of actions, where each action is a dictionary that specifies either a 'write' operation with a 'data' key containing a string to write to the file, or a 'read' operation with no add...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_handler([{'write': 'Hello, World!'}, {'read': None}, {'write': 'Goodbye!'}, {'read': None}]) == (2, 2)\", \"assert file_handler([{'read': None}, {'read': None}]) == (2, 0)\", \"assert file_handler([{'write': 'Test1'}]) == (0, 1)\", \"assert file_handler...
{ "split": "train", "index": 75926, "acecode_id": "oss_29081", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_character(word: str, n: int) -> str` that retrieves the character at the nth position from a given string. The function should return an appropriate error message if the string is empty, if the index is not a non-negative integer, or if the index is ou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_character('Hello', 0) == 'H'\", \"assert get_character('Hello', 1) == 'e'\", \"assert get_character('Hello', 4) == 'o'\", \"assert get_character('Python', 3) == 'h'\", \"assert get_character('Test', 2) == 's'\", \"assert get_character('OpenAI', 0) == 'O'...
{ "split": "train", "index": 75927, "acecode_id": "evol_8883", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given the root node of a balanced binary tree. Write a function that calculates the diameter of the tree. The diameter of a binary tree is defined as the number of nodes on the longest path between any two leaves in the tree. A leaf is defined as a node with no children...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert diameter(Node(1)) == 1\", \"assert diameter(Node(1, Node(2), Node(3))) == 3\", \"assert diameter(Node(1, Node(2, Node(4)), Node(3))) == 4\", \"assert diameter(Node(1, Node(2, Node(4, Node(8), Node(9))), Node(3))) == 5\", \"assert diameter(Node(1, Node(2, Nod...
{ "split": "train", "index": 75928, "acecode_id": "evol_9587", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given two lists of dictionaries representing two datasets related to materials science. Each dictionary contains a 'material_id' key among other fields. Your task is to implement a function that merges these two datasets based on the 'material_id' key. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert integrate_datasets([], [], 'material_id == 1', ['material_id']) == []\", \"assert integrate_datasets([{'material_id': 1}], [{'material_id': 2}], 'material_id == 1', ['material_id']) == []\", \"assert integrate_datasets([{'material_id': 1}], [], 'material_id ...
{ "split": "train", "index": 75929, "acecode_id": "oss_10131", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a value that can be either a single integer, float, string, or a sequence (list or tuple) of these types, implement a function `format_values(value)` that converts the input into a string representation. If the input is a single value (int, float, or str), return it as a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_values(10) == '10'\", \"assert format_values(3.14) == '3.14'\", \"assert format_values('hello') == 'hello'\", \"assert format_values([1, 2, 3]) == '1 2 3'\", \"assert format_values((4.5, 5.5)) == '4.5 5.5'\", \"assert format_values(['apple', 'banana',...
{ "split": "train", "index": 75930, "acecode_id": "bigcode_python_fns_41942", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of halos, where each halo is represented by a dictionary containing the following keys: 'HALOID', 'RA', 'DEC', 'Z', 'NGALS', and 'M200'. Your task is to write a Python function `find_common_halos(halos, truth_halos)` that takes two lists of halos (the first...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_halos([{'HALOID': 1, 'RA': 0, 'DEC': 0, 'Z': 0.2, 'NGALS': 6, 'M200': 1e13}, {'HALOID': 2, 'RA': 1, 'DEC': 1, 'Z': 0.6, 'NGALS': 3, 'M200': 1e14}], [{'HALOID': 1}, {'HALOID': 3}]) == [1]\", \"assert find_common_halos([{'HALOID': 1, 'RA': 0, 'DEC'...
{ "split": "train", "index": 75931, "acecode_id": "oss_32263", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_volume(shape: str, *dims: float) -> float` that computes the volume of various 3D geometric shapes including pyramids and torus. The function should accept a shape as a string and a variable number of dimensions. The valid shapes are 'pyramid' an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_volume('pyramid', 10, 12) == 40.0\", \"assert calculate_volume('pyramid', 2, 3) == 2.0\", \"assert calculate_volume('pyramid', 5, 10) == 16.666666666666668\", \"assert calculate_volume('pyramid', 0, 5) == 0.0\", \"assert calculate_volume('pyramid',...
{ "split": "train", "index": 75932, "acecode_id": "evol_1197", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates the type of input data based on certain conditions. The function, `validate_data_type`, should accept a parameter `data` which can either be a dictionary or a list of dictionaries. If `data` is a dictionary, it should b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_data_type({'key': 'value'}) == True\", \"assert validate_data_type([{ 'key1': 'value1' }, { 'key2': 'value2' }]) == True\", \"assert validate_data_type([]) == True\", \"assert validate_data_type({'key1': 'value1', 'key2': 'value2'}) == True\", \"ass...
{ "split": "train", "index": 75933, "acecode_id": "bigcode_python_fns_28754", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the process of finding an open port on a server. The function should return a randomly selected integer representing an open port number in the range of 1024 to 65535. The function must not take any parameters. Implement th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert 1024 <= find_open_port() <= 65535\", \"assert 1024 <= find_open_port() <= 65535\", \"assert 1024 <= find_open_port() <= 65535\", \"assert 1024 <= find_open_port() <= 65535\", \"assert 1024 <= find_open_port() <= 65535\", \"assert 1024 <= find_open_port() <= ...
{ "split": "train", "index": 75934, "acecode_id": "bigcode_python_fns_29496", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two states represented as integers, `state1` and `state2`. Implement a function `then(state1: int, state2: int) -> int` that returns the value of `state2` regardless of the value of `state1`. Essentially, this function simulates a binding operation where the outpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert then(1, 2) == 2\", \"assert then(3, 4) == 4\", \"assert then(0, 10) == 10\", \"assert then(-1, -5) == -5\", \"assert then(100, 200) == 200\", \"assert then(7, 3) == 3\", \"assert then(5, 8) == 8\", \"assert then(42, 42) == 42\", \"assert then(99, 1) == 1\", ...
{ "split": "train", "index": 75935, "acecode_id": "bigcode_python_fns_30492", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of numbers of the same length. You need to implement a function that subtracts the elements of the second list from the first and sums all the results together. However, one of the lists may contain a non-numeric string at an unknown position. Your funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_substraction([1, 1, 1], [1, 1, 1]) == 0\", \"assert sum_substraction([5, 10, 15], [1, 2, 3]) == 24\", \"assert sum_substraction([0, 0, 0], [0, 0, 'error']) == 0\", \"assert sum_substraction([1, 2, 3], [0, 0, 0]) == 6\", \"assert sum_substraction([1, 2], ...
{ "split": "train", "index": 75936, "acecode_id": "evol_19557", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function `generate_first_n_odd_numbers(n: int) -> List[int]` that takes an integer n as input and returns a list containing the first n odd numbers in ascending order. The function should not use any additional data structures for storing the numbers; instead, it should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_first_n_odd_numbers(1) == [1]\", \"assert generate_first_n_odd_numbers(2) == [1, 3]\", \"assert generate_first_n_odd_numbers(3) == [1, 3, 5]\", \"assert generate_first_n_odd_numbers(4) == [1, 3, 5, 7]\", \"assert generate_first_n_odd_numbers(5) == [...
{ "split": "train", "index": 75937, "acecode_id": "evol_15673", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function that takes in an array of integers where some elements may be 'None'. The function should compute the product of only the integer elements in the array and ignore the 'None' values. If the array contains no integers, the function should return None.\nPlease rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply([1, 3, None, 5, 7, None]) == 105\", \"assert multiply([None, None, None]) == None\", \"assert multiply([2, 3, None, 4]) == 24\", \"assert multiply([1, 2, 3, None]) == 6\", \"assert multiply([None, 1, None, 5]) == 5\", \"assert multiply([None, None, ...
{ "split": "train", "index": 75938, "acecode_id": "evol_24582", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing network interfaces and a string representing a Virtual Routing and Forwarding (VRF) context. Write a function that returns a list of interfaces associated with the given VRF context. If the VRF context is not found, return None. Your...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_interfaces_by_vrf(['eth0:VRF1', 'eth1:VRF2', 'eth2:VRF1'], 'VRF1') == ['eth0', 'eth2']\", \"assert get_interfaces_by_vrf(['eth0:VRF1', 'eth1:VRF2', 'eth2:VRF1'], 'VRF2') == ['eth1']\", \"assert get_interfaces_by_vrf(['eth0:VRF1', 'eth1:VRF2', 'eth2:VRF1'...
{ "split": "train", "index": 75939, "acecode_id": "bigcode_python_fns_30764", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of lists, your task is to implement a function that flattens the nested list into a single list containing all the elements in the order they appear. The input will be a list of lists where each inner list can contain elements of any type, including strings, intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten([['a', 'b'], ['c', 'd']]) == ['a', 'b', 'c', 'd']\", \"assert flatten([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert flatten([[True, False], [None, 'test']]) == [True, False, None, 'test']\", \"assert flatten([[], [], []]) == []\", \"assert flatten([[...
{ "split": "train", "index": 75940, "acecode_id": "bigcode_python_fns_14065", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a species ID, determine if the species should be considered as an intermediate compound. A species ID is defined as an intermediate compound if it starts with the prefix 'CMPD_'. Implement a function that takes a single parameter, 'specie_id', which ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_intermediate_compound('CMPD_123') == True\", \"assert is_intermediate_compound('CMPD_ABC') == True\", \"assert is_intermediate_compound('SPEC_123') == False\", \"assert is_intermediate_compound('CMPD_') == True\", \"assert is_intermediate_compound('CMPD_X...
{ "split": "train", "index": 75941, "acecode_id": "bigcode_python_fns_18001", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates setting a cookie and generating a greeting message. The function should take no parameters and return a string that consists of a greeting message in HTML format. The greeting message should be '<h1>Hello! How are you?<...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_greeting() == '<h1>Hello! How are you?</h1> User: CherryPyUser'\", \"assert generate_greeting() == '<h1>Hello! How are you?</h1> User: CherryPyUser'\", \"assert generate_greeting() == '<h1>Hello! How are you?</h1> User: CherryPyUser'\", \"assert gen...
{ "split": "train", "index": 75942, "acecode_id": "oss_22844", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers representing the x and y components of a point in a 2D space, and a third integer representing the direction of a vector, create a function `create_vector(x: int, y: int, direction: int) -> dict` that returns a dictionary representing the vector with the keys...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_vector(1, 2, 3) == {'point': (1, 2), 'direction': 3}\", \"assert create_vector(0, 0, 0) == {'point': (0, 0), 'direction': 0}\", \"assert create_vector(-1, -2, 1) == {'point': (-1, -2), 'direction': 1}\", \"assert create_vector(5, 5, 10) == {'point': (...
{ "split": "train", "index": 75943, "acecode_id": "bigcode_python_fns_30137", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom validation function for a data processing application. Your function should check if all required columns are present in the input data. Implement a function `custom_validation(data_columns, required_columns)` that takes two lists of string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_validation(['column1', 'column2'], ['column1', 'column2']) == True\", \"assert custom_validation(['columnA', 'columnB', 'columnC'], ['columnA', 'columnB']) == True\", \"assert custom_validation(['column1', 'column2', 'column3'], ['column3']) == True\"...
{ "split": "train", "index": 75944, "acecode_id": "oss_24983", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function `process_strings(strings: List[str]) -> Tuple[str, Dict[str, int]]` that returns the longest common prefix among the strings and a dictionary that maps each string to its corresponding vowel count. If there is no common prefix, retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_strings(['hello', 'world', 'hi']) == ('', {'hello': 2, 'world': 1, 'hi': 1})\", \"assert process_strings(['flower', 'flow', 'flight']) == ('fl', {'flower': 2, 'flow': 1, 'flight': 1})\", \"assert process_strings(['dog', 'racecar', 'car']) == ('', {'d...
{ "split": "train", "index": 75945, "acecode_id": "evol_14706", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function called `validate_password` that checks if a given password meets the following requirements: it must be at least 10 characters long, contain at least one uppercase letter, one lowercase letter, one number, one special symbol, and must not contain any seq...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_password('Aa1!abcde') == False\", \"assert validate_password('A1!bcdefghij') == True\", \"assert validate_password('abcdefghij') == False\", \"assert validate_password('A1!B2@C3') == False\", \"assert validate_password('Aaaa1!bcdef') == False\", \"a...
{ "split": "train", "index": 75946, "acecode_id": "evol_29831", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function to compute the factorial of a non-negative integer. The function should raise a TypeError if the input is not an integer and a ValueError if the input is a negative integer. The function should return the factorial of the given integer, where the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(10) == 3628800\", \"assert factorial(6) == 720\", \"assert factor...
{ "split": "train", "index": 75947, "acecode_id": "evol_35140", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a greeting message based on the user's name. The function should take a single parameter, `name`, which is a string representing the user's name. It should return a greeting message in the following format: 'Hello, [name]! ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_greeting('Alice') == 'Hello, Alice! Welcome to the task management system!'\", \"assert generate_greeting('Bob') == 'Hello, Bob! Welcome to the task management system!'\", \"assert generate_greeting('') == 'Hello! Welcome to the task management syst...
{ "split": "train", "index": 75948, "acecode_id": "oss_946", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that returns the smallest prime number in a list of integers. The list may contain negative integers and may contain up to 10,000 elements. If there are no prime numbers in the list, return None.\nPlease reason step by step, then write a self-contained Python s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_prime([4, 6, 8, 10, 2, 3]) == 2\", \"assert smallest_prime([-1, -2, -3, -4]) == None\", \"assert smallest_prime([15, 22, 33, 44]) == None\", \"assert smallest_prime([2, 3, 5, 7]) == 2\", \"assert smallest_prime([10, 11, 12, 13]) == 11\", \"assert sm...
{ "split": "train", "index": 75949, "acecode_id": "evol_27110", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that transforms an input string based on specific rules. The function should perform the following transformations: 1. Invert the case of each character (uppercase becomes lowercase and vice versa). 2. If a character is a digit and is a pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert enhanced_string_transformation('Hello123') == 'hELLO234' or 'hELLO234' or 'hELLO324' or 'hELLO342' or 'hELLO423' or 'hELLO432'\", \"assert enhanced_string_transformation('123456') == '234567' or '234576' or '234657' or '234675' or '234756' or '234765'\", \"a...
{ "split": "train", "index": 75950, "acecode_id": "evol_9120", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Determine if All 1's Are Separated by at Least K Positions. Given an array `nums` composed of 0s and 1s, and an integer `k`, return `True` if every 1 in the array is at least `k` positions distant from any other 1, and `False` otherwise.\nPlease reason step by step, then write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert kApart([1,0,0,0,1,0,0,1], 2) == True\", \"assert kApart([1,0,0,1,0,1], 2) == False\", \"assert kApart([1,1,1,1,1], 0) == True\", \"assert kApart([0,1,0,1], 1) == True\", \"assert kApart([1,0,1], 1) == True\", \"assert kApart([0,0,0,0], 1) == True\", \"assert...
{ "split": "train", "index": 75951, "acecode_id": "evol_21023", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `sort_even_indices_in_chunks(l: list, k: int) -> list` that accepts a list `l` and an integer `k`. The function should create a new list that matches `l` at odd indices. At even indices, the elements should correspond to the positions in list `l`, but sorte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_even_indices_in_chunks([1, 2, 3], 2) == [1, 2, 3]\", \"assert sort_even_indices_in_chunks([1, 4, 2, 3, 5, 6, 7, 8], 2) == [1, 4, 2, 3, 5, 6, 7, 8]\", \"assert sort_even_indices_in_chunks([1], 1) == [1]\", \"assert sort_even_indices_in_chunks([], 3) == [...
{ "split": "train", "index": 75952, "acecode_id": "evol_2210", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a date of birth as a string in the format 'YYYY-MM-DD', return the number of months until full retirement age (FRA) based on the following criteria: 1. If the date of birth is on or before '1938-01-01', the FRA is 65 years (780 months). 2. If the date of birth is between ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_fra_months('1938-01-01') == 780\", \"assert calculate_fra_months('1938-01-02') == 782\", \"assert calculate_fra_months('1939-01-01') == 782\", \"assert calculate_fra_months('1939-01-02') == 784\", \"assert calculate_fra_months('1940-01-01') == 784\...
{ "split": "train", "index": 75953, "acecode_id": "bigcode_python_fns_2592", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `manage_notes` that simulates a simple note-taking application with the following operations: 'create', 'retrieve', 'update', and 'delete'. The function takes in two parameters: an operation string (either 'create', 'retrieve', 'update', or 'delete') and an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_notes('create', 'First note') == 'Note created'\", \"assert manage_notes('create', 'Second note') == 'Note created'\", \"assert manage_notes('delete', 3) == 'Note not found'\", \"assert manage_notes('create', 'Third note') == 'Note created'\", \"asser...
{ "split": "train", "index": 75954, "acecode_id": "evol_16512", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to generate a multiplication table for a given number. The function should take an integer input and return a list of strings, where each string represents a line in the multiplication table for that number from 1 to 10. The format of eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_multiplication_table(1) == ['1 x 1 = 1', '1 x 2 = 2', '1 x 3 = 3', '1 x 4 = 4', '1 x 5 = 5', '1 x 6 = 6', '1 x 7 = 7', '1 x 8 = 8', '1 x 9 = 9', '1 x 10 = 10']\", \"assert generate_multiplication_table(2) == ['2 x 1 = 2', '2 x 2 = 4', '2 x 3 = 6', '...
{ "split": "train", "index": 75955, "acecode_id": "oss_3091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representation of an item, where the keys are the attributes of the item and the values are the corresponding values of these attributes. Implement a function `get_pretty_table(item: Dict[str, Any], output_fields: List[str]) -> List[List[str]]` that t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_pretty_table({'name': 'Alice', 'age': 30, 'city': 'New York'}, ['name', 'age']) == [['Attribute', 'Value'], ['name', 'Alice'], ['age', 30]]\", \"assert get_pretty_table({'product': 'Laptop', 'price': 999.99, 'stock': 25}, ['product', 'stock']) == [['Attr...
{ "split": "train", "index": 75956, "acecode_id": "bigcode_python_fns_21719", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `merge_scores(scores_test: dict, scores_val: dict) -> dict` that aggregates scores from two dictionaries. The `scores_test` dictionary contains scores with keys starting with 'test/' and the `scores_val` dictionary contains corresponding v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_scores({'test/score1': {'value': 80.0, 'string': '80.00'}, 'test/score2': {'value': 90.0, 'string': '90.00'}}, {'val/score1': {'value': 100.0, 'string': '100.00'}, 'val/score2': {'value': 70.0, 'string': '70.00'}}) == {'final/score1': {'value': 90.0, '...
{ "split": "train", "index": 75957, "acecode_id": "bigcode_python_fns_40906", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list of integers representing a matrix, and a list of integers representing scale factors. Your task is to scale each row of the matrix by the corresponding scale factor from the list. The number of rows in the matrix must match the number of scale factors in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_matrix([[1, 2], [3, 4]], [2, 3]) == [[2, 4], [9, 12]]\", \"assert scale_matrix([[5, 10], [20, 30]], [2]) == []\", \"assert scale_matrix([[1], [2], [3]], [1, 2, 3]) == [[1], [4], [9]]\", \"assert scale_matrix([], [1, 2]) == []\", \"assert scale_matrix([...
{ "split": "train", "index": 75958, "acecode_id": "bigcode_python_fns_3590", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a social media post. The function should take in the following parameters: a string for the text content of the post (maximum length of 280 characters), an integer for the number of likes (default is 0), an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_post('Hello, world!', 10, 2, '2023-10-01 12:00:00', 'toast') == {'text': 'Hello, world!', 'likes': 10, 'dislikes': 2, 'time_created': '2023-10-01 12:00:00', 'choose': 'toast'}\", \"assert create_post('Another post!', 5, 3, '2023-10-02 15:30:00', 'roas...
{ "split": "train", "index": 75959, "acecode_id": "oss_18964", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of permutations, where each permutation is represented as a list of integers. Your task is to compute the sum of the maximum values from each permutation. Implement a function `compute_max_sum(perms: List[List[int]]) -> int` that takes in a list of permutat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_max_sum([[1], [2], [3]]) == 6\", \"assert compute_max_sum([[1, 1], [2, 2], [3, 3]]) == 6\", \"assert compute_max_sum([[1]]) == 1\", \"assert compute_max_sum([[5, 3, 7], [2, 6, 1], [8, 4]]) == 21\", \"assert compute_max_sum([[4, 4], [4, 4], [4, 4]]) =...
{ "split": "train", "index": 75960, "acecode_id": "bigcode_python_fns_19624", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of dialogue exchanges, where each exchange is represented as a dictionary containing 'question' and 'answer' keys, write a function `extract_questions(dialogues)` that returns a list of all questions from the given dialogues. Each dialogue will be a dictionary stru...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_questions([{'question': 'What is your name?', 'answer': 'I am an AI.'}, {'question': 'How are you?', 'answer': 'I am fine, thank you.'}]) == ['What is your name?', 'How are you?']\", \"assert extract_questions([{'question': 'What is the weather today...
{ "split": "train", "index": 75961, "acecode_id": "evol_25746", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a repetition factor, create a function that constructs a new list by repeating the original list the specified number of times. The function should take two parameters: a list of integers `A` and an integer `reps`. The output should be a single list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert repeat_list([1, 2, 3], 2) == [1, 2, 3, 1, 2, 3]\", \"assert repeat_list([4, 5], 3) == [4, 5, 4, 5, 4, 5]\", \"assert repeat_list([], 5) == []\", \"assert repeat_list([7], 0) == []\", \"assert repeat_list([1, 2], -1) == []\", \"assert repeat_list([10, 20, 30]...
{ "split": "train", "index": 75962, "acecode_id": "bigcode_python_fns_45897", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `format_exception_info(exc_type, exc_value, file_name, line_number, function_name)` that formats the details of an exception into a single line string suitable for logging. The function should take the following parameters: \n- `exc_type...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_exception_info('ValueError', 'invalid literal for int() with base 10: abc', 'example.py', 42, 'my_function') == 'exception in my_function line 42 (ValueError: invalid literal for int() with base 10: abc)'\", \"assert format_exception_info('TypeError',...
{ "split": "train", "index": 75963, "acecode_id": "bigcode_python_fns_41165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function `get_subfield(institution)` that takes a single string argument `institution`. This function should return the subfield associated with the given institution. If the institution is not linked to any subfield, the function should return None. Implement t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_subfield('University A') == 'Computer Science'\", \"assert get_subfield('University B') == 'Biology'\", \"assert get_subfield('University C') == None\", \"assert get_subfield('University E') == None\", \"assert get_subfield('University H') == None\", \"a...
{ "split": "train", "index": 75964, "acecode_id": "bigcode_python_fns_34667", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the argument parsing for a visualization tool. The function should accept a geometry file location, a data file location, and several optional boolean flags: one indicating whether to save images of plot windows (`images`),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments('geometry.txt', 'data.txt') == {'geofile': 'geometry.txt', 'datafile': 'data.txt', 'images': False, 'timestamp': False, 'sessionfile': False, 'openvisit': False}\", \"assert parse_arguments('geometry.txt', 'data.txt', images=True) == {'geofil...
{ "split": "train", "index": 75965, "acecode_id": "bigcode_python_fns_13508", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that takes a string input and returns the string converted to title case. Title case means that the first letter of each word is capitalized and all other letters are in lowercase. For example, the input 'hello world' should return 'Hello World'.\nPl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert title_case('hello world') == 'Hello World'\", \"assert title_case('THIS IS A TEST') == 'This Is A Test'\", \"assert title_case('python programming') == 'Python Programming'\", \"assert title_case('a quick brown fox') == 'A Quick Brown Fox'\", \"assert title_...
{ "split": "train", "index": 75966, "acecode_id": "evol_6379", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s and an integer k, implement a function `palindrome_partitioning(s, k)` that returns the minimum number of changes required to partition the string into k palindromic substrings. A change is defined as modifying a single character in the substring to make it a p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert palindrome_partitioning('abc', 2) == 1\", \"assert palindrome_partitioning('abcb', 2) == 0\", \"assert palindrome_partitioning('aabb', 2) == 0\", \"assert palindrome_partitioning('racecar', 1) == 0\", \"assert palindrome_partitioning('a', 1) == 0\", \"assert...
{ "split": "train", "index": 75967, "acecode_id": "evol_4080", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the number of staff in a company based on their leave status and organizes department data. The function should take in two parameters: a list of staff objects and a list of department objects. Each staff object is represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_chart_data([], []) == {'staff': {'is_worker': 0, 'not_worker': 0, 'total_worker': 0}, 'department': []}\", \"assert get_chart_data([{'is_leave': False}], [{'name': 'Finance', 'staff_of_department': [{'is_leave': False}]}]) == {'staff': {'is_worker': 1, '...
{ "split": "train", "index": 75968, "acecode_id": "bigcode_python_fns_45237", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function `generate_secure_string(length)` that generates a random string of a specified length composed of uppercase letters, lowercase letters, and digits. The generated string should contain at least one uppercase letter, one lowercase letter, and one digit to ensure ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_secure_string(3) != ''\", \"assert len(generate_secure_string(12)) == 12\", \"assert len(generate_secure_string(5)) == 5\", \"assert generate_secure_string(1) == ''\", \"assert generate_secure_string(0) == ''\", \"assert generate_secure_string(2) ==...
{ "split": "train", "index": 75969, "acecode_id": "evol_3280", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string that may represent either a Roman numeral or an Arabic number, implement a function `convertStringToArabic(numStr: str) -> int` that converts the input string into its equivalent Arabic numeral. The function should handle the following scenarios: If the input str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convertStringToArabic('IV') == 4\", \"assert convertStringToArabic('123') == 123\", \"assert convertStringToArabic('MC') == 1100\", \"assert convertStringToArabic('XLII') == 42\", \"assert convertStringToArabic('MMMCMXCIX') == 3999\", \"assert convertStringT...
{ "split": "train", "index": 75970, "acecode_id": "bigcode_python_fns_22132", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating the metadata of a Python package represented as a dictionary. The validation criteria are as follows: 1. The 'packages' key must exist and its value must be a list of strings. 2. The 'license' key must exist and its value must be a non-empty strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_package_metadata({'packages': ['pkg1', 'pkg2'], 'license': 'MIT', 'description': 'A simple package', 'long_description': 'This package does something', 'long_description_content_type': 'text/markdown', 'install_requires': ['numpy'], 'url': 'https://...
{ "split": "train", "index": 75971, "acecode_id": "oss_4224", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a 2D grid representing a binary image where 1s represent black pixels and 0s represent white pixels. Your task is to write a function that returns the coordinates of the bounding box of the largest black region in the image. The bounding box is represented by the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largestBlackRegionBoundingBox([[1,1,0],[1,1,0],[0,0,0]]) == ((0, 0), (1, 1))\", \"assert largestBlackRegionBoundingBox([[0,0,0],[0,0,0],[0,0,0]]) == ((0, 0), (0, 0))\", \"assert largestBlackRegionBoundingBox([[1,0,1],[1,1,1],[0,1,0]]) == ((0, 0), (2, 2))\", ...
{ "split": "train", "index": 75972, "acecode_id": "oss_7351", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a user's worker is associated with a specific project of a todo item. You will be provided with a worker's project list and a todo item's project ID. Your function should return True if the worker is associated with the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_permission([1, 2, 3], 2) == True\", \"assert has_permission([1, 2, 3], 4) == False\", \"assert has_permission([], 1) == False\", \"assert has_permission([5, 6, 7], 5) == True\", \"assert has_permission([10], 10) == True\", \"assert has_permission([9, 8],...
{ "split": "train", "index": 75973, "acecode_id": "oss_34230", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the Lorentz factor (gamma) and the velocity parameter (beta) for a particle based on its velocity. The Lorentz factor and velocity parameter are fundamental concepts in special relativity and are defined as follows: Beta ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_beta_gamma(0) == (0.0, 1.0)\", \"assert calculate_beta_gamma(1.5e8) == (0.5, 1.1547005383792517)\", \"assert calculate_beta_gamma(0.1 * (3.0e8)) == (0.1, 1.005037815259212)\", \"assert calculate_beta_gamma(0.5 * (3.0e8)) == (0.5, 1.1547005383792517...
{ "split": "train", "index": 75974, "acecode_id": "oss_9752", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `jaccard_coefficient(y_true: List[int], y_pred: List[int]) -> float` that calculates the Jaccard coefficient between two binary lists. The Jaccard coefficient is defined as the size of the intersection divided by the size of the union of two sets. Both `y_t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert jaccard_coefficient([1, 0, 1], [1, 0, 1]) == 1.0\", \"assert jaccard_coefficient([0, 0, 0], [0, 0, 0]) == 1.0\", \"assert jaccard_coefficient([1, 1, 1], [1, 1, 1]) == 1.0\", \"assert jaccard_coefficient([0, 0], [1, 1]) == 0.0\", \"assert jaccard_coefficient(...
{ "split": "train", "index": 75975, "acecode_id": "bigcode_python_fns_27903", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a string `seq`, remove a specified prefix `prefix` from the beginning of `seq` if it exists. If `prefix` is not found at the start of `seq`, return `seq` unchanged. The function should be case-sensitive. Implement a function `remove_prefix(prefix: str, seq: str) -> str` t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_prefix('ab', 'abcd') == 'cd'\", \"assert remove_prefix('abc', 'abcdef') == 'def'\", \"assert remove_prefix('hello', 'hello world') == ' world'\", \"assert remove_prefix('prefix', 'prefix') == ''\", \"assert remove_prefix('', 'example') == 'example'\",...
{ "split": "train", "index": 75976, "acecode_id": "bigcode_python_fns_17728", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a float number, determine its polarity level. The function should return 'positive' if the number is greater than zero, 'neutral' if the number is exactly zero, and 'negative' if the number is less than zero. Implement a function `determine_polarity(num: float) -> str` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_polarity(0.8) == 'positive'\", \"assert determine_polarity(-0.5) == 'negative'\", \"assert determine_polarity(0.0) == 'neutral'\", \"assert determine_polarity(1.5) == 'positive'\", \"assert determine_polarity(-1.2) == 'negative'\", \"assert determi...
{ "split": "train", "index": 75977, "acecode_id": "bigcode_python_fns_25101", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary tree, implement a function `maxDepth(root)` that returns the maximum depth of the tree. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. If the tree is empty, return 0. The tree is represented by t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxDepth(None) == 0\", \"assert maxDepth(TreeNode(1)) == 1\", \"assert maxDepth(TreeNode(1, TreeNode(2))) == 2\", \"assert maxDepth(TreeNode(1, TreeNode(2), TreeNode(3))) == 2\", \"assert maxDepth(TreeNode(1, TreeNode(2, TreeNode(4)), TreeNode(3))) == 3\", \...
{ "split": "train", "index": 75978, "acecode_id": "evol_17865", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates changing the status of a bot in a messaging application. The function should take a string input representing the activity type (like 'listening', 'watching', etc.) and a string input for the activity name. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert change_bot_status('listening', 'music') == 'Bot is listening to music'\", \"assert change_bot_status('listening', 'podcasts') == 'Bot is listening to podcasts'\", \"assert change_bot_status('listening', 'news') == 'Bot is listening to news'\", \"assert chang...
{ "split": "train", "index": 75979, "acecode_id": "bigcode_python_fns_45392", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates sending a command to a device and receiving a response. The function `send_command` takes two parameters: a command name (a string) and a list of parameters (which can be of any type). The function should return a list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_command('TEST', [1, 'string', 3.5]) == ['Success', 'Failure', 'Failure']\", \"assert send_command('COMMAND', [2, 4, 6]) == ['Success', 'Success', 'Success']\", \"assert send_command('CHECK', ['text', 0, -1]) == ['Failure', 'Success', 'Success']\", \"ass...
{ "split": "train", "index": 75980, "acecode_id": "bigcode_python_fns_17784", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `search_papers(papers: List[Paper], keywords: str) -> List[Paper]` that takes a list of Paper objects and a string of keywords. The function should return a list of papers whose keywords contain the specified keywords string. The search should be case-sensi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_papers([], 'AI') == []\", \"assert search_papers([Paper('AI in Healthcare', 'Discusses AI in healthcare', 'AI, Healthcare', User('john_doe', 'john@example.com', 'password', 'John', 'Doe'))], 'healthcare') == []\", \"assert search_papers([Paper('Deep L...
{ "split": "train", "index": 75981, "acecode_id": "evol_4644", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given an integer array `nums`, you can choose exactly one index (0-indexed) and remove the element. An array is considered fair if the sum of the values at the even indices equals the sum of the values at the odd indices. Your task is to implement a function that returns the nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert waysToMakeFair([2, 1, 6, 4]) == (1, [1])\", \"assert waysToMakeFair([1, 1, 1]) == (3, [0, 1, 2])\", \"assert waysToMakeFair([1, 2, 3]) == (0, [])\", \"assert waysToMakeFair([1, 2, 3, 4, 5]) == (0, [])\", \"assert waysToMakeFair([2, 2, 2, 2, 2]) == (5, [0, 1,...
{ "split": "train", "index": 75982, "acecode_id": "evol_17443", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `create_abstract_class()` that creates an abstract base class with two abstract methods and two abstract properties. Then, implement a subclass that correctly implements these abstract methods and properties. The abstract methods should be named `do_somethi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_abstract_class().first_property == 'Value from first property'\", \"assert create_abstract_class().second_property == 'Value from second property'\", \"assert hasattr(create_abstract_class(), 'first_property')\", \"assert hasattr(create_abstract_class...
{ "split": "train", "index": 75983, "acecode_id": "evol_28958", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You have a list of events, each represented by a dictionary containing an 'id' and a 'start_time' in the format 'HH:MM'. Write a function that filters these events based on a given time range. The function should take a list of events and two strings representing the start and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_events([{'id': 1, 'start_time': '19:00'}, {'id': 2, 'start_time': '12:00'}], '18:00', '19:00') == [1]\", \"assert filter_events([{'id': 1, 'start_time': '19:00'}, {'id': 2, 'start_time': '12:00'}], '12:00', '19:00') == [1, 2]\", \"assert filter_events...
{ "split": "train", "index": 75984, "acecode_id": "bigcode_python_fns_42526", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, return the sum of the absolute values of distinct prime numbers multiplied by the product of the signs of each distinct prime number in the array, where the sign can be 1 (positive), -1 (negative), or 0 (if the number is zero). If the array contains ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prod_signs([0, 1, 4]) == None\", \"assert prod_signs([]) == None\", \"assert prod_signs([1, -1, 0]) == None\", \"assert prod_signs([-19, 19, 19, 0]) == 0\", \"assert prod_signs([4, 6, 8, 10]) == None\", \"assert prod_signs([5, 5, -5, 0]) == 0\", \"assert pro...
{ "split": "train", "index": 75985, "acecode_id": "evol_27806", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes either a string or a list of strings and returns a single formatted string. If the input is a string, it should be returned as is. If the input is a list of strings, each string in the list should be formatted as a JSON str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_string('Hello, World!', 50) == 'Hello, World!'\", \"assert format_string('Single string', 100) == 'Single string'\", \"assert format_string('Just another test', 50) == 'Just another test'\", \"assert format_string('A', 10) == 'A'\", \"assert format_st...
{ "split": "train", "index": 75986, "acecode_id": "bigcode_python_fns_38139", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of account names represented as strings. Your task is to implement a function that takes this list and returns a single string that concatenates the account IDs corresponding to each account name in the format of a space-separated string, where each ID is e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_account_ids(['alice', 'bob', 'charlie']) == '\\\"alice_id\\\" \\\"bob_id\\\" \\\"charlie_id\\\" '\", \"assert get_account_ids(['david']) == '\\\"david_id\\\" '\", \"assert get_account_ids(['eve', 'frank']) == '\\\"eve_id\\\" \\\"frank_id\\\" '\", \"asser...
{ "split": "train", "index": 75987, "acecode_id": "bigcode_python_fns_20840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that takes a list of integers and returns a list of the product of all distinct prime factors for each integer in the input list. Each product should be calculated for every number in the list, and the function should handle large lists efficiently.\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_of_distinct_prime_factors([1]) == [1]\", \"assert product_of_distinct_prime_factors([2, 3, 5, 7]) == [2, 3, 5, 7]\", \"assert product_of_distinct_prime_factors([12, 18, 24]) == [6, 6, 6]\", \"assert product_of_distinct_prime_factors([101, 103, 107]) ...
{ "split": "train", "index": 75988, "acecode_id": "evol_11687", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of queries and their corresponding results. Each query has a specific format that includes a query string, a domain, and a list of results. Your function should count the total number of unique results added acro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_query_results([{'query': 'query1', 'domain': 'domain1', 'results': [{'result_fxf': 'fxf1', 'result_position': 1}, {'result_fxf': 'fxf2', 'result_position': 2}]}]) == (2, 0)\", \"assert process_query_results([{'query': 'query1', 'domain': 'domain1', '...
{ "split": "train", "index": 75989, "acecode_id": "bigcode_python_fns_45695", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the positions of elements in a linear array. Your task is to write a function `calculate_total_distance(positions: List[int], bonds: List[Tuple[int, int]]) -> int` that calculates the total distance between pairs of positions specif...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_distance([1, 2, 3, 4], [(0, 1), (1, 2), (2, 3)]) == 3\", \"assert calculate_total_distance([10, 20, 30], [(0, 1), (1, 2)]) == 20\", \"assert calculate_total_distance([1], [(0, 1)]) == 0\", \"assert calculate_total_distance([5, 5, 5, 5], [(0, ...
{ "split": "train", "index": 75990, "acecode_id": "bigcode_python_fns_1580", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the raw data of section scores for different courses. Your task is to implement a function that transforms this raw data into a normalized format. The normalization is defined as follows: for each score, if the score is greater than...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_section_data([-1, 2, -3, 4]) == [0, 2, 0, 4]\", \"assert transform_section_data([0, -5, 10]) == [0, 0, 10]\", \"assert transform_section_data([-10, -20, -30]) == [0, 0, 0]\", \"assert transform_section_data([5, 4, 3]) == [5, 4, 3]\", \"assert trans...
{ "split": "train", "index": 75991, "acecode_id": "bigcode_python_fns_35386", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that extracts all numeric characters from a given string. The input string may contain various non-numeric characters, and your function should return a string that consists only of the numeric characters found in the input. If no numeric...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_numbers('Discount: 20% off!') == '20'\", \"assert extract_numbers('Total cost is $15.99') == '1599'\", \"assert extract_numbers('No numbers here!') == '0'\", \"assert extract_numbers('Save 30% on items!') == '30'\", \"assert extract_numbers('Price: 1...
{ "split": "train", "index": 75992, "acecode_id": "bigcode_python_fns_15376", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `below_threshold(l: list, t: int) -> bool` that checks if all integers in the given list `l` are less than or equal to a specified threshold `t`. If the list contains non-integer elements, they should be ignored while making the comparison. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert below_threshold([1, 2, '4', 10], 100) == True\", \"assert below_threshold([1, 20, 4, '10'], 5) == False\", \"assert below_threshold([], 10) == True\", \"assert below_threshold([5, 'a', 3.5, 2], 10) == True\", \"assert below_threshold([5, -1, 0], 5) == True\"...
{ "split": "train", "index": 75993, "acecode_id": "evol_15285", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a float angle, write a function `wrap_angle(angle: float) -> float` that ensures the angle is between -360 and 360 degrees. The function should return the normalized angle such that if the angle is positive, it is reduced to a value within the range by taking the modulus ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert wrap_angle(370) == 10\", \"assert wrap_angle(720) == 0\", \"assert wrap_angle(-720) == 0\", \"assert wrap_angle(180) == 180\", \"assert wrap_angle(-180) == -180\", \"assert wrap_angle(0) == 0\", \"assert wrap_angle(45) == 45\", \"assert wrap_angle(-45) == -4...
{ "split": "train", "index": 75994, "acecode_id": "bigcode_python_fns_20162", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a given tag slug according to specific rules. The tag slug must consist of word characters (letters, digits, and underscores) and Chinese characters, and it can be of any length but cannot be empty. Write a function `is_val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_tag_slug('valid_tag_123') == True\", \"assert is_valid_tag_slug('\\u6709\\u6548\\u6807\\u7b7e') == True\", \"assert is_valid_tag_slug('valid_tag_\\u6709\\u6548') == True\", \"assert is_valid_tag_slug('') == False\", \"assert is_valid_tag_slug('tag_w...
{ "split": "train", "index": 75995, "acecode_id": "oss_21952", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that removes all empty strings from a given list of strings. The function should take a list of strings as input and return a new list that contains only the non-empty strings. For example, given the input list ['apple', '', 'banana', ' ', 'orange'], the ou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_empty_strings(['', '', '', '']) == []\", \"assert filter_empty_strings(['a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert filter_empty_strings(['', 'a', '', 'b', '', 'c', '']) == ['a', 'b', 'c']\", \"assert filter_empty_strings(['hello', 'world', '', '']...
{ "split": "train", "index": 75996, "acecode_id": "evol_26783", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a Python function to verify a password by ensuring it consists of at least 8 characters, including at least one uppercase letter, one lowercase letter, one digit, and one special character from the set { '$', '@', '#', '%', '&' }. Additionally, the password must not cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_password('Password1$') == 'Valid password'\", \"assert verify_password('Pass1@') == 'Invalid: Password should be at least 8 characters'\", \"assert verify_password('Short1$') == 'Invalid: Password should be at least 8 characters'\", \"assert verify_pa...
{ "split": "train", "index": 75997, "acecode_id": "evol_21248", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function that takes this list as input and returns a new list containing only the unique elements from the original list, preserving the order of their first occurrence. Implement the function `get_unique_elements(arr: L...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 2, 3, 4, 1, 5]) == [1, 2, 3, 4, 5]\", \"assert get_unique_elements([1, 1, 1, 1]) == [1]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([5, 4, 3, 2, 1]) == [5, 4, 3, 2, 1]\", \"assert get_unique_elements([...
{ "split": "train", "index": 75998, "acecode_id": "bigcode_python_fns_44905", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a list of elements that do not have a corresponding negative counterpart in the list. For example, if the list contains both 1 and -1, they will cancel each other out, and neither will be included in the result. If an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unpaired_elements([1, -1, 2, -2, 3, 4]) == [3, 4]\", \"assert find_unpaired_elements([-5, 5, 5, -5, 6]) == [6]\", \"assert find_unpaired_elements([0, 0, 1, -1]) == []\", \"assert find_unpaired_elements([10, -10, 20, 30]) == [20, 30]\", \"assert find_unp...
{ "split": "train", "index": 75999, "acecode_id": "evol_11994", "num_tests": 15 }