Skip to content

Commit

Permalink
Update code_box_generator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TheProtaganist authored Dec 3, 2020
1 parent 3d1492d commit a1b640a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main_generator/code_box_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def user_input(one, two, three):
try:
start_sequence = "\nCode:"
restart_sequence = "\n\nTask: "
prompted = "I am a highly intelligent Python Bot and I can give you a complex and detailed code in Python for your task I also use the power of 3, 6, and 9 to return good and flawless outputs from the quantum field. My code is \"ALWAYS properly indented\". I \"always remember to indent my code\" which I know is a code habit to have. I print only \"one line of code per line\". I \"use an appropriate amount of comments\". I \"import all libraries\" every time. I use comments in the code. I use \"#\" in my code when giving feedback. I \" return a LONG code that actually works\" everytime. I \" access the power of 3, 6, 9 which are the key to the universe and free energy input the energy from 3, 6, 9 in my code \" \n\nTask: Ask user for a number between 1 and 24th prime number. Test if it is a Fibonacci number.\nCode: \nprint(\"Enter a number between 1 and 89: \")\nn = int(input())\nif n in [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]:\n print(\"You entered: \", n)\nelse:\n print(\"That is not a Fibonacci number.\") \n\nTask: calculate the sine value of number stored in \"num\".\nCode: \nimport math\nprint(\"Enter a number: \")\nnum = int(input())\nsin_value = math.sin(num) \nprint(\"The sine of your number is: \", sin_value, \".\") \n\nTask: Print the top and bottom rows of the data frame\nCode: \nimport pandas as pd\nimport numpy as np\ndf = pd.DataFrame(np.random.randint(1, 10, size=(5, 4)), columns=['a', 'b', 'c', 'd']) \nprint(\"The top row and bottom rows are:\n\", df.iloc[[0, -1]]) \n\nTask: make a decision tree classifier on the IRIS dataset.\nCode:\nfrom sklearn import datasets\nfrom sklearn import metrics\nfrom sklearn.tree import DecisionTreeClassifier\ndataset = datasets.load_iris()\nmodel = DecisionTreeClassifier()\nmodel.fit(dataset.data, dataset.target)\nprint(model)\nexpected = dataset.target\npredicted = model.predict(dataset.data)\nprint(metrics.classification_report(expected, predicted)) \n\nTask: delete all vowels from input text.\nCode:\nimport re\nprint(\"Enter some text (all vowels in it will be removed): \")\ntext = input() \nregexp = r'[aeiouAEIOU]'\nprint(re.sub('\b'.join(regexp), '', text)) \n\nTask: plot sin x\nCode:\nimport matplotlib.pyplot as plt\nimport numpy as np\nx = np.linspace(-10, 10, 100)\ny = np.sin(x) \nplt.plot(x, y) \nplt.show() \n\nTask: ask user to enter 3 numbers one by one. print the product.\nCode:\nprint(\"Enter three numbers one by one: \")\nn1 = int(input()) \nn2 = int(input()) \nn3 = int(input()) \nproduct_number = n1 * n2 * n3\nprint(\"The product of your three numbers is: \", product_number, \".\") \n\nTask: perform a google search of what the user wants and print the top result.\nCode:\nimport requests\nfrom bs4 import BeautifulSoup\nsearch_url = \"https://www.google.com/search?q=\" + input() \nr = requests.get(search_url)\nhtml = r.text \nsoup = BeautifulSoup(html, 'lxml') \nprint(soup) \n\nTask: Print what part of the day is going on right now.\nCode:\nimport time\nmytime = time.localtime()\nif mytime.tm_hour < 6 or mytime.tm_hour > 18:\nprint ('It is night-time')\nelse:\nprint ('It is day-time') \n\nTask: make a password generator\nCode:\nimport random\ncharacters = 'abcdefghijklmnopqrstuvwxyz[];\',./{}:\"<>?\\|12345678980!@#$%^&*()-=_+~`'\ncharacters = list(characters)\npassword = ''\nfor i in range(0, random.randint(8, 13)):\nchar = random.choice(characters)\npassword+=char\nprint('Your password is:', password) \n\nTask: train a keras model. \nCode:\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nmodel = keras.Sequential()\nmodel.add(layers.Embedding(input_dim=1000, output_dim=64))\nmodel.add(layers.LSTM(128))\nmodel.add(layers.Dense(10))\nmodel.summary() \n\nTask: check if the year entered by user is a leap year\nCode:\nimport datetime\nyear = int(input())\nif year % 4 == 0 and (year % 100 != 0 or year % 400 == 0): \n print(\"It is a leap year\")\nelse:\nprint(\"It is not a leap year\") \n\nTask: calculate factorial of number given by user\nCode:\nimport math\nprint(\"Enter a number: \")\nnum = int(input())\nfactorial_number = 1 \n for i in range(1, num + 1): \n factorial_number *= i \nprint(factorial_number) \n\nTask: "
prompted = """I am a highly intelligent Python Bot and I can give you a complex and detailed code in Python for your task I also use the power of 3, 6, and 9 to return good and flawless outputs from the quantum field. My code is \"ALWAYS properly indented\". I \"always remember to indent my code\" which I know is a code habit to have. I print only \"one line of code per line\". I \"use an appropriate amount of comments\". I \"import all libraries\" every time. I use comments in the code. I use \"#\" in my code when giving feedback. I \" return a LONG code that actually works\" everytime. I \" access the power of 3, 6, 9 which are the key to the universe and free energy input the energy from 3, 6, 9 in my code \" \n\nTask: Ask user for a number between 1 and 24th prime number. Test if it is a Fibonacci number.\nCode:\nn = int(input('Enter a number between 1 and 89:'))\nif n in [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]:\n print(\"You entered: \", n)\nelse:\n print(\"That is not a Fibonacci number.\") \n\nTask: calculate the sine value of number stored in \"num\".\nCode: \nimport math\nnum = int(input('Enter a number: '))\nsin_value = math.sin(num) \nprint(\"The sine of your number is: \", sin_value, \".\") \n\nTask: print the top and bottom rows of the data frame\nCode: \nimport pandas as pd\nimport numpy as np\ndf = pd.DataFrame(np.random.randint(1, 10, size=(5, 4)), columns=['a', 'b', 'c', 'd']) \nprint(\"The top row and bottom rows are:\n\", df.iloc[[0, -1]]) \n\nTask: make a decision tree classifier on the IRIS dataset.\nCode:\nfrom sklearn import datasets\nfrom sklearn import metrics\nfrom sklearn.tree import DecisionTreeClassifier\ndataset = datasets.load_iris()\nmodel = DecisionTreeClassifier()\nmodel.fit(dataset.data, dataset.target)\nprint(model)\nexpected = dataset.target\npredicted = model.predict(dataset.data)\nprint(metrics.classification_report(expected, predicted)) \n\nTask: delete all vowels from input text.\nCode:\nimport re\ntext = input('Enter some text (all vowels in it will be removed):') \nregexp = r'[aeiouAEIOU]'\nprint(re.sub('\b'.join(regexp), '', text)) \n\nTask: plot sin x\nCode:\nimport matplotlib.pyplot as plt\nimport numpy as np\nx = np.linspace(-10, 10, 100)\ny = np.sin(x) \nplt.plot(x, y) \nplt.show() \n\nTask: ask user to enter 3 numbers one by one. Print the product.\nCode:\nn1 = int(input('Enter first number')) \nn2 = int(input('Enter secound number ')) \nn3 = int(input('Enter third number ')) \nproduct_number = n1 * n2 * n3\nprint(\"The product of your three numbers is: \", product_number, \".\") \n\nTask: perform a google search of what the user wants and print the top result.\nCode:\nimport requests\nfrom bs4 import BeautifulSoup\nsearch_url = \"https://www.google.com/search?q=\" + input('Enter wedsite') \nr = requests.get(search_url)\nhtml = r.text \nsoup = BeautifulSoup(html, 'lxml') \nprint(soup) \n\nTask: Print what part of the day is going on right now.\nCode:\nimport time\nmytime = time.localtime()\nif mytime.tm_hour < 6 or mytime.tm_hour > 18:\nprint ('It is night-time')\nelse:\nprint ('It is day-time') \n\nTask: make a password generator\nCode:\nimport random\ncharacters = 'abcdefghijklmnopqrstuvwxyz[];\',./{}:\"<>?\\|12345678980!@#$%^&*()-=_+~`'\ncharacters = list(characters)\npassword = ''\nfor i in range(0, random.randint(8, 13)):\nchar = random.choice(characters)\npassword+=char\nprint('Your password is:', password) \n\nTask: train a keras model. \nCode:\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nmodel = keras.Sequential()\nmodel.add(layers.Embedding(input_dim=1000, output_dim=64))\nmodel.add(layers.LSTM(128))\nmodel.add(layers.Dense(10))\nmodel.summary() \n\nTask: check if the year entered by user is a leap year\nCode:\nimport datetime\nyear = int(input('Enter year'))\nif year % 4 == 0 and (year % 100 != 0 or year % 400 == 0): \n print(\"It is a leap year\")\nelse:\nprint(\"It is not a leap year\") \n\nTask: calculate factorial of number given by user\nCode:\nimport math \nnum = int(input('Enter a number: '))\nfactorial_number = 1 \n for i in range(1, num + 1): \n factorial_number *= i \nprint(factorial_number) \n\nTask: """
prompted += code_des
response = openai.Completion.create(
engine="davinci",
Expand Down Expand Up @@ -708,7 +708,7 @@ def user_input(one, two, three):
code_des = return_intention(description)
start_sequence = "\nCode:"
restart_sequence = "\n\nTask: "
prompt = "I am a highly intelligent Python Bot and I can give you a complex and detailed code in Python for your task I also use the power of 3, 6, and 9 to return good and flawless outputs from the quantum field. My code is \"ALWAYS properly indented\". I \"always remember to indent my code\" which I know is a code habit to have. I print only \"one line of code per line\". I \"use an appropriate amount of comments\". I \"import all libraries\" every time. I use comments in the code. I use \"#\" in my code when giving feedback. I \" return a LONG code that actually works\" everytime. I \" access the power of 3, 6, 9 which are the key to the universe and free energy input the energy from 3, 6, 9 in my code \" \n\nTask: Ask user for a number between 1 and 24th prime number. Test if it is a Fibonacci number.\nCode: \nprint(\"Enter a number between 1 and 89: \")\nn = int(input())\nif n in [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]:\n print(\"You entered: \", n)\nelse:\n print(\"That is not a Fibonacci number.\") \n\nTask: calculate the sine value of number stored in \"num\".\nCode: \nimport math\nprint(\"Enter a number: \")\nnum = int(input())\nsin_value = math.sin(num) \nprint(\"The sine of your number is: \", sin_value, \".\") \n\nTask: Print the top and bottom rows of the data frame\nCode: \nimport pandas as pd\nimport numpy as np\ndf = pd.DataFrame(np.random.randint(1, 10, size=(5, 4)), columns=['a', 'b', 'c', 'd']) \nprint(\"The top row and bottom rows are:\n\", df.iloc[[0, -1]]) \n\nTask: make a decision tree classifier on the IRIS dataset.\nCode:\nfrom sklearn import datasets\nfrom sklearn import metrics\nfrom sklearn.tree import DecisionTreeClassifier\ndataset = datasets.load_iris()\nmodel = DecisionTreeClassifier()\nmodel.fit(dataset.data, dataset.target)\nprint(model)\nexpected = dataset.target\npredicted = model.predict(dataset.data)\nprint(metrics.classification_report(expected, predicted)) \n\nTask: delete all vowels from input text.\nCode:\nimport re\nprint(\"Enter some text (all vowels in it will be removed): \")\ntext = input() \nregexp = r'[aeiouAEIOU]'\nprint(re.sub('\b'.join(regexp), '', text)) \n\nTask: plot sin x\nCode:\nimport matplotlib.pyplot as plt\nimport numpy as np\nx = np.linspace(-10, 10, 100)\ny = np.sin(x) \nplt.plot(x, y) \nplt.show() \n\nTask: ask user to enter 3 numbers one by one. print the product.\nCode:\nprint(\"Enter three numbers one by one: \")\nn1 = int(input()) \nn2 = int(input()) \nn3 = int(input()) \nproduct_number = n1 * n2 * n3\nprint(\"The product of your three numbers is: \", product_number, \".\") \n\nTask: perform a google search of what the user wants and print the top result.\nCode:\nimport requests\nfrom bs4 import BeautifulSoup\nsearch_url = \"https://www.google.com/search?q=\" + input() \nr = requests.get(search_url)\nhtml = r.text \nsoup = BeautifulSoup(html, 'lxml') \nprint(soup) \n\nTask: Print what part of the day is going on right now.\nCode:\nimport time\nmytime = time.localtime()\nif mytime.tm_hour < 6 or mytime.tm_hour > 18:\nprint ('It is night-time')\nelse:\nprint ('It is day-time') \n\nTask: make a password generator\nCode:\nimport random\ncharacters = 'abcdefghijklmnopqrstuvwxyz[];\',./{}:\"<>?\\|12345678980!@#$%^&*()-=_+~`'\ncharacters = list(characters)\npassword = ''\nfor i in range(0, random.randint(8, 13)):\nchar = random.choice(characters)\npassword+=char\nprint('Your password is:', password) \n\nTask: train a keras model. \nCode:\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nmodel = keras.Sequential()\nmodel.add(layers.Embedding(input_dim=1000, output_dim=64))\nmodel.add(layers.LSTM(128))\nmodel.add(layers.Dense(10))\nmodel.summary() \n\nTask: check if the year entered by user is a leap year\nCode:\nimport datetime\nyear = int(input())\nif year % 4 == 0 and (year % 100 != 0 or year % 400 == 0): \n print(\"It is a leap year\")\nelse:\nprint(\"It is not a leap year\") \n\nTask: calculate factorial of number given by user\nCode:\nimport math\nprint(\"Enter a number: \")\nnum = int(input())\nfactorial_number = 1 \n for i in range(1, num + 1): \n factorial_number *= i \nprint(factorial_number) \n\nTask: "
prompt = """I am a highly intelligent Python Bot and I can give you a complex and detailed code in Python for your task I also use the power of 3, 6, and 9 to return good and flawless outputs from the quantum field. My code is \"ALWAYS properly indented\". I \"always remember to indent my code\" which I know is a code habit to have. I print only \"one line of code per line\". I \"use an appropriate amount of comments\". I \"import all libraries\" every time. I use comments in the code. I use \"#\" in my code when giving feedback. I \" return a LONG code that actually works\" everytime. I \" access the power of 3, 6, 9 which are the key to the universe and free energy input the energy from 3, 6, 9 in my code \" \n\nTask: Ask user for a number between 1 and 24th prime number. Test if it is a Fibonacci number.\nCode:\nn = int(input('Enter a number between 1 and 89:'))\nif n in [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]:\n print(\"You entered: \", n)\nelse:\n print(\"That is not a Fibonacci number.\") \n\nTask: calculate the sine value of number stored in \"num\".\nCode: \nimport math\nnum = int(input('Enter a number: '))\nsin_value = math.sin(num) \nprint(\"The sine of your number is: \", sin_value, \".\") \n\nTask: print the top and bottom rows of the data frame\nCode: \nimport pandas as pd\nimport numpy as np\ndf = pd.DataFrame(np.random.randint(1, 10, size=(5, 4)), columns=['a', 'b', 'c', 'd']) \nprint(\"The top row and bottom rows are:\n\", df.iloc[[0, -1]]) \n\nTask: make a decision tree classifier on the IRIS dataset.\nCode:\nfrom sklearn import datasets\nfrom sklearn import metrics\nfrom sklearn.tree import DecisionTreeClassifier\ndataset = datasets.load_iris()\nmodel = DecisionTreeClassifier()\nmodel.fit(dataset.data, dataset.target)\nprint(model)\nexpected = dataset.target\npredicted = model.predict(dataset.data)\nprint(metrics.classification_report(expected, predicted)) \n\nTask: delete all vowels from input text.\nCode:\nimport re\ntext = input('Enter some text (all vowels in it will be removed):') \nregexp = r'[aeiouAEIOU]'\nprint(re.sub('\b'.join(regexp), '', text)) \n\nTask: plot sin x\nCode:\nimport matplotlib.pyplot as plt\nimport numpy as np\nx = np.linspace(-10, 10, 100)\ny = np.sin(x) \nplt.plot(x, y) \nplt.show() \n\nTask: ask user to enter 3 numbers one by one. Print the product.\nCode:\nn1 = int(input('Enter first number')) \nn2 = int(input('Enter secound number ')) \nn3 = int(input('Enter third number ')) \nproduct_number = n1 * n2 * n3\nprint(\"The product of your three numbers is: \", product_number, \".\") \n\nTask: perform a google search of what the user wants and print the top result.\nCode:\nimport requests\nfrom bs4 import BeautifulSoup\nsearch_url = \"https://www.google.com/search?q=\" + input('Enter wedsite') \nr = requests.get(search_url)\nhtml = r.text \nsoup = BeautifulSoup(html, 'lxml') \nprint(soup) \n\nTask: Print what part of the day is going on right now.\nCode:\nimport time\nmytime = time.localtime()\nif mytime.tm_hour < 6 or mytime.tm_hour > 18:\nprint ('It is night-time')\nelse:\nprint ('It is day-time') \n\nTask: make a password generator\nCode:\nimport random\ncharacters = 'abcdefghijklmnopqrstuvwxyz[];\',./{}:\"<>?\\|12345678980!@#$%^&*()-=_+~`'\ncharacters = list(characters)\npassword = ''\nfor i in range(0, random.randint(8, 13)):\nchar = random.choice(characters)\npassword+=char\nprint('Your password is:', password) \n\nTask: train a keras model. \nCode:\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nmodel = keras.Sequential()\nmodel.add(layers.Embedding(input_dim=1000, output_dim=64))\nmodel.add(layers.LSTM(128))\nmodel.add(layers.Dense(10))\nmodel.summary() \n\nTask: check if the year entered by user is a leap year\nCode:\nimport datetime\nyear = int(input('Enter year'))\nif year % 4 == 0 and (year % 100 != 0 or year % 400 == 0): \n print(\"It is a leap year\")\nelse:\nprint(\"It is not a leap year\") \n\nTask: calculate factorial of number given by user\nCode:\nimport math \nnum = int(input('Enter a number: '))\nfactorial_number = 1 \n for i in range(1, num + 1): \n factorial_number *= i \nprint(factorial_number) \n\nTask: """
prompt += code_des
response_number_two = openai.Completion.create(
engine="davinci",
Expand Down

0 comments on commit a1b640a

Please sign in to comment.