def _expand_expected_codes(codes):
 retval = set()
 for code in codes.replace(',', ' ').split(' '):
  code = code.strip()
  if (not code):
   continue
  elif ('-' in code):
   (low, hi) = code.split('-')[:2]
   retval.update((str(i) for i in xrange(int(low), (int(hi) + 1))))
  else:
   retval.add(code)
 return retval

def _expand_expected_codes ( codes ) : retval = set ( ) for code in codes . replace ( ',' , ' ' ) . split ( ' ' ) : code = code . strip ( ) if ( not code ) : continue elif ( '-' in code ) : ( low , hi ) = code . split ( '-' ) [ : 2 ] retval . update ( ( str ( i ) for i in xrange ( int ( low ) , ( int ( hi ) + 1 ) ) ) ) else : retval . add ( code ) return retval
expand the expected code string in set of codes .