how to use isidentifier method in python