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 implementing a function that checks for mismatches between a given type code and a list of data types. The function should iterate through the provided list of data types and compare each one with the given type code. If a data type does not match the type c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_type_mismatches('A', ['int', 'float', 'str', 'bool']) == ['int', 'float', 'str', 'bool']\", \"assert find_type_mismatches('B', ['int', 'float', 'str', 'bool']) == ['int', 'float', 'str', 'bool']\", \"assert find_type_mismatches('C', ['int', 'float', 'st...
{ "split": "train", "index": 85700, "acecode_id": "oss_29578", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of station names and their corresponding URLs, and returns a dictionary where the keys are the station names and the values are the URLs. The function should have the following signature: `def build_station_dict(s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_station_dict([('Station A', 'http://stationA.com'), ('Station B', 'http://stationB.com')]) == {'Station A': 'http://stationA.com', 'Station B': 'http://stationB.com'}\", \"assert build_station_dict([('Station A', 'http://stationA.com'), ('Station A', '...
{ "split": "train", "index": 85701, "acecode_id": "oss_11236", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a tuple representing a parsed email, where the first element is the name of the person and the second element (optional) is their email address, write a function `stringify_parsed_email(parsed: Tuple[str, Optional[str]]) -> str` that converts the parsed email tuple into a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stringify_parsed_email(('John Doe', 'johndoe@example.com')) == 'John Doe <johndoe@example.com>'\", \"assert stringify_parsed_email(('Jane Smith',)) == 'Jane Smith'\", \"assert stringify_parsed_email(('Alice Johnson', 'alice@example.org')) == 'Alice Johnson <...
{ "split": "train", "index": 85702, "acecode_id": "bigcode_python_fns_31402", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `modes(data)` that returns a list of the mode(s) of the numbers in the list. The mode is defined as the number(s) that appear most frequently in the list. If there are multiple modes, return all of them in a list. Do not use the built-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modes([1, 2, 2, 3, 3, 4]) == [2, 3]\", \"assert modes([5]) == [5]\", \"assert modes([1, 1, 2, 3, 3, 4, 4]) == [1, 3, 4]\", \"assert modes([0, 0, 1, 1, 2]) == [0, 1]\", \"assert modes([2, 2, 2, 3, 3, 4, 4, 4]) == [2, 4]\", \"assert modes([1, 1, 1, 1]) == [1]\...
{ "split": "train", "index": 85703, "acecode_id": "evol_23830", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary of variables and their gradients. Each variable's gradient is another dictionary that maps deterministic variables to their respective Jacobian values. Your task is to implement a function `update_covariance(cov_inv: Dict[str, float], jacobian: Dict[s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_covariance({'a': 0.5}, {'a': {'detX': 0.4}}) == {'a': 0.5, 'detX': 0.2}\", \"assert update_covariance({'p': 1.0}, {'p': {'detC': 2.0}}) == {'p': 1.0, 'detC': 2.0}\", \"assert update_covariance({'u': 3.0}, {'u': {'detD': 1.0, 'detE': 1.5}}) == {'u': 3....
{ "split": "train", "index": 85704, "acecode_id": "bigcode_python_fns_37133", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with identifying the peak indices in a given signal represented as a list of integers. A peak index is defined as an index `i` where the value at `signal[i]` is greater than its immediate neighbors (i.e., `signal[i-1]` and `signal[i+1]`). Your function should tak...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_signal_peaks([0, 1, 2, 1, 3, 2, 1, 4, 1, 2]) == [2, 4, 7]\", \"assert find_signal_peaks([1, 2, 3, 4, 5]) == []\", \"assert find_signal_peaks([5, 4, 3, 2, 1]) == []\", \"assert find_signal_peaks([1, 2, 1, 2, 1, 2]) == [1, 3]\", \"assert find_signal_peaks...
{ "split": "train", "index": 85705, "acecode_id": "oss_13511", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `create_axolotl` that takes three parameters: `species` (a string), `limb_count` (an integer), and `skin_color` (a string). The function should return a dictionary representing an axolotl with the specified attributes. The dictionary should have keys 'speci...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_axolotl('Mexican walking fish', 4, 'Black') == {'species': 'Mexican walking fish', 'limb_count': 4, 'skin_color': 'Black'}\", \"assert create_axolotl('Ambystoma mexicanum', 4, 'White') == {'species': 'Ambystoma mexicanum', 'limb_count': 4, 'skin_color...
{ "split": "train", "index": 85706, "acecode_id": "evol_11371", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of students in a class. Your task is to write a function `find_highest_score` that takes in this list of integers and returns the highest score achieved by any student. If the list is empty, the function should return -1 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_highest_score([85, 92, 78, 90, 88]) == 92\", \"assert find_highest_score([70, 65, 80, 75, 85, 90]) == 90\", \"assert find_highest_score([100, 99, 98, 97]) == 100\", \"assert find_highest_score([50]) == 50\", \"assert find_highest_score([-10, -20, -30]) ...
{ "split": "train", "index": 85707, "acecode_id": "oss_1094", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings and a prefix string. Write a function that returns a list of all the strings in the input list that start with the given prefix, case insensitive. The output list should preserve the original order of the input list. The prefix will only contain ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_prefixed(['apple', 'banana', 'apricot', 'grape'], 'ap') == ['apple', 'apricot']\", \"assert find_prefixed(['apple', 'banana', 'apricot', 'grape'], 'b') == ['banana']\", \"assert find_prefixed(['apple', 'banana', 'apricot', 'grape'], 'G') == ['grape']\",...
{ "split": "train", "index": 85708, "acecode_id": "bigcode_python_fns_28093", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are required to implement a function that extracts specific metadata details from a provided dictionary representing a software package. Your task is to write a function `extract_metadata(metadata_dict: dict) -> dict` that takes a dictionary `metadata_dict` as input. This d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_metadata({'version': '1.0.0', 'description': 'Sample package.', 'license': 'MIT', 'author': 'Alice', 'author_email': 'alice@example.com'}) == {'version': '1.0.0', 'description': 'Sample package.', 'license': 'MIT', 'author': 'Alice', 'author_email': ...
{ "split": "train", "index": 85709, "acecode_id": "oss_15395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the execution of commands on a simple network device. The function, named `execute_command`, should take a command string as input and two optional boolean parameters: `wait` (defaulting to `True`) and `venv` (defaulting to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_command('show ip', True, False) == 'Executing command: show ip, wait: True, venv: False'\", \"assert execute_command('restart', False, True) == 'Executing command: restart, wait: False, venv: True'\", \"assert execute_command('shutdown', True, True) ...
{ "split": "train", "index": 85710, "acecode_id": "oss_2903", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the calculation of a vaccination progress percentage for a given region. The function will take in the total population of the region and the number of people who have received the first dose of the COVID-19 vaccine. Your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_vaccination_progress(1000, 500) == 50.0\", \"assert calculate_vaccination_progress(1000, 0) == 0.0\", \"assert calculate_vaccination_progress(0, 0) == 0.0\", \"assert calculate_vaccination_progress(1500, 1500) == 100.0\", \"assert calculate_vaccina...
{ "split": "train", "index": 85711, "acecode_id": "oss_13744", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function called `replace_ip_address` that takes a string `text` as input and replaces all instances of valid IPv4 addresses with the term 'IP_ADDRESS'. An IPv4 address is defined as four decimal numbers separated by dots, where each number is between 0 and 255. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_ip_address('My IP is 192.168.1.1') == 'My IP is IP_ADDRESS'\", \"assert replace_ip_address('Connect to 10.0.0.255 for access') == 'Connect to IP_ADDRESS for access'\", \"assert replace_ip_address('The server IP 255.255.255.255 is down') == 'The serve...
{ "split": "train", "index": 85712, "acecode_id": "evol_11743", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an integer n and returns a list of dictionaries representing users, articles, and comments. Each user should have a unique identifier and associated data, each article should have a unique identifier, a user ID it is associated...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_data(1) == [{'user': {'id': 1, 'name': 'User 1'}, 'articles': [{'id': 1, 'user_id': 1, 'content': 'Article content 1'}], 'comments': [{'id': 1, 'article_id': 1, 'content': 'Comment content 1'}]}]\", \"assert generate_data(2) == [{'user': {'id': 1, '...
{ "split": "train", "index": 85713, "acecode_id": "bigcode_python_fns_7909", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of commands. Each command consists of an operation type (string) and a target (string). The operation type can be 'create', 'delete', or 'update'. Your function should return a list of strings representing the pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_commands([('create', 'resource1'), ('delete', 'resource2'), ('update', 'resource3')]) == ['create resource1', 'delete resource2', 'update resource3']\", \"assert process_commands([('create', 'resource1'), ('unknown', 'resource2')]) == ['create resour...
{ "split": "train", "index": 85714, "acecode_id": "bigcode_python_fns_40051", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing descriptions of concepts using a simple data structure. Implement a function `manage_concept` that takes a list of operations and returns the results of those operations. The operations are as follows: 1. `add_description(ID, term)`: Add a descripti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_concept([('add_description', 'D1', 'Description 1'), ('add_description', 'D2', 'Description 2'), ('set_definition', 'Definition of Concept 1'), ('get_description_by_id', 'D1')]) == 'Description 1'\", \"assert manage_concept([('add_description', 'D1', ...
{ "split": "train", "index": 85715, "acecode_id": "oss_11554", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates and formats a MAC address. A MAC address is a unique identifier assigned to network interfaces for communications on a network segment. It is usually represented as six groups of two hexadecimal digits, separated by col...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_and_format_mac('01:23:45:67:89:ab') == '01:23:45:67:89:ab'\", \"assert validate_and_format_mac('01:23:45:67:89:AB') == '01:23:45:67:89:ab'\", \"assert validate_and_format_mac('01:23:45:67:89:cd') == '01:23:45:67:89:cd'\", \"assert validate_and_forma...
{ "split": "train", "index": 85716, "acecode_id": "oss_26613", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of strings and returns a dictionary where each unique string from the list is a key, and its value is the number of times it appears in the list. The function should ignore case, meaning 'Apple' and 'apple' should be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_strings(['apple', 'banana', 'Apple', 'orange', 'banana']) == {'apple': 2, 'banana': 2, 'orange': 1}\", \"assert count_strings(['cat', 'dog', 'Cat', 'dog', 'DOG']) == {'cat': 2, 'dog': 3}\", \"assert count_strings(['Hello', 'world', 'hello', 'WORLD']) =...
{ "split": "train", "index": 85717, "acecode_id": "bigcode_python_fns_39637", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a clothing item detected in a video frame. Your task is to create a function `group_clothing_items(items: List[str]) -> Dict[str, List[str]]` that takes this list of clothing items and returns a dictionary. The keys ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_clothing_items(['shirt', 'pants', 'shirt', 'hat']) == {'shirt': ['shirt', 'shirt'], 'pants': ['pants'], 'hat': ['hat']}\", \"assert group_clothing_items(['dress', 'skirt', 'dress', 'shoes']) == {'dress': ['dress', 'dress'], 'skirt': ['skirt'], 'shoes':...
{ "split": "train", "index": 85718, "acecode_id": "oss_28282", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the integer that appears the most frequently in the list. If there is a tie, return the smallest integer among those that appear the most frequently. The function should take a list of integers as input and return a tuple ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_repeating([1, 2, 3, 1, 2, 1, 4, 5, 6]) == (1, 3)\", \"assert find_max_repeating([1, 1, 2, 2, 3]) == (1, 2)\", \"assert find_max_repeating([4, 5, 6, 4, 5, 6]) == (4, 2)\", \"assert find_max_repeating([7, 8, 9, 10]) == (7, 1)\", \"assert find_max_repe...
{ "split": "train", "index": 85719, "acecode_id": "bigcode_python_fns_2893", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `retrieve_tracker_info(path: str, args: tuple, kwargs: dict) -> Tuple[str, Any]` that simulates the retrieval of a tracker object and its associated code. The function takes in a string `path`, a tuple `args`, and a dictionary `kwargs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_tracker_info('tracker.module', (), {}) == ('Code for tracker.module', 'Tracker at tracker.module')\", \"assert retrieve_tracker_info('another.tracker', (1, 2), {'key': 'value'}) == ('Code for another.tracker', 'Tracker at another.tracker')\", \"asse...
{ "split": "train", "index": 85720, "acecode_id": "bigcode_python_fns_26293", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with controlling a two-wheeled robot that uses a distance sensor to avoid obstacles. Your goal is to implement a function `avoid_obstacles` that simulates the robot's movement based on sensor readings. The robot should behave according to the following rules: If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert avoid_obstacles(0.6) == 'Moving Forward'\", \"assert avoid_obstacles(0.7) == 'Moving Forward'\", \"assert avoid_obstacles(1.0) == 'Moving Forward'\", \"assert avoid_obstacles(0.8) == 'Moving Forward'\", \"assert avoid_obstacles(0.55) == 'Moving Forward'\", \...
{ "split": "train", "index": 85721, "acecode_id": "oss_3760", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that counts the occurrences of labels in a dataset represented as a list of dictionaries. Each dictionary contains a 'label' key that holds a string value representing the label of a sample. Your function should take in this list of sampl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_labels([{'label': 'A'}, {'label': 'B'}, {'label': 'A'}, {'label': 'C'}, {'label': 'B'}]) == {'A': 2, 'B': 2, 'C': 1}\", \"assert count_labels([{'label': 'A'}, {'label': 'A'}, {'label': 'A'}]) == {'A': 3}\", \"assert count_labels([{'label': 'X'}, {'labe...
{ "split": "train", "index": 85722, "acecode_id": "oss_6259", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `find_average(numbers: List[float]) -> float` that takes a list of numbers as input and returns the average of those numbers. If the list is empty, the function should return 0.0.\nPlease reason step by step, then write a self-contained Python solution. Giv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_average([1, 2, 3, 4, 5]) == 3.0\", \"assert find_average([-1, -2, -3]) == -2.0\", \"assert find_average([0, 0, 0]) == 0.0\", \"assert find_average([10.5, 20.5, 30.5]) == 20.5\", \"assert find_average([]) == 0.0\", \"assert find_average([1.5, 2.5, 3.5, 4...
{ "split": "train", "index": 85723, "acecode_id": "evol_14097", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a URL string, extract the protocol, domain, and path from it. The protocol is the part before '://', the domain is the part between '://' and the first '/', and the path is the part after the domain. If any part is missing, return an empty string for that part. Write a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_url_components('https://www.example.com/path/to/resource') == ('https', 'www.example.com', '/path/to/resource')\", \"assert extract_url_components('http://example.com/') == ('http', 'example.com', '/')\", \"assert extract_url_components('ftp://ftp.ex...
{ "split": "train", "index": 85724, "acecode_id": "bigcode_python_fns_17021", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple parser for a configuration file format. Write a function `parse_config(content: str) -> Tuple[bool, str]` that takes a string `content` representing the contents of a configuration file in a key-value format. The configuration file may cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_config('[section1]\\\\nkey1=value1\\\\nkey2=value2') == (True, '')\", \"assert parse_config('[section1]\\\\nkey1=value1\\\\n[section1]\\\\nkey2=value2') == (False, 'Duplicate Section')\", \"assert parse_config('key1=value1\\\\n[section1]\\\\nkey2=value...
{ "split": "train", "index": 85725, "acecode_id": "bigcode_python_fns_34583", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two coordinate axes represented by two strings `x_axis` and `y_axis`, and two tuples `xlim` and `ylim` representing the limits of the x-axis and y-axis respectively, write a function `same_axes(x_axis: str, y_axis: str, xlim: tuple, ylim: tuple) -> bool` that checks wheth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert same_axes('x', 'x', (0, 10), (0, 10)) == True\", \"assert same_axes('x', 'y', (0, 10), (0, 10)) == False\", \"assert same_axes('x', 'x', (0, 10), (0, 5)) == False\", \"assert same_axes(None, None, (0, 10), (0, 10)) == False\", \"assert same_axes('x', 'x', (1...
{ "split": "train", "index": 85726, "acecode_id": "bigcode_python_fns_38930", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a tree-like structure where each node has a unique integer ID and a parent ID (pid). Write a function `get_descendant_ids(pid: int, tree: List[Tuple[int, int]], include_self: bool = True) -> Set[int]` that returns a set of all descendant IDs of the node with the g...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_descendant_ids(1, [(2, 1), (3, 1), (4, 2), (5, 2)], True) == {1, 2, 3, 4, 5}\", \"assert get_descendant_ids(2, [(2, 1), (3, 1), (4, 2), (5, 2)], True) == {2, 4, 5}\", \"assert get_descendant_ids(1, [(2, 1), (3, 1), (4, 2), (5, 2)], False) == {2, 3, 4, 5}...
{ "split": "train", "index": 85727, "acecode_id": "bigcode_python_fns_4494", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing a combination of parentheses, curly braces, and square brackets, write a function to determine if the order of the parentheses is valid. A valid order means that for every opening parenthesis, there is a corresponding closing parenthesis in the correct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validParenthesesOrder('{(abc})') == False\", \"assert validParenthesesOrder('({abc})') == True\", \"assert validParenthesesOrder('()[]{}') == True\", \"assert validParenthesesOrder('([)]') == False\", \"assert validParenthesesOrder('{[()]}') == True\", \"ass...
{ "split": "train", "index": 85728, "acecode_id": "oss_35806", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function `validate_lambda_expression` that takes a string representing a lambda expression and returns a boolean value indicating whether the expression is valid according to the Lispyc parser's rules. The lambda expression must be enclosed...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_lambda_expression('(lambda ((string s)) (concat s \\\" world\\\"))') == False\", \"assert validate_lambda_expression('(lambda (x) (return x))') == False\", \"assert validate_lambda_expression('(lambda ((int a)) (a + 2))') == False\", \"assert valida...
{ "split": "train", "index": 85729, "acecode_id": "oss_15097", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given three integers a, b, and c, write a function `max_of_three(a, b, c)` that returns the largest of the three integers.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_of_three(1, 2, 3) == 3\", \"assert max_of_three(10, 20, 5) == 20\", \"assert max_of_three(-1, -2, -3) == -1\", \"assert max_of_three(0, 0, 0) == 0\", \"assert max_of_three(5, 5, 5) == 5\", \"assert max_of_three(7, 7, 8) == 8\", \"assert max_of_three(100,...
{ "split": "train", "index": 85730, "acecode_id": "evol_28720", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two matrices A and B represented as lists of lists, write a function `batch_matmul(A: List[List[int]], B: List[List[int]], transpose_a: bool, transpose_b: bool) -> List[List[int]]` that performs batch matrix multiplication. If `transpose_a` is True, transpose matrix A bef...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert batch_matmul([[1, 2], [3, 4]], [[5, 6], [7, 8]], False, False) == [[19, 22], [43, 50]]\", \"assert batch_matmul([[1, 2, 3]], [[4], [5], [6]], False, False) == [[32]]\", \"assert batch_matmul([[1, 0], [0, 1]], [[1, 2], [3, 4]], False, False) == [[1, 2], [3, 4...
{ "split": "train", "index": 85731, "acecode_id": "bigcode_python_fns_33500", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Create a function that checks if a provided number is a prime number. The function should return True if the number is prime and False otherwise. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers.\nPlea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(0) == False\", \"assert is_prime(1) == False\", \"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"asser...
{ "split": "train", "index": 85732, "acecode_id": "evol_23187", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `data` and a string `encoding`, implement a function `encode_data(encoding: str, data: str) -> bytes` that encodes the given `data` using the specified `encoding`. The `encoding` can be one of the following supported types: 'base64', 'hex', or 'utf-8'. If the `en...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_data('base64', 'hello') == b'aGVsbG8='\", \"assert encode_data('hex', 'hello') == b'68656c6c6f'\", \"assert encode_data('utf-8', 'hello') == b'hello'\", \"assert encode_data('base64', 'python') == b'cHl0aG9u'\", \"assert encode_data('hex', 'python') =...
{ "split": "train", "index": 85733, "acecode_id": "bigcode_python_fns_37761", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that replaces each element of the array with its square and returns the new array. Do not use built-in functions like `map()`, `**`, or `pow()` to perform the squaring operation. The input array may contain both positive and nega...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_elements([1, 2, 3, 4, 5]) == [1, 4, 9, 16, 25]\", \"assert square_elements([-1, -2, -3]) == [1, 4, 9]\", \"assert square_elements([0]) == [0]\", \"assert square_elements([0, 1, 2]) == [0, 1, 4]\", \"assert square_elements([-1, 0, 1]) == [1, 0, 1]\", \...
{ "split": "train", "index": 85734, "acecode_id": "evol_25966", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a multi-dimensional numerical matrix containing integers (including negative integers and zero) and returns a single-dimensional list of integers sorted in decreasing order. The function should handle arbitrarily large matrices. The sorting shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sortMultiArray([[4, 7, 2], [9, 0, -6], [2, 5, -3]]) == [9, 7, 5, 4, 2, 2, 0, -3, -6]\", \"assert sortMultiArray([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [9, 8, 7, 6, 5, 4, 3, 2, 1]\", \"assert sortMultiArray([[0]]) == [0]\", \"assert sortMultiArray([[-5, -10], ...
{ "split": "train", "index": 85735, "acecode_id": "evol_26756", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes data exports in different formats based on the provided exporter class. The function should accept an exporter class, an optional format (defaulting to 'xlsx'), and any additional keyword arguments. If the `tenant` keyw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert export_data(MockExporter, 'csv', tenant='TenantA') == 'Exported data in csv format from TenantA'\", \"assert export_data(MockExporter, 'xlsx', tenant='TenantB') == 'Exported data in xlsx format from TenantB'\", \"assert export_data(MockExporter, 'json') == '...
{ "split": "train", "index": 85736, "acecode_id": "oss_10679", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of DNA sequences and returns the number of sequences that exceed a specified maximum length. The function should take two parameters: a list of strings representing the DNA sequences and an integer specifying the max...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_long_sequences(['ATCG', 'AAGCTGATCGATCG', 'AGCT'], 10) == 1\", \"assert count_long_sequences(['A', 'AA', 'AAA', 'AAAA'], 3) == 1\", \"assert count_long_sequences(['GATTACA', 'AGCTAGCTAG', 'TGCTGCT'], 8) == 1\", \"assert count_long_sequences(['ATCG', 'A...
{ "split": "train", "index": 85737, "acecode_id": "oss_16273", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that generates all valid strings starting with '1', followed by any permutation of a given list of characters, and ending with the unique superscript '@'. The function should take a list of characters as input and return a list of all valid strings that mee...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_valid_strings(['a', 'b', 'c']) == ['1abc@', '1acb@', '1bac@', '1bca@', '1cab@', '1cba@']\", \"assert generate_valid_strings(['x', 'y']) == ['1xy@', '1yx@']\", \"assert generate_valid_strings(['']) == ['1@']\", \"assert generate_valid_strings(['a']) ...
{ "split": "train", "index": 85738, "acecode_id": "evol_8336", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the average sales from a list of sales figures. Implement a function named `calculate_average_sales` that takes a list of integers representing sales figures as input. The function should return the average of the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_sales([100, 150, 200, 175, 300]) == 185.0\", \"assert calculate_average_sales([50, 75, 125]) == 83.33\", \"assert calculate_average_sales([200]) == 200.0\", \"assert calculate_average_sales([]) == 0.0\", \"assert calculate_average_sales([10...
{ "split": "train", "index": 85739, "acecode_id": "oss_15745", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of floating-point numbers representing accuracy metrics recorded over time, write a function `time_to_accuracy(metrics: List[float], threshold: float) -> float` that calculates the amount of time (in seconds) taken for the accuracy to reach or exceed a specified th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert time_to_accuracy([0.1, 0.2, 0.3, 0.4, 0.5], 0.5) == 4.0\", \"assert time_to_accuracy([0.5, 0.6, 0.7, 0.8, 0.9], 0.8) == 3.0\", \"assert time_to_accuracy([0.0, 0.1, 0.2, 0.3, 0.4], 0.5) == -1\", \"assert time_to_accuracy([0.5, 0.7, 0.9, 1.0], 1.0) == 3.0\", \...
{ "split": "train", "index": 85740, "acecode_id": "bigcode_python_fns_25093", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of user records represented as tuples, write a function `get_user_by_identifier(records: List[Tuple]) -> List[Tuple]` that returns the user record based on a given identifier. The identifier can either be a string representing a user's token or an integer represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_by_identifier([('2023-01-01', 'token123', 1, 'user1', True, 'call1'), ('2023-02-01', 'token456', 2, 'user2', False, 'call2')], 'token123') == ('2023-01-01', 'token123', 1, 'user1', True, 'call1')\", \"assert get_user_by_identifier([('2023-01-01', 't...
{ "split": "train", "index": 85741, "acecode_id": "bigcode_python_fns_25822", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `merge_in_place(arr)` that performs an in-place merge of two sorted halves of the given list `arr`. The first half of the list is sorted from index `0` to `mid` (exclusive), and the second half is sorted from index `mid` to the end of the list. You should n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_in_place([1, 3, 5, 0, 2, 4]) == None and [0, 1, 2, 3, 4, 5] == [0, 1, 2, 3, 4, 5]\", \"assert merge_in_place([2, 6, 8, 1, 3, 5]) == None and [1, 2, 3, 5, 6, 8] == [1, 2, 3, 5, 6, 8]\", \"assert merge_in_place([10, 15, 20, 5, 7, 30]) == None and [5, 7, ...
{ "split": "train", "index": 85742, "acecode_id": "evol_20514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `calculate_product(my_list)` that returns the product of all the integers in the list. If the list is empty, the function should return 1.\nPlease reason step by step, then write a self-contained Python solution. Give your final pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_product([1, 2, 3, 4]) == 24\", \"assert calculate_product([-1, -2, -3]) == -6\", \"assert calculate_product([0, 1, 2]) == 0\", \"assert calculate_product([]) == 1\", \"assert calculate_product([100, 2, 3]) == 600\", \"assert calculate_product([2, 2...
{ "split": "train", "index": 85743, "acecode_id": "evol_8483", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a command-line tool that builds a project based on specified parameters. Write a function `build_project` that takes in four parameters: `gram_dir` (a string representing the directory for the build), `reference` (a string representing the referen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_project('path/to/gram', 'ref_file.txt', 21, 4) == {'command': 'gramtools_exec build --gram_dir path/to/gram --ref ref_file.txt --kmer_size 21 --max_threads 4', 'stdout': ['Build successful'], 'stderr': []}\", \"assert build_project('path/to/gram', 'ref...
{ "split": "train", "index": 85744, "acecode_id": "bigcode_python_fns_5092", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `sum_of_special_sum_sets(sets: List[List[int]]) -> int` that identifies all special sum sets from the provided list of sets. A set is defined as a special sum set if it satisfies the following conditions for any two non-empty disjo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_special_sum_sets([[7, 8, 9], [10, 11, 12]]) == 57\", \"assert sum_of_special_sum_sets([[1], [2], [3], [4], [5]]) == 15\", \"assert sum_of_special_sum_sets([[100, 200], [300, 400]]) == 1000\", \"assert sum_of_special_sum_sets([[8, 9], [10, 11, 12]]) ==...
{ "split": "train", "index": 85745, "acecode_id": "evol_26240", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `count_word_occurrences(text: str, words: List[str]) -> Dict[str, int]` that takes a string `text` representing multiple lines of text and a list of words. The function should return a dictionary containing each word from the list as keys and their respecti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_word_occurrences('No occurrences here.', ['not', 'found']) == {'not': 0, 'found': 0}\", \"assert count_word_occurrences('A B C D E F G', ['a', 'b', 'c']) == {'a': 1, 'b': 1, 'c': 1}\", \"assert count_word_occurrences('One two three.', ['four', 'five', ...
{ "split": "train", "index": 85746, "acecode_id": "evol_3170", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of wealth comparisons among individuals and their respective quietness levels. Each comparison is represented as `richer[i] = [x, y]`, which indicates that person `x` is richer than person `y`. Additionally, you have a list `quiet` where `quiet[i]` represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert loudAndRich([[1,0],[2,1],[3,1],[3,7],[4,3],[5,3],[6,3]], [3,2,5,4,6,1,7,0]) == [5,5,2,5,4,5,6,7]\", \"assert loudAndRich([[0,1],[1,2]], [0,1,2]) == [0,0,0]\", \"assert loudAndRich([], [4,3,2,1,0]) == [0,1,2,3,4]\", \"assert loudAndRich([[1,0]], [1,0]) == [1,...
{ "split": "train", "index": 85747, "acecode_id": "evol_8317", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a string `s` representing a binary tree in the format of an integer followed by zero, one, or two pairs of parentheses, implement a function `construct_and_validate(s: str) -> Tuple[List[int], bool]` that constructs the binary tree and validates if it is a Binary Search T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_and_validate('4(2(3)(1))(6(5))') == ([4, 2, 6, 3, 1, 5], False)\", \"assert construct_and_validate('4(2(1)(3))(6(5)(7))') == ([4, 2, 6, 1, 3, 5, 7], True)\", \"assert construct_and_validate('-4(2(3)(1))(6(5)(7))') == ([-4, 2, 6, 3, 1, 5, 7], False)...
{ "split": "train", "index": 85748, "acecode_id": "evol_18421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `is_happy` that takes a string `s` as input and returns a boolean indicating whether the string qualifies as 'happy'. A string is considered 'happy' if it meets the following conditions: its length is three or more, no consecutive letters are the sam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_happy('abc') == False\", \"assert is_happy('aa') == False\", \"assert is_happy('abcd') == False\", \"assert is_happy('aabb') == False\", \"assert is_happy('xyy') == False\", \"assert is_happy('aabbcc') == False\", \"assert is_happy('aaaa') == False\", \"a...
{ "split": "train", "index": 85749, "acecode_id": "evol_10771", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a 2D tensor (list of lists) of shape BxL, where B is the batch size and L is the tensor length. You also have a list of updates with length B and an integer i. Your task is to update the i-th element of each row in the tensor with the corresponding value from the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert inplace_update_i([[1, 2, 3], [4, 5, 6]], [10, 20], 1) == [[1, 10, 3], [4, 20, 6]]\", \"assert inplace_update_i([[1, 2], [3, 4]], [5, 6], 0) == [[5, 2], [6, 4]]\", \"assert inplace_update_i([[7, 8], [9, 10]], [11, 12], 1) == [[7, 11], [9, 12]]\", \"assert inp...
{ "split": "train", "index": 85750, "acecode_id": "bigcode_python_fns_35002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function that determines whether n is a prime number. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Return True if n is a prime number, otherwise return False.\nPlease reason step ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser...
{ "split": "train", "index": 85751, "acecode_id": "bigcode_python_fns_8087", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `greet()` that returns the string 'Greetings Earth'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greet() == 'Greetings Earth'\", \"assert greet() == 'Greetings Earth'\", \"assert greet() == 'Greetings Earth'\", \"assert greet() == 'Greetings Earth'\", \"assert greet() == 'Greetings Earth'\", \"assert greet() == 'Greetings Earth'\", \"assert greet() == '...
{ "split": "train", "index": 85752, "acecode_id": "evol_34986", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file names that may contain a year enclosed in parentheses at the end. Your task is to implement a function that removes the year and any trailing whitespace from each file name in the list. The year is represented as a four-digit number enclosed in pare...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_file_names(['movie1 (2023)', 'documentary (2020)', 'notes.txt', 'photo.jpg']) == ['movie1', 'documentary', 'notes.txt', 'photo.jpg']\", \"assert clean_file_names(['file (2022)', 'file (2019)']) == ['file', 'file']\", \"assert clean_file_names(['report ...
{ "split": "train", "index": 85753, "acecode_id": "bigcode_python_fns_8337", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> int` that returns the nth Fibonacci number using Binet's formula. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2. You should use Binet's formula to compute the Fibonacci number d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2...
{ "split": "train", "index": 85754, "acecode_id": "evol_15839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing email addresses and need to implement a function that categorizes email addresses based on their domain. The function should take a list of email addresses and return a dictionary where the keys are the unique domains and the values are lists of ema...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_emails(['alice@example.com', 'bob@example.com', 'charlie@test.com']) == {'example.com': ['alice@example.com', 'bob@example.com'], 'test.com': ['charlie@test.com']}\", \"assert categorize_emails(['user1@domain.com', 'user2@domain.com', 'user3@anoth...
{ "split": "train", "index": 85755, "acecode_id": "oss_13954", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `lucas_numbers(n: int) -> List[int]` that generates the first N Lucas numbers. The Lucas numbers are defined as follows: L(0) = 2, L(1) = 1, and for n > 1, L(n) = L(n-1) + L(n-2). The function should return a list of the first N Lucas numbers. If N is less ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lucas_numbers(0) == []\", \"assert lucas_numbers(1) == [2]\", \"assert lucas_numbers(2) == [2, 1]\", \"assert lucas_numbers(3) == [2, 1, 3]\", \"assert lucas_numbers(4) == [2, 1, 3, 4]\", \"assert lucas_numbers(5) == [2, 1, 3, 4, 7]\", \"assert lucas_numbers...
{ "split": "train", "index": 85756, "acecode_id": "evol_21902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `simple_counter` that simulates a simple counter. The function should take three parameters: an initial value `initial`, an integer `increments` that specifies how many times to increment the counter, and an integer `decrements...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simple_counter(5, 3, 1) == 7\", \"assert simple_counter(5, 0, 0) == 5\", \"assert simple_counter(0, 5, 0) == 5\", \"assert simple_counter(10, 0, 10) == 0\", \"assert simple_counter(3, 2, 5) == 0\", \"assert simple_counter(7, 10, 0) == 17\", \"assert simple_c...
{ "split": "train", "index": 85757, "acecode_id": "oss_25240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the deletion of a file from a file system. The function should take in a file object represented by a dictionary containing the file's name and a boolean indicating whether the file is marked for deletion. If the file i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_file({'name': 'document.txt', 'is_deleted': True}) == 'File document.txt has been deleted.'\", \"assert delete_file({'name': 'image.png', 'is_deleted': False}) == 'File image.png is safe and has not been deleted.'\", \"assert delete_file({'name': 'not...
{ "split": "train", "index": 85758, "acecode_id": "bigcode_python_fns_11954", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary or a JSON string, implement a function that converts the input into a Python dictionary. If the input is already a dictionary, return it as is. If the input is a valid JSON string, parse it and return the resulting dictionary. If the input is neither a dictio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_dict({'key': 'value'}) == {'key': 'value'}\", \"assert to_dict('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert to_dict('{\\\"nested\\\": {\\\"key\\\": \\\"value\\\"}}') == {'nested': {'key': 'value'}}\", \"assert to_dict('{\\\"list\\\": [1...
{ "split": "train", "index": 85759, "acecode_id": "bigcode_python_fns_10768", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing movie titles as keys and their details (including year and location) as values. Your task is to implement a function `select_year(data: dict, year: int) -> dict` that filters the movie data dictionary to include only movies from the specifi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_year({'Movie A': {'year': 2005, 'location': 'Location A'}, 'Movie B': {'year': 2006, 'location': 'Location B'}, 'Movie C': {'year': 2005, 'location': 'Location C'}}, 2005) == {'Movie A': {'year': 2005, 'location': 'Location A'}, 'Movie C': {'year': 20...
{ "split": "train", "index": 85760, "acecode_id": "oss_5207", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `is_min_value_greater_equal` that checks if the smallest integer in the list is greater than or equal to a specified minimum value. The function should return `True` if it is, otherwise, return `False`. If the input list is empty, retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_min_value_greater_equal([1, 2, 3, 4, 5], 0) == True\", \"assert is_min_value_greater_equal([5, 1, 3, 2, 4], 1) == True\", \"assert is_min_value_greater_equal([], 0) == False\", \"assert is_min_value_greater_equal([1, 2, 3], 5) == False\", \"assert is_min_...
{ "split": "train", "index": 85761, "acecode_id": "bigcode_python_fns_28310", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a non-empty list of integers `nums`, every element appears three times except for one, which appears exactly once. Implement a function `single_number(nums: List[int]) -> int` to find and return that single number. You must implement the solution with linear runtime compl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert single_number([2, 2, 3, 2]) == 3\", \"assert single_number([0, 1, 0, 1, 0, 1, 99]) == 99\", \"assert single_number([1]) == 1\", \"assert single_number([-2, -2, -3, -2]) == -3\", \"assert single_number([4, 4, 4, 5]) == 5\", \"assert single_number([10, 10, 10,...
{ "split": "train", "index": 85762, "acecode_id": "evol_27099", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a new data point `x` and a training dataset represented as a list of instances, implement a function `predict(x, training_set, k)` that predicts the class of the new data point based on the k nearest neighbors in the training dataset. The function should return the majori...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict([1, 2], [[1, 2, 'A'], [2, 3, 'B'], [3, 4, 'A']], 2) == 'A'\", \"assert predict([5, 5], [[1, 1, 'A'], [5, 5, 'B'], [5, 6, 'B']], 1) == 'B'\", \"assert predict([0, 0], [[0, 1, 'A'], [1, 0, 'B'], [0, 0, 'A']], 1) == 'A'\", \"assert predict([2, 2], [[2, ...
{ "split": "train", "index": 85763, "acecode_id": "evol_31040", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers called `seq_aps`. Your task is to implement a function `seq(seq_aps)` that processes this list in the following way: If the list is empty, return an empty list. If the list is not empty, return a list containing the first element followed by the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert seq([]) == []\", \"assert seq([1]) == [1]\", \"assert seq([1, 2]) == [1, 2]\", \"assert seq([1, 2, 3]) == [1, 2, 3]\", \"assert seq([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert seq([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\"]}" }
{ "split": "train", "index": 85764, "acecode_id": "bigcode_python_fns_32155", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of vessels with their corresponding date, port, and deadweight tonnage (DWT) capacity. Your task is to implement a function that calculates the total capacity of vessels for two specified ports on each date, returning a dictionary where the keys are the dat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_capacity([('2023-01-01', 'Port A', 100.0), ('2023-01-01', 'Port B', 200.0)], 'Port A', 'Port B') == {'2023-01-01': (100.0, 200.0)}\", \"assert calculate_total_capacity([('2023-01-01', 'Port A', 100.0), ('2023-01-01', 'Port A', 150.0)], 'Port ...
{ "split": "train", "index": 85765, "acecode_id": "bigcode_python_fns_43545", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given two dictionaries representing two social media accounts. Each dictionary contains the following key: 'follower_count', which is a non-negative integer representing the number of followers the account has. Write a function `higher_follower_count(A: dict, B: dict) -...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert higher_follower_count({'follower_count': 100}, {'follower_count': 50}) == 'A'\", \"assert higher_follower_count({'follower_count': 75}, {'follower_count': 75}) == 'A'\", \"assert higher_follower_count({'follower_count': 0}, {'follower_count': 1}) == 'B'\", \...
{ "split": "train", "index": 85766, "acecode_id": "bigcode_python_fns_6767", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a mapping of port names to their alias names. Your task is to implement a function that takes in this dictionary and an interface alias, and returns the corresponding port name. If the alias is not found, return the alias itself. Addition...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_port_name({'port1': {'alias': 'alias1'}, 'port2': {'alias': 'alias2'}}, 'alias1') == 'port1'\", \"assert find_port_name({'port1': {'alias': 'alias1'}, 'port2': {'alias': 'alias2'}}, 'alias2') == 'port2'\", \"assert find_port_name({'port1': {'alias': 'al...
{ "split": "train", "index": 85767, "acecode_id": "bigcode_python_fns_45100", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even integers from the original list. The function should be named `filter_even_numbers` and should meet the following criteria: 1. The function takes a single param...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert filter_even_numbers(...
{ "split": "train", "index": 85768, "acecode_id": "oss_30134", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing commands in a file system. Each command can be a standalone command or a subcommand of another command. Your task is to write a function called `build_file_system_tree(commands)` that takes a list of strings `commands` as input and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_file_system_tree(['fsrm', 'fsserve', 'fstree', 'fsmkdir', 'fsmount', 'fsserve start', 'fsserve stop', 'fstree show', 'fsmkdir create', 'fsmount attach', 'fsmount detach']) == {'fsrm': [], 'fsserve': ['start', 'stop'], 'fstree': ['show'], 'fsmkdir': ['c...
{ "split": "train", "index": 85769, "acecode_id": "oss_5590", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given an integer 'value' and a list of integers 'rawdata'. Your task is to decode a value based on the following rules: \n1. If 'value' is between 0 and 12 (inclusive), return a tuple containing 'value' and 'rawdata'. \n2. If 'value' is equal to 13, return a tuple conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_value(0, [1, 2, 3]) == (0, [1, 2, 3])\", \"assert decode_value(12, [10, 20, 30]) == (12, [10, 20, 30])\", \"assert decode_value(13, [5, 6, 7]) == (18, [6, 7])\", \"assert decode_value(13, [0]) == (13, [])\", \"assert decode_value(9, [100, 200]) == (9,...
{ "split": "train", "index": 85770, "acecode_id": "bigcode_python_fns_13684", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a matrix represented as a list of lists, where each inner list corresponds to a row of the matrix. Your task is to convert this matrix into a dense representation of a two-dimensional array (list of lists) where each element is the sum of the elements in the corre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_to_dense([[1, 2, 3], [4, 5, 6]]) == [6, 15]\", \"assert matrix_to_dense([[0, 0], [0, 0]]) == [0, 0]\", \"assert matrix_to_dense([[1]]) == [1]\", \"assert matrix_to_dense([[5, 10, 15], [20, 25, 30]]) == [30, 75]\", \"assert matrix_to_dense([[1, -1], [2...
{ "split": "train", "index": 85771, "acecode_id": "bigcode_python_fns_30029", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of strings as input and returns the longest consecutive substring that is alphabetically ordered and appears in every string in the array. If no such substring exists, return an empty string.\nPlease reason step by step, then write a sel...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_common_substring(['abcd', 'abcd', 'abcd']) == 'abcd'\", \"assert longest_common_substring(['a', 'b', 'c']) == ''\", \"assert longest_common_substring(['xyz', 'abc', 'pqr']) == ''\", \"assert longest_common_substring(['aaa', 'aa', 'a']) == 'a'\", \"as...
{ "split": "train", "index": 85772, "acecode_id": "evol_9185", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers representing soccer player scores, write a function `extract_train_data` that checks if the input data is of type list. If the data is a list, the function should return the string 'Valid data input', otherwise it should raise a TypeError with the messa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_train_data([4, 5]) == 'Valid data input'\", \"assert extract_train_data([1, 2, 3]) == 'Valid data input'\", \"assert extract_train_data([]) == 'Valid data input'\", \"assert extract_train_data([7]) == 'Valid data input'\", \"assert extract_train_data...
{ "split": "train", "index": 85773, "acecode_id": "bigcode_python_fns_2001", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates two values, N and J, based on the input parameters for an ensemble model. The function should take four parameters: n_classifiers (an integer representing the number of classifiers), pct_accuracy (a float representing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_N_and_J(10, 0.8, 0.5, 'accuracy') == (8, 5)\", \"assert calculate_N_and_J(5, 1.0, 1.0, 'f1_score') == (5, 5)\", \"assert calculate_N_and_J(10, 0.7, 0.2, 'roc_auc') == (7, 2)\", \"assert calculate_N_and_J(12, 0.0, 0.0, 'accuracy') == (0, 0)\", \"ass...
{ "split": "train", "index": 85774, "acecode_id": "oss_21724", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a string that represents the content of a file and another string representing the expected content of that file. Write a function `check_file_content(file_content: str, expected_content: str) -> bool` that returns True if the file content matches the expected con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_file_content('Hello, World!', 'Hello, World!') == True\", \"assert check_file_content('Hello, World!', 'Hello, world!') == False\", \"assert check_file_content('12345', '12345') == True\", \"assert check_file_content('abc', 'abc') == True\", \"assert c...
{ "split": "train", "index": 85775, "acecode_id": "bigcode_python_fns_1871", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates downloading data from a URL. The function should take a list of URLs and return a dictionary where each key is a URL and the value is the size of the data that would be downloaded from that URL in bytes. The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_download(['http://example.com', 'http://test.com'], {'http://example.com': 5000, 'http://test.com': 3000}) == {'http://example.com': 5000, 'http://test.com': 3000}\", \"assert simulate_download(['http://example.com'], {'http://example.com': 10000}) ...
{ "split": "train", "index": 85776, "acecode_id": "bigcode_python_fns_42488", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function `solve(s)` that takes a string `s` as input, intended to modify the input string based on the following rules: 1. If the first character of the string is a digit, the string remains unchanged. 2. If the first character is a letter, it should be capitali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve('hello world') == 'Hello World'\", \"assert solve('123 apples') == '123 apples'\", \"assert solve('a quick brown fox') == 'A Quick Brown Fox'\", \"assert solve('1st place') == '1st place'\", \"assert solve('one two three') == 'One Two Three'\", \"asser...
{ "split": "train", "index": 85777, "acecode_id": "oss_12224", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a dictionary `sys_map` that represents system information and a dictionary `parsed_map` that represents parsed data, create a function `add_missing_scheduler_data` which updates `parsed_map` with missing I/O scheduler details based on the `sys_map`. The `sys_map` dictiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_missing_scheduler_data({}, {}, 'node1') == None and {} == {}\", \"assert add_missing_scheduler_data({'scheduler': 'deadline'}, {'node1': {'scheduler': 'noop'}}, 'node2') == None and {'node1': {'scheduler': 'noop'}, 'node2': {'scheduler': 'deadline'}} == ...
{ "split": "train", "index": 85778, "acecode_id": "bigcode_python_fns_10025", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that serializes a list of contacts into a specific string format. Each contact is represented as a tuple containing a name and an email address. The function should take a list of these tuples and return a serialized string representation...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_contacts([]) == ''\", \"assert serialize_contacts([('John Doe', 'john@example.com')]) == 'John Doe:john@example.com'\", \"assert serialize_contacts([('John Doe', 'john@example.com'), ('Jane Smith', 'jane@example.com')]) == 'John Doe:john@example.co...
{ "split": "train", "index": 85779, "acecode_id": "oss_20311", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a Python function that accepts a list of integer lists and a position index. The function should return a new list that contains the values at the given position index from each sublist. If a sublist does not have enough elements, treat the missing value as zero. For ex...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_at_index([[2, 3, 4, 5], [1, 2, 3]], 2) == [4, 3]\", \"assert sum_at_index([[2, 3, 4, 5], [1, 2, 3]], 3) == [5, 0]\", \"assert sum_at_index([[2, 3], [1, 2, 3]], 1) == [3, 2]\", \"assert sum_at_index([[1], [2, 3, 4]], 0) == [1, 2]\", \"assert sum_at_index(...
{ "split": "train", "index": 85780, "acecode_id": "evol_15397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a register value that represents a current measurement in hundredths of an Amp, or a current in Amps. You need to implement a function that converts this value based on the following conditions:\n- If the input value is in hundredths of an Amp (i.e., a raw registe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_current(10000, False) == 100.0\", \"assert convert_current(0, False) == 0.0\", \"assert convert_current(65535, False) == 655.35\", \"assert convert_current(100, True) == 10000\", \"assert convert_current(0, True) == 0\", \"assert convert_current(1234...
{ "split": "train", "index": 85781, "acecode_id": "bigcode_python_fns_37468", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `multi_experiment` that simulates running a given experiment multiple times with varying parameters. The function should take the following parameters: `params`, a dictionary where keys are parameter names and values are either single val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multi_experiment({'N': 100, 'method': 'A'}, 1, None) == [{'N': 100, 'method': 'A', 'output': 'experiment_output'}]\", \"assert multi_experiment({'N': [100, 200], 'method': 'A'}, 1, None) == [{'N': 100, 'method': 'A', 'output': 'experiment_output'}, {'N': 200...
{ "split": "train", "index": 85782, "acecode_id": "bigcode_python_fns_26818", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with converting local Cartesian coordinates to Altitude-Azimuth coordinates. Implement a function `cartesian_to_altaz(x: Tuple[float, float, float]) -> Tuple[float, float]` that takes a tuple of three floats representing the Cartesian coordinates (x, y, z) and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cartesian_to_altaz((1, 0, 0)) == (0.0, 0.0)\", \"assert cartesian_to_altaz((0, 1, 0)) == (0.0, -1.5707963267948966)\", \"assert cartesian_to_altaz((0, 0, 1)) == (1.5707963267948966, 0.0)\", \"assert cartesian_to_altaz((0, 0, -1)) == (-1.5707963267948966, 0.0...
{ "split": "train", "index": 85783, "acecode_id": "bigcode_python_fns_43076", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple token system for a user registration process. Write a function `create_auth_token(sender: str, created: bool) -> str` that accepts two parameters: a string `sender`, which represents the user identifier, and a boolean `created`, which indic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_auth_token('user123', True) == 'Token created for user123'\", \"assert create_auth_token('user123', False) == 'No token created'\", \"assert create_auth_token('admin', True) == 'Token created for admin'\", \"assert create_auth_token('admin', False) ==...
{ "split": "train", "index": 85784, "acecode_id": "bigcode_python_fns_23925", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if two provided strings, `str1` and `str2`, are anagrams of each other. An anagram is a rearrangement of the characters of one string to form another string, considering character frequencies but ignoring character orders. The function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_variations('listen', 'silent') == True\", \"assert check_variations('hello', 'world') == False\", \"assert check_variations('triangle', 'integral') == True\", \"assert check_variations('apple', 'pale') == False\", \"assert check_variations('night', 'th...
{ "split": "train", "index": 85785, "acecode_id": "evol_18538", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with converting a central value (average) and its standard uncertainty (s.u.) into a specific string representation compliant with the IUCr (International Union of Crystallography) format. Write a function `iucr_string(values: Tuple[float, float]) -> str` that ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert iucr_string((4.567, 0.123)) == '4.57(0.1)'\", \"assert iucr_string((10.0, 0.0)) == '10.0'\", \"assert iucr_string((2.3, 0.195)) == '2.3(0.2)'\", \"assert iucr_string((0.456, 0.1)) == '0.46(0.1)'\", \"assert iucr_string((-3.5, 0.0)) == '-3.5'\", \"assert iucr...
{ "split": "train", "index": 85786, "acecode_id": "bigcode_python_fns_29212", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of stage configurations, where each configuration is represented by a string. Your task is to implement a function that expands each stage configuration into a detailed representation. The expansion rules are as follows: if a configuration is a single lette...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert expand_stage_cfgs(['A3', 'B', 'C2']) == ['AAA', 'B', 'CC']\", \"assert expand_stage_cfgs(['D4', 'E1', 'F']) == ['DDDD', 'E', 'F']\", \"assert expand_stage_cfgs(['G2', 'H3', 'I']) == ['GG', 'HHH', 'I']\", \"assert expand_stage_cfgs(['J', 'K5', 'L0']) == ['J',...
{ "split": "train", "index": 85787, "acecode_id": "bigcode_python_fns_38641", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an integer n as input and returns the sum of all its integral divisors. An integral divisor of n is any integer that divides n without leaving a remainder. For example, for n = 6, the integral divisors are 1, 2, 3, and 6, and their sum is 12. You...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_divisors(6) == 12\", \"assert aggregate_divisors(15) == 24\", \"assert aggregate_divisors(0) == 0\", \"assert aggregate_divisors(-6) == 12\", \"assert aggregate_divisors(1) == 1\", \"assert aggregate_divisors(28) == 56\", \"assert aggregate_divisor...
{ "split": "train", "index": 85788, "acecode_id": "evol_14016", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an alphanumeric string `s` and an integer `length`. If the length of the string `s` is equal to `length`, the function should return the string in uppercase. If the length of string `s` is not equal to `length`, it should raise a ValueError.\nPle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert uppercase_string('abc123', 6) == 'ABC123'\", \"assert uppercase_string('hello', 5) == 'HELLO'\", \"assert uppercase_string('Python3', 7) == 'PYTHON3'\", \"assert uppercase_string('test123', 7) == 'TEST123'\", \"assert uppercase_string('A1B2C3', 6) == 'A1B2C3...
{ "split": "train", "index": 85789, "acecode_id": "evol_13570", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function `median(arr)` that returns the median of the array. The median is defined as follows: if the array length is odd, the median is the middle element. If the array length is even, the median is the average of the two middle elements...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([1]) == 1\", \"assert median([1, 2]) == 1.5\", \"assert median([1, 2, 3]) == 2\", \"assert median([1, 3]) == 2.0\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([3, 1, 2]) == 2\", \"assert median([5, 1, 3, 2]) == 2.5\", \"assert median([7, ...
{ "split": "train", "index": 85790, "acecode_id": "evol_12332", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the availability of a resource based on a given default availability and the impact of a reaction. The availability is determined by the default availability and the reaction's impact, represented as a decimal value betwe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_availability(0.75, 0.2, 'increased availability of aluminum') == 0.95\", \"assert calculate_availability(0.5, 0.1, 'decreased efficiency') == 0.4\", \"assert calculate_availability(0.9, 0.1, 'no change in availability') == 0.9\", \"assert calculate...
{ "split": "train", "index": 85791, "acecode_id": "oss_2413", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a user's name and a list of post titles, then returns a dictionary representing the user and their associated posts. The dictionary should have the user's name and a list of posts, where each post is represented as a diction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_user_with_posts('Robert', []) == {'name': 'Robert', 'posts': []}\", \"assert create_user_with_posts('Tegan', ['My first post!']) == {'name': 'Tegan', 'posts': [{'title': 'My first post!', 'published': True}]}\", \"assert create_user_with_posts('Alice'...
{ "split": "train", "index": 85792, "acecode_id": "bigcode_python_fns_48212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a program to compare two texts and highlight the differences between them. The differences should be presented in a human-readable format, indicating added, removed, and unchanged lines. Write a function `text_diff` that takes two strings `text1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert text_diff('Same line\\\\n', 'Different line\\\\n') == ['- Same line\\\\n', '+ Different line\\\\n']\", \"assert text_diff('Line1\\\\nLine2\\\\n', '') == ['- Line1\\\\n', '- Line2\\\\n']\", \"assert text_diff('', 'Line1\\\\nLine2\\\\n') == ['+ Line1\\\\n', '+...
{ "split": "train", "index": 85793, "acecode_id": "oss_6065", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a dictionary of Chrome browser options. The function should take in optional keyword arguments to customize the user agent, user data directory, window size, and profile. The function should then create and return a diction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_custom_chrome_options() == {'user_agent': 'Chrome/96.0.4664.110 Safari/537.36', 'user_data_dir': '~/.config/google-chrome-auto', 'window_size': '2560,1440', 'profile': 'Default'}\", \"assert create_custom_chrome_options(user_agent='CustomAgent/1.0') =...
{ "split": "train", "index": 85794, "acecode_id": "oss_1915", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are working on a machine learning project and need to validate the predictions made by your model against the ground truth labels. You have the following information: \n- `true_n_loose_labs`: The number of ground truth labels for loose classification. \n- `true_n_high_dim_l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_predictions(10, 5, 10, 5) == True\", \"assert validate_predictions(8, 4, 10, 5) == False\", \"assert validate_predictions(0, 0, 0, 0) == True\", \"assert validate_predictions(1, 1, 1, 1) == True\", \"assert validate_predictions(2, 2, 1, 1) == False\...
{ "split": "train", "index": 85795, "acecode_id": "oss_32573", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with constructing a URL for a web application based on provided headers and a registration path. Write a function `construct_app_url(headers: dict, register_path: str) -> str` that takes in a dictionary of headers and a registration path string. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_app_url({'host': 'example.com', 'x-forwarded-proto': 'https'}, '/register') == 'https://example.com/register'\", \"assert construct_app_url({'host': 'example.com'}, '/login') == 'http://example.com/login'\", \"assert construct_app_url({'host': 'mya...
{ "split": "train", "index": 85796, "acecode_id": "bigcode_python_fns_39932", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a dictionary of Docker contexts and returns a list of context names that have the `docker_cli` attribute set to `True`. Each key in the dictionary represents a Docker context name, and the value is another dictio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_docker_contexts({'context1': {'docker_cli': True}}) == ['context1']\", \"assert filter_docker_contexts({'context1': {'docker_cli': False}}) == []\", \"assert filter_docker_contexts({'context1': {'docker_cli': True}, 'context2': {'docker_cli': False}})...
{ "split": "train", "index": 85797, "acecode_id": "oss_35747", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibfib(n: int) -> int` that calculates the nth element of the FibFib series. The series is defined as follows: fibfib(0) == 0, fibfib(1) == 0, fibfib(2) == 1, and for n >= 3, fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Your implementation should ...
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": 85798, "acecode_id": "evol_17112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_memory_usage_of_process(pid: int) -> float` that simulates retrieving the memory usage of a process identified by its process ID (PID). The function should return the memory usage in megabytes (MB) as a float value. However, if the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_memory_usage_of_process(1234, {1234: 150.5, 5678: 200.0}) == 150.5\", \"assert get_memory_usage_of_process(5678, {1234: 150.5, 5678: 200.0}) == 200.0\", \"assert get_memory_usage_of_process(9999, {1234: 150.5, 5678: 200.0}) == 0\", \"assert get_memory_us...
{ "split": "train", "index": 85799, "acecode_id": "bigcode_python_fns_31496", "num_tests": 16 }