Skip to content

Instantly share code, notes, and snippets.

Created December 30, 2021 05:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?

Explain code

This uses AI to read and try and understand the code, and explain it back to you:


curl --request POST --header 'Content-Type: application/json' \
--data '{"code":"    history =, y_train, epochs=100, batch_size=32, validation_split=0.1,\ncallbacks=[keras.callbacks.EarlyStopping(monitor='val_loss', patience=3, mode='min')], shuffle=False)\nprint(model.evaluate(X_test, y_test))"}'

Sample response:

The model is trained using the training data, and the validation data is used to check the accuracy of the model. The model is trained for 100 epochs, with a batch size of 32 and 10 percent of the data being used for validation. The early stopping callback is used to stop training when the validation loss has not decreased for 3 epochs.

Security source code scanner (SAST)

Using AI with GPT-3 and codex and more to scan for problems. Examples:

curl --request POST --header 'Content-Type: application/json' 
-d '{"code": "class Log:\ndef __init__(self, path):\n        dirname = os.path.dirname(path)\n       os.makedirs(dirname, exist_ok=True)\n "}'

Sample response:

The code is vulnerable to directory traversal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment