def get_int_or_uuid(value):
 try:
  uuid.UUID(value)
  return value
 except (ValueError, AttributeError):
  return int(value)

def get_int_or_uuid ( value ) : try : uuid . UUID ( value ) return value except ( ValueError , AttributeError ) : return int ( value )
check if a value is valid as uuid or an integer .