def is_uuid(u, version=4):
 try:
  uuid_obj = UUID(u, version=version)
  return (str(uuid_obj) == u)
 except:
  return False

def is_uuid ( u , version = 4 ) : try : uuid_obj = UUID ( u , version = version ) return ( str ( uuid_obj ) == u ) except : return False
test if valid v4 uuid .