Added python stubs and completed python code.