def _parse_object_status(status):
 if (not isinstance(status, list)):
  status = [status]
 status_set = set()
 action_set = set()
 for val in status:
  for s in ('COMPLETE', 'FAILED', 'IN_PROGRESS'):
   index = val.rfind(s)
   if (index != (-1)):
    status_set.add(val[index:])
    if (index > 1):
     action_set.add(val[:(index - 1)])
    break
 return (action_set, status_set)

def _parse_object_status ( status ) : if ( not isinstance ( status , list ) ) : status = [ status ] status_set = set ( ) action_set = set ( ) for val in status : for s in ( 'COMPLETE' , 'FAILED' , 'IN_PROGRESS' ) : index = val . rfind ( s ) if ( index != ( - 1 ) ) : status_set . add ( val [ index : ] ) if ( index > 1 ) : action_set . add ( val [ : ( index - 1 ) ] ) break return ( action_set , status_set )
parse input status into action and status if possible .