def _check_iterable(arg, msg, **kwargs):
 if isinstance(arg, compat.string_types):
  raise exceptions.ValidationError(msg.format(arg=arg, **kwargs))
 elif (not isinstance(arg, collections.Iterable)):
  raise exceptions.ValidationError(msg.format(arg=arg, **kwargs))
 elif (iter(arg) is iter(arg)):
  raise exceptions.ValidationError(msg.format(arg=arg, **kwargs))

def _check_iterable ( arg , msg , ** kwargs ) : if isinstance ( arg , compat . string_types ) : raise exceptions . ValidationError ( msg . format ( arg = arg , ** kwargs ) ) elif ( not isinstance ( arg , collections . Iterable ) ) : raise exceptions . ValidationError ( msg . format ( arg = arg , ** kwargs ) ) elif ( iter ( arg ) is iter ( arg ) ) : raise exceptions . ValidationError ( msg . format ( arg = arg , ** kwargs ) )
ensure we have an iterable which is not a string or an iterator .