Library python code