def make_option_group(group, parser):
 option_group = OptionGroup(parser, group['name'])
 for option in group['options']:
  option_group.add_option(option.make())
 return option_group

def make_option_group ( group , parser ) : option_group = OptionGroup ( parser , group [ 'name' ] ) for option in group [ 'options' ] : option_group . add_option ( option . make ( ) ) return option_group
return an optiongroup object group -- assumed to be dict with name and options keys parser -- an optparse parser .