Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    CastError
Message:      Couldn't cast
dataset: string
id: string
messages: list<item: struct<role: string, content: string>>
  child 0, item: struct<role: string, content: string>
      child 0, role: string
      child 1, content: string
starter_code: string
difficulty: string
explanation: string
solved_by: string
test: string
entry_point: string
category: string
level: null
to
{'dataset': Value('string'), 'id': Value('string'), 'level': Value('null'), 'category': Value('string'), 'entry_point': Value('string'), 'messages': List({'role': Value('string'), 'content': Value('string')}), 'test': Value('string')}
because column names don't match
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1827, in _prepare_split_single
                  for key, table in generator:
                                    ^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 613, in wrapped
                  for item in generator(*args, **kwargs):
                              ~~~~~~~~~^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
                  raise CastError(
                  ...<3 lines>...
                  )
              datasets.table.CastError: Couldn't cast
              dataset: string
              id: string
              messages: list<item: struct<role: string, content: string>>
                child 0, item: struct<role: string, content: string>
                    child 0, role: string
                    child 1, content: string
              starter_code: string
              difficulty: string
              explanation: string
              solved_by: string
              test: string
              entry_point: string
              category: string
              level: null
              to
              {'dataset': Value('string'), 'id': Value('string'), 'level': Value('null'), 'category': Value('string'), 'entry_point': Value('string'), 'messages': List({'role': Value('string'), 'content': Value('string')}), 'test': Value('string')}
              because column names don't match
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~^
                      builder, max_dataset_size_bytes=max_dataset_size_bytes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
                      gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  ):
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1880, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

