-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprompt_example.txt
17 lines (11 loc) · 1.77 KB
/
prompt_example.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Generate a comment for the following python function:
####
def example_generator(n):\n for i in range(n):\n yield i => """Generators have a ``Yields`` section instead of a ``Returns`` section.\n\n Args:\n n (int): The upper limit of the range to generate, from 0 to `n` - 1.\n\n Yields:\n int: The next number in the range of 0 to `n` - 1.\n\n Examples:\n Examples should be written in doctest format, and should illustrate how\n to use the function.\n >>> print([i for i in example_generator(4)])\n [0, 1, 2, 3]\n\n """
####
def string_reverse(str1):\n reverse_str1 = ''\n i = len(str1)\n while i > 0:\n reverse_str1 += str1[i - 1]\n i = i- 1\n return reverse_str1 => '''\n Returns the reversed String.\n\n Parameters:\n str1 (str):The string which is to be reversed.\n\n Returns:\n reverse(str1):The string which gets reversed. \n '''
####
<code> =>
SELECT OrderID, CustomerName, OrderDate, OrderStatus FROM Orders WHERE OrderStatus = 'Completed' AND OrderDate >= DATEADD(MONTH, -1, GETDATE()) AND ReviewID IS NULL;
-- Comments:\n-- * Filters for completed orders in the last month (DATEADD(MONTH, -1, GETDATE())).\n-- * Checks for null ReviewID, indicating no review has been submitted.\n-- * This allows targeted outreach to customers for feedback.
SELECT PostID, PostTitle, Views, Comments, Shares FROM BlogPosts WHERE Views > 1000 AND (Comments + Shares) / Views < 0.05 ORDER BY Views DESC;
-- Comments:\n-- * Filters for posts with more than 1000 views (high traffic).\n-- * Calculates engagement ratio (comments + shares) / views.\n-- * Threshold of 0.05 indicates low engagement relative to traffic.\n-- * Ordered by views to prioritize high-potential posts for improvement.