prompt
stringlengths
14
2.1k
completion
stringlengths
0
10.3k
concept
stringclasses
200 values
<?code string = " Hello, UL4! "?>
<?print string.strip()?>
doc
<?code lines = "Line 1\nLine 2\nLine 3"?>
<?print lines.splitlines()?>
whitespace
<?code text = " This is a string with leading and trailing spaces. "?>
<?print text.strip()?>
whitespace
<?code text = "This is a test string.\n This line is indented.\n This line is more indented."?>
<?print text.splitlines(keepends=True)?>
whitespace
<?code text = " This is a string with leading and trailing whitespace. "?>
<?print text.strip()?>
whitespace
<?code text = "This is a string with\nmultiple lines.\n This line is indented."?>
<?whitespace strip?><?print text?>
whitespace
<?code text = "This is a string with trailing spaces. "?>
<?print text.rstrip()?>
whitespace
<?code text = "This is a string with leading and trailing tabs.\t\t"?>
<?print text.strip('\t')?>
whitespace
<?code text = " This string has leading and trailing spaces. "?>
<?whitespace strip?><?print text?>
whitespace
<?code text = "This is a string with leading and trailing whitespace.\n \t "?>
<?print text.strip()?>
whitespace
<?code text = "This string has\nmultiple lines\nwith different indentation levels.\n "?>
<?whitespace strip?><?print text?>
whitespace
<?code x = 10?><?code y = 20?><?def outer(z)?><?def inner()?>
<?print x + y + z?><?end def?><?render inner()?><?end def?><?render outer(z=30)?>
lexical_scope
<?code x = 10?><?code y = 20?><?def outer(z)?><?def inner()?><?code a = x + z?>
<?print a + y?><?end def?><?render inner()?><?end def?><?render outer(z=30)?>
lexical_scope
<?code x = 10?><?code y = 20?><?def outer(z)?><?def inner(a)?><?code b = x + y + z + a?>
<?print b?><?end def?><?render inner(a=40)?><?end def?><?render outer(z=30)?>
lexical_scope
<?code outer_var = 'Hello'?><?def outer_func(inner_arg)?><?code x = outer_var + ', ' + inner_arg?>
<?print x?><?end def?><?render outer_func(inner_arg='world!')?>
lexical_scope
<?code x = 'outer'?><?def outer()?><?code x = 'inner'?><?def inner()?>
<?print x?><?end def?><?render inner()?><?print x?><?end def?><?render outer()?>
lexical_scope
<?code a = 1?><?code b = 2?><?def outer()?><?code a = 3?><?def inner()?><?code c = a + b?>
<?print c?><?end def?><?render inner()?><?end def?><?render outer()?>
lexical_scope
<?code x = 10?><?def outer()?><?code y = 20?><?def inner()?><?code z = x + y?>
<?print z?><?end def?><?render inner()?><?end def?><?render outer()?>
lexical_scope
<?code x = 1?><?def f1()?><?code x = 2?><?def f2()?><?code x = 3?><?def f3()?>
<?print x?><?end def?><?render f3()?><?print x?><?end def?><?render f2()?><?print x?><?end def?><?render f1()?>
lexical_scope
<?code outer_var = 10?><?def outer_func(inner_var)?><?def inner_func()?>
<?print outer_var + inner_var?><?end def?><?render inner_func()?><?end def?><?render outer_func(inner_var=5)?>
lexical_scope
<?code a = 10?><?def outer()?><?code b = 20?><?def inner()?>
<?code c = a + b?><?print c?><?end def?><?render inner()?><?end def?><?render outer()?>
lexical_scope
<?code x = 10?><?code y = 5?>
<?print x + y?><?print x - y?><?print x * y?><?print x / y?><?print x // y?><?print x % y?>
arithmetic_operators
<?code x = 10?><?code y = 3?><?code z = 2?>
<?print (x + y) * z?><?print x + y * z?><?print x - y // z?>
arithmetic_operators
<?code x = 12?><?code y = 4?>
<?print x << y?><?print x >> y?>
arithmetic_operators
<?code x = 17?><?code y = 5?>
<?print x & y?><?print x | y?><?print x ^ y?>
arithmetic_operators
<?code x = 10?><?code y = 5?><?code z = 2?>
<?print x * (y + z)?><?print x * y + z?>
arithmetic_operators
<?code x = 10?><?code y = 3?>
<?print x % y?>
arithmetic_operators
<?code x = 12?><?code y = 3?>
<?print x // y?>
arithmetic_operators
<?code x = 10?><?code y = 20?><?code z = 5?>
<?print (x + y) * z?>
arithmetic_operators
<?code x = 17?><?code y = 5?>
<?print x - y?>
arithmetic_operators
<?code x = 100?><?code y = 7?>
<?print x % y?>
arithmetic_operators
<?code x = 10?><?code y = 5?>
<?print x > y?>
comparison_operators
<?code x = 1?><?code y = 0?>
<?print x >= y?>
comparison_operators
<?code x = "apple"?><?code y = "banana"?>
<?print x < y?>
comparison_operators
<?code x = 10?><?code y = 20?><?code z = 10?>
<?print (x < y) and (x == z)?>
comparison_operators
<?code x = True?><?code y = False?>
<?print x != y?>
comparison_operators
<?code x = "apple"?><?code y = "banana"?>
<?print x < y?>
comparison_operators
<?code x = 10?><?code y = 5?>
<?print x > y?>
comparison_operators
<?code x = 1?><?code y = 1?><?code z = 2?>
<?print (x == y) and (x < z)?>
comparison_operators
<?code x = 1?><?code y = 2?><?code z = 3?>
<?print (x < y) and (y < z)?>
comparison_operators
<?code x = True?><?code y = False?>
<?print x or y?>
logical_operators
<?code x = True?><?code y = False?><?code z = True?>
<?print (x and z) or y?>
logical_operators
<?code x = False?><?code y = True?><?code z = False?>
<?print (x or y) and (not z)?>
logical_operators
<?code x = True?><?code y = False?><?code z = 2?>
<?print (x and not y) and (z > 1)?>
logical_operators
<?code x = True?><?code y = False?><?code z = 1?><?code w = 0?>
<?print (x or y) and (z > w)?>
logical_operators
<?code x = 10?><?code y = 5?><?code z = 2?>
<?print (x > y) and (y > z)?>
logical_operators
<?code x = False?><?code y = True?><?code z = False?>
<?print x or y or z?>
logical_operators
<?code x = True?><?code y = False?><?code z = True?>
<?print (x and y) or z?>
logical_operators
<?code x = True?><?code y = False?><?code z = 10?><?code w = 0?>
<?print (x and z) or (y and w)?>
logical_operators
<?code x = True?><?code y = True?><?code z = False?>
<?print (x and y) and (not z)?>
logical_operators
<?code s1 = "apple"?><?code s2 = "pineapple"?>
<?print s1 in s2?>
containment
<?code word = "banana"?><?code letters = ["a", "b", "n"]?>
<?print all(letter in word for letter in letters)?>
containment
<?code needle = "cat"?><?code haystack = "concatenate"?>
<?print needle in haystack?>
containment
<?code word = "programming"?><?code prefix = "pro"?>
<?print word.startswith(prefix)?>
containment
<?code word = "xyzzy"?><?code letter = "z"?>
<?print letter in word?>
containment
<?code sentence = "The quick brown rabbit jumps over the lazy frogs."?><?code word = "fox"?>
<?print word in sentence?>
containment
<?code text = "Hello, world!"?><?code substring = "world"?>
<?print substring in text?>
containment
<?code needles = ["apple", "banana", "cherry"]?><?code haystack = "I like bananas and cherries."?>
<?print any(needle in haystack for needle in needles)?>
containment
<?code my_list = ["apple", "banana", "cherry"]?><?code fruit = "banana"?>
<?print fruit in my_list?>
containment
<?code long_string = "This is a long string with multiple words."?><?code word = "multiple"?>
<?print word in long_string?>
containment
<?code a = 10?><?code b = 5?><?code condition = True?>
<?print a if condition else b?>
conditional_expression
<?code age = 20?><?code adult_age = 18?>
<?print "Adult" if age >= adult_age else "Minor"?>
conditional_expression
<?code is_raining = True?><?code weather = None?>
<?code weather = "Wet" if is_raining else "Dry"?><?print weather?>
conditional_expression
<?code name = "Alice"?><?code greeting = None?><?code is_morning = True?>
<?code greeting = "Good morning, " + name if is_morning else "Hello, " + name?><?print greeting?>
conditional_expression
<?code points = 75?><?code passing_grade = 60?>
<?print "Pass" if points >= passing_grade else "Fail"?>
conditional_expression
<?code age = 20?><?code price = None?><?code adult_age = 18?>
<?code price = 10 if age >= adult_age else 5?><?print price?>
conditional_expression
<?code a = 10?><?code b = 5?><?code result = None?>
<?code result = a if a > b else b?><?print result?>
conditional_expression
<?code name = "Alice"?><?code greeting = None?>
<?code greeting = "Hello, " + name if name else "Hello, Guest"?><?print greeting?>
conditional_expression
<?code x = 10?><?code y = 5?><?code max_val = None?>
<?code max_val = x if x > y else y?><?print max_val?>
conditional_expression
<?code age = 20?><?code status = None?>
<?code status = "Adult" if age >= 18 else "Minor"?><?print status?>
conditional_expression
<?code my_string = "Hello, World!"?><?code sliced_string = None?>
<?code sliced_string = my_string[7:]?><?print sliced_string?>
slicing
<?code my_string = "abcdefghijklmnopqrstuvwxyz"?><?code sliced_string = None?>
<?code sliced_string = my_string[10:20]?><?print sliced_string?>
slicing
<?code my_list = ["apple", "banana", "cherry", "date", "elderberry"]?><?code sliced_list = None?>
<?code sliced_list = my_list[1:4]?><?print sliced_list?>
slicing
<?code my_string = "Hello, World!"?><?code sliced_string = None?>
<?code sliced_string = my_string[:5]?><?print sliced_string?>
slicing
<?code my_string = "This is a test string"?><?code sliced_string = None?>
<?code sliced_string = my_string[10:]?><?print sliced_string?>
slicing
<?code my_string = "Hello, World!"?><?code sliced_string = None?>
<?code sliced_string = my_string[:5]?><?print sliced_string?>
slicing
<?code my_list = ["apple", "banana", "cherry", "date", "elderberry"]?><?code sliced_list = None?>
<?code sliced_list = my_list[1:-1]?><?print sliced_list?>
slicing
<?code my_string = "This is a test string"?><?code sliced = None?>
<?code sliced = my_string[10:]?><?print sliced?>
slicing
<?code fruits = ["apple", "banana", "cherry"]?><?code upper_fruits = None?>
<?code upper_fruits = (f.upper() for f in fruits)?><?print ", ".join(upper_fruits)?>
Generator expressions
<?code colors = ['red', 'green', 'blue'] ?><?code modified_colors = None?>
<?code modified_colors = (c + "-ish" for c in colors)?><?print list(modified_colors)?>
Generator expressions
<?code names = ["Alice", "Bob", "Charlie"]?><?code greetings = None?>
<?code greetings = ("Hello, " + name + "!" for name in names)?><?print "\n".join(greetings)?>
Generator expressions
<?code fruits = ["apple", "banana", "cherry", "date"]?><?code lengths = None?>
<?code lengths = (len(f) for f in fruits)?><?print list(lengths)?>
Generator expressions
<?code numbers = [1, 2, 3, 4, 5]?><?code squares = None?>
<?code squares = (n * n for n in numbers)?><?print list(squares)?>
Generator expressions
<?code colors = ["red", "green", "blue"]?><?code exclaim_colors = None?>
<?code exclaim_colors = (c + "!" for c in colors)?><?print ", ".join(exclaim_colors)?>
Generator expressions
<?code names = ["Alice", "Bob", "Charlie"]?><?code greetings = None?>
<?code greetings = ("Hello, " + name + "!" for name in names)?><?print "\n".join(greetings)?>
Generator expressions
<?code fruits = ["apple", "banana", "cherry"]?><?code lengths = None?>
<?code lengths = (len(fruit) for fruit in fruits)?><?print list(lengths)?>
Generator expressions
<?code numbers = [1, 2, 3, 4, 5]?><?code squares = None?>
<?code squares = (n * n for n in numbers)?><?print list(squares)?>
Generator expressions
<?code person = {"name": "Alice", "age": 30}?>
<?print person.name?>
Attribute access
<?code data = {"name": "John Doe", "city": "New York"}?>
<?print data.city?>
Attribute access
<?code book = {"title": "The Lord of the Rings", "author": "J.R.R. Tolkien"}?>
<?print book.author?>
Attribute access
<?code product = {"name": "Laptop", "brand": "Dell", "price": 1200}?>
<?print product.price?>
Attribute access
<?code person = {"name": "Alice", "age": 30, "occupation": "Software Engineer"}?>
<?print person.occupation?>
Attribute access
<?code car = {"make": "Toyota", "model": "Camry", "year": 2023}?>
<?print car.model?>
Attribute access
<?code book = {"title": "The Lord of the Rings", "author": "J.R.R. Tolkien", "pages": 1178}?>
<?print book.author?>
Attribute access
<?code product = {"name": "Laptop", "brand": "Dell", "price": 1200}?>
<?print product.price?>
Attribute access
<?code person = {"name": "Alice", "age": 30, "city": "New York"}?>
<?print person.city?>
Attribute access
<?code car = {"make": "Toyota", "model": "Camry", "year": 2023}?>
<?print car.model?>
Attribute access
<?code items = ["apple", "banana", "cherry"]?>
<?print len(items)?>
Function calls
<?code product = {"name": "Laptop", "price": 1200, "discount": 0.1}?>
<?print round(product.price * (1 - product.discount))?>
Function calls
<?code values = [1, 2, 3, 4, 5]?>
<?print sum(values)?>
Function calls