def split_input(val):
 if isinstance(val, list):
  return val
 try:
  return [x.strip() for x in val.split(',')]
 except AttributeError:
  return [x.strip() for x in str(val).split(',')]

def split_input ( val ) : if isinstance ( val , list ) : return val try : return [ x . strip ( ) for x in val . split ( ',' ) ] except AttributeError : return [ x . strip ( ) for x in str ( val ) . split ( ',' ) ]
take an input value and split it into a list .