Python Check If Variable Is A Function