.. _l-functions: Functions ========= .. contents:: :local: :depth: 1 Summary +++++++ +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | function | class parent | truncated documentation | +=========================================================================================================================+==============+===================================================================================================================================================================================================+ | :func:`_distance_img ` | | Computes the distance between two images. The function uses :epkg:`Pillow`. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`_distance_img_b64 ` | | Calls :func:`_distance_img` on an image encoded with :epkg:`*pyf:base64`. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`_get_app ` | | Get application. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`_setup_hook ` | | if this function is added to the module, the help automation and unit tests call it first before anything goes on ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`base642image ` | | Gets an encoded image and builds an :epkg:`PIL:Image.Image` from it. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`bytes2string ` | | Converts bytes to string. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`check ` | | Checks the library is working. It raises an exception. If you want to disable the logs: | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`dummy_application ` | | Defines a dummy application using this API. It returns a score produced by a model trained on `Iris datasets `_ ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`dummy_application_auth ` | | Defines a dummy application using this API including authentification. It returns a score produced by a model trained ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`dummy_application_fct ` | | Defines an application as defined in the tutorial :ref:`l-dummy-function-application`. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`dummy_application_image ` | | Defines a dummy application using this API and processing one image. The API ingests an image, resizes it to 224x224 ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`dummy_application_neighbors ` | | Defines a dummy application using this API. It returns a list of neighbors with a score on `Iris datasets `_. ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`dummy_application_neighbors_image ` | | Defines a dummy application using this API. It returns a list of one neighbor for an image and metadata (random). ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`dummy_mlstorage ` | | Defines a dummy application using this API. It stores a model and it returns a score produced by a model trained ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`encrypt_password ` | | Encrypts one password. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`encrypt_passwords ` | | Encrypts users passwords. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`encrypt_pwd ` | | Encrypts passwords to setup a REST API with *lightmlrestapi*. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`enumerate_parsed_logs ` | | Goes through a list of logged files, reads and decrypts the content. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_wiki_img ` | | Returns a path to local image. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`image2array ` | | Converts a color imaged into an array. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`image2base64 ` | | Encodes an image into :epkg:`*pyf:base64`. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`json_dumps ` | | Dumps an object into :epkg:`json`. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`json_loads ` | | Loads an object from :epkg:`json`. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`json_predict_model ` | | Builds a REST request to compute the prediction of a machine learning model upload with :func:`json_upload_model`. ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`json_upload_model ` | | Builds a REST request to upload a machine learned models to a REST API defined by :class:`MLStoragePost`. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`load_passwords ` | | Loads the encrypted passwords from a filename, a dataframe, a list of tuple. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`main ` | | Implements ``python -m pyquickhelper ``. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_load ` | | Loads the model. The model name is relative to this file. When call by a REST API, the default value is always used. ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_load ` | | Loads the model. The model name is relative to this file. When call by a REST API, the default value is always used. ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_load ` | | Loads the model. The model name is relative to this file. When call by a REST API, the default value is always used. ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_load ` | | Loads the model. The model name is relative to this file. When call by a REST API, the default value is always used. ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_predict ` | | Computes the prediction for model *clf*. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_predict ` | | Computes the prediction for model *clf*. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_predict ` | | Computes the prediction for model *clf*. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_predict ` | | Computes the prediction for model *clf*. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_version ` | | Displays a version. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_version ` | | Displays a version. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_version ` | | Displays a version. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`restapi_version ` | | Displays a version. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`start_mlrestapi ` | | Creates an :epkg:`falcon` application and runs it through a :epkg:`wsgi` server. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`start_mlreststor ` | | Creates an :epkg:`falcon` application and runs it through a :epkg:`wsgi` server. The appplication stores machine ... | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`string2bytes ` | | Converts string to bytes. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`submit_rest_request ` | | Submits a request to a REST API defined by :class:`MLStoragePost`. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`unzip_bytes ` | | Unzips everything from a buffer. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`upload_model ` | | Uplaods a machine learned models to a REST API defined by :class:`MLStoragePost`. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`zip_dict ` | | Zips a dictionary ``{ str: bytes }``. | +-------------------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+