Building Blocks of Time: The Mathematical Foundation and Python Implementation of RNNs