def check_exclusive_options(**kwargs):
 if (not kwargs):
  return
 pretty_keys = kwargs.pop('pretty_keys', True)
 exclusive_options = {}
 for (k, v) in kwargs.items():
  if (v is not None):
   exclusive_options[k] = True
 if (len(exclusive_options) > 1):
  if pretty_keys:
   names = [k.replace('_', ' ') for k in kwargs.keys()]
  else:
   names = kwargs.keys()
  names = ', '.join(sorted(names))
  msg = (_('May specify only one of %s') % names)
  raise exception.InvalidInput(reason=msg)

def check_exclusive_options ( ** kwargs ) : if ( not kwargs ) : return pretty_keys = kwargs . pop ( 'pretty_keys' , True ) exclusive_options = { } for ( k , v ) in kwargs . items ( ) : if ( v is not None ) : exclusive_options [ k ] = True if ( len ( exclusive_options ) > 1 ) : if pretty_keys : names = [ k . replace ( '_' , ' ' ) for k in kwargs . keys ( ) ] else : names = kwargs . keys ( ) names = ', ' . join ( sorted ( names ) ) msg = ( _ ( 'May specify only one of %s' ) % names ) raise exception . InvalidInput ( reason = msg )
checks that only one of the provided options is actually not-none .