Undefined Variable Error When Importing Modules Functions In A Function

Undefined Variable Error When Importing Modules Functions In A Function