parameters: ()
return_statement: return options
docstring: Registers the command-line options.
docstring_summary: Registers the command-line options.
docstring_tokens: Registers the command - line options .
function: def _ParseArgs():
    """Registers the command-line options."""
    usage = 'usage: %prog [options]'
    parser = optparse.OptionParser(usage=usage)
  
    parser.add_option('--label', type='string', default='MY_TEST',
                      help=('Label of the test, used to identify different '
                            'tests. Default: %default'))
    parser.add_option('--ref_video', type='string',
                      help='Reference video to compare with (YUV).')
    parser.add_option('--test_video', type='string',
                      help=('Test video to be compared with the reference '
                            'video (YUV).'))
    parser.add_option('--frame_analyzer', type='string',
                      help='Path to the frame analyzer executable.')
    parser.add_option('--aligned_output_file', type='string',
                      help='Path for output aligned YUV or Y4M file.')
    parser.add_option('--vmaf', type='string',
                      help='Path to VMAF executable.')
    parser.add_option('--vmaf_model', type='string',
                      help='Path to VMAF model.')
    parser.add_option('--vmaf_phone_model', action='store_true',
                      help='Whether to use phone model in VMAF.')
    parser.add_option('--yuv_frame_width', type='int', default=640,
                      help='Width of the YUV file\'s frames. Default: %default')
    parser.add_option('--yuv_frame_height', type='int', default=480,
                      help='Height of the YUV file\'s frames. Default: %default')
    parser.add_option('--chartjson_result_file', type='str', default=None,
                      help='Where to store perf results in chartjson format.')
    options, _ = parser.parse_args()
  
    if not options.ref_video:
      parser.error('You must provide a path to the reference video!')
    if not os.path.exists(options.ref_video):
      parser.error('Cannot find the reference video at %s' % options.ref_video)
  
    if not options.test_video:
      parser.error('You must provide a path to the test video!')
    if not os.path.exists(options.test_video):
      parser.error('Cannot find the test video at %s' % options.test_video)
  
    if not options.frame_analyzer:
      parser.error('You must provide the path to the frame analyzer executable!')
    if not os.path.exists(options.frame_analyzer):
      parser.error('Cannot find frame analyzer executable at %s!' %
                   options.frame_analyzer)
  
    if options.vmaf and not options.vmaf_model:
      parser.error('You must provide a path to a VMAF model to use VMAF.')
  
    return options
function_tokens: def _ParseArgs ( ) : usage = 'usage: %prog [options]' parser = optparse . OptionParser ( usage = usage ) parser . add_option ( '--label' , type = 'string' , default = 'MY_TEST' , help = ( 'Label of the test, used to identify different ' 'tests. Default: %default' ) ) parser . add_option ( '--ref_video' , type = 'string' , help = 'Reference video to compare with (YUV).' ) parser . add_option ( '--test_video' , type = 'string' , help = ( 'Test video to be compared with the reference ' 'video (YUV).' ) ) parser . add_option ( '--frame_analyzer' , type = 'string' , help = 'Path to the frame analyzer executable.' ) parser . add_option ( '--aligned_output_file' , type = 'string' , help = 'Path for output aligned YUV or Y4M file.' ) parser . add_option ( '--vmaf' , type = 'string' , help = 'Path to VMAF executable.' ) parser . add_option ( '--vmaf_model' , type = 'string' , help = 'Path to VMAF model.' ) parser . add_option ( '--vmaf_phone_model' , action = 'store_true' , help = 'Whether to use phone model in VMAF.' ) parser . add_option ( '--yuv_frame_width' , type = 'int' , default = 640 , help = 'Width of the YUV file\'s frames. Default: %default' ) parser . add_option ( '--yuv_frame_height' , type = 'int' , default = 480 , help = 'Height of the YUV file\'s frames. Default: %default' ) parser . add_option ( '--chartjson_result_file' , type = 'str' , default = None , help = 'Where to store perf results in chartjson format.' ) options , _ = parser . parse_args ( ) if not options . ref_video : parser . error ( 'You must provide a path to the reference video!' ) if not os . path . exists ( options . ref_video ) : parser . error ( 'Cannot find the reference video at %s' % options . ref_video ) if not options . test_video : parser . error ( 'You must provide a path to the test video!' ) if not os . path . exists ( options . test_video ) : parser . error ( 'Cannot find the test video at %s' % options . test_video ) if not options . frame_analyzer : parser . error ( 'You must provide the path to the frame analyzer executable!' ) if not os . path . exists ( options . frame_analyzer ) : parser . error ( 'Cannot find frame analyzer executable at %s!' % options . frame_analyzer ) if options . vmaf and not options . vmaf_model : parser . error ( 'You must provide a path to a VMAF model to use VMAF.' ) return options