original_docstring: 
      Give ability to enter command-line interactive mode.
  
      Options are printed on startup or if input is empty. If input not valid
      for the menu options, standard errors are raised with appropriate messages.
  
      :param args: list of command-line arguments as strings.
  
      :return: None
      
docstring: Give ability to enter command-line interactive mode.
  Options are printed on startup or if input is empty. If input not valid
  for the menu options, standard errors are raised with appropriate messages.
docstring_tokens: Give ability to enter command - line interactive mode . Options are printed on startup or if input is empty . If input not valid for the menu options standard errors are raised with appropriate messages .
code: def main(args):
      """
      Give ability to enter command-line interactive mode.
  
      Options are printed on startup or if input is empty. If input not valid
      for the menu options, standard errors are raised with appropriate messages.
  
      :param args: list of command-line arguments as strings.
  
      :return: None
      """
      if not args or set(args) & {"-h", "--help"}:
          print("Usage: python utils/job_manager.py [-i|--interactive]" " [-h|--help]")
          print("--help        : show help message")
          print("--interactive : enter interactive mode and show options.")
      else:
          if set(args) & {"-i", "--interactive"}:
              options = [
                  ("QUIT", sys.exit),
                  ("VIEW counts", getCounts),
                  ("VIEW records", getRecords),
                  ("SINGLE - enable one PlaceJob record", enableOne),
                  ("SINGLE - disable", disableOne),
                  ("SINGLE - delete", deleteOne),
                  ("SINGLE - reset times", resetTimes),
                  ("ALL - enable all PlaceJob records", enableAll),
                  ("ALL - disable", disableAll),
                  ("ALL - delete", deleteAll),
                  ("CREATE a job from specified town or country name", insertPlaceByName),
                  (
                      "CREATE a job for all towns within a specified country name",
                      insertTownsOfCountry,
                  ),
                  (
                      "VIEW the list of pre-configured places to watch, set in the"
                      " app config file",
                      printConfiguredValues,
                  ),
                  ("INSERT - Watch all pre-configured places", insertDefaults),
              ]
  
              print("Job Manager interactive mode.")
              print()
              print(
                  "You are now viewing and editing the PlaceJob table"
                  " records. Actions like enable only work after a record"
                  " has been created using CREATE or INSERT options."
              )
              print()
  
              assert db.PlaceJob.tableExists(), "PlaceJob table must be created still."
  
              # Loop until exit option is selected.
              while True:
                  print("OPTIONS")
                  for i, option in enumerate(options):
                      print("{0:2d}) {1:s}".format(i, option[0]))
                  print()
                  print("TIPS")
                  print(
                      "- Enter an option number then hit enter."
                      "\n- The 'VIEW ...' options do not alter data."
                      "\n- To see menu options again, leave text blank and"
                      " press enter."
                  )
                  print()
  
                  choice = True
  
                  # Loop until choice is empty string.
                  while choice:
                      choice = input("jobManager /> ")
                      try:
                          index = int(choice)
                          command = options[index][1]
                          command()
                      except Exception as e:
                          print("{0}. {1}".format(type(e).__name__, str(e)))
                  print()
code_tokens: def main ( args ) : if not args or set ( args ) & { "-h" , "--help" } : print ( "Usage: python utils/job_manager.py [-i|--interactive]" " [-h|--help]" ) print ( "--help        : show help message" ) print ( "--interactive : enter interactive mode and show options." ) else : if set ( args ) & { "-i" , "--interactive" } : options = [ ( "QUIT" , sys . exit ) , ( "VIEW counts" , getCounts ) , ( "VIEW records" , getRecords ) , ( "SINGLE - enable one PlaceJob record" , enableOne ) , ( "SINGLE - disable" , disableOne ) , ( "SINGLE - delete" , deleteOne ) , ( "SINGLE - reset times" , resetTimes ) , ( "ALL - enable all PlaceJob records" , enableAll ) , ( "ALL - disable" , disableAll ) , ( "ALL - delete" , deleteAll ) , ( "CREATE a job from specified town or country name" , insertPlaceByName ) , ( "CREATE a job for all towns within a specified country name" , insertTownsOfCountry , ) , ( "VIEW the list of pre-configured places to watch, set in the" " app config file" , printConfiguredValues , ) , ( "INSERT - Watch all pre-configured places" , insertDefaults ) , ] print ( "Job Manager interactive mode." ) print ( ) print ( "You are now viewing and editing the PlaceJob table" " records. Actions like enable only work after a record" " has been created using CREATE or INSERT options." ) print ( ) assert db . PlaceJob . tableExists ( ) , "PlaceJob table must be created still." while True : print ( "OPTIONS" ) for i , option in enumerate ( options ) : print ( "{0:2d}) {1:s}" . format ( i , option [ 0 ] ) ) print ( ) print ( "TIPS" ) print ( "- Enter an option number then hit enter." "\n- The 'VIEW ...' options do not alter data." "\n- To see menu options again, leave text blank and" " press enter." ) print ( ) choice = True while choice : choice = input ( "jobManager /> " ) try : index = int ( choice ) command = options [ index ] [ 1 ] command ( ) except Exception as e : print ( "{0}. {1}" . format ( type ( e ) . __name__ , str ( e ) ) ) print ( )
short_docstring: Give ability to enter command-line interactive mode.
short_docstring_tokens: Give ability to enter command - line interactive mode .
comment: """
      Give ability to enter command-line interactive mode.
  
      Options are printed on startup or if input is empty. If input not valid
      for the menu options, standard errors are raised with appropriate messages.
  
      :param args: list of command-line arguments as strings.
  
      :return: None
      """$SEP$# Loop until exit option is selected.$SEP$# Loop until choice is empty string.