def ensure_metadata_list(text):
 if isinstance(text, six.text_type):
  if (u';' in text):
   text = text.split(u';')
  else:
   text = text.split(u',')
 return list(OrderedDict.fromkeys([v for v in (w.strip() for w in text) if v]))

def ensure_metadata_list ( text ) : if isinstance ( text , six . text_type ) : if ( u';' in text ) : text = text . split ( u';' ) else : text = text . split ( u',' ) return list ( OrderedDict . fromkeys ( [ v for v in ( w . strip ( ) for w in text ) if v ] ) )
canonicalize the format of a list of authors or tags .