parameters: (argv)
docstring: Command-line parsing for 'cyber_channel hz' command.
docstring_summary: Command-line parsing for 'cyber_channel hz' command.
docstring_tokens: Command - line parsing for cyber_channel hz command .
function: def _channel_cmd_hz(argv):
      """
      Command-line parsing for 'cyber_channel hz' command.
      """
      args = argv[2:]
      from optparse import OptionParser
      parser = OptionParser(
          usage="usage: cyber_channel hz channelname")
      parser.add_option("-w", "--window",
                        dest="window_size", default=-1,
                        help="window size for calculating rate, max size is 50000")
  
      channel_name = ""
      (options, args) = parser.parse_args(args)
      if len(args) == 0:
          parser.error("channelname must be specified")
      if len(args) == 1:
          channel_name = args[0]
      if len(args) > 1:
          parser.error("param is too much")
  
      # check string
      try:
          if options.window_size != -1:
              import string
              window_size = string.atoi(options.window_size)
          else:
              window_size = options.window_size
      except:
          parser.error("window size must be an integer")
  
      channel_hz(channel_name, window_size)
function_tokens: def _channel_cmd_hz ( argv ) : args = argv [ 2 : ] from optparse import OptionParser parser = OptionParser ( usage = "usage: cyber_channel hz channelname" ) parser . add_option ( "-w" , "--window" , dest = "window_size" , default = - 1 , help = "window size for calculating rate, max size is 50000" ) channel_name = "" ( options , args ) = parser . parse_args ( args ) if len ( args ) == 0 : parser . error ( "channelname must be specified" ) if len ( args ) == 1 : channel_name = args [ 0 ] if len ( args ) > 1 : parser . error ( "param is too much" ) # check string try : if options . window_size != - 1 : import string window_size = string . atoi ( options . window_size ) else : window_size = options . window_size except : parser . error ( "window size must be an integer" ) channel_hz ( channel_name , window_size )