Dataset Viewer
Auto-converted to Parquet Duplicate
ground_truth
listlengths
1
1
dataset
listlengths
1
1
custom_id
stringlengths
33
55
original_dataset
stringclasses
6 values
dataset_source
stringclasses
2 values
prompt
stringlengths
33
1.47k
id
stringclasses
379 values
model
stringclasses
0 values
predicted_label
stringclasses
0 values
prompt_original
stringlengths
35
1.53k
prompt_language
stringclasses
1 value
is_translation
bool
1 class
translation_mode
stringclasses
1 value
translation_id
stringlengths
33
33
[ "[\"assert find_kth_smallest([4, 2, 5, 1, 3], 3) == 3\", \"assert find_kth_smallest([7, 10, 4, 3, 20, 15], 4) == 10\", \"assert find_kth_smallest([1, 2, 3, 4, 5], 1) == 1\", \"assert find_kth_smallest([1, 2, 3, 4, 5], 5) == 5\", \"assert find_kth_smallest([5, 4, 3, 2, 1], 2) == 2\", \"assert find_kth_smallest([2, 2...
[ "code" ]
llama-nemotron-rlvr-difficulty-6_filtered-request-2-35
hamishivi/llama-nemotron-rlvr-difficulty-6_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulle annetaan funktio, jolla on seuraava allekirjoitus: def find_kth_smallest(nums: list, k: int) -> int missä `nums` on kokonaislukujen lista (mahdollisesti järjestämätön) ja `k` on kokonaisluku. Kirjoita funktio, joka palauttaa listan k:nneksi pienimmän alkion JÄRJESTÄMÄTÄ koko listaa. Älä käytä mitään Pyt...
0ffffd98-942b-426d-b4f8-943d3917d6cb
null
null
user: You are given a function with the following signature: def find_kth_smallest(nums: list, k: int) -> int where `nums` is a list of integers (possibly unsorted) and `k` is an integer. Write a function that returns the kth smallest element in the list WITHOUT sorting the entire list. Do not use any built-in Python...
fi
true
prompt_only
code_000000__fi__3b5de3ef72b1a980
[ "[\"assert singleNumber([3, 3, 3, 4, 2, 2, 2]) == 4\", \"assert singleNumber([5, 5, 5, 17]) == 17\", \"assert singleNumber([1, 1, 1, -7]) == -7\", \"assert singleNumber([-2, -2, -2, 0]) == 0\", \"assert singleNumber([12]) == 12\", \"assert singleNumber([0, 1, 0, 1, 0, 1, 99]) == 99\", \"assert singleNumber([2,2,3,2...
[ "code" ]
llama-nemotron-rlvr-difficulty-6_filtered-request-15-26
hamishivi/llama-nemotron-rlvr-difficulty-6_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio, jolla on allekirjoitus `def singleNumber(nums: list[int]) -> int` joka annettuna kokonaislukutaulukko `nums` jossa jokainen alkio esiintyy kolme kertaa yhtä lukuun ottamatta, joka esiintyy täsmälleen kerran, palauttaa sen yksittäisen alkion, joka esiintyy vain kerran. Ratkaisusi on oltava aikakom...
77396fb0-aba1-4b6d-bf0b-afbc70e6e762
null
null
user: Implement a function with the signature `def singleNumber(nums: list[int]) -> int` that, given an integer array `nums` where every element appears three times except for one, which appears exactly once, returns the single element that appears only once. Your solution must have linear runtime complexity and use on...
fi
true
prompt_only
code_000001__fi__6a203d21c4228a30
[ "[\"assert get_unique_integers([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert get_unique_integers([4, 5, 4, 6, 7, 8, 5]) == [4, 5, 6, 7, 8]\", \"assert get_unique_integers([1, 1, 1, 1]) == [1]\", \"assert get_unique_integers([]) == []\", \"assert get_unique_integers([3, 2, 1, 3, 2, 1]) == [3, 2, 1]\", \"assert get_un...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-3-4
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Tehtävänäsi on luoda funktio, joka ottaa syötteeksi kokonaislukujen listan ja palauttaa listan uniikeista kokonaisluvuista kyseisestä listasta, säilyttäen niiden ensimmäisen esiintymisjärjestyksen. Kirjoita funktio `get_unique_integers(nums: List[int]) -> List[int]` joka toteuttaa tämän. Syöte on kokonaislukujen ...
48c5807d99d07d66e941b019578a7215a2be85a9af5c579e506e762abe0d7b1a
null
null
user: You are tasked with creating a function that takes a list of integers and returns a list of unique integers from that list, preserving the order of their first appearance. Write a function `get_unique_integers(nums: List[int]) -> List[int]` that accomplishes this. The input will be a list of integers, and the out...
fi
true
prompt_only
code_000002__fi__f649836c1cfa6617
[ "[\"assert apply_dropout([[1.0, 2.0], [3.0, 4.0]], 0.5, False) == [[1.0, 2.0], [3.0, 4.0]]\", \"assert apply_dropout([[0.0, 0.0], [0.0, 0.0]], 0.2, True) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert apply_dropout([[1.5, 2.5], [3.5, 4.5]], 0.3, False) == [[1.5, 2.5], [3.5, 4.5]]\", \"assert apply_dropout([[1.0]], 0.0, Tr...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-4-95
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `apply_dropout` joka simuloi dropout-kerrosta eteenpäin syöttävälle neuroverkolle. Funktion tulee ottaa syötteeksi 2D liittymä liukuluvuista `input_data`, liukuluku `dropout_ratio` joka edustaa kunkin yksikön dropout-todennäköisyyttä, sekä totuusarvo `training_mode` joka osoittaa, käytetäänkö drop...
cf73b9637aaa59a052fd8063515b175d6005c1a833edaebad51ad7c30e0684c0
null
null
user: Implement a function `apply_dropout` that simulates a dropout layer for a feed-forward neural network. The function should take a 2D list of floats `input_data`, a float `dropout_ratio` representing the probability of dropping out each unit, and a boolean `training_mode` indicating whether to apply dropout. Your ...
fi
true
prompt_only
code_000003__fi__375046046d4adaa4
[ "[\"assert check_convergence(True) is None\", \"assert check_convergence(True) is None\", \"assert check_convergence(True) is None\", \"assert check_convergence(True) is None\", \"assert check_convergence(True) is None\", \"assert check_convergence(True) is None\", \"assert check_convergence(True) is None\", \"asse...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-7-49
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on toteuttaa mukautettu varoitusjärjestelmä koneoppimiskirjastolle. Tavoitteenasi on luoda mukautettu varoitusluokka nimeltä `ConvergenceWarning` , joka tallentaa konvergenssiongelmat mallien koulutuksen aikana. Tehtäväsi on toteuttaa funktio `check_convergence(converged: bool) -> None`, joka no...
21a86abeeb14696dcd53615996fcb9f716403e5734c83e0d8f54a35700ca23ee
null
null
user: You are tasked with implementing a custom warning system for a machine learning library. Your goal is to create a custom warning class called `ConvergenceWarning` that captures convergence problems during the training of models. Your task is to implement a function `check_convergence(converged: bool) -> None`, wh...
fi
true
prompt_only
code_000005__fi__1c98747b7d4260db
[ "[\"assert calculate_columns(0) == 0\", \"assert calculate_columns(1) == 1\", \"assert calculate_columns(2) == 2\", \"assert calculate_columns(3) == 3\", \"assert calculate_columns(4) == 4\", \"assert calculate_columns(5) == 5\", \"assert calculate_columns(6) == 6\", \"assert calculate_columns(7) == 2\", \"assert c...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-8-2
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Tehtävänäsi on luoda Python-funktio, joka laskee dynaamisesti optimaalisen sarakkeiden määrän kamerasyötteiden näyttämiseksi graafisessa käyttöliittymässä (GUI). Funktion tulee ottaa kokonaislukumuotoinen syöte, joka edustaa kamerasyötteiden määrää, ja palauttaa optimaalinen sarakkeiden määrä syötteiden järjestäm...
f5e722ba3adc511b39ecb46575877097f172be9e4d103b92e13cc42f764ccfae
null
null
user: You are tasked with creating a Python function that dynamically calculates the optimal number of columns for displaying camera feeds in a graphical user interface (GUI). The function should take an integer input representing the number of camera feeds and return the optimal number of columns for arranging the fee...
fi
true
prompt_only
code_000006__fi__4743cebabca1f210
[ "[\"assert calculate_theta({0: 5, 90: 10, 180: 15, 270: 20}) == [0.0, 1.5707963267948966, 3.141592653589793, 4.71238898038469]\", \"assert calculate_theta({30: 1, 150: 2, 270: 3}) == [0.5235987755982988, 2.6179938779914944, 4.71238898038469]\", \"assert calculate_theta({45: 1, 135: 2, 225: 3, 315: 4}) == [0.7853981...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-8-55
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetun sanakirjan perusteella, joka esittää histogram sen, että avaimet ovat kulmia asteina (0 :sta 360:iin) ja arvot ovat taajuuksia, kirjoita funktio `calculate_theta(histogram: Dict[int, int]) -> List[float]` , joka palauttaa listan asteista radiaaneiksi muunnetuista kulmista. Palautetun listan tulee säilyttä...
5774e7321b6279d892e5152f826f5e172ff305f235bf5a66c5a0ccbcf256af2d
null
null
user: Given a dictionary representing a histogram where the keys are angles in degrees (0 to 360) and the values are frequencies, write a function `calculate_theta(histogram: Dict[int, int]) -> List[float]` that returns a list of angles converted from degrees to radians. The returned list should maintain the order of t...
fi
true
prompt_only
code_000007__fi__eba2bcb770faccf5
[ "[\"assert paginate_data([1, 2, 3, 4, 5], 2, 1) == [1, 2]\", \"assert paginate_data([1, 2, 3, 4, 5], 2, 2) == [3, 4]\", \"assert paginate_data([1, 2, 3, 4, 5], 2, 3) == [5]\", \"assert paginate_data([1, 2, 3, 4, 5], 2, 0) == [1, 2]\", \"assert paginate_data([1, 2, 3, 4, 5], 2, -1) == [1, 2]\", \"assert paginate_dat...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-8-73
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `paginate_data(data: List[int], paginate_by: int, page: int) -> List[int]` , joka ottaa syötteenä kokonaislukulistan `data`, kokonaisluvun `paginate_by` , joka ilmoittaa näytettävien elementtien määrän per page, sekä kokonaisluvun `page` , joka ilmoittaa haettavan page numeron. Jos page numero ei ...
8a7bccc0930a318c3a7579d833790a35b7d51fc7ace320aa2704615641e638bb
null
null
user: Implement a function `paginate_data(data: List[int], paginate_by: int, page: int) -> List[int]` that takes a list of integers `data`, an integer `paginate_by` indicating the number of elements to be displayed per page, and an integer `page` indicating the page number to retrieve. If the page number is not a valid...
fi
true
prompt_only
code_000008__fi__f2f0e580a5d239dc
[ "[\"assert maxGameScore([0]) == 0\", \"assert maxGameScore([0, 0, 0]) == 0\", \"assert maxGameScore([]) == 0\", \"assert maxGameScore([5, 0, 5]) == 5\", \"assert maxGameScore([4, 5, 6, 0, 1, 2]) == 15\", \"assert maxGameScore([0, 1, 2, 3, 4]) == 10\", \"assert maxGameScore([3, 3, 3, 0, 0, 4, 5]) == 9\", \"assert ma...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-9-92
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulle annetaan kokonaislukujen lista, joka edustaa pelin scores . Pelissä on sääntö, jonka mukaan jos pistemäärä 0 kohdataan, nykyinen kierros päättyy välittömästi, eikä voit kerryttää enää mitään scores kyseisellä kierroksella. Tehtäväsi on löytää suurin pistemäärä, joka voidaan saavuttaa millä tahansa pelin y...
3f1a56789ee3c9b16f281bd72e4cc78b030ce3eb011976513fc6b81c9e55cfb6
null
null
user: You are given a list of integers representing the scores of a game. The game has a rule that if a score of 0 is encountered, the current round ends immediately, and you cannot accumulate any further scores in that round. Your task is to find the maximum score that can be achieved from any single round of the game...
fi
true
prompt_only
code_000009__fi__15171f103cc29443
[ "[\"assert fill_missing_booleans([None, None, None, None, None]) == [False, False, False, False, False]\", \"assert fill_missing_booleans([True, None, True]) == [True, True, True]\", \"assert fill_missing_booleans([True, None, None, None, True]) == [True, True, True, True, True]\", \"assert fill_missing_booleans([N...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-12-99
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulle annetaan lista totuusarvoja ja `None`, jossa `None` edustaa puuttuvia totuusarvoja. Tehtäväsi on täyttää puuttuvat totuusarvot seuraavien sääntöjen mukaan: Jos on kaksi vierekkäistä totuusarvoa, niiden väliset puuttuvat arvot tulee täyttää samalla totuusarvolla. Jos on vain yksi viereinen totuusarvo, puut...
55de67e75fac114641401156d88928cae11b92f30b111c2ccd7168edfecf3994
null
null
user: You are given a list of boolean values and `None`, where `None` represents missing boolean values. Your task is to fill in the missing boolean values based on the following rules: If there are two adjacent boolean values, the missing values between them should be filled with the same boolean value. If there is on...
fi
true
prompt_only
code_000010__fi__c64e6d13a54765e9
[ "[\"assert generate_masks(2.0, [0, 1, 2], 4) == [2.0, 2.0, 2.0]\", \"assert generate_masks(1.5, None, 5) == [1.5, 1.5, 1.5, 1.5, 1.5]\", \"assert generate_masks(2.5, [-1, 0, 5], 5) == [2.5]\", \"assert generate_masks([1.0, 2.0, 3.0], [0, 1, 2], 3) == [1.0, 2.0, 3.0]\", \"assert generate_masks([2.0, 3.0], [0, 1], 2)...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-13-16
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on luoda maskeja kuvasarjalle magnification -kertoimen ja indeksilistan perusteella. Kirjoita funktio `generate_masks(magnification: Union[float, List[float]], applylist: Optional[List[int]], length: int) -> List[float]` , joka luo maskin määritetyille kuville. Funktion tulee toimia seuraavasti:...
7f1c9f280bfbe1545c71ad19f1c02372f1949227ff238c3c4316d8a776671693
null
null
user: You are tasked with generating masks for a set of images based on a magnification factor and a list of indices. Write a function `generate_masks(magnification: Union[float, List[float]], applylist: Optional[List[int]], length: int) -> List[float]` that generates a mask for the specified images. The function shoul...
fi
true
prompt_only
code_000011__fi__8274a48044ee80a2
[ "[\"assert get_block_by_height(10, {5: 2}) is None\", \"assert get_block_by_height(-1, {0: 1}) is None\", \"assert get_block_by_height(0, {}) is None\", \"assert get_block_by_height(6, {2: 6}) is None\", \"assert get_block_by_height(7, {4: 8}) is None\", \"assert get_block_by_height(11, {11: 11}) is None\", \"asser...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-22-37
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on toteuttaa funktio, joka hakee lohkon lohkoketjusta sen height. perusteella. Lohkoketjun lohkoja edustaa `Block` -luokka, jolla on `height` -attribuutti, joka osoittaa sen sijainnin lohkoketjussa. Toteutat funktion `get_block_by_height(height, block_files)` , joka ottaa syötteeksi lohkon heigh...
a019537be0a5239f149aff6a47c82678c1ccc1ba6b721fc87173271a49b89e5c
null
null
user: You are tasked with implementing a function that retrieves a block from a blockchain by its height. Blocks in the blockchain are represented by the `Block` class, which has a `height` attribute indicating its position in the blockchain. You will implement a function `get_block_by_height(height, block_files)` that...
fi
true
prompt_only
code_000012__fi__4c1a65a8374781d2
[ "[\"assert find_correct_g([8, 13]) == 1\", \"assert find_correct_g([15, 25]) == 5\", \"assert find_correct_g([7, 11]) == 1\", \"assert find_correct_g([-8, -12]) == 4\", \"assert find_correct_g([1, 1]) == 1\", \"assert find_correct_g([-5, 5]) == 5\", \"assert find_correct_g([10, -5]) == 5\", \"assert find_correct_g(...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-33-91
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulle annetaan kokonaislukujen lista `zcw_g`, joka sisältää täsmälleen kaksi kokonaislukua. Tehtäväsi on löytää pienin positiivinen kokonaisluku `g` , joka on molempien listan kokonaislukujen yhteinen tekijä. Arvon `g` on oltava suurempi kuin 0. Toteuta funktio `find_correct_g(zcw_g)` , joka palauttaa tämän arv...
d697bddf9fd3619032624a465229c388f2005ae33f960cc53c96b77ff3cf7c18
null
null
user: You are given a list of integers `zcw_g`, which contains exactly two integers. Your task is to find the smallest positive integer `g` that is a common factor of both integers in the list. The value of `g` must be greater than 0. Implement a function `find_correct_g(zcw_g)` that returns this value. Function sign...
fi
true
prompt_only
code_000013__fi__72e8c8f6e1d49d48
[ "[\"assert calculate_average([3, -2, 5, 7, -8, 10]) == 6.25\", \"assert calculate_average([-1, -2, -3]) == 0\", \"assert calculate_average([]) == 0\", \"assert calculate_average([1, 2, 3]) == 2.0\", \"assert calculate_average([-10, -5, 0]) == 0\", \"assert calculate_average([0, 0, 0]) == 0\", \"assert calculate_ave...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-35-44
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on toteuttaa Python-funktio, joka laskee numerolistan keskiarvon ja jättää kaikki negatiiviset luvut laskun ulkopuolelle. Jos syötelistat on tyhjä tai se sisältää vain negatiivisia lukuja, funktion tulee palauttaa 0. Kirjoita funktio nimeltä `calculate_average` , joka ottaa syötteenä numerilista...
7d0724e7e75cdcb47af233fba71e70e4bce6afe94ff7906771301b4344fbf788
null
null
user: You are tasked with implementing a Python function that calculates the average of a list of numbers, excluding any negative numbers from the calculation. If the input list is empty or contains only negative numbers, the function should return 0. Write a function called `calculate_average` that takes a list of num...
fi
true
prompt_only
code_000014__fi__61c4ffacbde790c9
[ "[\"assert check_consecutive([]) == False\", \"assert check_consecutive([1]) == True\", \"assert check_consecutive([1, 2, 3]) == True\", \"assert check_consecutive([1, 2, 4]) == False\", \"assert check_consecutive([5, 6, 7, 8, 9]) == True\", \"assert check_consecutive([1, 2, 5, 6]) == False\", \"assert check_consec...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-39-66
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulle annetaan funktio `check_consecutive` , joka ottaa syötteenä kokonaislukulistan. Tehtäväsi on määrittää, sisältääkö lista peräkkäisiä kokonaislukuja nousevassa järjestyksessä. Funktion tulee palauttaa `True` , jos syöte-lista sisältää peräkkäisiä kokonaislukuja, ja `False` , jos ei. Funktion tulee täyttää ...
4dbba9e13072d8f5a613ee197a7770b3c398b9bc46f883fecaef9a36673afd66
null
null
user: You are given a function `check_consecutive` that takes in a list of integers. Your task is to determine if the list contains consecutive integers in an ascending order. The function should return `True` if the input list contains consecutive integers, and `False` otherwise. The function should satisfy the follow...
fi
true
prompt_only
code_000015__fi__2708d1f5f0628ae6
[ "[\"assert update_channels([1, 2, 3], 5, 7) == [1, 2, 3, 5, 6, 7]\", \"assert update_channels([10, 20], 15, 17) == [10, 20, 15, 16, 17]\", \"assert update_channels([], 1, 5) == [1, 2, 3, 4, 5]\", \"assert update_channels([5], 3, 3) == [5, 3]\", \"assert update_channels([100], 110, 115) == [100, 110, 111, 112, 113, ...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-40-62
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on päivittää kanavanumeroiden luettelo digitaalisen signaalinkäsittelyn sovelluksessa. Kirjoita funktio `update_channels(current_channels, start_channel, end_channel)` , joka ottaa kolme parametria: kokonaislukujen luettelon `current_channels`, kokonaisluvun `start_channel`, ja kokonaisluvun `en...
8ecc149b34f6222a29931585f9cbe5c00835b0a84ba75396e58f782e5a0d9af7
null
null
user: You are tasked with updating a list of channel numbers in a digital signal processing application. Write a function `update_channels(current_channels, start_channel, end_channel)` that takes three parameters: a list of integers `current_channels`, an integer `start_channel`, and an integer `end_channel`. The func...
fi
true
prompt_only
code_000016__fi__305e2ed5114147d3
[ "[\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([-1, -2, -3, -4]) == -6\", ...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-41-96
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Tehtävänäsi on luoda Python-funktio, joka ottaa parametrinaan kokonaislukulistan ja palauttaa kaikkien parillisten numbers summan listassa. Jos parillisia numbers, ei ole, palauta 0. Funktion nimi tulee olla `sum_of_evens(numbers)` ja sen tulee ottaa yksi parametri `numbers`, joka on kokonaislukulista. Funktion t...
6937c886ccb49919b94d3f50ee69e815c3e066eeb9aa1c87661b7f212fdc21d7
null
null
user: You are tasked with creating a Python function that takes a list of integers and returns the sum of all even numbers in the list. If there are no even numbers, return 0. Your function should be named `sum_of_evens(numbers)` and take a single parameter `numbers`, which is a list of integers. The function should it...
fi
true
prompt_only
code_000017__fi__329f38b4f99e10a8
[ "[\"assert normalize_utilities([10, 20, 30]) == [0.0, 0.5, 1.0]\", \"assert normalize_utilities([5, 15, 25, 35]) == [0.0, 0.3333333333333333, 0.6666666666666666, 1.0]\", \"assert normalize_utilities([1, 2, 3, 4, 5]) == [0.0, 0.25, 0.5, 0.75, 1.0]\", \"assert normalize_utilities([-10, -5, 0, 5, 10]) == [0.0, 0.25, 0...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-43-78
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Tehtävänäsi on toteuttaa hyötyfunktion normalisointifunktio neuvottelusimulaattoria varten. Funktio saa syötteenä listan hyötyarvoja, ja sen tavoitteena on palauttaa näiden hyötyarvojen normalisoitu lista, varmistaen että kaikki arvot on skaalattu välille 0 ja 1 listan minimi- ja maksimihyötyarvojen perusteella. ...
ee4a28a0c802974372558872d438a1c1e8b8378de7fcc1416ee1d35a61fe84e7
null
null
user: You are tasked with implementing a utility normalization function for a negotiation simulator. The function will receive a list of utility values, and its goal is to return a normalized list of these utility values, ensuring that all values are scaled between 0 and 1 based on the minimum and maximum utility value...
fi
true
prompt_only
code_000018__fi__75b9a0d7b196359f
[ "[\"assert simulate_follow_bot([True, True, True], 0) == 3\", \"assert simulate_follow_bot([False, False, False], 0) == 0\", \"assert simulate_follow_bot([True, False, True], 0) == 2\", \"assert simulate_follow_bot([True, False, False], 5) == 6\", \"assert simulate_follow_bot([True], 10) == 11\", \"assert simulate_...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-48-33
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on luoda Python-funktio, joka simuloi sosiaalisen median botin käyttäytymistä. Botti on ohjelmoitu seuraamaan sivuja sosiaalisen median alustalla, mutta prosessin aikana voi ilmetä virheitä. Tehtäväsi on toteuttaa funktio `simulate_follow_bot` , joka ottaa vastaan kaksi parametria: totuusarvolis...
fa1c21188f95746bf5ec13db13949c7ef3e1c444a5f8cf9d77c290de634dc60c
null
null
user: You are tasked with creating a Python function that simulates a social media bot's behavior. The bot is programmed to follow pages on the social media platform, but it may encounter errors during this process. Your task is to implement a function `simulate_follow_bot` that takes in two parameters: a list of boole...
fi
true
prompt_only
code_000019__fi__6969a4eae81b6fee
[ "[\"assert collision_check([(100, 200), (300, 400)], (400, 500), (50, 50), (30, 30)) == False\", \"assert collision_check([(0, 0)], (6, 6), (5, 5), (5, 5)) == False\", \"assert collision_check([], (100, 100), (50, 50), (30, 30)) == False\", \"assert collision_check([(50, 50)], (50, 50), (50, 50), (50, 50)) == True\...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-51-37
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Tehtävänäsi on toteuttaa funktio, joka havaitsee törmäykset pelaajahahmon ja vihollishahmojen listan välillä 2D -avaruudessa. Funktion tulee tarkistaa,leikkaako pelaajan ympäröivä suorakaide minkään vihollishahmon ympäröivän suorakaiteen. Saat vihollisten sijaintien listan, pelaajan sijainnin, pelaajan koon sekä ...
7a968c60cdde630488e9e7f537c6c9753846561399f3f42d494b8a51ebe2e556
null
null
user: You are tasked with implementing a function to detect collisions between a player character and a list of enemy characters in a 2D space. The function should check if the bounding box of the player intersects with any of the enemy characters. You are given a list of enemy positions, the position of the player, th...
fi
true
prompt_only
code_000020__fi__3554a20c7207de7e
[ "[\"assert find_unique_elements([1, 2, 3, 2, 1]) == [3]\", \"assert find_unique_elements([4, 5, 6, 5, 4, 7, 8]) == [6, 7, 8]\", \"assert find_unique_elements([10, 20, 10, 30, 40, 30]) == [20, 40]\", \"assert find_unique_elements([1, 1, 1, 1]) == []\", \"assert find_unique_elements([]) == []\", \"assert find_unique_...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-55-9
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla kokonaislukulistalla kirjoita funktio `find_unique_elements` joka palauttaa listan elementeistä, jotka esiintyvät täsmälleen kerran syötelistassa. Tuloslistan elementtien järjestyksen tulee vastata niiden ensimmäistä esiintymisjärjestystä syötelistassa. Voit olettaa, että syötelista sisältää vain kokona...
514d44c07a9bb2277af51423d99c89c1e1560eb9b2d6f2d2a979e283d11eb7e7
null
null
user: Given a list of integers, write a function `find_unique_elements` that returns a list of elements that occur exactly once in the input list. The order of elements in the output list should match the order of their first appearance in the input list. You may assume that the input list contains only integers. For e...
fi
true
prompt_only
code_000021__fi__39fcf061dfae9873
[ "[\"assert calculate_spearman_correlation([1, 2, 3], [3, 2, 1]) == -1.0\", \"assert calculate_spearman_correlation([10, 20, 30], [30, 20, 10]) == -1.0\", \"assert calculate_spearman_correlation([1, 2, 3, 4], [2, 3, 4, 5]) == 1.0\", \"assert calculate_spearman_correlation([1, 2, 3, 4], [4, 3, 2, 1]) == -1.0\", \"ass...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-55-53
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Tehtävänäsi on toteuttaa Python-funktio, joka laskee Spearmanin järjestyskorrelaatiokertoimen kahdelle annetulle numeeristen arvojen listalle. Spearmanin järjestyskorrelaatiokerroin on ei-parametrinen tilastollisen riippuvuuden mittari kahden muuttujan välillä. Se arvioi, kuinka hyvin kahden muuttujan välistä suh...
070b6ae8bf92f81d086f80de00466654902904eb1b85f8938a185cefbf52814d
null
null
user: You are tasked with implementing a Python function that calculates the Spearman rank correlation coefficient for two given lists of numerical values. The Spearman rank correlation coefficient is a non-parametric measure of statistical dependence between two variables. It assesses how well the relationship between...
fi
true
prompt_only
code_000022__fi__a3d57186c56c8d36
[ "[\"assert scale_image([[1, 2], [3, 4]], 0, 4) == []\", \"assert scale_image([[1, 2]], 2, 1) == [[1, 2]]\", \"assert scale_image([[1]], 2, 2) == [[1, 1], [1, 1]]\", \"assert scale_image([[1, 2], [3, 4]], 2, 0) == []\", \"assert scale_image([[1, 1], [1, 1]], 3, 3) == [[1, 1, 1], [1, 1, 1], [1, 1, 1]]\", \"assert sca...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-56-88
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on toteuttaa funktio, joka skaalaa annetun image joka on esitetty 2D pikselilistana, sopimaan määritettyyn leveyteen ja korkeuteen. image on esitetty listana listoja, joista jokainen sisäinen lista sisältää pikseliarvoja (kokonaislukuja). Funktion tulee skaalata image uusiin mittoihin säilyttäen...
233be980510bde695f7a9894e27ef188ed95fda0e5c8a69200d3db838a3e5f68
null
null
user: You are tasked with implementing a function that scales a given image represented as a 2D list of pixels to fit within a specified width and height. The image is represented as a list of lists, where each inner list contains pixel values (integers). Your function should scale the image to the new dimensions while...
fi
true
prompt_only
code_000023__fi__169fb4b552d472ec
[ "[\"assert manipulate_and_duplicate_tuple((1, 2, 3, 4)) == (5, 6, 1, 2, 3, 5, 6, 1, 2, 3)\", \"assert manipulate_and_duplicate_tuple((10, 20, 30)) == (5, 6, 10, 20, 5, 6, 10, 20)\", \"assert manipulate_and_duplicate_tuple((0, -1, -2, -3)) == (5, 6, 0, -1, -2, 5, 6, 0, -1, -2)\", \"assert manipulate_and_duplicate_tu...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-59-75
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on luoda funktio nimeltä `manipulate_and_duplicate_tuple` , joka ottaa argumenttinaan kokonaislukujen tuple-rakenteen. Funktion tulee suorittaa seuraavat toiminnot: 1) Poista viimeinen alkio tuple-rakenteesta. 2) Lisää kokonaisluvut 5 ja 6 tuple-rakenteen alkuun. 3) Tuplaa tulos-tuplen alkiot sä...
335ce21d7bafa8c548df47dbed88cb9f3a5731b7f42bcae63511582809470d97
null
null
user: You are tasked with creating a function called `manipulate_and_duplicate_tuple` that takes a tuple of integers as an argument. The function should perform the following operations: 1) Remove the last element from the tuple. 2) Add the integers 5 and 6 at the beginning of the tuple. 3) Duplicate the elements of th...
fi
true
prompt_only
code_000024__fi__3161dd36739e6af5
[ "[\"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"asse...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-60-80
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun on toteutettava funktio `outer()` joka sisältää kaksi sisäkkäistä funktiota, `middle()` ja `inner()`. Funktion `inner()` tulisi kasvattaa muuttujaa `x`, joka on määritelty funktiossa `outer()` , arvolla 1. Tavoitteenasi on varmistaa, että funktio `inner()` pystyy lukemaan ja muokkaamaan muuttujaa `x` funkti...
0b418b68589460313e0ff4755236e9f558b8ea73395dfcabb75c9d87bf81b60e
null
null
user: You are tasked with implementing a function `outer()` that contains two nested functions, `middle()` and `inner()`. The `inner()` function should increment a variable `x`, which is defined in the `outer()` function, by 1. Your goal is to ensure that `inner()` can access and modify `x` from `outer()`. Implement th...
fi
true
prompt_only
code_000025__fi__363cdab2b43b5699
[ "[\"assert min_positive_element([5, -3, 2, 1, -4]) == 1\", \"assert min_positive_element([-1, -2, -3, -4]) == 0\", \"assert min_positive_element([10, 20, 30, 5]) == 5\", \"assert min_positive_element([-10, 0, 2, 1]) == 1\", \"assert min_positive_element([3, 5, 7, 9]) == 3\", \"assert min_positive_element([0, -1, -2...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-61-12
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla kokonaislukujen luettelolla kirjoita funktio `min_positive_element(l: list)` , joka palauttaa luettelon pienimmän positiivisen kokonaisluvun käyttämättä vertailuoperaatioita. Luettelo voi sisältää sekä positiivisia että negatiivisia kokonaislukuja, ja jos positiivisia kokonaislukuja ei ole, palauta 0.
a9728cf7cbf48a48652b4b3201ca52733a912b160f619958ba4788f10a57eb92
null
null
user: Given a list of integers, write a function `min_positive_element(l: list)` that returns the smallest positive integer in the list without using any comparison operations. The list may contain both positive and negative integers, and if there are no positive integers, return 0.
fi
true
prompt_only
code_000026__fi__e685f2f9633f4a0d
[ "[\"assert find_pair([1, 2, 3, 4, 5], 10) == (2, 5)\", \"assert find_pair([2, 3, 6, 1, 8], 24) == (3, 8)\", \"assert find_pair([10, 15, 3, 7], 21) == (3, 7)\", \"assert find_pair([9, 5, 2, 8], 72) == (9, 8)\", \"assert find_pair([10, 20, 30, 40], 600) == (20, 30)\", \"assert find_pair([2, 4, 6, 8], 48) == (6, 8)\",...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-63-7
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla listalla positiivisia rationaalilukuja numbers, toteuta funktio `find_pair(numbers, target)` joka etsii yhden parin luvuista numbers niin, että niiden tulo on tietty target arvo. Jos tällainen pari on olemassa, palauta se tuplina. Jos tällaista paria ei ole, palauta None.
80f8a5b8dfdbfb19e3ce90582f35fb63ed937bfe3fd5770a35f0d706d0a3f6e0
null
null
user: Given a list of positive rational numbers, implement a function `find_pair(numbers, target)` that locates one pair of numbers whose multiplication equals a specified target value. If such a pair exists, return it as a tuple. If no pair exists, return None.
fi
true
prompt_only
code_000027__fi__f3b57415b49d8445
[ "[\"assert analyze_lists([1, 2, 3, 4], [2, 4, 6, 8]) == ([2, 4], [1, 3])\", \"assert analyze_lists([], [2, 4, 6]) == ([], [])\", \"assert analyze_lists([10, 20, 30], [40, 50, 60]) == ([], [10, 20, 30])\", \"assert analyze_lists([1, 2, 3], [1, 2, 3]) == ([1, 2, 3], [])\", \"assert analyze_lists([7, 8, 9], [6, 7, 8])...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-64-58
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetuilla kahdella kokonaislukulistalla, `my_list` ja `pre_defined_list`, toteuta funktio `analyze_lists(my_list, pre_defined_list)` , joka palauttaa tupleen sisältävän kaksi listaa: ensimmäisen listan tulee sisältää elementit, jotka esiintyvät sekä `my_list` että `pre_defined_list`, -listoissa, ja toisen listan...
e4bb899cbac91906c5904895eff6630d19c7b2b5aba05f133d48f3936f1ac957
null
null
user: Given two lists of integers, `my_list` and `pre_defined_list`, implement a function `analyze_lists(my_list, pre_defined_list)` that returns a tuple containing two lists: the first list should contain the elements that are present in both `my_list` and `pre_defined_list`, and the second list should contain the ele...
fi
true
prompt_only
code_000028__fi__7ac7af64c05a4f91
[ "[\"assert sum_of_odd(3, 1) == 9\", \"assert sum_of_odd(1, 7) == 7\", \"assert sum_of_odd(5, 2) == 35\", \"assert sum_of_odd(1, 11) == 11\", \"assert sum_of_odd(7, 1) == 49\", \"assert sum_of_odd(1, 2) == 3\"]" ]
[ "code" ]
rlvr_acecoder_filtered_filtered-request-64-88
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Kirjoita funktio `sum_of_odd(n: int, m: int) -> int` joka ottaa kaksi parametria, n ja m, ja palauttaa ensimmäisten n parittoman kokonaisluvun summan alkaen luvusta m. Jos n tai m eivät ole positiivisia kokonaislukuja, funktion tulee nostaa ValueError-virhe.
fef40b91031f0cb770b442ba32909dad5d68be6d2a9c4f836319db00c8698de1
null
null
user: Write a function `sum_of_odd(n: int, m: int) -> int` that takes two parameters, n and m, and returns the sum of the first n odd integers starting with m. If n or m are not positive integers, the function should raise a ValueError.
fi
true
prompt_only
code_000029__fi__6924c8de71afdcdf
[ "[\"assert max_sum_non_adjacent([1, 2, 4, 1, 3]) == 7\", \"assert max_sum_non_adjacent([8, 1, 2, 3, 4]) == 8\", \"assert max_sum_non_adjacent([5, 5, 5, 5]) == 5\", \"assert max_sum_non_adjacent([2, 4, 6, 8]) == 8\", \"assert max_sum_non_adjacent([]) == 0\", \"assert max_sum_non_adjacent([1]) == 1\", \"assert max_su...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-65-84
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla kokonaislukutaulukolla kirjoita funktio, joka laskee suurimman summan ei-vierekkäisille alkioille mistä tahansa annetun taulukon alitaulukosta. Taulukon alitaulukon on myös sisällettävä alkiot, jotka ovat pariittain keskenään jaollisia (eli minkä tahansa alitaulukon alkioparin suurin yhteinen tekijä (GC...
46484c21d26608294e283c5ff810ced4715c0864e5903a1d91cd53fea8f6d48b
null
null
user: Given an array of integers, write a function that computes the maximum sum of non-adjacent elements in any subarray of the given array. A subarray of the array must also contain elements that are pairwise coprime (i.e., the greatest common divisor (GCD) of any pair of elements in the subarray is 1). Implement the...
fi
true
prompt_only
code_000030__fi__147920fe6cb79ee6
[ "[\"assert second_smallest_and_sum_of_evens([1, 3, 5, 7, 9]) == (None, 0)\", \"assert second_smallest_and_sum_of_evens([2, 2, 2, 2]) == (None, 8)\", \"assert second_smallest_and_sum_of_evens([]) == (None, 0)\", \"assert second_smallest_and_sum_of_evens([10]) == (None, 10)\", \"assert second_smallest_and_sum_of_even...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-66-18
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla kokonaislukulistalla toteuta funktio `second_smallest_and_sum_of_evens(l: list)` joka palauttaa tuplen, joka sisältää listan toiseksi pienimmän parillisen luvun ja kaikkien parillisten lukujen summan. Jos toiseksi pienintä parillista lukua ei ole, palauta sen sijasta None . Funktion tulee käsitellä tyhj...
16a21632ffddb9232eb1285cb2872db19d31cdf5c244a76e04e683a0d12e77ec
null
null
user: Given a list of integers, implement a function `second_smallest_and_sum_of_evens(l: list)` that returns a tuple containing the second smallest even number in the list and the sum of all even numbers. If there is no second smallest even number, return None in its place. The function should handle the case of an em...
fi
true
prompt_only
code_000031__fi__641e868370f6c0c7
[ "[\"assert multiply_unique([1, 2, 3, 4]) == 24\", \"assert multiply_unique([1, 2, 3, 4, 1, 2]) == 24\", \"assert multiply_unique([0, 1, 2, 3]) == 0\", \"assert multiply_unique([0, 0, 0]) == 0\", \"assert multiply_unique([5, 5, 5, 5]) == 5\", \"assert multiply_unique([-1, -2, -3]) == -6\", \"assert multiply_unique([...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-67-61
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `multiply_unique(nums)` joka ottaa syötteeksi kokonaislukujen listan (mukaan lukien nollat) ja palauttaa listan kaikkien uniikkien lukujen tulon. Jos lista sisältää luvun 0, funktion tulee palauttaa 0. Funktion tulee käsitellä suuria syötteitä tehokkaasti.
6fe1d4b0040f6ef47478670dc8eb6f38e0076f719586ff01360e26aaecfb00c4
null
null
user: Implement a function `multiply_unique(nums)` that accepts a list of whole numbers (including zeros) and returns the product of all unique numbers in the list. If the list contains the number 0, the function should return 0. The function should handle large inputs efficiently.
fi
true
prompt_only
code_000032__fi__0eb3c0c0ded452e8
[ "[\"assert smallest_change([1, 2, 3, 4, 5, 4, 3, 2, 1], 2) == 0\", \"assert smallest_change([7, 8, 9, 10, 9, 8, 7], 1) == 0\", \"assert smallest_change([10, 20, 30, 40, 30, 20, 10], 1) == 0\", \"assert smallest_change([100, 200, 300, 400, 300, 200, 100], 0) == 0\", \"assert smallest_change([10, 20, 30, 30, 20, 10],...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-68-3
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla kokonaislukutaulukolla laske minimimuutosten määrä, joita tarvitaan taulukon muuttamiseksi palindromiksi, tietyn sallitun uniikkien alkioiden muutosten määrän rajoituksessa. Toteuta funktio `smallest_change(arr: List[int], limit: int) -> int` joka ottaa parametrinaan kokonaislukutaulukon `arr` ja kokona...
b6926048cf6b4286de15af576f97de90e9ed4b0f782421a40eddd76078117385
null
null
user: Given an array of integers, calculate the minimum modifications required to transform the array into a palindrome, under the restriction of a certain number of unique element changes allowed. Implement a function `smallest_change(arr: List[int], limit: int) -> int` that takes an array of integers `arr` and an int...
fi
true
prompt_only
code_000033__fi__67e3d88aab15fe1a
[ "[\"assert sort_even_indices_in_chunks([1, 2, 3], 2) == [1, 2, 3]\", \"assert sort_even_indices_in_chunks([1, 4, 2, 3, 5, 6, 7, 8], 2) == [1, 4, 2, 3, 5, 6, 7, 8]\", \"assert sort_even_indices_in_chunks([1], 1) == [1]\", \"assert sort_even_indices_in_chunks([], 3) == []\", \"assert sort_even_indices_in_chunks([4, 3...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-68-62
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `sort_even_indices_in_chunks(l: list, k: int) -> list` , joka ottaa syötteenä listan `l` ja kokonaisluvun `k`. Funktion tulee luoda uusi lista, joka vastaa listaa `l` parittomilla indekseillä. Parillisilla indekseillä alkioiden tulee vastata listan `l`, sijainteja, mutta ne on järjestettävä nousev...
454c2c10d0cc0b0056762db0418e418912b7a915ddb35497e712f18b18bafd01
null
null
user: Implement a function `sort_even_indices_in_chunks(l: list, k: int) -> list` that accepts a list `l` and an integer `k`. The function should create a new list that matches `l` at odd indices. At even indices, the elements should correspond to the positions in list `l`, but sorted in increasing order in chunks of s...
fi
true
prompt_only
code_000034__fi__ccb3e3f5aee23071
[ "[\"assert remove_duplicates([3, 4, 11, 2, 11, 2, 3, 3], 2) == [4]\", \"assert remove_duplicates([2, 3, 5, 7, 11, 13], 1) == []\", \"assert remove_duplicates([], 2) == []\", \"assert remove_duplicates([5, 5, 5, 5, 5], 4) == []\", \"assert remove_duplicates([4, 6, 8, 10, 12], 2) == [4, 6, 8, 10, 12]\", \"assert remo...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-68-95
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulta kokonaislukulistalta on toteutettava funktio, joka poistaa päällekkäiset alkiot, alkiot, jotka esiintyvät useammin kuin määritetyn määrän, sekä alkuluvut numbers listasta. Funktion tulee säilyttää jäljelle jäävien alkioiden järjestys siten, että ne ovat samassa järjestyksessä kuin syötelistassa. Kirjoit...
9ee395285df516d9c6ce840c7d56ba23ab49e51a291e9ee9e4bdef593c342ab7
null
null
user: Given a list of integers, implement a function that removes duplicate elements, elements that occur more than a specified number of times, and prime numbers from the list. The function should maintain the order of the remaining elements as they appeared in the input list. Write a function named `remove_duplicates...
fi
true
prompt_only
code_000035__fi__7ca768709bc0cdbb
[ "[\"assert get_even_prime_and_merge([-1, 2, -4, 5, 6], [5, 3, -5, 2, -3, 3, 8, 0, 14, 4, -10]) == [2, 2]\", \"assert get_even_prime_and_merge([1, 3, 5], [7, 11, 13]) == []\", \"assert get_even_prime_and_merge([2, 4, 6], [-2, -4, -6]) == [2]\", \"assert get_even_prime_and_merge([], [2, 4, 6]) == [2]\", \"assert get_...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-69-17
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on luoda funktio, joka palauttaa järjestetyn listan kaikista parillisista alkuluvuista kahdesta syötelistasta. Palautetun listan tulee olla järjestetty laskevaan järjestykseen. Määritä funktio `get_even_prime_and_merge(l1: list, l2: list)` missä `l1` ja `l2` ovat kokonaislukujen listoja. Sinun o...
45b3d7f1b5d78a7866ac5d124fc2b50da499e252bfdf63aa0281da4bb820a3a3
null
null
user: You are tasked with creating a function that returns a sorted list of all even prime numbers from two input lists. The returned list should be sorted in descending order. Define the function `get_even_prime_and_merge(l1: list, l2: list)` where `l1` and `l2` are lists of integers. You need to ensure that negative ...
fi
true
prompt_only
code_000036__fi__5555edc2291f7506
[ "[\"assert reconstructMatrix(2, 1, 1, [1, 1, 1, 1]) == [[1, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]\", \"assert reconstructMatrix(0, 0, 0, [0, 0, 0]) == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\", \"assert reconstructMatrix(1, 1, 1, [1, 1, 1]) == [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\", \"assert reconstructMatrix(1, 1, 1, [2, 0...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-70-27
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annettu binäärimatriisi, jossa on 3 riviä ja tietty määrä sarakkeita, tulee rekonstruoida seuraavien ehtojen perusteella: Sinulle annetaan kolme kokonaislukua `upper`, `middle`, ja `lower` , jotka edustavat vastaavien rivien alkioiden summaa. Lisäksi sinulle annetaan kokonaislukutaulukko `colsum` , joka edustaa k...
3aa4d6d263a3f972f1f7d69cf654a296717ec6230f05c45d0b02383fc7fb3adb
null
null
user: Given a binary matrix with 3 rows and a specified number of columns, reconstruct the matrix based on the following conditions: You are provided with three integers `upper`, `middle`, and `lower` representing the sum of elements in the respective rows. Additionally, you are given an integer array `colsum` represen...
fi
true
prompt_only
code_000037__fi__505654933e9846ba
[ "[\"assert closest_nums([1, 2]) == (1, 2)\", \"assert closest_nums([3, 8, 15, 17]) == (15, 17)\", \"assert closest_nums([5, 5, 6]) == (5, 5)\", \"assert closest_nums([2, 2, 2]) == (2, 2)\", \"assert closest_nums([1, 1, 1, 1, 2]) == (1, 1)\", \"assert closest_nums([0, 0, -1, 1]) == (0, 0)\", \"assert closest_nums([1...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-72-20
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulle annetaan kokonaislukulista, jossa on vähintään kaksi alkiota. Kirjoita funktio `closest_nums(nums)` joka palauttaa listan kaksi lähintä lukua. Palautetun parin tulee olla nousevassa järjestyksessä. Jos on useita pareja, joilla on sama minimiero, palauta ensimmäinen alkuperäisessä listajärjestyksessä löyty...
8d486963a9b5d2036525a8538cf8e86ad722955bf45094fbd4185149699afe4c
null
null
user: You are given a list of integers with at least two elements. Write a function `closest_nums(nums)` that returns the two closest numbers in the list. The returned pair should be in ascending order. If there are multiple pairs with the same minimum difference, return the first one found in the original list order. ...
fi
true
prompt_only
code_000038__fi__b5e41c03858f9b4a
[ "[\"assert calculate_crc8_checksum([0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x8c]) == False\", \"assert calculate_crc8_checksum([0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x01, 0x23, 0x4a]) == False\", \"assert calculate_crc8_checksum([0x7f, 0x7e, 0x7d, 0x7c, 0x7b, 0x7a, 0x79, 0x78, 0x0b]) == False\", \"assert ca...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-72-35
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `calculate_crc8_checksum(data_packet: List[int]) -> bool` joka laskee annetun datapaketin CRC-8 tarkistussumman, joka sisältää heksadesimaalisia tavuarvoja. Paketin rakenne koostuu otsikosta (kaksi ensimmäistä tavua), dataosiosta (keskimmäiset tavut) ja loppuosasta (kaksi viimeistä tavua). Paketin...
3ce7960a6713fb64ee0844b0031f780ebaedbedcde26d2e56dd5587f7e812367
null
null
user: Implement a function `calculate_crc8_checksum(data_packet: List[int]) -> bool` that calculates the CRC-8 checksum of a given data packet containing hexadecimal byte values. The packet structure consists of a header (first two bytes), a data section (middle bytes), and a trailer (last two bytes). The last byte of ...
fi
true
prompt_only
code_000039__fi__1445b5bed16c9d19
[ "[\"assert get_prime_fibonacci(1) == []\", \"assert get_prime_fibonacci(2) == []\", \"assert get_prime_fibonacci(4) == [2]\", \"assert get_prime_fibonacci(5) == [2, 3]\", \"assert get_prime_fibonacci(6) == [2, 3, 5]\", \"assert get_prime_fibonacci(7) == [2, 3, 5]\", \"assert get_prime_fibonacci(11) == [2, 3, 5, 13]...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-72-64
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `get_prime_fibonacci(p: int) -> List[int]` joka palauttaa listan Fibonacci-sarjan alkuluvuista p:nteen termiin asti. Arvo p on positiivinen kokonaisluku, eikä se saa ylittää arvoa 20.
723f9ab6017d055ae124e33f440dc20ba369f8c4f7003ce78df6d0ce8cd24724
null
null
user: Implement a function `get_prime_fibonacci(p: int) -> List[int]` that returns a list of prime numbers found in the Fibonacci series up to the p-th term. The value of p will be a positive integer and should not exceed 20.
fi
true
prompt_only
code_000040__fi__90bb5e7e1220d4cc
[ "[\"assert subtract_matrices([[10, 9], [8, 5]], [[2, 3], [4, 1]]) == [[8, 6], [4, 4]]\", \"assert subtract_matrices([[1, 2]], [[1, 1]]) == [[0, 1]]\", \"assert subtract_matrices([[5]], [[3]]) == [[2]]\", \"assert subtract_matrices([[10, 20], [30, 40]], [[1, 2], [3, 4]]) == [[9, 18], [27, 36]]\", \"assert subtract_m...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-72-73
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetuilla kahdella 2D matriisilla, toteuta funktio `subtract_matrices(matrix1, matrix2)` joka vähentää matriisin `matrix2` matriisista `matrix1`. Funktion tulee palauttaa uusi 2D matriisi, joka sisältää vähennyslaskun tulokset. Jos matriisien ulottuvuudet ovat erilaiset, funktion tulee palauttaa merkityksellinen...
e102860689c78fc3c9c19faed8e42c11d71880a7f747f1bb8b59533b1855b656
null
null
user: Given two 2D matrices, implement a function `subtract_matrices(matrix1, matrix2)` that subtracts `matrix2` from `matrix1`. The function should return a new 2D matrix containing the results of the subtraction. If the matrices are of differing dimensions, the function should return a meaningful error message indica...
fi
true
prompt_only
code_000041__fi__37c526fec31701ee
[ "[\"assert restoreArray([[2,1],[3,4],[3,2]]) == ([1, 2, 3, 4], 10)\", \"assert restoreArray([[4,-2],[1,4],[-3,1]]) == ([-2, 4, 1, -3], 0)\", \"assert restoreArray([[100000,-100000]]) == ([100000, -100000], 0)\", \"assert restoreArray([[1,2],[2,3],[3,4],[4,5]]) == ([1, 2, 3, 4, 5], 15)\", \"assert restoreArray([[10,...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-73-68
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulle annetaan 2D taulukko `adjacentPairs` jossa jokainen `adjacentPairs[i] = [ui, vi]` edustaa vierekkäisten alkioiden paria tuntemattomassa alkuperäisessä taulukossa `nums`. Tehtävänäsi on toteuttaa funktio `restoreArray(adjacentPairs: List[List[int]]) -> Tuple[List[int], int]` joka rekonstruoi alkuperäisen t...
b402e6fbfa43539a6886ec4b3da344f4eb78faa4a970986f15671343f964f5ee
null
null
user: You are given a 2D array `adjacentPairs` where each `adjacentPairs[i] = [ui, vi]` represents a pair of neighboring elements in an unknown original array `nums`. Your task is to implement the function `restoreArray(adjacentPairs: List[List[int]]) -> Tuple[List[int], int]` that reconstructs the original array `nums...
fi
true
prompt_only
code_000042__fi__297031772659fa8e
[ "[\"assert maxTurbulenceSize([9, 4, 2, 10, 7, 8, 8, 1, 9]) == 5\", \"assert maxTurbulenceSize([4, 8, 12, 16]) == 2\", \"assert maxTurbulenceSize([100]) == 1\", \"assert maxTurbulenceSize([1, 1, 1, 1]) == 1\", \"assert maxTurbulenceSize([1, 2, 3, 4]) == 2\", \"assert maxTurbulenceSize([4, 3, 2, 1]) == 2\", \"assert ...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-74-2
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla kokonaislukutaulukolla `arr`, kirjoita funktio `maxTurbulenceSize(arr: List[int]) -> int` , joka palauttaa suurimman turbulentin alitaulukon pituuden. Turbulentiksi alitaulukoksi määritellään alitaulukko, jossa vertailumerkki vaihtelee peräkkäisten alkioiden välillä. Alitaulukon `[arr[i], arr[i + 1], .....
a0c9b02bae7dcfba95d0d50a2e50f9b809362d77ae5191f5116248d0432e43a6
null
null
user: Given an integer array `arr`, write a function `maxTurbulenceSize(arr: List[int]) -> int` that returns the length of the largest turbulent subarray. A turbulent subarray is defined as a subarray where the comparison sign alternates between successive pairs of elements. For a subarray `[arr[i], arr[i + 1], ..., ar...
fi
true
prompt_only
code_000043__fi__189b4e282fb6e30b
[ "[\"assert process_array([]) == ({}, 0)\", \"assert process_array([1]) == ({1: (0, 1)}, 1)\", \"assert process_array([1, 1, 1]) == ({1: (2, 3)}, 3)\", \"assert process_array([3, 4, 5, 1, 2]) == ({1: (3, 1), 2: (4, 1), 3: (0, 1), 4: (1, 1), 5: (2, 1)}, 5)\", \"assert process_array([2, 2, 3, 3, 4, 4, 5, 5]) == ({2: (...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-74-51
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetun kiertoon sijoitetun järjestetyn kokonaislukutaulukon perusteella toteuta funktio `process_array(nums)` joka käsittelee taulukon luodakseen sanaston elementtien viimeisen esiintymiskerran ja taajuuden nopeaa hakua varten. Funktion tulee palauttaa tuple, joka sisältää hakusanaston ja taulukon pituuden. Haku...
a720f022f511260995784f5e1835774be4fe7f31523c29134a2c08eff1e698ee
null
null
user: Given a rotated sorted array of integers, implement a function `process_array(nums)` that processes the array to generate a dictionary for quick access of the last occurrence and frequency of elements. The function should return a tuple containing the lookup dictionary and the length of the array. The lookup dict...
fi
true
prompt_only
code_000044__fi__98318e2c43cdb707
[ "[\"assert count_ways(2) == 0\", \"assert count_ways(3) == 0\", \"assert count_ways(5) == 0\", \"assert count_ways(6) == 0\", \"assert count_ways(7) == 0\", \"assert count_ways(9) == 0\", \"assert count_ways(10) == 0\", \"assert count_ways(11) == 0\", \"assert count_ways(12) == 0\", \"assert count_ways(13) == 0\", ...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-75-14
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Olkoon $f(n)$ tapausten määrä, joilla positiivinen kokonaisluku $n$ voidaan esittää muodossa: $$x^3+xy+29y^3$$ missä $x$ ja $y$ ovat kokonaislukuja. Kirjoita funktio `count_ways(n: int) -> int` joka laskee arvon $f(n)$ annetylle positiiviselle kokonaisluvulle $n$.
f382c6ccefd3b0825627b90953bab2a0700b9cf7721a6b23648afcf97191a7b7
null
null
user: Let $f(n)$ denote the number of ways a positive integer $n$ can be represented in the form: $$x^3+xy+29y^3$$ where $x$ and $y$ are integers. Write a function `count_ways(n: int) -> int` that computes the value of $f(n)$ for a given positive integer $n$.
fi
true
prompt_only
code_000045__fi__148b5bbebd05b98f
[ "[\"assert hybrid_sort_list_heap([1, 2, 3, 4]) == [1, 4, 2, 3]\", \"assert hybrid_sort_list_heap([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert hybrid_sort_list_heap([]) == []\", \"assert hybrid_sort_list_heap([-2, 1.5, 3.5, -1]) == [-2, 3.5, -1, 1.5]\", \"assert hybrid_sort_list_heap([10, 20, 30, 40, 50]) == [10, 50, 2...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-75-48
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetun kokonaislukujen ja desimaalilukujen listan järjestämiseksi käytä kekokasitteluun yhdistettyä binääri-insertiolajittelua erityisessä järjestyksessä. Järjestys alkaa pienimmällä arvolla, sitten suurimmalla, sitten jäljellä olevista vielä sisällyttämättömistä arvoista pienimmällä, ja tätä jatketaan, kunnes k...
6043e03d72902b7ff2f714d0e1084b356b5f2cbb6fa5ff46402370079f16028c
null
null
user: Given a list of integers and decimals, use a heap sort combined with binary insertion sort to arrange the list in a special order. The ordering should start with the smallest value, then the largest, then the smallest of the remaining values not yet included in the output, and continue doing this until all elemen...
fi
true
prompt_only
code_000046__fi__4a7fa61efaa59949
[ "[\"assert maxCandies([0,1,1], [1,2,3], [[1],[],[]], [[1],[],[]], [1]) == 2\", \"assert maxCandies([0,0,0,0], [1,2,3,4], [[1],[2],[3],[]], [[],[],[],[]], [0]) == 0\", \"assert maxCandies([1], [5], [[]], [[]], [0]) == 5\", \"assert maxCandies([1,1,0], [4,5,6], [[],[],[0]], [[1],[2],[]], [0]) == 9\", \"assert maxCand...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-75-78
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulla on kokoelma laatikoita, joista jokainen on esitetty listana, joka sisältää niiden status (avoin tai suljettu), niiden sisältämien candies määrän, niiden tarjoaman keys muiden laatikoiden avaamiseen sekä niiden sisältämät laatikot. Annettujen alkulaatikoiden perusteella, joihin sinulla on pääsy, määritä en...
2d3b170a9c0a646c1a569cdc238def925f1c3d5a95c0cbb35fa10fcf0b68c7ee
null
null
user: You have a collection of boxes, each represented by a list containing their status (open or closed), the number of candies they contain, the keys they provide to open other boxes, and the boxes they contain. Given the initial boxes you have access to, determine the maximum number of candies you can collect by ope...
fi
true
prompt_only
code_000047__fi__38cdae8c62a58eaa
[ "[\"assert sign_speed(0, 0, 0, 0, 0) == (0.0, 0.0)\", \"assert sign_speed(0, 5, 5, 90, 90) == (5.0, 90.0)\", \"assert sign_speed(1, 0, 1, 0, 0) == (1.0, 0.0)\", \"assert sign_speed(20, 0, 20, 0, 0) == (20.0, 0.0)\", \"assert sign_speed(0, 20, 20, 90, 90) == (20.0, 90.0)\"]" ]
[ "code" ]
rlvr_acecoder_filtered_filtered-request-77-90
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Tehtävänäsi on toteuttaa funktio, joka laskee vesivirtausten etumerkillisen nopeuden ja pääsuunnan annettujen itä- ja pohjoissuuntaisten nopeuskomponenttien perusteella. Sinun tulee toteuttaa funktio `sign_speed(east_vel, north_vel, spd, dir_vel, flooddir)` joka laskee ja palauttaa vesivirtausten etumerkillisen n...
7704e36748677d8b5aa846ae0bb21d3880bf0d6f32cd659a9d766a3754689371
null
null
user: You are tasked with implementing a function that calculates the signed speed and principal direction of water currents based on given eastward and northward velocity components. You need to implement the function `sign_speed(east_vel, north_vel, spd, dir_vel, flooddir)` that calculates and returns the signed spee...
fi
true
prompt_only
code_000049__fi__566677862d20ad3b
[ "[\"assert close_motor_and_get_current(1, 1) >= 0 and close_motor_and_get_current(1, 1) <= 100\", \"assert close_motor_and_get_current(1, 2) >= 0 and close_motor_and_get_current(1, 2) <= 100\", \"assert close_motor_and_get_current(1, 3) >= 0 and close_motor_and_get_current(1, 3) <= 100\", \"assert close_motor_and_g...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-80-36
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on kirjoittaa funktio, joka simuloi moottorin sulkemista ja hakee sen nykyisen arvon. Funktiolle annetaan handle moottoriin sekä solmun tunnus (kokonaisluku, joka edustaa moottorin tunnusta). Tehtäväsi on toteuttaa funktio `close_motor_and_get_current(handle: int, node_id: int) -> int` , joka te...
3dbae268d70bcd02d580f22499afc8a3de8ab8a2d6e22a16eaaef0595f93d62c
null
null
user: You are tasked with writing a function that simulates the closing of a motor and retrieves its current value. The function will be provided with a handle to the motor and a node ID (an integer representing the motor's ID). Your task is to implement the function `close_motor_and_get_current(handle: int, node_id: i...
fi
true
prompt_only
code_000050__fi__6ef8e1b82934bc06
[ "[\"assert sort_lists([[3, 1, 4, 2], [[9, 7, 8], [6, 5], [11, 10]]]) == [[1, 2, 3, 4], [[7, 8, 9], [5, 6], [10, 11]]]\", \"assert sort_lists([[5, 3, 8, 1], [[3, 2], [4]]]) == [[1, 3, 5, 8], [[2, 3], [4]]]\", \"assert sort_lists([[10, 20, 30], [[1, 2, 3], [9, 8, 7]]]) == [[10, 20, 30], [[1, 2, 3], [7, 8, 9]]]\", \"a...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-80-62
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulle annetaan lista `num` , joka sisältää kaksi alilistaa. Ensimmäinen alilista `num[0]` sisältää kokonaislukuja ja toinen alilista `num[1]` sisältää kokonaislukulistoja. Tehtävänäsi on kirjoittaa funktio, joka ottaa tämän listan syötteenä ja palauttaa uuden listan, jossa muuttujan `num[0]` kokonaisluvut on jä...
c4e2f5c247812520d490be4ef05590dfdb29a9b2d57fb9ed0b4e6a170ee2093a
null
null
user: You are given a list `num` containing two sublists. The first sublist `num[0]` contains integers, and the second sublist `num[1]` contains lists of integers. Your task is to write a function that takes this list as input and returns a new list where the integers in `num[0]` are sorted in ascending order, and each...
fi
true
prompt_only
code_000051__fi__7204ec59f7974d79
[ "[\"assert max_profit([7, 1, 5, 3, 6, 4], 3) == 5\", \"assert max_profit([7, 6, 4, 3, 1], 2) == 0\", \"assert max_profit([1, 2, 3, 4, 5], 4) == 4\", \"assert max_profit([5, 4, 3, 2, 1], 1) == 0\", \"assert max_profit([], 3) == 0\", \"assert max_profit([10, 22, 5, 75, 65, 80], 4) == 75\", \"assert max_profit([1, 2, ...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-81-83
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulle annetaan lista kokonaisluvuista, jotka edustavat tietyn yrityksen päivittäisiä osakehintoja. Tehtäväsi on kirjoittaa funktio, joka laskee suurimman mahdollisen voiton, joka voidaan saavuttaa ostamalla ja myymällä osaketta tietyn määrän peräkkäisten days. sisällä. Funktion tulee ottaa kaksi parametria: lis...
4583ef2dc9e4564d96def783d82c1a2276b38bfb65731fa67553acc763ada3a0
null
null
user: You are given a list of integers representing the daily stock prices of a certain company. Your task is to write a function that calculates the maximum profit that can be obtained by buying and selling the stock within a specified number of consecutive days. The function should take two parameters: a list of stoc...
fi
true
prompt_only
code_000052__fi__bd903a02b733f3ff
[ "[\"assert compute_disparity_and_frequency([7, 8, 9], [1, 2, 3]) == (8, 1)\", \"assert compute_disparity_and_frequency([1, 1, 1], [2, 2, 2]) == (1, 1)\", \"assert compute_disparity_and_frequency([5, 5, 5], [5, 5, 5]) == (0, 5)\", \"assert compute_disparity_and_frequency([0], [0]) == (0, 0)\", \"assert compute_dispa...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-85-2
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetuilla kahdella numeerisella taulukolla tehtävänäsi on toteuttaa funktio, joka laskee kaksi arvoa: 1) suurin ero molempien taulukoiden sisältämien arvojen välillä. Ero määritellään ensimmäisen taulukon maksimiarvon ja toisen taulukon minimiarvon välisenä itseisarvoerona tai toisen taulukon maksimiarvon ja ens...
2972c2675852c83fb3ef29ec72c6cb4cf17a21d3fcaa57abbdef830c5b62d1bc
null
null
user: Given two numerical arrays, your task is to implement a function that computes two values: 1) the largest disparity between the values contained in both arrays. Disparity is defined as the absolute difference between the maximum value of the first array and the minimum value of the second array, or the maximum va...
fi
true
prompt_only
code_000053__fi__5e8a5a0f488cc9c5
[ "[\"assert divide_array_into_four_parts([1, 1, 1, 1]) == [[[1], [1], [1], [1]]]\", \"assert divide_array_into_four_parts([1, 2, 3, 4, 5, 5]) == []\", \"assert divide_array_into_four_parts([0, 0, 0, 0]) == [[[0], [0], [0], [0]]]\", \"assert divide_array_into_four_parts([5, 5, 5, 5, 5, 5, 5, 5]) == [[[5, 5], [5, 5], ...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-87-79
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla kokonaislukutaulukolla suunnittele algoritmi, joka jakaa sen neljään tyhjäävään peräkkäiseen osaan siten, että jokaisen osan summa on yhtä suuri. Jos taulukkoa ei ole mahdollista jakaa tällä tavoin, funktion tulee palauttaa tyhjä lista. Toteuta funktio `divide_array_into_four_parts(arr: List[int]) -> Li...
a76400f5c6b57b2967e7498e87b7fc169e889bcecae4afae0b52b885a07c3e90
null
null
user: Given an array of integers, design an algorithm to divide it into four non-empty contiguous parts such that the sum of each part is equal. If it is not possible to divide the array in such a manner, the function should return an empty list. Implement a function `divide_array_into_four_parts(arr: List[int]) -> Lis...
fi
true
prompt_only
code_000054__fi__cb4019739314129e
[ "[\"assert count_swaps_to_min_heap([3, 1, 2]) == 1\", \"assert count_swaps_to_min_heap([1, 2, 3]) == 0\", \"assert count_swaps_to_min_heap([5, 10, 15, 20, 25]) == 0\", \"assert count_swaps_to_min_heap([5, None, 3, 2]) == 1\", \"assert count_swaps_to_min_heap([1, 2, 3, None]) == 0\", \"assert count_swaps_to_min_heap...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-88-90
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Tehtävänäsi on kirjoittaa funktio, joka ottaa syötteenä taulukon ja palauttaa vaihtojen määrän, joka tarvitaan taulukon muuttamiseksi min-keoksi. Min-keko on täydellinen binääripuu, jossa jokaisen solmun arvo on pienempi tai yhtä suuri kuin sen lapsisolmujen arvot. Funktion on pystyttävä käsittelemään mielivaltai...
46908c68676865226a8516674de1097aa650525550d8e890656426363af1a95a
null
null
user: You are tasked with writing a function that takes an array as input and returns the number of swaps needed to convert the array into a min heap. A min heap is a complete binary tree where the value of each node is less than or equal to the values of its children. Your function should be able to handle arrays of a...
fi
true
prompt_only
code_000055__fi__6fb31eab7ccdfb60
[ "[\"assert nextGreaterElement(12) == (21, 1)\", \"assert nextGreaterElement(21) == (-1, 0)\", \"assert nextGreaterElement(321) == (-1, 0)\", \"assert nextGreaterElement(4321) == (-1, 0)\", \"assert nextGreaterElement(555) == (-1, 0)\", \"assert nextGreaterElement(999) == (-1, 0)\", \"assert nextGreaterElement(98765...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-89-8
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla positiivisella kokonaisluvulla `n`, etsi pienin kokonaisluku, jolla on täsmälleen samat numerot kuin kokonaisluvulla `n` ja joka on arvoltaan suurempi kuin `n`. Jos tällaista positiivista kokonaislukua ei ole, palauta `-1`. Palauta lisäksi `n` permutaatioiden lukumäärä, jotka ovat suurempia kuin `n`. Jo...
4bf6d0435aa2836b7aae0d923f7a36f9ff46b285c1ee82adf3108bba68fc1e1a
null
null
user: Given a positive integer `n`, find the smallest integer which has exactly the same digits existing in the integer `n` and is greater in value than `n`. If no such positive integer exists, return `-1`. In addition, return the number of permutations of `n` that are greater than `n`. If there are no permutations gre...
fi
true
prompt_only
code_000056__fi__26a9a11c847bf869
[ "[\"assert sort_and_transform_even_indices([1, 2, 3]) == [1, 2, 9]\", \"assert sort_and_transform_even_indices([5, 6, 3, 4, 8, 9, 2]) == [4, 6, 9, 4, 25, 9, 64]\", \"assert sort_and_transform_even_indices([0]) == [0]\", \"assert sort_and_transform_even_indices([1, 3, 5, 7]) == [1, 3, 25, 7]\", \"assert sort_and_tra...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-89-15
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annettuna on kokonaislukujen lista, kirjoita funktio `sort_and_transform_even_indices(l: list) -> list` joka luo uuden listan. Tämän uuden listan tulee säilyttää alkuperäisen listan parittomilla indekseillä olevat alkiot. Parillisilla indekseillä sen tulee ottaa alkuperäisen listan vastaavat alkiot, järjestää ne ...
e6d3dc13455ce00ea289c41bf1515ab140ba7e0f47fdd0e61df6fc915622c002
null
null
user: Given a list of integers, write a function `sort_and_transform_even_indices(l: list) -> list` that generates a new list. This new list should preserve the elements at the odd indices from the original list. At the even indices, it should take the corresponding elements from the original list, sort them in ascendi...
fi
true
prompt_only
code_000057__fi__f24170a8258ff080
[ "[\"assert fibonacci_search([1, 2, 3, 4, 5], 3) == 2\", \"assert fibonacci_search([1, 2, 3, 4, 5], 1) == 0\", \"assert fibonacci_search([1, 2, 3, 4, 5], 5) == 4\", \"assert fibonacci_search([1, 2, 3, 4, 5], 6) == -1\", \"assert fibonacci_search([], 1) == -1\", \"assert fibonacci_search([1, 2, 3], 2) == 1\", \"asser...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-90-42
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla järjestetyllä kokonaislukutaulukolla ja tavoitekokonaisluvulla toteuta funktio `fibonacci_search(arr, x)` joka suorittaa Fibonaccin haun taulukosta löytääkseen tavoitteen indeksin. Jos tavoite löytyy taulukosta, palauta sen indeksi; muutoin palauta -1. Syötteenä annetun taulukon on taattu olevan järjest...
88a5433cfc96de5c01b186ceb0af74c37ad18b43186b386d3e4d57f8b54a5e6e
null
null
user: Given a sorted array of integers and a target integer, implement a function `fibonacci_search(arr, x)` that performs a Fibonacci search on the array to find the index of the target. If the target exists in the array, return its index; otherwise, return -1. The input array is guaranteed to be sorted in non-decreas...
fi
true
prompt_only
code_000058__fi__d96390376a18b716
[ "[\"assert find_median([1, 3], [2]) == 2\", \"assert find_median([1, 2], [3, 4]) == 2.5\", \"assert find_median([1, 2, 3], [4, 5]) == 3\", \"assert find_median([1, 2], [3, 4], [5, 6]) == 3.5\", \"assert find_median([], [1, 2]) == 1.5\", \"assert find_median([1, 2, 3], [4, 5, 6]) == 3.5\", \"assert find_median([1], ...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-90-89
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetuilla useilla järjestetyillä numeerisilla sarjoilla, toteuta funktio `find_median` joka määrittää kaikkien näiden sarjojen alkioiden mediaaniarvon. Jos alkioiden kokonaismäärä on parillinen, funktion tulee palauttaa kahden keskimmäisen luvun keskiarvo. Funktion tulee hyväksyä syötteenä vaihteleva määrä listo...
2a30d81bb2ad45d797080ad71a3ed1a2c770eaee63b0c744d3393d12d9e9e049
null
null
user: Given multiple ordered numerical sequences, implement a function `find_median` that determines the median value of all the elements across these sequences. If there is an even number of total elements, the function should return the average of the two middle numbers. The function should accept a variable number o...
fi
true
prompt_only
code_000059__fi__37d2812db24dd7ae
[ "[\"assert find_swap_values([2, 4], [1, 3]) == (2, 1)\", \"assert find_swap_values([], [1, 2]) == None\", \"assert find_swap_values([5, 7], [3, 1]) == (5, 1)\", \"assert find_swap_values([1, 2, 3], [4, 5, 6, 7]) == None\", \"assert find_swap_values([1], [2]) == None\", \"assert find_swap_values([10, 10], [5, 5]) ==...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-91-19
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annettuina on kaksi kokonaislukutaulukkoa, ja tehtäväsi on toteuttaa funktio, joka etsii arvoparin, yksi kummastakin taulukosta, jotka voidaan vaihtaa niin, että molempien taulukoiden summat muuttuvat yhtä suuriksi. Jos tällaista paria ei ole, palauta None. Funktion allekirjoituksen tulee olla seuraava: `def find...
11d7c44b7a050ff48397f0befb9b847e88bf75c7b6fd3618c44143dcb02e9f67
null
null
user: Given two integer arrays, your task is to implement a function that finds a pair of values, one from each array, that can be exchanged to make the sums of both arrays equal. If no such pair exists, return None. The function should have the following signature: `def find_swap_values(arr1: List[int], arr2: List[int...
fi
true
prompt_only
code_000060__fi__ac00ccf2f51f7846
[ "[\"assert sorted_merge([5, 8, 2], [7, 1]) == [1, 2, 5, 7, 8]\", \"assert sorted_merge([3, 1, 4], [6, 5, 2]) == [1, 2, 3, 4, 5, 6]\", \"assert sorted_merge([10, 20], [5, 15]) == [5, 10, 15, 20]\", \"assert sorted_merge([], [1, 2, 3]) == [1, 2, 3]\", \"assert sorted_merge([1, 2, 3], []) == [1, 2, 3]\", \"assert sort...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-91-38
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annettuna on kaksi järjestämätöntä kokonaislukutaulukkoa, ja tehtävänäsi on toteuttaa funktio, joka yhdistää nämä kaksi taulukkoa yhdeksi järjestetyksi taulukoksi käyttämättä lisätilaa. Yhdistetty taulukko tulee palauttaa tuloksena. Saat muokata syötteenä annettuja taulukkoja tarvittaessa. Toteuta funktio `sorted...
8bd297c8d375c1195912dffca96d9230159ba808bee1c1fd5d62e4d6b5e676e1
null
null
user: Given two unsorted integer arrays, your task is to implement a function that merges these two arrays into a single sorted array without using any extra space. The merged array should be returned as the output. You may modify the input arrays as necessary. Implement the function `sorted_merge(nums1, nums2)` where ...
fi
true
prompt_only
code_000061__fi__ccafdc847b83362f
[ "[\"assert monotonic([1, 2, 3, 4], strict=False, heavy_positive=False, irregular=False) == True\", \"assert monotonic([1, 2, 2, 3], strict=True, heavy_positive=False, irregular=False) == False\", \"assert monotonic([1, 2, 1, 3], strict=False, heavy_positive=False, irregular=False) == False\", \"assert monotonic([1,...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-92-75
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `monotonic(l: List[float], strict: bool = False, heavy_positive: bool = False, irregular: bool = False) -> bool` joka määrittää, noudattaako numerolista tiettyä monotonic trendiä. Funktion tulee ottaa huomioon kolme lisäparametria: `strict` joka velvoittaa strict monotonisuuden, `heavy_positive` j...
ce2f689508ac09b45fa4a76c0a1c7398eb9d31625e1004246625c8c97961eaf1
null
null
user: Implement a function `monotonic(l: List[float], strict: bool = False, heavy_positive: bool = False, irregular: bool = False) -> bool` that determines if a list of numbers exhibits a specified monotonic trend. The function should consider three additional parameters: `strict` which enforces strict monotonicity, `h...
fi
true
prompt_only
code_000062__fi__7fab94ab9bba84f9
[ "[\"assert lazy_update_and_query(5, [(0, 4, 1)], [(0, 4)]) == [5]\", \"assert lazy_update_and_query(6, [(0, 5, 2)], [(2, 4)]) == [6]\", \"assert lazy_update_and_query(4, [(0, 0, 5)], [(0, 0)]) == [5]\", \"assert lazy_update_and_query(1, [(0, 0, 10)], [(0, 0)]) == [10]\", \"assert lazy_update_and_query(5, [(1, 1, 3)...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-92-88
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `lazy_update_and_query` joka simuloi segmenttipuun toimintoja lazy propagation -menetelmällä. Funktio ottaa seuraavat parametrit: kokonaisluvun `size` joka edustaa puun size kokoa, listan `updates` missä jokainen päivitys on esitetty tuplena `(l, r, diff)` ilmoittaen, että arvo `diff` tulisi lisät...
8b7626b42d17f3dabdf95a162541a51c44ca54e3eddcea792d599069b05311d6
null
null
user: Implement a function `lazy_update_and_query` that simulates the operations of a segment tree with lazy propagation. The function takes the following parameters: an integer `size` representing the size of the tree, a list of `updates` where each update is represented as a tuple `(l, r, diff)` indicating that the v...
fi
true
prompt_only
code_000063__fi__688508963c03a24d
[ "[\"assert calculate_volume_area_ratio(1) == 1.3333333333333333\", \"assert calculate_volume_area_ratio(0) == None\", \"assert calculate_volume_area_ratio(-1) == None\", \"assert calculate_volume_area_ratio(-3.5) == None\", \"assert calculate_volume_area_ratio(-10) == None\", \"assert calculate_volume_area_ratio(-0...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-95-40
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `calculate_volume_area_ratio(radius: float) -> float` joka laskee pallon tilavuuden ja ympyrän pinta-alan suhteen annetulla radius. //arvolla. Funktion tulee nostaa ValueError -poikkeus, jos radius ei ole positiivinen luku. Jos poikkeus ValueError nostetaan, funktion tulee palauttaa None sen sijaa...
53834be655c915f010b565de5d6b2bc7c3a428d2e4d60f95d746044b4d645c77
null
null
user: Implement a function `calculate_volume_area_ratio(radius: float) -> float` that computes the ratio of the volume of a sphere to the area of a circle given a radius. The function should raise a ValueError if the radius is not a positive number. If a ValueError is raised, the function should return None instead.
fi
true
prompt_only
code_000064__fi__964dff580aa14a8b
[ "[\"assert maxSumAfterPartitioning([1, 15, 7, 9, 2, 5, 10], 3) == 84\", \"assert maxSumAfterPartitioning([1], 1) == 1\", \"assert maxSumAfterPartitioning([10, 9, 8, 7, 6], 1) == 40\", \"assert maxSumAfterPartitioning([10, 10, 10], 2) == 30\", \"assert maxSumAfterPartitioning([1, 1, 1, 1], 4) == 4\", \"assert maxSum...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-96-94
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla kokonaislukutaulukolla 'arr' ja kokonaisluvulla 'k', sinun tulee jakaa taulukko yhteen tai useampaan peräkkäiseen alitaulukkoon, joiden maksimipituus on 'k'. Jokaisen alitaulukon kohdalla sinun tulee ottaa kyseisen alitaulukon maksimiarvo ja kertoa se alitaulukon alkioiden määrällä. Tehtäväsi on palautt...
001af7e863d6f5884b56be865d4e98fed0985aee461ec2df58b311f7e1374193
null
null
user: Given an array of integers 'arr' and an integer 'k', you need to partition the array into one or more contiguous subarrays of maximum length 'k'. For each subarray, you should take the maximum value of that subarray and multiply it by the number of elements in that subarray. Your task is to return the maximum sum...
fi
true
prompt_only
code_000065__fi__15caa15b98973bc8
[ "[\"assert find_median([30, 20, 10]) == 20\", \"assert find_median([45, 55, 50]) == 50\", \"assert find_median([90, 80, 70]) == 80\", \"assert find_median([10, 30, 20]) == 20\", \"assert find_median([100, 0, 50]) == 50\", \"assert find_median([25, 15, 35]) == 25\", \"assert find_median([60, 40, 80]) == 60\", \"asse...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-97-16
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Tehtävänäsi on kirjoittaa funktio, joka ottaa syötteenä listan kolmesta eri ilmankosteusprosentista, jotka on esitetty kokonaislukuina, ja palauttaa näiden prosenttien mediaanin. Mediaani määritellään arvona, joka jakaa tietoaineiston kahteen yhtä suureen osaan: ylempään ja alempaan puoliskoon. Funktion tulee var...
f70266d66487eecc9386dbd71eb6c9930e124ec7ae2d507219e4528ec3260938
null
null
user: You are tasked with writing a function that takes in a list of three distinct humidity percentages, represented as integers, and returns the median value of these percentages. The median is defined as the value that separates the higher half from the lower half of the data set. Your function should ensure that th...
fi
true
prompt_only
code_000066__fi__00859c3f564e7c63
[ "[\"assert newton_cube_root(64) == 4.0\", \"assert newton_cube_root(125) == 5.0\", \"assert newton_cube_root(216) == 6.0\", \"assert newton_cube_root(512) == 8.0\", \"assert newton_cube_root(729) == 9.0\", \"assert newton_cube_root(1728) == 12.0\", \"assert newton_cube_root(2197) == 13.0\", \"assert newton_cube_roo...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-98-85
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `newton_cube_root` , joka hyödyntää Newtonin menetelmää lasketakseen annetun positiivisen numeerisen arvon kuutiojuuren. Funktion tulee ottaa yksi parametri, `number`, joka on positiivinen liukuluku tai kokonaisluku, ja palauttaa tämän number. kuutiojuuren. Voit olettaa, että syöte number on aina ...
167c93e45bbd72d6378b9d8725605b4b7ec594ba447809b790b8607f07971961
null
null
user: Implement a function `newton_cube_root` that utilizes Newton's method to calculate the cube root of a given positive numerical value. The function should take a single parameter, `number`, which is a positive float or integer, and return the cube root of that number. You may assume that the input number will alwa...
fi
true
prompt_only
code_000067__fi__6bda69c096aa13b7
[ "[\"assert max_expression(0, 5) == 20\", \"assert max_expression(1, 10) == 90\", \"assert max_expression(3, 7) == 42\", \"assert max_expression(2, 6) == 30\", \"assert max_expression(10, 15) == 210\", \"assert max_expression(5, 10) == 90\", \"assert max_expression(6, 8) == 56\", \"assert max_expression(0, 0) == 0\"...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-99-14
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `max_expression(start: int, end: int) -> int` , joka palauttaa korkeimman numeerisen lausekkeen annetulta ei-negatiivisten kokonaislukujen väliltä `start` ja `end`. Jos `start` on suurempi kuin `end`, vaihda niiden arvot. Jos jompikumpi, `start` tai `end` , on negatiivinen, palauta -1 ilmaistakses...
1c29f21a00d3625e2d492b2d4b1784f0f7120e1c475ab26146b9f6a6c5663948
null
null
user: Implement a function `max_expression(start: int, end: int) -> int` that returns the highest numerical expression found amidst a given range of non-negative integer values from `start` to `end`. If `start` is greater than `end`, swap their values. If either `start` or `end` is negative, return -1 to indicate inval...
fi
true
prompt_only
code_000068__fi__b9854d075b9d35dd
[ "[\"assert is_connected(0, 30) == True\", \"assert is_connected(0, 60) == False\", \"assert is_connected(0, 59.999) == True\", \"assert is_connected(30, 89.999) == True\", \"assert is_connected(30, 90) == False\", \"assert is_connected(10, 70) == False\", \"assert is_connected(10, 69.999) == True\", \"assert is_con...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-104-28
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on toteuttaa funktio, joka tarkistaa tukiasemalaitteen yhteystilan viimeisimmän tilan ajan ja ennalta määritetyn aikakatkaisurajan perusteella. Funktio ottaa kaksi parametria: `last_status_time` (liukuluku, joka edustaa viimeisintä aikaa, jolloin tukiasema lähetti heartbeat-viestin) ja `current_...
241ea33e790a8d9f7f0ef50325d4d1acbc4dc3328ede7e07a25e5b7a060a30f8
null
null
user: You are tasked with implementing a function that checks the connection status of a Basestation device based on the last status time and a predefined timeout limit. The function will take two parameters: `last_status_time` (a float representing the last time the Basestation sent a heartbeat message) and `current_t...
fi
true
prompt_only
code_000069__fi__a39b82840b11f96f
[ "[\"assert moz_to_unix_timestamp(1609459200000) == 1609459200\", \"assert moz_to_unix_timestamp(0) == 0\", \"assert moz_to_unix_timestamp(1000) == 1\", \"assert moz_to_unix_timestamp(5000) == 5\", \"assert moz_to_unix_timestamp(1234567890000) == 1234567890\", \"assert moz_to_unix_timestamp(None) == 0\", \"assert mo...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-106-41
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Tehtävänäsi on toteuttaa funktio, joka muuntaa Mozillan aikaleiman Unix-aikaleimaksi. Muunnos on määritelty seuraavasti: jos syöte `moz_timestamp` ei ole `None`, Unix-aikaleima lasketaan jakamalla `moz_timestamp` luvulla 1000. Jos syöte `moz_timestamp` on `None`, Unix-aikaleiman tulee olla 0. Toteuta funktio `moz...
6766cdf0722a30f80ea6452b3e4c1194e374eeffa0baa61b1a5b6c9500af8955
null
null
user: You are tasked with implementing a function that converts a Mozilla timestamp to a Unix timestamp. The conversion is defined as follows: if the input `moz_timestamp` is not `None`, the Unix timestamp is calculated by dividing the `moz_timestamp` by 1000. If the input `moz_timestamp` is `None`, the Unix timestamp ...
fi
true
prompt_only
code_000070__fi__382243ffebb8d469
[ "[\"assert calculate_probability(10, [1, 2, 3, 4]) == 1.0000\", \"assert calculate_probability(0, [1, 2, 3]) == 0.0000\", \"assert calculate_probability(7, [8]) == 0.0000\", \"assert calculate_probability(15, [4, 6, 2]) == 1.0000\", \"assert calculate_probability(1, [2, 3, 4]) == 0.0000\", \"assert calculate_probab...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-111-42
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Työskentelet pelin parissa, jossa loitsitaan spells käyttämällä manaa. Jokainen loitsu vaatii tietyn määrän manaa loitsimiseen. Tehtävänäsi on kirjoittaa funktio `calculate_probability` , joka ottaa kaksi parametria: kokonaisluvun `total_mana` , joka edustaa käytettävissä olevan manan kokonaismäärää, ja kokonaisl...
d9b6ced46f07b3256ccc89078f96a32ae63b0f3ae3bc80c83f15c4c1db241f70
null
null
user: You are working on a game that involves casting spells using mana. Each spell requires a certain amount of mana to cast. Your task is to write a function `calculate_probability` that takes two parameters: an integer `total_mana` representing the total amount of mana available, and a list of integers `spells` repr...
fi
true
prompt_only
code_000072__fi__4de7d72ec3382bd1
[ "[\"assert scale_analog_sensor(-32768) == 0\", \"assert scale_analog_sensor(-16384) == 0\", \"assert scale_analog_sensor(0) == 0\", \"assert scale_analog_sensor(16384) == 1023\", \"assert scale_analog_sensor(32767) == 2047\", \"assert scale_analog_sensor(-1) == 0\", \"assert scale_analog_sensor(1) == 0\", \"assert ...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-112-11
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Tehtävänäsi on toteuttaa funktio, joka simuloi analogisen anturitiedon lukemista 12-bittisestä analogis-digitaalimuuntimesta (ADC), jonka suurin lukuarvo on value arvona 2047. Funktion tulee ottaa parametrina kokonaisluku `value` , joka edustaa ADC:stä saatua raakalukemaa, jonka arvot voivat vaihdella välillä -32...
008a0f62a016a430f3538ea817653be07b424e58db21e42522201bdc7b1675f0
null
null
user: You are tasked with implementing a function to simulate reading analog sensor data from a 12-bit Analog-to-Digital Converter (ADC) with a maximum reading value of 2047. Your function should take an integer `value` representing a raw reading from the ADC, which can range from -32768 to 32767, and convert it to a s...
fi
true
prompt_only
code_000073__fi__a179b7e45efd181e
[ "[\"assert calculate_total_fuel([12]) == 2\", \"assert calculate_total_fuel([14]) == 2\", \"assert calculate_total_fuel([1969]) == 966\", \"assert calculate_total_fuel([100756]) == 50346\", \"assert calculate_total_fuel([12, 14]) == 4\", \"assert calculate_total_fuel([0]) == 0\", \"assert calculate_total_fuel([1]) ...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-112-24
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinun tehtävänäsi on laskea kokonais fuel joka tarvitaan luettelolle masses perustuen tiettyyn fuel laskenta-algoritmiin. Toteuta funktio `calculate_total_fuel(masses)` joka ottaa syötteenä kokonaislukuluettelon `masses`, jossa jokainen kokonaisluku edustaa yhtä mass, ja palauttaa kokonais fuel joka tarvitaan kai...
bc408e8f4c1e13fbdd976d0893f3eacc5df695e5e1d0ea6f8b5be947c822cb4f
null
null
user: You are tasked with calculating the total fuel required for a list of masses based on a specific fuel calculation algorithm. Implement a function `calculate_total_fuel(masses)` that takes a list of integers `masses`, where each integer represents a mass, and returns the total fuel required for all the masses comb...
fi
true
prompt_only
code_000074__fi__983756eae12bb014
[ "[\"assert generate_primes(1) == [2]\", \"assert generate_primes(2) == [3, 2]\", \"assert generate_primes(3) == [5, 3, 2]\", \"assert generate_primes(4) == [7, 5, 3, 2]\", \"assert generate_primes(5) == [11, 7, 5, 3, 2]\", \"assert generate_primes(6) == [13, 11, 7, 5, 3, 2]\", \"assert generate_primes(7) == [17, 13...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-116-36
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Kirjoita Python-funktio `generate_primes(n: int) -> List[int]` joka generoi ensimmäiset `n` alkuluvua ja palauttaa ne käänteisessä järjestyksessä. Alkuluku on luonnollinen luku, joka on suurempi kuin 1 ja jota ei voida muodostaa kertomalla kahta pienempää luonnollista lukua. Ratkaisusi tulee hyödyntää rekursion j...
16636830a7899558c12044d20b084151d55f1e4547c5ca119d1d223d152e0433
null
null
user: Write a Python function `generate_primes(n: int) -> List[int]` that generates the first `n` prime numbers and returns them in reverse order. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your solution should use recursion and dynamic programmin...
fi
true
prompt_only
code_000075__fi__d074eae810f5544a
[ "[\"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) == 44\", \"assert fibfib(10) == 81\", \"assert fib...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-119-41
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio `fibfib(n: int) -> int` joka laskee n:nnen luvun muokatussa Fibonaccin sarjassa, jossa kolme ensimmäistä lukua ovat 0, 0, ja 1, ja jokainen seuraava luku on kolmen edellisen luvun summa. Funktion tulee palauttaa sarjan n:s luku.
e8669485a8a2284885ece4b659f435300cc7a46d0ee08fc4553310fde4ee7ca1
null
null
user: Implement a function `fibfib(n: int) -> int` that computes the nth number in a modified Fibonacci sequence where the first three numbers are 0, 0, and 1, and each subsequent number is the sum of the three preceding numbers. The function should return the nth number in this sequence.
fi
true
prompt_only
code_000076__fi__3318aeebe2359be8
[ "[\"assert median([1, 2, 3], 4) == 2.5\", \"assert median([1], 2) == 1.5\", \"assert median([7, 9], 8) == 8.0\", \"assert median([15, 25, 35, 45], 30) == 30.0\", \"assert median([12, 14, 16, 18], 13) == 14.0\", \"assert median([6, 7, 8, 9], 5) == 7.0\", \"assert median([5], 1) == 3.0\", \"assert median([1, 1, 1], 1...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-120-11
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Toteuta funktio, joka laskee median arvon järjestämättömälle kokonaislukulistalle sen jälkeen, kun listaan on lisätty uusi alkio. Funktion tulee säilyttää listan järjestys ja tasapaino varmistaakseen tehokkaan median laskennan. Syötelista ei sisällä duplikaatteja ja siinä on vähintään yksi alkio. Funktion allekir...
2ab009173382fc78cc599a32e3cdb1eb7fe314fad185036dd2ca04b41337102e
null
null
user: Implement a function that calculates the median of an unsorted list of integers after inserting a new element into the list. The function should maintain the order and balance of the list to ensure efficient median calculation. The input list will not contain duplicates and will have at least one element. The fun...
fi
true
prompt_only
code_000077__fi__51205d38ed1af5d9
[ "[\"assert countElements([1,2,3]) == 2\", \"assert countElements([1,1,3,3,5,5,7,7]) == 0\", \"assert countElements([1,3,2,3,5,0]) == 3\", \"assert countElements([1,1,2,2]) == 2\", \"assert countElements([1,1,2]) == 2\", \"assert countElements([0,0,0,1]) == 3\", \"assert countElements([1000]) == 0\", \"assert countE...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-120-39
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla kokonaislukutaulukolla, merkinnällä `arr`, toteuta funktio `countElements(arr)` , joka määrittää niiden alkioiden määrän, joita kutsutaan nimellä `x`, joille arvo `x + 1` on myös läsnä taulukossa `arr`. Jos taulukko `arr` sisältää duplikaatteja, jokainen esiintymä tulee laskea erikseen. Funktion tulee p...
4071f27d2d957f8b4774045c25bb15234d525a15d0206d276ef22d94f6ac86b6
null
null
user: Given an array of integers, denoted as `arr`, implement a function `countElements(arr)` that determines the quantity of elements, referred to as `x`, for which `x + 1` is also present in `arr`. If `arr` contains duplicate elements, each instance should be counted individually. The function should return the count...
fi
true
prompt_only
code_000078__fi__475eda3f31dab9fb
[ "[\"assert split_array([1, 2, 2, 4, 8]) == -1\", \"assert split_array([0, 0, 0]) == ([0], [0], [0])\", \"assert split_array([2, 2, 2]) == ([2], [2], [2])\", \"assert split_array([1, 3, 1, 3, 1]) == -1\", \"assert split_array([1, 2, 3, 6]) == -1\", \"assert split_array([4, 6, 1, 2, 12]) == -1\", \"assert split_array...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-124-70
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Annetulla kokonaislukutaulukolla kirjoita funktio `split_array` joka määrittää, onko mahdollista jakaa taulukko kolmeen tyhjäävään peräkkäiseen segmenttiin siten, että kunkin segmentin lukujen tulo on sama. Jos tällainen jako on mahdollinen, palauta segmentit listojen tuplena. Jos ei, palauta -1. Huomioi, että se...
7389474ea49579f3fc0d1428de54ad0a977dd069fbc6ea46e15a1ecd3c68cd28
null
null
user: Given an array of integers, write a function `split_array` that determines if it is possible to split the array into three non-empty contiguous segments such that the product of the numbers in each segment is the same. If such a split is possible, return the segments as a tuple of lists. If not, return -1. Note t...
fi
true
prompt_only
code_000079__fi__a120a1f8e6913ef0
[ "[\"assert maxSweetness([5,6,7,8,9,1,2,3,4], 8, [0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0]) == 1\", \"assert maxSweetness([1,2,2,1,2,2,1,2,2], 2, [0,0,1,0,0,1,0,0,1], [0,0,0,0,0,0,0,0,0]) == 6\", \"assert maxSweetness([1,1,1,1,1], 1, [0,0,0,0,0], [0,0,0,0,0]) == 2\", \"assert maxSweetness([1,2,3], 0, [0,0,0], [0,0,0]...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-126-55
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulla on yksi suklaapatukka, joka koostuu useista paloista. Jokaisella palalla on oma sweetness joka on annettu taulukona `sweetness`. Haluat jakaa suklaan `K` ystäviesi kanssa leikkaamalla suklaapatukan `K+1` osaan tekemällä `K` leikkausta, jolloin jokainen osa koostuu peräkkäisistä paloista. Syöt itse osan, j...
fa6b755e7fb47ffa8539f1224ce1b5d664d914bbbb0479a8aabf475828ae6ac5
null
null
user: You have one chocolate bar that consists of some chunks. Each chunk has its own sweetness given by the array `sweetness`. You want to share the chocolate with your `K` friends by cutting the chocolate bar into `K+1` pieces using `K` cuts, where each piece consists of some consecutive chunks. You will eat the piec...
fi
true
prompt_only
code_000080__fi__0d8052588ff0564b
[ "[\"assert min_absolute_sum_diff([2,4,6,8,10], [2,4,6,8,10], 5) == 0\", \"assert min_absolute_sum_diff([1,1,1], [2,2,2], 1) == 3\", \"assert min_absolute_sum_diff([10,10,10,10], [20,20,20,20], 1) == 40\", \"assert min_absolute_sum_diff([10,20,30,40,50], [10,20,30,40,50], 5) == 0\", \"assert min_absolute_sum_diff([1...
[ "code" ]
rlvr_acecoder_filtered_filtered-request-126-86
hamishivi/rlvr_acecoder_filtered_filtered
hamishivi/code_rlvr_mixture_dpo
user: Sinulle annetaan kaksi positiivisten kokonaislukujen taulukkoa `nums1` ja `nums2`, molempien pituus on `n`. Taulukoiden `nums1` ja `nums2` absoluuttinen summaero määritellään summana `|nums1[i] - nums2[i]|` jokaiselle `0 <= i < n` (0-indeksoitu). Voit korvata enintään yhden alkion taulukossa `nums1` millä tahansa...
8583499650cda41a078348a5d03b53b8c1c6c946486df4e26773ff7a76a3cb3c
null
null
user: You are given two positive integer arrays `nums1` and `nums2`, both of length `n`. The absolute sum difference of arrays `nums1` and `nums2` is defined as the sum of `|nums1[i] - nums2[i]|` for each `0 <= i < n` (0-indexed). You can replace at most one element of `nums1` with any other element in `nums1` to minim...
fi
true
prompt_only
code_000081__fi__67d13014b74759b8
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
35