data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a bug identifier (a string) and an optional description (a string), and returns a formatted string representing the bug entry. If a description is provided, the output should be in the format 'Bug ID: [bug_id], Description: [de... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_bug_entry('12345', 'A critical error occurred.') == 'Bug ID: 12345, Description: A critical error occurred.'\", \"assert format_bug_entry('67890') == 'Bug ID: 67890'\", \"assert format_bug_entry('', 'A minor issue.') == 'Invalid Bug ID'\", \"assert fo... | {
"split": "train",
"index": 74800,
"acecode_id": "bigcode_python_fns_49899",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a password management system for a web application. Your goal is to create a function `validate_password(input_password: str, stored_password: str) -> bool` that checks if an input password matches a stored password after applying a specific enc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_password('mypassword', 'randomsalt$hashedvalue') == False\", \"assert validate_password('wrongpassword', 'abc123$hashedvalue') == False\", \"assert validate_password('anotherPass', 'randomSalt$hashedOutput') == False\", \"assert validate_password('q... | {
"split": "train",
"index": 74801,
"acecode_id": "oss_11447",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `string_to_int_list(input_string: str) -> List[int]` that takes a string of space-separated integers and converts it into a list of integers. The input string may contain leading or trailing whitespace, and it is guaranteed that all substrings can be conver... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_int_list('1 2 3 4 5') == [1, 2, 3, 4, 5]\", \"assert string_to_int_list(' 10 20 30 ') == [10, 20, 30]\", \"assert string_to_int_list('7 8 9') == [7, 8, 9]\", \"assert string_to_int_list(' 100') == [100]\", \"assert string_to_int_list('4 5') == [4, ... | {
"split": "train",
"index": 74802,
"acecode_id": "evol_2837",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two sorted lists of integers, write a function that computes the intersection of these two lists. The function should return a new sorted list that contains only the elements that are present in both input lists. The intersection must not contain duplicate elements, even ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersect_sorted_lists([1, 2, 2, 3], [2, 2, 3, 4]) == [2, 3]\", \"assert intersect_sorted_lists([1, 3, 5], [2, 4, 6]) == []\", \"assert intersect_sorted_lists([], []) == []\", \"assert intersect_sorted_lists([1, 1, 1], [1, 1, 1]) == [1]\", \"assert intersect... | {
"split": "train",
"index": 74803,
"acecode_id": "bigcode_python_fns_35330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a version string representing a software version and a list of release versions. Your task is to determine whether an update is available for the given version. An update is considered available if the given version is not in the release list and its suffix does n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_update_available('3.3.2', ['3.3.1']) == True\", \"assert is_update_available('3.3.2.dev0', ['3.3.1']) == False\", \"assert is_update_available('3.3.1', ['3.3.1', '3.3.0']) == False\", \"assert is_update_available('4.0.0', ['3.3.1', '3.3.0']) == True\", \"... | {
"split": "train",
"index": 74804,
"acecode_id": "bigcode_python_fns_42399",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple user authentication system for a command-line application. Your task is to implement a function `check_user_money(username, users)` that checks the logged-in status of a user and returns the user's money if they are logged in, or an err... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_user_money('user1', {'user1': {'password': 'password123', 'logged_in': True}}) == \\\"User's money: $1000\\\"\", \"assert check_user_money('user2', {'user1': {'password': 'password123', 'logged_in': True}, 'user2': {'password': 'mypassword', 'logged_in... | {
"split": "train",
"index": 74805,
"acecode_id": "oss_22724",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the path to an installed XSD file based on a given profile name and version. The function should take two parameters: a string `profile_name` and a string `profile_version`. The function should first check if the `profile_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_xsd_file('example', 'v1') == '/path/to/example/v1.xsd'\", \"assert get_xsd_file('example', 'v2') == '/path/to/example/v2.xsd'\", \"assert get_xsd_file('sample', 'v1') == '/path/to/sample/v1.xsd'\", \"assert get_xsd_file('example', 'v1') == '/path/to/exam... | {
"split": "train",
"index": 74806,
"acecode_id": "bigcode_python_fns_44692",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the current authenticated team's name from a predefined list. The function should return the name of the team that is currently authenticated based on their index. Given a list of team names and an index, implement a functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_authenticated_team(['Team A', 'Team B', 'Team C'], 0) == 'Team A'\", \"assert get_authenticated_team(['Team A', 'Team B', 'Team C'], 1) == 'Team B'\", \"assert get_authenticated_team(['Team A', 'Team B', 'Team C'], 2) == 'Team C'\", \"assert get_authenti... | {
"split": "train",
"index": 74807,
"acecode_id": "bigcode_python_fns_18380",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibfib(n: int) -> int` that computes the FibFib sequence, which is defined as follows: fibfib(0) == 0, fibfib(1) == 0, fibfib(2) == 1, and for n > 2, fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). For negative indices, fibfib(n) == fibfib(n+3) - fib... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibfib(0) == 0\", \"assert fibfib(1) == 0\", \"assert fibfib(2) == 1\", \"assert fibfib(3) == 1\", \"assert fibfib(4) == 2\", \"assert fibfib(5) == 4\", \"assert fibfib(6) == 7\", \"assert fibfib(7) == 13\", \"assert fibfib(8) == 24\", \"assert fibfib(9) == ... | {
"split": "train",
"index": 74808,
"acecode_id": "evol_20048",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing names, write a function that concatenates all the names into a single string, cleans up any occurrences of the phrases 'not available', 'not provided', or 'n/a' (case insensitive), and then returns a tuple containing the first name, last nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_names(['not available']) == (None, None, None)\", \"assert clean_names(['not provided']) == (None, None, None)\", \"assert clean_names(['n/a']) == (None, None, None)\", \"assert clean_names([]) == (None, None, None)\", \"assert clean_names(['not availa... | {
"split": "train",
"index": 74809,
"acecode_id": "bigcode_python_fns_11625",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_geolocation(ip: str) -> Tuple[str, str, str, str]` that takes an Internet Protocol (IP) address as input and returns a tuple containing the latitude and longitude as a string in the format 'lat,long', the city name, the region name, and the country nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_geolocation('192.168.1.1') == ('None', 'None', 'None', 'None')\", \"assert get_geolocation('255.255.255.255') == ('None', 'None', 'None', 'None')\", \"assert get_geolocation('203.0.113.0') == ('None', 'None', 'None', 'None')\", \"assert get_geolocation('... | {
"split": "train",
"index": 74810,
"acecode_id": "evol_32413",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given an undirected graph represented as a list of edges, where each edge is a tuple of two nodes. Your task is to implement a function `find_shortest_path(edges, start, end)` that takes in a list of edges and two nodes, `start` and `end`, and returns a list representin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_shortest_path([('a', 'b'), ('b', 'c'), ('a', 'd'), ('d', 'e'), ('e', 'c')], 'a', 'c') in [['a', 'b', 'c'], ['a', 'd', 'e', 'c']]\", \"assert find_shortest_path([('a', 'b'), ('b', 'c'), ('c', 'd'), ('a', 'd')], 'a', 'd') == ['a', 'd']\", \"assert find_sh... | {
"split": "train",
"index": 74811,
"acecode_id": "oss_401",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `invert_nested_numbers(t)` that takes a nested tuple of numbers (both integers and floating point numbers) and inverts each numerical element. If an element is not a number, it should remain unchanged. If the element is zero, it should remain zero. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert invert_nested_numbers(((1, 2, (3, 2, 4)), 2)) == ((1.0, 0.5, (0.3333333333333333, 0.5, 0.25)), 0.5)\", \"assert invert_nested_numbers(((0, 1.0), (3.5, 0))) == ((0, 1.0), (0.2857142857142857, 0))\", \"assert invert_nested_numbers(((1, -2, (3, -4)), 0)) == ((1... | {
"split": "train",
"index": 74812,
"acecode_id": "evol_12187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that represents a float number, implement a function that will remove any leading and trailing whitespace from the string and return the float value. If the string cannot be converted into a float (e.g., empty string or invalid format), return None.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_whitespace_float(' 3.14 ') == 3.14\", \"assert remove_whitespace_float(' -0.001 ') == -0.001\", \"assert remove_whitespace_float(' 1.0e3 ') == 1000.0\", \"assert remove_whitespace_float(' 0.0 ') == 0.0\", \"assert remove_whitespace_floa... | {
"split": "train",
"index": 74813,
"acecode_id": "bigcode_python_fns_49594",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that verifies if a given string contains a specific substring. The function should take two parameters: the first parameter is the main string to be searched, and the second parameter is the substring to look for. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_substring('hello world', 'world') == True\", \"assert contains_substring('hello world', 'worlds') == False\", \"assert contains_substring('Python programming', 'Python') == True\", \"assert contains_substring('Python programming', 'python') == False... | {
"split": "train",
"index": 74814,
"acecode_id": "bigcode_python_fns_6336",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of negative integers, determine if it is possible to rearrange the integers such that no two adjacent integers are the same. Implement a function `can_rearrange(lst: List[int]) -> bool` that returns True if the rearrangement is possible and False otherwise. The lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_rearrange([-1, -2, -3]) == True\", \"assert can_rearrange([-1, -2, -2]) == True\", \"assert can_rearrange([-5, -3, -5, -3, -4]) == True\", \"assert can_rearrange([-1, -1, -1]) == False\", \"assert can_rearrange([-1, -2, -3, -2]) == True\", \"assert can_r... | {
"split": "train",
"index": 74815,
"acecode_id": "bigcode_python_fns_42722",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of gene prefixes where each prefix is represented as a tuple of three elements (Pattern, Category, Notes), write a function that extracts and returns a list of unique gene categories from these prefixes. The input will be a list of tuples, and the output should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_categories([('geneA', 'Type1', 'note1'), ('geneB', 'Type1', 'note2'), ('geneC', 'Type2', 'note3')]) == ['Type1', 'Type2']\", \"assert extract_unique_categories([('geneX', 'TypeA', 'note1'), ('geneY', 'TypeB', 'note2'), ('geneZ', 'TypeC', 'note... | {
"split": "train",
"index": 74816,
"acecode_id": "bigcode_python_fns_10073",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with measuring the execution time of a given function in milliseconds. Your goal is to implement a function named `measure_execution_time` that takes a function as input and returns another function that, when called, executes the original function while printing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert measure_execution_time(lambda: sum(range(10000))) is not None\", \"assert measure_execution_time(asyncio.sleep(1)) is not None\", \"assert measure_execution_time(lambda x: x + 1)(5) == 6\", \"assert measure_execution_time(lambda: 'Hello, World!')() == 'Hello... | {
"split": "train",
"index": 74817,
"acecode_id": "oss_19127",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a generator function that yields individual characters from a string representing genetic data. The genetic data is represented as a sequence of characters (A, C, G, T). Your task is to create a generator function named `chars` that takes a stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(chars('ACGT', 1)) == ['A', 'C', 'G', 'T']\", \"assert list(chars('ACGT', 2)) == ['A', 'C', 'G', 'T']\", \"assert list(chars('ACGTACGT', 4)) == ['A', 'C', 'G', 'T', 'A', 'C', 'G', 'T']\", \"assert list(chars('A', 3)) == ['A']\", \"assert list(chars('', 2... | {
"split": "train",
"index": 74818,
"acecode_id": "oss_17847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function named 'find_duplicates' that takes a list of strings as an argument and returns a list of all the strings that appear more than once in the input list. If there are no duplicates, the function should return an empty list.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates(['apple', 'banana', 'apple', 'cherry', 'banana']) == ['apple', 'banana']\", \"assert find_duplicates(['apple', 'banana', 'cherry']) == []\", \"assert find_duplicates(['cat', 'dog', 'cat', 'fish', 'dog', 'dog']) == ['cat', 'dog']\", \"assert f... | {
"split": "train",
"index": 74819,
"acecode_id": "evol_17446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing textboxes, where each dictionary contains the positions of the textboxes in a 2D space with keys 'top', 'bottom', 'left', and 'right'. Your task is to implement a function `get_border_positions(texts: List[Dict[str, int]], direc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_border_positions([{'top': 1, 'bottom': 3, 'left': 4, 'right': 6}, {'top': 2, 'bottom': 5, 'left': 1, 'right': 9}], 'horizontal') == [1, 4, 6, 9]\", \"assert get_border_positions([{'top': 1, 'bottom': 3, 'left': 4, 'right': 6}], 'vertical') == [1, 3]\", \... | {
"split": "train",
"index": 74820,
"acecode_id": "bigcode_python_fns_8562",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings called 'pentadList' that may contain multiple lines separated by newline characters '\\n'. Your task is to create a function that takes this list and returns a new list where every sequence of non-empty lines is combined into a single line. If a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_lines(['Line1\\\\n', 'Line2\\\\nLine3', '\\\\n']) == ['Line1', 'Line2 Line3']\", \"assert combine_lines(['Single line']) == ['Single line']\", \"assert combine_lines(['First line\\\\nSecond line\\\\nThird line']) == ['First line Second line Third lin... | {
"split": "train",
"index": 74821,
"acecode_id": "bigcode_python_fns_27239",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple job management system. Your goal is to create a function that takes a list of job descriptions and filters out jobs that have a length less than a specified minimum length. The function should return a new list containing only the job d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_jobs(['Software Developer', 'Teacher', 'Nurse'], 7) == ['Software Developer', 'Teacher']\", \"assert filter_jobs([], 3) == []\", \"assert filter_jobs(['Manager', 'Lead', 'Coordinator'], 4) == ['Manager', 'Lead', 'Coordinator']\", \"assert filter_jobs(... | {
"split": "train",
"index": 74822,
"acecode_id": "oss_5398",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a mock accession instance for a biological experiment. The function `create_mock_accession(lab: str, award: str) -> dict` should take two parameters, `lab` and `award`, which represent the laboratory name an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_mock_accession('Lab A', 'Award X') == {'@id': 'foo', 'assay_term_name': 'microRNA', 'replicates': [{'biological_replicate_number': 1, 'status': 'released'}]}\", \"assert create_mock_accession('Lab B', 'Award Y') == {'@id': 'foo', 'assay_term_name': 'm... | {
"split": "train",
"index": 74823,
"acecode_id": "bigcode_python_fns_17844",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string and a letter as input and returns a new string with all occurrences of that letter removed from the original string. The function should be case-sensitive, meaning that it should only remove the exact letter that h... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert expunge_letter('Hello World', 'o') == 'Hell Wrld'\", \"assert expunge_letter('Data Science', 'a') == 'Dt Science'\", \"assert expunge_letter('LeetCode', 'e') == 'LtCod'\", \"assert expunge_letter('Remove All A', 'A') == 'Remove ll '\", \"assert expunge_lette... | {
"split": "train",
"index": 74824,
"acecode_id": "evol_14801",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an input string, write a function that counts the occurrences of each distinct word in the string, ignoring any special characters or numbers. Words are defined as sequences of alphabetic characters, and the comparison should be case insensitive. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_occurrences('Hello, hello! 123') == {'hello': 2}\", \"assert count_word_occurrences('Python is fun! Python is great.') == {'python': 2, 'is': 2, 'fun': 1, 'great': 1}\", \"assert count_word_occurrences('Numbers 123 and letters abc!') == {'numbers'... | {
"split": "train",
"index": 74825,
"acecode_id": "evol_27555",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `data` that contains information about training and evaluation traces of a machine learning experiment. The dictionary has the following structure:\n- A key `'_train_trace'` which maps to another dictionary containing training data for different tasks... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert missing_keys_4({'_train_trace': {0: [1, 2], 1: [3]}, '_eval_trace': {0: [1], 1: [2]}, '_task_info': [], '_args': {'train': {'epochs_per_task': 2}}}) == 1\", \"assert missing_keys_4({'_train_trace': {0: [1, 2], 1: [3]}, '_eval_trace': {0: [1], 1: [2]}, '_task... | {
"split": "train",
"index": 74826,
"acecode_id": "bigcode_python_fns_30901",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates the names for YAML files based on a given section name and project name. The function should follow these rules: 1) The YAML file for an instance should be named by appending '_os_instance.yaml' to the section name, and 2) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_yaml_file_names('webserver', 'projectA') == ('webserver_os_instance.yaml', 'webserver_os_instance_cleanup.yaml')\", \"assert generate_yaml_file_names('database', 'projectB') == ('database_os_instance.yaml', 'database_os_instance_cleanup.yaml')\", \"... | {
"split": "train",
"index": 74827,
"acecode_id": "bigcode_python_fns_45355",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing space-separated numbers. Implement a function `convert_to_floats(s: str) -> List[float]` that reads the string and converts each number into a float. The function should return a list of floats representing the numbers in the order they appear ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_floats('1 2 3') == [1.0, 2.0, 3.0]\", \"assert convert_to_floats(' 4.5 5.5 6.5 ') == [4.5, 5.5, 6.5]\", \"assert convert_to_floats('') == []\", \"assert convert_to_floats(' 7.0 ') == [7.0]\", \"assert convert_to_floats('10 20 30 40') == [10.0, 20.... | {
"split": "train",
"index": 74828,
"acecode_id": "bigcode_python_fns_41321",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a JSON object. Your task is to implement a function that takes this string as input and returns a Python dictionary representing the JSON object. The function should handle possible exceptions and return an empty dictionary if the input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_json('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert parse_json('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}') == {'name': 'John', 'age': 30}\", \"assert parse_json('{\\\"is_active\\\": true, \\\"balance\\\": 45.67}') == {'is_active':... | {
"split": "train",
"index": 74829,
"acecode_id": "bigcode_python_fns_33552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the construction of an ImporterNode component for hyperparameters. The function should take a string representing the URI of hyperparameters and return a dictionary that contains the instance name, source URI, and artifact ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_importer_node('http://example.com/hyperparams') == {'instance_name': 'with_hyperparameters', 'source_uri': 'http://example.com/hyperparams', 'artifact_type': 'HyperParameters'}\", \"assert create_importer_node('http://test.com/params') == {'instance_n... | {
"split": "train",
"index": 74830,
"acecode_id": "bigcode_python_fns_10175",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a bagging system for a retail store. The system should keep track of items being added to the bag and should provide functionality to reset the bag's contents. Additionally, the system should indicate whether an item ha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bagging_system([('add', 'carrot'), ('add', 'carrot'), ('dump', ), ('add', 'lettuce')]) == [True, False, 'dumped', True]\", \"assert bagging_system([('add', 'banana'), ('add', 'banana'), ('add', 'banana'), ('dump', )]) == [True, False, False, 'dumped']\", \"a... | {
"split": "train",
"index": 74831,
"acecode_id": "oss_15251",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_prime_sum(lst)` that returns the maximum sum of the digits of the prime numbers in the list. If there are no prime numbers in the list, return 0.\nPlease reason step by step, then write a self-contained Python solution. Give your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_prime_sum([0, 3, 2, 1, 5, 5, 5, 181]) == 10\", \"assert max_prime_sum([1, 0, 8, 2, 4597, 3, 40, 1]) == 25\", \"assert max_prime_sum([4, 6, 8, 10]) == 0\", \"assert max_prime_sum([4, 6, 9, 12]) == 0\", \"assert max_prime_sum([1, 4, 6, 8]) == 0\", \"assert... | {
"split": "train",
"index": 74832,
"acecode_id": "evol_28692",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the creation of a message queue based on a given configuration dictionary. The dictionary will contain a key 'type' indicating the type of queue to create. You should return a string that describes the created queue bas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_queue({'type': 'FIFO'}) == 'Created FIFO queue'\", \"assert create_queue({'type': 'LIFO'}) == 'Created LIFO queue'\", \"assert create_queue({'type': 'Priority'}) == 'Created Priority queue'\", \"assert create_queue({}) == 'Created FIFO queue'\", \"ass... | {
"split": "train",
"index": 74833,
"acecode_id": "bigcode_python_fns_17533",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of post titles based on a given tag name. You will be provided with a list of posts, where each post is represented as a dictionary containing a 'title' and a list of 'tags'. Your function should return a list of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_posts_by_tag([{'title': 'Post 1', 'tags': ['python', 'coding']}, {'title': 'Post 2', 'tags': ['python']}, {'title': 'Post 3', 'tags': ['java']}], 'python') == ['Post 1', 'Post 2']\", \"assert get_posts_by_tag([{'title': 'Post 1', 'tags': ['python', 'codi... | {
"split": "train",
"index": 74834,
"acecode_id": "oss_29042",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `coef` and `intercept`, representing the coefficients and the intercept of a linear model respectively. Write a function `predict_score(inputs: List[int], coef: List[int], intercept: int) -> List[float]` that calculates the predicted scores ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_score([0, 0, 0], [1, 2, 3], 5) == [5.0, 5.0, 5.0]\", \"assert predict_score([2, 4, 6], [1, 1, 1], 3) == [5.0, 7.0, 9.0]\", \"assert predict_score([], [1, 2, 3], 10) == []\", \"assert predict_score([1, 1, 1], [1, 2], 5) == []\", \"assert predict_score... | {
"split": "train",
"index": 74835,
"acecode_id": "bigcode_python_fns_32792",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of arguments, `args`, which may contain various types of elements. Your task is to implement a function `java_args(args: List[Any]) -> List[Any]` that returns the same list of arguments. The function should not modify the original list in any way. The input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert java_args(['arg1', 'arg2', 'arg3']) == ['arg1', 'arg2', 'arg3']\", \"assert java_args([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert java_args(['test', 123, True]) == ['test', 123, True]\", \"assert java_args([]) == []\", \"assert java_args(['single_arg']) == ['s... | {
"split": "train",
"index": 74836,
"acecode_id": "bigcode_python_fns_46662",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two dictionaries, determine if they are equal by comparing their keys and values. The dictionaries are considered equal if they contain the same keys with the same corresponding values, regardless of the order of insertion. Implement a function that takes two dictionaries... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_hashes_equal({'a': 1, 'b': 2}, {'b': 2, 'a': 1}) == True\", \"assert are_hashes_equal({'a': 1, 'b': 2}, {'a': 1}) == False\", \"assert are_hashes_equal({}, {}) == True\", \"assert are_hashes_equal({'key1': 'value1'}, {'key1': 'value1'}) == True\", \"asse... | {
"split": "train",
"index": 74837,
"acecode_id": "evol_27816",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a volume's information based on a given volume ID. Implement a function `get_volume_info(volume_id: str) -> str`, which takes a string `volume_id` as input. If the `volume_id` is empty or None, the function should return 'M... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_volume_info('vol1') == 'Volume info for vol1'\", \"assert get_volume_info('vol2') == 'Volume info for vol2'\", \"assert get_volume_info('') == 'Must provide volume_id to get.'\", \"assert get_volume_info(None) == 'Must provide volume_id to get.'\", \"ass... | {
"split": "train",
"index": 74838,
"acecode_id": "bigcode_python_fns_35945",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two objects represented by their dimensions in a 3D space, write a function `identify_larger_object(dimensions_one: Tuple[int, int, int], dimensions_two: Tuple[int, int, int]) -> Tuple[int, int, int]` that returns the dimensions of the larger object. The dimensions are re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_larger_object((5, 3, 4), (3, 2, 5)) == (5, 3, 4)\", \"assert identify_larger_object((2, 2, 2), (2, 2, 2)) == (2, 2, 2)\", \"assert identify_larger_object((0, 0, 0), (1, 1, 1)) == (1, 1, 1)\", \"assert identify_larger_object((1, 2, 3), None) == (1, 2... | {
"split": "train",
"index": 74839,
"acecode_id": "bigcode_python_fns_28480",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes in a dictionary and a file path as input, and processes the dictionary by converting it to a JSON string. The function should return the JSON string representation of the dictionary. If the input dictionary is empty, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data_to_json({'key1': 'value1', 'key2': 'value2'}) == '{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\"}'\", \"assert process_data_to_json({}) == '{}'\", \"assert process_data_to_json({'a': 1, 'b': 2, 'c': 3}) == '{\\\"a\\\": 1, \\\"b\\\":... | {
"split": "train",
"index": 74840,
"acecode_id": "oss_1781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a member's unique identifier `compass_id`, implement a function `get_latest_disclosure(compass_id: int) -> str` that retrieves the latest disclosure information for that member. The disclosure information is represented as a string. If the member does not have any disclos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_latest_disclosure(1) == 'Disclosure for member 1: Quarterly report.'\", \"assert get_latest_disclosure(2) == 'Disclosure for member 2: Annual report.'\", \"assert get_latest_disclosure(3) == 'No disclosures available.'\", \"assert get_latest_disclosure(6... | {
"split": "train",
"index": 74841,
"acecode_id": "bigcode_python_fns_14503",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a variable `rotation` that can be of type string or a numeric value, write a function `get_rotation(rotation)` that returns the angle as a float between 0 and 360 degrees. The possible values for `rotation` are: 'horizontal' which corresponds to 0 degrees, 'vertical' whic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_rotation('horizontal') == 0.0\", \"assert get_rotation('vertical') == 90.0\", \"assert get_rotation(360) == 0.0\", \"assert get_rotation(450) == 90.0\", \"assert get_rotation(720) == 0.0\", \"assert get_rotation(-90) == 270.0\", \"assert get_rotation(-36... | {
"split": "train",
"index": 74842,
"acecode_id": "bigcode_python_fns_43587",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a set of operations to perform on registers. Each register has a unique identifier and may be linked to another register. You need to implement a function `register_operations(operations)` that takes a list of operations, where each operation is a string formatted... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_operations(['union 0 1', 'union 1 2', 'find 2']) == [0]\", \"assert register_operations(['union 0 1', 'union 2 3', 'union 1 3', 'find 0']) == [0]\", \"assert register_operations(['union 0 1', 'union 1 2', 'union 2 3', 'find 1']) == [0]\", \"assert r... | {
"split": "train",
"index": 74843,
"acecode_id": "oss_37392",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `check_integer_properties(n)` that evaluates the mathematical properties of a provided integer. The function should determine if the integer is odd or even, and also identify if the integer is a prime number. If the input is not a valid integer or if it is less... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_integer_properties(4) == '4 is an Even number and it is not a prime number'\", \"assert check_integer_properties(1) == '1 is an Odd number and it is not a prime number'\", \"assert check_integer_properties(18) == '18 is an Even number and it is not a p... | {
"split": "train",
"index": 74844,
"acecode_id": "evol_30404",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining whether a given marker ID is used in a game based on predefined ranges of marker sizes. Each range is represented as a list of tuples, where each tuple contains two integers indicating the inclusive lower and upper bounds of the range. Your goal ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_marker_used(5, [(1, 10), (15, 20), (25, 30)]) == True\", \"assert is_marker_used(12, [(1, 10), (15, 20), (25, 30)]) == False\", \"assert is_marker_used(20, [(1, 10), (15, 20), (25, 30)]) == True\", \"assert is_marker_used(25, [(1, 10), (15, 20), (25, 30)]... | {
"split": "train",
"index": 74845,
"acecode_id": "bigcode_python_fns_27236",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, implement a function `DFS(root)` that performs a depth-first search on the tree and returns a list of values representing the order in which the nodes are visited. The traversal should visit the left subtree first, then the right subtree, and fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert DFS(Node(1, Node(2, Node(4), Node(5)), Node(3))) == [4, 5, 2, 3, 1]\", \"assert DFS(Node(1)) == [1]\", \"assert DFS(None) == []\", \"assert DFS(Node(1, Node(2))) == [2, 1]\", \"assert DFS(Node(1, None, Node(3))) == [3, 1]\", \"assert DFS(Node(1, Node(2, Node... | {
"split": "train",
"index": 74846,
"acecode_id": "evol_20188",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that computes the cumulative total of the integers in the list. The cumulative total at each index is the sum of all integers from the start of the list up to that index. The function should return a new list containing these cumul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_cumulative_total([1, 2, 3, 4, 5]) == [1, 3, 6, 10, 15]\", \"assert compute_cumulative_total([0, 0, 0]) == [0, 0, 0]\", \"assert compute_cumulative_total([-1, -1, -1]) == [-1, -2, -3]\", \"assert compute_cumulative_total([10]) == [10]\", \"assert comp... | {
"split": "train",
"index": 74847,
"acecode_id": "evol_4140",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the process of updating a contact list. The function takes in an old contact list and a new contact list, and it should return the index at which a contact was removed from the old list to obtain the new list. If no con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_removed_contact_index(['Alice', 'Bob', 'Charlie', 'David'], ['Alice', 'Charlie', 'David']) == 1\", \"assert find_removed_contact_index(['John', 'Doe', 'Jane'], ['John', 'Jane']) == 1\", \"assert find_removed_contact_index(['Mike', 'Emily', 'Sarah'], ['M... | {
"split": "train",
"index": 74848,
"acecode_id": "oss_20585",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers. The function should take the list as input and perform the following operations: 1. Filter out all the even numbers from the list. 2. Square each of the remaining odd numbers. 3. Return the result... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([1, 2, 3, 4, 5]) == [1, 9, 25]\", \"assert process_numbers([10, 15, 20, 25]) == [225, 625]\", \"assert process_numbers([2, 4, 6, 8]) == []\", \"assert process_numbers([-1, -2, -3, -4]) == [1, 9]\", \"assert process_numbers([0, 1, 2, 3, 4, 5])... | {
"split": "train",
"index": 74849,
"acecode_id": "oss_3921",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to calculate the average Seebeck coefficient for a given material. The Seebeck coefficient is a measure of the magnitude of the thermoelectric effect in a material, representing its ability to generate a voltage difference when sub... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_seebeck({'n': {500: {1: [1, 2, 3], 2: [4, 5, 6]}, 600: {1: [7, 8, 9], 2: [10, 11, 12]}}, 'p': {500: {1: [13, 14, 15], 2: [16, 17, 18]}, 600: {1: [19, 20, 21], 2: [22, 23, 24]}}}) == {'n': {500: {1: 2.0, 2: 5.0}, 600: {1: 8.0, 2: 11.0}}, 'p'... | {
"split": "train",
"index": 74850,
"acecode_id": "oss_23146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `is_valid_bracket_sequence` that accepts an array of at least two strings containing only open parentheses '(', closing parentheses ')', open curly braces '{', closing curly braces '}', and also square brackets '[', closing brackets ']'. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_bracket_sequence(['(', ')', '{', '}']) == 'Yes'\", \"assert is_valid_bracket_sequence(['{', '(', '[', '}', ')', ']']) == 'No'\", \"assert is_valid_bracket_sequence(['[', '{', '}', ']', '(', ')']) == 'Yes'\", \"assert is_valid_bracket_sequence(['(', ... | {
"split": "train",
"index": 74851,
"acecode_id": "evol_6354",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with comparing software version numbers represented by their major, minor, and patch components. Write a function `compare_versions(version1: str, version2: str) -> str` that takes two version strings in the format 'major.minor.patch' and returns a string indicat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_versions('1.2.3', '1.2.3') == 'versions are equal'\", \"assert compare_versions('1.2.4', '1.2.3') == 'version1 is greater'\", \"assert compare_versions('1.2.3', '1.2.4') == 'version2 is greater'\", \"assert compare_versions('2.0.0', '1.9.9') == 'vers... | {
"split": "train",
"index": 74852,
"acecode_id": "oss_10446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `replicate_words(text: str, number: int) -> str` that takes a string `text` and a positive integer `number` as arguments. The function should return a new string where each distinct word in `text` is repeated `number` times in the same order they appeared in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replicate_words('Hello world', 1) == 'Hello world'\", \"assert replicate_words('Hello world', 2) == 'HelloHello worldworld'\", \"assert replicate_words('sample test', 3) == 'samplesamplesample testtesttest'\", \"assert replicate_words('LeetCode', 5) == 'Leet... | {
"split": "train",
"index": 74853,
"acecode_id": "evol_23446",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function `call_reflector_function` that simulates calling a C function based on specified parameters. The function should take the following parameters: \n- `function_name` (string): The name of the C function to be called (e.g., 'ElRightRe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert call_reflector_function('ElRightReflector', 'z', 1.0) == 2.0\", \"assert call_reflector_function('ElRightReflector', 's', 2.0) == 3.0\", \"assert call_reflector_function('ElRightReflector', 'd', 3.0) == 6.0\", \"assert call_reflector_function('ElRightReflect... | {
"split": "train",
"index": 74854,
"acecode_id": "oss_35127",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes astronomical data by validating and setting a specific parameter in a dictionary. The function should accept three parameters: a float value for 'BCV', a float value for 'UT', and a string representing 'fout'. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert main(1.2, 2.3, 'output.txt') == {'HJD': 0.0, 'BCV': 1.2}\", \"assert main(None, 2.3, 'output.txt') == {'HJD': 0.0, 'BCV': 0.0}\", \"assert main(0.0, 2.3, 'output.txt') == {'HJD': 0.0, 'BCV': 0.0}\", \"assert main(-1.5, 2.3, 'output.txt') == {'HJD': 0.0, 'BCV... | {
"split": "train",
"index": 74855,
"acecode_id": "oss_29704",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `notify_observers(subject, observers, modifier)` that simulates the behavior of notifying observers in the Observer design pattern. The function should take in three parameters: `subject`, which represents the subject object, `observers`, a list of observer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert notify_observers('Subject4', ['ObserverC'], 'ObserverC') == None\", \"assert notify_observers('Subject5', [], 'Observer1') == None\", \"assert notify_observers('Subject10', ['ObserverF'], 'ObserverF') == None\", \"assert notify_observers('Subject12', ['Obser... | {
"split": "train",
"index": 74856,
"acecode_id": "evol_33213",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents an event description. Your task is to classify these events into two categories: 'tactics' or 'techniques'. You need to implement a function `classify_events(events: List[str], target_class: str) -> List[str]` that t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_events([], 'tactics') == []\", \"assert classify_events(['defense required', 'strategic planning', 'no action'], 'tactics') == ['tactics', 'unknown', 'unknown']\", \"assert classify_events(['no tactics here', 'methodology explained', 'random text'],... | {
"split": "train",
"index": 74857,
"acecode_id": "bigcode_python_fns_7296",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a 2D square matrix representing an image and a specified threshold, find the coordinates of the local maxima (peaks) in the image that are above the given threshold. A peak is defined as an element that is greater than its 8 neighbors. The function should return a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_peaks([[1, 2, 1], [3, 4, 2], [1, 2, 1]], 3) == [(1, 1)]\", \"assert find_peaks([[0, 0, 0], [0, 1, 0], [0, 0, 0]], 0) == [(1, 1)]\", \"assert find_peaks([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 8) == [(2, 2)]\", \"assert find_peaks([[3, 2, 1], [2, 1, 2], [1, 2... | {
"split": "train",
"index": 74858,
"acecode_id": "bigcode_python_fns_9377",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of fractions represented as strings. Write a function `process_fractions(fractions: List[str]) -> List[Fraction]` that performs the following tasks: 1. Convert the strings into fraction objects using the 'fractions' module in Python. 2. Handle cases where i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_fractions(['1/2', '3/4', '2/3', '1/8', '5/6']) == [Fraction(5, 6), Fraction(3, 4), Fraction(2, 3), Fraction(1, 2), Fraction(1, 8)]\", \"assert process_fractions(['1/2', '3/4', '2/3', '1/8', '5/6', 'invalid']) == [Fraction(5, 6), Fraction(3, 4), Fract... | {
"split": "train",
"index": 74859,
"acecode_id": "evol_29824",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string `raw_data` which represents a sentence. Your task is to implement a function `transform_data(raw_data: str) -> str` that reverses the order of words in the sentence. A word is defined as a sequence of characters separated by spaces. For example, for the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_data('Hello World!') == 'World! Hello'\", \"assert transform_data('Hello World!') == 'World! Hello'\", \"assert transform_data('SingleWord') == 'SingleWord'\", \"assert transform_data('') == ''\", \"assert transform_data('A B C D E') == 'E D C B ... | {
"split": "train",
"index": 74860,
"acecode_id": "bigcode_python_fns_37784",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string of words, implement a function that reverses the order of the words while maintaining their original form. The input string will consist of words separated by spaces. Write a function called `reverse_words` that takes a single parameter, a string `sentence`, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_words('This sentence should be reversed') == 'reversed be should sentence This'\", \"assert reverse_words('Hello world') == 'world Hello'\", \"assert reverse_words('LeetCode is awesome') == 'awesome is LeetCode'\", \"assert reverse_words('Python prog... | {
"split": "train",
"index": 74861,
"acecode_id": "evol_18410",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that sorts the array in descending order using a sorting algorithm of your choice. The function should take a list of integers as input and return a new list that contains the integers sorted in descending order. You must not use bui... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort_descending([5, 3, 8, 1, 2]) == [8, 5, 3, 2, 1]\", \"assert bubble_sort_descending([10, 20, 10, 5, 30]) == [30, 20, 10, 10, 5]\", \"assert bubble_sort_descending([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert bubble_sort_descending([-1, -2, -3, -... | {
"split": "train",
"index": 74862,
"acecode_id": "evol_33514",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_styles(html: str) -> dict` that takes an HTML string as input and returns a dictionary of CSS styles defined within `<style>` tags in the HTML. Each key in the dictionary should be a CSS selector, and the value should be another dictionary representing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_styles('<html><head><style>body { background-color: lightblue; }</style></head></html>') == {'body': {'background-color': 'lightblue'}}\", \"assert get_styles('<html><head><style>h1 { color: white; }</style><style>p { font-size: 16px; }</style></head></h... | {
"split": "train",
"index": 74863,
"acecode_id": "evol_17471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of keywords extracted from a publication's metadata. The function should iterate through the keywords, normalize each keyword to lower case and remove leading or trailing spaces. If a normalized keyword exceeds 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_keywords({'keywords': [' Keyword1 ', 'keyword1 ', ' keyword2']}) == {'keyword1', 'keyword2'}\", \"assert store_keywords({'keywords': ['a', 'b', 'c']}) == {'a', 'b', 'c'}\", \"assert store_keywords({'keywords': ['longkeyword' * 10]}) == set()\", \"as... | {
"split": "train",
"index": 74864,
"acecode_id": "oss_29499",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `type_conversion(node: str) -> str` that simulates a type conversion operation in a database system. The function takes a string `node` representing the name of a database node. The function should return a string that describes the result... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert type_conversion('clickhouse1') == 'Type conversion successful on clickhouse1'\", \"assert type_conversion('mysql') == 'Type conversion successful on mysql'\", \"assert type_conversion('postgres') == 'Type conversion successful on postgres'\", \"assert type_c... | {
"split": "train",
"index": 74865,
"acecode_id": "bigcode_python_fns_3510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of transactions, each represented as a list of items, write a function that finds all unique itemsets of a specified length k that appear in at least a given percentage of the transactions. An itemset is considered frequent if it appears in at least min_support * t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_frequent_length_k_itemsets([['apple', 'banana'], ['banana', 'apple'], ['banana', 'orange'], ['apple', 'orange']], 0.25, 2) == [frozenset({'apple', 'banana'}), frozenset({'banana', 'orange'}), frozenset({'apple', 'orange'})]\", \"assert get_frequent_lengt... | {
"split": "train",
"index": 74866,
"acecode_id": "bigcode_python_fns_28957",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that searches for a specific file name within a given list of file names. Your function should return the index of the first occurrence of the file name in the list. If the file name is not found, the function should return -1. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_file_index(['file1.txt', 'file2.txt', 'file3.txt', 'file1.txt'], 'file1.txt') == 0\", \"assert find_file_index(['file1.txt', 'file2.txt', 'file3.txt', 'file1.txt'], 'file2.txt') == 1\", \"assert find_file_index(['file1.txt', 'file2.txt', 'file3.txt', 'f... | {
"split": "train",
"index": 74867,
"acecode_id": "oss_1294",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary called 'options' that contains configuration settings for a certificate creation process. Your task is to implement a function called 'create_certificate' that takes the following parameters: 'name' (a string), 'options' (a dictionary), 'export_type' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_certificate('cert1', {'dstPrivKey': 'key1', 'dstDir': '/certs'}, 'export', 'user1', 'priv1', 'host1', 8080) == ('cert1', '/certs', 'export', 'user1', 'priv1', 'key1', 'host1', 8080)\", \"assert create_certificate('cert2', {'dstPrivKey': '', 'dstDir': ... | {
"split": "train",
"index": 74868,
"acecode_id": "oss_16082",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple bank account. The function should take an initial balance and a list of transactions as input. Each transaction can either be a deposit (represented as a positive integer) or a withdrawal (represented as a nega... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_bank_account(100, [50, -20, -30, 25]) == (125, 4)\", \"assert manage_bank_account(50, [-100]) == (50, 0)\", \"assert manage_bank_account(1000, [500, -200, -300, -100, 300]) == (1200, 5)\", \"assert manage_bank_account(100, []) == (100, 0)\", \"assert ... | {
"split": "train",
"index": 74869,
"acecode_id": "oss_35665",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_email_address(local: str, domain: str, sub_domain: str) -> str` that constructs an email address from the provided local, domain, and sub-domain parts. The function should validate the constructed email address according to the following rules: 1)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email_address('alice_smith', 'gmail', 'com') == 'alice_smith@gmail.com'\", \"assert validate_email_address('user.name', 'example', 'org') == 'user.name@example.org'\", \"assert validate_email_address('valid_email123', 'mydomain', 'net') == 'valid_em... | {
"split": "train",
"index": 74870,
"acecode_id": "evol_26845",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a price represented as a float or an integer, write a function `compute_discount` that calculates the final price after applying a 15% discount. The function should take one parameter, `original_price`, and return the discounted price as a float.\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_discount(100) == 85.0\", \"assert compute_discount(200) == 170.0\", \"assert compute_discount(0) == 0.0\", \"assert compute_discount(50) == 42.5\", \"assert compute_discount(150) == 127.5\", \"assert compute_discount(300) == 255.0\", \"assert compute... | {
"split": "train",
"index": 74871,
"acecode_id": "evol_12196",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that returns a new array containing only the unique elements from the given array, preserving the order of their first appearance. For example, if the input array is [1, 2, 2, 3, 4, 4, 5], the output should be [1, 2, 3, 4, 5]. Implem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([5, 5, 5, 5, 5]) == [5]\", \"assert unique_elements([1, 2, 3]) == [1, 2, 3]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, 2, 3, 1, 2, 3]) == [1, 2, ... | {
"split": "train",
"index": 74872,
"acecode_id": "bigcode_python_fns_46972",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating model parameters for a deep learning audio processing model called 'ds_tc_resnet'. Given a boolean parameter 'use_tf_fft', you need to create a function that returns a dictionary of model parameters. The parameters should include the following fie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ds_tc_resnet_model_params(True) == {'model_name': 'ds_tc_resnet', 'clip_duration_ms': 160, 'use_tf_fft': True, 'mel_non_zero_only': False, 'feature_type': 'mfcc_tf', 'window_size_ms': 5.0, 'window_stride_ms': 2.0, 'wanted_words': 'a,b,c', 'ds_padding': \\\"'... | {
"split": "train",
"index": 74873,
"acecode_id": "bigcode_python_fns_5057",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a file path as input and returns the path of the configuration file used for experiments. Your function should accept an optional parameter that defaults to 'experiments_config.json'. If the user provides a different file path,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_experiments_config_path() == 'experiments_config.json'\", \"assert get_experiments_config_path('custom_config.json') == 'custom_config.json'\", \"assert get_experiments_config_path('') == ''\", \"assert get_experiments_config_path('path/to/experiments_co... | {
"split": "train",
"index": 74874,
"acecode_id": "bigcode_python_fns_21274",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `frequency_weighting(frequencies: List[float], kind: str) -> List[float]` that computes the weighting of a set of frequencies based on the specified weighting kind. The function should take two parameters: a list of frequencies (in Hz) and a string represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert frequency_weighting([100, 200, 300], 'A') == [1.0, 0.8, 0.6]\", \"assert frequency_weighting([100, 200, 300], 'B') == [1.0, 0.7, 0.5]\", \"assert frequency_weighting([100, 200, 300], 'C') == [1.0, 0.6, 0.4]\", \"assert frequency_weighting([100, 200, 300], 'D... | {
"split": "train",
"index": 74875,
"acecode_id": "bigcode_python_fns_41481",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of geographical coordinates represented as tuples of latitude and longitude, write a function `filter_coordinates(coordinates: List[Tuple[float, float]], min_lat: float, max_lat: float, min_lon: float, max_lon: float) -> List[Tuple[float, float]]` that filters the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_coordinates([(10.0, 10.0), (20.0, 20.0)], 0, 15, 0, 15) == [(10.0, 10.0)]\", \"assert filter_coordinates([(10.0, 10.0), (20.0, 20.0)], 0, 25, 0, 25) == [(10.0, 10.0), (20.0, 20.0)]\", \"assert filter_coordinates([(5.0, 5.0), (10.0, 10.0)], 6, 15, 6, 1... | {
"split": "train",
"index": 74876,
"acecode_id": "bigcode_python_fns_49706",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given object matches any of the specified patterns. A pattern can be a string or a number, and the function should return True if the object matches at least one of the patterns; otherwise, it should return False. Impleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matches_any('hello', ['hello', 'world']) == True\", \"assert matches_any('Hello', ['hello', 'world']) == False\", \"assert matches_any(5, [1, 2, 3]) == False\", \"assert matches_any(10, [10, 20, 30]) == True\", \"assert matches_any('abc', ['xyz', 'abc', '123... | {
"split": "train",
"index": 74877,
"acecode_id": "bigcode_python_fns_42796",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to describe the steps needed to process an image for a machine learning model. The function takes in two parameters: `new_height` and `target_width`. The `new_height` parameter specifies the height to which the loaded image will be sc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert describe_image_processing(300, 200) == 'Scale the height of loaded image to 300 for later multiscale cropping and resizing. Scale the width of transformed image to the same 200 for batch forwarding.'\", \"assert describe_image_processing(150, 100) == 'Scale ... | {
"split": "train",
"index": 74878,
"acecode_id": "oss_30598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of 7 gain maps, where each gain map is a 2D array of the same shape consisting of binary values (0s and 1s). Your task is to implement a function `pixel_gain_mode_statistics(gmaps)` that takes this list of gain maps as input and returns a list of integers w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pixel_gain_mode_statistics([[[1, 1], [0, 0]], [[0, 1], [1, 1]], [[1, 0], [0, 0]], [[1, 1], [1, 1]], [[0, 0], [0, 0]], [[1, 0], [1, 1]], [[1, 1], [0, 0]]]) == [2, 3, 1, 4, 0, 3, 2]\", \"assert pixel_gain_mode_statistics([[[0, 0], [0, 0]], [[0, 0], [0, 0]], [[... | {
"split": "train",
"index": 74879,
"acecode_id": "bigcode_python_fns_16498",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a given string containing a series of commands and returns the final position of a robot. The robot starts at position (0, 0) on a 2D grid and can move in four directions: up, down, left, and right. Each command is repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert finalPosition('UUDDLR') == (0, 0)\", \"assert finalPosition('LLUU') == (-2, 2)\", \"assert finalPosition('RRDD') == (2, -2)\", \"assert finalPosition('URDL') == (0, 0)\", \"assert finalPosition('UUU') == (0, 3)\", \"assert finalPosition('DDD') == (0, -3)\", ... | {
"split": "train",
"index": 74880,
"acecode_id": "oss_303",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a binary number (given as a string) to its hexadecimal representation. The input binary string will only consist of the characters '0' and '1'. If the input is not a valid binary number, raise a ValueError. The output should be a string repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_hex('0') == '0'\", \"assert binary_to_hex('1') == '1'\", \"assert binary_to_hex('10') == '2'\", \"assert binary_to_hex('11') == '3'\", \"assert binary_to_hex('100') == '4'\", \"assert binary_to_hex('101') == '5'\", \"assert binary_to_hex('110') == ... | {
"split": "train",
"index": 74881,
"acecode_id": "evol_35009",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of components and their dependencies, implement a function `get_load_order(components: List[str], dependencies: Dict[str, List[str]]) -> List[str]` that returns an ordered list of components in the order they should be loaded, taking into account their dependencies... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_load_order(['A', 'B', 'C'], {'A': ['B'], 'B': ['C'], 'C': ['A']}) == []\", \"assert get_load_order(['A'], {'A': []}) == ['A']\", \"assert get_load_order(['A', 'B', 'C'], {'A': ['B', 'C'], 'B': ['A'], 'C': []}) == []\", \"assert get_load_order(['A', 'B', ... | {
"split": "train",
"index": 74882,
"acecode_id": "bigcode_python_fns_12579",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `complex_encode` that takes a string `s` and an integer `n` as input and returns an encoded string. The encoding should shift each alphabetical character by `n` positions to the right in the alphabet, wrap around if necessary, and leave non-alphabeti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_encode('hello', 1) == 'ifmmp'\", \"assert complex_encode('WORLD', 2) == 'YQTNF'\", \"assert complex_encode('#$%&*', 3) == '#$%&*'\", \"assert complex_encode('abc', 3) == 'def'\", \"assert complex_encode('xyz', 5) == 'cde'\", \"assert complex_encode('... | {
"split": "train",
"index": 74883,
"acecode_id": "evol_650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_character_sequence_positions(text: str, sequence: str) -> List[int]` that searches for all occurrences of a specific sequence of characters within a given text. The function should return a list of starting positions of each occurrence of the sequence... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_character_sequence_positions('The quick brown fox jumps over the lazy dog', 'brown') == [10]\", \"assert find_character_sequence_positions('The quick brown fox jumps over the lazy dog', 'fox') == [16]\", \"assert find_character_sequence_positions('The q... | {
"split": "train",
"index": 74884,
"acecode_id": "evol_14702",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with estimating the value of π using a simplified Monte Carlo method. Your function should take an integer `num_samples` as input, which represents the number of random points to simulate within a square of side length 1, centered at the origin (0, 0). You need t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(estimate_pi(1) - 3.2) < 1.0\", \"assert abs(estimate_pi(10) - 3.2) < 1.0\", \"assert abs(estimate_pi(100) - 3.12) < 1.0\", \"assert abs(estimate_pi(1000) - 3.14) < 0.1\", \"assert abs(estimate_pi(10000) - 3.14) < 0.01\", \"assert abs(estimate_pi(250000) ... | {
"split": "train",
"index": 74885,
"acecode_id": "oss_17775",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `split_string(string: str) -> List[str]` that takes a string as input and returns a list of its individual characters. Each character in the string should be a separate element in the output list.\nPlease reason step by step, then write a self-contained Pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_string('hello') == ['h', 'e', 'l', 'l', 'o']\", \"assert split_string('') == []\", \"assert split_string('a') == ['a']\", \"assert split_string('1234') == ['1', '2', '3', '4']\", \"assert split_string('!@#$') == ['!', '@', '#', '$']\", \"assert split_s... | {
"split": "train",
"index": 74886,
"acecode_id": "evol_21398",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python that generates Pascal's triangle up to a given number of rows. The function should return a list of lists, where each inner list represents a row in Pascal's triangle. The rows should start from 0 up to n-1, where n is the input parameter.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_pascals_triangle(1) == [[1]]\", \"assert generate_pascals_triangle(2) == [[1], [1, 1]]\", \"assert generate_pascals_triangle(3) == [[1], [1, 1], [1, 2, 1]]\", \"assert generate_pascals_triangle(4) == [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]]\", \"asser... | {
"split": "train",
"index": 74887,
"acecode_id": "evol_20921",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are designing a simple reinforcement learning algorithm to control a robot's actions in a grid environment. The robot can move in four directions: up (0), down (1), left (2), and right (3). Given the current state represented as a tuple (x, y) and a list of possible actions... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert type(select_random_action((0, 0), [0, 1, 2, 3], 1, 10)) == tuple\", \"assert len(select_random_action((0, 0), [0, 1, 2, 3], 1, 10)) == 2\", \"assert select_random_action((0, 0), [0, 1, 2, 3], 1, 10)[1] == [(1, 10)]\", \"assert select_random_action((1, 1), [0... | {
"split": "train",
"index": 74888,
"acecode_id": "oss_2158",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that updates player information based on their team's performance in a game. You need to implement a function `update_player_info(team: str, mmr: int, league: str, games_played: int, battletag: str, region: str) -> int`. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_player_info('Protoss', 4000, 'Diamond', 100, 'Player1#1234', 'US') == 1\", \"assert update_player_info('Zerg', 3500, 'Platinum', 200, 'Player2#5678', 'EU') == 1\", \"assert update_player_info('Terran', 4500, 'Masters', 300, 'Player3#9101', 'AS') == 1\... | {
"split": "train",
"index": 74889,
"acecode_id": "oss_25548",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, which may include negative numbers, write a function `median(l: list)` that calculates the median without sorting the list or using any built-in library functions. The median is defined as the middle value when the numbers are arranged in order. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5]) == 3\", \"assert median([1]) == 1\", \"assert median([1, 3]) == 2.0\", \"assert median([1, 2, 3]) == 2\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([5, 3, 1, 4, 2]) == 3\", \"assert median([-1, -2, -3, -4]) == -2.5\", \"... | {
"split": "train",
"index": 74890,
"acecode_id": "evol_19394",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of count-paired domains along with their earliest and latest visit timestamps. Each count-paired domain is represented as a tuple with the format (\"count domain\", \"earliest_timestamp\", \"latest_timestamp\"). A website domain like \"discuss.leetcode.com\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subdomain_visits([('9001 discuss.leetcode.com', '2019-01-01 00:00:00', '2019-01-01 23:59:59')]) == [('9001 discuss.leetcode.com', '2019-01-01 00:00:00', '2019-01-01 23:59:59'), ('9001 leetcode.com', '2019-01-01 00:00:00', '2019-01-01 23:59:59'), ('9001 com',... | {
"split": "train",
"index": 74891,
"acecode_id": "evol_26460",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a given string to a boolean value based on certain predefined rules. The function should take a string as input and return a boolean value according to the following rules: If the input string is 'yes', 'true', 't', or '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_boolean('yes') == True\", \"assert string_to_boolean('true') == True\", \"assert string_to_boolean('t') == True\", \"assert string_to_boolean('1') == True\", \"assert string_to_boolean('Yes') == True\", \"assert string_to_boolean('TRUE') == True\",... | {
"split": "train",
"index": 74892,
"acecode_id": "oss_12746",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates unique material names for a 3D modeling application. The function `generate_unique_material_name()` should take a string representing the material name and a list of existing material names as input. Your function should cl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unique_material_name('Wood@#$', ['Wood']) == 'Wood_1'\", \"assert generate_unique_material_name('Steel', ['Steel']) == 'Steel_1'\", \"assert generate_unique_material_name('Stone', ['Stone', 'Stone_1']) == 'Stone_2'\", \"assert generate_unique_materi... | {
"split": "train",
"index": 74893,
"acecode_id": "oss_27289",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `add_unique_strings` that takes two lists as input, `list1` and `list2`. The function should add a given string `new_string` to `list1` if it is not already present in either `list1` or `list2`. If `new_string` is a duplicate in either list, it shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_unique_strings(['Hello', 'World'], ['Python', 'Programming'], 'Hello') == ['Hello', 'World']\", \"assert add_unique_strings([], [], 'Hello') == ['Hello']\", \"assert add_unique_strings(['Hello'], ['Hello'], 'World') == ['Hello', 'World']\", \"assert add_... | {
"split": "train",
"index": 74894,
"acecode_id": "evol_4253",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that reverses an array in-place. The function should modify the original array and handle cases where the input array contains duplicate values and/or negative integers. You should not use any built-in functions like reverse() or reversed().\nPlease reason ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_arr([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_arr([-1, -2, -3, -4]) == [-4, -3, -2, -1]\", \"assert reverse_arr([1, 2, 2, 1]) == [1, 2, 2, 1]\", \"assert reverse_arr([0, 1, 2, 3, 4]) == [4, 3, 2, 1, 0]\", \"assert reverse_arr([-5, -10, ... | {
"split": "train",
"index": 74895,
"acecode_id": "evol_27261",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of startups represented as dictionaries and returns a list of names of startups that have an investment greater than a specified amount. Each startup dictionary contains keys including 'name', 'investment', and other relevant details. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_startups_above_investment([{'name': 'Startup A', 'investment': 100000}, {'name': 'Startup B', 'investment': 50000}], 75000) == ['Startup A']\", \"assert get_startups_above_investment([{'name': 'Startup C', 'investment': 200000}, {'name': 'Startup D', 'in... | {
"split": "train",
"index": 74896,
"acecode_id": "evol_4028",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of images based on specific parameters for training and validation scenarios. The function should take the following parameters: `search_area_factor`, `output_sz`, `center_jitter_factor`, `scale_jitter_factor`, `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data(['img1', 'img2'], 1.0, (128, 128), 0.1, 0.1, 'sequence', {'param1': 10}, 'transform_train', True) == ['img1_processed_train', 'img2_processed_train']\", \"assert process_data(['img1'], 2.0, (256, 256), 0.2, 0.2, 'sequence', {'param1': 20}, 'tran... | {
"split": "train",
"index": 74897,
"acecode_id": "oss_11097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing actions taken in a game. Each action is either 'move' or 'pause'. Your task is to write a function `modify_sequence(path_actions: List[str]) -> List[str]` that modifies the sequence based on the following rule: If the number of 'paus... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_sequence(['move', 'pause', 'move']) == ['move', 'move']\", \"assert modify_sequence(['move']) == ['move']\", \"assert modify_sequence(['move', 'move', 'move']) == ['move', 'move', 'move']\", \"assert modify_sequence(['move', 'move', 'pause', 'pause', ... | {
"split": "train",
"index": 74898,
"acecode_id": "oss_3865",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string `config_name` which represents the name of a configuration. Your task is to implement a function that returns the full path to a certificate signing request (CSR) file for a projector. The CSR file is formed by joining the base directory of the run config... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_projector_csr_file('test_config') == 'configs/run/test_config/projector.jks.csr'\", \"assert get_projector_csr_file('dev_config') == 'configs/run/dev_config/projector.jks.csr'\", \"assert get_projector_csr_file('production') == 'configs/run/production/pr... | {
"split": "train",
"index": 74899,
"acecode_id": "bigcode_python_fns_27072",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.