def _ConvertToListAndCheckType(arg, element_type, arg_name):
 ret = _ConvertToList(arg)
 for element in ret:
  if (not isinstance(element, element_type)):
   raise TypeError(('%s should be single element or list of type %s' % (arg_name, element_type)))
 return ret

def _ConvertToListAndCheckType ( arg , element_type , arg_name ) : ret = _ConvertToList ( arg ) for element in ret : if ( not isinstance ( element , element_type ) ) : raise TypeError ( ( '%s should be single element or list of type %s' % ( arg_name , element_type ) ) ) return ret
converts args to a list and check its element type .