prompt
stringlengths
14
2.1k
completion
stringlengths
0
10.3k
concept
stringclasses
200 values
<?code number = 10?>
<?print oct(number)?>
oct
<?code number = 16?>
<?print oct(number)?>
oct
<?code number = -42?>
<?print oct(number)?>
oct
<?code numbers = [10, 20, 30]?><?for number in numbers?>
<?print oct(number)?> <?end for?>
oct
<?code number = 0?>
<?print oct(number)?>
oct
<?code number = 1234567?>
<?print oct(number)?>
oct
<?code number = -42?>
<?print oct(number)?>
oct
<?code number = 100?>
<?print oct(number)?>
oct
<?code numbers = [10, 20, 30, 40, 50]?><?for number in numbers?>
<?print oct(number)?> <?end for?>
oct
<?code number = 255?>
<?print bin(number)?>
bin
<?code number = 16?>
<?print bin(number)?>
bin
<?code number = 123?>
<?print bin(number)?>
bin
<?code numbers = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]?>
<?for n in numbers?><?print bin(n)?> <?end for?>
bin
<?code number = -5?>
<?print bin(number)?>
bin
<?code a = 10?><?code b = 5?>
<?print bin(a + b)?>
bin
<?code number = 12345?>
<?print bin(number)?>
bin
<?code numbers = [1, 2, 4, 8, 16]?>
<?print ", ".join(bin(n) for n in numbers)?>
bin
<?code negative_number = -42?>
<?print bin(negative_number)?>
bin
<?code number = 0?>
<?print bin(number)?>
bin
<?code my_list = ["apple", "banana", "cherry", "date", "elderberry"]?>
<?for item in slice(my_list, 0, len(my_list), 2)?><?print item?> <?end for?>
slice_full
<?code my_string = "abcdefghijklmnopqrstuvwxyz"?>
<?print slice(my_string, 10, 20, 3)?>
slice_full
<?code my_string = "This is a test string"?>
<?print slice(my_string, 0, len(my_string), 1)?>
slice_full
<?code my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]?>
<?print slice(my_list, 2, 8, 2)?>
slice_full
<?code my_list = ["apple", "banana", "cherry", "date", "elderberry"]?>
<?print slice(my_list, 1, 4, 1)?>
slice_full
<?code my_list = ["apple", "banana", "cherry", "date", "elderberry", "fig", "grape"]?>
<?print slice(my_list, 0, len(my_list), 2)?>
slice_full
<?code my_string = "abcdefghijklmnopqrstuvwxyz"?>
<?print slice(my_string, 5, 15, 3)?>
slice_full
<?code my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]?>
<?print slice(my_list, 3, 7, 1)?>
slice_full
<?code my_string = "This is a test string"?>
<?print slice(my_string, 0, 10, 1)?>
slice_full
<?code my_list = ["apple", "banana", "cherry", "date", "elderberry"]?>
<?print slice(my_list, 1, 4, 2)?>
slice_full
<?code my_list = ["one", "two", "three", "four", "five"]?>
<?print slice(my_list, 2)?>
slice_partial
<?code my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]?>
<?print slice(my_list, 0, 5)?>
slice_partial
<?code my_string = "abcdefghijklmnopqrstuvwxyz"?>
<?print slice(my_string, 5, 15, 2)?>
slice_partial
<?code my_string = "This is a test string."?>
<?print slice(my_string, 5)?>
slice_partial
<?code my_list = ["apple", "banana", "cherry", "date", "elderberry"]?>
<?print slice(my_list, 2)?>
slice_partial
<?code my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]?><?code start = 3?><?code stop = 8?><?code step = 2?>
<?print slice(my_list, start, stop, step)?>
slice_partial
<?code my_string = "This is a test string"?><?code end_index = 10?>
<?print slice(my_string, end_index)?>
slice_partial
<?code my_list = ["apple", "banana", "cherry", "date", "elderberry"]?><?code start_index = 1?><?code end_index = 4?>
<?print slice(my_list, start_index, end_index)?>
slice_partial
<?code my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]?><?code start_index = 2?><?code end_index = 8?><?code step_value = 2?>
<?print slice(my_list, start_index, end_index, step_value)?>
slice_partial
<?code my_string = "abcdefghijklmnopqrstuvwxyz"?><?code start_index = 5?><?code end_index = 15?>
<?print slice(my_string, start_index, end_index)?>
slice_minimal
<?code my_string = "This is a test string."?><?code end_index = 4?>
<?print slice(my_string, end_index)?>
slice_minimal
<?code my_list = ["apple", "banana", "cherry", "date", "elderberry"]?><?code stop_index = 3?>
<?print slice(my_list, stop_index)?>
slice_minimal
<?code my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]?><?code start = 2?><?code stop = 8?><?code step = 2?>
<?print slice(my_list, start, stop, step)?>
slice_minimal
<?code my_string = "abcdefghijklmnopqrstuvwxyz"?><?code start_index = 5?><?code end_index = 15?>
<?print slice(my_string, start_index, end_index)?>
slice_minimal
<?code my_string = "This is a test string"?><?code stop = 4?>
<?print slice(my_string, stop)?>
slice_minimal
<?code my_list = ["apple", "banana", "cherry", "date", "elderberry"]?><?code stop_index = 3?>
<?print slice(my_list, stop_index)?>
slice_minimal
<?code my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]?><?code start = 2?><?code stop = 8?><?code step = 2?>
<?print slice(my_list, start, stop, step)?>
slice_minimal
<?code my_string = "abcdefghijklmnopqrstuvwxyz"?><?code stop = 5?>
<?print slice(my_string, stop)?>
slice_minimal
<?code start = 5?><?code stop = 15?><?code step = 2?>
<?for i in range(start, stop, step)?><?print i?><?end for?>
range_full
<?code start = 10?><?code stop = 20?><?code step = 2?>
<?print list(range(start, stop, step))?>
range_full
<?code start = 5?><?code end = 10?><?code step = 1?>
<?print list(range(start, end, step))?>
range_full
<?code start = 1?><?code stop = 11?><?code step = 3?>
<?print list(range(start, stop, step))?>
range_full
<?code start = 0?><?code stop = 5?><?code step = 1?><?code lst = []?><?for i in range(start, stop, step)?><?code lst.append(i * 2)?><?end for?>
<?print lst?>
range_full
<?code start = 10?><?code stop = 20?><?code step = 2?>
<?print list(range(start, stop, step))?>
range_full
<?code start = 5?><?code stop = 15?><?code step = 2?><?code result = 0?><?for i in range(start, stop, step)?><?code result += i?><?end for?>
<?print result?>
range_full
<?code start = 3?><?code end = 12?><?code step = 3?>
<?print list(range(start, end, step))?>
range_full
<?code start = 5?><?code stop = 25?><?code step = 5?><?code my_list = []?><?for i in range(start, stop, step)?><?code my_list.append(i * 2)?><?end for?>
<?print my_list?>
range_full
<?code start = 10?><?code stop = 20?><?code step = 2?><?code my_list = []?><?for i in range(start, stop, step)?><?code my_list.append(i)?><?end for?>
<?print my_list?>
range_full
<?code start = 2?><?code stop = 12?><?code step = 2?><?code result = ""?><?for i in range(start, stop, step)?><?code result += str(i)?><?end for?>
<?print result?>
range_start_stop
<?code start = 0?><?code end = 5?><?code step = 1?><?code result = []?><?for i in range(start, end, step)?><?code result.append(i)?><?end for?>
<?print result?>
range_start_stop
<?code start = 5?><?code stop = 15?><?code step = 3?><?code result = 0?><?for i in range(start, stop, step)?><?code result += i?><?end for?>
<?print result?>
range_start_stop
<?code start = 10?><?code stop = 25?><?code step = 5?><?code result = []?><?for i in range(start, stop, step)?><?code result.append(i * 2)?><?end for?>
<?print result?>
range_start_stop
<?code start = 10?><?code stop = 30?><?code step = 4?><?code result = ''?><?for i in range(start, stop, step)?><?code result += str(i)?><?end for?>
<?print result?>
range_start_stop
<?code start = 2?><?code stop = 12?><?code step = 2?><?code result = []?><?for i in range(start, stop, step)?><?code result.append(i)?><?end for?>
<?print result?>
range_start_stop
<?code start = 5?><?code stop = 15?><?code step = 2?><?code result = 0?><?for i in range(start, stop, step)?><?code result += i?><?end for?>
<?print result?>
range_start_stop
<?code start = 0?><?code stop = 5?><?code step = 1?><?code result = []?><?for i in range(start, stop, step)?><?code result.append(str(i))?><?end for?>
<?print ','.join(result)?>
range_start_stop
<?code start = 10?><?code stop = 25?><?code step = 5?><?code result = ''?><?for i in range(start, stop, step)?><?code result += str(i) + '-'?><?end for?>
<?print result[:-1]?>
range_start_stop
<?code start = 2?><?code stop = 12?><?code step = 3?><?code result = []?><?for i in range(start, stop, step)?><?code result.append(i * i)?><?end for?>
<?print result?>
range_start_stop
<?code stop = 7?><?code result = []?><?for i in range(stop)?><?code result.append(chr(ord('a') + i))?><?end for?>
<?print ''.join(result)?>
range_stop_only
<?code stop = 5?><?code result = []?><?for i in range(stop)?><?code result.append(i * 2)?><?end for?>
<?print result?>
range_stop_only
<?code stop = 10?><?code result = []?><?for i in range(stop)?><?code result.append(str(i))?><?end for?>
<?print ", ".join(result)?>
range_stop_only
<?code stop = 15?><?code result = []?><?for i in range(stop)?><?code result.append(i % 3)?><?end for?>
<?print result?>
range_stop_only
<?code stop = 20?><?code result = []?><?for i in range(stop)?><?code result.append(i // 4)?><?end for?>
<?print result?>
range_stop_only
<?code stop = 5?><?code result = []?><?for i in range(stop)?><?code result.append(chr(ord('a') + i))?><?end for?>
<?print ''.join(result)?>
range_stop_only
<?code stop = 10?><?code result = []?><?for i in range(stop)?><?code result.append(str(i))?><?end for?>
<?print ", ".join(result)?>
range_stop_only
<?code stop = 7?><?code result = []?><?for i in range(stop)?><?code result.append(i * 2)?><?end for?>
<?print result?>
range_stop_only
<?code stop = 15?><?code result = []?><?for i in range(stop)?><?if i % 3 == 0?><?code result.append(i)?><?end if?><?end for?>
<?print result?>
range_stop_only
<?code stop = 20?><?code result = []?><?for i in range(stop)?><?if i % 2 != 0?><?code result.append(i)?><?end if?><?end for?>
<?print sum(result)?>
range_stop_only
<?code items = ['apple', 'banana', 'cherry']?>
<?for (is_first, is_last, item) in isfirstlast(items)?><?if is_first?>First: <?end if?><?print item?><?if is_last?>. Last.<?else?>, <?end if?><?end for?>
isfirstlast
<?code items = ['apple', 'banana', 'cherry']?>
<?for (is_first, is_last, item) in isfirstlast(items)?><?if is_first?>[<?end if?><?print item?><?if is_last?>]<?else?>, <?end if?><?end for?>
isfirstlast
<?code items = ['apple', 'banana', 'cherry']?>
<?for (first, last, item) in isfirstlast(items)?><?if first?><ul><?end if?><li><?print item?></li><?if last?></ul><?end if?><?end for?>
isfirstlast
<?code fruits = ['apple', 'banana', 'cherry']?>
<?for (is_first, is_last, fruit) in isfirstlast(fruits)?><?if is_first?>First: <?end if?><?print fruit?><?if is_last?> (Last)<?end if?><?if not is_last?>, <?end if?><?end for?>
isfirstlast
<?code colors = ['red', 'green', 'blue']?>
<?for (first, last, color) in isfirstlast(colors)?><?print color?><?if not last?>-<?end if?><?end for?>
isfirstlast
<?code weekdays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']?>
<?for (first, last, day) in isfirstlast(weekdays)?><?if first?>Start of week: <?end if?><?print day?><?if last?>. End of week.<?else?>, <?end if?><?end for?>
isfirstlast
<?code items = [1, 2, 3, 4, 5]?>
<?for (first, last, item) in isfirstlast(items)?><?print item?><?if not last?>, <?end if?><?end for?>
isfirstlast
<?code l = ["apple", "banana", "cherry"]?>
<?for (is_first, is_last, item) in isfirstlast(l)?><?if is_first?>First item: <?end if?><?print item?><?if is_last?> (last)<?else?>, <?end if?><?end for?>
isfirstlast
<?code colors = ['red', 'green', 'blue'] ?>
<?for (first, last, color) in isfirstlast(colors)?><?if first?>[<?end if?><?print color?><?if last?>]<?else?>, <?end if?><?end for?>
isfirstlast
<?code fruits = ["apple", "banana", "cherry"]?>
<?for (first, fruit) in isfirst(fruits)?><?if first?>The first fruit is: <?end if?><?print fruit?> <?end for?>
isfirst
<?code week_days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]?>
<?for (is_first, day) in isfirst(week_days)?><?if is_first?>The first day of the week is: <?end if?><?print day?><?end for?>
isfirst
<?code items = [1, 2, 3, 4, 5]?>
<?for (first, item) in isfirst(items)?><?if first?>First item: <?end if?><?print item?><?end for?>
isfirst
<?code colors = ['red', 'green', 'blue'] ?>
<?for (first, color) in isfirst(colors)?><?if first?> <p>The first color is: <?print color?></p> <?end if?><?end for?>
isfirst
<?code weekdays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']?>
<?for (is_first, day) in isfirst(weekdays)?><?if is_first?><?print day.lower()?><?else?><?print day?><?end if?><?end for?>
isfirst
<?code colors = ['red', 'green', 'blue']?>
<?for (first, color) in isfirst(colors)?><?if first?><span style="color: <?print color?>;"><?print color?></span><?else?><?print color?><?end if?><?end for?>
isfirst
<?code fruits = ['apple', 'banana', 'cherry'] ?>
<?for (first, fruit) in isfirst(fruits)?><?if first?>First fruit: <?print fruit?>. <?else?><?print fruit?> <?end if?><?end for?>
isfirst
<?code items = ['apple', 'banana', 'cherry']?>
<?for (is_last, item) in islast(items)?><?print item?><?if is_last?>.<?else?>, <?end if?><?end for?>
islast
<?code names = ['Alice', 'Bob', 'Charlie'] ?>
<?for (last, name) in islast(names)?><?print name?><?if not last?>, <?else?>.<?end if?><?end for?>
islast
<?code colors = ['red', 'green', 'blue'] ?>
<?for (last, color) in islast(colors)?><?print color?><?if not last?> -> <?end if?><?end for?>
islast
<?code data = {1: 'one', 2: 'two', 3: 'three'}?>
<?for (is_last, k) in islast(data.keys())?><?print data[k]?><?if not is_last?>, <?end if?><?end for?>
islast
<?code items = ['apple', 'banana', 'cherry'] ?>
<?for (last, item) in islast(items)?><?print item?><?if not last?> and <?end if?><?end for?>
islast
<?code fruits = ['apple', 'banana', 'cherry', 'date'] ?>
<?for (last, fruit) in islast(fruits)?><li><?print fruit?><?if not last?>, <?end if?></li><?end for?>
islast
<?code colors = ['red', 'green', 'blue'] ?>
<?for (last, color) in islast(colors)?><?print color?><?if not last?>, <?end if?><?end for?>
islast