Ubuntu 18.04: Create/Modify SWAP partition memory limit.

Common error:
fallocate: fallocate failed: Text file busy in ubuntu OS 

Check the allocation:
free -m
or
sudo swapon --show

Make sure you have enough free disk space by
df -h

Disable the use of swap, allocate new swap space, enable swap.
sudo swapoff -a

sudo fallocate -l 8G /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Check the allocation:
free -m
or
sudo swapon --show

For detailed information: https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-18-04

Python contextlib for Timing Python code

If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...