def parse_labels_string(header, labels_str):
 if (header in SPACE_SEPARATED_LABEL_HEADERS):
  sep = ' '
 else:
  sep = ','
 labels = labels_str.strip().split(sep)
 return set([l.strip() for l in labels if l.strip()])

def parse_labels_string ( header , labels_str ) : if ( header in SPACE_SEPARATED_LABEL_HEADERS ) : sep = ' ' else : sep = ',' labels = labels_str . strip ( ) . split ( sep ) return set ( [ l . strip ( ) for l in labels if l . strip ( ) ] )
parses a string into a set of labels .