KlaudiaTH commited on
Commit
fcf6b5e
1 Parent(s): 53326d4

Added tedrics dataset and data loading script.

Browse files
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .idea/
README.md ADDED
File without changes
tedrics_data.py ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import datasets
3
+
4
+ _REPO_NAME = "TeDriCS/tedrics-data"
5
+
6
+ _DESCRIPTION = ""
7
+
8
+ _HOMEPAGE = ""
9
+
10
+ _CITATION = """\
11
+ @misc{,
12
+ title={ },
13
+ author={},
14
+ year={2022}
15
+ }
16
+ """
17
+
18
+ _LICENSES = ['CC BY-SA', 'CC Attribution 4.0']
19
+
20
+ _SUBSETS = ["tasks", "testcases", "codefunctions"]
21
+
22
+ _DATA_URLS = {
23
+ "tasks": {
24
+ "train": ["tedrics_data_tasks.json"]
25
+ },
26
+ "testcases": {
27
+ "train": ["tedrics_data_testcases.json"]
28
+ },
29
+ "codefunctions": {
30
+ "train": ["tedrics_data_codefunctions.json"]
31
+ }
32
+ }
33
+
34
+ class TeDriCSData(datasets.GeneratorBasedBuilder):
35
+ BUILDER_CONFIGS = [
36
+ datasets.BuilderConfig(
37
+ name=f"{subset}",
38
+ version=datasets.Version("1.0"),
39
+ description=_DESCRIPTION,
40
+ )
41
+ for subset in _SUBSETS
42
+ ]
43
+
44
+ DEFAULT_CONFIG_NAME = "tasks"
45
+
46
+ def _info(self):
47
+ if self.config.name == "tasks":
48
+ features = datasets.Features(
49
+ {
50
+ "task_id": datasets.Value("int32"),
51
+ "mbpp_task_id": datasets.Value("int32"),
52
+ "source": datasets.Value("string"),
53
+ "licence": datasets.Sequence(datasets.Value("string")),
54
+ "task": datasets.Value("string"),
55
+ }
56
+ )
57
+
58
+ if self.config.name == "testcases":
59
+ features = datasets.Features(
60
+ {
61
+ "task_id": datasets.Value("int32"),
62
+ "mbpp_task_id": datasets.Value("int32"),
63
+ "task": datasets.Value("string"),
64
+ "test_cases": datasets.Sequence(
65
+ {
66
+ "test_case_id": datasets.Value("int32"),
67
+ "cot": datasets.Value("string"),
68
+ "input": datasets.Sequence(datasets.Value("string")),
69
+ "output": datasets.Value("string")
70
+ }
71
+ )
72
+ }
73
+ )
74
+
75
+ if self.config.name == "codefunctions":
76
+ features = datasets.Features(
77
+ {
78
+ "task_id": datasets.Value("int32"),
79
+ "mbpp_task_id": datasets.Value("int32"),
80
+ "description": datasets.Value("string"),
81
+ "cot": datasets.Value("string"),
82
+ "imports": datasets.Sequence(datasets.Value("string")),
83
+ "function_head": datasets.Sequence(datasets.Value("string")),
84
+ "function_body": datasets.Sequence(datasets.Value("string"))
85
+ }
86
+ )
87
+
88
+ return datasets.DatasetInfo(
89
+ description=_DESCRIPTION,
90
+ features=features,
91
+ supervised_keys=None,
92
+ homepage=_HOMEPAGE,
93
+ license=_LICENSES,
94
+ citation=_CITATION,
95
+ )
96
+
97
+ def _split_generators(self, dl_manager):
98
+ urls = _DATA_URLS[self.config.name]
99
+ data = dl_manager.download(urls)
100
+
101
+ return [
102
+ datasets.SplitGenerator(
103
+ name=split,
104
+ gen_kwargs={
105
+ "files": data[split],
106
+ },
107
+ )
108
+ for split in [datasets.Split.TRAIN]
109
+ ]
110
+
111
+ def _generate_examples(self, filepath):
112
+ with open(filepath, encoding="utf-8") as file:
113
+ data = json.load(file)
114
+ id_ = 0
115
+ for sample in data:
116
+ yield id_, sample
117
+ id_ += 1
tedrics_data_codefunctions.json ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "task_id": 1,
4
+ "mbpp_task_id": 776,
5
+ "description": "Write a Python function to count characters which have vowels as their neighbors in the given string.",
6
+ "cot": "Given the vowel list vowels = ['a', 'e', 'i', 'o', 'u']. Given a string s with len(s) characters. If len(s) is less than 2, then there are no neighboring characters, so return 0. Otherwise: All characters except for the first and the last have a preceding and a following neighbor. Use a for loop to iterate over the indices idx of s except for the first and last index, i.e. starting from the second and ending with the second to last character. Check if the idx-th character is a vowel. If not, check if the character preceding or the following the current character is a vowel and if it is, then increment the vowel counter res. After the loop ends, the first and last characters still need to be checked. If the first character is not a vowel and the second character is a vowel, increment res by 1. If the last character is not a vowel and the second-to-last character is a vowel, increment res by 1. Then return res.",
7
+ "imports": "",
8
+ "function_head": "def count_vowels(s):\n",
9
+ "function_body": " res = 0\n vowels = ['a', 'e', 'i', 'o', 'u']\n for idx in range(1, len(s) - 1):\n if s[idx] not in vowels and (s[idx - 1] in vowels or s[idx + 1] in vowels):\n res += 1\n if s[0] not in vowels and s[1] in vowels:\n res += 1\n if s[-1] not in vowels and s[-2] in vowels:\n res += 1\n return (res) "
10
+ }, {
11
+ "task_id": 2,
12
+ "mbpp_task_id": 639,
13
+ "description": "Write a Python function to sum the length of the strings of a given list after removing the strings that start with a lowercase letter.",
14
+ "cot": "The function can be implemented using a lambda function. Given the list containing strings starting with a lowecase or a uppercase letter. The sum of the lengths of each string starting with an uppercase letter can be determined as follows: First remove all the strings that start with a lowercase letter using the filter function. The filtering condition can be dynamically created using a lambda function which iterates over the strings and checks whether a string starts with an uppercase or a lowercase letter keeping only the strings starting with an uppercase letter. The filter function returns an iterator with the elements that pass the filtering condition. To convert it to a list, you can use the list(...) constructor. Finally, join each string of the filtered list and return its length to count the sum of the lengths of each string starting with an uppercase letter.",
15
+ "imports": "",
16
+ "function_head": "def sum_str_len(s):\n",
17
+ "function_body": " s=list(filter(lambda el:el[0].isupper() and el[1:].islower(),s))\n return len(''.join(s))"
18
+ }, {
19
+ "task_id": 3,
20
+ "mbpp_task_id": 793,
21
+ "description": "Write a Python function to find the position of last occurrences of an element in a sorted array.",
22
+ "cot": "The function can be implemented using a binary search algorithm. Given a sorted array of elements arr of length n. Given the target element x for which we want to find the last occurrence in the array and return its position. The last occurrence of the target element x can be determined as follows: First initialize the bottom border to 0, i.e. low = 0, and the top border to n - 1, i.e. high = n-1, to track the left and right ends of the current search interval. By the end of the loop, if we did not find the target value, the function returns -1. Then enter the loop and repeatedly divide the search interval in half to find the part of the array that contains the element x. This can be accomplished by adding the bottom and top border of the current search interval and dividing the sum by 2 using the floor division operator, i.e. mid = (low + high) // 2. Now compare the value at mid with the target. If the value at mid is greater than the target x, then we need to search the last occurrence in the left part because all the values in the right part are less than the target. Update the top border, i.e. high= mid - 1. Else, if the value at mid is less than the target x, then we need to search for the first occurrence in the right part and update the bottom border, i.e. low = mid +1. Else the value at mid is the target element and the bottom border is updated, i.e. low=mid+1. The loop ends when the bottom border is greater than the top border, i.e. low > high.",
23
+ "imports": "",
24
+ "function_head": "def last(arr,x):\n",
25
+ "function_body": " n = len(arr)\n low = 0\n high = n - 1\n res = -1 \n while (low <= high):\n mid = (low + high) // 2 \n if arr[mid] > x:\n high = mid - 1\n elif arr[mid] < x:\n low = mid + 1\n else:\n res = mid\n low = mid + 1\n return res"
26
+ }, {
27
+ "task_id": 4,
28
+ "mbpp_task_id": null,
29
+ "description": "Write a Python function to lowercase the input text.",
30
+ "cot": "Given an input text. The function can be implemented with the lower() method, which returns a string in which all characters are lowercase. Symbols and Numbers are ignored.",
31
+ "imports": "",
32
+ "function_head": "def text_lowercase(text):\n",
33
+ "function_body": " return text.lower()"
34
+ }, {
35
+ "task_id": 5,
36
+ "mbpp_task_id": 725,
37
+ "description": "Write a Python function to extract values between quotation marks \" \" of the given string.",
38
+ "cot": "The function can be implemented using a regular expression. Given an input string s containing substrings between quotation. To extract strings in between the quotations the method findall() from re library can be used. The method findall() returns all non-overlapping matches of pattern in string, as a list of strings. The string is scanned left-to-right, and matches are returned in the order found.",
39
+ "imports": "import re\n",
40
+ "function_head": "def extract_quotation(s):\n",
41
+ "function_body": " return (re.findall(r'\"(.*?)\"', s))"
42
+ }, {
43
+ "task_id": 6,
44
+ "mbpp_task_id": 619,
45
+ "description": "Write a Python function to move all the numbers to the end of the given string.",
46
+ "cot": "\"The function can be implemented using a for loop. Given an input string s. Initialize two empty strings to append the digits and the substrings found in the input string, i.e. dig='' and res=''. Iterate over each character in the string and check if it is a digit using the method isdigit(). If it is a digit append it to the digits string i.e. dig += ele, else append it to the substring string res i.e. res += ele. After the loop terminates, append the digits string to the substring string res, i.e. res += dig.",
47
+ "imports": "",
48
+ "function_head": "def move_num(s):\n",
49
+ "function_body": " res = ''\n dig = ''\n for ele in s:\n if ele.isdigit():\n dig += ele\n else:\n res += ele\n res += dig\n return (res) "
50
+ }, {
51
+ "task_id": 7,
52
+ "mbpp_task_id": 602,
53
+ "description": "Write a Python function to find the first repeated character in a given string.",
54
+ "cot": "The function can be implemented using a for loop. Given an input string s. Iterate over each character in the string using enumerate objects in the loop, i.e. enumerate(s). The enumerate() function adds a counter to an iterable and returns it in the form of an enumeration object, i.e. each character c is accompanied by a position index. Use this position index to count the occurrences of a character up to its position index, i.e. s[:index+1].count(c). Returns the first character whose counter is greater than 1.",
55
+ "imports": "",
56
+ "function_head": "def first_repeated_char(s):\n",
57
+ "function_body": " for index,c in enumerate(s):\n if s[:index+1].count(c) > 1:\n return c"
58
+ }, {
59
+ "task_id": 8,
60
+ "mbpp_task_id": 616,
61
+ "description": "Write a Python function which takes two tuples of the same length and performs the element wise modulo.",
62
+ "cot": "The function can be implemented using a generator expression. Given two tuples i.e. tup1, tup2 of same length. The element wise modulo of tuples can be realized using a generator expression and the zip() function. The zip() function returns pairs of elements, where the first element is from the first tuple and the second element is from the second tuple.",
63
+ "imports": "",
64
+ "function_head": "def tuple_modulo(tup1, tup2):\n",
65
+ "function_body": " res = tuple(el1 % el2 for el1, el2 in zip(tup1, tup2)) \n return (res)"
66
+ }, {
67
+ "task_id": 9,
68
+ "mbpp_task_id": 641,
69
+ "description": "Write a Python function to find the nth nonagonal number.",
70
+ "cot": "The function can be implemented using the formula: n*(7*n - 5)/2.",
71
+ "imports": "",
72
+ "function_head": "def is_nonagonal(n):\n",
73
+ "function_body": " return int(n * (7 * n - 5) / 2)"
74
+ }, {
75
+ "task_id": 10,
76
+ "mbpp_task_id": 784,
77
+ "description": "Write a Python function to find the first even and odd number of a given list.",
78
+ "cot": "The function can be implemented using a generator expression and the next() function. Given a list l of numbers. Iterate over the list and find the first even number from the list, i.e. el%2==0. Then iterate over the list to find the first odd number from the list, i.e. el%2!=0. Return a tuple containing the first even and odd number. If there is no even or odd number on the list then return -1.",
79
+ "function_head": "def even_odd(l):\n",
80
+ "function_body": " first_even = next((el for el in l if el%2==0),-1)\n first_odd = next((el for el in l if el%2!=0),-1)\n return first_even, first_odd"
81
+ }, {
82
+ "task_id": 11,
83
+ "mbpp_task_id": 785,
84
+ "description": "Write a Python function to convert tuple string to integer tuple.",
85
+ "cot": "The function can be implemented using the functions tuple(), int(), replace() and split(). Given a tuple of integers as a string. Iterate over the string characters and use the replace() and split() function to extract the digits. Use the int() function to convert the characters to integers and use the tuple() method to create a tuple from the integer values.",
86
+ "imports": "",
87
+ "function_head": "def tuple_str_int(test_str):\n",
88
+ "function_body": " res = tuple(int(num) for num in test_str.replace('(', '').replace(')', '').replace('...', '').split(', '))\n return (res)"
89
+ }, {
90
+ "task_id": 12,
91
+ "mbpp_task_id": 574,
92
+ "description": "Write a Python function to compute the surface area of a cylinder.",
93
+ "cot": "Given the height and the radius of a cylinder. The surface of a cylinder can be implemented using the following formula: ((2*pi*radian) * height) + ((pi*radian**2)*2). With pi = 3.1415.",
94
+ "imports": "",
95
+ "function_head": "def surfacearea_cylinder(r,h):\n",
96
+ "function_body": " surfacearea=((2*3.1415*r)*h) + ((3.1415*r**2)*2)\n return surfacearea"
97
+ }, {
98
+ "task_id": 13,
99
+ "mbpp_task_id": 786,
100
+ "description": "Write a Python function to locate the right insertion point for a specified value in sorted order.",
101
+ "cot": "Given a list l and a value x to be inserted. Use the bisect_right function of the bisect library to find the position in the list where the input value x can be inserted to keep the list sorted. The bisect_right function returns the position in the sorted list where the input value x can be inserted to keep the resulting list sorted. If the element already exists in the list, the rightmost position where the element must be inserted is returned.\n",
102
+ "imports": "import bisect\n",
103
+ "function_head": "def right_insertion(l, x):\n",
104
+ "function_body": " return bisect.bisect_right(l, x)"
105
+ }, {
106
+ "task_id": 14,
107
+ "mbpp_task_id": 566,
108
+ "description": "Write a Python function to get the sum of the digits of a non-negative integer.",
109
+ "cot": "Given an non-negative integer n. The sum can be implemented by using a recursive function and the modulo operator. The modulo operation returns the rest of the division of n by 10. By casting the result of the division of n by 10, the digits before the decimal point are obtained. With the casted result, the function can be called again to determine the next digit and add it to the intermediate result.",
110
+ "imports": "",
111
+ "function_head": "def sum_digits(n):\n",
112
+ "function_body": " if n == 0:\n return 0\n else:\n return n % 10 + sum_digits(int(n / 10))"
113
+ }, {
114
+ "task_id": 15,
115
+ "mbpp_task_id": 603,
116
+ "description": "Write a Python function to get lucid numbers smaller than or equal to a given integer.",
117
+ "cot": "Given an non-negative integer number n. Ludic numbers smaller or equal than n are obtained by considering list of natural numbers and removing i-th number in i-th iteration where i begins with 2. In every iteration, the first removed number is Ludic. 1 is considered as Ludic.",
118
+ "imports": "",
119
+ "function_head": "def get_ludic(n):\n",
120
+ "function_body": " ludics = []\n for i in range(1, n + 1):\n ludics.append(i)\n index = 1\n while(index != len(ludics)):\n first_ludic = ludics[index]\n remove_index = index + first_ludic\n while(remove_index < len(ludics)):\n ludics.remove(ludics[remove_index])\n remove_index = remove_index + first_ludic - 1\n index += 1\n return ludics"
121
+ }, {
122
+ "task_id": 16,
123
+ "mbpp_task_id": 760,
124
+ "description": "Write a Python function to check whether a list of numbers contains only one distinct element or not.",
125
+ "cot":"Given is a list of numbers l. The check whether a list of numbers contains only one element or not can be realized using a set, since no repetitions are allowed in a set. Insert the elements of the list into the set. If there is only one element, the length of the set should be 1. In this case return True else False.",
126
+ "imports": "",
127
+ "function_head": "def unique_element(l):\n",
128
+ "function_body": " s = set(l)\n return len(s) == 1"
129
+ }, {
130
+ "task_id": 17,
131
+ "mbpp_task_id": 744,
132
+ "description": "Write a Python function to check if the given tuple has any none value or not.",
133
+ "cot":"Given a tuple t. To check if the given tuple has any none value or not can be implemented by using the functions any(), map() and lambda. The map() function iterates over each element of the given tuple and returns an iterable of the results after applying the lambda function to each item of the given tuple. The lambda function checks if an item is None. The any() function returns True if any of the elements of the returned map results are True else it returns False.",
134
+ "imports": "",
135
+ "function_head": "def check_none(test_tup):\n",
136
+ "function_body": " res = any(map(lambda ele: ele is None, test_tup))\n return res"
137
+ }, {
138
+ "task_id": 18,
139
+ "mbpp_task_id": 772,
140
+ "description": "Write a Python function to remove all the words with k length in the given string.",
141
+ "cot":"Given a string s and the length k. To remove k length words in the given string s can be realized using a list comprehension and the functions split(), join() and len(). The split() function splits a string into a list of strings after breaking the given string by the specified separator. If is not provided then any white space is a separator. Iterate over the splits with a list comprehension and omit all elements whose length differs from k, i.e. len(ele) != k. Then use the join() function to concatenate the elements of length k separated by the space character. The joined elements of length k are returned as a string.",
142
+ "imports": "",
143
+ "function_head": "def remove_length(s, k):\n",
144
+ "function_body": " temp = s.split()\n res = [ele for ele in temp if len(ele) != k]\n res = ' '.join(res)\n return (res)"
145
+ }, {
146
+ "task_id": 19,
147
+ "mbpp_task_id": 775,
148
+ "description": "Write a Python function to check whether every odd index contains odd numbers of a given list.",
149
+ "cot":"Given a list of integer numbers. To check whether every even index contains an even number and every odd index contains odd number of the input list num can be implemented using a generator expression and the modulo operator. Iterate over the indexes of the list and compare whether the index and the value stored under the index is an even or odd number. If each even index has an even value and each odd index has an odd value then return True otherwise False. Use the all() function for this. The all() function returns True if all items in an iterable are true, otherwise it returns False. If the iterable object is empty, the all() function also returns True.",
150
+ "imports": "",
151
+ "function_head": "def odd_position(nums):\n",
152
+ "function_body": " return all(nums[i]%2==i%2 for i in range(len(nums)))"
153
+ }, {
154
+ "task_id": 20,
155
+ "mbpp_task_id": 597,
156
+ "description": "Write a Python function to find kth element from the given two sorted arrays.",
157
+ "cot":"Given two sorted lists of size m and n respectively and a value k. Finding the k-th element from the given two lists of integers can be realized by using a technique based on while-loops to merge two lists. From the merged (and sorted) list the element from the k-th position can be easily determined.",
158
+ "imports": "",
159
+ "function_head": "def find_kth(arr1, arr2, k):\n",
160
+ "function_body": " m = len(arr1)\n n = len(arr2)\n sorted1 = [0] * (m + n)\n i = 0\n j = 0\n d = 0\n while (i < m and j < n):\n if (arr1[i] < arr2[j]):\n sorted1[d] = arr1[i]\n i += 1\n else:\n sorted1[d] = arr2[j]\n j += 1\n d += 1\n while (i < m):\n sorted1[d] = arr1[i]\n d += 1\n i += 1\n while (j < n):\n sorted1[d] = arr2[j]\n d += 1\n j += 1\n return sorted1[k - 1]"
161
+ }
162
+ ]
tedrics_data_tasks.json ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "task_id": 1,
4
+ "mbpp_task_id": 776,
5
+ "source": "https://www.geeksforgeeks.org/python-program-to-count-characters-surrounding-vowels/",
6
+ "licence": "CC BY-SA",
7
+ "task": "Count non-vowels neighboring at least one vowel in a string."
8
+ }, {
9
+ "task_id": 2,
10
+ "mbpp_task_id": 639,
11
+ "source": "https://www.w3resource.com/python-exercises/lambda/python-lambda-exercise-22.php",
12
+ "licence": "CC Attribution 4.0 International License",
13
+ "task": "Sum the length of the strings of a given list after removing the strings that start with a lowercase letter."
14
+ }, {
15
+ "task_id": 3,
16
+ "mbpp_task_id": 793,
17
+ "source": "https://www.geeksforgeeks.org/find-first-and-last-positions-of-an-element-in-a-sorted-array/",
18
+ "licence": "CC BY-SA",
19
+ "task": "Find the position of last occurrences of an element in a sorted array."
20
+ }, {
21
+ "task_id": 4,
22
+ "mbpp_task_id": null,
23
+ "source": "https://www.geeksforgeeks.org/text-preprocessing-in-python-set-1/",
24
+ "licence": "CC BY-SA",
25
+ "task": "Lowercase the given input text."
26
+ }, {
27
+ "task_id": 5,
28
+ "mbpp_task_id": 725,
29
+ "source": "https://www.geeksforgeeks.org/extract-string-from-between-quotations-python/",
30
+ "licence": "CC BY-SA",
31
+ "task": "Extract string from between quotations."
32
+ }, {
33
+ "task_id": 6,
34
+ "mbpp_task_id": 619,
35
+ "source": "https://www.geeksforgeeks.org/python-program-to-move-numbers-to-the-end-of-the-string/",
36
+ "licence": "CC BY-SA",
37
+ "task": "Move numbers to the end of the string."
38
+ }, {
39
+ "task_id": 7,
40
+ "mbpp_task_id": 602,
41
+ "source": "https://www.geeksforgeeks.org/find-the-first-repeated-character-in-a-string/",
42
+ "licence": "CC BY-SA",
43
+ "task": "Find the first repeated character in a string."
44
+ }, {
45
+ "task_id": 8,
46
+ "mbpp_task_id": 616,
47
+ "source": "https://www.geeksforgeeks.org/python-modulo-of-tuple-elements/",
48
+ "licence": "CC BY-SA",
49
+ "task":"Perform element wise modulo of tuples of the same length."
50
+ }, {
51
+ "task_id": 9,
52
+ "mbpp_task_id": 641,
53
+ "source": "https://www.geeksforgeeks.org/nonagonal-number/#:~:text=The%20nth%20nonagonal%20number,7n%20%E2%80%93%205)%20%2F%202.",
54
+ "licence": "CC BY-SA",
55
+ "task":"Find the nth nonagonal number."
56
+ }, {
57
+ "task_id": 10,
58
+ "mbpp_task_id": 784,
59
+ "source": "https://www.w3resource.com/python-exercises/list/python-data-type-list-exercise-137.php",
60
+ "licence": "CC Attribution 4.0 International License",
61
+ "task":"Find the first even and odd number of a given list."
62
+ }, {
63
+ "task_id": 11,
64
+ "mbpp_task_id": 785,
65
+ "source": "https://www.geeksforgeeks.org/python-convert-tuple-string-to-integer-tuple/#:~:text=One%20can%20face%20a%20problem,tuple()%20and%20int().",
66
+ "licence": "CC BY-SA",
67
+ "task":"Convert tuple string to integer tuple."
68
+ }, {
69
+ "task_id": 12,
70
+ "mbpp_task_id": 574,
71
+ "source":"https://www.w3resource.com/python-exercises/math/python-math-exercise-5.php",
72
+ "licence": "CC Attribution 4.0 International License",
73
+ "task":"Compute the surface area of a cylinder."
74
+ }, {
75
+ "task_id": 13,
76
+ "mbpp_task_id": 786,
77
+ "source":"https://www.w3resource.com/python-exercises/data-structures-and-algorithms/python-data-structure-exercise-25.php",
78
+ "licence": "CC Attribution 4.0 International License",
79
+ "task":"Locate the right insertion point for a specified value in sorted order."
80
+ }, {
81
+ "task_id": 14,
82
+ "mbpp_task_id": 566,
83
+ "source":"https://www.geeksforgeeks.org/program-for-sum-of-the-digits-of-a-given-number/",
84
+ "licence": "CC BY-SA",
85
+ "task": "Get the sum of the digits of a non-negative integer."
86
+ }, {
87
+ "task_id": 15,
88
+ "mbpp_task_id": 603,
89
+ "source":"https://www.geeksforgeeks.org/program-for-sum-of-the-digits-of-a-given-number/",
90
+ "licence": "CC BY-SA",
91
+ "task": "Get lucid numbers smaller than or equal to a given integer."
92
+ }, {
93
+ "task_id": 16,
94
+ "mbpp_task_id": 760,
95
+ "source":"https://www.geeksforgeeks.org/check-if-an-array-contains-only-one-distinct-element/",
96
+ "licence": "CC BY-SA",
97
+ "task": "Check whether a list of numbers contains only one distinct element or not."
98
+ }, {
99
+ "task_id": 17,
100
+ "mbpp_task_id": 744,
101
+ "source":"https://www.geeksforgeeks.org/python-check-if-tuple-has-any-none-value/",
102
+ "licence": "CC BY-SA",
103
+ "task": "Check if the given tuple has any none value or not."
104
+ }, {
105
+ "task_id": 18,
106
+ "mbpp_task_id": 772,
107
+ "source":"https://www.geeksforgeeks.org/python-program-to-remove-k-length-words-in-string/",
108
+ "licence": "CC BY-SA",
109
+ "task": "Remove all the words with k length in the given string."
110
+ }, {
111
+ "task_id": 19,
112
+ "mbpp_task_id": 775,
113
+ "source":"https://www.w3resource.com/python-exercises/basic/python-basic-1-exercise-95.php",
114
+ "licence": "CC Attribution 4.0 International License",
115
+ "task": "Check whether every odd index contains odd numbers of a given list."
116
+ }, {
117
+ "task_id": 20,
118
+ "mbpp_task_id": 597,
119
+ "source":"https://www.geeksforgeeks.org/k-th-element-two-sorted-arrays/",
120
+ "licence": "CC BY-SA",
121
+ "task": "Find kth element from the given two sorted arrays."
122
+ }
123
+ ]
tedrics_data_testcases.json ADDED
@@ -0,0 +1,502 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "task_id": 1,
4
+ "mbpp_task_id": 776,
5
+ "task": "Count non-vowels neighboring at least one vowel in a string.",
6
+ "test_cases": [
7
+ {
8
+ "test_case_id": 1,
9
+ "cot": "Vowels are 'a', 'e', 'i', 'o', 'u'. The input string 'amazonprime' consists of the following characters: 1: a, 2: m, 3: a, 4: z, 5: o, 6: n, 7: p, 8: r, 9: i, 10: m, 11: e. The input string 'amazonprime' has 5 characters that have surrounding vowels, namely: 1: p, 4: z, 6: n, 8: r, 10: m. The output is 5.",
10
+ "input": "['amazonprime']",
11
+ "output": "5"
12
+ },
13
+ {
14
+ "test_case_id": 2,
15
+ "cot": "Vowels are 'a', 'e', 'i', 'o', 'u'. The input is a string, e.g. 'partofthejourney' consists of the following characters: 1: p, 2: a, 3: r, 4: t, 5: o, 6: f, 7: t, 8: h, 9: e, 10: j, 11: o, 12: u, 13: r, 14: n, 15: e, 16: y. The input string 'partofthejourney' has 9 characters that have surrounding vowels, namely: 1: p, 3: r, 4: t, 6: f, 8: h, 10: j, 13: r, 14: n, 16: y. The output is 9.",
16
+ "input": "['partofthejourney']",
17
+ "output": "9"
18
+ },
19
+ {
20
+ "test_case_id": 3,
21
+ "cot": "Vowels are 'a', 'e', 'i', 'o', 'u'. The input is a string, e.g. '140tls' consists of the following characters: 1: 1, 2: 4, 3: 0, 4: t, 5: l, 6: s. The input string '140tls' has 0 characters that have surrounding vowels. The output is 0.",
22
+ "input": "['140tls']",
23
+ "output": "0"
24
+ }
25
+ ]
26
+ },
27
+ {
28
+ "task_id": 2,
29
+ "mbpp_task_id": 639,
30
+ "task": "Sum the length of the strings of a given list after removing the strings that start with a lowercase letter.",
31
+ "test_cases": [
32
+ {
33
+ "test_case_id": 1,
34
+ "cot": "Given the input list of strings ['abcd', 'Python', 'abba', 'aba']. Remove the strings that start with a lowercase letter, namely 'abcd', 'abba' and 'aba' from the input list. Count the characters of the strings that start with an uppercase letter, i.e., 'Python' to deternine the sum of the lengths of the strings. The output length of the string 'Python' is 6.",
35
+ "input": "[['abcd', 'Python', 'abba', 'aba']]",
36
+ "output": "6"
37
+ },
38
+ {
39
+ "test_case_id": 2,
40
+ "cot": "Given the input list of strings ['sally', 'Dylan', 'rebecca', 'Diana']. Remove the strings that start with a lowercase letter, namely 'sally' and 'rebecca' from the input list. Count the characters of the strings that start with an uppercase letter, i.e., 'Dylan' and 'Diana' to deternine the sum of the lengths of the strings. The length of the string 'Dylan' is 5 and the length of the string 'Diana' is also 5. The output sum of both lengths is 10.",
41
+ "input": "[['sally', 'Dylan', 'rebecca', 'Diana']]",
42
+ "output": "10"
43
+ },
44
+ {
45
+ "test_case_id": 3,
46
+ "cot": "Given the input list of strings ['catch', 'me', 'if', 'you', 'can']. Remove the strings that start with a lowercase letter, namely 'catch', 'me', 'if', 'you' and 'can' from the input list. There are no strings that start with an uppercase letter to deternine the sum of their lengths. The output is 0.",
47
+ "input": "[['catch', 'me', 'if', 'you', 'can']]",
48
+ "output": "0"
49
+ }
50
+ ]
51
+ },
52
+ {
53
+ "task_id": 3,
54
+ "mbpp_task_id": 793,
55
+ "task": "Find the position of last occurrences of an element in a sorted array.",
56
+ "test_cases": [
57
+ {
58
+ "test_case_id": 1,
59
+ "cot": "Given a sorted array of the elements [1,2,3] and the target element 1. The target element 1 occurs first and last at position 0. The output is the last occurrence of the target element 1, i.e. position 0.",
60
+ "input": "[[1,2,3],1]",
61
+ "output": "0"
62
+ },
63
+ {
64
+ "test_case_id": 2,
65
+ "cot": "Given a sorted array of the elements [1,1,1,2,3,4] and the target element 1. The target element 1 occurs first at position 0 and last at position 2. The output is the last occurrence of the target element 1, i.e. position 2.",
66
+ "input": "[[1,1,1,2,3,4],1]",
67
+ "output": "2"
68
+ },
69
+ {
70
+ "test_case_id": 3,
71
+ "cot": "Given a sorted array of the elements [2,3,2,3,6,8,9] and the target element 5. The target element 5 does not occur in the input array. The output is -1.",
72
+ "input": "[[2,3,2,3,6,8,9],5]",
73
+ "output": "-1"
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ "task_id": 4,
79
+ "mbpp_task_id": null,
80
+ "task": "Lowercase the given input text.",
81
+ "test_cases": [
82
+ {
83
+ "test_case_id": 1,
84
+ "cot": "Given the input 'Hey! How are you?'. The first and second words, i.e. 'Hey' and 'How', each start with a capital letter. Transforming the input text in lower case results in the output'hey! how are you?'.",
85
+ "input": "['Hey! How are you?']",
86
+ "output": "'hey! how are you?'"
87
+ },
88
+ {
89
+ "test_case_id": 2,
90
+ "cot": "Given an input text 'you got it'. All words are written in lower case. The output is 'you got it'.",
91
+ "input": "['you got it']",
92
+ "output": "'you got it'"
93
+ },
94
+ {
95
+ "test_case_id": 3,
96
+ "cot": "Given an input text 'WOW'. All letters of the input text are written in upper case. Transforming the input text in lower case results in the output 'wow'.",
97
+ "input": "['WOW']",
98
+ "output": "'wow'"
99
+ }
100
+ ]
101
+ },
102
+ {
103
+ "task_id": 5,
104
+ "mbpp_task_id": 725,
105
+ "task": "Extract string from between quotations.",
106
+ "test_cases": [
107
+ {
108
+ "test_case_id": 1,
109
+ "cot": "Given an input string s = 'Cast your \"favorite\" entertainment \"apps\"'. The task is to extract substrings from the input string s between double quotation marks. The first, second and fourth substrings, i.e., 'Cast', 'your' and 'entertainment' are not between quotation marks. The third and fifth substrings, i.e. '\"favorite\"' and '\"apps\"' are surrounded by double quotation marks and can be extracted. The output is ['favorite', 'apps'].",
110
+ "input": "['Cast your \"favorite\" entertainment \"apps\"']",
111
+ "output": "['favorite', 'apps']"
112
+ },
113
+ {
114
+ "test_case_id": 2,
115
+ "cot": "Given an input string s = \"Watch content \\'4k Ultra HD\\' resolution with \\'HDR 10\\' Support\". The task is to extract substrings from the input string s between double quotation marks. The first, second, fourth, fifth and seventh substrings, i.e., 'Watch', 'content', 'resolution', 'with' and 'Support ' are not between quotation marks. The third and sixth substrings, i.e. '\\'4k Ultra HD\\'' and '\\'HDR 10\\'' are surrounded by single quotation marks and can't be extracted. The output is [].",
116
+ "input": "['Watch content \\'4k Ultra HD\\' resolution with \\'HDR 10\\' Support']",
117
+ "output": "[]"
118
+ },
119
+ {
120
+ "test_case_id": 3,
121
+ "cot": "Given an input string s = 'You and me are \"great\"'. The task is to extract substrings from the input string s between double quotation marks. The first, second, third and fourth substrings, i.e., 'You', 'and', 'me' and 'are ' are not between quotation marks. The fifth substring, i.e. '\"great\"' and is surrounded by double quotation marks and can be extracted. The output is ['great'].",
122
+ "input": "['You and me are \"great\"']",
123
+ "output": "['great']"
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "task_id": 6,
129
+ "mbpp_task_id": 619,
130
+ "task": "Move numbers to the end of the string.",
131
+ "test_cases": [
132
+ {
133
+ "test_case_id": 1,
134
+ "cot": "Given an input string s = 'I1love143you55three3000thousand'. The input string s contains the digits 1, 143, 55 and 3000 and the substrings 'I', 'love', 'you', 'three' and 'thousand'. The digits are attached in the order found after the substrings. The output is 'Iloveyouthreethousand1143553000'.",
135
+ "input": "['I1love143you55three3000thousand']",
136
+ "output": "'Iloveyouthreethousand1143553000'"
137
+ },
138
+ {
139
+ "test_case_id": 2,
140
+ "cot": "Given an input string s = 'AvengersOneTwoAssemble'. There are no digits in the input string. The output is 'AvengersOneTwoAssemble'.",
141
+ "input": "['AvengersOneTwoAssemble']",
142
+ "output": "'AvengersOneTwoAssemble'"
143
+ },
144
+ {
145
+ "test_case_id": 3,
146
+ "cot": "Given an input string s = 'thisis100percentnotagoodidea'. The input string s contains the digits 1, 0 and 0 and the substrings 'thisis', and 'percentnotagoodidea'. The digits are attached in the order found after the two substrings. The output is 'thisispercentnotagoodidea100'.",
147
+ "input": "['thisis100percentnotagoodidea']",
148
+ "output": "'thisispercentnotagoodidea100'"
149
+ }
150
+ ]
151
+ },
152
+ {
153
+ "task_id": 7,
154
+ "mbpp_task_id": 602,
155
+ "task": "Find the first repeated character in a string.",
156
+ "test_cases": [
157
+ {
158
+ "test_case_id": 1,
159
+ "cot": "Given an input string s = 'abcabc'. The character 'a' first occurs at position 0 and recurs at position 3. The character 'b' first occurs at position 1 and recurs at position 4. The character 'c' first occurs at position 2 and recurs at position 5. The character 'a' is the first repeated character in the input string. The output is 'a'.",
160
+ "input": "['abcabc']",
161
+ "output": "'a'"
162
+ },
163
+ {
164
+ "test_case_id": 2,
165
+ "cot": "Given an input string s = 'abc'. The character 'a' only occurs at position 0. The character 'b' only occurs at position 1. The character 'c' only occurs at position 2. The output is None.",
166
+ "input": "['abc']",
167
+ "output": "None"
168
+ },
169
+ {
170
+ "test_case_id": 3,
171
+ "cot": "Given an input string s = '12323'. The character '1' only occurs at position 0. The character '2' first occurs at position 1 and recurs at position 3. The character '3' first occurs at position 2 and recurs at position 4. The character '2' is the first repeated character in the input string. The output is '2'.",
172
+ "input": "['12323']",
173
+ "output": "'2'"
174
+ }
175
+ ]
176
+ },
177
+ {
178
+ "task_id": 8,
179
+ "mbpp_task_id": 616,
180
+ "task":"Perform element wise modulo of tuples of the same length.",
181
+ "test_cases": [
182
+ {
183
+ "test_case_id": 1,
184
+ "cot": "Given the input tuples tup1 = (10, 4, 5, 6) and tup2 = (5, 6, 7, 5) with equal length. The first element of the tuple tup1, 10, modulo the first element of the second tuple, 5, is 10 % 5 = 0. The second element of the tuple tup1, 4, modulo the second element of the second tuple, 6, is 4 % 6 = 4. The third element of the tuple tup1, 5, modulo the third element of the second tuple, 7, is 5 % 7 = 5. The fourth element of the tuple tup1, 6, modulo the fourth element of the second tuple, 5, is 6 % 5 = 1. The output is (0, 4, 5, 1).",
185
+ "input": "[(10, 4, 5, 6), (5, 6, 7, 5)]",
186
+ "output": "(0, 4, 5, 1)"
187
+ },
188
+ {
189
+ "test_case_id": 2,
190
+ "cot": "Given the input tuples tup1 = (11, 5, 6, 7) and tup2 = (6, 7, 8, 6) with equal length. The first element of the tuple tup1, 11, modulo the first element of the second tuple, 6, is 11 % 6 = 5. The second element of the tuple tup1, 5, modulo the second element of the second tuple, 7, is 5 % 7 = 5. The third element of the tuple tup1, 6, modulo the third element of the second tuple, 8, is 6 % 8 = 6. The fourth element of the tuple tup1, 7, modulo the fourth element of the second tuple, 6, is 7 % 6 = 1. The output is (5, 5, 6, 1).",
191
+ "input": "[(11, 5, 6, 7), (6, 7, 8, 6)]",
192
+ "output": "(5, 5, 6, 1)"
193
+ },
194
+ {
195
+ "test_case_id": 3,
196
+ "cot": "Given the input tuples tup1 = (12, 6, 7, 8) and tup2 = (7, 8, 9, 7) with equal length. The first element of the tuple tup1, 12, modulo the first element of the second tuple, 7, is 12 % 7 = 5. The second element of the tuple tup1, 6, modulo the second element of the second tuple, 8, is 6 % 8 = 6. The third element of the tuple tup1, 7, modulo the third element of the second tuple, 9, is 7 % 9 = 7. The fourth element of the tuple tup1, 8, modulo the fourth element of the second tuple, 7, is 8 % 7 = 1. The output is (5, 6, 7, 1).",
197
+ "input": "[(12, 6, 7, 8), (7, 8, 9, 7)]",
198
+ "output": "(5, 6, 7, 1)"
199
+ }
200
+ ]
201
+ },
202
+ {
203
+ "task_id": 9,
204
+ "mbpp_task_id": 641,
205
+ "task":"Find the nth nonagonal number.",
206
+ "test_cases": [
207
+ {
208
+ "test_case_id": 1,
209
+ "cot": "Given the input number n = 10. The nth nonagonal number is given by the formula: n*(7*n - 5)/2 = 325. The output is 325.",
210
+ "input": "[10]",
211
+ "output": "325"
212
+ },
213
+ {
214
+ "test_case_id": 2,
215
+ "cot": "Given the input number n = 15. The nth nonagonal number is given by the formula: n*(7*n - 5)/2 = 750. The output is 750.",
216
+ "input": "[15]",
217
+ "output": "750"
218
+ },
219
+ {
220
+ "test_case_id": 3,
221
+ "cot": "Given the input number n = 18. The nth nonagonal number is given by the formula: n*(7*n - 5)/2 = 18. The output is 1089.",
222
+ "input": "[18]",
223
+ "output": "1089"
224
+ }
225
+ ]
226
+ },
227
+ {
228
+ "task_id": 10,
229
+ "mbpp_task_id": 784,
230
+ "task":"Find the first even and odd number of a given list.",
231
+ "test_cases": [
232
+ {
233
+ "test_case_id": 1,
234
+ "cot": "Given the input list [1,3,4,7,6]. The third and fifth elements are even numbers, since 4 divided by 2 and 6 divided by 2 equals zero. The first, second, and fourth elements are odd numbers, because 1 divided by 2, 3 divided by 2, and 7 divided by 2 is not equal to zero. The first even number from the list is 4 and the first odd number is 1. The output is the tuple (4, 1).",
235
+ "input": "[[1,3,4,7,6]]",
236
+ "output": "(4, 1)"
237
+ },
238
+ {
239
+ "test_case_id": 2,
240
+ "cot": "Given the input list [2,4,3,1]. The first and second elements are even numbers, since 2 divided by 2 and 4 divided by 2 equals zero. The third and fourth elements are odd numbers, because 3 divided by 2 and 1 divided by 2 is not equal to zero. The first even number is 2 and the first odd number from the list is 3. The output is the tuple (2, 3).",
241
+ "input": "[[2,4,3,1]]",
242
+ "output": "(2, 3)"
243
+ },
244
+ {
245
+ "test_case_id": 3,
246
+ "cot": "Given the input list [2,4,6]. The first, second and third elements are even numbers, since 2 divided by 2, 4 divided by 2 and 6 divided by 2 equals zero. There are no odd numbers, so the output is the tuple (2, -1).",
247
+ "input": "[[2,4,6]]",
248
+ "output": "(2, -1)"
249
+ }
250
+ ]
251
+ },
252
+ {
253
+ "task_id": 11,
254
+ "mbpp_task_id": 785,
255
+ "task":"Convert tuple string to integer tuple.",
256
+ "test_cases": [
257
+ {
258
+ "test_case_id": 1,
259
+ "cot": "Given the input string \"(7, 8, 9)\". The output is the tuple (7, 8, 9) containing integer values.",
260
+ "input": "[\"(7, 8, 9)\"]",
261
+ "output": "(7, 8, 9)"
262
+ },
263
+ {
264
+ "test_case_id": 2,
265
+ "cot": "Given the input string \"(1, 2, 3)\". The output is the tuple (1, 2, 3) containing integer values.",
266
+ "input": "[\"(1, 2, 3)\"]",
267
+ "output": "(1, 2, 3)"
268
+ },
269
+ {
270
+ "test_case_id": 3,
271
+ "cot": "Given the input string \"(4, 5)\". The output is the tuple (4, 5) containing integer values.",
272
+ "input": "[\"(4, 5)\"]",
273
+ "output": "(4, 5)"
274
+ }
275
+ ]
276
+ },
277
+ {
278
+ "task_id": 12,
279
+ "mbpp_task_id": 574,
280
+ "task":"Compute the surface area of a cylinder.",
281
+ "test_cases": [
282
+ {
283
+ "test_case_id": 1,
284
+ "cot": "Given the radius 10 and the height 5. The surface area of a cylinder is computed by the formula ((2*3.1415*10)*5) + ((3.1415*10**2)*2). The output is 942.45.",
285
+ "input": "[10,5]",
286
+ "output": "942.45"
287
+ },
288
+ {
289
+ "test_case_id": 2,
290
+ "cot": "Given the radius 4 and the height 5. The surface area of a cylinder is computed by the formula ((2*3.1415*4)*5) + ((3.1415*4**2)*2). The output is 226.18800000000002.",
291
+ "input": "[4,5]",
292
+ "output": "226.18800000000002"
293
+ },
294
+ {
295
+ "test_case_id": 3,
296
+ "cot": "Given the radius 4 and the height 10. The surface area of a cylinder is computed by the formula ((2*3.1415*4)*10) + ((3.1415*4**2)*2). The output is 351.848.",
297
+ "input": "[4,10]",
298
+ "output": "351.848"
299
+ }
300
+ ]
301
+ },
302
+ {
303
+ "task_id": 13,
304
+ "mbpp_task_id": 786,
305
+ "task":"Locate the right insertion point for a specified value in sorted order.",
306
+ "test_cases": [
307
+ {
308
+ "test_case_id": 1,
309
+ "cot": "Given a sorted input list [1,2,4,5] and the element to be inserted, i.e. 6. The list has four elements, namely 1, 2, 4 and 5, all of which are smaller than input element 6. The position in the list where the input element 6 can be inserted to keep the resulting list sorted is at the end of the list. The output is position 4.",
310
+ "input": "[[1,2,4,5], 6]",
311
+ "output": "4"
312
+ },
313
+ {
314
+ "test_case_id": 2,
315
+ "cot": "Given a sorted input list [1,2,4,5] and the element to be inserted, i.e. 3. The list has four elements, namely 1, 2, 4 and 5. The first and the second elements are smaller than the input element 3. The third and fourth elements are greater than 3. The position in the list where the input element 3 can be inserted to keep the resulting list sorted is between the second and the third element. The output is position 2.",
316
+ "input": "[[1,2,4,5], 3]",
317
+ "output": "2"
318
+ },
319
+ {
320
+ "test_case_id": 3,
321
+ "cot": "Given a sorted input list [1,2,4,5] and the element to be inserted, i.e. 0. The list has four elements, namely 1, 2, 4 and 5, all of which are greater than input element 0. The position in the list where the input element 0 can be inserted to keep the resulting list sorted is at the beginning of the list. The output is position 0.",
322
+ "input": "[[1,2,4,5],0]",
323
+ "output": "0"
324
+ }
325
+ ]
326
+ },
327
+ {
328
+ "task_id": 14,
329
+ "mbpp_task_id": 566,
330
+ "task": "Get the sum of the digits of a non-negative integer.",
331
+ "test_cases": [
332
+ {
333
+ "test_case_id": 1,
334
+ "cot": "Given a non-negative integer number n = 345. The sum of the digits of n is 3 + 4 + 5 = 12. The output is position 12.",
335
+ "input": "[345]",
336
+ "output": "12"
337
+ },
338
+ {
339
+ "test_case_id": 2,
340
+ "cot": "Given a non-negative integer number n = 12. The sum of the digits of n is 1 + 2 = 3. The output is position 3.",
341
+ "input": "[12]",
342
+ "output": "3"
343
+ },
344
+ {
345
+ "test_case_id": 3,
346
+ "cot": "Given a non-negative integer number n = 97. The sum of the digits of n is 9 + 7 = 16. The output is position 16.",
347
+ "input": "[97]",
348
+ "output": "16"
349
+ }
350
+ ]
351
+ },
352
+ {
353
+ "task_id": 15,
354
+ "mbpp_task_id": 603,
355
+ "task": "Get lucid numbers smaller than or equal to a given integer.",
356
+ "test_cases": [
357
+ {
358
+ "test_case_id": 1,
359
+ "cot": "Given a non-negative integer number n = 10. Process of generating Ludic numbers: Ludic = [1] Consider natural numbers from 2 to n = 10, i.e., 2, 3, 4, 5, 6, 7, 8, 9, 10. Delete every 2nd number because first number is 2, i.e., 3, 5, 7, 9. Ludic = [1, 2]. Delete every 3rd number because first number is 3, i.e., 5, 7. Ludic = [1, 2, 3]. The process terminates here since there are less than 5 elements left. The last two numbers are added to the final result. The output is [1, 2, 3, 5, 7].",
360
+ "input": "[10]",
361
+ "output": "[1, 2, 3, 5, 7]"
362
+ },
363
+ {
364
+ "test_case_id": 2,
365
+ "cot": "Given a non-negative integer number n = 15. Process of generating Ludic numbers: Ludic = [1] Consider natural numbers from 2 to n = 15, i.e., 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15. Delete every 2nd number because first number is 2, i.e., 3, 5, 7, 9, 11, 13, 15. Ludic = [1, 2]. Delete every 3rd number because first number is 3, i.e., 5, 7, 11, 13 . Ludic = [1, 2, 3]. The process terminates here since there are less than 5 elements left. The last four numbers are added to the final result. The output is [1, 2, 3, 5, 7, 11, 13].",
366
+ "input": "[15]",
367
+ "output": "[1, 2, 3, 5, 7, 11, 13]"
368
+ },
369
+ {
370
+ "test_case_id": 3,
371
+ "cot": "Given a non-negative integer number n = 5. Process of generating Ludic numbers: Ludic = [1] Consider natural numbers from 2 to n = 5, i.e., 2, 3, 4, 5. Delete every 2nd number because first number is 2, i.e., 3, 5. Ludic = [1, 2]. The process terminates here since there are less than 3 elements left. The last two numbers are added to the final result. The output is [1, 2, 3, 5].",
372
+ "input": "[5]",
373
+ "output": "[1, 2, 3, 5]"
374
+ }
375
+ ]
376
+ },
377
+ {
378
+ "task_id": 16,
379
+ "mbpp_task_id": 760,
380
+ "task": "Check whether a list of numbers contains only one distinct element or not.",
381
+ "test_cases": [
382
+ {
383
+ "test_case_id": 1,
384
+ "cot": "Given a list of numbers l = [1,2,1,2]. The list consists of two distinct numbers, namely 1 and 2. The output is False.",
385
+ "input": "[[1,2,1,2]]",
386
+ "output": "False"
387
+ },
388
+ {
389
+ "test_case_id": 2,
390
+ "cot": "Given a list of numbers l = [1,2,3,4,5]. The list consists of five distinct numbers, namely 1, 2, 3, 4 and 5. The output is False.",
391
+ "input": "[[1,2,3,4,5]]",
392
+ "output": "False"
393
+ },
394
+ {
395
+ "test_case_id": 3,
396
+ "cot": "Given a list of numbers l = [1,1,1]. The list consists of one distinct numbers, namely 1. The output is True.",
397
+ "input": "[[1,1,1]]",
398
+ "output": "True"
399
+ }
400
+ ]
401
+ },
402
+ {
403
+ "task_id": 17,
404
+ "mbpp_task_id": 744,
405
+ "task": "Check if the given tuple has any none value or not.",
406
+ "test_cases": [
407
+ {
408
+ "test_case_id": 1,
409
+ "cot": "Given a tuple t = (10, 4, 5, 6, None). The tuple has five elements, namely four numbers, 10, 4, 5 and 6, and one None element. The output is True.",
410
+ "input": "[(10, 4, 5, 6, None)]",
411
+ "output": "True"
412
+ },
413
+ {
414
+ "test_case_id": 2,
415
+ "cot": "Given a tuple t = (7, 8, 9, 11, 14). The tuple has five elements, namely the five numbers 7, 8, 9, 11 and 14, but no None element. The output is False.",
416
+ "input": "[(7, 8, 9, 11, 14)]",
417
+ "output": "False"
418
+ },
419
+ {
420
+ "test_case_id": 3,
421
+ "cot": "Given a tuple t = (1, 2, 3, 4, None). The tuple has five elements, namely the four numbers 1, 2, 3 and 4, and one None element. The output is True.",
422
+ "input": "[(1, 2, 3, 4, None)]",
423
+ "output": "True"
424
+ }
425
+ ]
426
+ },
427
+ {
428
+ "task_id": 18,
429
+ "mbpp_task_id": 772,
430
+ "task": "Remove all the words with k length in the given string.",
431
+ "test_cases": [
432
+ {
433
+ "test_case_id": 1,
434
+ "cot": "Given a string s='The person is most value tet' and the length k=3. The strings 'person', 'is', 'most' and 'value' have lengths different from k, i.e. len('person') = 6 and 6!=3, len('is') = 2 and 6!=3, len('most') = 4 and 4!=3, len('value') = 5 and 5!=3. The strings 'The' and 'tet' have the length K=3 and are removed from the input string s. The output is 'person is most value'.",
435
+ "input": "['The person is most value tet', 3]",
436
+ "output": "'person is most value'"
437
+ },
438
+ {
439
+ "test_case_id": 2,
440
+ "cot": "Given a string s='If you told me about this ok' and the length k=4. The strings 'If', 'you', 'me', 'about' and 'ok' have lengths different from k, i.e. len('If') = 2 and 2!=4, len('you') = 3 and 3!=4, len('me') = 2 and 2!=4, len('about') = 5 and 5!=4, len('ok') = 2 and 2!=4. The strings 'told' and 'this' have the length K=4 and are removed from the input string s. The output is 'If you me about ok'.",
441
+ "input": "['If you told me about this ok', 4]",
442
+ "output": "'If you me about ok'"
443
+ },
444
+ {
445
+ "test_case_id": 3,
446
+ "cot": "Given a string s='Forces of darkeness' and the length k=4. The strings 'Forces', 'of' and 'darkeness' have lengths different from k, i.e. len('Forces') = 6 and 6!=4, len('of') = 2 and 2!=4, len('darkeness') = 9 and 9!=4. There are no strings that have the length K=4. The output is 'Forces of darkeness'.",
447
+ "input": "['Forces of darkeness', 4]",
448
+ "output": "'Forces of darkeness'"
449
+ }
450
+ ]
451
+ },
452
+ {
453
+ "task_id": 19,
454
+ "mbpp_task_id": 775,
455
+ "task": "Check whether every odd index contains odd numbers of a given list.",
456
+ "test_cases": [
457
+ {
458
+ "test_case_id": 1,
459
+ "cot": "Given a list of integer numbers num=[2,1,4,3]. The index 0 is even and the value 2 stored under the index 0 is even, i.e. 2%2=0%2=0. The index 1 is odd and the value 1 stored under the index 1 is odd, i.e. 1%2=1%2=1. The index 4 is even and the value 4 stored under the index 2 is even, i.e. 4%2=2%2=0. The index 3 is odd and the value 3 stored under the index 3 is odd, i.e. 3%2=3%2=1. Each even index has an even value and each odd index has an odd value. The output is True.",
460
+ "input": "[[2,1,4,3]]",
461
+ "output": "True"
462
+ },
463
+ {
464
+ "test_case_id": 2,
465
+ "cot": "Given a list of integer numbers num=[4,1,2]. The index 0 is even and the value 4 stored under the index 0 is even, i.e. 4%2=0%2=0. The index 1 is odd and the value 1 stored under the index 1 is odd, i.e. 1%2=1%2=1. The index 2 is even and the value 2 stored under the index 2 is even, i.e. 2%2=2%2=0. Each even index has an even value and each odd index has an odd value. The output is True.",
466
+ "input": "[[4,1,2]]",
467
+ "output": "True"
468
+ },
469
+ {
470
+ "test_case_id": 3,
471
+ "cot": "Given a list of integer numbers num=[1,2,3]. The index 0 is even and the value 1 stored under the index 0 is odd, i.e. 1%2=1 and 0%2=0. The index 1 is odd and the value 2 stored under the index 1 is even, i.e. 2%2=0 and 1%2=1. The index 2 is even and the value 3 stored under the index 2 is odd, i.e. 3%2=1 and 2%2=0. No even index has an even value and no odd index has an odd value. The output is False.",
472
+ "input": "[[1,2,3]]",
473
+ "output": "False"
474
+ }
475
+ ]
476
+ },
477
+ {
478
+ "task_id": 20,
479
+ "mbpp_task_id": 597,
480
+ "task": "Find kth element from the given two sorted arrays.",
481
+ "test_cases": [
482
+ {
483
+ "test_case_id": 1,
484
+ "cot": "Given two sorted lists of integer numbers [2, 3, 6, 7, 9] and [1, 4, 8, 10] and the value k = 5. The merged list of the two input lists is [1, 2, 3, 4, 6, 7, 8, 9, 10]. The 6-th element is 6. The output is 6.",
485
+ "input": "[[2, 3, 6, 7, 9], [1, 4, 8, 10], 5]",
486
+ "output": "6"
487
+ },
488
+ {
489
+ "test_case_id": 2,
490
+ "cot": "Given two sorted lists of integer numbers [100, 112, 256, 349, 770] and [72, 86, 113, 119, 265, 445, 892] and the value k = 7. The merged list of the two input lists is [72, 86, 100, 112, 113, 119, 256, 265, 349, 445, 892]. The 7-th element is 256. The output is 256.",
491
+ "input": "[[100, 112, 256, 349, 770], [72, 86, 113, 119, 265, 445, 892], 7]",
492
+ "output": "256"
493
+ },
494
+ {
495
+ "test_case_id": 3,
496
+ "cot": "Given two sorted lists of integer numbers [3, 4, 7, 8, 10] and [2, 5, 9, 11] and the value k = 6. The merged list of the two input lists is [2, 3, 4, 5, 7, 8, 9, 10, 11]. The 6-th element is 8. The output is 8.",
497
+ "input": "[[3, 4, 7, 8, 10], [2, 5, 9, 11], 6]",
498
+ "output": "8"
499
+ }
500
+ ]
501
+ }
502
+ ]