parameters: ()
docstring: The main function of the utility
docstring_summary: The main function of the utility
docstring_tokens: The main function of the utility
function: def main():
      """The main function of the utility"""
      try:
          sep_at = sys.argv.index('--')
      except ValueError:
          print('Usage: {0} <args> -- <command to run>'.format(sys.argv[0]))
          sys.exit(1)
  
      cmd = sys.argv[sep_at+1:]
  
      parser = argparse.ArgumentParser(description=sys.modules[__name__].__doc__)
      parser.add_argument(
          '--period_sec',
          required=True,
          type=int,
          help='The delay between two messages'
      )
      parser.add_argument(
          '--message',
          required=False,
          default='Still running ' + ' '.join(cmd),
          help='The message to display'
      )
      args = parser.parse_args(sys.argv[1:sep_at])
  
      with Condition() as running:
          bg_thread = threading.Thread(
              target=do_notifying,
              args=(args.period_sec, args.message, running)
          )
          bg_thread.start()
  
          with subprocess.Popen(
              cmd,
              stdin=subprocess.PIPE,
              stdout=subprocess.PIPE,
              stderr=subprocess.PIPE
          ) as proc:
              out, err = proc.communicate()
  
      bg_thread.join()
  
      sys.stdout.write(out.decode('utf-8'))
      sys.stderr.write(err.decode('utf-8'))
      sys.exit(proc.returncode)
function_tokens: def main ( ) : try : sep_at = sys . argv . index ( '--' ) except ValueError : print ( 'Usage: {0} <args> -- <command to run>' . format ( sys . argv [ 0 ] ) ) sys . exit ( 1 ) cmd = sys . argv [ sep_at + 1 : ] parser = argparse . ArgumentParser ( description = sys . modules [ __name__ ] . __doc__ ) parser . add_argument ( '--period_sec' , required = True , type = int , help = 'The delay between two messages' ) parser . add_argument ( '--message' , required = False , default = 'Still running ' + ' ' . join ( cmd ) , help = 'The message to display' ) args = parser . parse_args ( sys . argv [ 1 : sep_at ] ) with Condition ( ) as running : bg_thread = threading . Thread ( target = do_notifying , args = ( args . period_sec , args . message , running ) ) bg_thread . start ( ) with subprocess . Popen ( cmd , stdin = subprocess . PIPE , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) as proc : out , err = proc . communicate ( ) bg_thread . join ( ) sys . stdout . write ( out . decode ( 'utf-8' ) ) sys . stderr . write ( err . decode ( 'utf-8' ) ) sys . exit ( proc . returncode )