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 to decode a sequence of likelihood probabilities into a string of characters using the Connectionist Temporal Classification (CTC) decoding method. You are given a 2-D list of probabilities, `probs_seq`, where each element is a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ctc_decode([[0.1, 0.9], [0.8, 0.2]], ['X', 'Y'], 'best_path') == 'YX'\", \"assert ctc_decode([[0.0, 0.0], [0.0, 0.0]], ['A', 'B'], 'best_path') == 'AA'\", \"assert ctc_decode([[0.5, 0.5]], ['A', 'B'], 'best_path') == 'A'\", \"assert ctc_decode([[0.0, 0.0]], ... | {
"split": "train",
"index": 84300,
"acecode_id": "oss_33711",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a CI pipeline name, determine if the pipeline is valid based on specific rules: a valid CI pipeline name must only contain alphanumeric characters and underscores, and it must start with a letter. Implement a function `is_valid_pipeline(pipeline_name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_pipeline('ci_pipeline_1') == True\", \"assert is_valid_pipeline('ci-pipeline-1') == False\", \"assert is_valid_pipeline('1ci_pipeline') == False\", \"assert is_valid_pipeline('ciPipeline') == True\", \"assert is_valid_pipeline('ci_pipeline') == True... | {
"split": "train",
"index": 84301,
"acecode_id": "bigcode_python_fns_49829",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a configuration script for a deep learning model. Given a Python script snippet as a string, an integer `yolo_conv_count`, and a list `_k`, implement a function `process_config_script(script: str, yolo_conv_count: int, _k: list) -> str` that will ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_config_script('if yolo_conv_count % 2 == 0: og_yolo_conv += 1 else: if len(_k) > 3: k = \\\"module_list.%s.%s.%s\\\"%(_k[1], _k[2], _k[3]) else: k = \\\"module_list.%s.%s\\\"%(_k[1], _k[2],)', 4, ['module', 'layer1', 'sublayer1']) == 'module_list.lay... | {
"split": "train",
"index": 84302,
"acecode_id": "oss_21094",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating incoming webhooks from GitHub for repository events. Your function should check if the incoming request is a valid webhook with the following criteria: The request must use the POST method, the User-Agent should include 'GitHub-Hookshot', the cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_webhook({'method': 'POST', 'META': {'HTTP_USER_AGENT': 'Some-Agent', 'CONTENT_TYPE': 'application/json', 'HTTP_X_GITHUB_EVENT': 'push', 'HTTP_X_HUB_SIGNATURE': 'valid_signature'}}) == 'Invalid credentials.'\", \"assert validate_webhook({'method': 'P... | {
"split": "train",
"index": 84303,
"acecode_id": "bigcode_python_fns_24484",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string representing an interface name and simulates retrieving the network and broadcast addresses associated with that interface. The function should return a dictionary with two keys: 'network' and 'bcastaddr'. The value fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_network_info('dummy0') == None\", \"assert get_network_info('eth2') == None\", \"assert get_network_info('eth4') == None\", \"assert get_network_info('tap1') == None\", \"assert get_network_info('wlan2') == None\", \"assert get_network_info('vlan20') == ... | {
"split": "train",
"index": 84304,
"acecode_id": "bigcode_python_fns_48046",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a string `gene_id`, write a function `fetch_gene_details` that simulates the retrieval of gene details based on the provided gene ID. The function should return a dictionary containing the following fields: 'name' (a string representing the display name of the gene), 'id'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_gene_details('gene1') == {'name': 'Gene A', 'id': 'gene1', 'chrom': '1', 'tss': 1000, 'biotype': 'protein_coding'}\", \"assert fetch_gene_details('gene2') == {'name': 'Gene B', 'id': 'gene2', 'chrom': '2', 'tss': 2000, 'biotype': 'lincRNA'}\", \"assert... | {
"split": "train",
"index": 84305,
"acecode_id": "bigcode_python_fns_4169",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a speed in meters per second (m/s). Write a function that converts this speed into kilometers per hour (km/h). The conversion formula is: km/h = m/s * 3.6. Implement a function named `convert_mps_to_kmh` that takes a single argument, `speed_in_mps`, which is a flo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_mps_to_kmh(0) == 0.0\", \"assert convert_mps_to_kmh(1) == 3.6\", \"assert convert_mps_to_kmh(2.5) == 9.0\", \"assert convert_mps_to_kmh(10) == 36.0\", \"assert convert_mps_to_kmh(20) == 72.0\", \"assert convert_mps_to_kmh(50) == 180.0\", \"assert con... | {
"split": "train",
"index": 84306,
"acecode_id": "bigcode_python_fns_40352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing trucking events. Each event has an event ID, a trucker's WhatsApp number, and a date. Your goal is to create a function that takes three parameters: event_id (an integer), trucker_whatsapp (a string), and date (a string in 'YYYY-MM-DD' format). The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_trucking_event(1, '1234567890', '2023-10-01') == {'event_id': 1, 'trucker_whatsapp': '1234567890', 'date': '2023-10-01'}\", \"assert create_trucking_event(2, '0987654321', '2023-11-15') == {'event_id': 2, 'trucker_whatsapp': '0987654321', 'date': '202... | {
"split": "train",
"index": 84307,
"acecode_id": "oss_293",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two bounding boxes represented by their coordinates in the form (x_min, y_min, x_max, y_max), write a function `iou(bbox_1: List[float], bbox_2: List[float]) -> float` that computes the Intersection over Union (IoU) between the two bounding boxes. The IoU is defined as th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert iou([0.0, 0.0, 1.0, 1.0], [0.5, 0.5, 1.5, 1.5]) == 0.14285714285714285\", \"assert iou([0.0, 0.0, 2.0, 2.0], [1.0, 1.0, 3.0, 3.0]) == 0.14285714285714285\", \"assert iou([0.0, 0.0, 1.0, 1.0], [1.0, 1.0, 2.0, 2.0]) == 0.0\", \"assert iou([0.0, 0.0, 1.0, 1.0],... | {
"split": "train",
"index": 84308,
"acecode_id": "bigcode_python_fns_18809",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the nth Fibonacci number using memoization. The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, starting with 0 and 1. You need to implement a function `fib(n)` that returns the nth Fibonacci numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(0) == 0\", \"assert fib(1) == 1\", \"assert fib(2) == 1\", \"assert fib(3) == 2\", \"assert fib(4) == 3\", \"assert fib(5) == 5\", \"assert fib(6) == 8\", \"assert fib(7) == 13\", \"assert fib(8) == 21\", \"assert fib(9) == 34\", \"assert fib(10) == 55\"... | {
"split": "train",
"index": 84309,
"acecode_id": "oss_32482",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `generate_csv_content(statement)` that takes a dictionary representation of a `statement` and returns a string containing the CSV format of the statement's details. The `statement` dictionary has the following keys: `title`, `from_dat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_csv_content({'title': 'Monthly Report', 'from_date': '2023-01-01', 'line_items': [{'tag_pool_name': 'Pool A', 'tag_name': 'Tag 1', 'message_direction': 'inbound', 'total_cost': 10.0}, {'tag_pool_name': 'Pool A', 'tag_name': 'Tag 2', 'message_directi... | {
"split": "train",
"index": 84310,
"acecode_id": "bigcode_python_fns_4443",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple contains two float values: the first value represents the flux measurement of H-gamma and the second value represents the signal-to-noise ratio (S/N) of that measurement. Your task is to implement a function that calculates a 3-si... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_flux_limit([(10.0, 2.0), (15.0, 3.0), (5.0, 1.0)]) == [15.0, 15.0, 15.0]\", \"assert calculate_flux_limit([(0.0, 1.0), (0.0, 0.0)]) == [0.0, 0.0]\", \"assert calculate_flux_limit([(9.0, 3.0), (6.0, 2.0)]) == [9.0, 9.0]\", \"assert calculate_flux_li... | {
"split": "train",
"index": 84311,
"acecode_id": "bigcode_python_fns_11084",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where keys are student names and values are tuples containing (student_height, student_weight, student_age, student_GPA), along with minimum thresholds for height, weight, age, and GPA, write a function that filters out students who do not meet all the minimu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sort_students({'Alice': (5.5, 130, 20, 3.5), 'Bob': (5.8, 150, 21, 3.0), 'Charlie': (5.6, 160, 20, 3.5)}, 5.0, 120, 18, 2.5) == [('Bob', (5.8, 150, 21, 3.0)), ('Alice', (5.5, 130, 20, 3.5)), ('Charlie', (5.6, 160, 20, 3.5))]\", \"assert filter_and... | {
"split": "train",
"index": 84312,
"acecode_id": "evol_26227",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_pin(title: str, description: str, latitude: float, longitude: float, user: User) -> Pin` that creates a new travel pin with the given title, description, latitude, longitude, and associated user. The function should ensure that the provided data is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_pin('Beach Trip', 'Had a great time at the beach!', 34.0522, -118.2437, User(username='john_doe', email='john@example.com', password='securepassword')).title == 'Beach Trip'\", \"assert create_pin('Mountain Hike', 'Amazing views from the top!', 36.778... | {
"split": "train",
"index": 84313,
"acecode_id": "evol_17946",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes survey data as input and generates a string representation of the survey results formatted as a list of options with their corresponding response counts. The survey data consists of the number of responses for each option. Writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_survey_results({'Option A': 15, 'Option B': 20, 'Option C': 10, 'Option D': 25}) == 'Option A: 15\\\\nOption B: 20\\\\nOption C: 10\\\\nOption D: 25'\", \"assert format_survey_results({'Apple': 5, 'Banana': 3, 'Cherry': 7}) == 'Apple: 5\\\\nBanana: 3\... | {
"split": "train",
"index": 84314,
"acecode_id": "oss_23685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes rebalancing data for a financial application. The function should take a list of rebalancing objects as input and perform specific actions based on the attributes of each object. Each rebalancing object is an instance of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_rebalances([Rebalancer(0, 1)]) == ['Processing rebalancing ID: 1']\", \"assert process_rebalances([Rebalancer(1, 2)]) == ['Rebalancing ID 2 has already been completed']\", \"assert process_rebalances([Rebalancer(2, 3)]) == ['Rebalancing ID 3 has fail... | {
"split": "train",
"index": 84315,
"acecode_id": "oss_2527",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that accepts a string input and reverses the order of the words contained within it, while maintaining the original character sequence of each word. The function should return the modified string. For example, given the input 'Hello World!', the output should b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_words('Hello World!') == 'World! Hello'\", \"assert reverse_words('Python is fun') == 'fun is Python'\", \"assert reverse_words('The quick brown fox') == 'fox brown quick The'\", \"assert reverse_words('LeetCode rocks') == 'rocks LeetCode'\", \"asser... | {
"split": "train",
"index": 84316,
"acecode_id": "evol_3720",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given IP address is already configured in a list of existing IP addresses. The function should take two parameters: a string `new_ip` representing the new IP address to be checked, and a list of strings `existing_ips` rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_ip_configuration('1.1.1.1', ['2.2.2.2', '3.3.3.3']) == 'Not Configured'\", \"assert check_ip_configuration('1.1.1.1', ['1.1.1.1', '3.3.3.3']) == 'Already Configured'\", \"assert check_ip_configuration('192.168.1.1', ['192.168.1.2', '192.168.1.3']) == '... | {
"split": "train",
"index": 84317,
"acecode_id": "bigcode_python_fns_27127",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function to find the longest common prefix of two strings. Your function should also handle cases where either of the strings is null or contains only whitespace. If either string is null or contains only whitespace, return an appropriate message. Otherwise, return the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_prefix('hello', 'helmet') == 'hel'\", \"assert longest_common_prefix('apple', 'apricot') == 'ap'\", \"assert longest_common_prefix('test', 'testing') == 'test'\", \"assert longest_common_prefix('python', 'java') == ''\", \"assert longest_commo... | {
"split": "train",
"index": 84318,
"acecode_id": "evol_19892",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple command line argument processor. Write a function `process_arguments` that takes a variable number of string arguments. The function should return a list of strings, where each string is a unique argument from the input arguments, sorted in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_arguments('apple', 'banana', 'apple', 'orange') == ['apple', 'banana', 'orange']\", \"assert process_arguments('zebra', 'apple', 'banana', 'zebra') == ['apple', 'banana', 'zebra']\", \"assert process_arguments('car', 'bike', 'car', 'train', 'bike') =... | {
"split": "train",
"index": 84319,
"acecode_id": "bigcode_python_fns_13898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple memory management system for a microcontroller. The microcontroller has a limited amount of memory, and your task is to create a function that simulates the behavior of allocating and freeing memory. Implement a function `memory_managem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert memory_management([('allocate', 10), ('allocate', 20), ('deinit', 0)]) == 0\", \"assert memory_management([('allocate', 5), ('allocate', 15), ('allocate', 10)]) == 30\", \"assert memory_management([('allocate', 10), ('deinit', 0), ('allocate', 5)]) == 5\", \... | {
"split": "train",
"index": 84320,
"acecode_id": "oss_3419",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string consisting of multiple lines, where each line contains the name of a GitHub repository followed by its star count, separated by a hyphen. Your task is to write a function that processes this string and returns the repository with the highest number of sta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_highest_star_repo('repo1-5\\\\nrepo2-10\\\\nrepo3-8') == 'repo2-10'\", \"assert find_highest_star_repo('repoA-0\\\\nrepoB-0\\\\nrepoC-0') == 'repoA-0'\", \"assert find_highest_star_repo('repoX-15\\\\nrepoY-15\\\\nrepoZ-10') == 'repoX-15'\", \"assert fin... | {
"split": "train",
"index": 84321,
"acecode_id": "oss_12601",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified logging system. Your goal is to create a function `log_messages(messages: List[Tuple[str, str]], level: str) -> List[str]` that takes a list of tuples representing log messages and their severity levels, al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_messages([('System initialized', 'DEBUG'), ('User logged in', 'INFO'), ('Disk space low', 'WARNING'), ('Invalid password attempt', 'ERROR'), ('System failure', 'CRITICAL')], 'WARNING') == ['WARNING: Disk space low', 'ERROR: Invalid password attempt', 'CR... | {
"split": "train",
"index": 84322,
"acecode_id": "oss_27355",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a task object that can represent either an album or a single music item. The task object contains the following attributes: 'is_album' (a boolean indicating if the task is an album), 'cur_artist' (a string representing the current artist for the album), 'cur_album... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert summary({'is_album': True, 'cur_artist': 'Artist A', 'cur_album': 'Album A'}) == 'Artist A - Album A'\", \"assert summary({'is_album': False, 'item': {'artist': 'Artist B', 'title': 'Single B'}}) == 'Artist B - Single B'\", \"assert summary({'is_album': True... | {
"split": "train",
"index": 84323,
"acecode_id": "bigcode_python_fns_5056",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of strings representing configuration lines. The function should remove any lines that start with the prefix 'CEPH_ARGS' and return a new list containing only the remaining lines. Your function should have the follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scrub_ceph_config(['CEPH_ARGS=value1', 'setting1=value2', 'CEPH_ARGS=value3', 'setting2=value4']) == ['setting1=value2', 'setting2=value4']\", \"assert scrub_ceph_config(['settingA=1', 'settingB=2', 'CEPH_ARGS=3', 'CEPH_ARGS=4']) == ['settingA=1', 'settingB=... | {
"split": "train",
"index": 84324,
"acecode_id": "bigcode_python_fns_24389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple authentication system. Write a function called `authenticate_user(username, password)` that takes two string parameters: `username` and `password`. The function should compare the input username and password with the predefined values: the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user('Username', 'Password') == True\", \"assert authenticate_user('Username', 'WrongPassword') == False\", \"assert authenticate_user('WrongUsername', 'Password') == False\", \"assert authenticate_user('userName', 'Password') == False\", \"asse... | {
"split": "train",
"index": 84325,
"acecode_id": "oss_7247",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple user permission check system. Your task is to write a function `check_permissions` that takes two parameters: a list of user permissions represented as strings, and a permission string that you need to check. The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_permissions(['app1.view', 'app1.edit', 'app2.delete'], 'app1.view') == True\", \"assert check_permissions(['app1.view', 'app1.edit', 'app2.delete'], 'app1.delete') == False\", \"assert check_permissions(['app1.view', 'app1.edit', 'app2.delete'], 'app2.... | {
"split": "train",
"index": 84326,
"acecode_id": "oss_36773",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a search query with fields to include and exclude. Your task is to implement a function that checks whether the properties in the features of the response contain only the specified included properties and do not include any excluded prop... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_properties({'fields': {'exclude': ['datetime'], 'include': ['properties.pers:phi', 'properties.gsd']}}, {'features': [{'properties': {'gsd': 1, 'pers:phi': 2}}]}) == True\", \"assert check_properties({'fields': {'exclude': ['datetime'], 'include': ['pr... | {
"split": "train",
"index": 84327,
"acecode_id": "bigcode_python_fns_17861",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `create_email` that takes three parameters: `local_part`, `domain`, and `sub_domain`. The function should construct an email address in the format `local_part@domain.sub_domain` and return the email address if it has a valid syntax according to standard email f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_email('john.doe', 'hotmail', 'co.uk') == 'john.doe@hotmail.co.uk'\", \"assert create_email('alice.smith', 'gmail', 'com') == 'alice.smith@gmail.com'\", \"assert create_email('user123', 'example', 'org') == 'user123@example.org'\", \"assert create_emai... | {
"split": "train",
"index": 84328,
"acecode_id": "evol_20060",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates a user interface based on the state of a checkbox. Specifically, your function should change the text of a scale label when the checkbox is unchecked. The function takes two parameters: a boolean `is_checked` indicating t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_scale_text(False, 'Current Scale') == 'Scale x/y by:'\", \"assert update_scale_text(True, 'Current Scale') == 'Current Scale'\", \"assert update_scale_text(False, 'Scale Factor') == 'Scale x/y by:'\", \"assert update_scale_text(True, 'Scale Factor') =... | {
"split": "train",
"index": 84329,
"acecode_id": "oss_25349",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a command-line interface (CLI) function that processes user input for a repository management system. Your function should take two arguments: a list of command-line options and a list of actions. The function should validate the options to ensu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_repo_args({'--repo-url': 'http://example.com'}, ['list']) == ({'--repo-url': 'http://example.com'}, 'list')\", \"assert parse_repo_args({'--repo-url': 'http://example.com'}, ['get']) == ({'--repo-url': 'http://example.com'}, 'get')\", \"assert parse_re... | {
"split": "train",
"index": 84330,
"acecode_id": "bigcode_python_fns_18750",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of decoder-only parameter names and updating a reloaded parameters dictionary based on certain conditions. Write a function `process_parameters` that takes the following parameters: \n- `DECODER_ONLY_PARAMS` (list): A list of parameter name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_parameters(['param1', 'param2'], {'modelA': {'param1': 1, 'param2': 2}}, 'modelA', type('params', (object,), {'reload_encoder_attn_on_decoder': False})) == {'modelA': {'param1': 1, 'param2': 2}}\", \"assert process_parameters(['param1'], {'modelA': {... | {
"split": "train",
"index": 84331,
"acecode_id": "oss_13944",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `identify_polygon(sides)` that takes a list of integers representing the lengths of the sides of a polygon and returns a string indicating the type of polygon based on the number of sides. The function should return 'Triangle' for 3 sides, 'Quadrilateral' f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_polygon([3]) == 'Polygon'\", \"assert identify_polygon([3, 5]) == 'Polygon'\", \"assert identify_polygon([3, 5, 7]) == 'Triangle'\", \"assert identify_polygon([3, 5, 7, 2]) == 'Quadrilateral'\", \"assert identify_polygon([3, 5, 7, 2, 4]) == 'Pentago... | {
"split": "train",
"index": 84332,
"acecode_id": "evol_32973",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of nodes represented as dictionaries, where each node has a 'name' (string) and a 'dimmable' (boolean) attribute. Your task is to implement a function that filters out dimmable nodes and appends a specific suffix to the names of nodes that contain a certain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_modify_nodes([{'name': 'NodeA', 'dimmable': True}, {'name': 'NodeB', 'dimmable': False}, {'name': 'NodeC', 'dimmable': True}], 'Secret') == ['NodeASecret', 'NodeCSecret']\", \"assert filter_and_modify_nodes([{'name': 'Node1', 'dimmable': True}], '... | {
"split": "train",
"index": 84333,
"acecode_id": "bigcode_python_fns_26888",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a user's profile represented as a dictionary with the following keys: 'age', 'country', 'city', 'telegram', and 'git'. Write a function `update_user_profile(profile: Dict[str, Union[int, str]], age: int, country: str, city: str, telegram: str, git: str) -> str` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_user_profile({'age': 25, 'country': 'USA', 'city': 'New York', 'telegram': 'user123', 'git': 'user456'}, 30, 'Canada', 'Toronto', 'new_user', 'new_git') == 'Profile updated successfully.'\", \"assert update_user_profile({'age': 40, 'country': 'UK', 'c... | {
"split": "train",
"index": 84334,
"acecode_id": "bigcode_python_fns_43397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a packet object with four addresses (addr1, addr2, addr3, addr4) and a field called FCfield. The FCfield is an integer that determines the type of communication based on the values of its least significant bits. Your task is to implement a function that returns a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_packet_addresses({'FCfield': 0, 'addr1': 'A', 'addr2': 'B', 'addr3': 'C', 'addr4': 'D'}) == {'destination': 'A', 'source': 'B', 'bssid': 'C'}\", \"assert get_packet_addresses({'FCfield': 1, 'addr1': 'A', 'addr2': 'B', 'addr3': 'C', 'addr4': 'D'}) == {'bs... | {
"split": "train",
"index": 84335,
"acecode_id": "bigcode_python_fns_34943",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the lengths of fingers. Your task is to implement a function that counts how many fingers are considered 'extended'. A finger is considered extended if its length is greater than a specified threshold. Implement the function `count_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_extended_fingers([1, 2, 3, 4, 5], 0) == 5\", \"assert count_extended_fingers([0, 0, 0, 0, 0], 1) == 0\", \"assert count_extended_fingers([10, 20, 30], 15) == 2\", \"assert count_extended_fingers([], 1) == 0\", \"assert count_extended_fingers([3, 3, 3],... | {
"split": "train",
"index": 84336,
"acecode_id": "oss_9348",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given integer is a perfect number. A perfect number is a positive integer that is equal to the sum of its proper divisors (excluding itself). For example, the number 6 is a perfect number because its divisors are 1, 2, and 3, and 1 + 2 + 3 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_perfect_number(6) == True\", \"assert is_perfect_number(28) == True\", \"assert is_perfect_number(496) == True\", \"assert is_perfect_number(8128) == True\", \"assert is_perfect_number(1) == False\", \"assert is_perfect_number(2) == False\", \"assert is_p... | {
"split": "train",
"index": 84337,
"acecode_id": "evol_28456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of user reviews and returns the review with the highest rating. Each review is represented as a dictionary containing the keys 'user', 'review_text', and 'rating'. The function should return the review with the highes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highest_rated_review([]) is None\", \"assert highest_rated_review([{'user': 'Alice', 'review_text': 'Great!', 'rating': 5}]) == {'user': 'Alice', 'review_text': 'Great!', 'rating': 5}\", \"assert highest_rated_review([{'user': 'Bob', 'review_text': 'Not bad.... | {
"split": "train",
"index": 84338,
"acecode_id": "oss_35016",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a device ID. Your task is to determine if the device ID contains a specific substring that indicates it requires a driver installation. The substring you need to check for is 'CM_PROB_FAILED_INSTALL'. Write a function `needs_driver(device_id:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert needs_driver('CM_PROB_FAILED_INSTALL_1234') == True\", \"assert needs_driver('1234_CM_PROB_FAILED_INSTALL') == True\", \"assert needs_driver('DeviceId_5678') == False\", \"assert needs_driver('CM_PROB_FAILED_INSTALL') == True\", \"assert needs_driver('NoIssu... | {
"split": "train",
"index": 84339,
"acecode_id": "bigcode_python_fns_25635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of dialogue events for a conversational AI system. Each event can be of three types: 'ActionExecuted', 'UserUttered', or 'ActionReverted'. Each event updates the dialogue state in the following manner: if the event i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_dialogue_events([('ActionExecuted', 'action1'), ('UserUttered', 'Hello'), ('ActionExecuted', 'action2')]) == {'executed_actions': ['action1', 'action2'], 'user_utterances': ['Hello']}\", \"assert process_dialogue_events([('UserUttered', 'Hi'), ('Acti... | {
"split": "train",
"index": 84340,
"acecode_id": "oss_20340",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the initialization of a truss element in a finite element analysis. The function should accept the following parameters: an integer `tag` (identifier for the truss element), an integer `inode` (identifier for the start node... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_truss_element(1, 2, 3, 4) == {'tag': 1, 'inode': 2, 'jnode': 3, 'section': 4, 'cmass': False, 'do_rayleigh': False, 'corot': False}\", \"assert create_truss_element(1, 2, 3, 4, cmass=True) == {'tag': 1, 'inode': 2, 'jnode': 3, 'section': 4, 'cmass': T... | {
"split": "train",
"index": 84341,
"acecode_id": "oss_10174",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts an array of integers in ascending order using the insertion sort algorithm. The function should take an array as input and return a new array that contains the sorted elements.\nPlease reason step by step, then write a self-contained Python solut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insertion_sort([3, 2, 5, 4, 1]) == [1, 2, 3, 4, 5]\", \"assert insertion_sort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert insertion_sort([5]) == [5]\", \"assert insertion_sort([]) == []\", \"assert insertion_sort([2, 1]) == [1, 2]\", \"assert ins... | {
"split": "train",
"index": 84342,
"acecode_id": "evol_26714",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function `sum_of_sq_root(arr: List[int], primes_only: bool = False, reverse: bool = False) -> Union[float, None]` that computes the sum of the square roots of unique positive integers in the array. If the parameter `primes_only` is set to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_sq_root([1, 4, 4, 16]) == 7.0\", \"assert sum_of_sq_root([-1, 0]) == 0.0\", \"assert sum_of_sq_root([]) == None\", \"assert sum_of_sq_root([1, 1, 1, 1]) == 1.0\", \"assert sum_of_sq_root([15, 15, 25, 35], primes_only=True) == 0.0\", \"assert sum_of_sq... | {
"split": "train",
"index": 84343,
"acecode_id": "evol_4020",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of project members, where each member is represented as a dictionary containing 'user_id' and 'project_id'. Your task is to implement a function that checks if a specific user is a member of a specific project. If the user is a member of the project, return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_project_for_user('user1', 'project1', [{'user_id': 'user1', 'project_id': 'project1'}, {'user_id': 'user2', 'project_id': 'project2'}]) == 'project1'\", \"assert get_project_for_user('user1', 'project2', [{'user_id': 'user1', 'project_id': 'project1'}, {... | {
"split": "train",
"index": 84344,
"acecode_id": "bigcode_python_fns_26139",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of video data, where each video is represented as a dictionary containing the following attributes: 'title' (a string), 'duration' (a string in the format 'HH:MM:SS'), and 'upload_date' (a string in ISO 8601 format). Write a function `get_longest_video_titl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_longest_video_title([]) == ''\", \"assert get_longest_video_title([{'title': 'Video A', 'duration': '00:10:00', 'upload_date': '2023-01-01T00:00:00Z'}, {'title': 'Video B', 'duration': '00:05:00', 'upload_date': '2023-01-02T00:00:00Z'}]) == 'Video A'\", ... | {
"split": "train",
"index": 84345,
"acecode_id": "oss_7753",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that modifies a given list of integers based on the following rules: 1. If the input list contains any negative integers, they should be replaced with their absolute values. 2. If the input list is empty, the function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_list([3, -5, 2, -5, 8, 2, 3]) == [3, 5, 2, 8]\", \"assert modify_list([]) == []\", \"assert modify_list([-1, -2, -3, -1]) == [1, 2, 3]\", \"assert modify_list([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert modify_list([-1, 1, 1, 2, 2]) == [1, 2]\", \... | {
"split": "train",
"index": 84346,
"acecode_id": "oss_14015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple banking system. The function should take a list of transactions, where each transaction is represented as a tuple containing the transaction type ('deposit' or 'withdraw') and the amount. The function should pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_simulation([('deposit', 100), ('withdraw', 50), ('deposit', 30), ('withdraw', 200)]) == (80, 4)\", \"assert bank_account_simulation([('deposit', 50), ('withdraw', 50)]) == (0, 2)\", \"assert bank_account_simulation([('withdraw', 100)]) == (0, 1)... | {
"split": "train",
"index": 84347,
"acecode_id": "oss_21029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a universe simulation. The universe is represented as a grid of cells, where each cell can either contain a value or be empty. You need to implement a function `from_data(data: List[List[Optional[int]]]) -> List[List[Optional[int]]]` that create... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert from_data([[1, 2], [3, 4]]) == [[1, 2], [3, 4]]\", \"assert from_data([[None, 2], [3, None]]) == [[None, 2], [3, None]]\", \"assert from_data([[None, None], [None, None]]) == [[None, None], [None, None]]\", \"assert from_data([[1, None], [None, 4]]) == [[1, ... | {
"split": "train",
"index": 84348,
"acecode_id": "oss_10631",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of names as input and returns a list of names that contain at least 3 symbols. A symbol is defined as any character that is not a letter or a digit. The function should iterate through the list and check each name for the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_names_with_symbols(['abc', 'def', 'ghi']) == []\", \"assert filter_names_with_symbols(['A', 'B', 'C']) == []\", \"assert filter_names_with_symbols(['']) == []\", \"assert filter_names_with_symbols(['one', 'two', 'three']) == []\", \"assert filter_name... | {
"split": "train",
"index": 84349,
"acecode_id": "oss_33659",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple contains a parent item ID and a file path of an attachment. Your task is to implement a function that takes a pattern string as an argument and returns a list of tuples containing the parent item ID and the path of each attachment... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_attachments('%doc%', [(1, 'document.pdf'), (2, 'image.png'), (3, 'doc.txt')]) == [(1, 'document.pdf'), (3, 'doc.txt')]\", \"assert find_attachments('%.png', [(1, 'document.pdf'), (2, 'image.png'), (3, 'doc.txt')]) == [(2, 'image.png')]\", \"assert find_... | {
"split": "train",
"index": 84350,
"acecode_id": "bigcode_python_fns_20844",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Design a function that processes a given string and returns different results based on the content of the string. The function should be defined as follows: \n\n```python\ndef process_string(s):\n pass\n``` \nIf the string contains only uppercase alphabetic characters, the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string('HELLO') == 3\", \"assert process_string('Hello123!') == {'upper': 1, 'lower': 4, 'digits': 3, 'others': 1}\", \"assert process_string(' ') == []\", \"assert process_string('ABCDE') == 3\", \"assert process_string('abcdefg') == {'upper': 0, ... | {
"split": "train",
"index": 84351,
"acecode_id": "evol_3517",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string of characters that may include letters, numbers, and special symbols. Your task is to implement a function that counts the number of alphabetic characters (both uppercase and lowercase) in the given string. The function should ignore numbers and special c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_alphabets('Hello, World!') == 10\", \"assert count_alphabets('1234567890') == 0\", \"assert count_alphabets('Python 3.8!') == 6\", \"assert count_alphabets('LeetCode') == 8\", \"assert count_alphabets('') == 0\", \"assert count_alphabets('a1b2c3') == 3... | {
"split": "train",
"index": 84352,
"acecode_id": "bigcode_python_fns_45584",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of strings representing various types and returns a new list containing only the types that do not contain the word 'Component'. Your function should be named `filter_component_types` and should take a single ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_component_types(['GetSoundVol', 'SetSoundVol', 'UnsignedFixed', 'Component', 'ComponentInstance', 'SoundComponentDataPtr', 'SoundComponentData', 'SoundComponentData_ptr', 'SoundConverter']) == ['GetSoundVol', 'SetSoundVol', 'UnsignedFixed', 'SoundConv... | {
"split": "train",
"index": 84353,
"acecode_id": "oss_36672",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array as input and multiplies each integer element by 2, returning a new flattened array. The input array may contain nested arrays, which should also be flattened. Do not use any built-in array methods or libraries. The function should ensure... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_by_two([1, 2, 3]) == [2, 4, 6]\", \"assert multiply_by_two([[1, 2], [3, 4]]) == [2, 4, 6, 8]\", \"assert multiply_by_two([1, [2, [3]], 4]) == [2, 4, 6, 8]\", \"assert multiply_by_two([]) == []\", \"assert multiply_by_two([[1], [2], [3]]) == [2, 4, 6... | {
"split": "train",
"index": 84354,
"acecode_id": "evol_30503",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, return the square of the first integer in the list. If the list is empty, return 0. The function should be defined as `def square_first_integer(numbers: List[int]) -> int:` where `numbers` is the input list of integers.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_first_integer([4, 2, 3]) == 16\", \"assert square_first_integer([0, 5, 6]) == 0\", \"assert square_first_integer([-3, 1, 2]) == 9\", \"assert square_first_integer([10]) == 100\", \"assert square_first_integer([-10, -5, -2]) == 100\", \"assert square_f... | {
"split": "train",
"index": 84355,
"acecode_id": "bigcode_python_fns_24679",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of floating-point numbers, implement a function that subtracts elements of the second list from the first list. If the lists are of different lengths, the subtraction should only be performed up to the length of the shorter list. The subtraction should be done e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subtract([5.0, 3.0, 4.0], [2.0, 1.0]) == [3.0, 2.0]\", \"assert subtract([10.5, 2.3], [1.5]) == [9.0]\", \"assert subtract([1.0, 2.0, 3.0], [1.0, 1.0, 1.0]) == [0.0, 1.0, 2.0]\", \"assert subtract([3.5, 2.0], [0.5, 0.5, 0.5]) == [3.0, 1.5]\", \"assert subtra... | {
"split": "train",
"index": 84356,
"acecode_id": "bigcode_python_fns_29150",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Create a function named `format_address` that takes two parameters: `street` (a string) and `house_number` (an integer). The function should return a formatted string of the address in the format 'house_number street'. If the provided `street` is not a string or `house_number` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_address('Baker Street', 221) == '221 Baker Street'\", \"assert format_address('Main St', 123) == '123 Main St'\", \"assert format_address('Elm Street', 45) == '45 Elm Street'\", \"assert format_address('1st Avenue', 1001) == '1001 1st Avenue'\", \"ass... | {
"split": "train",
"index": 84357,
"acecode_id": "evol_7594",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of dictionaries containing information about vessel coordinates and position received time. Each dictionary has a 'key' that represents the type of information and a 'value' that represents the corresponding d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_vessel_data([{'key': 'Coordinates', 'value': '34.0522\\u00b0 N, 118.2437\\u00b0 W'}, {'key': 'Vessel Name', 'value': 'Vessel A'}, {'key': 'Position received', 'value': 'Jul 10, 2021 09:30 UTC'}]) == {'vessel_name': 'Vessel A', 'coordinates': '34.0522... | {
"split": "train",
"index": 84358,
"acecode_id": "oss_17129",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two rectangular grids represented by their dimensions (width and height), determine the dimensions of their intersection and the number of tiles needed to cover this intersection area using a specified tile size. Each tile has a defined width and height. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tile_grid_intersection(0, 0, 5, 5, 1, 1) == (0, (0, 0))\", \"assert tile_grid_intersection(10, 10, 0, 0, 2, 2) == (0, (0, 0))\", \"assert tile_grid_intersection(10, 10, 10, 10, 5, 5) == (4, (10, 10))\", \"assert tile_grid_intersection(6, 6, 6, 6, 2, 2) == (9... | {
"split": "train",
"index": 84359,
"acecode_id": "bigcode_python_fns_7268",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that counts the number of prime numbers in a given range from startnum to endnum, inclusive. The function should only consider positive integers and will operate in base 10. You need to return the count of prime numbers found in that range. The function sig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_primes_in_range(1, 10) == 4\", \"assert count_primes_in_range(10, 20) == 4\", \"assert count_primes_in_range(1, 1) == 0\", \"assert count_primes_in_range(2, 2) == 1\", \"assert count_primes_in_range(3, 5) == 2\", \"assert count_primes_in_range(5, 5) ==... | {
"split": "train",
"index": 84360,
"acecode_id": "evol_6761",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a DELETE request specification for removing an attachment from a document. The function should take in three parameters: a document ID (doc_id), a document revision (doc_rev), and an attachment ID (att_id). The output of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_delete_request('doc123', '1-a', 'att456') == ('DELETE', 'doc123/att456', {'rev': '1-a'})\", \"assert generate_delete_request('my_doc', '2-b', 'attachment1') == ('DELETE', 'my_doc/attachment1', {'rev': '2-b'})\", \"assert generate_delete_request('doc... | {
"split": "train",
"index": 84361,
"acecode_id": "bigcode_python_fns_29793",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains two integers. The first integer represents a month number and the second integer represents the principal value of a loan at that month. Your task is to implement a function that extracts the month numbers and the princi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_loan_data([(1, 1000), (2, 900), (3, 800)]) == ([1, 2, 3], [1000, 900, 800])\", \"assert extract_loan_data([(5, 500), (6, 450), (7, 400)]) == ([5, 6, 7], [500, 450, 400])\", \"assert extract_loan_data([(0, 1200), (1, 1100), (2, 1000), (3, 950)]) == ([... | {
"split": "train",
"index": 84362,
"acecode_id": "bigcode_python_fns_42118",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string of text and a list of specific words. Your task is to create a function that counts the occurrences of each word in the text and returns a dictionary where the keys are the words and the values are their corresponding counts. The function should be case-i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_occurrences('Hello world! Hello again.', ['hello', 'world']) == {'hello': 2, 'world': 1}\", \"assert count_word_occurrences('Python is great. Python is easy.', ['python', 'great', 'easy']) == {'python': 2, 'great': 1, 'easy': 1}\", \"assert count_... | {
"split": "train",
"index": 84363,
"acecode_id": "oss_25115",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that evaluates a simple quiz game. The function should take a list of questions, where each question is represented by a dictionary containing a 'question' string, a list of 'options', and the 'correct_answer' key that indicates the corre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_quiz([{'question': 'What is the capital of France?', 'options': ['a) London', 'b) Paris', 'c) Berlin', 'd) Madrid'], 'correct_answer': 'b'}], ['b']) == 1\", \"assert evaluate_quiz([{'question': 'What is the capital of France?', 'options': ['a) Londo... | {
"split": "train",
"index": 84364,
"acecode_id": "oss_9543",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing distances between vertices in a graph, implement a function that calculates the total stress value after a specified number of iterations using a stochastic gradient descent approach. The stress for each iteration is calculated by summing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_stress([1, 2, 3], 1, 0.1) == [6.0]\", \"assert calculate_stress([0, 0, 0], 5, 0.1) == [0.0, 0.0, 0.0, 0.0, 0.0]\", \"assert calculate_stress([5, 0, 3], 0, 0.1) == []\", \"assert calculate_stress([1, 3, 5, 7], 1, 1.0) == [16.0]\", \"assert calculate... | {
"split": "train",
"index": 84365,
"acecode_id": "bigcode_python_fns_16407",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `check_relation_attributes(relation)` that takes an object `relation` and checks its attributes to determine the type of relation it represents. The function should return a dictionary with the following keys and boolean values: 'is_m2m',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_relation_attributes(MockRelation(True, False, True)) == {'is_m2m': True, 'is_multi': False, 'is_direct': True}\", \"assert check_relation_attributes(MockRelation(False, True, False)) == {'is_m2m': False, 'is_multi': True, 'is_direct': False}\", \"asser... | {
"split": "train",
"index": 84366,
"acecode_id": "bigcode_python_fns_36903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes employee registration data. The function should take a dictionary representing an employee's information and return a new dictionary with the same keys and values. However, if the employee's 'cpf' (a unique identifier) is a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_employee({'nome': 'John Doe', 'rua': '123 Main St', 'cpf': '123456789', 'rg': '987654321', 'fone': '555-1234', 'bloqueado': False, 'usuario_fun': 'jdoe'}) == {'nome': 'John Doe', 'rua': '123 Main St', 'cpf': '123456789', 'rg': '987654321', 'fone': '... | {
"split": "train",
"index": 84367,
"acecode_id": "bigcode_python_fns_1717",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing an iSCSI IQN (iSCSI Qualified Name). Your task is to extract and return the initiator name from the given IQN string. The initiator name is the part of the IQN that appears after the first colon (':'). If there is no colon in the string, retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_initiator_name('iqn.2023-10.com.example:initiator') == 'initiator'\", \"assert extract_initiator_name('iqn.2023-10.com.example:') == ''\", \"assert extract_initiator_name('iqn.2023-10.com.example') == ''\", \"assert extract_initiator_name('iqn.2023-1... | {
"split": "train",
"index": 84368,
"acecode_id": "bigcode_python_fns_49576",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, determine if one string is a rotation of the other, while ignoring spaces and case differences. If one string is a rotation of the other, return a tuple with True and the index at which the rotation starts; otherwise, return a tuple with False and None. The i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_rotation('abc def', 'defabc') == (True, 3)\", \"assert is_rotation('12345', '34512') == (True, 2)\", \"assert is_rotation('Aa Bb Cc', 'Cc Aa Bb') == (True, 4)\", \"assert is_rotation('Rotation!', '!Rotation') == (True, 8)\", \"assert is_rotation('123', '3... | {
"split": "train",
"index": 84369,
"acecode_id": "evol_21063",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function called `main` that returns the integer 0. This function does not take any parameters. Your implementation should simply return the value 0.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert main() == 0\", \"assert main() == 0\", \"assert main() == 0\", \"assert main() == 0\", \"assert main() == 0\", \"assert main() == 0\", \"assert main() == 0\", \"assert main() == 0\", \"assert main() == 0\", \"assert main() == 0\", \"assert main() == 0\", \"a... | {
"split": "train",
"index": 84370,
"acecode_id": "bigcode_python_fns_28675",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representation of data, implement a function `is_binary_data(data: str) -> bool` that checks if the string represents binary data. Binary data is defined as a string that contains only the characters '0' and '1'. Return True if the string is binary data, otherwis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_binary_data('101010') == True\", \"assert is_binary_data('111000') == True\", \"assert is_binary_data('000') == True\", \"assert is_binary_data('1') == True\", \"assert is_binary_data('0') == True\", \"assert is_binary_data('01010101') == True\", \"assert... | {
"split": "train",
"index": 84371,
"acecode_id": "bigcode_python_fns_37315",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `transform_string(s: str) -> str` that takes a string `s` as input and transforms all whitespace characters into underscores. If the string contains no whitespace characters, the function should transform all underscores into whitespace characters. Return t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_string('Hello World') == 'Hello_World'\", \"assert transform_string('Python is great') == 'Python_is_great'\", \"assert transform_string('NoSpacesHere') == 'NoSpacesHere'\", \"assert transform_string('Spaces and tabs') == 'Spaces____and____ta... | {
"split": "train",
"index": 84372,
"acecode_id": "evol_29427",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of elements, convert the list into a string representation where the square brackets are replaced with parentheses. The resulting string should maintain the order of the elements in the list. Implement a function `list_to_str(elements: List[Any]) -> str` that takes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_to_str([1, 2, 3]) == '(1, 2, 3)'\", \"assert list_to_str([]) == '()'\", \"assert list_to_str([True, False]) == '(True, False)'\", \"assert list_to_str([1.1, 2.2, 3.3]) == '(1.1, 2.2, 3.3)'\", \"assert list_to_str([None]) == '(None)'\", \"assert list_to_... | {
"split": "train",
"index": 84373,
"acecode_id": "bigcode_python_fns_40481",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates the BIOS settings of a computer system. The function receives a dictionary representing the current BIOS settings and another dictionary representing the new settings to be applied. Your goal is to return a dictionary com... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_bios_settings({'Speed': '2400MHz', 'Voltage': '1.2V', 'Mode': 'Normal'}, {'Speed': '3200MHz', 'Mode': 'Performance'}) == {'Speed': '3200MHz', 'Voltage': '1.2V', 'Mode': 'Performance'}\", \"assert update_bios_settings({'Speed': '2400MHz', 'Voltage': '1... | {
"split": "train",
"index": 84374,
"acecode_id": "bigcode_python_fns_13977",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple contains a flowcell ID (a string) and a lane number (an integer). Your task is to create a function that returns a sorted list of unique flowcell IDs from the input list, without any duplicates. The input list may have multiple en... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_flowcells([('FC1', 1), ('FC2', 1), ('FC1', 2), ('FC3', 1)]) == ['FC1', 'FC2', 'FC3']\", \"assert get_unique_flowcells([('FC1', 1), ('FC1', 1)]) == ['FC1']\", \"assert get_unique_flowcells([('FC2', 3), ('FC2', 2), ('FC1', 1)]) == ['FC1', 'FC2']\", ... | {
"split": "train",
"index": 84375,
"acecode_id": "bigcode_python_fns_29154",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function `palindrome_analysis(strings)` that analyzes the list to determine the longest palindromic string, the shortest palindromic string, and the average length of all palindromic strings in the list. The function should return a tuple contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert palindrome_analysis(['abc', 'def', 'ghi']) == (None, None, 0)\", \"assert palindrome_analysis([None, None, None]) == (None, None, 0)\", \"assert palindrome_analysis(['']) == ('', '', 0)\", \"assert palindrome_analysis(['a', 'b', 'c', 'd', 'e']) == ('a', 'a',... | {
"split": "train",
"index": 84376,
"acecode_id": "evol_19529",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes three strings as input: a website name, a theme, and a logo URL. The function should return a string representation of the website configuration in the format 'Site Config: [site_name], Theme: [theme], Logo: [logo_url]'. Im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_website_config('Example Site', 'Dark Theme', 'https://example.com/logo.png') == 'Site Config: Example Site, Theme: Dark Theme, Logo: https://example.com/logo.png'\", \"assert create_website_config('My Blog', 'Light Theme', 'https://myblog.com/logo.png... | {
"split": "train",
"index": 84377,
"acecode_id": "oss_27374",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to process a list of integers. Write a Python function `process_numbers(numbers: List[int]) -> Dict[str, int]` that takes a list of integers and returns a dictionary containing the count of positive numbers, the count of negative numbers,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([1, 2, 3]) == {'positive_count': 3, 'negative_count': 0, 'total_sum': 6}\", \"assert process_numbers([-1, -2, -3]) == {'positive_count': 0, 'negative_count': 3, 'total_sum': -6}\", \"assert process_numbers([0]) == {'positive_count': 0, 'negat... | {
"split": "train",
"index": 84378,
"acecode_id": "oss_1939",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of order book IDs representing different stocks. Your task is to implement a function that returns the number of unique order book IDs in the list. The function should also handle cases where the input may contain duplicate IDs. You need to implement the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_order_book_ids(['000001.XSHE', '000002.XSHE', '000001.XSHE']) == 2\", \"assert count_unique_order_book_ids(['000003.XSHE', '000003.XSHE', '000003.XSHE']) == 1\", \"assert count_unique_order_book_ids(['000004.XSHE', '000005.XSHE', '000006.XSHE'])... | {
"split": "train",
"index": 84379,
"acecode_id": "bigcode_python_fns_45552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that searches a given string for specified regular expression patterns and returns the starting and ending indices of all matches. The function should be able to handle overlapping patterns and return the indices for each match in the format of a list of di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_patterns('abcabc', ['abc']) == [{'pattern': 'abc', 'match': 'abc', 'start_index': 0, 'end_index': 3}, {'pattern': 'abc', 'match': 'abc', 'start_index': 3, 'end_index': 6}]\", \"assert search_patterns('aaa', ['a']) == [{'pattern': 'a', 'match': 'a', 's... | {
"split": "train",
"index": 84380,
"acecode_id": "evol_22674",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of integers and returns a new list containing only the even integers from the original list. If there are no even integers, the function should return an empty list. Write a function `filter_even_numbers(n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers([5, 7, 9]) == []\", \"assert filter_even_numbers([10... | {
"split": "train",
"index": 84381,
"acecode_id": "oss_22648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts a list of ocean data sources and returns the total number of unique ocean data sources. Each source is represented by a string. The function should ignore any duplicate entries in the list. Implement the function `count_uniqu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_sources(['WOA18', 'WOA18', 'WOA94', 'WOA01']) == 3\", \"assert count_unique_sources(['WOA2018', 'GEBCO', 'NODC', 'GEBCO', 'WOA2018']) == 3\", \"assert count_unique_sources(['DOC', 'SWrad', 'SeaWIFS', 'Productivity']) == 4\", \"assert count_uniqu... | {
"split": "train",
"index": 84382,
"acecode_id": "bigcode_python_fns_364",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that combines two strings by alternating their characters. If the strings are of unequal length, include the remaining characters from the longer string. After combining, reverse the final output. Write a function named `custom_mix_strings` that takes in tw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_mix_strings('', '') == ''\", \"assert custom_mix_strings('a', '') == 'a'\", \"assert custom_mix_strings('', 'b') == 'b'\", \"assert custom_mix_strings('a', 'b') == 'ba'\", \"assert custom_mix_strings('abcde', '') == 'edcba'\", \"assert custom_mix_stri... | {
"split": "train",
"index": 84383,
"acecode_id": "evol_11172",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python named `evaluate_numbers` that takes a variable number of arguments. For each argument, the function should determine if it is a positive number, negative number, or non-numeric input. Additionally, if the argument is a positive integer, the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_numbers(1, 2, 3, 4, 5) == [{'input': 1, 'type': 'positive', 'is_prime': False}, {'input': 2, 'type': 'positive', 'is_prime': True}, {'input': 3, 'type': 'positive', 'is_prime': True}, {'input': 4, 'type': 'positive', 'is_prime': False}, {'input': 5,... | {
"split": "train",
"index": 84384,
"acecode_id": "evol_10290",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `create_user_profile` that takes three parameters: a string `screen_name`, a string `biometric_hash`, and a string or integer `cellular_contact`. The function should return a dictionary representing a user profile with the keys 'ScreenName', 'BioMetr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user_profile('user123', 'hashed_key_abc', '123-456-7890') == {'ScreenName': 'user123', 'BioMetricHash': 'hashed_key_abc', 'CellularContact': '123-456-7890'}\", \"assert create_user_profile('admin', 'secure_hash_456', 9876543210) == {'ScreenName': 'adm... | {
"split": "train",
"index": 84385,
"acecode_id": "evol_35820",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `extract_urls_and_clean_text` that takes a tweet's text and two lists of URLs (one from the original tweet and another from a quoted tweet) to extract and store the URLs while cleaning the tweet's text. The function should perform the foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_urls_and_clean_text('Check this out! https://example.com and also https://another.com', [{'url': 'https://example.com'}, {'url': 'https://another.com'}], [{'url': 'https://quoted.com'}]) == ('Check this out! and also ', ['https://example.com', 'http... | {
"split": "train",
"index": 84386,
"acecode_id": "oss_20151",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the movement of a robot based on a given command string. The robot can perform the following commands: 'MOVE FORWARD', 'MOVE BACKWARD', 'TURN LEFT', and 'TURN RIGHT'. Each command executes once. The robot starts at the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_robot(['MOVE FORWARD', 'MOVE FORWARD', 'TURN RIGHT', 'MOVE FORWARD']) == (1, 2)\", \"assert move_robot(['MOVE FORWARD']) == (0, 1)\", \"assert move_robot(['MOVE BACKWARD']) == (0, -1)\", \"assert move_robot(['TURN RIGHT', 'MOVE FORWARD']) == (1, 0)\", \... | {
"split": "train",
"index": 84387,
"acecode_id": "bigcode_python_fns_30039",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that identifies the first recurring word in a given text string. The function should return the word along with the index positions of its first and second occurrence. If no recurring word is found, the function should return 'No recurring word found'. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_recurring_word('No repeats here') == 'No recurring word found'\", \"assert first_recurring_word('A quick brown fox jumps over the lazy dog. A lazy dog.') == ('a', 0, 9)\", \"assert first_recurring_word('Hello, hello, how are you?') == ('hello', 0, 1)\"... | {
"split": "train",
"index": 84388,
"acecode_id": "evol_29324",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python program that processes a list of search results provided as a multi-line string and extracts specific information from them. Write a Python function `extract_search_results` that takes a single string as input, where each search result is s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_search_results('title: Python\\\\nurl: https://www.python.org\\\\nsnippet: Python is amazing!\\\\n\\\\ntitle: Java\\\\nurl: https://www.java.com\\\\nsnippet: Java is versatile.') == [{'title': 'Python', 'url': 'https://www.python.org', 'snippet': 'Py... | {
"split": "train",
"index": 84389,
"acecode_id": "oss_13004",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of three floating-point numbers representing a vector, and an integer representing the number of decimal places to round each element of the vector, implement a function `round_vector(v: List[float], fraction: int) -> List[float]` that rounds each element of the ve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_vector([1.12345, 2.23456, 3.34567], 2) == [1.12, 2.23, 3.35]\", \"assert round_vector([0.11111, 0.22222, 0.33333], 3) == [0.111, 0.222, 0.333]\", \"assert round_vector([-1.98765, -2.87654, -3.76543], 1) == [-2.0, -2.9, -3.8]\", \"assert round_vector([0... | {
"split": "train",
"index": 84390,
"acecode_id": "bigcode_python_fns_21290",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 2D points represented as a list of tuples, write a function that calculates the Euclidean distance between each pair of points and returns a 2D list representing the distance matrix. The distance between point A (x1, y1) and point B (x2, y2) is calculated as sqr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distance_matrix([(0, 0)]) == [[0.0]]\", \"assert calculate_distance_matrix([(0, 0), (1, 1)]) == [[0.0, 1.4142135623730951], [1.4142135623730951, 0.0]]\", \"assert calculate_distance_matrix([(1, 2), (3, 4)]) == [[0.0, 2.8284271247461903], [2.8284271... | {
"split": "train",
"index": 84391,
"acecode_id": "bigcode_python_fns_45941",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `multiply_decimals` that takes three string inputs representing decimal numbers. The function should validate that the inputs can be converted to decimals. If they are valid, it should multiply these decimal numbers and return the result rounded to 8 decimal po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_decimals('0.1', '0.2', '0.3') == Decimal('0.00600000')\", \"assert multiply_decimals('1.0', '0.0', '3.5') == Decimal('0.00000000')\", \"assert multiply_decimals('9999999999.99999999', '1', '1') == Decimal('9999999999.99999999')\", \"assert multiply_... | {
"split": "train",
"index": 84392,
"acecode_id": "evol_14079",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_fulcrum(lst: List[int]) -> int` that identifies the index of the 'fulcrum' integer in a list of integers. A 'fulcrum' integer is defined as an element such that the sum of all elements before it is equal to the average of all elements after it. If no ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_fulcrum([0, 1, 2, 3, 4, 5]) == -1\", \"assert find_fulcrum([10, 5, 2, 1, 0]) == -1\", \"assert find_fulcrum([]) == -1\", \"assert find_fulcrum([1, 2, 3, 3, 3]) == 2\", \"assert find_fulcrum([1, 1, 2, 2, 2]) == 2\", \"assert find_fulcrum([10, 20, 30, 40]... | {
"split": "train",
"index": 84393,
"acecode_id": "evol_19060",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a string consisting only of lowercase English letters. Your task is to determine the minimum number of operations needed to reproduce the string using a peculiar printer that can only print a continuous sequence of identical characters in one go. During each opera... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_operations('a') == 1\", \"assert min_operations('abc') == 3\", \"assert min_operations('ab') == 2\", \"assert min_operations('l') == 1\", \"assert min_operations('mnopqr') == 6\", \"assert min_operations('abcdefg') == 7\"]}"
} | {
"split": "train",
"index": 84394,
"acecode_id": "evol_17180",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `b64_encode(data: bytes) -> bytes` that takes a bytes object as input and returns its Base64 encoded representation as a bytes object. The Base64 encoding scheme is used to encode binary data into an ASCII string format by converting it into a radix-64 repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert b64_encode(b'') == b''\", \"assert b64_encode(b'foo') == b'Zm9v'\", \"assert b64_encode(b'foobar') == b'Zm9vYmFy'\", \"assert b64_encode(b'Hello, World!') == b'SGVsbG8sIFdvcmxkIQ=='\", \"assert b64_encode(b'Python') == b'UHl0aG9u'\", \"assert b64_encode(b'Ba... | {
"split": "train",
"index": 84395,
"acecode_id": "bigcode_python_fns_5647",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to manage a list of chemical elements. Your goal is to format the names of these elements by applying italic styling and a specific background color. Write a function `formatChemicalElements` that takes a list of chemical element names as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert formatChemicalElements(['Hydrogen', 'Helium', 'Lithium', 'Beryllium']) == ['Hydrogen (font: italic, background: #729FDF)', 'Helium (font: italic, background: #729FDF)', 'Lithium (font: italic, background: #729FDF)', 'Beryllium (font: italic, background: #729... | {
"split": "train",
"index": 84396,
"acecode_id": "oss_4607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of employee records and calculates the average salary of all employees in the list. Each record is represented as a dictionary containing the keys 'id', 'name', 'department', and 'salary'. The function should return a fl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_salary([]) == 0.0\", \"assert average_salary([{'id': 1, 'name': 'Alice', 'department': 'Engineering', 'salary': 75000.00}]) == 75000.00\", \"assert average_salary([{'id': 1, 'name': 'Alice', 'department': 'Engineering', 'salary': 75000.00}, {'id': 2,... | {
"split": "train",
"index": 84397,
"acecode_id": "oss_34392",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Your task is to write a function that takes this list and returns a dictionary that maps each age to the number of people who have that age. If the input list is empty, return an empty dictionary. Impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert age_count([20, 21, 20, 22]) == {20: 2, 21: 1, 22: 1}\", \"assert age_count([30, 30, 30]) == {30: 3}\", \"assert age_count([15]) == {15: 1}\", \"assert age_count([]) == {}\", \"assert age_count([1, 2, 3, 1, 2, 1]) == {1: 3, 2: 2, 3: 1}\", \"assert age_count([... | {
"split": "train",
"index": 84398,
"acecode_id": "bigcode_python_fns_27936",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks whether a specific OpenGL extension is supported and retrieves the value of a constant associated with that extension. The function should take the extension name as input and return the constant value if the extension ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_extension_support('GL_SGIX_depth_texture') == 0x81A5\", \"assert check_extension_support('GL_EXT_framebuffer_object') == 0x8CA1\", \"assert check_extension_support('GL_ARB_vertex_buffer_object') == 0x8892\", \"assert check_extension_support('GL_SGIX_de... | {
"split": "train",
"index": 84399,
"acecode_id": "oss_32521",
"num_tests": 6
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.