def _get_repr_cls(value):
 if (value in REPRESENTATION_CLASSES):
  value = REPRESENTATION_CLASSES[value]
 try:
  assert issubclass(value, BaseRepresentation)
 except (TypeError, AssertionError):
  raise ValueError(u'Representation is {0!r} but must be a BaseRepresentation class or one of the string aliases {1}'.format(value, list(REPRESENTATION_CLASSES)))
 return value

def _get_repr_cls ( value ) : if ( value in REPRESENTATION_CLASSES ) : value = REPRESENTATION_CLASSES [ value ] try : assert issubclass ( value , BaseRepresentation ) except ( TypeError , AssertionError ) : raise ValueError ( u'Representation is {0!r} but must be a BaseRepresentation class or one of the string aliases {1}' . format ( value , list ( REPRESENTATION_CLASSES ) ) ) return value
return a valid representation class from value or raise exception .