prompt
stringlengths
14
2.1k
completion
stringlengths
0
10.3k
concept
stringclasses
200 values
<?code name = 'Bob'?><?def greet(name)?>
Greetings, <?print name?>!<?end def?><?render greet(name=name)?>
render
<?code name = 'Alice'?><?def greet(name)?>
Hi, <?print name?>!<?end def?><?render greet(name)?>
render
<?code names = ['Alice', 'Bob', 'Charlie'] ?><?def greet_person(name)?>Hello, <?print name?>!<?end def?><?for name in names?>
<?render greet_person(name=name)?><?end for?>
render
<?code name = 'World'?><?def greet(name)?>Hello, <?print name?>!<?end def?>
<?render greet(name=name)?>
render
<?code name = 'Bob'?><?def greet(name)?>Hello, <?print name?>!<?end def?>
<?render greet(name)?>
render
<?code items = ['apple', 'banana', 'cherry']?><?def item_template(item)?><li><?print item?></li><?end def?><?for item in items?>
<?render item_template(item=item)?><?end for?>
render
<?code name = 'World'?><?def greet(name)?>Hello, <bold><?print name?></bold>!<?end def?>
<?renderx greet(name=name)?>
renderx
<?code name = 'Alice'?><?def greeting(name)?>Hello, <?print name?>!<?end def?>
<?renderx greeting(name=name)?>
renderx
<?code name = 'Bob'?><?def greet(name)?>Hello, <?print name?>!<?end def?>
<?renderx greet(name=name)?>
renderx
<?code name = 'Charlie'?><?def greet(name='World')?>Hello, <?print name?>!<?end def?>
<?renderx greet()?>
renderx
<?code name = 'David'?><?def g(name)?>Hello, <?print name?><?end def?>
<?renderx g(name=name)?>
renderx
<?code name = 'User'?><?def welcome(name)?>Welcome, <?print name?>!<?end def?>
<?renderx welcome(name)?>
renderx
<?code items = ['apple', 'banana', 'cherry']?><?def item_list(items)?><ul><?for item in items?><li><?print item?><?end for?></ul><?end def?>
<?renderx item_list(items=items)?>
renderx
<?code name = 'Sophia'?><?def greet(name)?>Greetings, <?print name?>.<?end def?>
<?renderx greet(name=name)?>
renderx
<?code name = 'Alex'?><?def hello(name)?>Hello, <?print name?>!<?end def?>
<?renderx hello(name=name)?>
renderx
<?code name = 'Bob'?><?def greet(name)?>Hello, <?print name?>!<?end def?>
<?renderx greet(name=name)?>
renderx
<?code name = 'World'?><?def hello(name)?>Hello, <?print name?>!<?end def?><?code greeting = hello?>
<?render_or_print greeting(name=name)?>
render_or_print
<?code item = {'name': 'orange', 'price': 0.5}?><?def item_template(item)?><div><?print item.name?>: $<?print item.price?></div><?end def?><?code item_renderer = item_template?>
<?render_or_print item_renderer(item=item)?>
render_or_print
<?def my_list(items)?><ul><?for item in items?><li><?print item?></li><?end for?></ul><?end def?>
<?renderblocks my_list(items=['apple', 'banana', 'cherry'])?><?end renderblocks?>
renderblocks
<?def greet(name, greeting='Hello')?><?print greeting?>, <?print name?>!<?end def?>
<?renderblocks greet(name='World')?><?end renderblocks?>
renderblocks
<?def wrapper(content)?><div><?render content()?></div><?end def?>
<?renderblocks wrapper()?><?def content?>Hello, world!<?end def?><?end renderblocks?>
renderblocks
<?def list_items(items)?><ul><?for item in items?><li><?print item?></li><?end for?></ul><?end def?>
<?renderblocks list_items(items=['apple', 'banana', 'cherry'])?><?end renderblocks?>
renderblocks
<?def container(content, tag)?><<?print tag?>><?render content()?></<?print tag?>><?end def?>
<?renderblocks container(tag='p')?><?def content?>This is a paragraph.<?end def?><?end renderblocks?>
renderblocks
<?def greet(name, greeting='Hello')?><?print greeting?>, <?print name?>!<?end def?>
<?renderblocks greet(name='World')?><?end renderblocks?>
renderblocks
<?def wrapper(content)?><div><?render content()?></div><?end def?>
<?renderblock wrapper()?>Content inside a div.<?end renderblock?>
renderblock
<?def strong(content)?><strong><?render content()?></strong><?end def?>
<?renderblock strong()?>This text is strong.<?end renderblock?>
renderblock
<?def p(content, cls='paragraph')?><p class="<?print cls?>"><?render content()?></p><?end def?>
<?renderblock p(cls='info')?>Informational paragraph.<?end renderblock?>
renderblock
<?def wrap(content, tag)?><<?print tag?>><?render content()?></<?print tag?>><?end def?>
<?renderblock wrap(tag='b')?>This is bold text.<?end renderblock?>
renderblock
<?def my_div(content, cls=None)?><div <?if cls?>class="<?print cls?>"<?end if?>><?render content()?></div><?end def?>
<?renderblock my_div(cls='container')?>This text is inside a div with class 'container'.<?end renderblock?>
renderblock
<?def list_item(content, idx)?><li value="<?print idx?>"><?render content()?></li><?end def?>
<?renderblock list_item(idx=1)?>First item in the list.<?end renderblock?>
renderblock
<?def strong(content)?><strong><?render content()?></strong><?end def?>
<?renderblock strong()?>This text is strong.<?end renderblock?>
renderblock
<?def wrap(content, tag)?><<?print tag?>><?render content()?></<?print tag?>><?end def?>
<?renderblock wrap(tag='span')?>This is wrapped in a span.<?end renderblock?>
renderblock
<?def return_text()?>
<?return "Hello, world!"?><?end def?>
return
<?def get_username(user)?><?if user?>
<?return user.name?><?end if?><?return 'Guest'?><?end def?>
return
<?def simple_return()?>
<?return "This is a simple return."?><?end def?>
return
<?def return_concatenated_strings(str1, str2)?>
<?return str1 + str2?><?end def?>
return
<?def return_modified_string(s)?><?code s = s.upper()?>
<?return s?><?end def?>
return
<?def return_substring(s, start, end)?>
<?return s[start:end]?><?end def?>
return
<?def return_first_char(s)?>
<?return s[0]?><?end def?>
return
<?def return_sum(a, b)?>
<?return a + b?><?end def?>
return
<?def return_longer_string(s1, s2)?> <?doc Returns the longer of two strings.?>
<?return s1 if len(s1) > len(s2) else s2?><?end def?>
return
<?def return_string(s)?>
<?return s?><?end def?>
return
<?code name = "World"?>
<?print "Hello, " + name + "!"?>
code
<?code greeting = "Hello"?><?code name = "World"?>
<?print greeting + ", " + name + "!"?>
code
<?code s = "Hello"?><?code name = "World"?>
<?code greeting = s + ", " + name + "!"?><?print greeting?>
code
<?code s1 = "Hello"?><?code s2 = "World"?>
<?code s3 = s1 + ", " + s2 + "!"?><?print s3?>
code
<?code s = "abc"?><?code n = 2?>
<?code result = s * n?><?print result?>
code
<?code s = "Hello"?><?code n = 5?>
<?code result = s * n?><?print result?>
code
<?code s = "Hello, World!"?><?code start = 7?><?code end = 12?>
<?code substring = s[start:end]?><?print substring?>
code
<?code s = "abc"?><?code prefix = "a"?>
<?code result = s.startswith(prefix)?><?print result?>
code
<?code s = "Hello"?><?code old = "l"?><?code new = "x"?>
<?code result = s.replace(old, new)?><?print result?>
code
<?code s = "Hello, World!"?><?code old = "World"?><?code new = "UL4"?>
<?code result = s.replace(old, new)?><?print result?>
code
<?code i = 0?><?code limit = 5?>
<?while i < limit?><?print i?><?code i += 1?><?end while?>
while
<?code i = 0?><?code limit = 10?><?code step = 2?>
<?while i < limit?><?print i?><?code i += step?><?end while?>
while
<?code count = 0?><?code limit = 3?>
<?while count < limit?><?print "Iteration: " + str(count)?><?code count += 1?><?end while?>
while
<?code names = ["Alice", "Bob", "Charlie", "David", "Eve"]?><?code i = 0?><?code found = False?>
<?while i < len(names) and not found?><?if names[i] == "Charlie"?><?code found = True?><?end if?><?print names[i]?><?code i += 1?><?end while?>
while
<?code numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]?><?code i = 0?><?code even_numbers = []?>
<?while i < len(numbers)?><?if numbers[i] % 2 == 0?><?code even_numbers.append(numbers[i])?><?end if?><?code i += 1?><?end while?><?print even_numbers?>
while
<?code text = "hello world"?><?code i = 0?>
<?while i < len(text)?><?print text[i]?><?code i += 1?><?end while?>
while
<?code counter = 0?>
<?while counter < 5?><?print counter?><?code counter += 1?><?end while?>
while
<?code i = 0?><?code limit = 10?><?code result = []?>
<?while i < limit?><?code result.append(i)?><?code i = i + 2?><?end while?><?print result?>
while
<?code names = ["Alice", "Bob", "Charlie"]?><?code i = 0?>
<?while i < len(names)?><?print names[i]?><?if not islast(names, i)?>, <?end if?><?code i += 1?><?end while?>
while
<?code a = 10?><?code b = 0?>
<?while a > b?><?code a -= 1?><?print a?><?end while?>
while
<?code items = ['apple', 'banana', 'orange']?>
<?ignore?><?print items[3]?><?end ignore?><?print items[0]?>
ignore
<?code message = "Hello, world!"?>
<?ignore?><?print message.upper()?><?end ignore?><?print message?>
ignore
<?code names = ['Alice', 'Bob', 'Charlie']?>
<?ignore?><?for name in names?><?print name.lower()?><?end for?><?end ignore?><?for name in names?><?print name.upper()?><?end for?>
ignore
<?code x = 10?><?code y = 20?>
<?ignore?><?print x + y?><?end ignore?><?print x * y?>
ignore
<?code items = ['apple', 'banana', 'cherry']?>
<?ignore?><?print ", ".join(items)?><?end ignore?><?print "; ".join(reversed(items))?>
ignore
<?code fruits = ['apple', 'banana', 'cherry']?>
<?ignore?><?print fruits[0]?><?end ignore?><?if fruits?><?print fruits[-1]?><?end if?>
ignore
<?code name = 'World'?>
<?ignore?><?print 'Hello, ' + name + '!'?><?end ignore?><?print 'Goodbye, ' + name + '!'?>
ignore
<?code x = 10?><?code y = 20?>
<?ignore?><?print x + y?><?end ignore?><?print x * y?>
ignore
<?code items = ['a', 'b', 'c', 'd']?>
<?ignore?><?for i in items?><?print i?><?end for?><?end ignore?><?for i in range(len(items))?><?print items[i]?><?end for?>
ignore
<?code fruits = ['apple', 'banana', 'cherry']?>
<?ignore?><?print fruits[0]?><?end ignore?><?print fruits[1]?>
ignore
<?code name = "UL4 Templating Language"?>
<?print name.upper()?>
ul4
<?code s = "Hello, world!"?>
<?print s[7:]?>
ul4
<?code strings = ['hello', 'world', 'ul4'] ?>
<?print ''.join(strings)?>
ul4
<?code s = " Hello, UL4! "?>
<?print s.strip()?>
ul4
<?code s = "UL4 is a templating language"?>
<?print s.replace("templating", "cool")?>
ul4
<?code s = "hello"?>
<?print s.upper()?>
ul4
<?code s = "hello"?><?code n = 2?>
<?print s * n?>
ul4
<?code s = "hello"?><?code suffix = " world"?>
<?print s + suffix?>
ul4
<?code s = " Hello, world! "?>
<?print s.strip()?>
ul4
<?code s = "hello"?><?code n = 5?><?code prefix = "world"?>
<?print prefix + s * n?>
ul4
<?code note = "This code calculates the factorial of a number."?>
<?note?><?print note?><?end note?>
note
<?code explanation = "This template demonstrates nested notes."?>
<?note?>This is the outer note. <?note?>This is an inner note.<?end note?><?end note?>
note
<?code note1 = "This is the first note."?><?code note2 = "This is the second note."?>
<?note?><?print note1?><?end note?><?note?><?print note2?><?end note?>
note
<?code note = "This note contains a \"quoted\" string."?>
<?note?><?print note?><?end note?>
note
<?code note = "This note demonstrates nested notes."?><?code inner_note = "This is a note within a note."?>
<?note?><?print note?><?note?><?print inner_note?><?end note?><?end note?>
note
<?code note = "This note contains escaped quotes: \"\"."?>
<?note?><?print note?><?end note?>
note
<?code note1 = "First note"?><?code note2 = "Second note"?>
<?note?><?print note1?><?end note?><?note?><?print note2?><?end note?>
note
<?code note = "This is a multi-line\nnote."?>
<?note?><?print note?><?end note?>
note
<?code note = "This note has some <strong>HTML</strong> inside."?>
<?note?><?print note?><?end note?>
note
<?code strings = ["apple", "banana", "cherry"]?>
<?print ", ".join(strings)?>
doc
<?code string = " Hello, World! "?>
<?print string.strip()?>
doc
<?code string = "Hello, World!"?>
<?print string[7:]?>
doc
<?code string = "hello"?>
<?print string.upper()?>
doc
<?code string = "Hello, World!"?><?code substring = "World"?>
<?print string.find(substring)?>
doc
<?code string = " Hello, World! "?>
<?print string.strip()?>
doc
<?code string = "Hello, World!"?><?code old = "World"?><?code new = "UL4"?>
<?print string.replace(old, new)?>
doc
<?code string = "Hello"?><?code repeat_count = 3?>
<?print string * repeat_count?>
doc
<?code string = "apple,banana,orange"?><?code separator = ","?>
<?print string.split(separator)?>
doc