def safe_brands(brands):
 if isinstance(brands, str):
  brands = set([brands])
 if isinstance(brands, list):
  brands = set(brands)
 return brands

def safe_brands ( brands ) : if isinstance ( brands , str ) : brands = set ( [ brands ] ) if isinstance ( brands , list ) : brands = set ( brands ) return brands
for convenience .