def _merge_extra_filerefs(*args):
 ret = []
 for arg in args:
  if isinstance(arg, string_types):
   if arg:
    ret.extend(arg.split(','))
  elif isinstance(arg, list):
   if arg:
    ret.extend(arg)
 return ','.join(ret)

def _merge_extra_filerefs ( * args ) : ret = [ ] for arg in args : if isinstance ( arg , string_types ) : if arg : ret . extend ( arg . split ( ',' ) ) elif isinstance ( arg , list ) : if arg : ret . extend ( arg ) return ',' . join ( ret )
takes a list of filerefs and returns a merged list .