Python Check If Variable Is Function