.. _l-functions: Functions ========= .. contents:: :local: :depth: 1 Summary +++++++ +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | function | class parent | truncated documentation | +=================================================================================================================+==============+===============================================================================================================================================================================================================================================================+ | :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:`audio2wav ` | | The sound is converted into :epkg:`wav` and returned as an :epkg:`AudioArrayClip`. Le son est converti au format ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`audio_compose ` | | Concatenates or superposes two sounds. Ajoute ou superpose deux sons. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`audio_concatenate ` | | Concatenates sounds. Met bout à bout des sons. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`audio_extract_audio ` | | Extracts a part of an audio. Extrait une partie du son. Uses `subclip `_. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`audio_modification ` | | Modifies a sound. Modifie un son. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`audio_save ` | | Saves as a sound. Enregistre un son dans un fichier. Uses `write_audiofile `_. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`blur ` | | Blurs a part of a picture. Uses `blur `_. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`check ` | | Checks a couple of functionality works. The test takes 5-6 seconds to download, 4-5 seconds to process the video. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`check ` | | Checks the library is working. It raises an exception. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`check ` | | run checking functions | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`check_chute ` | | basic checkings | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`check_echiquier ` | | basic checkings | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`check_pyramide ` | | basic checkings | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`check_tri ` | | basic checkings | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`clean_function_notebook ` | | Cleans cells when unittesting notebooks. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`clean_video ` | | Cleans residual open streams. It is related to the following issues: | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`copy_jstool2notebook ` | | Copies a tool to :epkg:`notebook` folder. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`display_canvas_point ` | | Adds a canvas to draw from a notebook, the code use javascript. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`distance ` | | Computes the distance between two positions. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`distance_circuit ` | | Computes the distance of this circuit. Calcule la longueur d'un circuit. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`distance_point ` | | Returns the Euclidian distance between two points. Retourne la distance euclidienne entre deux points. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`download_youtube_video ` | | Downloads a video from :epkg:`youtube` with :epkg:`pytube`. Télécharge une vidéo depuis :epkg:`youtube` avec :epkg:`pytube`. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`execute_notebooks ` | | Executes a list of notebooks. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`find_best_positions_greedy ` | | Finds the best position for name, explore all positions. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_additional_paths ` | | Returns a list of paths to add before running the notebooks, paths to :epkg:`pyquickhelper`, ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`get_wrapped ` | | Retrives the video or the audio wrapped or not wrapped into obj. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`instruction_pass ` | | Cette fonction ne fait rien. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`load_ipython_extension ` | | to allow the call ``%load_ext code_beatrix`` | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`load_prenoms_w ` | | returns a list of first names, taken from `Nominis `_. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`local_d3js ` | | try to find a local copy of d3js | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`ls_notebooks ` | | Returns the list of notebooks in a particular subfolder. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`measure_positions ` | | Returns the sum of edges weights. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`optimize_positions ` | | Optimizes the positions. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`permutation ` | | Switches two points and returns a new path. Echange deux points et retourne le nouveau circuit. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`plot_circuit ` | | Plots the circuit on a graph. Dessine la solution du voyageur de commerce. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`plot_positions ` | | Draws positions and first names into a graph. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`random_positions ` | | Draws random position for some person in a classroom. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`rectangle ` | | Draws a rectangle. Uses `blur `_. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`register_scratch_magics ` | | register magics function, can be called from a notebook | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`reverse ` | | Reverses a sub part of circuit. Retourne une partie du circuit. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_compose ` | | Concatenates or superposes two videos. Ajoute ou superpose deux vidéos. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_concatenate ` | | Concatenates videos. Met bout à bout des vidéos. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_enumerate_frames ` | | Enumerates frames from a video. Itère sur des images depuis une vidéo. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_extract_audio ` | | Returns the audio of a video. Retourne le son d'une vidéo. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_extract_video ` | | Extracts a part of a video. Extrait une partie de la vidéo. Uses `subclip `_. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_frame ` | | Creates a video from drawing or images. *fct_frame* can either be a function which draws a picture at time *t* or ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_image ` | | Creates a :epkg:`ImageClip`. Créé une vidéo à partir d'une image. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_load ` | | Loads a video. Charge une vidéo. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_map_images ` | | Applies one complex process to a video such as extracting characters from videos and removing the backaground. It ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_map_images_detect ` | | Blurs people faces. Uses function `detectmultiscale `_. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_map_images_people ` | | Extracts characters from a movie. The movie is composed with an image and a `mask `_. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_modification ` | | Modifies a video. Modifie une vidéo. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_position ` | | Modifies the position of a position. Modifie la position d'une video. Relies on function `set_position `_. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_remove_audio ` | | Returns the same video without audio. Retourne la même vidéo sans le son. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_replace_audio ` | | Replaces the sound of a video. Remplace la bande-son d'une vidéo. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_resize ` | | Resizes a video. Modifie la taille d'une video. Relies on function `resize `_. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_save ` | | Saves as a video or as a :epkg:`gif`. Enregistre une vidéo dans un fichier. Uses `write_videofile `_. ... | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_save_image ` | | Saves one image from a video. Enregistre une image extraite d'une vidéo. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`video_text ` | | Creates an image with text (:epkg:`ImageClip`). Créé une image à partir de texte. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`voyageur_commerce_simple ` | | Solves the TSP using basic permutations, points are 2D coordinates. Résoud le problème du voyageur de commerce. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :func:`voyageur_de_commerce_points ` | | Default values for the notebook :ref:`voyageurdecommercerst`. | +-----------------------------------------------------------------------------------------------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+