Get or create a unique device id in Python
