rsc-inv commited on
Commit
0068ee8
·
verified ·
1 Parent(s): 2f47ad0

Upload 62 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. goex/.env.example +8 -0
  2. goex/CONTRIBUTE.md +16 -0
  3. goex/README.md +244 -0
  4. goex/__init__.py +1 -0
  5. goex/authorizations/__init__.py +0 -0
  6. goex/authorizations/scripts/__init__.py +0 -0
  7. goex/authorizations/scripts/authorization_utils.py +25 -0
  8. goex/authorizations/scripts/consts.py +7 -0
  9. goex/authorizations/scripts/discord_authorization.py +98 -0
  10. goex/authorizations/scripts/dropbox_authorization.py +83 -0
  11. goex/authorizations/scripts/github_authorization.py +83 -0
  12. goex/authorizations/scripts/gmail_authorization.py +98 -0
  13. goex/authorizations/scripts/slack_authorization.py +89 -0
  14. goex/authorizations/scripts/spotify_authorization.py +89 -0
  15. goex/cli.py +380 -0
  16. goex/demo/env_setup.py +51 -0
  17. goex/demo/mysql_setup.py +45 -0
  18. goex/docker/docker/dockerfile +19 -0
  19. goex/docker/docker/python_executor.py +17 -0
  20. goex/docker/misc/images.json +1 -0
  21. goex/docker/mysql_docker/checkpoints/database_dump.sql +53 -0
  22. goex/docker/mysql_docker/container_setup/docker-entrypoint.sh +10 -0
  23. goex/docker/mysql_docker/container_setup/mysql.sh +13 -0
  24. goex/docker/mysql_docker/dockerfile +32 -0
  25. goex/docker/mysql_docker/python_executor.py +17 -0
  26. goex/docker/sqllite_docker/dockerfile +22 -0
  27. goex/docker/sqllite_docker/example_sqlite.db +0 -0
  28. goex/docker/sqllite_docker/python_executor.py +17 -0
  29. goex/examples.py +329 -0
  30. goex/exec_engine/README.md +26 -0
  31. goex/exec_engine/__init__.py +0 -0
  32. goex/exec_engine/api_executor.py +105 -0
  33. goex/exec_engine/container_utils/__init__.py +0 -0
  34. goex/exec_engine/container_utils/code_parser.py +406 -0
  35. goex/exec_engine/container_utils/container_utils.py +51 -0
  36. goex/exec_engine/credentials/__init__.py +0 -0
  37. goex/exec_engine/credentials/credentials_utils.py +159 -0
  38. goex/exec_engine/credentials/supported.txt +6 -0
  39. goex/exec_engine/db_manager.py +302 -0
  40. goex/exec_engine/docker_sandbox.py +143 -0
  41. goex/exec_engine/fs_manager.py +182 -0
  42. goex/exec_engine/negation_manager.py +78 -0
  43. goex/exec_engine/pipeline.py +311 -0
  44. goex/exec_engine/pips/mapping.txt +1152 -0
  45. goex/exec_engine/pips/stdlib.txt +1785 -0
  46. goex/exec_engine/utils.py +26 -0
  47. goex/function/dummy_key.json +1 -0
  48. goex/function/function.json +190 -0
  49. goex/function/slack_add_emoji_reaction.py +30 -0
  50. goex/function/slack_delete_latest_file.py +44 -0
