def validate_is_instance(instance, classes):
 if (not isinstance(classes, tuple)):
  classes = (classes,)
 correct_instance = isinstance(instance, classes)
 if (not correct_instance):
  raise ValueError(('Expected instance type %s found %s' % (classes, type(instance))))

def validate_is_instance ( instance , classes ) : if ( not isinstance ( classes , tuple ) ) : classes = ( classes , ) correct_instance = isinstance ( instance , classes ) if ( not correct_instance ) : raise ValueError ( ( 'Expected instance type %s found %s' % ( classes , type ( instance ) ) ) )
usage validate_is_instance validate_is_instance(a .