Altair, Pandas The function generates a random chart based on a provided DataFrame and chart type. The function first randomly selects fields from the DataFrame, then generates the corresponding Altair chart based on the chart type (bar, line, or scatter). 2024-12-16 12:12:04 Python Function 4 views
Flask, Flask-SQLAlchemy, SQLite database This code implements a user management system based on Flask-SQLAlchemy, including functions to create a user, retrieve a user by email, update a user's email, and delete a user. 2024-12-16 12:12:04 The type of code 4 views
gensim This function takes a text and a pre-trained gensim model as input, and then extracts keyphrases from the text using the provided model. 2024-12-16 12:12:03 Function 8 views
mysql-connector-python This function is used to create a MySQL database. If the database already exists, it will not be created again. 2024-12-16 12:12:03 Function 6 views
opencv-python, numpy, skimage This function reads an image from a specified path, converts the image to the Lab color space, detects areas within a specific color range in the Lab space, and draws the detected color areas on the original image. 2024-12-16 12:12:03 Image processing 5 views
CatBoost, NumPy This function trains a CatBoost classifier using the provided training data. It accepts training data X_train and corresponding labels y_train as inputs and returns the trained model. 2024-12-16 12:12:03 Machine Learning Classifier Training Function 4 views
Tkinter This function toggles the state of a Tkinter button based on the state of a given Tkinter variable. If the variable is True, the button is disabled; otherwise, it is enabled. 2024-12-16 12:12:02 Tkinter GUI Function 3 views
CatBoost, scikit-learn This function trains a CatBoost regression model on the Boston Housing dataset and returns the predictions on the test set. 2024-12-16 12:12:02 Function 4 views
Flask, random This function creates a simple Flask application that returns a random number in JSON or text format based on the input parameters. 2024-12-16 12:12:02 Web API 4 views
Pillow library This function first loads an image, then creates a drawing context, draws a red outline circle and a blue rectangle on the image, and finally saves the modified image to the specified output path. 2024-12-16 12:12:02 Pillow library image processing 3 views