def supports_proxies(*proxy_types):
 def _supports_proxies(fn):
  def __supports_proxies(*args, **kwargs):
   proxy_type = get_proxy_type()
   if (proxy_type not in proxy_types):
    raise CommandExecutionError("'{0}' proxy is not supported by function {1}".format(proxy_type, fn.__name__))
   return fn(*args, **clean_kwargs(**kwargs))
  return __supports_proxies
 return _supports_proxies

def supports_proxies ( * proxy_types ) : def _supports_proxies ( fn ) : def __supports_proxies ( * args , ** kwargs ) : proxy_type = get_proxy_type ( ) if ( proxy_type not in proxy_types ) : raise CommandExecutionError ( "'{0}' proxy is not supported by function {1}" . format ( proxy_type , fn . __name__ ) ) return fn ( * args , ** clean_kwargs ( ** kwargs ) ) return __supports_proxies return _supports_proxies
decorator to specify which proxy types are supported by a function proxy_types: arbitrary list of strings with the supported types of proxies .