Create base.py

Base functions.