def deserialize_count_specs(text):
 specs = text.splitlines()
 specs = [line.split(',') for line in specs if line.strip()]
 return {int(num): slug.strip().lower() for (num, slug) in specs}

def deserialize_count_specs ( text ) : specs = text . splitlines ( ) specs = [ line . split ( ',' ) for line in specs if line . strip ( ) ] return { int ( num ) : slug . strip ( ) . lower ( ) for ( num , slug ) in specs }
takes a string in the format of: int .