def split_csp_str(s):
 if isinstance(s, (list, tuple)):
  return s
 return list(set((i for i in s.strip().split(',') if i)))

def split_csp_str ( s ) : if isinstance ( s , ( list , tuple ) ) : return s return list ( set ( ( i for i in s . strip ( ) . split ( ',' ) if i ) ) )
split commaseparated string .