def validate_read_preference_tags(name, value):
 if (not isinstance(value, list)):
  value = [value]
 tag_sets = []
 for tag_set in value:
  if (tag_set == ''):
   tag_sets.append({})
   continue
  try:
   tag_sets.append(dict([tag.split(':') for tag in tag_set.split(',')]))
  except Exception:
   raise ValueError(('%r not a valid value for %s' % (tag_set, name)))
 return tag_sets

def validate_read_preference_tags ( name , value ) : if ( not isinstance ( value , list ) ) : value = [ value ] tag_sets = [ ] for tag_set in value : if ( tag_set == '' ) : tag_sets . append ( { } ) continue try : tag_sets . append ( dict ( [ tag . split ( ':' ) for tag in tag_set . split ( ',' ) ] ) ) except Exception : raise ValueError ( ( '%r not a valid value for %s' % ( tag_set , name ) ) ) return tag_sets
parse readpreferencetags if passed as a client kwarg .