dataset
string
id
string
level
null
category
string
entry_point
string
messages
list
test
string
mbpp_train
mbpp_train-601
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the longest chain which can be formed from the given set of pairs.\nassert max_chain_length([Pair(5, 24), Pair(15, 25),Pair(27, 40), ...
null
mbpp_train
mbpp_train-602
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the first repeated character in a given string.\nassert first_repeated_char(\"abcabc\") == \"a\"\n\"\"\"\n```" }, { "r...
null
mbpp_train
mbpp_train-603
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to get a lucid number smaller than or equal to n.\nassert get_ludic(10) == [1, 2, 3, 5, 7]\n\"\"\"\n```" }, { "role": "assistant", ...
null
mbpp_train
mbpp_train-604
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to reverse words in a given string.\nassert reverse_words(\"python program\")==(\"program python\")\n\"\"\"\n```" }, { "role": "assis...
null
mbpp_train
mbpp_train-605
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to check if the given integer is a prime number.\nassert prime_num(13)==True\n\"\"\"\n```" }, { "role": "assistant", "content": "...
null
mbpp_train
mbpp_train-606
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to convert degrees to radians.\nassert radian_degree(90)==1.5707963267948966\n\"\"\"\n```" }, { "role": "assistant", "content": "...
null
mbpp_train
mbpp_train-607
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to search a literals string in a string and also find the location within the original string where the pattern occurs by using regex.\nasser...
null
mbpp_train
mbpp_train-608
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find nth bell number.\nassert bell_Number(2) == 2\n\"\"\"\n```" }, { "role": "assistant", "content": "Below is a Python...
null
mbpp_train
mbpp_train-609
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find minimum possible value for the given periodic function.\nassert floor_Min(10,20,30) == 15\n\"\"\"\n```" }, { "role": "...
null
mbpp_train
mbpp_train-610
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to remove the k'th element from a given list.\nassert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]\n\"\"\"\n```" }...
null
mbpp_train
mbpp_train-611
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the maximum of nth column from the given tuple list.\nassert max_of_nth([(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2) == 19\n\"\"\"\n```" ...
null
mbpp_train
mbpp_train-612
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to merge the first and last elements separately in a list of lists.\nassert merge([['x', 'y'], ['a', 'b'], ['m', 'n']]) == [['x', 'a',...
null
mbpp_train
mbpp_train-613
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the maximum value in record list as tuple attribute in the given tuple list.\nassert maximum_value([('key1', [3, 4, 5]), ('key2', [1,...
null
mbpp_train
mbpp_train-614
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the cumulative sum of all the values that are present in the given tuple list.\nassert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) =...
null
mbpp_train
mbpp_train-615
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find average value of the numbers in a given tuple of tuples.\nassert average_tuple(((10, 10, 10, 12), (30, 45, 56, 45), (81, 80, 39, 32),...
null
mbpp_train
mbpp_train-616
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to perfom the modulo of tuple elements in the given two tuples.\nassert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)\n\"\"\"\n``...
null
mbpp_train
mbpp_train-617
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to check for the number of jumps required of given length to reach a point of form (d, 0) from origin in a 2d plane.\nassert min_Jumps(3,4,11...
null
mbpp_train
mbpp_train-618
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to divide two lists using map and lambda function.\nassert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]\n\"\"\"\n```" }, { "role": "ass...
null
mbpp_train
mbpp_train-619
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to move all the numbers in it to the given string.\nassert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'\n...
null
mbpp_train
mbpp_train-620
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the largest subset where each pair is divisible.\nassert largest_subset([ 1, 3, 6, 13, 17, 18 ], 6) == 4\n\"\"\"\n```" }, { "...
null
mbpp_train
mbpp_train-621
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to increment the numeric values in the given strings by k.\nassert increment_numerics([\"MSM\", \"234\", \"is\", \"98\", \"123\", \"best\", \...
null
mbpp_train
mbpp_train-622
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the median of two sorted arrays of same size.\nassert get_median([1, 12, 15, 26, 38], [2, 13, 17, 30, 45], 5) == 16.0\n\"\"\"\n```" ...
null
mbpp_train
mbpp_train-623
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the n-th power of individual elements in a list using lambda function.\nassert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9,...
null
mbpp_train
mbpp_train-624
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to convert the given string to upper case.\nassert is_upper(\"person\") ==\"PERSON\"\n\"\"\"\n```" }, { "role": "assistant", ...
null
mbpp_train
mbpp_train-625
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to interchange first and last elements in a given list.\nassert swap_List([1,2,3]) == [3,2,1]\n\"\"\"\n```" }, { "role": "assi...
null
mbpp_train
mbpp_train-626
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the largest triangle that can be inscribed in the semicircle.\nassert triangle_area(0) == 0\n\"\"\"\n```" }, { "role":...
null
mbpp_train
mbpp_train-627
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the smallest missing number from the given array.\nassert find_First_Missing([0,1,2,3],0,3) == 4\n\"\"\"\n```" }, { "r...
null
mbpp_train
mbpp_train-628
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to replace all spaces in the given string with character * list item * list item * list item * list item '%20'.\nassert replace_spaces(\"My N...
null
mbpp_train
mbpp_train-629
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find even numbers from a mixed list.\nassert Split([1,2,3,4,5]) == [2,4]\n\"\"\"\n```" }, { "role": "assistant", "conte...
null
mbpp_train
mbpp_train-630
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to extract all the adjacent coordinates of the given coordinate tuple.\nassert get_coordinates((3, 4)) == [[2, 3], [2, 4], [2, 5], [3, 3], [3...
null
mbpp_train
mbpp_train-631
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to replace whitespaces with an underscore and vice versa in a given string by using regex.\nassert replace_spaces('Jumanji The Jungle') == 'J...
null
mbpp_train
mbpp_train-632
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to move all zeroes to the end of the given list.\nassert move_zero([1,0,2,0,3,4]) == [1,2,3,4,0,0]\n\"\"\"\n```" }, { "role": ...
null
mbpp_train
mbpp_train-633
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the sum of xor of all pairs of numbers in the given array.\nassert pair_OR_Sum([5,9,7,6],4) == 47\n\"\"\"\n```" }, { "...
null
mbpp_train
mbpp_train-634
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the sum of fourth power of first n even natural numbers.\nassert even_Power_Sum(2) == 272\n\"\"\"\n```" }, { "role": "...
null
mbpp_train
mbpp_train-635
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to push all values into a heap and then pop off the smallest values one at a time.\nassert heap_sort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])==[0, 1, ...
null
mbpp_train
mbpp_train-636
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to check if roots of a quadratic equation are reciprocal of each other or not.\nassert Check_Solution(2,0,2) == \"Yes\"\n\"\"\"\n```" ...
null
mbpp_train
mbpp_train-637
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to check whether the given amount has no profit and no loss\nassert noprofit_noloss(1500,1200)==False\n\"\"\"\n```" }, { "role": "ass...
null
mbpp_train
mbpp_train-638
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to calculate wind chill index.\nassert wind_chill(120,35)==40\n\"\"\"\n```" }, { "role": "assistant", "content": "Below is a Pyth...
null
mbpp_train
mbpp_train-639
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to sum the length of the names of a given list of names after removing the names that start with a lowercase letter.\nassert sample_nam(['sal...
null
mbpp_train
mbpp_train-640
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to remove the parenthesis area in a string.\nassert remove_parenthesis([\"python (chrome)\"])==(\"python\")\n\"\"\"\n```" }, { "role"...
null
mbpp_train
mbpp_train-641
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the nth nonagonal number.\nassert is_nonagonal(10) == 325\n\"\"\"\n```" }, { "role": "assistant", "content": "Below is a ...
null
mbpp_train
mbpp_train-642
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to remove similar rows from the given tuple matrix.\nassert remove_similar_row([[(4, 5), (3, 2)], [(2, 2), (4, 6)], [(3, 2), (4, 5)]] ) == {(...
null
mbpp_train
mbpp_train-643
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function that matches a word containing 'z', not at the start or end of the word.\nassert text_match_wordz_middle(\"pythonzabc.\")==('Found a match!')...
null
mbpp_train
mbpp_train-644
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to reverse an array upto a given position.\nassert reverse_Array_Upto_K([1, 2, 3, 4, 5, 6],4) == [4, 3, 2, 1, 5, 6]\n\"\"\"\n```" },...
null
mbpp_train
mbpp_train-645
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the product of it’s kth index in the given tuples.\nassert find_k_product([(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2) == 665\n\"\"\"\n```"...
null
mbpp_train
mbpp_train-646
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to count number of cubes of size k in a cube of size n.\nassert No_of_cubes(2,1) == 8\n\"\"\"\n```" }, { "role": "assistant", ...
null
mbpp_train
mbpp_train-647
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to split a string at uppercase letters.\nassert split_upperstring(\"PythonProgramLanguage\")==['Python','Program','Language']\n\"\"\"\n```" ...
null
mbpp_train
mbpp_train-648
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to exchange the position of every n-th value with (n+1)th value and (n+1)th value with n-th value in a given list.\nassert exchange_elements(...
null
mbpp_train
mbpp_train-649
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to calculate the sum of the numbers in a list between the indices of a specified range.\nassert sum_Range_list([2, 1, 5, 6, 8, 3, 4, 9...
null
mbpp_train
mbpp_train-650
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to check whether the given two arrays are equal or not.\nassert are_Equal([1,2,3],[3,2,1],3,3) == True\n\"\"\"\n```" }, { "rol...
null
mbpp_train
mbpp_train-651
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to check if one tuple is a subset of another tuple.\nassert check_subset((10, 4, 5, 6), (5, 10)) == True\n\"\"\"\n```" }, { "role": "...
null
mbpp_train
mbpp_train-652
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to flatten the given tuple matrix into the tuple list with each tuple representing each column.\nassert matrix_to_list([[(4, 5), (7, 8)], [(1...
null
mbpp_train
mbpp_train-653
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to group a sequence of key-value pairs into a dictionary of lists using collections module.\nassert grouping_dictionary([('yellow', 1), ('blu...
null
mbpp_train
mbpp_train-654
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the perimeter of a rectangle.\nassert rectangle_perimeter(10,20)==60\n\"\"\"\n```" }, { "role": "assistant", "content": "...
null
mbpp_train
mbpp_train-655
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the sum of fifth power of n natural numbers.\nassert fifth_Power_Sum(2) == 33\n\"\"\"\n```" }, { "role": "assistant", ...
null
mbpp_train
mbpp_train-656
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the minimum sum of absolute differences of two arrays.\nassert find_Min_Sum([3,2,1],[2,1,3],3) == 0\n\"\"\"\n```" }, { ...
null
mbpp_train
mbpp_train-657
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the first digit in factorial of a given number.\nassert first_Digit(5) == 1\n\"\"\"\n```" }, { "role": "assistant", ...
null
mbpp_train
mbpp_train-658
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the item with maximum occurrences in a given list.\nassert max_occurrences([2,3,8,4,7,9,8,2,6,5,1,6,1,2,3,4,6,9,1,2])==2\n\"\"\"\n```...
null
mbpp_train
mbpp_train-659
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to print duplicants from a list of integers.\nassert Repeat([10, 20, 30, 20, 20, 30, 40, 50, -20, 60, 60, -20, -20]) == [20, 30, -20, ...
null
mbpp_train
mbpp_train-660
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to choose points from two ranges such that no point lies in both the ranges.\nassert find_Points(5,10,1,5) == (1,10)\n\"\"\"\n```" }...
null
mbpp_train
mbpp_train-661
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the maximum sum that can be formed which has no three consecutive elements present.\nassert max_sum_of_three_consecutive([100, 1000, ...
null
mbpp_train
mbpp_train-662
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to sort a list in a dictionary.\nassert sorted_dict({'n1': [2, 3, 1], 'n2': [5, 1, 2], 'n3': [3, 2, 4]})=={'n1': [1, 2, 3], 'n2': [1, 2, 5], ...
null
mbpp_train
mbpp_train-663
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the largest possible value of k such that k modulo x is y.\nassert find_max_val(15, 10, 5) == 15\n\"\"\"\n```" }, { "role": "...
null
mbpp_train
mbpp_train-664
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the average of even numbers till a given even number.\nassert average_Even(2) == 2\n\"\"\"\n```" }, { "role": "assista...
null
mbpp_train
mbpp_train-665
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to shift first element to the end of given list.\nassert move_last([1,2,3,4]) == [2,3,4,1]\n\"\"\"\n```" }, { "role": "assista...
null
mbpp_train
mbpp_train-666
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to count occurrence of a character in a string.\nassert count_char(\"Python\",'o')==1\n\"\"\"\n```" }, { "role": "assistant", "co...
null
mbpp_train
mbpp_train-667
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to count number of vowels in the string.\nassert Check_Vow('corner','AaEeIiOoUu') == 2\n\"\"\"\n```" }, { "role": "assistant",...
null
mbpp_train
mbpp_train-668
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to replace multiple occurence of character by single.\nassert replace('peep','e') == 'pep'\n\"\"\"\n```" }, { "role": "assista...
null
mbpp_train
mbpp_train-669
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to check whether the given ip address is valid or not using regex.\nassert check_IP(\"192.168.0.1\") == 'Valid IP address'\n\"\"\"\n```" },...
null
mbpp_train
mbpp_train-670
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to check whether a sequence of numbers has a decreasing trend or not.\nassert decreasing_trend([-4,-3,-2,-1]) == True\n\"\"\"\n```" ...
null
mbpp_train
mbpp_train-671
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to set the right most unset bit.\nassert set_Right_most_Unset_Bit(21) == 23\n\"\"\"\n```" }, { "role": "assistant", "conte...
null
mbpp_train
mbpp_train-672
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find maximum of three numbers.\nassert max_of_three(10,20,30)==30\n\"\"\"\n```" }, { "role": "assistant", "content": "Below is...
null
mbpp_train
mbpp_train-673
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to convert a list of multiple integers into a single integer.\nassert convert([1,2,3]) == 123\n\"\"\"\n```" }, { "role": "assi...
null
mbpp_train
mbpp_train-674
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to remove duplicate words from a given string using collections module.\nassert remove_duplicate(\"Python Exercises Practice Solution Exercis...
null
mbpp_train
mbpp_train-675
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to add two integers. however, if the sum is between the given range it will return 20.\nassert sum_nums(2,10,11,20)==20\n\"\"\"\n```" }, ...
null
mbpp_train
mbpp_train-676
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to remove everything except alphanumeric characters from the given string by using regex.\nassert remove_extra_char('**//Google Android// - 1...
null
mbpp_train
mbpp_train-677
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to check if the triangle is valid or not.\nassert validity_triangle(60,50,90)==False\n\"\"\"\n```" }, { "role": "assistant", "con...
null
mbpp_train
mbpp_train-678
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to remove spaces from a given string.\nassert remove_spaces(\"a b c\") == \"abc\"\n\"\"\"\n```" }, { "role": "assistant", ...
null
mbpp_train
mbpp_train-679
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to access dictionary key’s element by index.\nassert access_key({'physics': 80, 'math': 90, 'chemistry': 86},0)== 'physics'\n\"\"\"\n```" }...
null
mbpp_train
mbpp_train-680
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to check whether a sequence of numbers has an increasing trend or not.\nassert increasing_trend([1,2,3,4]) == True\n\"\"\"\n```" }, ...
null
mbpp_train
mbpp_train-681
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the smallest prime divisor of a number.\nassert smallest_Divisor(10) == 2\n\"\"\"\n```" }, { "role": "assistant", ...
null
mbpp_train
mbpp_train-682
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to multiply two lists using map and lambda function.\nassert mul_list([1, 2, 3],[4,5,6])==[4,10,18]\n\"\"\"\n```" }, { "role": "assis...
null
mbpp_train
mbpp_train-683
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to check whether the given number can be represented by sum of two squares or not.\nassert sum_Square(25) == True\n\"\"\"\n```" }, ...
null
mbpp_train
mbpp_train-684
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to count occurences of a character in a repeated string.\nassert count_Char(\"abcac\",'a') == 4\n\"\"\"\n```" }, { "role": "as...
null
mbpp_train
mbpp_train-685
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find sum of prime numbers between 1 to n.\nassert sum_Of_Primes(10) == 17\n\"\"\"\n```" }, { "role": "assistant", "cont...
null
mbpp_train
mbpp_train-686
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the frequency of each element in the given list.\nassert freq_element((4, 5, 4, 5, 6, 6, 5, 5, 4) ) == '{4: 3, 5: 4, 6: 2}'\n\"\"\"\n...
null
mbpp_train
mbpp_train-687
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find the greatest common divisor (gcd) of two integers by using recursion.\nassert recur_gcd(12,14) == 2\n\"\"\"\n```" }, { "role"...
null
mbpp_train
mbpp_train-688
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to get the length of a complex number.\nassert len_complex(3,4)==5.0\n\"\"\"\n```" }, { "role": "assistant", "content": "Below is...
null
mbpp_train
mbpp_train-689
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\n## write a function to find the minimum number of jumps to reach the end of the array for the given array of integers where each element represents the max nu...
null
mbpp_train
mbpp_train-690
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to multiply consecutive numbers of a given list.\nassert mul_consecutive_nums([1, 1, 3, 4, 4, 5, 6, 7])==[1, 3, 12, 16, 20, 30, 42]\n\"\"\"\n...
null
mbpp_train
mbpp_train-691
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to group the 1st elements on the basis of 2nd elements in the given tuple list.\nassert group_element([(6, 5), (2, 7), (2, 5), (8, 7), (9, 8)...
null
mbpp_train
mbpp_train-692
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the last two digits in factorial of a given number.\nassert last_Two_Digits(7) == 40\n\"\"\"\n```" }, { "role": "assis...
null
mbpp_train
mbpp_train-693
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to remove multiple spaces in a string by using regex.\nassert remove_multiple_spaces('Google Assistant') == 'Google Assistant'\n\"\"\"\n...
null
mbpp_train
mbpp_train-694
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to extract unique values from the given dictionary values.\nassert extract_unique({'msm' : [5, 6, 7, 8],'is' : [10, 11, 7, 5],'best' : [6, 12...
null
mbpp_train
mbpp_train-695
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to check if each element of the second tuple is greater than its corresponding index in the first tuple.\nassert check_greater((10, 4, 5), (1...
null
mbpp_train
mbpp_train-696
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to zip two given lists of lists.\nassert zip_list([[1, 3], [5, 7], [9, 11]] ,[[2, 4], [6, 8], [10, 12, 14]] )==[[1, 3, 2, 4], [5, 7, 6, 8], [...
null
mbpp_train
mbpp_train-697
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to find number of even elements in the given list using lambda function.\nassert count_even([1, 2, 3, 5, 7, 8, 9, 10])==3\n\"\"\"\n```" }, ...
null
mbpp_train
mbpp_train-698
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to sort dictionary items by tuple product of keys for the given dictionary with tuple keys.\nassert sort_dict_item({(5, 6) : 3, (2, 3) : 9, (...
null
mbpp_train
mbpp_train-699
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a python function to find the minimum number of swaps required to convert one binary string to another.\nassert min_Swaps(\"1101\",\"1110\") == 1\n\"\"\...
null
mbpp_train
mbpp_train-700
null
code_generation
null
[ { "role": "user", "content": "Please provide a self-contained Python script that solves the following problem in a markdown code block:\n```\n\"\"\"\nWrite a function to count the number of elements in a list which are within a specific range.\nassert count_range_in_list([10,20,30,40,40,40,70,80,99],40,100)...
null
End of preview.

Data used in the paper. See the paper for details.

This repository combines data from multiple sources under different licenses; see the LICENSE file for details.

Downloads last month
6