def check_valid_profile(option, _opt_str, value, parser):
 profs = registry.get_plugin_classes(obj.Profile)
 if profs:
  try:
   profs[value]
  except KeyError:
   debug.error((('Invalid profile ' + value) + ' selected'))
  setattr(parser.values, option.dest, value)

def check_valid_profile ( option , _opt_str , value , parser ) : profs = registry . get_plugin_classes ( obj . Profile ) if profs : try : profs [ value ] except KeyError : debug . error ( ( ( 'Invalid profile ' + value ) + ' selected' ) ) setattr ( parser . values , option . dest , value )
checks to make sure the selected profile is valid .