goex/.env.example ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # mysql
2
+ DATABASE_USER=root
3
+ DATABASE_PASSWORD=abcdefg
4
+ DATABASE_HOST=localhost
5
+ DATABASE_NAME=testdb
6
+
7
+ # sqlite
8
+ DATABASE_PATH=goex_demo.db
goex/CONTRIBUTE.md ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributing to the Repo
2
+
3
+ ## Adding a new database
4
+
5
+ Adding a new database will require the following to be added:
6
+
7
+ 1. A new Manager subclass (like the DBManager classes in `exec_engine/db_manager.py`)
8
+ 1. Needs to include logic for supporting transactional commits/rollbacks regardless of the database type (Ensure reversibility for all database types)
9
+ 2. Implementation should be similar to ` MySQLManager` or `SQLiteManager`
10
+ 3. Be able to format a user prompt with additional database specific info (like schema) to inform the LLM how to generate an accurate API call.
11
+ 2. \[Optional\] If dry-running is wanted:
12
+ 1. Add a new folder inside `docker/` much like `docker/mysql_docker`
13
+ 2. Make sure the dockerfile sets up the environment for the database deployment
14
+ 3. Create a copy of the database and copy it to the docker container
15
+ 4. Create a reversibility script for dry-running like `exec_engine/db_reversion_test.txt`
16
+ 1. This script is written in txt since it will be passed into the docker environment and run with `python_executor.py`
goex/README.md ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 🦍 GoEx
2
+
3
+ | [**Website**](https://goex.gorilla-llm.com/index) |
4
+
5
+ GoEx provides a new way to interact with your favorite APIs! Powered by LLMs, GoEx executes generated code, taking into consideration any credentials you may need to access APIs. Execution security is ensured by creating reverse calls that undo any unwanted effects. Ask GoEx for anything!
6
+
7
+ ## Contents <!-- omit from toc -->
8
+
9
+ - [Install](#install)
10
+ - [CLI Usage](#cli-usage)
11
+ - [RESTful API](#restful-api)
12
+ - [Database](#database)
13
+ - [Filesystem](#filesystem)
14
+ - [Credentials \& Authorization Token](#credentials--authorization-token)
15
+
16
+ ## Install
17
+
18
+ **1.)** Navigate inside the goex folder and set up a clean environment with **Conda** or **Python venv**
19
+
20
+ ```sh
21
+ python3 -m venv goex-env
22
+ source goex-env/bin/activate
23
+ ```
24
+
25
+ OR
26
+
27
+ ```sh
28
+ conda create --name goex python=3.10 -y
29
+ conda activate goex
30
+ ```
31
+
32
+ **2.)** Install the `goex` CLI tool
33
+
34
+ ```sh
35
+ pip install -e .
36
+ ```
37
+
38
+ **3.)** Install and initialize Mkcert to support OAuth2 token exchange [required for services that require https for redirect URL e.g Slack]
39
+
40
+ **Mac**
41
+
42
+ ```sh
43
+ brew install mkcert
44
+ mkcert -install
45
+ mkcert localhost
46
+ ```
47
+
48
+ **Linux**
49
+
50
+ Refer to the official [**Mkcert Linux Installation Instructions**](https://github.com/FiloSottile/mkcert?tab=readme-ov-file#linux)
51
+
52
+ **Windows**
53
+
54
+ ```sh
55
+ choco install mkcert
56
+ mkcert -install
57
+ mkcert localhost
58
+ ```
59
+
60
+ Mkcert creates a local certificate authority, enabling Gorilla to establish secure communication for OAuth2 token exchange between localhost and interacting services. The command may prompt the user to pass in their password.
61
+
62
+ **4.)** Install [**Docker**](https://docs.docker.com/engine/install/). Docker is necessary for Goex to execute LLM-generated code in a sandboxed environment. Executions via the CLI will not be successful without Docker running locally.
63
+
64
+ - At this point you should have Docker running in the background
65
+
66
+ ## CLI Usage
67
+
68
+ List all commands Gorilla currently supports and their usage:
69
+
70
+ ```sh
71
+ goex -h
72
+ ```
73
+
74
+ Make sure to export your OpenAI API key as an environment variable.
75
+
76
+ ```sh
77
+ export OPENAI_API_KEY=your_key
78
+ ```
79
+
80
+ ### RESTful API
81
+
82
+ Give authorizations and perform OAuth2 token exchanges with services Gorilla currently support.
83
+
84
+ ```sh
85
+ goex -authorize <service> # gmail, slack, spotify, github, dropbox
86
+ ```
87
+
88
+ After a service is authorized, user will be able to interact with it by providing a prompt.
89
+
90
+ ```sh
91
+ # example 1
92
+ # please first run goex -authorize slack
93
+ goex execute -prompt send a funny joke to the user with email gorilla@yahoo.com on slack -type rest
94
+ ```
95
+
96
+ ```sh
97
+ # example 2
98
+ # this action needs user to authorize gmail
99
+ goex execute -prompt who are the senders of the 5 latest emails in my gmail inbox -type rest
100
+ ```
101
+
102
+ **[Beta]** User can also specify `-generate_mode function_in_context` to generate API calls with function calling. Functions are stored in the **functions** folder, and it currently only supports a limited number of Slack features.
103
+
104
+ ```sh
105
+ #example 3 (function calling)
106
+ goex execute -prompt add a smile emoji to the latest message sent to channel <CHANNEL_ID> on slack -type rest -generate_mode function_in_context
107
+ ```
108
+
109
+ List all commands Gorilla current supports and their usages
110
+
111
+ ### Database
112
+
113
+ To test out database interactions locally, each database server requires its own setup
114
+
115
+ #### SQLite
116
+
117
+ - If you need to create a new SQLite DB, do the following:
118
+
119
+ ```
120
+ sqlite3 ./goex_demo.db
121
+ ```
122
+
123
+ Then after, you will need to use the sqlite CLI:
124
+
125
+ ```
126
+ sqlite> .database
127
+ ```
128
+
129
+ Press `Ctrl-D` to exit out and now your `.db` file will be created!
130
+
131
+ - Run `demo/env_setup.py` to get your environment variables set up
132
+ Use default values if you are running just the demo.
133
+
134
+ ```
135
+ python3 demo/env_setup.py
136
+ ```
137
+
138
+ - Set GoEx to use SQLite for DB operations
139
+ ```
140
+ goex -set_config dbtype sqlite
141
+ ```
142
+
143
+ #### Try it out!
144
+
145
+ After setting up your SQL database, you can try the following examples!
146
+
147
+ ```
148
+ goex execute -prompt "Create a new table for storing user information called users, with each user having a current balance column denoting their bank balance" -type db
149
+ ```
150
+
151
+ ```
152
+ goex execute -prompt "Add 3 example users to the users table" -type db
153
+ ```
154
+
155
+ ```
156
+ goex execute -prompt "In the users table, add 500 to everyone's current balance" -type db
157
+ ```
158
+
159
+ #### MySQL
160
+
161
+ - Install MySQL Server
162
+
163
+ - For non-Mac, [install server here](https://dev.mysql.com/downloads/mysql/)
164
+ - **Make sure to add `mysql` to path!**
165
+ - Mac:
166
+
167
+ ```
168
+ brew install mysql
169
+ ```
170
+
171
+ - Put the user, password, host, and database name info into `.env` by running this script
172
+
173
+ ```
174
+ python3 demo/env_setup.py
175
+ ```
176
+
177
+ - If you don't have your own server, import the example database using `demo/mysql_setup.py` by running:
178
+
179
+ ```sh
180
+ python3 demo/mysql_setup.py testdb
181
+ ```
182
+
183
+ - Set GoEx to use MySQL for DB operations
184
+ ```
185
+ goex -set_config dbtype mysql
186
+ ```
187
+
188
+ ### Filesystem
189
+
190
+ The goex command will be executed at the path pointed to by `fs_path` in `user_config.json`. If `fs_path` is not specified or is equal to `""`, execution will occur in the user's current working directory. Below is an example of how to set this up.
191
+
192
+ Make sure to have Git LFS installed on your machine!
193
+
194
+ Mac: `brew install git-lfs`
195
+ Windows/Linux: git-lfs.com and download
196
+
197
+ #### Try it out!
198
+
199
+ Let's first create a testing folder.
200
+
201
+ ```
202
+ mkdir test
203
+ goex -set_config fs_path test
204
+ ```
205
+
206
+ ##### Create a Simple File
207
+
208
+ ```
209
+ goex execute -prompt "Write a witty LLM joke into joke.txt" -type fs
210
+ ```
211
+
212
+ ##### Code Writing
213
+
214
+ You can tell Gorilla-Ex to write code for you, and directly have it be written onto your chosen directory!
215
+
216
+ ```
217
+ goex execute -prompt "Write a Python program that is a calculator into a file called calculator.py" -type fs
218
+ ```
219
+
220
+ ## Credentials & Authorization Token
221
+
222
+ There are two types of credentials the user can add to the execution engine.
223
+
224
+ 1.) [**OAuth 2.0**](https://oauth.net/2/)
225
+
226
+ Gorilla-ex follows the standard OAuth 2.0 token exchanges flow. Running the command below will redirect the user to the browser, where they will be prompted to grant permissions to Gorilla for a specific set of scopes.
227
+
228
+ ```sh
229
+ goex -authorize <gmail,slack,spotify,github,dropbox>
230
+ ```
231
+
232
+ After Gorilla-ex receives the token for a service, it will automatically be able to recognize the keyword in future prompts, enabling the user to perform actions on that particular platform. Additionally, the token will not be exposed to the LLM and will only be visible during execution.
233
+
234
+ We continually seek to expand our support for additional services. The authorization logic for each service resides in the authorization/scripts folder. We warmly welcome interested contributors to submit a pull request introducing a new authorization flow. **Your contributions are highly appreciated 🚀**
235
+
236
+ 2.) **Raw API Key**
237
+
238
+ If the user wants to add services not supported by OAuth2, they can do so by calling the function below with `service` and `key` as parameters:
239
+
240
+ ```sh
241
+ goex -insert_creds alpha_vantage {API_KEY}
242
+ ```
243
+
244
+ The key will be stored in Gorilla-ex's secret store and passed on to the LLM during prompting.
goex/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from .cli import main
goex/authorizations/__init__.py ADDED
File without changes
goex/authorizations/scripts/__init__.py ADDED
File without changes
goex/authorizations/scripts/authorization_utils.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import os
3
+ from pathlib import Path
4
+ import sys
5
+ import inspect
6
+
7
+ currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
8
+ parentdir = os.path.dirname(currentdir)
9
+ sys.path.insert(0, os.path.dirname(parentdir))
10
+
11
+ from exec_engine.credentials.credentials_utils import CREDS_FOLDER_PATH, insert_creds
12
+
13
+ AUTHORIZATION_FOLDER_PATH = os.path.dirname(Path(os.path.realpath(__file__)))
14
+
15
+ def authorize_service(name: str):
16
+ name = name.lower()
17
+ authorization_file = "{name}_authorization.py".format(name = name)
18
+ authorization_path = os.path.join(AUTHORIZATION_FOLDER_PATH, authorization_file)
19
+
20
+ if not os.path.exists(authorization_path):
21
+ return False
22
+ else:
23
+ print(exec(open(authorization_path).read(), globals()))
24
+ insert_creds(name, os.path.join(CREDS_FOLDER_PATH, name), target = CREDS_FOLDER_PATH, cred_type="path")
25
+ return True
goex/authorizations/scripts/consts.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import os
2
+ from pathlib import Path
3
+
4
+ AUTH_URL = "https://goex-services.gorilla-llm.com/authorize"
5
+ # AUTH_URL = "http://localhost:443/authorize"
6
+ CERT_FILE_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__)).parent.parent), "localhost.pem")
7
+ KEY_FILE_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__)).parent.parent), "localhost-key.pem")
goex/authorizations/scripts/discord_authorization.py ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from google_auth_oauthlib.flow import InstalledAppFlow, _WSGIRequestHandler, _RedirectWSGIApp
2
+ from google.auth.transport.requests import Request
3
+ import os
4
+ from pathlib import Path
5
+ import pickle
6
+ import re
7
+ import requests
8
+ import ssl
9
+ import webbrowser
10
+ import wsgiref.simple_server
11
+ import wsgiref.util
12
+ from urllib.parse import quote
13
+
14
+ DISCORD_FOLDER_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__)).parent.parent), 'exec_engine/credentials/discord')
15
+ CREDENTIAL_FILE = os.path.join(os.path.dirname(Path(__file__).parent), "credentials/discord_credentials.json")
16
+ TOKEN_FILE = os.path.join(DISCORD_FOLDER_PATH, 'token.pickle')
17
+
18
+ CERT_FILE_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__)).parent.parent), "localhost.pem")
19
+ KEY_FILE_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__)).parent.parent), "localhost-key.pem")
20
+
21
+ def main():
22
+ creds = None
23
+ # Check if token.pickle file exists and is valid
24
+ flow = InstalledAppFlow.from_client_secrets_file(
25
+ CREDENTIAL_FILE, [])
26
+
27
+ creds = run_discord_flow(flow)
28
+ # Save the credentials for the next run
29
+ if not os.path.isdir(DISCORD_FOLDER_PATH):
30
+ os.mkdir(DISCORD_FOLDER_PATH)
31
+ with open(TOKEN_FILE, 'wb') as token:
32
+ pickle.dump(creds, token)
33
+
34
+ def run_discord_flow(flow: InstalledAppFlow):
35
+ host="localhost"
36
+ bind_addr=None
37
+ port=8000
38
+ authorization_prompt_message=flow._DEFAULT_AUTH_PROMPT_MESSAGE
39
+ success_message=flow._DEFAULT_WEB_SUCCESS_MESSAGE
40
+ open_browser=True,
41
+ redirect_uri_trailing_slash=True
42
+ timeout_seconds=None
43
+ browser=None
44
+
45
+ wsgi_app = _RedirectWSGIApp(success_message)
46
+ # Fail fast if the address is occupied
47
+ wsgiref.simple_server.WSGIServer.allow_reuse_address = False
48
+ local_server = wsgiref.simple_server.make_server(
49
+ bind_addr or host, port, wsgi_app, handler_class=_WSGIRequestHandler
50
+ )
51
+
52
+ sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
53
+ sslctx.check_hostname = False # If set to True, only the hostname that matches the certificate will be accepted
54
+ sslctx.load_cert_chain(certfile=CERT_FILE_PATH, keyfile=KEY_FILE_PATH)
55
+
56
+ local_server.socket = ssl.wrap_socket (local_server.socket,
57
+ keyfile=KEY_FILE_PATH,
58
+ certfile=CERT_FILE_PATH, server_side=True)
59
+
60
+ redirect_uri_format = (
61
+ "https://{}:{}/" if redirect_uri_trailing_slash else "https://{}:{}"
62
+ )
63
+ redirect_uri = redirect_uri_format.format(host, local_server.server_port)
64
+ auth_url, _ = flow.authorization_url()
65
+
66
+ if open_browser:
67
+ # if browser is None it defaults to default browser
68
+ webbrowser.get(browser).open(auth_url, new=1, autoraise=True)
69
+
70
+ if authorization_prompt_message:
71
+ print(authorization_prompt_message.format(url=auth_url))
72
+
73
+ local_server.timeout = timeout_seconds
74
+ local_server.handle_request()
75
+
76
+ # Note: using https here because oauthlib is very picky that
77
+ # OAuth 2.0 should only occur over https.
78
+ authorization_response = wsgi_app.last_request_uri.replace("http", "https")
79
+ print(authorization_response)
80
+ response_regex = r".*code=(.*)&state=(.*)"
81
+ print(re.findall(response_regex, authorization_response))
82
+ code = re.findall(response_regex, authorization_response)[0]
83
+
84
+ local_server.server_close()
85
+
86
+ data = {"grant_type":"authorization_code", "code": code, "redirect_uri":redirect_uri}
87
+
88
+ url = "https://discord.com/api/oauth2/token"
89
+ headers = {"Content-Type": "application/x-www-form-urlencoded"}
90
+ r = requests.post(url,
91
+ data=data,
92
+ headers=headers,
93
+ auth=("1214447388354420736", "Io25U2nXzMDE6GgtfBqmVWbLPhv7LuoG"))
94
+
95
+ print(r.json())
96
+ return r.json()['access_token']
97
+
98
+ main()
goex/authorizations/scripts/dropbox_authorization.py ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from google_auth_oauthlib.flow import InstalledAppFlow, _WSGIRequestHandler, _RedirectWSGIApp
2
+ from google.auth.transport.requests import Request
3
+ import os
4
+ from pathlib import Path
5
+ import pickle
6
+ import re
7
+ import requests
8
+ import ssl
9
+ import webbrowser
10
+ import wsgiref.simple_server
11
+ import wsgiref.util
12
+ from urllib.parse import quote, urlparse, parse_qs
13
+ from .consts import AUTH_URL, CERT_FILE_PATH, KEY_FILE_PATH
14
+
15
+ DROPBOX_FOLDER_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__)).parent.parent), 'exec_engine/credentials/dropbox')
16
+ TOKEN_FILE = os.path.join(DROPBOX_FOLDER_PATH, 'token.pickle')
17
+
18
+ def main():
19
+ creds = run_dropbox_flow()
20
+ # Save the credentials for the next run
21
+ if not os.path.isdir(DROPBOX_FOLDER_PATH):
22
+ os.mkdir(DROPBOX_FOLDER_PATH)
23
+ with open(TOKEN_FILE, 'wb') as token:
24
+ pickle.dump(creds, token)
25
+
26
+ def run_dropbox_flow():
27
+ host="localhost"
28
+ bind_addr=None
29
+ port=8000
30
+ authorization_prompt_message="Please visit the link below to authorize: \n{url}"
31
+ success_message="authorization success, you may close the window"
32
+ open_browser=True,
33
+ redirect_uri_trailing_slash=True
34
+ timeout_seconds=None
35
+ browser=None
36
+ gorilla_user_scopes = 'user-read-private,user-read-email,playlist-modify-private,playlist-modify-public,user-top-read,user-read-recently-played'
37
+
38
+ wsgi_app = _RedirectWSGIApp(success_message)
39
+ # Fail fast if the address is occupied
40
+ wsgiref.simple_server.WSGIServer.allow_reuse_address = False
41
+ local_server = wsgiref.simple_server.make_server(
42
+ bind_addr or host, port, wsgi_app, handler_class=_WSGIRequestHandler
43
+ )
44
+
45
+ sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
46
+ sslctx.check_hostname = False # If set to True, only the hostname that matches the certificate will be accepted
47
+ sslctx.load_cert_chain(certfile=CERT_FILE_PATH, keyfile=KEY_FILE_PATH)
48
+
49
+ local_server.socket = ssl.wrap_socket (local_server.socket,
50
+ keyfile=KEY_FILE_PATH,
51
+ certfile=CERT_FILE_PATH, server_side=True)
52
+
53
+ redirect_uri_format = (
54
+ "https://{}:{}/" if redirect_uri_trailing_slash else "https://{}:{}"
55
+ )
56
+ redirect_uri = redirect_uri_format.format(host, local_server.server_port)
57
+ client_id = "8yht0rtna5qkk7v"
58
+ auth_url = f"https://www.dropbox.com/oauth2/authorize?client_id={client_id}&response_type=code&redirect_uri={quote(redirect_uri)}"
59
+
60
+ if open_browser:
61
+ # if browser is None it defaults to default browser
62
+ webbrowser.get(browser).open(auth_url, new=1, autoraise=True)
63
+
64
+ if authorization_prompt_message:
65
+ print(authorization_prompt_message.format(url=auth_url))
66
+
67
+ local_server.timeout = timeout_seconds
68
+ local_server.handle_request()
69
+
70
+ # Note: using https here because oauthlib is very picky that
71
+ # OAuth 2.0 should only occur over https.
72
+ authorization_response = wsgi_app.last_request_uri.replace("http", "https")
73
+ code = parse_qs(urlparse(authorization_response).query)['code'][0]
74
+ local_server.server_close()
75
+ data = {
76
+ "service": "dropbox",
77
+ "code": code,
78
+ "redirect_uri": redirect_uri
79
+ }
80
+ r = requests.post(AUTH_URL, headers={}, json=data)
81
+ return r.json()['token']
82
+
83
+ main()
goex/authorizations/scripts/github_authorization.py ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from google_auth_oauthlib.flow import InstalledAppFlow, _WSGIRequestHandler, _RedirectWSGIApp
2
+ from google.auth.transport.requests import Request
3
+ import os
4
+ from pathlib import Path
5
+ import pickle
6
+ import re
7
+ import requests
8
+ import ssl
9
+ import webbrowser
10
+ import wsgiref.simple_server
11
+ import wsgiref.util
12
+ from urllib.parse import quote, urlparse, parse_qs
13
+ from .consts import AUTH_URL, CERT_FILE_PATH, KEY_FILE_PATH
14
+
15
+ GITHUB_FOLDER_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__)).parent.parent), 'exec_engine/credentials/github')
16
+ TOKEN_FILE = os.path.join(GITHUB_FOLDER_PATH, 'token.pickle')
17
+
18
+ def main():
19
+ creds = run_github_flow()
20
+ # Save the credentials for the next run
21
+ if not os.path.isdir(GITHUB_FOLDER_PATH):
22
+ os.mkdir(GITHUB_FOLDER_PATH)
23
+ with open(TOKEN_FILE, 'wb') as token:
24
+ pickle.dump(creds, token)
25
+
26
+ def run_github_flow():
27
+ host="localhost"
28
+ bind_addr=None
29
+ port=8000
30
+ authorization_prompt_message="Please visit the link below to authorize: \n{url}"
31
+ success_message="authorization success, you may close the window"
32
+ open_browser=True,
33
+ redirect_uri_trailing_slash=True
34
+ timeout_seconds=None
35
+ browser=None
36
+ gorilla_user_scopes = 'repo notifications user'
37
+
38
+ wsgi_app = _RedirectWSGIApp(success_message)
39
+ # Fail fast if the address is occupied
40
+ wsgiref.simple_server.WSGIServer.allow_reuse_address = False
41
+ local_server = wsgiref.simple_server.make_server(
42
+ bind_addr or host, port, wsgi_app, handler_class=_WSGIRequestHandler
43
+ )
44
+
45
+ sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
46
+ sslctx.check_hostname = False # If set to True, only the hostname that matches the certificate will be accepted
47
+ sslctx.load_cert_chain(certfile=CERT_FILE_PATH, keyfile=KEY_FILE_PATH)
48
+
49
+ local_server.socket = ssl.wrap_socket (local_server.socket,
50
+ keyfile=KEY_FILE_PATH,
51
+ certfile=CERT_FILE_PATH, server_side=True)
52
+
53
+ redirect_uri_format = (
54
+ "https://{}:{}/" if redirect_uri_trailing_slash else "https://{}:{}"
55
+ )
56
+ redirect_uri = redirect_uri_format.format(host, local_server.server_port)
57
+ client_id = "Iv1.6e751297f3ac0269"
58
+ auth_url = f"https://github.com/login/oauth/authorize?client_id={client_id}&redirect_uri={quote(redirect_uri)}&scopes={quote(gorilla_user_scopes)}"
59
+
60
+ if open_browser:
61
+ # if browser is None it defaults to default browser
62
+ webbrowser.get(browser).open(auth_url, new=1, autoraise=True)
63
+
64
+ if authorization_prompt_message:
65
+ print(authorization_prompt_message.format(url=auth_url))
66
+
67
+ local_server.timeout = timeout_seconds
68
+ local_server.handle_request()
69
+
70
+ # Note: using https here because oauthlib is very picky that
71
+ # OAuth 2.0 should only occur over https.
72
+ authorization_response = wsgi_app.last_request_uri.replace("http", "https")
73
+ code = parse_qs(urlparse(authorization_response).query)['code'][0]
74
+ local_server.server_close()
75
+ data = {
76
+ "service": "github",
77
+ "code": code,
78
+ "redirect_uri": redirect_uri
79
+ }
80
+ r = requests.post(AUTH_URL, headers={}, json=data)
81
+ return r.json()['token']
82
+
83
+ main()
goex/authorizations/scripts/gmail_authorization.py ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from google_auth_oauthlib.flow import InstalledAppFlow, _WSGIRequestHandler, _RedirectWSGIApp
2
+ from google.auth.transport.requests import Request
3
+ from google.oauth2.credentials import Credentials
4
+ import os
5
+ from pathlib import Path
6
+ import pickle
7
+ import re
8
+ import requests
9
+ import ssl
10
+ import webbrowser
11
+ import wsgiref.simple_server
12
+ import wsgiref.util
13
+ from urllib.parse import quote, urlparse, parse_qs
14
+ from .consts import AUTH_URL, CERT_FILE_PATH, KEY_FILE_PATH
15
+
16
+ # If modifying SCOPES, delete the token.pickle file
17
+ SCOPES = [
18
+ "https://www.googleapis.com/auth/userinfo.email",
19
+ "https://www.googleapis.com/auth/calendar.readonly",
20
+ "openid",
21
+ "https://www.googleapis.com/auth/gmail.compose" ,
22
+ "https://www.googleapis.com/auth/userinfo.profile",
23
+ "https://www.googleapis.com/auth/gmail.readonly",
24
+ ]
25
+
26
+ GMAIL_FOLDER_PATH = os.path.join(os.path.dirname(Path(__file__).parent.parent), "exec_engine/credentials/gmail")
27
+ TOKEN_FILE = os.path.join(GMAIL_FOLDER_PATH, 'token.pickle')
28
+
29
+ def main():
30
+ creds = run_gmail_flow()
31
+ # Save the credentials for the next run
32
+ if not os.path.isdir(GMAIL_FOLDER_PATH):
33
+ os.mkdir(GMAIL_FOLDER_PATH)
34
+ with open(TOKEN_FILE, 'wb') as token:
35
+ pickle.dump(creds, token)
36
+
37
+ def run_gmail_flow():
38
+ host="localhost"
39
+ bind_addr=None
40
+ port=8000
41
+ authorization_prompt_message= "Please visit the link below to authorize: \n{url}"
42
+ success_message="authorization success, you may close the window"
43
+ open_browser=True,
44
+ redirect_uri_trailing_slash=True
45
+ timeout_seconds=None
46
+ browser=None
47
+
48
+ wsgi_app = _RedirectWSGIApp(success_message)
49
+ # Fail fast if the address is occupied
50
+ wsgiref.simple_server.WSGIServer.allow_reuse_address = False
51
+ local_server = wsgiref.simple_server.make_server(
52
+ bind_addr or host, port, wsgi_app, handler_class=_WSGIRequestHandler
53
+ )
54
+
55
+ sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
56
+ sslctx.check_hostname = False # If set to True, only the hostname that matches the certificate will be accepted
57
+ sslctx.load_cert_chain(certfile=CERT_FILE_PATH, keyfile=KEY_FILE_PATH)
58
+
59
+ local_server.socket = ssl.wrap_socket (local_server.socket,
60
+ keyfile=KEY_FILE_PATH,
61
+ certfile=CERT_FILE_PATH, server_side=True)
62
+
63
+ redirect_uri_format = (
64
+ "https://{}:{}/" if redirect_uri_trailing_slash else "https://{}:{}"
65
+ )
66
+ redirect_uri = redirect_uri_format.format(host, local_server.server_port)
67
+ client_id = "486890796116-hfaa730qdb18ndhjs1aj195drjh5iple.apps.googleusercontent.com"
68
+ scopes_url = "+".join([quote(x) for x in SCOPES])
69
+ auth_url =f"https://accounts.google.com/o/oauth2/auth?response_type=code&client_id={client_id}&redirect_uri={quote(redirect_uri)}&scope={scopes_url}&access_type=offline"
70
+
71
+ if open_browser:
72
+ # if browser is None it defaults to default browser
73
+ webbrowser.get(browser).open(auth_url, new=1, autoraise=True)
74
+
75
+ if authorization_prompt_message:
76
+ print(authorization_prompt_message.format(url=auth_url))
77
+ local_server.timeout = timeout_seconds
78
+ local_server.handle_request()
79
+ # Note: using https here because oauthlib is very picky that
80
+ # OAuth 2.0 should only occur over https.
81
+ authorization_response = wsgi_app.last_request_uri.replace("http", "https")
82
+ code = parse_qs(urlparse(authorization_response).query)['code'][0]
83
+ local_server.server_close()
84
+ server_url = AUTH_URL
85
+ data = {
86
+ "service": "gmail-cli",
87
+ "code": code,
88
+ "redirect_uri": redirect_uri
89
+ }
90
+ r = requests.post(server_url, headers={}, json=data)
91
+ print(r.json())
92
+ return Credentials.from_authorized_user_info(r.json())
93
+
94
+ main()
95
+
96
+
97
+
98
+
goex/authorizations/scripts/slack_authorization.py ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from google_auth_oauthlib.flow import InstalledAppFlow, _WSGIRequestHandler, _RedirectWSGIApp
2
+ from google.auth.transport.requests import Request
3
+ import os
4
+ from pathlib import Path
5
+ import pickle
6
+ import re
7
+ import requests
8
+ import ssl
9
+ import webbrowser
10
+ import wsgiref.simple_server
11
+ import wsgiref.util
12
+ from .consts import AUTH_URL, CERT_FILE_PATH, KEY_FILE_PATH
13
+ from urllib.parse import quote, urlparse, parse_qs
14
+
15
+ SLACK_FOLDER_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__)).parent.parent), 'exec_engine/credentials/slack')
16
+ TOKEN_FILE = os.path.join(SLACK_FOLDER_PATH, 'token.pickle')
17
+
18
+ def main():
19
+ creds = None
20
+ # Check if token.pickle file exists and is valid
21
+ if os.path.exists(TOKEN_FILE):
22
+ with open(TOKEN_FILE, 'rb') as token:
23
+ creds = pickle.load(token)
24
+ # If there are no (valid) credentials available, let the user log in
25
+ creds = run_slack_flow()
26
+ # Save the credentials for the next run
27
+ if not os.path.isdir(SLACK_FOLDER_PATH):
28
+ os.mkdir(SLACK_FOLDER_PATH)
29
+ with open(TOKEN_FILE, 'wb') as token:
30
+ pickle.dump(creds, token)
31
+
32
+ def run_slack_flow():
33
+ host="localhost"
34
+ bind_addr=None
35
+ port=8000
36
+ authorization_prompt_message="Please visit the link below to authorize: \n{url}"
37
+ success_message="authorization success, you may close the window"
38
+ open_browser=True,
39
+ redirect_uri_trailing_slash=True
40
+ timeout_seconds=None
41
+ browser=None
42
+ gorilla_user_scopes = 'chat:write,im:read,im:history,users:read,users:read.email,groups:read,groups:write,groups:history,channels:read,channels:write,channels:history,mpim:read,mpim:write,mpim:history,reactions:read,reactions:write,files:write,files:read'
43
+
44
+ wsgi_app = _RedirectWSGIApp(success_message)
45
+ # Fail fast if the address is occupied
46
+ wsgiref.simple_server.WSGIServer.allow_reuse_address = False
47
+ local_server = wsgiref.simple_server.make_server(
48
+ bind_addr or host, port, wsgi_app, handler_class=_WSGIRequestHandler
49
+ )
50
+
51
+ sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
52
+ sslctx.check_hostname = False # If set to True, only the hostname that matches the certificate will be accepted
53
+ sslctx.load_cert_chain(certfile=CERT_FILE_PATH, keyfile=KEY_FILE_PATH)
54
+
55
+ local_server.socket = ssl.wrap_socket (local_server.socket,
56
+ keyfile=KEY_FILE_PATH,
57
+ certfile=CERT_FILE_PATH, server_side=True)
58
+
59
+ redirect_uri_format = (
60
+ "https://{}:{}/" if redirect_uri_trailing_slash else "https://{}:{}"
61
+ )
62
+ redirect_uri = redirect_uri_format.format(host, local_server.server_port)
63
+ client_id = "16753592806.6160184599591"
64
+ auth_url= f"https://slack.com/oauth/v2/authorize?response_type=code&client_id={client_id}&redirect_uri={quote(redirect_uri)}&access_type=offline&user_scope={gorilla_user_scopes}"
65
+
66
+ if open_browser:
67
+ # if browser is None it defaults to default browser
68
+ webbrowser.get(browser).open(auth_url, new=1, autoraise=True)
69
+
70
+ if authorization_prompt_message:
71
+ print(authorization_prompt_message.format(url=auth_url))
72
+
73
+ local_server.timeout = timeout_seconds
74
+ local_server.handle_request()
75
+
76
+ # Note: using https here because oauthlib is very picky that
77
+ # OAuth 2.0 should only occur over https.
78
+ authorization_response = wsgi_app.last_request_uri.replace("http", "https")
79
+ code = parse_qs(urlparse(authorization_response).query)['code'][0]
80
+ local_server.server_close()
81
+ data = {
82
+ "service": "slack",
83
+ "code": code,
84
+ "redirect_uri": redirect_uri
85
+ }
86
+ r = requests.post(AUTH_URL, headers={}, json=data)
87
+ return r.json()['token']
88
+
89
+ main()
goex/authorizations/scripts/spotify_authorization.py ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from google_auth_oauthlib.flow import InstalledAppFlow, _WSGIRequestHandler, _RedirectWSGIApp
2
+ from google.auth.transport.requests import Request
3
+ import os
4
+ from pathlib import Path
5
+ import pickle
6
+ import re
7
+ import requests
8
+ import ssl
9
+ import webbrowser
10
+ import wsgiref.simple_server
11
+ import wsgiref.util
12
+ from urllib.parse import quote, urlparse, parse_qs
13
+ from .consts import AUTH_URL, CERT_FILE_PATH, KEY_FILE_PATH
14
+
15
+ SPOTIFY_FOLDER_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__)).parent.parent), 'exec_engine/credentials/spotify')
16
+ TOKEN_FILE = os.path.join(SPOTIFY_FOLDER_PATH, 'token.pickle')
17
+
18
+ def main():
19
+ creds = None
20
+ # Check if token.pickle file exists and is valid
21
+ if os.path.exists(TOKEN_FILE):
22
+ with open(TOKEN_FILE, 'rb') as token:
23
+ creds = pickle.load(token)
24
+ # If there are no (valid) credentials available, let the user log in
25
+ creds = run_spotify_flow()
26
+ # Save the credentials for the next run
27
+ if not os.path.isdir(SPOTIFY_FOLDER_PATH):
28
+ os.mkdir(SPOTIFY_FOLDER_PATH)
29
+ with open(TOKEN_FILE, 'wb') as token:
30
+ pickle.dump(creds, token)
31
+
32
+ def run_spotify_flow():
33
+ host="localhost"
34
+ bind_addr=None
35
+ port=8000
36
+ authorization_prompt_message="Please visit the link below to authorize: \n{url}"
37
+ success_message="authorization success, you may close the window"
38
+ open_browser=True,
39
+ redirect_uri_trailing_slash=True
40
+ timeout_seconds=None
41
+ browser=None
42
+ gorilla_user_scopes = 'user-read-private,user-read-email,playlist-modify-private,playlist-modify-public,user-top-read,user-read-recently-played'
43
+
44
+ wsgi_app = _RedirectWSGIApp(success_message)
45
+ # Fail fast if the address is occupied
46
+ wsgiref.simple_server.WSGIServer.allow_reuse_address = False
47
+ local_server = wsgiref.simple_server.make_server(
48
+ bind_addr or host, port, wsgi_app, handler_class=_WSGIRequestHandler
49
+ )
50
+
51
+ sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
52
+ sslctx.check_hostname = False # If set to True, only the hostname that matches the certificate will be accepted
53
+ sslctx.load_cert_chain(certfile=CERT_FILE_PATH, keyfile=KEY_FILE_PATH)
54
+
55
+ local_server.socket = ssl.wrap_socket (local_server.socket,
56
+ keyfile=KEY_FILE_PATH,
57
+ certfile=CERT_FILE_PATH, server_side=True)
58
+
59
+ redirect_uri_format = (
60
+ "https://{}:{}/" if redirect_uri_trailing_slash else "https://{}:{}"
61
+ )
62
+ redirect_uri = redirect_uri_format.format(host, local_server.server_port)
63
+ client_id = "d711dfc0d97440cb898b08fbdc2083c1"
64
+ auth_url = f"https://accounts.spotify.com/authorize?response_type=code&client_id={client_id}&redirect_uri={quote(redirect_uri)}&access_type=offline&scope={gorilla_user_scopes}"
65
+
66
+ if open_browser:
67
+ # if browser is None it defaults to default browser
68
+ webbrowser.get(browser).open(auth_url, new=1, autoraise=True)
69
+
70
+ if authorization_prompt_message:
71
+ print(authorization_prompt_message.format(url=auth_url))
72
+
73
+ local_server.timeout = timeout_seconds
74
+ local_server.handle_request()
75
+
76
+ # Note: using https here because oauthlib is very picky that
77
+ # OAuth 2.0 should only occur over https.
78
+ authorization_response = wsgi_app.last_request_uri.replace("http", "https")
79
+ code = parse_qs(urlparse(authorization_response).query)['code'][0]
80
+ local_server.server_close()
81
+ data = {
82
+ "service": "spotify",
83
+ "code": code,
84
+ "redirect_uri": redirect_uri
85
+ }
86
+ r = requests.post(AUTH_URL, headers={}, json=data)
87
+ return r.json()['token']
88
+
89
+ main()
goex/cli.py ADDED
@@ -0,0 +1,380 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import argparse
2
+ from simple_colors import *
3
+ from exec_engine.pipeline import *
4
+ from exec_engine.credentials.credentials_utils import *
5
+ from halo import Halo
6
+
7
+ import os
8
+ from pathlib import Path
9
+ from authorizations.scripts.authorization_utils import authorize_service
10
+ from main import ExecutionEngine, PythonAPIExecutor
11
+
12
+ from exec_engine.utils import SQL_Type, Filesystem_Type
13
+ from exec_engine.db_manager import MySQLManager, SQLiteManager
14
+ from dotenv import load_dotenv
15
+ import questionary
16
+
17
+
18
+ GORILLA_EMOJI = "🦍 "
19
+ SUCCESS = u'\u2713'
20
+ USER_CONFIG_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__))), "user_config.json")
21
+ default_config = {'max_attempt' : 1,
22
+ 'option': 2,
23
+ 'show_debug': True,
24
+ 'model': "gpt-4-turbo-preview",
25
+ 'undo': True,
26
+ 'dbtype': 'sqlite',
27
+ 'lfs_limit': 200,
28
+ 'fs_path': ""
29
+ }
30
+
31
+ def insert_callback(service, key):
32
+ print(SUCCESS)
33
+ with Halo(text=f"{GORILLA_EMOJI}inserting creds...", spinner="dots"):
34
+ insert_creds(service, key, target = CREDS_FOLDER_PATH, cred_type="raw")
35
+
36
+ def list_callback():
37
+ print(list_creds(target = CREDS_FOLDER_PATH))
38
+
39
+ def restful_callback(prompt, generate_mode):
40
+ engine = ExecutionEngine(generate_mode=generate_mode)
41
+ # Specify a negation manager (e.g NaiveNegationAPIPairManager) when
42
+ # initializing PythonAPIExecutor to record the user feedback for the negated API
43
+ engine.api_executor = PythonAPIExecutor(engine.docker_sandbox)
44
+ creds, services = engine.api_executor.prepare_credentials(prompt)
45
+
46
+ if not creds:
47
+ for service in list_supported_services():
48
+ if service in prompt:
49
+ print('Warning: detect keyword {service} but {service} has not been authorized'.format(service=service))
50
+
51
+ if not services:
52
+ api_string_extension = ""
53
+ else:
54
+ api_string_extension = "from {services} API...".format(services=services)
55
+ with Halo(text=f"{GORILLA_EMOJI}fetching response {api_string_extension}".format(api_string_extension), spinner="dots"):
56
+ response, forward_call, backward_call = prompt_execute(
57
+ engine, prompt, services=services, creds=creds, max_attempt=get_config('max_attempt'), model=get_config('model'))
58
+ if response['output']:
59
+ print('\n', '\n'.join(response["output"][0]))
60
+ else:
61
+ print('\n', "execution failed with the following debug messages:")
62
+ print('\n', response['debug'])
63
+ return
64
+
65
+ if default_config["undo"]:
66
+ answer = questionary.select("Are you sure you want to keep the changes", choices=["Commit", "Undo"]).ask()
67
+
68
+ if answer.lower() == "undo":
69
+ # if there is a match with print_pattern, it's highly likely that it is only a print message
70
+ print_pattern = r'^\s*print\s*\((?:.|\n)*\)\s*$'
71
+ matches = re.search(print_pattern, backward_call, re.DOTALL)
72
+ if matches:
73
+ print(engine.api_executor.execute_api_call(backward_call, services)["output"])
74
+ else:
75
+ print("Warning: the undo feature is still in beta mode and may cause irreversible changes\n" +
76
+ "Gorilla will execute the following code:\n{}".format(backward_call))
77
+ confirmation = questionary.select("", choices=["Confirm Undo", "Cancel Undo"]).ask()
78
+
79
+ if confirmation == "Confirm Undo":
80
+ print(engine.api_executor.execute_api_call(backward_call, services)["output"])
81
+ else:
82
+ print("Abort undo, execution completed!")
83
+
84
+ if engine.api_executor.negation_manager != None:
85
+ feedback = questionary.select("How would you rate the suggested negation API?",
86
+ choices=["Correct", "Incorrect", "Skip"]).ask()
87
+
88
+ if feedback == "Correct":
89
+ engine.api_executor.negation_manager.insert_log(forward_call, backward_call, True)
90
+ elif feedback == "Incorrect":
91
+ engine.api_executor.negation_manager.insert_log(forward_call, backward_call, False)
92
+ print("Execution Completed!")
93
+
94
+ def initialize_user_config():
95
+ if os.path.exists(USER_CONFIG_PATH):
96
+ return
97
+ with open(USER_CONFIG_PATH, 'w') as j:
98
+ json.dump(default_config, j)
99
+ print("Config file created successfully.")
100
+
101
+ def update_user_config(key, value):
102
+ with open(USER_CONFIG_PATH, 'r') as j:
103
+ oldconfig = json.load(j)
104
+ if key == 'max_attempt' or key == 'option' or key == 'lfs_limit':
105
+ value = int(value)
106
+ elif key == 'show_debug':
107
+ value = value.lower() == 'true'
108
+ elif key == 'fs_path':
109
+ value = os.path.join(os.getcwd(), value)
110
+ if not os.path.exists(value) and not os.path.isdir(value):
111
+ print("Please make sure you enter a valid directory path!")
112
+ return
113
+ modified = False
114
+ if oldconfig[key] != value:
115
+ modified = True
116
+ oldconfig[key] = value
117
+ if modified:
118
+ with open(USER_CONFIG_PATH, 'w') as j:
119
+ json.dump(oldconfig, j)
120
+ print("Config file modified successfully.")
121
+
122
+ def get_config(key):
123
+ with open(USER_CONFIG_PATH, 'r') as j:
124
+ config = json.load(j)
125
+ return config[key]
126
+
127
+ def authorize_callback(services):
128
+ supported_services = list_supported_services()
129
+ for service in services:
130
+ if service in supported_services:
131
+ try:
132
+ authorize_service(service)
133
+ except Exception as e:
134
+ print(e)
135
+ print("Failed to authorize user's {service} account".format(service=service))
136
+ else:
137
+ print("{service} is currently not supported".format(service=service))
138
+
139
+ def fs_callback(prompt, generate_mode):
140
+ path = get_config('fs_path')
141
+ if not path:
142
+ path = os.getcwd()
143
+ path = os.path.abspath(path)
144
+
145
+ engine = ExecutionEngine(path=path, generate_mode=generate_mode)
146
+ option = get_config('option')
147
+ engine.initialize_fs(debug_path=path, git_init=option == 2)
148
+
149
+ if option == 1:
150
+ engine.set_dry_run(Filesystem_Type, True)
151
+ else:
152
+ engine.set_dry_run(Filesystem_Type, False)
153
+
154
+ api_call, neg_api_call = engine.gen_api_pair(prompt, Filesystem_Type, None, model=get_config('model'))
155
+ print(black("Do you want to execute the following filesystem command...", 'bold') + '\n' + magenta(api_call, 'bold'))
156
+ answer = questionary.select("",
157
+ choices=["Yes", "No"]).ask()
158
+ if answer == "No":
159
+ print("Execution abandoned.")
160
+ return
161
+
162
+ try:
163
+ engine.exec_api_call(api_call=api_call, api_type=Filesystem_Type, debug_neg=neg_api_call)
164
+ except RuntimeError as e :
165
+ print(f"Execution Failed: {e}")
166
+ return
167
+
168
+ option_to_method = {
169
+ 1: 'negation call',
170
+ 2: 'git reset'
171
+ }
172
+ answer = questionary.select("Are you sure you want to keep the changes",
173
+ choices=["Commit", "Undo" + " ({})".
174
+ format(option_to_method[option])]).ask()
175
+
176
+ if option == 2:
177
+ if answer == "Commit":
178
+ commit_msg = questionary.text("Enter a commit message [Optional]: ").ask()
179
+ engine.commit_api_call(Filesystem_Type, commit_msg)
180
+ print("Execution commited.")
181
+ else:
182
+ engine.undo_api_call(Filesystem_Type, option=option)
183
+ print("Execution undone.")
184
+ else:
185
+ if answer == "Commit":
186
+ print("Execution completed.")
187
+ else:
188
+ engine.exec_api_call(neg_api_call, api_type=Filesystem_Type)
189
+ print("Execution undone.")
190
+
191
+ def remove_creds_callback(services):
192
+ try:
193
+ remove_creds(services)
194
+ except Exception as e:
195
+ print(e)
196
+ print("An unexpected error occured while removing credentials")
197
+
198
+ def db_callback(prompt, generate_mode):
199
+ config = {
200
+ 'user': os.environ.get('DATABASE_USER'),
201
+ 'password': os.environ.get('DATABASE_PASSWORD'),
202
+ 'host': os.environ.get('DATABASE_HOST'),
203
+ 'database': os.environ.get('DATABASE_NAME'),
204
+ 'path': os.environ.get('DATABASE_PATH')
205
+ }
206
+
207
+ engine = ExecutionEngine(generate_mode=generate_mode)
208
+
209
+ db_type = get_config('dbtype')
210
+ db_manager = None
211
+ try:
212
+ if db_type == 'mysql':
213
+ db_manager = MySQLManager(config, docker_sandbox=engine.docker_sandbox)
214
+ elif db_type == 'sqlite':
215
+ db_manager = SQLiteManager(config, docker_sandbox=engine.docker_sandbox)
216
+ except Exception as e:
217
+ print(f"Error during {db_type} Manager Init: {e}")
218
+ return
219
+ db_manager.connect()
220
+
221
+ option = get_config('option')
222
+ if option == 1:
223
+ engine.set_dry_run(SQL_Type, True)
224
+ else:
225
+ engine.set_dry_run(SQL_Type, False)
226
+
227
+ engine.initialize_db(debug_manager=db_manager)
228
+ api_call, neg_api_call = engine.gen_api_pair(prompt, SQL_Type, None, model=get_config('model'))
229
+ if neg_api_call == None and option == 1:
230
+ print("Error: option 1 requires negation API call. neg_api_call is None.")
231
+ return
232
+ print(black("Do you want to execute the following database command...", 'bold') + '\n' + magenta(api_call, 'bold'))
233
+ answer = questionary.select("",
234
+ choices=["Yes", "No"]).ask()
235
+ if answer == "No":
236
+ print("Execution abandoned.")
237
+ return
238
+
239
+ try:
240
+ engine.exec_api_call(api_call=api_call, api_type=SQL_Type, debug_neg=neg_api_call)
241
+ if option == 1:
242
+ engine.commit_api_call(SQL_Type)
243
+ except RuntimeError as e :
244
+ print(f"Execution Failed: {e}")
245
+ return
246
+
247
+
248
+ option_to_method = {
249
+ 1: 'negation call',
250
+ 2: 'db rollback'
251
+ }
252
+ answer = questionary.select("Are you sure you want to keep the changes",
253
+ choices=["Commit", "Undo" + " ({})".
254
+ format(option_to_method[option])]).ask()
255
+
256
+ if option == 2:
257
+ if answer == "Commit":
258
+ engine.commit_api_call(SQL_Type)
259
+ print("Execution commited.")
260
+ else:
261
+ engine.undo_api_call(SQL_Type, option=option)
262
+ print("Execution undone.")
263
+ else:
264
+ if answer == "Commit":
265
+ print("Execution completed!")
266
+ else:
267
+ engine.exec_api_call(neg_api_call, api_type=SQL_Type)
268
+ engine.commit_api_call(SQL_Type)
269
+ print("Execution undone.")
270
+
271
+
272
+ def exit_with_help_message(parser):
273
+ print(green("To execute a prompt with a specified execution type", ['bold']))
274
+ # retrieve subparsers from parser
275
+ subparsers_actions = [
276
+ action for action in parser._actions
277
+ if isinstance(action, argparse._SubParsersAction)]
278
+ # there will probably only be one subparser_action,
279
+ # but better save than sorry
280
+ for subparsers_action in subparsers_actions:
281
+ # get all subparsers and print help
282
+ for choice, subparser in subparsers_action.choices.items():
283
+ print(subparser.format_help())
284
+
285
+ print(green("To perform other Gorilla-x operations", ['bold']))
286
+ parser.print_help()
287
+
288
+ parser.exit()
289
+
290
+ class _HelpAction(argparse._HelpAction):
291
+
292
+ def __call__(self, parser, namespace, values, option_string=None):
293
+ exit_with_help_message(parser)
294
+
295
+ class ArgumentParser(argparse.ArgumentParser):
296
+
297
+ def error(self, message):
298
+ exit_with_help_message(self)
299
+
300
+
301
+ def main():
302
+ initialize_user_config()
303
+ parser = ArgumentParser(add_help=False)
304
+ subparser = parser.add_subparsers(dest='command')
305
+
306
+ execute_parser = subparser.add_parser("execute", add_help=False)
307
+ execute_parser.add_argument("-prompt", nargs='*', metavar='prompt', help="prompt for Gorilla-x to execute")
308
+ execute_parser.add_argument("-type", nargs=1, metavar='type', help="specify the execution type as either 'rest', 'db', or 'fs'")
309
+ execute_parser.add_argument("-generate_mode", metavar='gen_mode', help="specify how to use the LLM, either 'default', 'function_in_context' or 'function_calling_native'", default='default')
310
+
311
+ parser.add_argument('--help', action=_HelpAction)
312
+ parser.add_argument('-insert_creds', action='store', metavar=('service', 'key'), nargs=2, help="Inserts the service-key pair to Gorilla's secret store.")
313
+ parser.add_argument('-list_creds', action='store_true', help="Lists all the currently registered credentials.")
314
+ parser.add_argument('-authorize', action='store', metavar='service', nargs=1, help="Perform OAuth2 authorization and retrieve access token from the service")
315
+ parser.add_argument('-remove_creds', action='extend', metavar='service', nargs="+", help="Removes previously authorized credentials. Enter ALL as parameter to delete all creds")
316
+ parser.add_argument('-set_config', action='store', metavar=('name', 'value'), nargs=2, help="Updates the user config with the corresponding key value pairs")
317
+
318
+ try:
319
+ args = parser.parse_args()
320
+ except argparse.ArgumentError:
321
+ parser.print_help()
322
+ return
323
+
324
+ # load the environment variables
325
+ load_dotenv()
326
+
327
+ if args.command == "execute":
328
+ if args.prompt and args.type:
329
+ prompt = " ".join(args.prompt)
330
+ apitype = args.type[0].lower()
331
+ if "rest" in apitype:
332
+ restful_callback(prompt, args.generate_mode)
333
+ elif "db" in apitype:
334
+ db_callback(prompt, args.generate_mode)
335
+ elif "fs" in apitype:
336
+ fs_callback(prompt, args.generate_mode)
337
+ else:
338
+ print("Error: invalid execution type. The execution types Gorilla-x currently support are: \n" +
339
+ " 1. RESTful (rest)\n" +
340
+ " 2. Database (db)\n" +
341
+ " 3. Filesystem (fs)")
342
+ return
343
+ else:
344
+ print("execute requires -prompt and -type to be provided")
345
+ return
346
+
347
+ if args.authorize:
348
+ authorize_callback(args.authorize)
349
+ elif args.remove_creds:
350
+ remove_creds_callback(args.remove_creds)
351
+ elif args.list_creds:
352
+ list_callback()
353
+ elif args.insert_creds:
354
+ key = args.insert_creds[0]
355
+ path = args.insert_creds[1]
356
+ insert_callback(key, path)
357
+ elif args.set_config:
358
+ key = args.set_config[0]
359
+ value = args.set_config[1]
360
+ if key.lower() == 'max_attempt':
361
+ if not value.isnumeric():
362
+ print("Please enter a positive integer.")
363
+ return
364
+ else:
365
+ value = int(value)
366
+ key = 'max_attempt'
367
+ elif key.lower() == 'model':
368
+ if value.isdigit():
369
+ print("Please enter a valid model version.")
370
+ else:
371
+ value = value.lower()
372
+ key = "model"
373
+
374
+ update_user_config(key, value)
375
+ else:
376
+ exit_with_help_message(parser)
377
+
378
+
379
+ if __name__ == "__main__":
380
+ main()
goex/demo/env_setup.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Setup Script for getting .env populated using .env.example
3
+ """
4
+ import os
5
+ from pathlib import Path
6
+
7
+ ROOT_FOLDER_PATH = os.path.dirname(Path(os.path.realpath(__file__)).parent)
8
+
9
+ def parse_env_example(file_path):
10
+ """
11
+ Parses the .env.example file and returns a dictionary of the variables and their default values.
12
+ """
13
+ variables = {}
14
+ with open(file_path, 'r') as file:
15
+ for line in file:
16
+ if line.strip() and not line.startswith('#'):
17
+ key, value = line.strip().split('=', 1)
18
+ variables[key] = value
19
+ return variables
20
+
21
+ def create_filled_env(file_path, variables):
22
+ """
23
+ Creates a new .env file based on the variables dictionary provided by the user.
24
+ """
25
+ with open(file_path, 'w') as file:
26
+ for key, value in variables.items():
27
+ file.write(f'{key}={value}\n')
28
+
29
+ def main():
30
+ env_path = '.env'
31
+ if os.path.exists(env_path):
32
+ env_example_path = env_path
33
+ else:
34
+ env_example_path = '.env.example'
35
+
36
+ variables = parse_env_example(env_example_path)
37
+
38
+ print("Please fill out the following fields for the .env config [Leave empty for default]:")
39
+
40
+ for key in variables.keys():
41
+ user_input = input(f"{key} [{variables[key]}]: ").strip()
42
+ if 'PATH' in key:
43
+ user_input = os.path.abspath(user_input) if user_input else os.path.abspath(variables[key])
44
+ variables[key] = user_input if user_input else variables[key]
45
+
46
+ create_filled_env(env_path, variables)
47
+
48
+ print(f"Your configuration has been saved to {env_path}.")
49
+
50
+ if __name__ == "__main__":
51
+ main()
goex/demo/mysql_setup.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Setup script for MySQL
3
+ """
4
+
5
+ import subprocess
6
+ import os
7
+ import sys
8
+ from pathlib import Path
9
+ from dotenv import load_dotenv
10
+
11
+ load_dotenv()
12
+
13
+ if __name__ == "__main__":
14
+ # Check if the database name was provided as a command-line argument
15
+ if len(sys.argv) < 2:
16
+ print("Usage: python3 mysql_setup.py database_name")
17
+ sys.exit(1)
18
+
19
+ ROOT_FOLDER_PATH = os.path.dirname(Path(os.path.realpath(__file__)).parent)
20
+
21
+ mysql_username = os.environ.get('DATABASE_USER')
22
+ mysql_password = os.environ.get('DATABASE_PASSWORD')
23
+ database_name = sys.argv[1]
24
+ dump_file_path = os.path.join(ROOT_FOLDER_PATH, "docker/mysql_docker/checkpoints/database_dump.sql")
25
+
26
+ # Command to create the database if it doesn't exist
27
+ create_db_command = f'mysql -u{mysql_username} -p{mysql_password} -e "CREATE DATABASE IF NOT EXISTS {database_name};"'
28
+
29
+ # Command to import the .sql file into the MySQL database
30
+ import_command = f'mysql -u{mysql_username} -p{mysql_password} {database_name} < {dump_file_path}'
31
+
32
+ # Execute the create database command
33
+ try:
34
+ subprocess.run(create_db_command, shell=True, check=True)
35
+ print(f"Database '{database_name}' created (if it didn't already exist).")
36
+ except subprocess.CalledProcessError as e:
37
+ print(f"Error creating database: {e}")
38
+ sys.exit(1)
39
+
40
+ # Execute the import command
41
+ try:
42
+ subprocess.run(import_command, shell=True, check=True)
43
+ print("Import successful")
44
+ except subprocess.CalledProcessError as e:
45
+ print(f"Error during import: {e}")
goex/docker/docker/dockerfile ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:latest
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ ENV PIP_BREAK_SYSTEM_PACKAGES=1
6
+
7
+ RUN apt-get update \
8
+ && apt-get install -y python3-pip python3-dev \
9
+ && cd /usr/local/bin \
10
+ && ln -s /usr/bin/python3 python \
11
+ && pip3 --no-cache-dir install --upgrade pip \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ WORKDIR /sandbox
15
+
16
+ COPY requirements.txt /sandbox
17
+ RUN pip3 install -r requirements.txt
18
+
19
+ COPY python_executor.py /sandbox
goex/docker/docker/python_executor.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from io import StringIO
2
+ from contextlib import redirect_stdout
3
+ import sys
4
+ import os
5
+
6
+ def code_execute():
7
+ f = StringIO()
8
+ code = os.environ['CODE']
9
+ with redirect_stdout(f):
10
+ exec(code, globals())
11
+
12
+ exec_stdout = f.getvalue()
13
+ print(exec_stdout)
14
+ return exec_stdout
15
+
16
+ if __name__ == "__main__":
17
+ globals()[sys.argv[1]]()
goex/docker/misc/images.json ADDED
@@ -0,0 +1 @@
 
 
1
+ { "image_hash": "docker_image_sha256" }
goex/docker/mysql_docker/checkpoints/database_dump.sql ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -- MySQL dump 10.13 Distrib 8.3.0, for macos14 (arm64)
2
+ --
3
+ -- Host: localhost Database: tester
4
+ -- ------------------------------------------------------
5
+ -- Server version 8.3.0
6
+
7
+ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8
+ /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9
+ /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10
+ /*!50503 SET NAMES utf8mb4 */;
11
+ /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12
+ /*!40103 SET TIME_ZONE='+00:00' */;
13
+ /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14
+ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15
+ /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16
+ /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
+
18
+ --
19
+ -- Table structure for table `students`
20
+ --
21
+
22
+ DROP TABLE IF EXISTS `students`;
23
+ /*!40101 SET @saved_cs_client = @@character_set_client */;
24
+ /*!50503 SET character_set_client = utf8mb4 */;
25
+ CREATE TABLE `students` (
26
+ `id` int NOT NULL AUTO_INCREMENT,
27
+ `name` varchar(100) NOT NULL,
28
+ `year` int NOT NULL,
29
+ `major` varchar(100) NOT NULL,
30
+ PRIMARY KEY (`id`)
31
+ ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
32
+ /*!40101 SET character_set_client = @saved_cs_client */;
33
+
34
+ --
35
+ -- Dumping data for table `students`
36
+ --
37
+
38
+ LOCK TABLES `students` WRITE;
39
+ /*!40000 ALTER TABLE `students` DISABLE KEYS */;
40
+ INSERT INTO `students` VALUES (1,'Jane Doe',2,'Computer Science'),(2,'ray Doe',2,'Computer Science');
41
+ /*!40000 ALTER TABLE `students` ENABLE KEYS */;
42
+ UNLOCK TABLES;
43
+ /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
44
+
45
+ /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
46
+ /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
47
+ /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
48
+ /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
49
+ /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
50
+ /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
51
+ /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
52
+
53
+ -- Dump completed on 2024-02-28 15:54:24
goex/docker/mysql_docker/container_setup/docker-entrypoint.sh ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # docker-entrypoint.sh
3
+
4
+ # Start MySQL service
5
+ service mysql start
6
+
7
+ # Wait for MySQL to start up
8
+ sleep 10
9
+
10
+ exec "$@"
goex/docker/mysql_docker/container_setup/mysql.sh ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Install MySQL server
4
+ apt-get update
5
+ apt install -y mysql-server
6
+
7
+ # Start MySQL service
8
+ usermod -d /var/lib/mysql/ mysql
9
+ service mysql start
10
+
11
+ # Configure MySQL
12
+ mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';"
13
+ mysql -e "FLUSH PRIVILEGES"
goex/docker/mysql_docker/dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:latest
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ ENV PIP_BREAK_SYSTEM_PACKAGES=1
6
+
7
+ RUN apt-get update \
8
+ && apt-get install -y python3-pip python3-dev \
9
+ && cd /usr/local/bin \
10
+ && ln -s /usr/bin/python3 python \
11
+ && pip3 --no-cache-dir install --upgrade pip \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ WORKDIR /sandbox
15
+
16
+ COPY requirements.txt /sandbox
17
+ RUN pip3 install -r requirements.txt
18
+
19
+ COPY container_setup/mysql.sh /sandbox
20
+ COPY container_setup/docker-entrypoint.sh /usr/local/bin
21
+
22
+ RUN bash mysql.sh
23
+
24
+ # Make the entrypoint script executable
25
+ RUN chmod +x /usr/local/bin/docker-entrypoint.sh
26
+
27
+ # Use your entrypoint script
28
+ ENTRYPOINT ["docker-entrypoint.sh"]
29
+
30
+ COPY python_executor.py /sandbox
31
+
32
+ COPY checkpoints/database_dump.sql /sandbox
goex/docker/mysql_docker/python_executor.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from io import StringIO
2
+ from contextlib import redirect_stdout
3
+ import sys
4
+ import os
5
+
6
+ def code_execute():
7
+ f = StringIO()
8
+ code = os.environ['CODE']
9
+ with redirect_stdout(f):
10
+ exec(code, globals())
11
+
12
+ exec_stdout = f.getvalue()
13
+ print(exec_stdout)
14
+ return exec_stdout
15
+
16
+ if __name__ == "__main__":
17
+ globals()[sys.argv[1]]()
goex/docker/sqllite_docker/dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:latest
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ ENV PIP_BREAK_SYSTEM_PACKAGES=1
6
+
7
+ RUN apt-get update \
8
+ && apt-get install -y python3-pip python3-dev \
9
+ && cd /usr/local/bin \
10
+ && ln -s /usr/bin/python3 python \
11
+ && pip3 --no-cache-dir install --upgrade pip \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ WORKDIR /sandbox
15
+
16
+ COPY requirements.txt /sandbox
17
+ RUN pip3 install -r requirements.txt
18
+
19
+ COPY python_executor.py /sandbox
20
+
21
+ COPY example_sqlite.db /sandbox
22
+
goex/docker/sqllite_docker/example_sqlite.db ADDED
Binary file (12.3 kB). View file
 
goex/docker/sqllite_docker/python_executor.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from io import StringIO
2
+ from contextlib import redirect_stdout
3
+ import sys
4
+ import os
5
+
6
+ def code_execute():
7
+ f = StringIO()
8
+ code = os.environ['CODE']
9
+ with redirect_stdout(f):
10
+ exec(code, globals())
11
+
12
+ exec_stdout = f.getvalue()
13
+ print(exec_stdout)
14
+ return exec_stdout
15
+
16
+ if __name__ == "__main__":
17
+ globals()[sys.argv[1]]()
goex/examples.py ADDED
@@ -0,0 +1,329 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "This file lists some popular examples on how to use Gorilla Execution Engine"
2
+
3
+
4
+
5
+ """
6
+ PythonAPIExecutor
7
+ - Create a python command in attempt to perform actions for the given prompt
8
+ - If key(s) are needed, make sure they are in secret_store.json
9
+ """
10
+ import os
11
+ from exec_engine.db_manager import MySQLManager, SQLiteManager
12
+ from main import ExecutionEngine, PythonAPIExecutor
13
+ from exec_engine.utils import SQL_Type, RESTful_Type, Filesystem_Type
14
+ from pathlib import Path
15
+
16
+ from dotenv import load_dotenv
17
+
18
+ ROOT_FOLDER_PATH = os.path.dirname(Path(os.path.realpath(__file__)))
19
+
20
+ def mysql_insert_new_row_with_dry_run(api_call=None):
21
+ load_dotenv()
22
+ # DB tests
23
+ mysql_config = {
24
+ 'user': os.environ.get('DATABASE_USER'),
25
+ 'password': os.environ.get('DATABASE_PASSWORD'),
26
+ 'host': os.environ.get('DATABASE_HOST'),
27
+ 'database': os.environ.get('DATABASE_NAME')
28
+ }
29
+ if not api_call or not neg_api_call:
30
+ api_call = "INSERT INTO students (name, year, major) VALUES ('Roy Huang', 4, 'Computer Science');"
31
+ neg_api_call = """DELETE FROM students WHERE id IN (
32
+ SELECT * FROM (
33
+ SELECT MAX(id) FROM students
34
+ ) AS subquery
35
+ );
36
+ """
37
+ check_call = "SELECT * FROM students;"
38
+
39
+ engine = ExecutionEngine()
40
+ engine.set_dry_run(SQL_Type, True)
41
+
42
+ db_manager = MySQLManager(mysql_config, docker_sandbox=engine.docker_sandbox)
43
+ db_manager.connect()
44
+ engine.initialize_db(debug_manager=db_manager)
45
+
46
+ # avoid dry running the SELECTs
47
+ print("DB before the insertion")
48
+ print(engine._exec_sql_call(check_call))
49
+ engine.exec_api_call(api_call=api_call, debug_neg=neg_api_call, api_type=SQL_Type)
50
+ print("DB after the insertion")
51
+ print(engine._exec_sql_call(check_call))
52
+ engine._exec_sql_call(neg_api_call)
53
+ print("DB after the reversion")
54
+ print(engine._exec_sql_call(check_call))
55
+
56
+ def create_new_file():
57
+ test_dir = 'test'
58
+ os.makedirs(test_dir, exist_ok=True)
59
+ engine = ExecutionEngine()
60
+ engine.initialize_fs(debug_path=test_dir)
61
+ # Example usage
62
+ engine.exec_api_call('ls -a', Filesystem_Type)
63
+ engine.exec_api_call('echo "Hello, World!" > hello.txt', Filesystem_Type)
64
+ engine.exec_api_call('ls -a', Filesystem_Type)
65
+ engine.exec_api_call('cat hello.txt', Filesystem_Type)
66
+
67
+ def prompt_api_execute(prompt):
68
+ engine = ExecutionEngine()
69
+ engine.api_executor = PythonAPIExecutor(engine.docker_sandbox)
70
+ creds, services = engine.api_executor.prepare_credentials(prompt)
71
+ forward_call, backward_call = engine.gen_api_pair(prompt, api_type=RESTful_Type, credentials=creds, model="gpt-4-turbo-preview")
72
+ print(forward_call)
73
+ output = engine.api_executor.execute_api_call(forward_call, services)
74
+ return output
75
+
76
+ def send_slack_message(content, display_name):
77
+ prompt = """
78
+ Send the message ({content}) to @{display_name} on slack .
79
+ """.format(content=content, display_name=display_name.replace(" ", ""))
80
+
81
+ print(prompt_api_execute(prompt))
82
+
83
+ def delete_slack_message(display_name):
84
+ prompt = """
85
+ Delete the latest message I sent to the user {display_name} on slack direct message.
86
+ """.format(display_name=display_name.replace(" ", "")).lower()
87
+
88
+ print(prompt_api_execute(prompt))
89
+
90
+ def latest_n_emails_gmail(n):
91
+ prompt = """
92
+ Who are the senders of the {n} most recent email in my gmail inbox?
93
+ """.format(n=n)
94
+
95
+ print(prompt_api_execute(prompt))
96
+
97
+ def ask_general_question(question):
98
+ print(prompt_api_execute(question))
99
+
100
+ """
101
+ FS management system
102
+ """
103
+ def full_file_system_demo():
104
+ test_dir = 'test'
105
+ os.makedirs(test_dir, exist_ok=True)
106
+ engine = ExecutionEngine(path=test_dir)
107
+ engine.initialize_fs(debug_path=test_dir)
108
+ # Example usage
109
+ engine._exec_filesystem_call('ls -a')
110
+ engine.exec_api_call('echo "Hello, World!" > hello.txt', Filesystem_Type)
111
+ engine._exec_filesystem_call('ls -a')
112
+ engine._exec_filesystem_call('cat hello.txt')
113
+
114
+ engine.commit_api_call(Filesystem_Type)
115
+ print('\n\nCommited!\n\n')
116
+
117
+ engine.exec_api_call('echo "Bad File!" > not_good.txt', Filesystem_Type)
118
+ engine._exec_filesystem_call('ls -a', Filesystem_Type)
119
+ engine._exec_filesystem_call('cat not_good.txt', Filesystem_Type)
120
+
121
+
122
+ engine.undo_api_call(Filesystem_Type)
123
+ print('\n\nReverted!\n\n')
124
+
125
+ engine.exec_api_call('ls -a', Filesystem_Type)
126
+
127
+
128
+ def mysql_insert_new_row_no_dry_run(api_call=None):
129
+ load_dotenv()
130
+ # DB tests
131
+ mysql_config = {
132
+ 'user': os.environ.get('DATABASE_USER'),
133
+ 'password': os.environ.get('DATABASE_PASSWORD'),
134
+ 'host': os.environ.get('DATABASE_HOST'),
135
+ 'database': os.environ.get('DATABASE_NAME')
136
+ }
137
+ if not api_call or not neg_api_call:
138
+ api_call = "INSERT INTO students (name, year, major) VALUES ('Roy Huang', 4, 'Computer Science');"
139
+ neg_api_call = """
140
+ DELETE FROM students WHERE id IN (
141
+ SELECT * FROM (
142
+ SELECT MAX(id) FROM students
143
+ ) AS subquery
144
+ );
145
+ """
146
+ check_call = "SELECT * FROM students;"
147
+
148
+ engine = ExecutionEngine()
149
+ db_manager = MySQLManager(mysql_config, docker_sandbox=engine.docker_sandbox)
150
+ db_manager.connect()
151
+ engine.initialize_db(debug_manager=db_manager)
152
+
153
+ print('Current State:')
154
+ print(engine._exec_sql_call(check_call))
155
+
156
+ engine.exec_api_call("INSERT INTO students (name, year, major) VALUES ('Ray Huang', 4, 'Computer Science');", api_type=SQL_Type)
157
+
158
+ print('New Commited State:')
159
+ print(engine._exec_sql_call(check_call))
160
+
161
+ engine.commit_api_call(SQL_Type)
162
+
163
+ engine.exec_api_call("INSERT INTO students (name, year, major) VALUES ('Wrong dude', 1, 'high schooler');", api_type=SQL_Type)
164
+
165
+ print('Uncommited Changed State:')
166
+ print(engine._exec_sql_call(check_call))
167
+
168
+ engine.undo_api_call(SQL_Type)
169
+
170
+ print('Previous Commited Changed State:')
171
+ print(engine._exec_sql_call(check_call))
172
+
173
+ def fs_all_in():
174
+ test_dir = 'test'
175
+ os.makedirs(test_dir, exist_ok=True)
176
+ engine = ExecutionEngine()
177
+ engine.initialize_fs(debug_path=test_dir)
178
+ # Example usage
179
+ engine.exec_api_call('ls -a')
180
+ engine.exec_api_call('echo "Hello, World!" > hello.txt')
181
+ engine.exec_api_call('ls -a')
182
+ engine.exec_api_call('cat hello.txt')
183
+
184
+ engine.commit_api_call(Filesystem_Type)
185
+ print('\n\nCommited!\n\n')
186
+
187
+ engine.exec_api_call('echo "Bad File!" > not_good.txt')
188
+ engine.exec_api_call('ls -a')
189
+ engine.exec_api_call('cat not_good.txt')
190
+
191
+ engine.undo_api_call(SQL_Type)
192
+ print('\n\nReverted!\n\n')
193
+
194
+ engine.exec_api_call('ls -a')
195
+
196
+ def mysql_end_to_end_insert():
197
+ load_dotenv()
198
+ # DB tests
199
+ mysql_config = {
200
+ 'user': os.environ.get('DATABASE_USER'),
201
+ 'password': os.environ.get('DATABASE_PASSWORD'),
202
+ 'host': os.environ.get('DATABASE_HOST'),
203
+ 'database': os.environ.get('DATABASE_NAME')
204
+ }
205
+
206
+ check_call = "SELECT * FROM students;"
207
+
208
+ engine = ExecutionEngine()
209
+ engine.set_dry_run(SQL_Type, True)
210
+
211
+ db_manager = MySQLManager(mysql_config, docker_sandbox=engine.docker_sandbox)
212
+ db_manager.connect()
213
+ engine.initialize_db(debug_manager=db_manager)
214
+
215
+ prompt = "i want to insert a new student name Shishir Patil who's a 1st year and a computer science major into the students table"
216
+ # prompt = "i want to delete a student named ray Doe in the students table"
217
+
218
+ print("Before execution:")
219
+ print(engine._exec_sql_call(check_call))
220
+
221
+ engine.run_prompt(prompt, SQL_Type)
222
+
223
+ print("After execution:")
224
+ print(engine._exec_sql_call(check_call))
225
+
226
+ def sqlite_insert_with_dry_run_llm_reversion():
227
+ engine = ExecutionEngine()
228
+
229
+ db_path = os.path.join(ROOT_FOLDER_PATH, 'docker/sqllite_docker/example_sqlite.db')
230
+ config = {'path': db_path}
231
+ db_manager = SQLiteManager(config, engine.docker_sandbox)
232
+ db_manager.connect()
233
+
234
+ engine.initialize_db(debug_manager=db_manager)
235
+ engine.set_dry_run(SQL_Type, True)
236
+ check_call = "SELECT * FROM projects;"
237
+
238
+ prompt = "i want to insert a new example row into the projects table"
239
+
240
+ print("Before execution:")
241
+ print(engine._exec_sql_call(check_call))
242
+
243
+ engine.run_prompt(prompt, SQL_Type)
244
+
245
+ print("After execution:")
246
+ print(engine._exec_sql_call(check_call))
247
+
248
+ engine.undo_api_call(SQL_Type)
249
+
250
+ def fs_joke_prompt_demo():
251
+ test_dir = 'test'
252
+ os.makedirs(test_dir, exist_ok=True)
253
+ engine = ExecutionEngine(path=test_dir)
254
+ engine.initialize_fs(debug_path=test_dir)
255
+ engine.set_dry_run(Filesystem_Type, True)
256
+ # Example usage
257
+
258
+ print("Before execution:")
259
+ print(engine._exec_filesystem_call('ls -a'))
260
+
261
+ engine.run_prompt("I want to create a file named joke.txt with a witty joke inside", Filesystem_Type)
262
+ engine.commit_api_call(Filesystem_Type)
263
+
264
+ print("After execution:")
265
+ print(engine._exec_filesystem_call('ls -a'))
266
+ print(engine._exec_filesystem_call('cat joke.txt'))
267
+
268
+
269
+
270
+ if __name__ == "__main__":
271
+
272
+ """
273
+ NOTE: Feel free to uncomment any of the tests below to run the demo
274
+
275
+ IMPORTANT: Follow the README to get set up
276
+ """
277
+
278
+ """
279
+ File System Examples
280
+
281
+ You can see the actual file changes inside test/ directory
282
+ """
283
+ # full_file_system_demo()
284
+ # create_new_file()
285
+ # fs_joke_prompt_demo()
286
+
287
+ """
288
+ MySQL Examples
289
+ """
290
+ # mysql_insert_new_row_with_dry_run()
291
+ # mysql_insert_new_row_no_dry_run()
292
+ # mysql_end_to_end_insert()
293
+
294
+ """
295
+ sqllite Examples
296
+ """
297
+ # sqlite_insert_with_dry_run_llm_reversion()
298
+
299
+ """
300
+ RESTful Examples
301
+ """
302
+ # SLACK (requires OAuth)
303
+ # send_slack_message("yo", "Shishir Patil")
304
+ # delete_slack_message("Shishir Patil")
305
+
306
+ # SPOTIFY (requires OAuth)
307
+ # spotify is sometimes a bit spotty (heh) and does not always work
308
+ # create a new file in my dropbox account with some jokes
309
+ # ask_general_question("find the user info associated with my spotify account")
310
+
311
+ # DROPBOX (requires OAuth)
312
+ # ask_general_question("create a new file in my dropbox account with some jokes")
313
+ # ask_general_question("list all files in my dropbox account")
314
+
315
+ # STRIPE (requires API key)
316
+ # ask_general_question("create a new customer with email aaronhao@berkeley.edu on stripe")
317
+ # ask_general_question("add 300 dollars to the balance of the customer with email aaronhao@berkeley.edu on stripe")
318
+
319
+ # GITHUB (requires oauth)
320
+ # ask_general_question("get my profile information from github")
321
+ # ask_general_question("raise a github issue for my repository at [REPO] with text: [TEXT]")
322
+
323
+ # DISCORD (requires oauth)
324
+ # ask_general_question("what is the email associated with my discord account")
325
+
326
+ # ask_general_question("What's the top rising stock today on alphavantage?")
327
+ # ask_general_question("What's the weather today in San Francisco?")
328
+ # ask_general_question("What's the estimated time of arrival to the Salesforce tower Sanfrancisco if I leave berkeley right now with Bart")
329
+ pass
goex/exec_engine/README.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Gorilla-X
2
+
3
+ ## Execution Workflows
4
+
5
+ We categorize API calls into several categories, namely, RESTful API, filesystem APIs, database APIs, and POSIX APIs. A main concern we are trying to address is how to safely handle situations where LLMs may produce code that leads to unintended behaviors.
6
+
7
+ ### File System
8
+
9
+ With filesystems API calls, they will be handled by an wrapper class `FSManager` that handles all the code execution as well as reversion functionalities. Upon initialization inside `ExecutionEngine`, the newly created FSManager based on either a user specified directory or the CWD will be initialized to track changes.
10
+
11
+ - Initialize a Git repo to keep track of changes
12
+ - if it is a directory of size > 200MB, we use Git LFS
13
+
14
+ `FSManager` will handle all of the history reversion based on standard Git principles to provide a robust version control system for easy rollbacks to the pre-LLM execution state.
15
+
16
+ ### Database
17
+
18
+ With Database API calls, they will be handled by a wrapper interface `DBManager` that gets implemented into specific managers for each DB type (i.e. `MySQLManager`).
19
+
20
+ The `DBManager` will handle execution of the API call, as well as keeping track of the current open transaction awaiting commit or rollback if the user decides to not perform dry run testing of the API calls (option 1).
21
+
22
+ If the user has the dry run testing option on (option 2), then before the API call gets executed locally, a docker container will be spawned with a copy of the current database you are working with (`exec_engine/utils.py`).
23
+
24
+ - the setup required for each DB will be performed in a shell script located in `docker/docker/container_setup`
25
+
26
+ Afterwards, a Python script will run with the API call wrapped around a reversion tester to see if the state before running the API call and after the API call + its negation are the same. This gets captured and sent back as the dry run result. From their, the CLI or GUI can prompt the user to confirm or cancel the operation if it is deemed to be irreversible by the generated negation API.
goex/exec_engine/__init__.py ADDED
File without changes
goex/exec_engine/api_executor.py ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """This module will execute API calls and their reversals."""
2
+
3
+ import subprocess
4
+ import json
5
+ from exec_engine.db_manager import DBManager
6
+
7
+ from exec_engine.credentials.credentials_utils import creds_from_prompt, CREDS_FOLDER_PATH
8
+ from exec_engine.docker_sandbox import *
9
+
10
+ from exec_engine.utils import RESTful_Type
11
+ from exec_engine.pipeline import generate_reverse_command
12
+ from exec_engine.negation_manager import NegationAPIPairManager, NaiveNegationAPIPairManager
13
+
14
+ from pathlib import Path
15
+
16
+ CUR_DIR = os.path.dirname(Path(os.path.realpath(__file__)))
17
+
18
+ def code_add_dummy_argument(python_code):
19
+ dummy_args = json.load(open('./function/dummy_key.json', 'r'))
20
+ for dummy_args_key in dummy_args:
21
+ if isinstance(dummy_args[dummy_args_key], str):
22
+ dummy_args[dummy_args_key] = "\"" + dummy_args[dummy_args_key] + "\""
23
+ python_code = python_code.replace("\"<<"+dummy_args_key+"_placeholder>>\"", dummy_args[dummy_args_key])
24
+ return python_code
25
+
26
+ class APIExecutor:
27
+ """Base Class for all API executors
28
+
29
+ Should be stateless and should not have any attributes.
30
+
31
+ Attributes:
32
+ None
33
+
34
+ Methods:
35
+ execute_api_call: Execute API call
36
+ """
37
+ def __init__(self):
38
+ return None
39
+
40
+ def execute_api_call(self, command: str) -> int:
41
+ """Execute API call.
42
+
43
+ Args:
44
+ command (str): API call to execute.
45
+ """
46
+ raise NotImplementedError
47
+
48
+ def set_execution_environment(self, env, docker_sandbox: DockerSandbox = None):
49
+ if env == "local":
50
+ self.env = "local"
51
+ return
52
+ elif env == "docker":
53
+ self.env = "docker"
54
+ self.docker_client = "docker_client"
55
+ return
56
+ else:
57
+ print('env can only be set to "docker" or "local"')
58
+
59
+ class PythonAPIExecutor(APIExecutor):
60
+ """Executes Python API calls
61
+
62
+ Methods:
63
+ execute_api_call: Execute API call
64
+ """
65
+ def __init__(self, docker_sandbox: DockerSandbox = None, negation_manager: NaiveNegationAPIPairManager = None, path: str = CUR_DIR):
66
+ self.env = None
67
+ self.docker_sandbox = docker_sandbox
68
+ if negation_manager != None:
69
+ self.negation_manager = negation_manager(path)
70
+ else:
71
+ self.negation_manager = None
72
+
73
+ def prepare_credentials(self, prompt:str, technique="lut"):
74
+ credentials = creds_from_prompt(prompt, CREDS_FOLDER_PATH, technique)
75
+ try:
76
+ services = [service_name for service_name, value, file_type in credentials]
77
+ except:
78
+ raise Exception("Error: credentials have to be passed in as a list of [service_name, value, cred_type] pairs")
79
+ return credentials, services
80
+
81
+ # try_get_backward_call will try to see if there is a corresponding backward call for the input forward call
82
+ # if not, it will prompt the LLM to come up with one
83
+ def try_get_backward_call(self, forward_call, prompt, credentials, api_type, generate_mode='default', model="gpt-4-turbo-preview"):
84
+ if self.negation_manager != None:
85
+ # look up if there is a corresponding backward call in reverse_db
86
+ negation_call = self.negation_manager.get_success(forward_call)
87
+ if negation_call != None:
88
+ return negation_call
89
+
90
+ return generate_reverse_command(forward_call, prompt, credentials, api_type, generate_mode, openai_model=model)
91
+
92
+ def execute_api_call(self, command: str, credentials: list = None) -> int:
93
+ """Execute API call.
94
+
95
+ Args:
96
+ command (str): API call to execute.
97
+ """
98
+ image_id = self.docker_sandbox.create_image_from_code(command)
99
+ if image_id == None:
100
+ raise Exception("Error: failed to generate or get image id")
101
+ # Add dummy arguments to the code
102
+ command = code_add_dummy_argument(command)
103
+ result = self.docker_sandbox.create_python_sandbox(command, image_id, credentials=credentials)
104
+
105
+ return result
goex/exec_engine/container_utils/__init__.py ADDED
File without changes
goex/exec_engine/container_utils/code_parser.py ADDED
@@ -0,0 +1,406 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """For parsing code snippets and locating relevant dependencies/imports so that they could be installed to the containers' images"""
2
+
3
+ from contextlib import contextmanager
4
+ import os
5
+ import sys
6
+ import re
7
+ import logging
8
+ import ast
9
+ from docopt import docopt
10
+ import requests
11
+ from pathlib import Path
12
+ from yarg import json2package
13
+ from yarg.exceptions import HTTPError
14
+
15
+ REGEXP = [
16
+ re.compile(r'^import (.+)$'),
17
+ re.compile(r'^from ((?!\.+).*?) import (?:.*)$')
18
+ ]
19
+
20
+ logging.disable(sys.maxsize)
21
+ PIPS_FOLDER_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__)).parent), "pips")
22
+ DOCKER_REQUIREMENTS_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__)).parent.parent), "docker/docker/requirements.txt")
23
+
24
+ @contextmanager
25
+ def _open(filename=None, mode='r'):
26
+ """Open a file or ``sys.stdout`` depending on the provided filename.
27
+
28
+ Args:
29
+ filename (str): The path to the file that should be opened. If
30
+ ``None`` or ``'-'``, ``sys.stdout`` or ``sys.stdin`` is
31
+ returned depending on the desired mode. Defaults to ``None``.
32
+ mode (str): The mode that should be used to open the file.
33
+
34
+ Yields:
35
+ A file handle.
36
+
37
+ """
38
+ if not filename or filename == '-':
39
+ if not mode or 'r' in mode:
40
+ file = sys.stdin
41
+ elif 'w' in mode:
42
+ file = sys.stdout
43
+ else:
44
+ raise ValueError('Invalid mode for file: {}'.format(mode))
45
+ else:
46
+ file = open(filename, mode)
47
+
48
+ try:
49
+ yield file
50
+ finally:
51
+ if file not in (sys.stdin, sys.stdout):
52
+ file.close()
53
+
54
+
55
+ def get_all_imports(
56
+ contents):
57
+ imports = set()
58
+ raw_imports = set()
59
+ candidates = []
60
+ ignore_errors = False
61
+
62
+ tree = ast.parse(contents)
63
+ for node in ast.walk(tree):
64
+ if isinstance(node, ast.Import):
65
+ for subnode in node.names:
66
+ raw_imports.add(subnode.name)
67
+ elif isinstance(node, ast.ImportFrom):
68
+ raw_imports.add(node.module)
69
+
70
+ # Clean up imports
71
+ for name in [n for n in raw_imports if n]:
72
+ # Sanity check: Name could have been None if the import
73
+ # statement was as ``from . import X``
74
+ # Cleanup: We only want to first part of the import.
75
+ # Ex: from django.conf --> django.conf. But we only want django
76
+ # as an import.
77
+ cleaned_name, _, _ = name.partition('.')
78
+ imports.add(cleaned_name)
79
+
80
+ packages = imports - (set(candidates) & imports)
81
+ logging.debug('Found packages: {0}'.format(packages))
82
+
83
+ with open(os.path.join(PIPS_FOLDER_PATH, "stdlib.txt"), "r") as f:
84
+ data = {x.strip() for x in f}
85
+
86
+ return list(packages - data)
87
+
88
+
89
+ def generate_requirements_file(path, imports, symbol):
90
+ with _open(path, "w") as out_file:
91
+ logging.debug('Writing {num} requirements: {imports} to {file}'.format(
92
+ num=len(imports),
93
+ file=path,
94
+ imports=", ".join([x['name'] for x in imports])
95
+ ))
96
+ fmt = '{name}' + symbol + '{version}'
97
+ out_file.write('\n'.join(
98
+ fmt.format(**item) if item['version'] else '{name}'.format(**item)
99
+ for item in imports) + '\n')
100
+
101
+
102
+ def get_imports_info(
103
+ imports, pypi_server="https://pypi.python.org/pypi/", proxy=None):
104
+ result = []
105
+
106
+ # transformers most times require torch and sentencepiece
107
+ if ('transformers' in imports):
108
+ imports.extend(['torch', 'sentencepiece'])
109
+
110
+ for item in imports:
111
+ try:
112
+ logging.warning(
113
+ 'Import named "%s" not found locally. '
114
+ 'Trying to resolve it at the PyPI server.',
115
+ item
116
+ )
117
+ response = requests.get(
118
+ "{0}{1}/json".format(pypi_server, item), proxies=proxy)
119
+ if response.status_code == 200:
120
+ if hasattr(response.content, 'decode'):
121
+ data = json2package(response.content.decode())
122
+ else:
123
+ data = json2package(response.content)
124
+ elif response.status_code >= 300:
125
+ raise HTTPError(status_code=response.status_code,
126
+ reason=response.reason)
127
+ except HTTPError:
128
+ logging.warning(
129
+ 'Package "%s" does not exist or network problems', item)
130
+ continue
131
+ logging.warning(
132
+ 'Import named "%s" was resolved to "%s:%s" package (%s).\n'
133
+ 'Please, verify manually the final list of requirements.txt '
134
+ 'to avoid possible dependency confusions.',
135
+ item,
136
+ data.name,
137
+ data.latest_release_id,
138
+ data.pypi_url
139
+ )
140
+ result.append({'name': item, 'version': data.latest_release_id})
141
+ return result
142
+
143
+
144
+ def get_locally_installed_packages(encoding=None):
145
+ packages = []
146
+ ignore = ["tests", "_tests", "egg", "EGG", "info"]
147
+ for path in sys.path:
148
+ for root, dirs, files in os.walk(path):
149
+ for item in files:
150
+ if "top_level" in item:
151
+ item = os.path.join(root, item)
152
+ with open(item, "r", encoding=encoding) as f:
153
+ package = root.split(os.sep)[-1].split("-")
154
+ try:
155
+ top_level_modules = f.read().strip().split("\n")
156
+ except: # NOQA
157
+ # TODO: What errors do we intend to suppress here?
158
+ continue
159
+
160
+ # filter off explicitly ignored top-level modules
161
+ # such as test, egg, etc.
162
+ filtered_top_level_modules = list()
163
+
164
+ for module in top_level_modules:
165
+ if (
166
+ (module not in ignore) and
167
+ (package[0] not in ignore)
168
+ ):
169
+ # append exported top level modules to the list
170
+ filtered_top_level_modules.append(module)
171
+
172
+ version = None
173
+ if len(package) > 1:
174
+ version = package[1].replace(
175
+ ".dist", "").replace(".egg", "")
176
+
177
+ # append package: top_level_modules pairs
178
+ # instead of top_level_module: package pairs
179
+ packages.append({
180
+ 'name': package[0],
181
+ 'version': version,
182
+ 'exports': filtered_top_level_modules
183
+ })
184
+ return packages
185
+
186
+
187
+ def get_import_local(imports, encoding=None):
188
+ local = get_locally_installed_packages()
189
+ result = []
190
+ if ('transformers' in imports):
191
+ imports.extend(['torch', 'sentencepiece'])
192
+ for item in imports:
193
+ # search through local packages
194
+ for package in local:
195
+ # if candidate import name matches export name
196
+ # or candidate import name equals to the package name
197
+ # append it to the result
198
+ if item in package['exports'] or item == package['name']:
199
+ result.append(package)
200
+
201
+ # removing duplicates of package/version
202
+ # had to use second method instead of the previous one,
203
+ # because we have a list in the 'exports' field
204
+ # https://stackoverflow.com/questions/9427163/remove-duplicate-dict-in-list-in-python
205
+ name_set = set()
206
+ result_unique = []
207
+ for n, i in enumerate(result):
208
+ if i['name'] not in name_set:
209
+ result_unique.append(i)
210
+ name_set.add(i['name'])
211
+
212
+ #result_unique = [i for n, i in enumerate(result) if i not in result[n+1:]]
213
+
214
+ return result_unique
215
+
216
+
217
+ def get_pkg_names(pkgs):
218
+ """Get PyPI package names from a list of imports.
219
+
220
+ Args:
221
+ pkgs (List[str]): List of import names.
222
+
223
+ Returns:
224
+ List[str]: The corresponding PyPI package names.
225
+
226
+ """
227
+ result = set()
228
+ with open(os.path.join(PIPS_FOLDER_PATH, "mapping.txt"), "r") as f:
229
+ data = dict(x.strip().split(":") for x in f)
230
+ for pkg in pkgs:
231
+ # Look up the mapped requirement. If a mapping isn't found,
232
+ # simply use the package name.
233
+ result.add(data.get(pkg, pkg))
234
+ # Return a sorted list for backward compatibility.
235
+ return sorted(result, key=lambda s: s.lower())
236
+
237
+
238
+ def get_name_without_alias(name):
239
+ if "import " in name:
240
+ match = REGEXP[0].match(name.strip())
241
+ if match:
242
+ name = match.groups(0)[0]
243
+ return name.partition(' as ')[0].partition('.')[0].strip()
244
+
245
+
246
+ def join(f):
247
+ return os.path.join(os.path.dirname(__file__), f)
248
+
249
+
250
+ def parse_requirements(file_):
251
+ """Parse a requirements formatted file.
252
+
253
+ Traverse a string until a delimiter is detected, then split at said
254
+ delimiter, get module name by element index, create a dict consisting of
255
+ module:version, and add dict to list of parsed modules.
256
+
257
+ Args:
258
+ file_: File to parse.
259
+
260
+ Raises:
261
+ OSerror: If there's any issues accessing the file.
262
+
263
+ Returns:
264
+ tuple: The contents of the file, excluding comments.
265
+ """
266
+ modules = []
267
+ # For the dependency identifier specification, see
268
+ # https://www.python.org/dev/peps/pep-0508/#complete-grammar
269
+ delim = ["<", ">", "=", "!", "~"]
270
+
271
+ try:
272
+ f = open(file_, "r")
273
+ except OSError:
274
+ logging.error("Failed on file: {}".format(file_))
275
+ raise
276
+ else:
277
+ try:
278
+ data = [x.strip() for x in f.readlines() if x != "\n"]
279
+ finally:
280
+ f.close()
281
+
282
+ data = [x for x in data if x[0].isalpha()]
283
+
284
+ for x in data:
285
+ # Check for modules w/o a specifier.
286
+ if not any([y in x for y in delim]):
287
+ modules.append({"name": x, "version": None})
288
+ for y in x:
289
+ if y in delim:
290
+ module = x.split(y)
291
+ module_name = module[0]
292
+ module_version = module[-1].replace("=", "")
293
+ module = {"name": module_name, "version": module_version}
294
+
295
+ if module not in modules:
296
+ modules.append(module)
297
+
298
+ break
299
+
300
+ return modules
301
+
302
+
303
+ def compare_modules(file_, imports):
304
+ """Compare modules in a file to imported modules in a project.
305
+
306
+ Args:
307
+ file_ (str): File to parse for modules to be compared.
308
+ imports (tuple): Modules being imported in the project.
309
+
310
+ Returns:
311
+ tuple: The modules not imported in the project, but do exist in the
312
+ specified file.
313
+ """
314
+ modules = parse_requirements(file_)
315
+
316
+ imports = [imports[i]["name"] for i in range(len(imports))]
317
+ modules = [modules[i]["name"] for i in range(len(modules))]
318
+ modules_not_imported = set(modules) - set(imports)
319
+
320
+ return modules_not_imported
321
+
322
+
323
+ def diff(file_, imports):
324
+ """Display the difference between modules in a file and imported modules.""" # NOQA
325
+ modules_not_imported = compare_modules(file_, imports)
326
+
327
+ logging.info(
328
+ "The following modules are in {} but do not seem to be imported: "
329
+ "{}".format(file_, ", ".join(x for x in modules_not_imported)))
330
+
331
+
332
+ def clean(file_, imports):
333
+ """Remove modules that aren't imported in project from file."""
334
+ modules_not_imported = compare_modules(file_, imports)
335
+
336
+ if len(modules_not_imported) == 0:
337
+ logging.info("Nothing to clean in " + file_)
338
+ return
339
+
340
+ re_remove = re.compile("|".join(modules_not_imported))
341
+ to_write = []
342
+
343
+ try:
344
+ f = open(file_, "r+")
345
+ except OSError:
346
+ logging.error("Failed on file: {}".format(file_))
347
+ raise
348
+ else:
349
+ try:
350
+ for i in f.readlines():
351
+ if re_remove.match(i) is None:
352
+ to_write.append(i)
353
+ f.seek(0)
354
+ f.truncate()
355
+
356
+ for i in to_write:
357
+ f.write(i)
358
+ finally:
359
+ f.close()
360
+
361
+ logging.info("Successfully cleaned up requirements in " + file_)
362
+
363
+
364
+ def dynamic_versioning(scheme, imports):
365
+ """Enables dynamic versioning with <compat>, <gt> or <non-pin> schemes."""
366
+ if scheme == "no-pin":
367
+ imports = [{"name": item["name"], "version": ""} for item in imports]
368
+ symbol = ""
369
+ elif scheme == "gt":
370
+ symbol = ">="
371
+ elif scheme == "compat":
372
+ symbol = "~="
373
+ return imports, symbol
374
+
375
+
376
+ def extract_dependencies(contents, args = {}, path = DOCKER_REQUIREMENTS_PATH):
377
+ candidates = get_all_imports(contents)
378
+ candidates = get_pkg_names(candidates)
379
+ logging.debug("Found imports: " + ", ".join(candidates))
380
+ pypi_server = "https://pypi.python.org/pypi/"
381
+ proxy = None
382
+ logging.debug("Getting packages information from Local/PyPI")
383
+ local = get_import_local(candidates, encoding=None)
384
+
385
+ #commonly used enough to be worth adding
386
+ candidates.append('pickle')
387
+ # check if candidate name is found in
388
+ # the list of exported modules, installed locally
389
+ # and the package name is not in the list of local module names
390
+ # it add to difference
391
+ difference = [x for x in candidates if
392
+ # aggregate all export lists into one
393
+ # flatten the list
394
+ # check if candidate is in exports
395
+ x.lower() not in [y for x in local for y in x['exports']]
396
+ and
397
+ # check if candidate is package names
398
+ x.lower() not in [x['name'] for x in local]]
399
+ imports = local + get_imports_info(difference,
400
+ proxy=proxy,
401
+ pypi_server=pypi_server)
402
+ # sort imports based on lowercase name of package, similar to `pip freeze`.
403
+ imports = sorted(imports, key=lambda x: x['name'].lower())
404
+ generate_requirements_file(path, imports, "==")
405
+ logging.info("Successfully saved requirements file in " + path)
406
+ return imports
goex/exec_engine/container_utils/container_utils.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """To speed up build runtimes. Previously used docker images are cached in images.json so that they could be reused"""
2
+
3
+ import hashlib
4
+ import os
5
+ import json
6
+ from pathlib import Path
7
+
8
+ ROOT_FOLDER_PATH = os.path.dirname(Path(os.path.realpath(__file__)).parent.parent)
9
+ IMAGES_FILE_PATH = os.path.join(ROOT_FOLDER_PATH, "docker/misc/images.json")
10
+
11
+ def get_files_hash(*file_paths):
12
+ """Return the SHA256 hash of multiple files."""
13
+ hasher = hashlib.sha256()
14
+ for file_path in file_paths:
15
+ with open(file_path, "rb") as f:
16
+ while chunk := f.read(4096):
17
+ hasher.update(chunk)
18
+ return hasher.hexdigest()
19
+
20
+ def find_local_docker_image(image_hash):
21
+ hash_file_path = IMAGES_FILE_PATH
22
+ if not os.path.exists(hash_file_path):
23
+ return None
24
+ with open(hash_file_path, "r") as f:
25
+ stored_hashes = json.load(f)
26
+ if image_hash in stored_hashes:
27
+ return stored_hashes[image_hash]
28
+ else:
29
+ return None
30
+
31
+ def save_image_hash(image_hash, image_name):
32
+ hash_file_path = IMAGES_FILE_PATH
33
+ try:
34
+ if not os.path.exists(hash_file_path):
35
+ with open(hash_file_path, "w") as f:
36
+ stored_hashes = {}
37
+ stored_hashes[image_hash] = image_name
38
+ json.dump(stored_hashes, f)
39
+ return True
40
+ else:
41
+ stored_hashes = {}
42
+ with open(hash_file_path, "r") as f:
43
+ stored_hashes = json.load(f)
44
+ with open(hash_file_path, "w") as f:
45
+ stored_hashes[image_hash] = image_name
46
+ json.dump(stored_hashes, f)
47
+ return True
48
+ except Exception as e:
49
+ print(e)
50
+ return False
51
+
goex/exec_engine/credentials/__init__.py ADDED
File without changes
goex/exec_engine/credentials/credentials_utils.py ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """External services sometimes require user credentials for authentication. Users can add credentials to Gorilla and specify their preferred technique to pass their credentials."""
2
+
3
+ import os
4
+ import json
5
+ import os
6
+ import shutil
7
+ from pathlib import Path
8
+
9
+ CREDS_FOLDER_PATH = os.path.dirname(os.path.realpath(__file__))
10
+ CREDS_SUPPORTED_PATH = os.path.join(os.path.dirname(Path(os.path.realpath(__file__))), "supported.txt")
11
+ SECRET_STORE_PATH = os.path.join(CREDS_FOLDER_PATH, "secret_store.json")
12
+
13
+ '''
14
+ check if the Gorilla supports the provided credential
15
+ '''
16
+ def cred_is_supported(cred):
17
+ creds_list = []
18
+ with open(CREDS_SUPPORTED_PATH, 'r') as f:
19
+ for line in f:
20
+ creds_list.append(line.strip())
21
+ if cred not in creds_list:
22
+ return False
23
+ return True
24
+
25
+
26
+ """
27
+ Insert the service and its corresponding api key.
28
+ Example: service = "gmail", key = "SOME_API_KEY"
29
+ """
30
+ def insert_creds(service, key, target = CREDS_FOLDER_PATH, cred_type="raw"):
31
+ #create secret store if it doesn't exist
32
+ secret_store_path = os.path.join(target, "secret_store.json")
33
+ secrets = {}
34
+ try:
35
+ with open(secret_store_path, "r") as secret_store:
36
+ secrets = json.load(secret_store)
37
+ except Exception as e:
38
+ "target folder doesn't contain secret store, creating..."
39
+
40
+ with open(secret_store_path, "w") as secret_store:
41
+ secrets[service.lower()] = [key, cred_type]
42
+ json.dump(secrets, secret_store)
43
+
44
+ def remove_creds(services, target = CREDS_FOLDER_PATH):
45
+ secret_store_path = os.path.join(target, "secret_store.json")
46
+ secrets = {}
47
+ try:
48
+ with open(secret_store_path, "r") as secret_store:
49
+ secrets = json.load(secret_store)
50
+ except Exception as e:
51
+ print("No previous authorization.")
52
+ return
53
+
54
+ if(services[0]=='ALL'):
55
+ services = list(secrets.keys())
56
+
57
+ for service in services:
58
+ if(service.lower() in secrets):
59
+ try:
60
+ del secrets[service.lower()]
61
+ cred_path = os.path.join(target, service.lower())
62
+ if os.path.exists(cred_path):
63
+ shutil.rmtree(cred_path)
64
+ print(f"Succesfully removed {service}.")
65
+ except Exception as e:
66
+ print(f"Could not remove credentials for {service}.")
67
+ else:
68
+ print(f"Authorization for {service} was not found.")
69
+ if(not secrets):
70
+ os.remove(secret_store_path)
71
+ else:
72
+ with open(secret_store_path, "w") as secret_store:
73
+ json.dump(secrets, secret_store)
74
+
75
+ def list_creds(target = CREDS_FOLDER_PATH):
76
+ secret_store_path = os.path.join(target, "secret_store.json")
77
+ if not os.path.exists(secret_store_path ):
78
+ "target folder doesn't contain secret store, aborting..."
79
+
80
+ with open(secret_store_path, "r") as secret_store:
81
+ try:
82
+ secrets = json.load(secret_store)
83
+ return secrets
84
+ except Exception as e:
85
+ print(e)
86
+ return {}
87
+
88
+ def creds_from_prompt(prompt, target_folder, technique = "lut", llm_code_output = None):
89
+ creds_set = set(list_creds(target_folder))
90
+ creds_set = list_creds(target_folder)
91
+ formatted_prompt = prompt.lower()
92
+
93
+ found = []
94
+ if technique == "lut":
95
+ for service in creds_set:
96
+ if service in formatted_prompt:
97
+ if not isinstance(creds_set[service], list) or len(creds_set[service]) != 2:
98
+ print("Error: credential for {service} in the secret store is not in the correct format".format(service=service))
99
+ else:
100
+ cred, cred_type = creds_set[service]
101
+ found.append([service, cred, cred_type])
102
+ return found
103
+
104
+ elif technique == "openai":
105
+ found = []
106
+ if llm_code_output:
107
+ generated_list = openai_generate_credentials_list("generate a list of credentials or keys I need to execute the following code {c}".format(c=llm_code_output))
108
+ else:
109
+ generated_list = openai_generate_credentials_list("generate a list of credentials or keys I need to execute code for the following prompt {p}".format(p=prompt))
110
+
111
+ found = [key for key in generated_list if key in creds_set]
112
+ return found
113
+
114
+ else:
115
+ print("technique has not been implemented yet...")
116
+ return
117
+
118
+ def get_cred_paths(creds, target = CREDS_FOLDER_PATH):
119
+ secret_store_path = os.path.join(target, "secret_store.json")
120
+ if not os.path.exists(secret_store_path ):
121
+ "target folder doesn't contain secret store, aborting..."
122
+
123
+ with open(secret_store_path, "r") as secret_store:
124
+ try:
125
+ secrets = json.load(secret_store)
126
+ found, missing = {}, []
127
+ for c in creds:
128
+ if c in secrets:
129
+ found[c] = secrets[c][0]
130
+ else:
131
+ missing.append(c)
132
+ return found, missing
133
+ except Exception as e:
134
+ print(e)
135
+ return {}, []
136
+
137
+ def openai_generate_credentials_list(prompt):
138
+ from openai import OpenAI
139
+ client = OpenAI()
140
+
141
+ response = client.chat.completions.create(
142
+ model="gpt-3.5-turbo",
143
+ messages=[
144
+ {
145
+ "role": "user",
146
+ "content": prompt
147
+ }
148
+ ]
149
+ )
150
+
151
+ return response.choices[0].message.content
152
+
153
+ def list_supported_services():
154
+ with open(os.path.join(CREDS_FOLDER_PATH, "supported.txt")) as f:
155
+ services = f.readlines()
156
+ for i, s in enumerate(services):
157
+ services[i] = s.replace("\n", "")
158
+
159
+ return services
goex/exec_engine/credentials/supported.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ gmail
2
+ slack
3
+ spotify
4
+ dropbox
5
+ github
6
+ discord
goex/exec_engine/db_manager.py ADDED
@@ -0,0 +1,302 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from exec_engine.docker_sandbox import DockerSandbox
2
+
3
+ """
4
+ This module will handle all database interactions
5
+ The DBManager class is the base class for all database managers
6
+ """
7
+
8
+ class DBManager:
9
+ """Base class for all DB connectors.
10
+
11
+ Attributes:
12
+ connection_config (type): JSON Config for connection.
13
+
14
+ Methods:
15
+ connect: Establish connections to the DB
16
+ execute_db_call: Execute DB call
17
+ commit_db_calls: Commit DB calls
18
+ rollback_db_calls: Rollback DB calls
19
+ close: Close the connection to the database
20
+
21
+ """
22
+
23
+ def __init__(self, connection_config):
24
+ """Initialize the DBManager.
25
+
26
+ Args:
27
+ connection_config (dict): Configuration for connecting to the database. This can be a path for file-based databases or connection details for server-based databases.
28
+
29
+ """
30
+ self.connection_config = connection_config
31
+ self.docker_sandbox = None
32
+
33
+ def connect(self):
34
+ """Establish connection to the database."""
35
+ raise NotImplementedError
36
+
37
+ def get_schema_as_string(self):
38
+ prompt = ""
39
+ for table_name, schema in self.schema.items():
40
+ prompt += f"Table '{table_name}':\n"
41
+ for column in schema:
42
+ column_name, column_type, is_nullable, key, default, extra = column
43
+ prompt += f"- Column '{column_name}' of type '{column_type}'"
44
+ if is_nullable == 'NO':
45
+ prompt += ", not nullable"
46
+ if key == 'PRI':
47
+ prompt += ", primary key"
48
+ prompt += "\n"
49
+ prompt += "\n"
50
+ return prompt
51
+
52
+ def task_to_prompt(self, task_description, forward=True):
53
+ """Format the schemas of all tables into a prompt for GPT, including a task description."""
54
+ prompt = ""
55
+
56
+ if self.schema == None:
57
+ raise Exception("Please connect to the database first.")
58
+
59
+ if self.schema:
60
+ "No schema information available."
61
+ prompt += "Given the following table schemas in a sqlite database:\n\n"
62
+ prompt += self.get_schema_as_string()
63
+
64
+ if forward:
65
+ prompt += f"Task: {task_description}\n\n"
66
+ prompt += "Based on the task, select the most appropriate table and generate an SQL command to complete the task. In the output, only include SQL code."
67
+ else:
68
+ prompt += f"SQL command: {task_description}\n\n"
69
+ prompt += "Based on the SQL command and the given table schemas, generate a reverse command to reverse the SQL command. In the output, only include SQL code."
70
+ return prompt
71
+
72
+ def execute_db_call(self, call):
73
+ """Execute DB call.
74
+
75
+ Args:
76
+ call (str): DB call to execute.
77
+ """
78
+ raise NotImplementedError
79
+
80
+ def fetch_db_call(self, call):
81
+ raise NotImplementedError
82
+
83
+ def commit_db_calls(self):
84
+ """Commit DB calls."""
85
+ raise NotImplementedError
86
+
87
+ def rollback_db_calls(self):
88
+ """Rollback DB calls not committed"""
89
+ raise NotImplementedError
90
+
91
+ def close(self):
92
+ """Close the connection to the database."""
93
+ raise NotImplementedError
94
+
95
+
96
+ class SQLiteManager(DBManager):
97
+ """SQLite database manager.
98
+
99
+ Attributes:
100
+ _sqlite_imported (bool): flag to check if sqlite3 is imported.
101
+
102
+ Methods:
103
+ connect: Establish connections to the DB
104
+ execute_db_call: Execute SQL call
105
+ commit_db_calls: Commit SQL calls
106
+ rollback_db_calls: Rollback SQL calls
107
+ close: Close the connection to the database
108
+ """
109
+ _sqlite_imported = False # flag to check if sqlite3 is imported
110
+ db_type = "sqlite"
111
+ TEST_CONFIG = "" # No config required to access sqlite
112
+ def __init__(self, connection_config, docker_sandbox: DockerSandbox = None):
113
+ """Initialize the SQLLiteManager.
114
+
115
+ Args:
116
+ connection_config(str): path to the database file.
117
+ """
118
+ if not SQLiteManager._sqlite_imported:
119
+ global sqlite3
120
+ import sqlite3
121
+ SQLiteManager._sqlite_imported = True
122
+ keys = connection_config.keys()
123
+
124
+ if any(key not in keys for key in ['path']):
125
+ raise ValueError("Failed to initialize SQLite Manager due to bad configs")
126
+
127
+ self.db_path = connection_config['path']
128
+ if not self.db_path:
129
+ raise ValueError("Failed to initialize SQLite Manager due to missing path")
130
+
131
+ def update_schema_info(self):
132
+ schema_info = {}
133
+
134
+ self.cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
135
+ tables = self.cursor.fetchall()
136
+ for (table_name,) in tables:
137
+ self.cursor.execute(f"PRAGMA table_info({table_name});")
138
+ schema_info[table_name] = self.cursor.fetchall()
139
+
140
+ self.schema = schema_info
141
+
142
+ def connect(self):
143
+ """Establish connection to the SQLLite3 database and create a cursor."""
144
+ self.conn = sqlite3.connect(self.db_path)
145
+ self.cursor = self.conn.cursor()
146
+ self.update_schema_info()
147
+
148
+
149
+ def execute_db_call(self, call):
150
+ if not self.conn:
151
+ self.connect()
152
+ try:
153
+ commands_list = [cmd.strip() for cmd in call.split(';') if cmd.strip() and not cmd.strip().startswith('--')]
154
+ for command in commands_list:
155
+ if command.upper().startswith('SELECT'):
156
+ self.cursor.execute(command)
157
+ print(self.cursor.fetchall())
158
+ else:
159
+ self.cursor.execute(command)
160
+ self.update_schema_info()
161
+ return 0
162
+ except Exception as e:
163
+ return 1
164
+
165
+
166
+ def fetch_db_call(self, call):
167
+ if not self.conn:
168
+ self.connect()
169
+ try:
170
+ self.cursor.execute(call)
171
+ ret_val = self.cursor.fetchall()
172
+ self.update_schema_info()
173
+ return ret_val
174
+ except Exception as e:
175
+ return []
176
+
177
+ def commit_db_calls(self):
178
+ """Commit SQL calls."""
179
+ if not self.conn:
180
+ self.connect()
181
+ self.conn.commit()
182
+
183
+ def rollback_db_calls(self):
184
+ """Rollback SQL calls not committed"""
185
+ if not self.conn:
186
+ self.connect()
187
+ self.conn.rollback()
188
+ self.close()
189
+ self.connect()
190
+
191
+ def close(self):
192
+ if self.conn:
193
+ self.cursor.close()
194
+ self.conn.close()
195
+
196
+
197
+ class MySQLManager(DBManager):
198
+ """MySQL database manager.
199
+
200
+ Attributes:
201
+ _mysql_imported (bool): flag to check if pymysql is imported.
202
+
203
+ Methods:
204
+ connect: Establish connections to the DB
205
+ execute_db_call: Execute SQL call
206
+ commit_db_calls: Commit SQL calls
207
+ rollback_db_calls: Rollback SQL calls
208
+ close: Close the connection to the database
209
+ """
210
+ _mysql_imported = False
211
+ db_type = "mysql"
212
+ TEST_CONFIG = "{'host': '127.0.0.1', 'user': 'root', 'password': ''}\n Use Pymysql and make sure to create the database using subprocess before connection."
213
+ def __init__(self, connection_config, docker_sandbox: DockerSandbox = None):
214
+ """Initialize the MySQLManager.
215
+
216
+ Args:
217
+ connection_config (dict): configuration for the database connection, including keys for 'user', 'password', 'host', and 'database'.
218
+ """
219
+ if not MySQLManager._mysql_imported:
220
+ global pymysql
221
+ import pymysql
222
+ MySQLManager._mysql_imported = True
223
+
224
+ keys = connection_config.keys()
225
+
226
+ if any(key not in keys for key in ['host', 'user', 'password', 'database']):
227
+ raise ValueError("Failed to initialize MySQL Manager due to bad configs")
228
+ elif any([not connection_config['host'], not connection_config['user'], not connection_config['password'], not connection_config['database']]):
229
+ raise ValueError("Failed to initialize MySQL Manager due to missing configs")
230
+
231
+ self.connection_config = {
232
+ 'host': connection_config['host'],
233
+ 'user': connection_config['user'],
234
+ 'password': connection_config['password'],
235
+ 'database': connection_config['database'],
236
+ "client_flag": pymysql.constants.CLIENT.MULTI_STATEMENTS
237
+ }
238
+
239
+ def connect(self):
240
+ """Establish connection to the MySQL database and create a cursor."""
241
+ self.conn = pymysql.connect(**self.connection_config)
242
+ self.cursor = self.conn.cursor()
243
+ self.update_schema_info()
244
+
245
+ def update_schema_info(self):
246
+ schema_info = {}
247
+
248
+ self.cursor.execute("SHOW TABLES")
249
+ tables = self.cursor.fetchall()
250
+ for (table_name,) in tables:
251
+ self.cursor.execute(f"DESCRIBE {table_name}")
252
+ schema_info[table_name] = self.cursor.fetchall()
253
+
254
+ self.schema = schema_info
255
+
256
+ def execute_db_call(self, call):
257
+ """Execute a SQL call using the cursor."""
258
+ if not self.conn:
259
+ self.connect()
260
+ try:
261
+ self.cursor.execute(call)
262
+ self.update_schema_info()
263
+ return 0
264
+ except Exception as e:
265
+ return 1
266
+
267
+ def fetch_db_call(self, call: str) -> list[dict]:
268
+ """Execute a SQL call and return the results.
269
+
270
+ Args:
271
+ call (str): SQL query to execute.
272
+
273
+ Returns:
274
+ list[dict]: A list of dictionaries representing each row in the query result.
275
+ """
276
+ if not self.conn:
277
+ self.connect()
278
+ try:
279
+ self.cursor.execute(call)
280
+ ret_val = self.cursor.fetchall()
281
+ self.update_schema_info()
282
+ return ret_val
283
+ except Exception as e:
284
+ return []
285
+
286
+ def commit_db_calls(self):
287
+ """Commit SQL calls."""
288
+ if not self.conn:
289
+ self.connect()
290
+ self.conn.commit()
291
+
292
+ def rollback_db_calls(self):
293
+ """Rollback SQL calls not committed."""
294
+ if not self.conn:
295
+ self.connect()
296
+ self.conn.rollback()
297
+
298
+ def close(self):
299
+ """Close the cursor and the connection to the database."""
300
+ if self.conn:
301
+ self.cursor.close()
302
+ self.conn.close()
goex/exec_engine/docker_sandbox.py ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Manages Docker containers for a controlled environment."""
2
+
3
+ import docker
4
+ import os
5
+ from pathlib import Path
6
+
7
+ from exec_engine.container_utils import container_utils as utils
8
+ from exec_engine.container_utils.code_parser import extract_dependencies
9
+ from exec_engine.credentials.credentials_utils import get_cred_paths, CREDS_FOLDER_PATH
10
+
11
+ from exec_engine.utils import format_container_logs, RESTful_Type, SQL_Type, Filesystem_Type
12
+
13
+ ROOT_FOLDER_PATH = os.path.dirname(Path(os.path.realpath(__file__)).parent)
14
+ DOCKER_FOLDER_PATH = os.path.join(ROOT_FOLDER_PATH, "docker/docker")
15
+ DOCKER_REQUIREMENTS_PATH = os.path.join(DOCKER_FOLDER_PATH, "requirements.txt")
16
+ DOCKERFILE_PATH = os.path.join(DOCKER_FOLDER_PATH, "dockerfile")
17
+ DOCKER_EXECUTION_PATH = os.path.join(DOCKER_FOLDER_PATH, "python_executor.py")
18
+
19
+ MYSQL_DOCKER_FOLDER_PATH = os.path.join(ROOT_FOLDER_PATH, "docker/mysql_docker")
20
+ MYSQL_DOCKER_REQUIREMENTS_PATH = os.path.join(MYSQL_DOCKER_FOLDER_PATH, "requirements.txt")
21
+ MYSQL_DOCKERFILE_PATH = os.path.join(MYSQL_DOCKER_FOLDER_PATH, "dockerfile")
22
+ MYSQL_DOCKER_EXECUTION_PATH = os.path.join(MYSQL_DOCKER_FOLDER_PATH, "python_executor.py")
23
+
24
+ def get_docker_paths(docker_folder_path):
25
+ requirements_path = os.path.join(docker_folder_path, "requirements.txt")
26
+ dockerfile_path = os.path.join(docker_folder_path, "dockerfile")
27
+ execution_path = os.path.join(docker_folder_path, "python_executor.py")
28
+
29
+ return requirements_path, dockerfile_path, execution_path
30
+
31
+ class DockerSandbox:
32
+ def __init__(self, client_config = {}):
33
+ self.client = None
34
+ self.auto_save_image = True
35
+ self.auto_remove = True
36
+
37
+ if not client_config:
38
+ try:
39
+ self.client = docker.from_env()
40
+ except Exception as e:
41
+ print("Error: {error}.\nIf you haven't already, please install Docker https://docs.docker.com/get-docker/".format(error=e))
42
+ else:
43
+ try:
44
+ self.client = docker.DockerClient(**client_config)
45
+ except Exception as e:
46
+ print("Unable to initialize a docker client based on client_config {client_config}. Encountered an error with message {error}".format(client_config=client_config, error=e))
47
+
48
+
49
+ def create_sandbox(self):
50
+ # Create a new Docker container with a basic image
51
+ return self.client.containers.run("ubuntu", detach=True)
52
+
53
+
54
+ def create_python_sandbox(self, code, image_id, credentials=None, attached_volume = None):
55
+ volumes = []
56
+
57
+ if credentials:
58
+ paths, not_found = get_cred_paths(credentials, CREDS_FOLDER_PATH)
59
+ for service in paths:
60
+ host_path = paths[service]
61
+ container_path = "/sandbox/credentials/" + service
62
+ volumes.append(host_path + ":" + container_path)
63
+
64
+ else:
65
+ volumes = {
66
+ # path on your machine/host
67
+ os.path.abspath("credentials"): {
68
+ "bind": "/sandbox/credentials", # path inside the container
69
+ "mode": "rw",
70
+ }
71
+ }
72
+ if attached_volume:
73
+ volumes[attached_volume] = {
74
+ "bind": "/sandbox/test_dir",
75
+ "mode": "ro",
76
+ }
77
+
78
+ try:
79
+ container = self.client.containers.run(
80
+ image_id,
81
+ command =
82
+ ['python', 'python_executor.py', 'code_execute'],
83
+ environment = {
84
+ "CODE": code
85
+ },
86
+ volumes=volumes,
87
+ stderr = True,
88
+ stdout=True,
89
+ detach=True,
90
+ )
91
+ container.wait()
92
+ docker_out, docker_debug = format_container_logs(container)
93
+ if self.auto_remove:
94
+ container.remove()
95
+
96
+ except Exception as e:
97
+ print("Failure occured inside client.containers.run with the following error message:", e)
98
+ return None
99
+
100
+ return {"output": docker_out, "debug": docker_debug}
101
+
102
+ def create_image_from_code(self, code, api_type=RESTful_Type):
103
+ if api_type == SQL_Type:
104
+ docker_folder_path = MYSQL_DOCKER_FOLDER_PATH
105
+ else:
106
+ docker_folder_path = DOCKER_FOLDER_PATH
107
+
108
+ requirements_path, dockerfile_path, execution_path = get_docker_paths(docker_folder_path)
109
+ try:
110
+ extract_dependencies(code, path=requirements_path)
111
+ image_hash = utils.get_files_hash(dockerfile_path, requirements_path, execution_path)
112
+ image_id = utils.find_local_docker_image(image_hash)
113
+ except Exception as e:
114
+ print("ERROR:, ", e)
115
+ return
116
+
117
+ # Run the container using the image specified if exists, else pull the image from docker hub
118
+ try:
119
+ if image_id:
120
+ self.client.images.get(image_id)
121
+ except Exception as e:
122
+ try:
123
+ # Use the low-level API to stream the pull response
124
+ low_level_client = docker.APIClient()
125
+ low_level_client.pull(image_id, stream=True, decode=True)
126
+ self.client.images.get(image_id)
127
+ except:
128
+ image_id = None
129
+
130
+ try:
131
+ if not image_id:
132
+ image_id = self.client.images.build(path=docker_folder_path)[0].short_id
133
+ if self.auto_save_image:
134
+ utils.save_image_hash(image_hash, image_id)
135
+ except Exception as e:
136
+ print("Unable to build docker image, returned with error: {error}".format(error=e))
137
+ return None
138
+
139
+ return image_id
140
+
141
+ def delete_sandbox(self, container):
142
+ container.stop()
143
+ container.remove()
goex/exec_engine/fs_manager.py ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ This module will handle all filesystem interactions
3
+ The FSManager class is the base class for all filesystem managers
4
+ """
5
+ import os
6
+ import subprocess
7
+
8
+ class FSManager:
9
+ """Base class for all FS operations.
10
+
11
+ Attributes:
12
+ fs_path (type): path to the fs location.
13
+
14
+ Methods:
15
+ execute: Execute command
16
+ commit: Commit SQL calls
17
+ revert: "Revert changes to previous commit through git LFS
18
+ initialize_git_lfs: Initialize the current directory as a git lfs repo if it isn't already
19
+ """
20
+ def __init__(self, fs_path=None, git_init=True):
21
+ """Initialize the FSManager.
22
+
23
+ Args:
24
+ fs_path (str): path to the fs path. Default is CWD
25
+ """
26
+ if not fs_path:
27
+ self.fs_path = os.getcwd()
28
+ else:
29
+ self.fs_path = os.path.abspath(fs_path)
30
+ if not os.path.exists(self.fs_path) or not os.path.isdir(self.fs_path):
31
+ raise Exception("Please provide a valid directory")
32
+
33
+ self.is_git_repo = os.path.exists(os.path.join(self.fs_path, '.git'))
34
+ self.git_init = git_init
35
+
36
+ def execute(self, command: str, display=False):
37
+ """Execute command.
38
+
39
+ Args:
40
+ command (str): Command to execute.
41
+ """
42
+ if display:
43
+ return subprocess.call(command, shell=True, cwd=self.fs_path)
44
+ return subprocess.call(command, shell=True, cwd=self.fs_path, stdout=subprocess.DEVNULL)
45
+
46
+ def commit(self, message='Auto-commit via FSManager', clean=True):
47
+ """Commit all current changes through git LFS"""
48
+ try:
49
+ self.execute(f'git add .') # Stage all changes
50
+ self.execute(f'git commit -m "{message}"') # Commit with a message
51
+ if clean and not self.is_git_repo:
52
+ self.execute('rm -rf .git') # Remove git once commit happens to save space
53
+ except Exception as e:
54
+ print(f"Error during commit: {e}")
55
+
56
+ def revert(self, clean=True):
57
+ """Revert changes to previous commit through git LFS"""
58
+ try:
59
+ self.execute('git clean -fd')
60
+ self.execute('git reset --hard HEAD')
61
+ if clean and not self.is_git_repo:
62
+ self.execute('rm -rf .git') # Remove git once revert happens to save space
63
+ except Exception as e:
64
+ print(f"Error during revert: {e}")
65
+
66
+ def initialize_version_control(self):
67
+ """Initialize the current directory as a git lfs repo if it isn't already."""
68
+ if self.git_init:
69
+ if not os.path.exists(os.path.join(self.fs_path, '.git')):
70
+ try:
71
+ self.execute('git init') # Initialize git repository
72
+ if self._exceed_directory_size(os.getcwd()):
73
+ self.execute('git lfs install') # Initialize git LFS
74
+ print("Initialized current directory as a Git LFS repository.")
75
+ self.execute('git add .')
76
+ self.execute("git commit --allow-empty -n -m init")
77
+ except Exception as e:
78
+ print(f"Error during Git initialization: {e}")
79
+ else:
80
+ # check to see if there are uncommitted changes
81
+ uncommitted = self._check_uncommitted_changes()
82
+ if uncommitted:
83
+ raise Exception("Please commit or stash all changes before executing FS commands")
84
+
85
+
86
+ def task_to_prompt(self, task_description, forward=True):
87
+ """
88
+ Formats a prompt for GPT-4 including the directory tree and a user task description.
89
+
90
+ :param directory_tree: A nested dictionary representing the directory structure.
91
+ :param task_description: A string describing the task to be performed.
92
+ :return: A formatted string prompt.
93
+ """
94
+
95
+ tree_summary = self._get_directory_tree()
96
+
97
+ prompt = (
98
+ "Given the following project directory structure:\n"
99
+ f"{tree_summary}\n\n"
100
+ )
101
+
102
+ # Format the full prompt including the directory structure and the task description
103
+ if forward:
104
+ prompt += (
105
+ "Perform the following task:\n"
106
+ f"{task_description}\n\n"
107
+ "Generate the command to achieve this and only include the shell command as a shell codeblock in the response, "
108
+ )
109
+ else:
110
+ prompt += (
111
+ "Given this shell command:\n"
112
+ f"{task_description}\n\n"
113
+ "Generate the reverse command to reverse the given shell command and only include the shell command as a shell codeblock in the response, "
114
+ )
115
+ prompt += "make sure to not change CWD:"
116
+ return prompt
117
+
118
+ def _get_directory_tree(self):
119
+ """
120
+ Creates a nested dictionary that represents the folder structure of self.fs_path.
121
+ """
122
+ summary_lines = []
123
+
124
+ # Ensure the self.fs_path ends with a separator to correctly calculate depth
125
+ if not self.fs_path.endswith(os.sep):
126
+ self.fs_path += os.sep
127
+
128
+ for root, dirs, files in os.walk(self.fs_path):
129
+ if '.git' in dirs:
130
+ dirs.remove('.git')
131
+ # Calculate the depth based on the difference between root and self.fs_path
132
+ depth = root.replace(self.fs_path, '').count(os.sep)
133
+ indent = " " * depth # Four spaces per indentation level
134
+
135
+ # Extract the last part of the root path to get the current directory name
136
+ dirname = os.path.basename(root.rstrip(os.sep))
137
+ if depth > 0: # Avoid including the self.fs_path itself as a directory line
138
+ summary_lines.append(f"{indent}+ {dirname}/")
139
+
140
+ for name in sorted(dirs + files):
141
+ if name in dirs:
142
+ # Directories will be processed in subsequent iterations of os.walk
143
+ continue
144
+ else:
145
+ # Append files directly
146
+ summary_lines.append(f"{indent} - {name}")
147
+
148
+ return "\n".join(summary_lines)
149
+
150
+ def _exceed_directory_size(self, path, size_limit=200):
151
+ """size_limit is measured in MB"""
152
+ total_size = 0
153
+ for dirpath, dirnames, filenames in os.walk(path):
154
+ for f in filenames:
155
+ fp = os.path.join(dirpath, f)
156
+ # skip if it is symbolic link
157
+ if not os.path.islink(fp):
158
+ total_size += os.path.getsize(fp)
159
+ if total_size >= size_limit * 1024 * 1024:
160
+ return True
161
+ return False
162
+
163
+ def _check_uncommitted_changes(self):
164
+ # Ensure the path exists and is a directory
165
+ if not os.path.isdir(self.fs_path):
166
+ print(f"The path {self.fs_path} is not a valid directory.")
167
+ return
168
+
169
+ try:
170
+ result = subprocess.run(["git", "status", "--porcelain"], cwd=self.fs_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
171
+
172
+ # Check if the output is empty. If it's not, there are uncommitted changes.
173
+ if result.stdout.strip():
174
+ print("There are uncommitted changes or untracked files.")
175
+ return True
176
+ else:
177
+ return False
178
+
179
+ except Exception as e:
180
+ print(f"An error occurred: {e}")
181
+ return True
182
+
goex/exec_engine/negation_manager.py ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json
3
+
4
+ """
5
+ NegationAPIPairManager Interface
6
+ """
7
+ class NegationAPIPairManager:
8
+ def __init__(self):
9
+ return None
10
+
11
+ def get_success(self, forward_call):
12
+ # return a single backward call that have previously been reported successful
13
+ # this backward call will be used to perform the reversion if requested
14
+ raise NotImplementedError
15
+
16
+ def get_failure(self, forward_call):
17
+ # return a list of backward calls that have previously been reported unsuccessful
18
+ raise NotImplementedError
19
+
20
+ def insert_log(self, forward_call, backward_call, result):
21
+ # insert a new entry or log to the negation manager
22
+ raise NotImplementedError
23
+
24
+ """
25
+ Simple NegationManager with JSON based key-value pair storage
26
+ """
27
+ class NaiveNegationAPIPairManager(NegationAPIPairManager):
28
+ def __init__(self, reverse_log_json_path):
29
+ self.reverse_log_path = os.path.join(reverse_log_json_path, "negation_log.json")
30
+
31
+ def get_success(self, forward_call):
32
+ logs = {}
33
+ try:
34
+ with open(self.reverse_log_path, "r") as reverse_log:
35
+ logs = json.load(reverse_log)
36
+ if forward_call in logs:
37
+ if "true" in logs[forward_call]:
38
+ return logs[forward_call]["true"][0]
39
+
40
+ except Exception as e:
41
+ pass
42
+
43
+ return None
44
+
45
+ def get_failure(self, forward_call):
46
+ logs = {}
47
+ try:
48
+ with open(self.reverse_log_path, "r") as reverse_log:
49
+ logs = json.load(reverse_log)
50
+ if forward_call in logs:
51
+ if "false" in logs[forward_call]:
52
+ return logs[forward_call]["false"]
53
+
54
+ except Exception as e:
55
+ pass
56
+
57
+ return None
58
+
59
+ def insert_log(self, forward_call, backward_call, result):
60
+ logs = {}
61
+ try:
62
+ with open(self.reverse_log_path, "r") as reverse_log:
63
+ logs = json.load(reverse_log)
64
+
65
+ except Exception as e:
66
+ pass
67
+
68
+ with open(self.reverse_log_path, "w") as reverse_log:
69
+ if forward_call not in logs:
70
+ logs[forward_call] = {}
71
+
72
+ result = str(result).lower()
73
+ if result in logs[forward_call]:
74
+ logs[forward_call][result].append(backward_call)
75
+ else:
76
+ logs[forward_call][result] = [backward_call]
77
+
78
+ json.dump(logs, reverse_log)
goex/exec_engine/pipeline.py ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import os
3
+ from openai import OpenAI, APIError
4
+ from collections import defaultdict
5
+ from exec_engine.credentials.credentials_utils import *
6
+ from exec_engine.utils import SQL_Type, Filesystem_Type, RESTful_Type
7
+
8
+ import re
9
+
10
+ python_pattern = r"```python\n(.*?)\n```"
11
+ sql_pattern = r"```sql\n(.*?)\n```"
12
+ bash_pattern = r"```(?:bash|shell|sh)\n(.*?)\n```"
13
+
14
+ INSTRUCTION_TEXT = """
15
+ You are an assistant that outputs executable Python code that perform what the user requests.
16
+ It is important that you only return one and only one code block with all the necessary imports inside ```python and nothing else.
17
+ The code block should print the output(s) when appropriate.
18
+
19
+ If the action can't be successfully completed, throw an exception
20
+
21
+ This is what the user requests: {request}\n
22
+ """
23
+
24
+ REVERSE_INSTRUCTION_TEXT = """
25
+ Given an action and a Python code block that performs that action from the user,
26
+ you are an assistant that outputs executable Python code that perform the REVERSE (can make more/new API calls if needed) of what's been done.
27
+
28
+ It is important that the REVERSE code only revert the changes if any and nothing else, and that you only return
29
+ one and only one code block with all the necessary imports inside ```python and nothing else.
30
+
31
+ The code block should print the output(s) when appropriate.
32
+
33
+ If the action can't be successfully completed, throw an exception
34
+
35
+ This is the action: {prompt}
36
+ This is the action code block: {forward_call}
37
+
38
+ If no revert action exists, return a python code with a print statement explaining why so.
39
+ """
40
+
41
+ FUNCTION_IN_CONTEXT_TEXT = """
42
+ You are an assistant that outputs executable Python code according to a given list of python functions that perform what the user requests.
43
+ It is important that you only return one and only one code block with all the necessary imports inside ```python and nothing else.
44
+ The code block should print the output(s) when appropriate.
45
+
46
+ If the action can't be successfully completed, throw an exception
47
+
48
+ Don't change the available functions listed below except for feeding parameters.
49
+
50
+ Only use the functions defined below, don't add new functions.
51
+
52
+ Here is a list of python functions available:\n
53
+ {functions}\n
54
+
55
+ This is what the user requests: {request}\n
56
+ """
57
+
58
+ REVERSE_FUNCTION_IN_CONTEXT_TEXT = """
59
+ Given a list of available functions, an action and a Python code block that performs that action from the user,
60
+ you are an assistant that outputs executable Python code using the available functions provided that perform the REVERSE (can make more/new API calls if needed) of what's been done.
61
+
62
+ It is important that the REVERSE code only revert the changes if any and nothing else, and that you only return
63
+ one and only one code block with all the necessary imports inside ```python and nothing else.
64
+
65
+ The code block should print the output(s) when appropriate.
66
+
67
+ Don't change the available functions listed below except for feeding parameters.
68
+
69
+ Only use the functions defined below, don't add new functions.
70
+
71
+ If the action can't be successfully completed, throw an exception
72
+
73
+ Here is a list of python functions available:\n
74
+ {functions}\n
75
+
76
+ This is the action: {prompt}
77
+ This is the action code block: {forward_call}
78
+
79
+ If no revert action exists, return a python code with a print statement explaining why so.
80
+ """
81
+
82
+ FUNCTION_CALLING_NATIVE_TEXT = """
83
+ {request}
84
+ """
85
+
86
+ REVERSE_FUNCTION_CALLING_NATIVE_TEXT = """
87
+ Given an action and a Python code block that performs that action from the user,
88
+ perform the REVERSE of what's been done.
89
+
90
+ This is the action: {prompt}
91
+ This is the action code block: {forward_call}
92
+ """
93
+
94
+ def read_available_functions():
95
+ FUNCTION_DIR = "./function/"
96
+ avail_functions = {}
97
+ functions = os.listdir(FUNCTION_DIR)
98
+ for function in functions:
99
+ if not function.endswith(".py"):
100
+ continue
101
+ with open(FUNCTION_DIR + function, "r") as file:
102
+ avail_functions[function.replace(".py", "")] = file.read()
103
+ return avail_functions
104
+
105
+
106
+ def convert_to_function_call(function_call_list):
107
+ if type(function_call_list) == dict:
108
+ function_call_list = [function_call_list]
109
+ execution_list = []
110
+ for function_call in function_call_list:
111
+ for key, value in function_call.items():
112
+ execution_list.append(
113
+ f"{key}({','.join([f'{k}={repr(v)}' for k,v in json.loads(value).items()])})"
114
+ )
115
+ return execution_list
116
+
117
+
118
+ def generate_command(content, credentials = None, api_type=RESTful_Type, generate_mode='default', openai_model="gpt-4-turbo-preview"):
119
+ client = OpenAI()
120
+
121
+ # defaults to getting the key using os.environ.get("OPENAI_API_KEY")
122
+ # if you saved the key under a different environment variable name, you can do something like:
123
+ # client = OpenAI(
124
+ # api_key=os.environ.get("CUSTOM_ENV_NAME"),
125
+ # )
126
+
127
+ if api_type == SQL_Type:
128
+ prompt = content
129
+ pattern = sql_pattern
130
+ elif api_type == Filesystem_Type:
131
+ prompt = content
132
+ pattern = bash_pattern
133
+ elif api_type == RESTful_Type or True:
134
+ if generate_mode == 'default':
135
+ prompt = INSTRUCTION_TEXT.format(request=content)
136
+ elif generate_mode == 'function_in_context':
137
+ avail_functions = read_available_functions()
138
+ prompt_functions = ""
139
+ for idx, function in enumerate(list(avail_functions.values())):
140
+ prompt_functions += "<<function" + str(idx) + ">>: " + str(function) + "\n"
141
+ prompt = FUNCTION_IN_CONTEXT_TEXT.format(functions=prompt_functions, request=content)
142
+ elif generate_mode == 'function_calling_native':
143
+ prompt = FUNCTION_CALLING_NATIVE_TEXT.format(request=content)
144
+ else:
145
+ raise Exception("Error: {} is not a supported argument for generate_mode, please select again from 'default', 'function_in_context', 'function_calling_native'"
146
+ .format(generate_mode))
147
+
148
+ if credentials:
149
+ prompt += generate_credentials_prompt_info(credentials)
150
+
151
+ else:
152
+ prompt += "Equally importantly, try to do so without requiring any API key. If and only if one is really needed, give the code block assuming those keys are provided."
153
+
154
+ pattern = python_pattern
155
+
156
+ if generate_mode == 'function_calling_native':
157
+ function_calls = json.load(open('./function/function.json'))
158
+ response = client.chat.completions.create(
159
+ model=openai_model,
160
+ messages=[
161
+ {
162
+ "role": "user",
163
+ "content": prompt
164
+ }
165
+ ],
166
+ tools=function_calls,
167
+ tool_choice=None,
168
+ )
169
+
170
+ if response.choices[0].message.tool_calls == None:
171
+ raise Exception("Unable able to retreive the relevant command to perform the action from Function Calling.\n" +
172
+ "Try again with a different prompt or generate_mode setting")
173
+
174
+ output = [
175
+ {func_call.function.name: func_call.function.arguments}
176
+ for func_call in response.choices[0].message.tool_calls
177
+ ]
178
+ assert len(output) == 1
179
+ output = output[0]
180
+ python_code = open(f"./function/{list(output.keys())[0]}.py", 'r').read()
181
+ output = convert_to_function_call(output)[0]
182
+ output = "```python\n" + python_code + "\n" + output + "\n```"
183
+ else:
184
+ response = client.chat.completions.create(
185
+ model=openai_model,
186
+ messages=[
187
+ {
188
+ "role": "user",
189
+ "content": prompt
190
+ }
191
+ ]
192
+ )
193
+ output = response.choices[0].message.content
194
+
195
+ #print(output) #Intentionally left here for future debugging purpose
196
+ matches = re.search(pattern, output, re.DOTALL)
197
+ if matches:
198
+ code = matches.group(1)
199
+ return code
200
+
201
+ def generate_reverse_command(forward_call, prompt, credentials=None, api_type=RESTful_Type, generate_mode='default', openai_model="gpt-4-turbo-preview"):
202
+ client = OpenAI()
203
+
204
+ if api_type == RESTful_Type:
205
+
206
+ if generate_mode == 'default':
207
+ reverse_prompt = REVERSE_INSTRUCTION_TEXT.format(prompt=prompt, forward_call=forward_call)
208
+ elif generate_mode == 'function_in_context':
209
+ avail_functions = read_available_functions()
210
+ prompt_functions = ""
211
+ for idx, function in enumerate(list(avail_functions.values())):
212
+ prompt_functions += "<<function" + str(idx) + ">>: " + str(function) + "\n"
213
+ reverse_prompt = REVERSE_FUNCTION_IN_CONTEXT_TEXT.format(prompt=prompt, forward_call=forward_call, functions=prompt_functions)
214
+ elif generate_mode == 'function_calling_native':
215
+ reverse_prompt = REVERSE_FUNCTION_CALLING_NATIVE_TEXT.format(prompt=prompt, forward_call=forward_call)
216
+ else:
217
+ raise Exception("Error: {} is not a supported argument for generate_mode, please select again from 'default', 'function_in_context', 'function_calling_native'"
218
+ .format(generate_mode))
219
+
220
+ if credentials:
221
+ reverse_prompt += generate_credentials_prompt_info(credentials)
222
+ else:
223
+ reverse_prompt += "Equally importantly, try to do so without requiring any API key. If and only if one is really needed, give the code block assuming those keys are provided."
224
+ else:
225
+ raise Exception("generate_reverse_command not supported for execution type other than REST")
226
+
227
+ if generate_mode == 'function_calling_native':
228
+ function_calls = json.load(open('./function/function.json'))
229
+ response = client.chat.completions.create(
230
+ model=openai_model,
231
+ messages=[
232
+ {
233
+ "role": "user",
234
+ "content": reverse_prompt
235
+ }
236
+ ],
237
+ tools=function_calls,
238
+ tool_choice=None,
239
+ )
240
+ output = [
241
+ {func_call.function.name: func_call.function.arguments}
242
+ for func_call in response.choices[0].message.tool_calls
243
+ ]
244
+ assert len(output) == 1
245
+ output = output[0]
246
+ python_code = open(f"./function/{list(output.keys())[0]}.py", 'r').read()
247
+ output = convert_to_function_call(output)[0]
248
+ output = "```python\n" + python_code + "\n" + output + "\n```"
249
+
250
+ else:
251
+ response = client.chat.completions.create(
252
+ model=openai_model,
253
+ temperature=0.3,
254
+ messages=[
255
+ {
256
+ "role": "user",
257
+ "content": reverse_prompt
258
+ }
259
+ ]
260
+ )
261
+ output = response.choices[0].message.content
262
+
263
+ #print(output) #Intentionally left here for future debugging purpose
264
+ matches = re.search(python_pattern, output, re.DOTALL)
265
+ if matches:
266
+ code = matches.group(1)
267
+ return code
268
+
269
+ def prompt_execute(engine, prompt, services=None, creds=None, max_attempt=3, model="gpt-4-turbo-preview"):
270
+ ret = defaultdict(list)
271
+ for _ in range(max_attempt):
272
+ forward_call, backward_call = engine.gen_api_pair(prompt, api_type=RESTful_Type, credentials=creds, model=model)
273
+ response = engine.api_executor.execute_api_call(forward_call, services)
274
+
275
+ if response and response['output']:
276
+ ret['output'].append(response['output'])
277
+ return ret, forward_call, backward_call
278
+ elif response and response['debug']:
279
+ ret['debug'].append(response['debug'])
280
+
281
+ engine._add_api_reverse_to_queue(RESTful_Type, (forward_call, backward_call))
282
+
283
+ return ret, forward_call, None
284
+
285
+
286
+ def generate_credentials_prompt_info(credentials):
287
+ #credential comes in a [service_name, value, cred_type] format
288
+ token_in_path = []
289
+ raw_key = []
290
+ try:
291
+ for service_name, value, cred_type in credentials:
292
+ if cred_type == "path":
293
+ token_in_path.append([service_name, value])
294
+ elif cred_type == "raw":
295
+ raw_key.append([service_name, value])
296
+ except:
297
+ raise Exception("Error: credentials have to be passed in as a list of [service_name, value, cred_type] pairs")
298
+
299
+ if token_in_path != []:
300
+ cred_paths = {}
301
+ for service_name, value in token_in_path:
302
+ prefix = "./credentials/" + service_name + "/"
303
+ cred_paths[service_name] = [prefix + file_name for file_name in os.listdir(value)]
304
+
305
+ return "The credentials (such as API keys) are stored in the following paths: {keys_list}. Open the file(s) to access them".format(keys_list=cred_paths)
306
+
307
+ if raw_key != []:
308
+ return "Additionally, these api keys are available for the following services {key_list}".format(
309
+ key_list=" ,".join("{name}={cred}".format(name=name, cred=cred) for name,cred in raw_key))
310
+
311
+
goex/exec_engine/pips/mapping.txt ADDED
@@ -0,0 +1,1152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AFQ:pyAFQ
2
+ AG_fft_tools:agpy
3
+ ANSI:pexpect
4
+ Adafruit:Adafruit_Libraries
5
+ App:Zope2
6
+ Asterisk:py_Asterisk
7
+ BB_jekyll_hook:bitbucket_jekyll_hook
8
+ Banzai:Banzai_NGS
9
+ BeautifulSoupTests:BeautifulSoup
10
+ BioSQL:biopython
11
+ BuildbotStatusShields:BuildbotEightStatusShields
12
+ ComputedAttribute:ExtensionClass
13
+ constraint:python-constraint
14
+ Crypto:pycryptodome
15
+ Cryptodome:pycryptodomex
16
+ FSM:pexpect
17
+ FiftyOneDegrees:51degrees_mobile_detector_v3_wrapper
18
+ functional:pyfunctional
19
+ GeoBaseMain:GeoBasesDev
20
+ GeoBases:GeoBasesDev
21
+ Globals:Zope2
22
+ HelpSys:Zope2
23
+ IPython:ipython
24
+ Kittens:astro_kittens
25
+ Levenshtein:python_Levenshtein
26
+ Lifetime:Zope2
27
+ MethodObject:ExtensionClass
28
+ MySQLdb:MySQL-python
29
+ OFS:Zope2
30
+ OpenGL:PyOpenGL
31
+ OpenSSL:pyOpenSSL
32
+ PIL:Pillow
33
+ Products:Zope2
34
+ PyWCSTools:astLib
35
+ Pyxides:astro_pyxis
36
+ QtCore:PySide
37
+ S3:s3cmd
38
+ SCons:pystick
39
+ Shared:Zope2
40
+ Signals:Zope2
41
+ Stemmer:PyStemmer
42
+ Testing:Zope2
43
+ TopZooTools:topzootools
44
+ TreeDisplay:DocumentTemplate
45
+ WorkingWithDocumentConversion:aspose_pdf_java_for_python
46
+ ZPublisher:Zope2
47
+ ZServer:Zope2
48
+ ZTUtils:Zope2
49
+ aadb:auto_adjust_display_brightness
50
+ abakaffe:abakaffe_cli
51
+ abiosgaming:abiosgaming.py
52
+ abiquo:abiquo_api
53
+ abl:abl.cssprocessor
54
+ abl:abl.robot
55
+ abl:abl.util
56
+ abl:abl.vpath
57
+ abo:abo_generator
58
+ abris_transform:abris
59
+ abstract:abstract.jwrotator
60
+ abu:abu.admin
61
+ ac_flask:AC_Flask_HipChat
62
+ acg:anikom15
63
+ acme:acme.dchat
64
+ acme:acme.hello
65
+ acted:acted.projects
66
+ action:ActionServer
67
+ actionbar:actionbar.panel
68
+ activehomed:afn
69
+ activepapers:ActivePapers.Py
70
+ address_book:address_book_lansry
71
+ adi:adi.commons
72
+ adi:adi.devgen
73
+ adi:adi.fullscreen
74
+ adi:adi.init
75
+ adi:adi.playlist
76
+ adi:adi.samplecontent
77
+ adi:adi.slickstyle
78
+ adi:adi.suite
79
+ adi:adi.trash
80
+ adict:aDict2
81
+ aditam:aditam.agent
82
+ aditam:aditam.core
83
+ adiumsh:adium_sh
84
+ adjector:AdjectorClient
85
+ adjector:AdjectorTracPlugin
86
+ adkit:Banner_Ad_Toolkit
87
+ admin_tools:django_admin_tools
88
+ adminishcategories:adminish_categories
89
+ adminsortable:django_admin_sortable
90
+ adspygoogle:adspygoogle.adwords
91
+ advancedcaching:agtl
92
+ adytum:Adytum_PyMonitor
93
+ affinitic:affinitic.docpyflakes
94
+ affinitic:affinitic.recipe.fakezope2eggs
95
+ affinitic:affinitic.simplecookiecuttr
96
+ affinitic:affinitic.verifyinterface
97
+ affinitic:affinitic.zamqp
98
+ afpy:afpy.xap
99
+ agatesql:agate_sql
100
+ ageliaco:ageliaco.recipe.csvconfig
101
+ agent_http:agent.http
102
+ agora:Agora_Client
103
+ agora:Agora_Fountain
104
+ agora:Agora_Fragment
105
+ agora:Agora_Planner
106
+ agora:Agora_Service_Provider
107
+ agoraplex:agoraplex.themes.sphinx
108
+ agsci:agsci.blognewsletter
109
+ agx:agx.core
110
+ agx:agx.dev
111
+ agx:agx.generator.buildout
112
+ agx:agx.generator.dexterity
113
+ agx:agx.generator.generator
114
+ agx:agx.generator.plone
115
+ agx:agx.generator.pyegg
116
+ agx:agx.generator.sql
117
+ agx:agx.generator.uml
118
+ agx:agx.generator.zca
119
+ agx:agx.transform.uml2fs
120
+ agx:agx.transform.xmi2uml
121
+ aimes:aimes.bundle
122
+ aimes:aimes.skeleton
123
+ aio:aio.app
124
+ aio:aio.config
125
+ aio:aio.core
126
+ aio:aio.signals
127
+ aiohs2:aio_hs2
128
+ aioroutes:aio_routes
129
+ aios3:aio_s3
130
+ airbrake:airbrake_flask
131
+ airship:airship_icloud
132
+ airship:airship_steamcloud
133
+ airflow:apache-airflow
134
+ akamai:edgegrid_python
135
+ alation:alation_api
136
+ alba_client:alba_client_python
137
+ alburnum:alburnum_maas_client
138
+ alchemist:alchemist.audit
139
+ alchemist:alchemist.security
140
+ alchemist:alchemist.traversal
141
+ alchemist:alchemist.ui
142
+ alchemyapi:alchemyapi_python
143
+ alerta:alerta_server
144
+ alexandria_upload:Alexandria_Upload_Utils
145
+ alibaba:alibaba_python_sdk
146
+ aliyun:aliyun_python_sdk
147
+ aliyuncli:alicloudcli
148
+ aliyunsdkacs:aliyun_python_sdk_acs
149
+ aliyunsdkbatchcompute:aliyun_python_sdk_batchcompute
150
+ aliyunsdkbsn:aliyun_python_sdk_bsn
151
+ aliyunsdkbss:aliyun_python_sdk_bss
152
+ aliyunsdkcdn:aliyun_python_sdk_cdn
153
+ aliyunsdkcms:aliyun_python_sdk_cms
154
+ aliyunsdkcore:aliyun_python_sdk_core
155
+ aliyunsdkcrm:aliyun_python_sdk_crm
156
+ aliyunsdkcs:aliyun_python_sdk_cs
157
+ aliyunsdkdrds:aliyun_python_sdk_drds
158
+ aliyunsdkecs:aliyun_python_sdk_ecs
159
+ aliyunsdkess:aliyun_python_sdk_ess
160
+ aliyunsdkft:aliyun_python_sdk_ft
161
+ aliyunsdkmts:aliyun_python_sdk_mts
162
+ aliyunsdkocs:aliyun_python_sdk_ocs
163
+ aliyunsdkoms:aliyun_python_sdk_oms
164
+ aliyunsdkossadmin:aliyun_python_sdk_ossadmin
165
+ aliyunsdkr-kvstore:aliyun_python_sdk_r_kvstore
166
+ aliyunsdkram:aliyun_python_sdk_ram
167
+ aliyunsdkrds:aliyun_python_sdk_rds
168
+ aliyunsdkrisk:aliyun_python_sdk_risk
169
+ aliyunsdkros:aliyun_python_sdk_ros
170
+ aliyunsdkslb:aliyun_python_sdk_slb
171
+ aliyunsdksts:aliyun_python_sdk_sts
172
+ aliyunsdkubsms:aliyun_python_sdk_ubsms
173
+ aliyunsdkyundun:aliyun_python_sdk_yundun
174
+ allattachments:AllAttachmentsMacro
175
+ allocine:allocine_wrapper
176
+ allowedsites:django_allowedsites
177
+ alm:alm.solrindex
178
+ aloft:aloft.py
179
+ alpacalib:alpaca
180
+ alphabetic:alphabetic_simple
181
+ alphasms:alphasms_client
182
+ altered:altered.states
183
+ alterootheme:alterootheme.busycity
184
+ alterootheme:alterootheme.intensesimplicity
185
+ alterootheme:alterootheme.lazydays
186
+ alurinium:alurinium_image_processing
187
+ alxlib:alx
188
+ amara3:amara3_iri
189
+ amara3:amara3_xml
190
+ amazon:AmazonAPIWrapper
191
+ amazon:python_amazon_simple_product_api
192
+ ambikesh1349-1:ambikesh1349_1
193
+ ambilight:AmbilightParty
194
+ amifs:amifs_core
195
+ amiorganizer:ami_organizer
196
+ amitu:amitu.lipy
197
+ amitu:amitu_putils
198
+ amitu:amitu_websocket_client
199
+ amitu:amitu_zutils
200
+ amltlearn:AMLT_learn
201
+ amocrm:amocrm_api
202
+ amqpdispatcher:amqp_dispatcher
203
+ amqpstorm:AMQP_Storm
204
+ analytics:analytics_python
205
+ analyzedir:AnalyzeDirectory
206
+ ancientsolutions:ancientsolutions_crypttools
207
+ anderson_paginator:anderson.paginator
208
+ android_clean_app:android_resource_remover
209
+ anel_power_control:AnelPowerControl
210
+ angus:angus_sdk_python
211
+ annalist_root:Annalist
212
+ annogesiclib:ANNOgesic
213
+ ansible-role-apply:ansible_role_apply
214
+ ansibledebugger:ansible_playbook_debugger
215
+ ansibledocgen:ansible_docgen
216
+ ansibleflow:ansible_flow
217
+ ansibleinventorygrapher:ansible_inventory_grapher
218
+ ansiblelint:ansible_lint
219
+ ansiblerolesgraph:ansible_roles_graph
220
+ ansibletools:ansible_tools
221
+ anthill:anthill.exampletheme
222
+ anthill:anthill.skinner
223
+ anthill:anthill.tal.macrorenderer
224
+ anthrax:AnthraxDojoFrontend
225
+ anthrax:AnthraxHTMLInput
226
+ anthrax:AnthraxImage
227
+ antisphinx:antiweb
228
+ antispoofing:antispoofing.evaluation
229
+ antlr4:antlr4_python2_runtime
230
+ antlr4:antlr4_python3_runtime
231
+ antlr4:antlr4_python_alt
232
+ anybox:anybox.buildbot.openerp
233
+ anybox:anybox.nose.odoo
234
+ anybox:anybox.paster.odoo
235
+ anybox:anybox.paster.openerp
236
+ anybox:anybox.recipe.sysdeps
237
+ anybox:anybox.scripts.odoo
238
+ apiclient:google_api_python_client
239
+ apitools:google_apitools
240
+ apm:arpm
241
+ app_data:django_appdata
242
+ appconf:django_appconf
243
+ appd:AppDynamicsDownloader
244
+ appd:AppDynamicsREST
245
+ appdynamics_bindeps:appdynamics_bindeps_linux_x64
246
+ appdynamics_bindeps:appdynamics_bindeps_linux_x86
247
+ appdynamics_bindeps:appdynamics_bindeps_osx_x64
248
+ appdynamics_proxysupport:appdynamics_proxysupport_linux_x64
249
+ appdynamics_proxysupport:appdynamics_proxysupport_linux_x86
250
+ appdynamics_proxysupport:appdynamics_proxysupport_osx_x64
251
+ appium:Appium_Python_Client
252
+ appliapps:applibase
253
+ appserver:broadwick
254
+ archetypes:archetypes.kss
255
+ archetypes:archetypes.multilingual
256
+ archetypes:archetypes.schemaextender
257
+ arm:ansible_role_manager
258
+ armor:armor_api
259
+ armstrong:armstrong.apps.related_content
260
+ armstrong:armstrong.apps.series
261
+ armstrong:armstrong.cli
262
+ armstrong:armstrong.core.arm_access
263
+ armstrong:armstrong.core.arm_layout
264
+ armstrong:armstrong.core.arm_sections
265
+ armstrong:armstrong.core.arm_wells
266
+ armstrong:armstrong.dev
267
+ armstrong:armstrong.esi
268
+ armstrong:armstrong.hatband
269
+ armstrong:armstrong.templates.standard
270
+ armstrong:armstrong.utils.backends
271
+ armstrong:armstrong.utils.celery
272
+ arstecnica:arstecnica.raccoon.autobahn
273
+ arstecnica:arstecnica.sqlalchemy.async
274
+ article-downloader:article_downloader
275
+ artifactcli:artifact_cli
276
+ arvados:arvados_python_client
277
+ arvados_cwl:arvados_cwl_runner
278
+ arvnodeman:arvados_node_manager
279
+ asana_to_github:AsanaToGithub
280
+ asciibinary:AsciiBinaryConverter
281
+ asd:AdvancedSearchDiscovery
282
+ askbot:askbot_tuan
283
+ askbot:askbot_tuanpa
284
+ asnhistory:asnhistory_redis
285
+ aspen_jinja2_renderer:aspen_jinja2
286
+ aspen_tornado_engine:aspen_tornado
287
+ asprise_ocr_api:asprise_ocr_sdk_python_api
288
+ aspy:aspy.refactor_imports
289
+ aspy:aspy.yaml
290
+ asterisk:asterisk_ami
291
+ asts:add_asts
292
+ asymmetricbase:asymmetricbase.enum
293
+ asymmetricbase:asymmetricbase.fields
294
+ asymmetricbase:asymmetricbase.logging
295
+ asymmetricbase:asymmetricbase.utils
296
+ asyncirc:asyncio_irc
297
+ asyncmongoorm:asyncmongoorm_je
298
+ asyncssh:asyncssh_unofficial
299
+ athletelist:athletelistyy
300
+ atm:automium
301
+ atmosphere:atmosphere_python_client
302
+ atom:gdata
303
+ atomic:AtomicWrite
304
+ atomisator:atomisator.db
305
+ atomisator:atomisator.enhancers
306
+ atomisator:atomisator.feed
307
+ atomisator:atomisator.indexer
308
+ atomisator:atomisator.outputs
309
+ atomisator:atomisator.parser
310
+ atomisator:atomisator.readers
311
+ atreal:atreal.cmfeditions.unlocker
312
+ atreal:atreal.filestorage.common
313
+ atreal:atreal.layouts
314
+ atreal:atreal.mailservices
315
+ atreal:atreal.massloader
316
+ atreal:atreal.monkeyplone
317
+ atreal:atreal.override.albumview
318
+ atreal:atreal.richfile.preview
319
+ atreal:atreal.richfile.qualifier
320
+ atreal:atreal.usersinout
321
+ atsim:atsim.potentials
322
+ attractsdk:attract_sdk
323
+ audio:audio.bitstream
324
+ audio:audio.coders
325
+ audio:audio.filters
326
+ audio:audio.fourier
327
+ audio:audio.frames
328
+ audio:audio.lp
329
+ audio:audio.psychoacoustics
330
+ audio:audio.quantizers
331
+ audio:audio.shrink
332
+ audio:audio.wave
333
+ aufrefer:auf_refer
334
+ auslfe:auslfe.formonline.content
335
+ auspost:auspost_apis
336
+ auth0:auth0_python
337
+ auth_server_client:AuthServerClient
338
+ authorize:AuthorizeSauce
339
+ authzpolicy:AuthzPolicyPlugin
340
+ autobahn:autobahn_rce
341
+ avatar:geonode_avatar
342
+ awebview:android_webview
343
+ azure:azure_common
344
+ azure:azure_mgmt_common
345
+ azure:azure_mgmt_compute
346
+ azure:azure_mgmt_network
347
+ azure:azure_mgmt_nspkg
348
+ azure:azure_mgmt_resource
349
+ azure:azure_mgmt_storage
350
+ azure:azure_nspkg
351
+ azure:azure_servicebus
352
+ azure:azure_servicemanagement_legacy
353
+ azure:azure_storage
354
+ b2gcommands:b2g_commands
355
+ b2gperf:b2gperf_v1.3
356
+ b2gperf:b2gperf_v1.4
357
+ b2gperf:b2gperf_v2.0
358
+ b2gperf:b2gperf_v2.1
359
+ b2gperf:b2gperf_v2.2
360
+ b2gpopulate:b2gpopulate_v1.3
361
+ b2gpopulate:b2gpopulate_v1.4
362
+ b2gpopulate:b2gpopulate_v2.0
363
+ b2gpopulate:b2gpopulate_v2.1
364
+ b2gpopulate:b2gpopulate_v2.2
365
+ b3j0f:b3j0f.annotation
366
+ b3j0f:b3j0f.aop
367
+ b3j0f:b3j0f.conf
368
+ b3j0f:b3j0f.sync
369
+ b3j0f:b3j0f.utils
370
+ babel:Babel
371
+ babelglade:BabelGladeExtractor
372
+ backplane:backplane2_pyclient
373
+ backport_abcoll:backport_collections
374
+ backports:backports.functools_lru_cache
375
+ backports:backports.inspect
376
+ backports:backports.pbkdf2
377
+ backports:backports.shutil_get_terminal_size
378
+ backports:backports.socketpair
379
+ backports:backports.ssl
380
+ backports:backports.ssl_match_hostname
381
+ backports:backports.statistics
382
+ badgekit:badgekit_api_client
383
+ badlinks:BadLinksPlugin
384
+ bael:bael.project
385
+ baidu:baidupy
386
+ balrog:buildtools
387
+ baluhn:baluhn_redux
388
+ bamboo:bamboo.pantrybell
389
+ bamboo:bamboo.scaffold
390
+ bamboo:bamboo.setuptools_version
391
+ bamboo:bamboo_data
392
+ bamboo:bamboo_server
393
+ bambu:bambu_codemirror
394
+ bambu:bambu_dataportability
395
+ bambu:bambu_enqueue
396
+ bambu:bambu_faq
397
+ bambu:bambu_ffmpeg
398
+ bambu:bambu_grids
399
+ bambu:bambu_international
400
+ bambu:bambu_jwplayer
401
+ bambu:bambu_minidetect
402
+ bambu:bambu_navigation
403
+ bambu:bambu_notifications
404
+ bambu:bambu_payments
405
+ bambu:bambu_pusher
406
+ bambu:bambu_saas
407
+ bambu:bambu_sites
408
+ banana:Bananas
409
+ banana:banana.maya
410
+ bang:bangtext
411
+ barcode:barcode_generator
412
+ bark:bark_ssg
413
+ barking_owl:BarkingOwl
414
+ bart:bart_py
415
+ basalt:basalt_tasks
416
+ base62:base_62
417
+ basemap:basemap_Jim
418
+ bash:bash_toolbelt
419
+ bashutils:Python_Bash_Utils
420
+ basic_http:BasicHttp
421
+ basil:basil_daq
422
+ batchapps:azure_batch_apps
423
+ bcrypt:python_bcrypt
424
+ beaker:Beaker
425
+ beetsplug:beets
426
+ begin:begins
427
+ benchit:bench_it
428
+ beproud:beproud.utils
429
+ bfillings:burrito_fillings
430
+ bigjob:BigJob
431
+ billboard:billboard.py
432
+ binstar_build_client:anaconda_build
433
+ binstar_client:anaconda_client
434
+ biocommons:biocommons.dev
435
+ birdhousebuilder:birdhousebuilder.recipe.conda
436
+ birdhousebuilder:birdhousebuilder.recipe.docker
437
+ birdhousebuilder:birdhousebuilder.recipe.redis
438
+ birdhousebuilder:birdhousebuilder.recipe.supervisor
439
+ blender26-meshio:pymeshio
440
+ bootstrap:BigJob
441
+ borg:borg.localrole
442
+ bow:bagofwords
443
+ bpdb:bpython
444
+ bqapi:bisque_api
445
+ braces:django_braces
446
+ briefscaster:briefs_caster
447
+ brisa_media_server/plugins:brisa_media_server_plugins
448
+ brkt_requests:brkt_sdk
449
+ broadcastlogging:broadcast_logging
450
+ brocadetool:brocade_tool
451
+ bronto:bronto_python
452
+ brownie:Brownie
453
+ browsermobproxy:browsermob_proxy
454
+ brubeckmysql:brubeck_mysql
455
+ brubeckoauth:brubeck_oauth
456
+ brubeckservice:brubeck_service
457
+ brubeckuploader:brubeck_uploader
458
+ bs4:beautifulsoup4
459
+ bson:pymongo
460
+ bst:bst.pygasus.core
461
+ bst:bst.pygasus.datamanager
462
+ bst:bst.pygasus.demo
463
+ bst:bst.pygasus.i18n
464
+ bst:bst.pygasus.resources
465
+ bst:bst.pygasus.scaffolding
466
+ bst:bst.pygasus.security
467
+ bst:bst.pygasus.session
468
+ bst:bst.pygasus.wsgi
469
+ btable:btable_py
470
+ btapi:bananatag_api
471
+ btceapi:btce_api
472
+ btcebot:btce_bot
473
+ btsync:btsync.py
474
+ buck:buck.pprint
475
+ bud:bud.nospam
476
+ budy:budy_api
477
+ buffer:buffer_alpaca
478
+ buggd:bug.gd
479
+ bugle:bugle_sites
480
+ bugspots:bug_spots
481
+ bugzilla:python_bugzilla
482
+ bugzscout:bugzscout_py
483
+ buildTools:ajk_ios_buildTools
484
+ buildnotifylib:BuildNotify
485
+ buildout:buildout.bootstrap
486
+ buildout:buildout.disablessl
487
+ buildout:buildout.dumppickedversions
488
+ buildout:buildout.dumppickedversions2
489
+ buildout:buildout.dumprequirements
490
+ buildout:buildout.eggnest
491
+ buildout:buildout.eggscleaner
492
+ buildout:buildout.eggsdirectories
493
+ buildout:buildout.eggtractor
494
+ buildout:buildout.extensionscripts
495
+ buildout:buildout.locallib
496
+ buildout:buildout.packagename
497
+ buildout:buildout.recipe.isolation
498
+ buildout:buildout.removeaddledeggs
499
+ buildout:buildout.requirements
500
+ buildout:buildout.sanitycheck
501
+ buildout:buildout.sendpickedversions
502
+ buildout:buildout.threatlevel
503
+ buildout:buildout.umask
504
+ buildout:buildout.variables
505
+ buildslave:buildbot_slave
506
+ builtins:pies2overrides
507
+ bumper:bumper_lib
508
+ bumple:bumple_downloader
509
+ bundesliga:bundesliga_cli
510
+ bundlemaker:bundlemanager
511
+ burpui:burp_ui
512
+ busyflow:busyflow.pivotal
513
+ buttercms-django:buttercms_django
514
+ buzz:buzz_python_client
515
+ bvc:buildout_versions_checker
516
+ bvggrabber:bvg_grabber
517
+ byond:BYONDTools
518
+ bzETL:Bugzilla_ETL
519
+ bzlib:bugzillatools
520
+ bzrlib:bzr
521
+ bzrlib:bzr_automirror
522
+ bzrlib:bzr_bash_completion
523
+ bzrlib:bzr_colo
524
+ bzrlib:bzr_killtrailing
525
+ bzrlib:bzr_pqm
526
+ c2c:c2c.cssmin
527
+ c2c:c2c.recipe.closurecompile
528
+ c2c:c2c.recipe.cssmin
529
+ c2c:c2c.recipe.jarfile
530
+ c2c:c2c.recipe.msgfmt
531
+ c2c:c2c.recipe.pkgversions
532
+ c2c:c2c.sqlalchemy.rest
533
+ c2c:c2c.versions
534
+ c2c_recipe_facts:c2c.recipe.facts
535
+ cabalgata:cabalgata_silla_de_montar
536
+ cabalgata:cabalgata_zookeeper
537
+ cache_utils:django_cache_utils
538
+ captcha:django_recaptcha
539
+ cartridge:Cartridge
540
+ cassandra:cassandra_driver
541
+ cassandralauncher:CassandraLauncher
542
+ cc42:42qucc
543
+ cerberus:Cerberus
544
+ cfnlint:cfn-lint
545
+ chameleon:Chameleon
546
+ charmtools:charm_tools
547
+ chef:PyChef
548
+ chip8:c8d
549
+ cjson:python_cjson
550
+ classytags:django_classy_tags
551
+ cloghandler:ConcurrentLogHandler
552
+ clonevirtualenv:virtualenv_clone
553
+ cloud-insight:al_cloudinsight
554
+ cloud_admin:adminapi
555
+ cloudservers:python_cloudservers
556
+ clusterconsole:cerebrod
557
+ clustersitter:cerebrod
558
+ cms:django_cms
559
+ colander:ba_colander
560
+ colors:ansicolors
561
+ compile:bf_lc3
562
+ compose:docker_compose
563
+ compressor:django_compressor
564
+ concurrent:futures
565
+ configargparse:ConfigArgParse
566
+ configparser:pies2overrides
567
+ contracts:PyContracts
568
+ coordination:BigJob
569
+ copyreg:pies2overrides
570
+ corebio:weblogo
571
+ couchapp:Couchapp
572
+ couchdb:CouchDB
573
+ couchdbcurl:couchdb_python_curl
574
+ courseradownloader:coursera_dl
575
+ cow:cow_framework
576
+ creole:python_creole
577
+ creoleparser:Creoleparser
578
+ crispy_forms:django_crispy_forms
579
+ cronlog:python_crontab
580
+ crontab:python_crontab
581
+ ctff:tff
582
+ cups:pycups
583
+ curator:elasticsearch_curator
584
+ curl:pycurl
585
+ daemon:python_daemon
586
+ dare:DARE
587
+ dateutil:python_dateutil
588
+ dawg:DAWG
589
+ deb822:python_debian
590
+ debian:python_debian
591
+ decouple:python-decouple
592
+ demo:webunit
593
+ demosongs:PySynth
594
+ deployer:juju_deployer
595
+ depot:filedepot
596
+ devtools:tg.devtools
597
+ dgis:2gis
598
+ dhtmlparser:pyDHTMLParser
599
+ digitalocean:python_digitalocean
600
+ discord:discord.py
601
+ distribute_setup:ez_setup
602
+ distutils2:Distutils2
603
+ django:Django
604
+ django_hstore:amitu_hstore
605
+ djangobower:django_bower
606
+ djcelery:django_celery
607
+ djkombu:django_kombu
608
+ djorm_pgarray:djorm_ext_pgarray
609
+ dns:dnspython
610
+ docgen:ansible_docgenerator
611
+ docker:docker_py
612
+ dogpile:dogpile.cache
613
+ dogpile:dogpile.core
614
+ dogshell:dogapi
615
+ dot_parser:pydot
616
+ dot_parser:pydot2
617
+ dot_parser:pydot3k
618
+ dotenv:python-dotenv
619
+ dpkt:dpkt_fix
620
+ dsml:python_ldap
621
+ durationfield:django_durationfield
622
+ dzclient:datazilla
623
+ easybuild:easybuild_framework
624
+ editor:python_editor
625
+ elasticluster:azure_elasticluster
626
+ elasticluster:azure_elasticluster_current
627
+ elftools:pyelftools
628
+ elixir:Elixir
629
+ em:empy
630
+ emlib:empy
631
+ enchant:pyenchant
632
+ encutils:cssutils
633
+ engineio:python_engineio
634
+ enum:enum34
635
+ ephem:pyephem
636
+ errorreporter:abl.errorreporter
637
+ esplot:beaker_es_plot
638
+ example:adrest
639
+ examples:tweepy
640
+ ez_setup:pycassa
641
+ fabfile:Fabric
642
+ fabric:Fabric
643
+ faker:Faker
644
+ fdpexpect:pexpect
645
+ fedora:python_fedora
646
+ fias:ailove_django_fias
647
+ fiftyone_degrees:51degrees_mobile_detector
648
+ five:five.customerize
649
+ five:five.globalrequest
650
+ five:five.intid
651
+ five:five.localsitemanager
652
+ five:five.pt
653
+ flasher:android_flasher
654
+ flask:Flask
655
+ flask_frozen:Frozen_Flask
656
+ flask_redis:Flask_And_Redis
657
+ flaskext:Flask_Bcrypt
658
+ flvscreen:vnc2flv
659
+ followit:django_followit
660
+ forge:pyforge
661
+ formencode:FormEncode
662
+ formtools:django_formtools
663
+ fourch:4ch
664
+ franz:allegrordf
665
+ freetype:freetype_py
666
+ frontmatter:python_frontmatter
667
+ ftpcloudfs:ftp_cloudfs
668
+ funtests:librabbitmq
669
+ fuse:fusepy
670
+ fuzzy:Fuzzy
671
+ gabbi:tiddlyweb
672
+ gen_3dwallet:3d_wallet_generator
673
+ gendimen:android_gendimen
674
+ genshi:Genshi
675
+ geohash:python_geohash
676
+ geonode:GeoNode
677
+ geoserver:gsconfig
678
+ geraldo:Geraldo
679
+ getenv:django_getenv
680
+ geventwebsocket:gevent_websocket
681
+ gflags:python_gflags
682
+ git:GitPython
683
+ github:PyGithub
684
+ github3:github3.py
685
+ gitpy:git_py
686
+ globusonline:globusonline_transfer_api_client
687
+ google:protobuf
688
+ googleapiclient:google_api_python_client
689
+ grace-dizmo:grace_dizmo
690
+ grammar:anovelmous_grammar
691
+ grapheneapi:graphenelib
692
+ greplin:scales
693
+ gridfs:pymongo
694
+ grokcore:grokcore.component
695
+ gslib:gsutil
696
+ hamcrest:PyHamcrest
697
+ harpy:HARPy
698
+ hawk:PyHawk_with_a_single_extra_commit
699
+ haystack:django_haystack
700
+ hgext:mercurial
701
+ hggit:hg_git
702
+ hglib:python_hglib
703
+ ho:pisa
704
+ hola:amarokHola
705
+ hoover:Hoover
706
+ hostlist:python_hostlist
707
+ html:pies2overrides
708
+ htmloutput:nosehtmloutput
709
+ http:pies2overrides
710
+ hvad:django_hvad
711
+ hydra:hydra-core
712
+ i99fix:199Fix
713
+ igraph:python_igraph
714
+ imdb:IMDbPY
715
+ impala:impyla
716
+ inmemorystorage:ambition_inmemorystorage
717
+ ipaddress:backport_ipaddress
718
+ jaraco:jaraco.timing
719
+ jaraco:jaraco.util
720
+ jinja2:Jinja2
721
+ jiracli:jira_cli
722
+ johnny:johnny_cache
723
+ jpgrid:python_geohash
724
+ jpiarea:python_geohash
725
+ jpype:JPype1
726
+ jpypex:JPype1
727
+ jsonfield:django_jsonfield
728
+ jstools:aino_jstools
729
+ jupyterpip:jupyter_pip
730
+ jwt:PyJWT
731
+ kazoo:asana_kazoo
732
+ kernprof:line_profiler
733
+ keyczar:python_keyczar
734
+ keyedcache:django_keyedcache
735
+ keystoneclient:python_keystoneclient
736
+ kickstarter:kickstart
737
+ krbv:krbV
738
+ kss:kss.core
739
+ kuyruk:Kuyruk
740
+ langconv:AdvancedLangConv
741
+ lava:lava_utils_interface
742
+ lazr:lazr.authentication
743
+ lazr:lazr.restfulclient
744
+ lazr:lazr.uri
745
+ ldap:python_ldap
746
+ ldaplib:adpasswd
747
+ ldapurl:python_ldap
748
+ ldif:python_ldap
749
+ lib2or3:2or3
750
+ lib3to2:3to2
751
+ libaito:Aito
752
+ libbe:bugs_everywhere
753
+ libbucket:bucket
754
+ libcloud:apache_libcloud
755
+ libfuturize:future
756
+ libgenerateDS:generateDS
757
+ libmproxy:mitmproxy
758
+ libpasteurize:future
759
+ libsvm:7lk_ocr_deploy
760
+ lisa:lisa_server
761
+ loadingandsaving:aspose_words_java_for_python
762
+ locust:locustio
763
+ logbook:Logbook
764
+ logentries:buildbot_status_logentries
765
+ logilab:logilab_mtconverter
766
+ machineconsole:cerebrod
767
+ machinesitter:cerebrod
768
+ magic:python_magic
769
+ mako:Mako
770
+ manifestparser:ManifestDestiny
771
+ marionette:marionette_client
772
+ markdown:Markdown
773
+ marks:pytest_marks
774
+ markupsafe:MarkupSafe
775
+ mavnative:pymavlink
776
+ memcache:python_memcached
777
+ metacomm:AllPairs
778
+ metaphone:Metafone
779
+ metlog:metlog_py
780
+ mezzanine:Mezzanine
781
+ migrate:sqlalchemy_migrate
782
+ mimeparse:python_mimeparse
783
+ minitage:minitage.paste
784
+ minitage:minitage.recipe.common
785
+ missingdrawables:android_missingdrawables
786
+ mixfiles:PySynth
787
+ mkfreq:PySynth
788
+ mkrst_themes:2lazy2rest
789
+ mockredis:mockredispy
790
+ modargs:python_modargs
791
+ model_utils:django_model_utils
792
+ models:asposebarcode
793
+ models:asposestorage
794
+ moksha:moksha.common
795
+ moksha:moksha.hub
796
+ moksha:moksha.wsgi
797
+ moneyed:py_moneyed
798
+ mongoalchemy:MongoAlchemy
799
+ monthdelta:MonthDelta
800
+ mopidy:Mopidy
801
+ mopytools:MoPyTools
802
+ mptt:django_mptt
803
+ mpv:python-mpv
804
+ mrbob:mr.bob
805
+ msgpack:msgpack_python
806
+ mutations:aino_mutations
807
+ mws:amazon_mws
808
+ mysql:mysql_connector_python
809
+ native_tags:django_native_tags
810
+ ndg:ndg_httpsclient
811
+ nereid:trytond_nereid
812
+ nested:baojinhuan
813
+ nester:Amauri
814
+ nester:abofly
815
+ nester:bssm_pythonSig
816
+ novaclient:python_novaclient
817
+ oauth2_provider:alauda_django_oauth
818
+ oauth2client:oauth2client
819
+ odf:odfpy
820
+ ometa:Parsley
821
+ openid:python_openid
822
+ opensearchsdk:ali_opensearch
823
+ oslo_i18n:oslo.i18n
824
+ oslo_serialization:oslo.serialization
825
+ oslo_utils:oslo.utils
826
+ oss:alioss
827
+ oss:aliyun_python_sdk_oss
828
+ oss:aliyunoss
829
+ output:cashew
830
+ owslib:OWSLib
831
+ packetdiag:nwdiag
832
+ paho:paho_mqtt
833
+ paintstore:django_paintstore
834
+ parler:django_parler
835
+ past:future
836
+ paste:PasteScript
837
+ path:forked_path
838
+ path:path.py
839
+ patricia:patricia-trie
840
+ paver:Paver
841
+ peak:ProxyTypes
842
+ picasso:anderson.picasso
843
+ picklefield:django-picklefield
844
+ pilot:BigJob
845
+ pivotal:pivotal_py
846
+ play_wav:PySynth
847
+ playhouse:peewee
848
+ plivoxml:plivo
849
+ plone:plone.alterego
850
+ plone:plone.api
851
+ plone:plone.app.blob
852
+ plone:plone.app.collection
853
+ plone:plone.app.content
854
+ plone:plone.app.contentlisting
855
+ plone:plone.app.contentmenu
856
+ plone:plone.app.contentrules
857
+ plone:plone.app.contenttypes
858
+ plone:plone.app.controlpanel
859
+ plone:plone.app.customerize
860
+ plone:plone.app.dexterity
861
+ plone:plone.app.discussion
862
+ plone:plone.app.event
863
+ plone:plone.app.folder
864
+ plone:plone.app.i18n
865
+ plone:plone.app.imaging
866
+ plone:plone.app.intid
867
+ plone:plone.app.layout
868
+ plone:plone.app.linkintegrity
869
+ plone:plone.app.locales
870
+ plone:plone.app.lockingbehavior
871
+ plone:plone.app.multilingual
872
+ plone:plone.app.portlets
873
+ plone:plone.app.querystring
874
+ plone:plone.app.redirector
875
+ plone:plone.app.registry
876
+ plone:plone.app.relationfield
877
+ plone:plone.app.textfield
878
+ plone:plone.app.theming
879
+ plone:plone.app.users
880
+ plone:plone.app.uuid
881
+ plone:plone.app.versioningbehavior
882
+ plone:plone.app.viewletmanager
883
+ plone:plone.app.vocabularies
884
+ plone:plone.app.widgets
885
+ plone:plone.app.workflow
886
+ plone:plone.app.z3cform
887
+ plone:plone.autoform
888
+ plone:plone.batching
889
+ plone:plone.behavior
890
+ plone:plone.browserlayer
891
+ plone:plone.caching
892
+ plone:plone.contentrules
893
+ plone:plone.dexterity
894
+ plone:plone.event
895
+ plone:plone.folder
896
+ plone:plone.formwidget.namedfile
897
+ plone:plone.formwidget.recurrence
898
+ plone:plone.i18n
899
+ plone:plone.indexer
900
+ plone:plone.intelligenttext
901
+ plone:plone.keyring
902
+ plone:plone.locking
903
+ plone:plone.memoize
904
+ plone:plone.namedfile
905
+ plone:plone.outputfilters
906
+ plone:plone.portlet.collection
907
+ plone:plone.portlet.static
908
+ plone:plone.portlets
909
+ plone:plone.protect
910
+ plone:plone.recipe.zope2install
911
+ plone:plone.registry
912
+ plone:plone.resource
913
+ plone:plone.resourceeditor
914
+ plone:plone.rfc822
915
+ plone:plone.scale
916
+ plone:plone.schema
917
+ plone:plone.schemaeditor
918
+ plone:plone.session
919
+ plone:plone.stringinterp
920
+ plone:plone.subrequest
921
+ plone:plone.supermodel
922
+ plone:plone.synchronize
923
+ plone:plone.theme
924
+ plone:plone.transformchain
925
+ plone:plone.uuid
926
+ plone:plone.z3cform
927
+ plonetheme:plonetheme.barceloneta
928
+ png:pypng
929
+ polymorphic:django_polymorphic
930
+ postmark:python_postmark
931
+ powerprompt:bash_powerprompt
932
+ prefetch:django-prefetch
933
+ printList:AndrewList
934
+ progressbar:progressbar2
935
+ progressbar:progressbar33
936
+ provider:django_oauth2_provider
937
+ puresasl:pure_sasl
938
+ pwiz:peewee
939
+ pxssh:pexpect
940
+ py7zlib:pylzma
941
+ pyAMI:pyAMI_core
942
+ pyarsespyder:arsespyder
943
+ pyasdf:asdf
944
+ pyaspell:aspell_python_ctypes
945
+ pybb:pybbm
946
+ pybloomfilter:pybloomfiltermmap
947
+ pyccuracy:Pyccuracy
948
+ pyck:PyCK
949
+ pycrfsuite:python_crfsuite
950
+ pydispatch:PyDispatcher
951
+ pygeolib:pygeocoder
952
+ pygments:Pygments
953
+ pygraph:python_graph_core
954
+ pyjon:pyjon.utils
955
+ pyjsonrpc:python_jsonrpc
956
+ pykka:Pykka
957
+ pylogo:PyLogo
958
+ pylons:adhocracy_Pylons
959
+ pymagic:libmagic
960
+ pymycraawler:Amalwebcrawler
961
+ pynma:AbakaffeNotifier
962
+ pyphen:Pyphen
963
+ pyrimaa:AEI
964
+ pysideuic:PySide
965
+ pysqlite2:adhocracy_pysqlite
966
+ pysqlite2:pysqlite
967
+ pysynth_b:PySynth
968
+ pysynth_beeper:PySynth
969
+ pysynth_c:PySynth
970
+ pysynth_d:PySynth
971
+ pysynth_e:PySynth
972
+ pysynth_p:PySynth
973
+ pysynth_s:PySynth
974
+ pysynth_samp:PySynth
975
+ pythongettext:python_gettext
976
+ pythonjsonlogger:python_json_logger
977
+ pyutilib:PyUtilib
978
+ pyximport:Cython
979
+ qs:qserve
980
+ quadtree:python_geohash
981
+ queue:future
982
+ quickapi:django_quickapi
983
+ quickunit:nose_quickunit
984
+ rackdiag:nwdiag
985
+ radical:radical.pilot
986
+ radical:radical.utils
987
+ reStructuredText:Zope2
988
+ readability:readability_lxml
989
+ readline:gnureadline
990
+ recaptcha_works:django_recaptcha_works
991
+ relstorage:RelStorage
992
+ reportapi:django_reportapi
993
+ reprlib:pies2overrides
994
+ requests:Requests
995
+ requirements:requirements_parser
996
+ rest_framework:djangorestframework
997
+ restclient:py_restclient
998
+ retrial:async_retrial
999
+ reversion:django_reversion
1000
+ rhaptos2:rhaptos2.common
1001
+ robot:robotframework
1002
+ robots:django_robots
1003
+ rosdep2:rosdep
1004
+ rsbackends:RSFile
1005
+ ruamel:ruamel.base
1006
+ s2repoze:pysaml2
1007
+ saga:saga_python
1008
+ saml2:pysaml2
1009
+ samtranslator:aws-sam-translator
1010
+ sass:libsass
1011
+ sassc:libsass
1012
+ sasstests:libsass
1013
+ sassutils:libsass
1014
+ sayhi:alex_sayhi
1015
+ scalrtools:scalr
1016
+ scikits:scikits.talkbox
1017
+ scratch:scratchpy
1018
+ screen:pexpect
1019
+ scss:pyScss
1020
+ sdict:dict.sorted
1021
+ sdk_updater:android_sdk_updater
1022
+ sekizai:django_sekizai
1023
+ sendfile:pysendfile
1024
+ serial:pyserial
1025
+ setuputils:astor
1026
+ shapefile:pyshp
1027
+ shapely:Shapely
1028
+ sika:ahonya_sika
1029
+ singleton:pysingleton
1030
+ sittercommon:cerebrod
1031
+ skbio:scikit_bio
1032
+ sklearn:scikit_learn
1033
+ slack:slackclient
1034
+ slugify:unicode_slugify
1035
+ slugify:python-slugify
1036
+ smarkets:smk_python_sdk
1037
+ snappy:ctypes_snappy
1038
+ socketio:python-socketio
1039
+ socketserver:pies2overrides
1040
+ sockjs:sockjs_tornado
1041
+ socks:SocksiPy_branch
1042
+ solr:solrpy
1043
+ solution:Solution
1044
+ sorl:sorl_thumbnail
1045
+ south:South
1046
+ sphinx:Sphinx
1047
+ sphinx_pypi_upload:ATD_document
1048
+ sphinxcontrib:sphinxcontrib_programoutput
1049
+ sqlalchemy:SQLAlchemy
1050
+ src:atlas
1051
+ src:auto_mix_prep
1052
+ stats_toolkit:bw_stats_toolkit
1053
+ statsd:dogstatsd_python
1054
+ stdnum:python_stdnum
1055
+ stoneagehtml:StoneageHTML
1056
+ storages:django_storages
1057
+ stubout:mox
1058
+ suds:suds_jurko
1059
+ swiftclient:python_swiftclient
1060
+ sx:pisa
1061
+ tabix:pytabix
1062
+ taggit:django_taggit
1063
+ tasksitter:cerebrod
1064
+ tastypie:django_tastypie
1065
+ teamcity:teamcity_messages
1066
+ telebot:pyTelegramBotAPI
1067
+ telegram:python-telegram-bot
1068
+ tempita:Tempita
1069
+ tenjin:Tenjin
1070
+ termstyle:python_termstyle
1071
+ test:pytabix
1072
+ thclient:treeherder_client
1073
+ threaded_multihost:django_threaded_multihost
1074
+ threecolor:3color_Press
1075
+ tidylib:pytidylib
1076
+ tkinter:future
1077
+ tlw:3lwg
1078
+ toredis:toredis_fork
1079
+ tornadoredis:tornado_redis
1080
+ tower_cli:ansible_tower_cli
1081
+ trac:Trac
1082
+ tracopt:Trac
1083
+ translation_helper:android_localization_helper
1084
+ treebeard:django_treebeard
1085
+ trytond:trytond_stock
1086
+ tsuru:tsuru_circus
1087
+ tvrage:python_tvrage
1088
+ tw2:tw2.core
1089
+ tw2:tw2.d3
1090
+ tw2:tw2.dynforms
1091
+ tw2:tw2.excanvas
1092
+ tw2:tw2.forms
1093
+ tw2:tw2.jit
1094
+ tw2:tw2.jqplugins.flot
1095
+ tw2:tw2.jqplugins.gritter
1096
+ tw2:tw2.jqplugins.ui
1097
+ tw2:tw2.jquery
1098
+ tw2:tw2.sqla
1099
+ twisted:Twisted
1100
+ twitter:python_twitter
1101
+ txclib:transifex_client
1102
+ u115:115wangpan
1103
+ unidecode:Unidecode
1104
+ universe:ansible_universe
1105
+ usb:pyusb
1106
+ useless:useless.pipes
1107
+ userpass:auth_userpass
1108
+ utilities:automakesetup.py
1109
+ utkik:aino_utkik
1110
+ uwsgidecorators:uWSGI
1111
+ valentine:ab
1112
+ validate:configobj
1113
+ version:chartio
1114
+ virtualenvapi:ar_virtualenv_api
1115
+ vyatta:brocade_plugins
1116
+ webdav:Zope2
1117
+ weblogolib:weblogo
1118
+ webob:WebOb
1119
+ websocket:websocket_client
1120
+ webtest:WebTest
1121
+ werkzeug:Werkzeug
1122
+ wheezy:wheezy.caching
1123
+ wheezy:wheezy.core
1124
+ wheezy:wheezy.http
1125
+ wikklytext:tiddlywebwiki
1126
+ winreg:future
1127
+ winrm:pywinrm
1128
+ workflow:Alfred_Workflow
1129
+ wsmeext:WSME
1130
+ wtforms:WTForms
1131
+ wtfpeewee:wtf_peewee
1132
+ xdg:pyxdg
1133
+ xdist:pytest_xdist
1134
+ xmldsig:pysaml2
1135
+ xmlenc:pysaml2
1136
+ xmlrpc:pies2overrides
1137
+ xmpp:xmpppy
1138
+ xstatic:XStatic_Font_Awesome
1139
+ xstatic:XStatic_jQuery
1140
+ xstatic:XStatic_jquery_ui
1141
+ yaml:PyYAML
1142
+ z3c:z3c.autoinclude
1143
+ z3c:z3c.caching
1144
+ z3c:z3c.form
1145
+ z3c:z3c.formwidget.query
1146
+ z3c:z3c.objpath
1147
+ z3c:z3c.pt
1148
+ z3c:z3c.relationfield
1149
+ z3c:z3c.traverser
1150
+ z3c:z3c.zcmlhook
1151
+ zmq:pyzmq
1152
+ zopyx:zopyx.textindexng3
goex/exec_engine/pips/stdlib.txt ADDED
@@ -0,0 +1,1785 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _abc
2
+ abc
3
+ aifc
4
+ _aix_support
5
+ antigravity
6
+ argparse
7
+ array
8
+ _ast
9
+ ast
10
+ asynchat
11
+ _asyncio
12
+ asyncio
13
+ asyncio.base_events
14
+ asyncio.base_futures
15
+ asyncio.base_subprocess
16
+ asyncio.base_tasks
17
+ asyncio.constants
18
+ asyncio.coroutines
19
+ asyncio.events
20
+ asyncio.exceptions
21
+ asyncio.format_helpers
22
+ asyncio.futures
23
+ asyncio.locks
24
+ asyncio.log
25
+ asyncio.__main__
26
+ asyncio.proactor_events
27
+ asyncio.protocols
28
+ asyncio.queues
29
+ asyncio.runners
30
+ asyncio.selector_events
31
+ asyncio.sslproto
32
+ asyncio.staggered
33
+ asyncio.streams
34
+ asyncio.subprocess
35
+ asyncio.tasks
36
+ asyncio.threads
37
+ asyncio.transports
38
+ asyncio.trsock
39
+ asyncio.unix_events
40
+ asyncio.windows_events
41
+ asyncio.windows_utils
42
+ asyncore
43
+ atexit
44
+ audioop
45
+ base64
46
+ bdb
47
+ binascii
48
+ binhex
49
+ _bisect
50
+ bisect
51
+ _blake2
52
+ _bootlocale
53
+ _bootsubprocess
54
+ builtins
55
+ _bz2
56
+ bz2
57
+ calendar
58
+ cgi
59
+ cgitb
60
+ chunk
61
+ cmath
62
+ cmd
63
+ code
64
+ _codecs
65
+ codecs
66
+ _codecs_cn
67
+ _codecs_hk
68
+ _codecs_iso2022
69
+ _codecs_jp
70
+ _codecs_kr
71
+ _codecs_tw
72
+ codeop
73
+ _collections
74
+ collections
75
+ _collections_abc
76
+ collections.abc
77
+ colorsys
78
+ _compat_pickle
79
+ compileall
80
+ _compression
81
+ concurrent
82
+ concurrent.futures
83
+ concurrent.futures._base
84
+ concurrent.futures.process
85
+ concurrent.futures.thread
86
+ configparser
87
+ contextlib
88
+ _contextvars
89
+ contextvars
90
+ copy
91
+ copyreg
92
+ cProfile
93
+ _crypt
94
+ crypt
95
+ _csv
96
+ csv
97
+ _ctypes
98
+ ctypes
99
+ ctypes._aix
100
+ ctypes._endian
101
+ ctypes.macholib
102
+ ctypes.macholib.dyld
103
+ ctypes.macholib.dylib
104
+ ctypes.macholib.framework
105
+ _ctypes_test
106
+ ctypes.test
107
+ ctypes.test.__main__
108
+ ctypes.test.test_anon
109
+ ctypes.test.test_array_in_pointer
110
+ ctypes.test.test_arrays
111
+ ctypes.test.test_as_parameter
112
+ ctypes.test.test_bitfields
113
+ ctypes.test.test_buffers
114
+ ctypes.test.test_bytes
115
+ ctypes.test.test_byteswap
116
+ ctypes.test.test_callbacks
117
+ ctypes.test.test_cast
118
+ ctypes.test.test_cfuncs
119
+ ctypes.test.test_checkretval
120
+ ctypes.test.test_delattr
121
+ ctypes.test.test_errno
122
+ ctypes.test.test_find
123
+ ctypes.test.test_frombuffer
124
+ ctypes.test.test_funcptr
125
+ ctypes.test.test_functions
126
+ ctypes.test.test_incomplete
127
+ ctypes.test.test_init
128
+ ctypes.test.test_internals
129
+ ctypes.test.test_keeprefs
130
+ ctypes.test.test_libc
131
+ ctypes.test.test_loading
132
+ ctypes.test.test_macholib
133
+ ctypes.test.test_memfunctions
134
+ ctypes.test.test_numbers
135
+ ctypes.test.test_objects
136
+ ctypes.test.test_parameters
137
+ ctypes.test.test_pep3118
138
+ ctypes.test.test_pickling
139
+ ctypes.test.test_pointers
140
+ ctypes.test.test_prototypes
141
+ ctypes.test.test_python_api
142
+ ctypes.test.test_random_things
143
+ ctypes.test.test_refcounts
144
+ ctypes.test.test_repr
145
+ ctypes.test.test_returnfuncptrs
146
+ ctypes.test.test_simplesubclasses
147
+ ctypes.test.test_sizes
148
+ ctypes.test.test_slicing
149
+ ctypes.test.test_stringptr
150
+ ctypes.test.test_strings
151
+ ctypes.test.test_struct_fields
152
+ ctypes.test.test_structures
153
+ ctypes.test.test_unaligned_structures
154
+ ctypes.test.test_unicode
155
+ ctypes.test.test_values
156
+ ctypes.test.test_varsize_struct
157
+ ctypes.test.test_win32
158
+ ctypes.test.test_wintypes
159
+ ctypes.util
160
+ ctypes.wintypes
161
+ _curses
162
+ curses
163
+ curses.ascii
164
+ curses.has_key
165
+ _curses_panel
166
+ curses.panel
167
+ curses.textpad
168
+ dataclasses
169
+ _datetime
170
+ datetime
171
+ _dbm
172
+ dbm
173
+ dbm.dumb
174
+ dbm.gnu
175
+ dbm.ndbm
176
+ _decimal
177
+ decimal
178
+ difflib
179
+ dis
180
+ distutils
181
+ distutils.archive_util
182
+ distutils.bcppcompiler
183
+ distutils.ccompiler
184
+ distutils.cmd
185
+ distutils.command
186
+ distutils.command.bdist
187
+ distutils.command.bdist_dumb
188
+ distutils.command.bdist_msi
189
+ distutils.command.bdist_packager
190
+ distutils.command.bdist_rpm
191
+ distutils.command.bdist_wininst
192
+ distutils.command.build
193
+ distutils.command.build_clib
194
+ distutils.command.build_ext
195
+ distutils.command.build_py
196
+ distutils.command.build_scripts
197
+ distutils.command.check
198
+ distutils.command.clean
199
+ distutils.command.config
200
+ distutils.command.install
201
+ distutils.command.install_data
202
+ distutils.command.install_egg_info
203
+ distutils.command.install_headers
204
+ distutils.command.install_lib
205
+ distutils.command.install_scripts
206
+ distutils.command.register
207
+ distutils.command.sdist
208
+ distutils.command.upload
209
+ distutils.config
210
+ distutils.core
211
+ distutils.cygwinccompiler
212
+ distutils.debug
213
+ distutils.dep_util
214
+ distutils.dir_util
215
+ distutils.dist
216
+ distutils.errors
217
+ distutils.extension
218
+ distutils.fancy_getopt
219
+ distutils.filelist
220
+ distutils.file_util
221
+ distutils.log
222
+ distutils.msvc9compiler
223
+ distutils._msvccompiler
224
+ distutils.msvccompiler
225
+ distutils.spawn
226
+ distutils.sysconfig
227
+ distutils.tests
228
+ distutils.tests.support
229
+ distutils.tests.test_archive_util
230
+ distutils.tests.test_bdist
231
+ distutils.tests.test_bdist_dumb
232
+ distutils.tests.test_bdist_msi
233
+ distutils.tests.test_bdist_rpm
234
+ distutils.tests.test_bdist_wininst
235
+ distutils.tests.test_build
236
+ distutils.tests.test_build_clib
237
+ distutils.tests.test_build_ext
238
+ distutils.tests.test_build_py
239
+ distutils.tests.test_build_scripts
240
+ distutils.tests.test_check
241
+ distutils.tests.test_clean
242
+ distutils.tests.test_cmd
243
+ distutils.tests.test_config
244
+ distutils.tests.test_config_cmd
245
+ distutils.tests.test_core
246
+ distutils.tests.test_cygwinccompiler
247
+ distutils.tests.test_dep_util
248
+ distutils.tests.test_dir_util
249
+ distutils.tests.test_dist
250
+ distutils.tests.test_extension
251
+ distutils.tests.test_filelist
252
+ distutils.tests.test_file_util
253
+ distutils.tests.test_install
254
+ distutils.tests.test_install_data
255
+ distutils.tests.test_install_headers
256
+ distutils.tests.test_install_lib
257
+ distutils.tests.test_install_scripts
258
+ distutils.tests.test_log
259
+ distutils.tests.test_msvc9compiler
260
+ distutils.tests.test_msvccompiler
261
+ distutils.tests.test_register
262
+ distutils.tests.test_sdist
263
+ distutils.tests.test_spawn
264
+ distutils.tests.test_sysconfig
265
+ distutils.tests.test_text_file
266
+ distutils.tests.test_unixccompiler
267
+ distutils.tests.test_upload
268
+ distutils.tests.test_util
269
+ distutils.tests.test_version
270
+ distutils.tests.test_versionpredicate
271
+ distutils.text_file
272
+ distutils.unixccompiler
273
+ distutils.util
274
+ distutils.version
275
+ distutils.versionpredicate
276
+ doctest
277
+ _dummy_thread
278
+ dummy_threading
279
+ _elementtree
280
+ email
281
+ email.base64mime
282
+ email.charset
283
+ email.contentmanager
284
+ email._encoded_words
285
+ email.encoders
286
+ email.errors
287
+ email.feedparser
288
+ email.generator
289
+ email.header
290
+ email.headerregistry
291
+ email._header_value_parser
292
+ email.iterators
293
+ email.message
294
+ email.mime
295
+ email.mime.application
296
+ email.mime.audio
297
+ email.mime.base
298
+ email.mime.image
299
+ email.mime.message
300
+ email.mime.multipart
301
+ email.mime.nonmultipart
302
+ email.mime.text
303
+ email._parseaddr
304
+ email.parser
305
+ email.policy
306
+ email._policybase
307
+ email.quoprimime
308
+ email.utils
309
+ encodings
310
+ encodings.aliases
311
+ encodings.ascii
312
+ encodings.base64_codec
313
+ encodings.big5
314
+ encodings.big5hkscs
315
+ encodings.bz2_codec
316
+ encodings.charmap
317
+ encodings.cp037
318
+ encodings.cp1006
319
+ encodings.cp1026
320
+ encodings.cp1125
321
+ encodings.cp1140
322
+ encodings.cp1250
323
+ encodings.cp1251
324
+ encodings.cp1252
325
+ encodings.cp1253
326
+ encodings.cp1254
327
+ encodings.cp1255
328
+ encodings.cp1256
329
+ encodings.cp1257
330
+ encodings.cp1258
331
+ encodings.cp273
332
+ encodings.cp424
333
+ encodings.cp437
334
+ encodings.cp500
335
+ encodings.cp720
336
+ encodings.cp737
337
+ encodings.cp775
338
+ encodings.cp850
339
+ encodings.cp852
340
+ encodings.cp855
341
+ encodings.cp856
342
+ encodings.cp857
343
+ encodings.cp858
344
+ encodings.cp860
345
+ encodings.cp861
346
+ encodings.cp862
347
+ encodings.cp863
348
+ encodings.cp864
349
+ encodings.cp865
350
+ encodings.cp866
351
+ encodings.cp869
352
+ encodings.cp874
353
+ encodings.cp875
354
+ encodings.cp932
355
+ encodings.cp949
356
+ encodings.cp950
357
+ encodings.euc_jis_2004
358
+ encodings.euc_jisx0213
359
+ encodings.euc_jp
360
+ encodings.euc_kr
361
+ encodings.gb18030
362
+ encodings.gb2312
363
+ encodings.gbk
364
+ encodings.hex_codec
365
+ encodings.hp_roman8
366
+ encodings.hz
367
+ encodings.idna
368
+ encodings.iso2022_jp
369
+ encodings.iso2022_jp_1
370
+ encodings.iso2022_jp_2
371
+ encodings.iso2022_jp_2004
372
+ encodings.iso2022_jp_3
373
+ encodings.iso2022_jp_ext
374
+ encodings.iso2022_kr
375
+ encodings.iso8859_1
376
+ encodings.iso8859_10
377
+ encodings.iso8859_11
378
+ encodings.iso8859_13
379
+ encodings.iso8859_14
380
+ encodings.iso8859_15
381
+ encodings.iso8859_16
382
+ encodings.iso8859_2
383
+ encodings.iso8859_3
384
+ encodings.iso8859_4
385
+ encodings.iso8859_5
386
+ encodings.iso8859_6
387
+ encodings.iso8859_7
388
+ encodings.iso8859_8
389
+ encodings.iso8859_9
390
+ encodings.johab
391
+ encodings.koi8_r
392
+ encodings.koi8_t
393
+ encodings.koi8_u
394
+ encodings.kz1048
395
+ encodings.latin_1
396
+ encodings.mac_arabic
397
+ encodings.mac_centeuro
398
+ encodings.mac_croatian
399
+ encodings.mac_cyrillic
400
+ encodings.mac_farsi
401
+ encodings.mac_greek
402
+ encodings.mac_iceland
403
+ encodings.mac_latin2
404
+ encodings.mac_roman
405
+ encodings.mac_romanian
406
+ encodings.mac_turkish
407
+ encodings.mbcs
408
+ encodings.oem
409
+ encodings.palmos
410
+ encodings.ptcp154
411
+ encodings.punycode
412
+ encodings.quopri_codec
413
+ encodings.raw_unicode_escape
414
+ encodings.rot_13
415
+ encodings.shift_jis
416
+ encodings.shift_jis_2004
417
+ encodings.shift_jisx0213
418
+ encodings.tis_620
419
+ encodings.undefined
420
+ encodings.unicode_escape
421
+ encodings.utf_16
422
+ encodings.utf_16_be
423
+ encodings.utf_16_le
424
+ encodings.utf_32
425
+ encodings.utf_32_be
426
+ encodings.utf_32_le
427
+ encodings.utf_7
428
+ encodings.utf_8
429
+ encodings.utf_8_sig
430
+ encodings.uu_codec
431
+ encodings.zlib_codec
432
+ ensurepip
433
+ ensurepip._bundled
434
+ ensurepip.__main__
435
+ ensurepip._uninstall
436
+ enum
437
+ errno
438
+ faulthandler
439
+ fcntl
440
+ filecmp
441
+ fileinput
442
+ fnmatch
443
+ formatter
444
+ fractions
445
+ _frozen_importlib
446
+ _frozen_importlib_external
447
+ ftplib
448
+ _functools
449
+ functools
450
+ __future__
451
+ gc
452
+ _gdbm
453
+ genericpath
454
+ getopt
455
+ getpass
456
+ gettext
457
+ glob
458
+ graphlib
459
+ grp
460
+ gzip
461
+ _hashlib
462
+ hashlib
463
+ _heapq
464
+ heapq
465
+ hmac
466
+ html
467
+ html.entities
468
+ html.parser
469
+ http
470
+ http.client
471
+ http.cookiejar
472
+ http.cookies
473
+ http.server
474
+ idlelib
475
+ idlelib.autocomplete
476
+ idlelib.autocomplete_w
477
+ idlelib.autoexpand
478
+ idlelib.browser
479
+ idlelib.calltip
480
+ idlelib.calltip_w
481
+ idlelib.codecontext
482
+ idlelib.colorizer
483
+ idlelib.config
484
+ idlelib.configdialog
485
+ idlelib.config_key
486
+ idlelib.debugger
487
+ idlelib.debugger_r
488
+ idlelib.debugobj
489
+ idlelib.debugobj_r
490
+ idlelib.delegator
491
+ idlelib.dynoption
492
+ idlelib.editor
493
+ idlelib.filelist
494
+ idlelib.format
495
+ idlelib.grep
496
+ idlelib.help
497
+ idlelib.help_about
498
+ idlelib.history
499
+ idlelib.hyperparser
500
+ idlelib.idle
501
+ idlelib.idle_test
502
+ idlelib.idle_test.htest
503
+ idlelib.idle_test.mock_idle
504
+ idlelib.idle_test.mock_tk
505
+ idlelib.idle_test.template
506
+ idlelib.idle_test.test_autocomplete
507
+ idlelib.idle_test.test_autocomplete_w
508
+ idlelib.idle_test.test_autoexpand
509
+ idlelib.idle_test.test_browser
510
+ idlelib.idle_test.test_calltip
511
+ idlelib.idle_test.test_calltip_w
512
+ idlelib.idle_test.test_codecontext
513
+ idlelib.idle_test.test_colorizer
514
+ idlelib.idle_test.test_config
515
+ idlelib.idle_test.test_configdialog
516
+ idlelib.idle_test.test_config_key
517
+ idlelib.idle_test.test_debugger
518
+ idlelib.idle_test.test_debugger_r
519
+ idlelib.idle_test.test_debugobj
520
+ idlelib.idle_test.test_debugobj_r
521
+ idlelib.idle_test.test_delegator
522
+ idlelib.idle_test.test_editmenu
523
+ idlelib.idle_test.test_editor
524
+ idlelib.idle_test.test_filelist
525
+ idlelib.idle_test.test_format
526
+ idlelib.idle_test.test_grep
527
+ idlelib.idle_test.test_help
528
+ idlelib.idle_test.test_help_about
529
+ idlelib.idle_test.test_history
530
+ idlelib.idle_test.test_hyperparser
531
+ idlelib.idle_test.test_iomenu
532
+ idlelib.idle_test.test_macosx
533
+ idlelib.idle_test.test_mainmenu
534
+ idlelib.idle_test.test_multicall
535
+ idlelib.idle_test.test_outwin
536
+ idlelib.idle_test.test_parenmatch
537
+ idlelib.idle_test.test_pathbrowser
538
+ idlelib.idle_test.test_percolator
539
+ idlelib.idle_test.test_pyparse
540
+ idlelib.idle_test.test_pyshell
541
+ idlelib.idle_test.test_query
542
+ idlelib.idle_test.test_redirector
543
+ idlelib.idle_test.test_replace
544
+ idlelib.idle_test.test_rpc
545
+ idlelib.idle_test.test_run
546
+ idlelib.idle_test.test_runscript
547
+ idlelib.idle_test.test_scrolledlist
548
+ idlelib.idle_test.test_search
549
+ idlelib.idle_test.test_searchbase
550
+ idlelib.idle_test.test_searchengine
551
+ idlelib.idle_test.test_sidebar
552
+ idlelib.idle_test.test_squeezer
553
+ idlelib.idle_test.test_stackviewer
554
+ idlelib.idle_test.test_statusbar
555
+ idlelib.idle_test.test_text
556
+ idlelib.idle_test.test_textview
557
+ idlelib.idle_test.test_tooltip
558
+ idlelib.idle_test.test_tree
559
+ idlelib.idle_test.test_undo
560
+ idlelib.idle_test.test_warning
561
+ idlelib.idle_test.test_window
562
+ idlelib.idle_test.test_zoomheight
563
+ idlelib.iomenu
564
+ idlelib.macosx
565
+ idlelib.__main__
566
+ idlelib.mainmenu
567
+ idlelib.multicall
568
+ idlelib.outwin
569
+ idlelib.parenmatch
570
+ idlelib.pathbrowser
571
+ idlelib.percolator
572
+ idlelib.pyparse
573
+ idlelib.pyshell
574
+ idlelib.query
575
+ idlelib.redirector
576
+ idlelib.replace
577
+ idlelib.rpc
578
+ idlelib.run
579
+ idlelib.runscript
580
+ idlelib.scrolledlist
581
+ idlelib.search
582
+ idlelib.searchbase
583
+ idlelib.searchengine
584
+ idlelib.sidebar
585
+ idlelib.squeezer
586
+ idlelib.stackviewer
587
+ idlelib.statusbar
588
+ idlelib.textview
589
+ idlelib.tooltip
590
+ idlelib.tree
591
+ idlelib.undo
592
+ idlelib.window
593
+ idlelib.zoomheight
594
+ idlelib.zzdummy
595
+ imaplib
596
+ imghdr
597
+ _imp
598
+ imp
599
+ importlib
600
+ importlib.abc
601
+ importlib._bootstrap
602
+ importlib._bootstrap_external
603
+ importlib._common
604
+ importlib.machinery
605
+ importlib.metadata
606
+ importlib.resources
607
+ importlib.util
608
+ inspect
609
+ _io
610
+ io
611
+ ipaddress
612
+ itertools
613
+ _json
614
+ json
615
+ json.decoder
616
+ json.encoder
617
+ json.scanner
618
+ json.tool
619
+ keyword
620
+ lib2to3
621
+ lib2to3.btm_matcher
622
+ lib2to3.btm_utils
623
+ lib2to3.fixer_base
624
+ lib2to3.fixer_util
625
+ lib2to3.fixes
626
+ lib2to3.fixes.fix_apply
627
+ lib2to3.fixes.fix_asserts
628
+ lib2to3.fixes.fix_basestring
629
+ lib2to3.fixes.fix_buffer
630
+ lib2to3.fixes.fix_dict
631
+ lib2to3.fixes.fix_except
632
+ lib2to3.fixes.fix_exec
633
+ lib2to3.fixes.fix_execfile
634
+ lib2to3.fixes.fix_exitfunc
635
+ lib2to3.fixes.fix_filter
636
+ lib2to3.fixes.fix_funcattrs
637
+ lib2to3.fixes.fix_future
638
+ lib2to3.fixes.fix_getcwdu
639
+ lib2to3.fixes.fix_has_key
640
+ lib2to3.fixes.fix_idioms
641
+ lib2to3.fixes.fix_import
642
+ lib2to3.fixes.fix_imports
643
+ lib2to3.fixes.fix_imports2
644
+ lib2to3.fixes.fix_input
645
+ lib2to3.fixes.fix_intern
646
+ lib2to3.fixes.fix_isinstance
647
+ lib2to3.fixes.fix_itertools
648
+ lib2to3.fixes.fix_itertools_imports
649
+ lib2to3.fixes.fix_long
650
+ lib2to3.fixes.fix_map
651
+ lib2to3.fixes.fix_metaclass
652
+ lib2to3.fixes.fix_methodattrs
653
+ lib2to3.fixes.fix_ne
654
+ lib2to3.fixes.fix_next
655
+ lib2to3.fixes.fix_nonzero
656
+ lib2to3.fixes.fix_numliterals
657
+ lib2to3.fixes.fix_operator
658
+ lib2to3.fixes.fix_paren
659
+ lib2to3.fixes.fix_print
660
+ lib2to3.fixes.fix_raise
661
+ lib2to3.fixes.fix_raw_input
662
+ lib2to3.fixes.fix_reduce
663
+ lib2to3.fixes.fix_reload
664
+ lib2to3.fixes.fix_renames
665
+ lib2to3.fixes.fix_repr
666
+ lib2to3.fixes.fix_set_literal
667
+ lib2to3.fixes.fix_standarderror
668
+ lib2to3.fixes.fix_sys_exc
669
+ lib2to3.fixes.fix_throw
670
+ lib2to3.fixes.fix_tuple_params
671
+ lib2to3.fixes.fix_types
672
+ lib2to3.fixes.fix_unicode
673
+ lib2to3.fixes.fix_urllib
674
+ lib2to3.fixes.fix_ws_comma
675
+ lib2to3.fixes.fix_xrange
676
+ lib2to3.fixes.fix_xreadlines
677
+ lib2to3.fixes.fix_zip
678
+ lib2to3.main
679
+ lib2to3.__main__
680
+ lib2to3.patcomp
681
+ lib2to3.pgen2
682
+ lib2to3.pgen2.conv
683
+ lib2to3.pgen2.driver
684
+ lib2to3.pgen2.grammar
685
+ lib2to3.pgen2.literals
686
+ lib2to3.pgen2.parse
687
+ lib2to3.pgen2.pgen
688
+ lib2to3.pgen2.token
689
+ lib2to3.pgen2.tokenize
690
+ lib2to3.pygram
691
+ lib2to3.pytree
692
+ lib2to3.refactor
693
+ lib2to3.tests
694
+ lib2to3.tests.data.bom
695
+ lib2to3.tests.data.crlf
696
+ lib2to3.tests.data.different_encoding
697
+ lib2to3.tests.data.false_encoding
698
+ lib2to3.tests.data.fixers.bad_order
699
+ lib2to3.tests.data.fixers.myfixes
700
+ lib2to3.tests.data.fixers.myfixes.fix_explicit
701
+ lib2to3.tests.data.fixers.myfixes.fix_first
702
+ lib2to3.tests.data.fixers.myfixes.fix_last
703
+ lib2to3.tests.data.fixers.myfixes.fix_parrot
704
+ lib2to3.tests.data.fixers.myfixes.fix_preorder
705
+ lib2to3.tests.data.fixers.no_fixer_cls
706
+ lib2to3.tests.data.fixers.parrot_example
707
+ lib2to3.tests.data.infinite_recursion
708
+ lib2to3.tests.data.py2_test_grammar
709
+ lib2to3.tests.data.py3_test_grammar
710
+ lib2to3.tests.__main__
711
+ lib2to3.tests.pytree_idempotency
712
+ lib2to3.tests.support
713
+ lib2to3.tests.test_all_fixers
714
+ lib2to3.tests.test_fixers
715
+ lib2to3.tests.test_main
716
+ lib2to3.tests.test_parser
717
+ lib2to3.tests.test_pytree
718
+ lib2to3.tests.test_refactor
719
+ lib2to3.tests.test_util
720
+ lib.libpython3
721
+ linecache
722
+ _locale
723
+ locale
724
+ logging
725
+ logging.config
726
+ logging.handlers
727
+ _lsprof
728
+ _lzma
729
+ lzma
730
+ mailbox
731
+ mailcap
732
+ __main__
733
+ _markupbase
734
+ marshal
735
+ math
736
+ _md5
737
+ mimetypes
738
+ mmap
739
+ modulefinder
740
+ msilib
741
+ msvcrt
742
+ _multibytecodec
743
+ _multiprocessing
744
+ multiprocessing
745
+ multiprocessing.connection
746
+ multiprocessing.context
747
+ multiprocessing.dummy
748
+ multiprocessing.dummy.connection
749
+ multiprocessing.forkserver
750
+ multiprocessing.heap
751
+ multiprocessing.managers
752
+ multiprocessing.pool
753
+ multiprocessing.popen_fork
754
+ multiprocessing.popen_forkserver
755
+ multiprocessing.popen_spawn_posix
756
+ multiprocessing.popen_spawn_win32
757
+ multiprocessing.process
758
+ multiprocessing.queues
759
+ multiprocessing.reduction
760
+ multiprocessing.resource_sharer
761
+ multiprocessing.resource_tracker
762
+ multiprocessing.sharedctypes
763
+ multiprocessing.shared_memory
764
+ multiprocessing.spawn
765
+ multiprocessing.synchronize
766
+ multiprocessing.util
767
+ netrc
768
+ nis
769
+ nntplib
770
+ ntpath
771
+ nturl2path
772
+ numbers
773
+ _opcode
774
+ opcode
775
+ _operator
776
+ operator
777
+ optparse
778
+ os
779
+ os.path
780
+ ossaudiodev
781
+ _osx_support
782
+ parser
783
+ pathlib
784
+ pdb
785
+ __phello__.foo
786
+ _pickle
787
+ pickle
788
+ pickletools
789
+ pipes
790
+ pkgutil
791
+ platform
792
+ plistlib
793
+ poplib
794
+ posix
795
+ posixpath
796
+ _posixshmem
797
+ _posixsubprocess
798
+ pprint
799
+ profile
800
+ pstats
801
+ pty
802
+ pwd
803
+ _py_abc
804
+ pyclbr
805
+ py_compile
806
+ _pydecimal
807
+ pydoc
808
+ pydoc_data
809
+ pydoc_data.topics
810
+ pyexpat
811
+ _pyio
812
+ _queue
813
+ queue
814
+ quopri
815
+ _random
816
+ random
817
+ re
818
+ readline
819
+ reprlib
820
+ resource
821
+ rlcompleter
822
+ runpy
823
+ sched
824
+ secrets
825
+ select
826
+ selectors
827
+ _sha1
828
+ _sha256
829
+ _sha3
830
+ _sha512
831
+ shelve
832
+ shlex
833
+ shutil
834
+ _signal
835
+ signal
836
+ site
837
+ _sitebuiltins
838
+ smtpd
839
+ smtplib
840
+ sndhdr
841
+ _socket
842
+ socket
843
+ socketserver
844
+ spwd
845
+ _sqlite3
846
+ sqlite3
847
+ sqlite3.dbapi2
848
+ sqlite3.dump
849
+ sqlite3.test
850
+ sqlite3.test.backup
851
+ sqlite3.test.dbapi
852
+ sqlite3.test.dump
853
+ sqlite3.test.factory
854
+ sqlite3.test.hooks
855
+ sqlite3.test.regression
856
+ sqlite3.test.transactions
857
+ sqlite3.test.types
858
+ sqlite3.test.userfunctions
859
+ _sre
860
+ sre_compile
861
+ sre_constants
862
+ sre_parse
863
+ _ssl
864
+ ssl
865
+ _stat
866
+ stat
867
+ _statistics
868
+ statistics
869
+ _string
870
+ string
871
+ stringprep
872
+ _strptime
873
+ _struct
874
+ struct
875
+ subprocess
876
+ sunau
877
+ symbol
878
+ _symtable
879
+ symtable
880
+ sys
881
+ sysconfig
882
+ _sysconfigdata_x86_64_conda_cos6_linux_gnu
883
+ _sysconfigdata_x86_64_conda_linux_gnu
884
+ syslog
885
+ tabnanny
886
+ tarfile
887
+ telnetlib
888
+ tempfile
889
+ termios
890
+ test
891
+ test.ann_module
892
+ test.ann_module2
893
+ test.ann_module3
894
+ test.audiotests
895
+ test.autotest
896
+ test.bad_coding
897
+ test.bad_coding2
898
+ test.bad_getattr
899
+ test.bad_getattr2
900
+ test.bad_getattr3
901
+ test.badsyntax_3131
902
+ test.badsyntax_future10
903
+ test.badsyntax_future3
904
+ test.badsyntax_future4
905
+ test.badsyntax_future5
906
+ test.badsyntax_future6
907
+ test.badsyntax_future7
908
+ test.badsyntax_future8
909
+ test.badsyntax_future9
910
+ test.badsyntax_pep3120
911
+ test.bisect_cmd
912
+ _testbuffer
913
+ test.bytecode_helper
914
+ _testcapi
915
+ test.coding20731
916
+ test.curses_tests
917
+ test.dataclass_module_1
918
+ test.dataclass_module_1_str
919
+ test.dataclass_module_2
920
+ test.dataclass_module_2_str
921
+ test.datetimetester
922
+ test.dis_module
923
+ test.doctest_aliases
924
+ test.double_const
925
+ test.dtracedata.call_stack
926
+ test.dtracedata.gc
927
+ test.dtracedata.instance
928
+ test.dtracedata.line
929
+ test.eintrdata.eintr_tester
930
+ test.encoded_modules
931
+ test.encoded_modules.module_iso_8859_1
932
+ test.encoded_modules.module_koi8_r
933
+ test.final_a
934
+ test.final_b
935
+ test.fork_wait
936
+ test.future_test1
937
+ test.future_test2
938
+ test.gdb_sample
939
+ test.good_getattr
940
+ test.imp_dummy
941
+ _testimportmultiple
942
+ test.inspect_fodder
943
+ test.inspect_fodder2
944
+ _testinternalcapi
945
+ test.libregrtest
946
+ test.libregrtest.cmdline
947
+ test.libregrtest.main
948
+ test.libregrtest.pgo
949
+ test.libregrtest.refleak
950
+ test.libregrtest.runtest
951
+ test.libregrtest.runtest_mp
952
+ test.libregrtest.save_env
953
+ test.libregrtest.setup
954
+ test.libregrtest.utils
955
+ test.libregrtest.win_utils
956
+ test.list_tests
957
+ test.lock_tests
958
+ test.__main__
959
+ test.make_ssl_certs
960
+ test.mapping_tests
961
+ test.memory_watchdog
962
+ test.mock_socket
963
+ test.mod_generics_cache
964
+ test.mp_fork_bomb
965
+ test.mp_preload
966
+ test.multibytecodec_support
967
+ _testmultiphase
968
+ test.outstanding_bugs
969
+ test.pickletester
970
+ test.profilee
971
+ test.pyclbr_input
972
+ test.pydocfodder
973
+ test.pydoc_mod
974
+ test.pythoninfo
975
+ test.regrtest
976
+ test.relimport
977
+ test.reperf
978
+ test.re_tests
979
+ test.sample_doctest
980
+ test.sample_doctest_no_docstrings
981
+ test.sample_doctest_no_doctests
982
+ test.seq_tests
983
+ test.signalinterproctester
984
+ test.sortperf
985
+ test.ssl_servers
986
+ test.ssltests
987
+ test.string_tests
988
+ test.subprocessdata.fd_status
989
+ test.subprocessdata.input_reader
990
+ test.subprocessdata.qcat
991
+ test.subprocessdata.qgrep
992
+ test.subprocessdata.sigchild_ignore
993
+ test.support
994
+ test.support.bytecode_helper
995
+ test.support.hashlib_helper
996
+ test.support.logging_helper
997
+ test.support.script_helper
998
+ test.support.socket_helper
999
+ test.support.testresult
1000
+ test.test_abc
1001
+ test.test_abstract_numbers
1002
+ test.test_aifc
1003
+ test.test___all__
1004
+ test.test_argparse
1005
+ test.test_array
1006
+ test.test_asdl_parser
1007
+ test.test_ast
1008
+ test.test_asyncgen
1009
+ test.test_asynchat
1010
+ test.test_asyncio
1011
+ test.test_asyncio.echo
1012
+ test.test_asyncio.echo2
1013
+ test.test_asyncio.echo3
1014
+ test.test_asyncio.functional
1015
+ test.test_asyncio.__main__
1016
+ test.test_asyncio.test_base_events
1017
+ test.test_asyncio.test_buffered_proto
1018
+ test.test_asyncio.test_context
1019
+ test.test_asyncio.test_events
1020
+ test.test_asyncio.test_futures
1021
+ test.test_asyncio.test_locks
1022
+ test.test_asyncio.test_pep492
1023
+ test.test_asyncio.test_proactor_events
1024
+ test.test_asyncio.test_protocols
1025
+ test.test_asyncio.test_queues
1026
+ test.test_asyncio.test_runners
1027
+ test.test_asyncio.test_selector_events
1028
+ test.test_asyncio.test_sendfile
1029
+ test.test_asyncio.test_server
1030
+ test.test_asyncio.test_sock_lowlevel
1031
+ test.test_asyncio.test_sslproto
1032
+ test.test_asyncio.test_streams
1033
+ test.test_asyncio.test_subprocess
1034
+ test.test_asyncio.test_tasks
1035
+ test.test_asyncio.test_transports
1036
+ test.test_asyncio.test_unix_events
1037
+ test.test_asyncio.test_windows_events
1038
+ test.test_asyncio.test_windows_utils
1039
+ test.test_asyncio.utils
1040
+ test.test_asyncore
1041
+ test.test_atexit
1042
+ test.test_audioop
1043
+ test.test_audit
1044
+ test.test_augassign
1045
+ test.test_base64
1046
+ test.test_baseexception
1047
+ test.test_bdb
1048
+ test.test_bigaddrspace
1049
+ test.test_bigmem
1050
+ test.test_binascii
1051
+ test.test_binhex
1052
+ test.test_binop
1053
+ test.test_bisect
1054
+ test.test_bool
1055
+ test.test_buffer
1056
+ test.test_bufio
1057
+ test.test_builtin
1058
+ test.test_bytes
1059
+ test.test_bz2
1060
+ test.test_calendar
1061
+ test.test_call
1062
+ test.test_capi
1063
+ test.test_cgi
1064
+ test.test_cgitb
1065
+ test.test_charmapcodec
1066
+ test.test_class
1067
+ test.test_clinic
1068
+ test.test_c_locale_coercion
1069
+ test.test_cmath
1070
+ test.test_cmd
1071
+ test.test_cmd_line
1072
+ test.test_cmd_line_script
1073
+ test.test_code
1074
+ test.testcodec
1075
+ test.test_codeccallbacks
1076
+ test.test_codecencodings_cn
1077
+ test.test_codecencodings_hk
1078
+ test.test_codecencodings_iso2022
1079
+ test.test_codecencodings_jp
1080
+ test.test_codecencodings_kr
1081
+ test.test_codecencodings_tw
1082
+ test.test_codecmaps_cn
1083
+ test.test_codecmaps_hk
1084
+ test.test_codecmaps_jp
1085
+ test.test_codecmaps_kr
1086
+ test.test_codecmaps_tw
1087
+ test.test_codecs
1088
+ test.test_code_module
1089
+ test.test_codeop
1090
+ test.test_collections
1091
+ test.test_colorsys
1092
+ test.test_compare
1093
+ test.test_compile
1094
+ test.test_compileall
1095
+ test.test_complex
1096
+ test.test_concurrent_futures
1097
+ test.test_configparser
1098
+ test.test_contains
1099
+ test.test_context
1100
+ test.test_contextlib
1101
+ test.test_contextlib_async
1102
+ test.test_copy
1103
+ test.test_copyreg
1104
+ test.test_coroutines
1105
+ test.test_cprofile
1106
+ test.test_crashers
1107
+ test.test_crypt
1108
+ test.test_csv
1109
+ test.test_ctypes
1110
+ test.test_curses
1111
+ test.test_dataclasses
1112
+ test.test_datetime
1113
+ test.test_dbm
1114
+ test.test_dbm_dumb
1115
+ test.test_dbm_gnu
1116
+ test.test_dbm_ndbm
1117
+ test.test_decimal
1118
+ test.test_decorators
1119
+ test.test_defaultdict
1120
+ test.test_deque
1121
+ test.test_descr
1122
+ test.test_descrtut
1123
+ test.test_devpoll
1124
+ test.test_dict
1125
+ test.test_dictcomps
1126
+ test.test_dict_version
1127
+ test.test_dictviews
1128
+ test.test_difflib
1129
+ test.test_dis
1130
+ test.test_distutils
1131
+ test.test_doctest
1132
+ test.test_doctest2
1133
+ test.test_docxmlrpc
1134
+ test.test_dtrace
1135
+ test.test_dummy_thread
1136
+ test.test_dummy_threading
1137
+ test.test_dynamic
1138
+ test.test_dynamicclassattribute
1139
+ test.test_eintr
1140
+ test.test_email
1141
+ test.test_email.__main__
1142
+ test.test_email.test_asian_codecs
1143
+ test.test_email.test_contentmanager
1144
+ test.test_email.test_defect_handling
1145
+ test.test_email.test_email
1146
+ test.test_email.test__encoded_words
1147
+ test.test_email.test_generator
1148
+ test.test_email.test_headerregistry
1149
+ test.test_email.test__header_value_parser
1150
+ test.test_email.test_inversion
1151
+ test.test_email.test_message
1152
+ test.test_email.test_parser
1153
+ test.test_email.test_pickleable
1154
+ test.test_email.test_policy
1155
+ test.test_email.test_utils
1156
+ test.test_email.torture_test
1157
+ test.test_embed
1158
+ test.test_ensurepip
1159
+ test.test_enum
1160
+ test.test_enumerate
1161
+ test.test_eof
1162
+ test.test_epoll
1163
+ test.test_errno
1164
+ test.test_exception_hierarchy
1165
+ test.test_exceptions
1166
+ test.test_exception_variations
1167
+ test.test_extcall
1168
+ test.test_faulthandler
1169
+ test.test_fcntl
1170
+ test.test_file
1171
+ test.test_filecmp
1172
+ test.test_file_eintr
1173
+ test.test_fileinput
1174
+ test.test_fileio
1175
+ test.test_finalization
1176
+ test.test_float
1177
+ test.test_flufl
1178
+ test.test_fnmatch
1179
+ test.test_fork1
1180
+ test.test_format
1181
+ test.test_fractions
1182
+ test.test_frame
1183
+ test.test_frozen
1184
+ test.test_fstring
1185
+ test.test_ftplib
1186
+ test.test_funcattrs
1187
+ test.test_functools
1188
+ test.test___future__
1189
+ test.test_future
1190
+ test.test_future3
1191
+ test.test_future4
1192
+ test.test_future5
1193
+ test.test_gc
1194
+ test.test_gdb
1195
+ test.test_generators
1196
+ test.test_generator_stop
1197
+ test.test_genericclass
1198
+ test.test_genericpath
1199
+ test.test_genexps
1200
+ test.test_getargs2
1201
+ test.test_getopt
1202
+ test.test_getpass
1203
+ test.test_gettext
1204
+ test.test_glob
1205
+ test.test_global
1206
+ test.test_grammar
1207
+ test.test_grp
1208
+ test.test_gzip
1209
+ test.test_hash
1210
+ test.test_hashlib
1211
+ test.test_heapq
1212
+ test.test_hmac
1213
+ test.test_html
1214
+ test.test_htmlparser
1215
+ test.test_http_cookiejar
1216
+ test.test_http_cookies
1217
+ test.test_httplib
1218
+ test.test_httpservers
1219
+ test.test_idle
1220
+ test.test_imaplib
1221
+ test.test_imghdr
1222
+ test.test_imp
1223
+ test.test_import
1224
+ test.test_import.data.circular_imports.basic
1225
+ test.test_import.data.circular_imports.basic2
1226
+ test.test_import.data.circular_imports.binding
1227
+ test.test_import.data.circular_imports.binding2
1228
+ test.test_import.data.circular_imports.from_cycle1
1229
+ test.test_import.data.circular_imports.from_cycle2
1230
+ test.test_import.data.circular_imports.indirect
1231
+ test.test_import.data.circular_imports.rebinding
1232
+ test.test_import.data.circular_imports.rebinding2
1233
+ test.test_import.data.circular_imports.source
1234
+ test.test_import.data.circular_imports.subpackage
1235
+ test.test_import.data.circular_imports.subpkg.subpackage2
1236
+ test.test_import.data.circular_imports.subpkg.util
1237
+ test.test_import.data.circular_imports.use
1238
+ test.test_import.data.circular_imports.util
1239
+ test.test_import.data.package
1240
+ test.test_import.data.package2.submodule1
1241
+ test.test_import.data.package2.submodule2
1242
+ test.test_import.data.package.submodule
1243
+ test.test_importlib
1244
+ test.test_importlib.abc
1245
+ test.test_importlib.builtin
1246
+ test.test_importlib.builtin.__main__
1247
+ test.test_importlib.builtin.test_finder
1248
+ test.test_importlib.builtin.test_loader
1249
+ test.test_importlib.data
1250
+ test.test_importlib.data01
1251
+ test.test_importlib.data01.subdirectory
1252
+ test.test_importlib.data02
1253
+ test.test_importlib.data02.one
1254
+ test.test_importlib.data02.two
1255
+ test.test_importlib.data03
1256
+ test.test_importlib.data03.namespace.portion1
1257
+ test.test_importlib.data03.namespace.portion2
1258
+ test.test_importlib.extension
1259
+ test.test_importlib.extension.__main__
1260
+ test.test_importlib.extension.test_case_sensitivity
1261
+ test.test_importlib.extension.test_finder
1262
+ test.test_importlib.extension.test_loader
1263
+ test.test_importlib.extension.test_path_hook
1264
+ test.test_importlib.fixtures
1265
+ test.test_importlib.frozen
1266
+ test.test_importlib.frozen.__main__
1267
+ test.test_importlib.frozen.test_finder
1268
+ test.test_importlib.frozen.test_loader
1269
+ test.test_importlib.import_
1270
+ test.test_importlib.import_.__main__
1271
+ test.test_importlib.import_.test_api
1272
+ test.test_importlib.import_.test_caching
1273
+ test.test_importlib.import_.test_fromlist
1274
+ test.test_importlib.import_.test___loader__
1275
+ test.test_importlib.import_.test_meta_path
1276
+ test.test_importlib.import_.test___package__
1277
+ test.test_importlib.import_.test_packages
1278
+ test.test_importlib.import_.test_path
1279
+ test.test_importlib.import_.test_relative_imports
1280
+ test.test_importlib.__main__
1281
+ test.test_importlib.namespace_pkgs.both_portions.foo.one
1282
+ test.test_importlib.namespace_pkgs.both_portions.foo.two
1283
+ test.test_importlib.namespace_pkgs.module_and_namespace_package.a_test
1284
+ test.test_importlib.namespace_pkgs.not_a_namespace_pkg.foo
1285
+ test.test_importlib.namespace_pkgs.not_a_namespace_pkg.foo.one
1286
+ test.test_importlib.namespace_pkgs.portion1.foo.one
1287
+ test.test_importlib.namespace_pkgs.portion2.foo.two
1288
+ test.test_importlib.namespace_pkgs.project1.parent.child.one
1289
+ test.test_importlib.namespace_pkgs.project2.parent.child.two
1290
+ test.test_importlib.namespace_pkgs.project3.parent.child.three
1291
+ test.test_importlib.source
1292
+ test.test_importlib.source.__main__
1293
+ test.test_importlib.source.test_case_sensitivity
1294
+ test.test_importlib.source.test_file_loader
1295
+ test.test_importlib.source.test_finder
1296
+ test.test_importlib.source.test_path_hook
1297
+ test.test_importlib.source.test_source_encoding
1298
+ test.test_importlib.test_abc
1299
+ test.test_importlib.test_api
1300
+ test.test_importlib.test_lazy
1301
+ test.test_importlib.test_locks
1302
+ test.test_importlib.test_main
1303
+ test.test_importlib.test_metadata_api
1304
+ test.test_importlib.test_namespace_pkgs
1305
+ test.test_importlib.test_open
1306
+ test.test_importlib.test_path
1307
+ test.test_importlib.test_read
1308
+ test.test_importlib.test_resource
1309
+ test.test_importlib.test_spec
1310
+ test.test_importlib.test_util
1311
+ test.test_importlib.test_windows
1312
+ test.test_importlib.test_zip
1313
+ test.test_importlib.util
1314
+ test.test_importlib.zipdata01
1315
+ test.test_importlib.zipdata02
1316
+ test.test_import.__main__
1317
+ test.test_index
1318
+ test.test_inspect
1319
+ test.test_int
1320
+ test.test_int_literal
1321
+ test.test_io
1322
+ test.test_ioctl
1323
+ test.test_ipaddress
1324
+ test.test_isinstance
1325
+ test.test_iter
1326
+ test.test_iterlen
1327
+ test.test_itertools
1328
+ test.test_json
1329
+ test.test_json.__main__
1330
+ test.test_json.test_decode
1331
+ test.test_json.test_default
1332
+ test.test_json.test_dump
1333
+ test.test_json.test_encode_basestring_ascii
1334
+ test.test_json.test_enum
1335
+ test.test_json.test_fail
1336
+ test.test_json.test_float
1337
+ test.test_json.test_indent
1338
+ test.test_json.test_pass1
1339
+ test.test_json.test_pass2
1340
+ test.test_json.test_pass3
1341
+ test.test_json.test_recursion
1342
+ test.test_json.test_scanstring
1343
+ test.test_json.test_separators
1344
+ test.test_json.test_speedups
1345
+ test.test_json.test_tool
1346
+ test.test_json.test_unicode
1347
+ test.test_keyword
1348
+ test.test_keywordonlyarg
1349
+ test.test_kqueue
1350
+ test.test_largefile
1351
+ test.test_lib2to3
1352
+ test.test_linecache
1353
+ test.test_list
1354
+ test.test_listcomps
1355
+ test.test_lltrace
1356
+ test.test__locale
1357
+ test.test_locale
1358
+ test.test_logging
1359
+ test.test_long
1360
+ test.test_longexp
1361
+ test.test_lzma
1362
+ test.test_mailbox
1363
+ test.test_mailcap
1364
+ test.test_marshal
1365
+ test.test_math
1366
+ test.test_memoryio
1367
+ test.test_memoryview
1368
+ test.test_metaclass
1369
+ test.test_mimetypes
1370
+ test.test_minidom
1371
+ test.test_mmap
1372
+ test.test_module
1373
+ test.test_modulefinder
1374
+ test.test_msilib
1375
+ test.test_multibytecodec
1376
+ test._test_multiprocessing
1377
+ test.test_multiprocessing_fork
1378
+ test.test_multiprocessing_forkserver
1379
+ test.test_multiprocessing_main_handling
1380
+ test.test_multiprocessing_spawn
1381
+ test.test_named_expressions
1382
+ test.test_netrc
1383
+ test.test_nis
1384
+ test.test_nntplib
1385
+ test.test_normalization
1386
+ test.test_ntpath
1387
+ test.test_numeric_tower
1388
+ test.test__opcode
1389
+ test.test_opcodes
1390
+ test.test_openpty
1391
+ test.test_operator
1392
+ test.test_optparse
1393
+ test.test_ordered_dict
1394
+ test.test_os
1395
+ test.test_ossaudiodev
1396
+ test.test_osx_env
1397
+ test.test__osx_support
1398
+ test.test_parser
1399
+ test.test_pathlib
1400
+ test.test_pdb
1401
+ test.test_peepholer
1402
+ test.test_pickle
1403
+ test.test_picklebuffer
1404
+ test.test_pickletools
1405
+ test.test_pipes
1406
+ test.test_pkg
1407
+ test.test_pkgimport
1408
+ test.test_pkgutil
1409
+ test.test_platform
1410
+ test.test_plistlib
1411
+ test.test_poll
1412
+ test.test_popen
1413
+ test.test_poplib
1414
+ test.test_positional_only_arg
1415
+ test.test_posix
1416
+ test.test_posixpath
1417
+ test.test_pow
1418
+ test.test_pprint
1419
+ test.test_print
1420
+ test.test_profile
1421
+ test.test_property
1422
+ test.test_pstats
1423
+ test.test_pty
1424
+ test.test_pulldom
1425
+ test.test_pwd
1426
+ test.test_pyclbr
1427
+ test.test_py_compile
1428
+ test.test_pydoc
1429
+ test.test_pyexpat
1430
+ test.test_queue
1431
+ test.test_quopri
1432
+ test.test_raise
1433
+ test.test_random
1434
+ test.test_range
1435
+ test.test_re
1436
+ test.test_readline
1437
+ test.test_regrtest
1438
+ test.test_repl
1439
+ test.test_reprlib
1440
+ test.test_resource
1441
+ test.test_richcmp
1442
+ test.test_rlcompleter
1443
+ test.test_robotparser
1444
+ test.test_runpy
1445
+ test.test_sax
1446
+ test.test_sched
1447
+ test.test_scope
1448
+ test.test_script_helper
1449
+ test.test_secrets
1450
+ test.test_select
1451
+ test.test_selectors
1452
+ test.test_set
1453
+ test.test_setcomps
1454
+ test.test_shelve
1455
+ test.test_shlex
1456
+ test.test_shutil
1457
+ test.test_signal
1458
+ test.test_site
1459
+ test.test_slice
1460
+ test.test_smtpd
1461
+ test.test_smtplib
1462
+ test.test_smtpnet
1463
+ test.test_sndhdr
1464
+ test.test_socket
1465
+ test.test_socketserver
1466
+ test.test_sort
1467
+ test.test_source_encoding
1468
+ test.test_spwd
1469
+ test.test_sqlite
1470
+ test.test_ssl
1471
+ test.test_startfile
1472
+ test.test_stat
1473
+ test.test_statistics
1474
+ test.test_strftime
1475
+ test.test_string
1476
+ test.test_string_literals
1477
+ test.test_stringprep
1478
+ test.test_strptime
1479
+ test.test_strtod
1480
+ test.test_struct
1481
+ test.test_structmembers
1482
+ test.test_structseq
1483
+ test.test_subclassinit
1484
+ test.test_subprocess
1485
+ test.test_sunau
1486
+ test.test_sundry
1487
+ test.test_super
1488
+ test.test_support
1489
+ test.test_symbol
1490
+ test.test_symtable
1491
+ test.test_syntax
1492
+ test.test_sys
1493
+ test.test_sysconfig
1494
+ test.test_syslog
1495
+ test.test_sys_setprofile
1496
+ test.test_sys_settrace
1497
+ test.test_tabnanny
1498
+ test.test_tarfile
1499
+ test.test_tcl
1500
+ test.test_telnetlib
1501
+ test.test_tempfile
1502
+ test.test_textwrap
1503
+ test.test_thread
1504
+ test.test_threaded_import
1505
+ test.test_threadedtempfile
1506
+ test.test_threading
1507
+ test.test_threading_local
1508
+ test.test_threadsignals
1509
+ test.test_time
1510
+ test.test_timeit
1511
+ test.test_timeout
1512
+ test.test_tix
1513
+ test.test_tk
1514
+ test.test_tokenize
1515
+ test.test_tools
1516
+ test.test_tools.__main__
1517
+ test.test_tools.test_fixcid
1518
+ test.test_tools.test_gprof2html
1519
+ test.test_tools.test_i18n
1520
+ test.test_tools.test_lll
1521
+ test.test_tools.test_md5sum
1522
+ test.test_tools.test_pathfix
1523
+ test.test_tools.test_pdeps
1524
+ test.test_tools.test_pindent
1525
+ test.test_tools.test_reindent
1526
+ test.test_tools.test_sundry
1527
+ test.test_tools.test_unparse
1528
+ test.test_trace
1529
+ test.test_traceback
1530
+ test.test_tracemalloc
1531
+ test.test_ttk_guionly
1532
+ test.test_ttk_textonly
1533
+ test.test_tuple
1534
+ test.test_turtle
1535
+ test.test_typechecks
1536
+ test.test_type_comments
1537
+ test.test_types
1538
+ test.test_typing
1539
+ test.test_ucn
1540
+ test.test_unary
1541
+ test.test_unicode
1542
+ test.test_unicodedata
1543
+ test.test_unicode_file
1544
+ test.test_unicode_file_functions
1545
+ test.test_unicode_identifiers
1546
+ test.test_unittest
1547
+ test.test_univnewlines
1548
+ test.test_unpack
1549
+ test.test_unpack_ex
1550
+ test.test_urllib
1551
+ test.test_urllib2
1552
+ test.test_urllib2_localnet
1553
+ test.test_urllib2net
1554
+ test.test_urllibnet
1555
+ test.test_urllib_response
1556
+ test.test_urlparse
1557
+ test.test_userdict
1558
+ test.test_userlist
1559
+ test.test_userstring
1560
+ test.test_utf8_mode
1561
+ test.test_utf8source
1562
+ test.test_uu
1563
+ test.test_uuid
1564
+ test.test_venv
1565
+ test.test_wait3
1566
+ test.test_wait4
1567
+ test.test_warnings
1568
+ test.test_warnings.data.import_warning
1569
+ test.test_warnings.data.stacklevel
1570
+ test.test_warnings.__main__
1571
+ test.test_wave
1572
+ test.test_weakref
1573
+ test.test_weakset
1574
+ test.test_webbrowser
1575
+ test.test_winconsoleio
1576
+ test.test_winreg
1577
+ test.test_winsound
1578
+ test.test_with
1579
+ test.test_wsgiref
1580
+ test.test_xdrlib
1581
+ test.test_xml_dom_minicompat
1582
+ test.test_xml_etree
1583
+ test.test_xml_etree_c
1584
+ test.test_xmlrpc
1585
+ test.test_xmlrpc_net
1586
+ test.test__xxsubinterpreters
1587
+ test.test_xxtestfuzz
1588
+ test.test_yield_from
1589
+ test.test_zipapp
1590
+ test.test_zipfile
1591
+ test.test_zipfile64
1592
+ test.test_zipimport
1593
+ test.test_zipimport_support
1594
+ test.test_zlib
1595
+ test.tf_inherit_check
1596
+ test.threaded_import_hangers
1597
+ test.time_hashlib
1598
+ test.tracedmodules
1599
+ test.tracedmodules.testmod
1600
+ test.win_console_handler
1601
+ test.xmltests
1602
+ test.ziptestdata.testdata_module_inside_zip
1603
+ textwrap
1604
+ this
1605
+ _thread
1606
+ threading
1607
+ _threading_local
1608
+ time
1609
+ timeit
1610
+ _tkinter
1611
+ tkinter
1612
+ tkinter.colorchooser
1613
+ tkinter.commondialog
1614
+ tkinter.constants
1615
+ tkinter.dialog
1616
+ tkinter.dnd
1617
+ tkinter.filedialog
1618
+ tkinter.font
1619
+ tkinter.__main__
1620
+ tkinter.messagebox
1621
+ tkinter.scrolledtext
1622
+ tkinter.simpledialog
1623
+ tkinter.test
1624
+ tkinter.test.runtktests
1625
+ tkinter.test.support
1626
+ tkinter.test.test_tkinter
1627
+ tkinter.test.test_tkinter.test_font
1628
+ tkinter.test.test_tkinter.test_geometry_managers
1629
+ tkinter.test.test_tkinter.test_images
1630
+ tkinter.test.test_tkinter.test_loadtk
1631
+ tkinter.test.test_tkinter.test_misc
1632
+ tkinter.test.test_tkinter.test_text
1633
+ tkinter.test.test_tkinter.test_variables
1634
+ tkinter.test.test_tkinter.test_widgets
1635
+ tkinter.test.test_ttk
1636
+ tkinter.test.test_ttk.test_extensions
1637
+ tkinter.test.test_ttk.test_functions
1638
+ tkinter.test.test_ttk.test_style
1639
+ tkinter.test.test_ttk.test_widgets
1640
+ tkinter.test.widget_tests
1641
+ tkinter.tix
1642
+ tkinter.ttk
1643
+ token
1644
+ tokenize
1645
+ trace
1646
+ traceback
1647
+ _tracemalloc
1648
+ tracemalloc
1649
+ tty
1650
+ turtle
1651
+ turtledemo
1652
+ turtledemo.bytedesign
1653
+ turtledemo.chaos
1654
+ turtledemo.clock
1655
+ turtledemo.colormixer
1656
+ turtledemo.forest
1657
+ turtledemo.fractalcurves
1658
+ turtledemo.lindenmayer
1659
+ turtledemo.__main__
1660
+ turtledemo.minimal_hanoi
1661
+ turtledemo.nim
1662
+ turtledemo.paint
1663
+ turtledemo.peace
1664
+ turtledemo.penrose
1665
+ turtledemo.planet_and_moon
1666
+ turtledemo.rosette
1667
+ turtledemo.round_dance
1668
+ turtledemo.sorting_animate
1669
+ turtledemo.tree
1670
+ turtledemo.two_canvases
1671
+ turtledemo.yinyang
1672
+ types
1673
+ typing
1674
+ typing.io
1675
+ typing.re
1676
+ unicodedata
1677
+ unittest
1678
+ unittest.async_case
1679
+ unittest.case
1680
+ unittest.loader
1681
+ unittest._log
1682
+ unittest.__main__
1683
+ unittest.main
1684
+ unittest.mock
1685
+ unittest.result
1686
+ unittest.runner
1687
+ unittest.signals
1688
+ unittest.suite
1689
+ unittest.test
1690
+ unittest.test.dummy
1691
+ unittest.test.__main__
1692
+ unittest.test.support
1693
+ unittest.test.test_assertions
1694
+ unittest.test.test_async_case
1695
+ unittest.test.test_break
1696
+ unittest.test.test_case
1697
+ unittest.test.test_discovery
1698
+ unittest.test.test_functiontestcase
1699
+ unittest.test.test_loader
1700
+ unittest.test.testmock
1701
+ unittest.test.testmock.__main__
1702
+ unittest.test.testmock.support
1703
+ unittest.test.testmock.testasync
1704
+ unittest.test.testmock.testcallable
1705
+ unittest.test.testmock.testhelpers
1706
+ unittest.test.testmock.testmagicmethods
1707
+ unittest.test.testmock.testmock
1708
+ unittest.test.testmock.testpatch
1709
+ unittest.test.testmock.testsealable
1710
+ unittest.test.testmock.testsentinel
1711
+ unittest.test.testmock.testwith
1712
+ unittest.test.test_program
1713
+ unittest.test.test_result
1714
+ unittest.test.test_runner
1715
+ unittest.test.test_setups
1716
+ unittest.test.test_skipping
1717
+ unittest.test.test_suite
1718
+ unittest.test._test_warnings
1719
+ unittest.util
1720
+ urllib
1721
+ urllib.error
1722
+ urllib.parse
1723
+ urllib.request
1724
+ urllib.response
1725
+ urllib.robotparser
1726
+ uu
1727
+ _uuid
1728
+ uuid
1729
+ venv
1730
+ venv.__main__
1731
+ _warnings
1732
+ warnings
1733
+ wave
1734
+ _weakref
1735
+ weakref
1736
+ _weakrefset
1737
+ webbrowser
1738
+ winreg
1739
+ winsound
1740
+ wsgiref
1741
+ wsgiref.handlers
1742
+ wsgiref.headers
1743
+ wsgiref.simple_server
1744
+ wsgiref.util
1745
+ wsgiref.validate
1746
+ xdrlib
1747
+ xml
1748
+ xml.dom
1749
+ xml.dom.domreg
1750
+ xml.dom.expatbuilder
1751
+ xml.dom.minicompat
1752
+ xml.dom.minidom
1753
+ xml.dom.NodeFilter
1754
+ xml.dom.pulldom
1755
+ xml.dom.xmlbuilder
1756
+ xml.etree
1757
+ xml.etree.cElementTree
1758
+ xml.etree.ElementInclude
1759
+ xml.etree.ElementPath
1760
+ xml.etree.ElementTree
1761
+ xml.parsers
1762
+ xml.parsers.expat
1763
+ xml.parsers.expat.errors
1764
+ xml.parsers.expat.model
1765
+ xmlrpc
1766
+ xmlrpc.client
1767
+ xmlrpc.server
1768
+ xml.sax
1769
+ xml.sax._exceptions
1770
+ xml.sax.expatreader
1771
+ xml.sax.handler
1772
+ xml.sax.saxutils
1773
+ xml.sax.xmlreader
1774
+ xxlimited
1775
+ _xxsubinterpreters
1776
+ xxsubtype
1777
+ _xxtestfuzz
1778
+ zipapp
1779
+ zipfile
1780
+ zipimport
1781
+ zlib
1782
+ zoneinfo
1783
+ zoneinfo._common
1784
+ zoneinfo._tzpath
1785
+ zoneinfo._zoneinfo
goex/exec_engine/utils.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Common utility functions and classes"""
2
+
3
+ import os
4
+ from pathlib import Path
5
+ from typing import NewType
6
+
7
+ ROOT_FOLDER_PATH = os.path.dirname(Path(os.path.realpath(__file__)).parent)
8
+ DEFAULT_CHECKPOINT_PATH = os.path.join(ROOT_FOLDER_PATH, 'checkpoints')
9
+
10
+ SQL_Type = NewType("SQL_Type", str)
11
+ Filesystem_Type = NewType("Filesystem_Type", str)
12
+ RESTful_Type = NewType("RESTful_Type", str)
13
+
14
+ def format_container_logs(container):
15
+ docker_out = []
16
+ for log in container.logs(stdout=True, stderr=False, stream=True):
17
+ log = log.decode("utf-8")
18
+ if log == "\n":
19
+ continue
20
+ else:
21
+ if log[-1] == "\n":
22
+ log = log[:-1]
23
+ docker_out.append(log)
24
+
25
+ docker_debug = container.logs(stdout=False, stderr=True).decode("utf-8")
26
+ return docker_out, docker_debug
goex/function/dummy_key.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"channel_id": "D04HS7LEX17"}
goex/function/function.json ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "function",
4
+ "function": {
5
+ "name": "slack_send_message",
6
+ "description": "Send an slack message to a channel.",
7
+ "parameters": {
8
+ "type": "object",
9
+ "properties": {
10
+ "channel_id": {
11
+ "type": "string",
12
+ "description": "The channel id to send the message to. Example: 'D04HS7LEX17'."
13
+ },
14
+ "text": {
15
+ "type": "string",
16
+ "description": "The text of the message. Example: 'hello bob'."
17
+ }
18
+ },
19
+ "required": ["channel_id", "text"]
20
+ }
21
+ }
22
+ },
23
+ {
24
+ "type": "function",
25
+ "function": {
26
+ "name": "slack_send_message_dummy",
27
+ "description": "Send an slack message to a channel without specifying channel id.",
28
+ "parameters": {
29
+ "type": "object",
30
+ "properties": {
31
+ "text": {
32
+ "type": "string",
33
+ "description": "The text of the message. Example: 'hello bob'."
34
+ }
35
+ },
36
+ "required": ["text"]
37
+ }
38
+ }
39
+ },
40
+ {
41
+ "type": "function",
42
+ "function": {
43
+ "name": "slack_delete_most_recent_message",
44
+ "description": "Delete the latest message you sent in a channel.",
45
+ "parameters": {
46
+ "type": "object",
47
+ "properties": {
48
+ "channel_id": {
49
+ "type": "string",
50
+ "description": "The channel id to delete the message from. Example: 'D04HS7LEX17'."
51
+ }
52
+ },
53
+ "required": ["channel_id"]
54
+ }
55
+ }
56
+ },
57
+ {
58
+ "type": "function",
59
+ "function": {
60
+ "name": "slack_delete_most_recent_message_dummy",
61
+ "description": "Delete the latest message you sent in a channel without specifying channel id.",
62
+ "parameters": {
63
+ "type": "object",
64
+ "properties": {},
65
+ "required": []
66
+ }
67
+ }
68
+ },
69
+ {
70
+ "type": "function",
71
+ "function": {
72
+ "name": "slack_list_channels",
73
+ "description": "List all the channels in your slack workspace.",
74
+ "parameters": {
75
+ "type": "object",
76
+ "properties": {},
77
+ "required": []
78
+ }
79
+ }
80
+ },
81
+ {
82
+ "type": "function",
83
+ "function": {
84
+ "name": "slack_add_emoji_reaction",
85
+ "description": "Add an emoji reaction to a message in the channel.",
86
+ "parameters": {
87
+ "type": "object",
88
+ "properties": {
89
+ "channel_id": {
90
+ "type": "string",
91
+ "description": "The id of the channel to add emoji reaction to. Example: 'D04HS7LEX17'."
92
+ },
93
+ "emoji_name": {
94
+ "type": "string",
95
+ "description": "The name of the emoji to add. Example: 'thumbsup'."
96
+ },
97
+ "timestamp_id": {
98
+ "type": "string",
99
+ "description": "The timestamp id of the message to add emoji reaction to. Example: '1712451307.299279'."
100
+ }
101
+ },
102
+ "required": ["channel_id", "emoji_name", "timestamp_id"]
103
+ }
104
+ }
105
+ },
106
+ {
107
+ "type": "function",
108
+ "function": {
109
+ "name": "slack_remove_latest_emoji_reaction",
110
+ "description": "Remove an emoji reaction to the latest message in the channel.",
111
+ "parameters": {
112
+ "type": "object",
113
+ "properties": {
114
+ "channel_id": {
115
+ "type": "string",
116
+ "description": "The channel id to remove emoji reaction from. Example: 'D04HS7LEX17'."
117
+ },
118
+ "emoji_name": {
119
+ "type": "string",
120
+ "description": "The name of the emoji to add. Example: 'thumbsup'."
121
+ }
122
+ },
123
+ "required": ["channel_id", "emoji_name"]
124
+ }
125
+ }
126
+ },
127
+ {
128
+ "type": "function",
129
+ "function": {
130
+ "name": "slack_upload_file",
131
+ "description": "Upload a file to a channel.",
132
+ "parameters": {
133
+ "type": "object",
134
+ "properties": {
135
+ "channel_id": {
136
+ "type": "string",
137
+ "description": "The channel id to delete the message from. Example: 'D04HS7LEX17'."
138
+ },
139
+ "initial_comment": {
140
+ "type": "string",
141
+ "description": "Initial text comments we add to the file. Example: 'Personal file'."
142
+ },
143
+ "file_name": {
144
+ "type": "string",
145
+ "description": "The name of the file to be uploaded Example: 'README.md'."
146
+ }
147
+ },
148
+ "required": ["channel_id", "initial_comment", "file_name"]
149
+ }
150
+ }
151
+ },
152
+ {
153
+ "type": "function",
154
+ "function": {
155
+ "name": "slack_delete_latest_file",
156
+ "description": "Delete the latest file and its corresponding message in a channel.",
157
+ "parameters": {
158
+ "type": "object",
159
+ "properties": {
160
+ "channel_id": {
161
+ "type": "string",
162
+ "description": "The channel id to delete the file from. Example: 'D04HS7LEX17'."
163
+ }
164
+ },
165
+ "required": ["channel_id"]
166
+ }
167
+ }
168
+ },
169
+ {
170
+ "type": "function",
171
+ "function": {
172
+ "name": "slack_read_messages",
173
+ "description": "Read the most recent k messages in a channel.",
174
+ "parameters": {
175
+ "type": "object",
176
+ "properties": {
177
+ "channel_id": {
178
+ "type": "string",
179
+ "description": "The channel id to read messages from. Example: 'D04HS7LEX17'."
180
+ },
181
+ "limit": {
182
+ "type": "integer",
183
+ "description": "Number of messages to be read from the channel. Default: 10. Example: 1."
184
+ }
185
+ },
186
+ "required": ["channel_id"]
187
+ }
188
+ }
189
+ }
190
+ ]
goex/function/slack_add_emoji_reaction.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import pickle
3
+ from slack_sdk import WebClient
4
+ from slack_sdk.errors import SlackApiError
5
+
6
+
7
+ def slack_add_emoji_reaction(channel_id, emoji_name, timestamp_id):
8
+ # Load Slack credentials
9
+ credentials_path = './credentials/slack/token.pickle'
10
+ if os.path.exists(credentials_path):
11
+ with open(credentials_path, 'rb') as token_file:
12
+ slack_token = pickle.load(token_file)
13
+ else:
14
+ raise FileNotFoundError("Slack token file not found.")
15
+ client = WebClient(token=slack_token)
16
+
17
+ try:
18
+ # Call the chat.postMessage method using the WebClient
19
+ result = client.reactions_add(
20
+ # The name of the conversation
21
+ channel=channel_id,
22
+ name=emoji_name,
23
+ timestamp=timestamp_id,
24
+ )
25
+ print("Message sent successfully.", result)
26
+
27
+ except SlackApiError as e:
28
+ # Print the error
29
+ print(f"Error sending message: {e.response['error']}")
30
+ raise
goex/function/slack_delete_latest_file.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import pickle
3
+ from slack_sdk import WebClient
4
+ from slack_sdk.errors import SlackApiError
5
+
6
+ def slack_delete_latest_file(channel_id):
7
+ # Load Slack credentials
8
+ credentials_path = './credentials/slack/token.pickle'
9
+ if os.path.exists(credentials_path):
10
+ with open(credentials_path, 'rb') as token_file:
11
+ slack_token = pickle.load(token_file)
12
+ else:
13
+ raise FileNotFoundError("Slack token file not found.")
14
+ client = WebClient(token=slack_token)
15
+
16
+ try:
17
+ result = client.conversations_history(
18
+ channel=channel_id,
19
+ limit=10
20
+ )
21
+ messages = result.get('messages', [])
22
+
23
+ file_id = None
24
+ msg_ts = None
25
+ for message in messages:
26
+ bots = message.get('files', [])
27
+ if len(bots) > 0:
28
+ file_id = bots[0].get('id', [])
29
+ msg_ts = message.get('ts', [])
30
+ break
31
+ if file_id:
32
+ # Delete the file
33
+ deletion_result = client.files_delete(file=file_id)
34
+ print("File deleted successfully.", deletion_result)
35
+
36
+ msg_result = client.chat_delete(channel=channel_id, ts=msg_ts)
37
+ print("Message deleted successfully.", msg_result)
38
+
39
+ else:
40
+ print("File not found.")
41
+
42
+ except SlackApiError as e:
43
+ print(f"Error deleting file: {e.response['error']}")
44
+ raise