def allowed_flags(args, flags):
 flags = set(flags)
 for arg in args.keys():
  try:
   if (Options.__options__[arg].is_Flag and (not (arg in flags))):
    raise FlagError(("'%s' flag is not allowed in this context" % arg))
  except KeyError:
   raise OptionError(("'%s' is not a valid option" % arg))

def allowed_flags ( args , flags ) : flags = set ( flags ) for arg in args . keys ( ) : try : if ( Options . __options__ [ arg ] . is_Flag and ( not ( arg in flags ) ) ) : raise FlagError ( ( "'%s' flag is not allowed in this context" % arg ) ) except KeyError : raise OptionError ( ( "'%s' is not a valid option" % arg ) )
allow specified flags to be used in the given context .