SQLAlchemy This function randomly selects a database type supported by SQLAlchemy from a given URL and creates the corresponding database engine. 2024-12-16 12:09:01 Function 5 views
PyTorch This function generates a random tensor with a specified shape and data type. 2024-12-16 12:09:01 PyTorch Function 5 views
Flask-SQLAlchemy, SQLAlchemy, Flask, SQLite This code defines a Python function based on Flask-SQLAlchemy that performs operations on a user table, including creating, getting, updating, and deleting users. The function randomly selects an operation to perform. 2024-12-16 12:09:00 Python Function 3 views
wtforms This code defines a custom form validation function `validate_username` that checks if the username is alphanumeric and raises a validation error if it is not. It also defines a form class `RegistrationForm` that includes a username field using the `validate_username` function for validation. 2024-12-16 12:09:00 Custom form validation function 3 views
SHAP, NumPy, Pandas, scikit-learn This code defines a function that uses the SHAP library to analyze the performance of a model on the training set and test set, including calculating SHAP values and the accuracy on the test set. 2024-12-16 12:09:00 The type of code 5 views
MongoDB, Motor (Python driver for MongoDB) This function randomly finds and returns a document from a MongoDB collection based on the provided query criteria. 2024-12-16 12:08:59 Database query 5 views
Telethon This function uses the Telethon library to send a random type of media file (such as image, PDF, Word, etc.) to a specified chat. It determines the file type based on the file extension and creates the corresponding input media object. 2024-12-16 12:08:59 The type of code 4 views
Pyglet, Sprite, Image This code defines a Pyglet window with a ball that can be moved with the arrow keys. 2024-12-16 12:08:59 Pyglet Game 18 views
Flask, flask-wtf, WTForms This is a login form example based on Flask and flask-wtf. It includes a form class `LoginForm` that uses `StringField` and `PasswordField` to collect username and password, and uses `InputRequired` and `Length` validators to ensure that the input is required and the length is appropriate. The `check_login_form` function is used to validate the form data and handle the login logic. 2024-12-16 12:08:59 Flask Web Application 4 views
cryptography library, hashes module, asymmetric module This code defines two functions, one for encrypting a message with an RSA public key, and another for decrypting a message with an RSA private key. It uses the cryptography library's hashes and asymmetric modules. 2024-12-16 12:08:58 The type of code 6 views