Args:
            *modules: Modules, or names of modules to silence (by setting their log level to WARNING or above)
            **kwargs: Pass as kwargs due to python 2.7, would be level=logging.WARNING otherwise
427472
def silence(cls, *modules, **kwargs):
        
        level = kwargs.pop("level", logging.WARNING)
        for mod in modules:
            name = mod.__name__ if hasattr(mod, "__name__") else mod
            logging.getLogger(name).setLevel(level)
254355
function logWithArgs(level, args) {
    args = [level].concat([].slice.call(args));
    logger.logLevel.apply(logger, args);
}
696617
def set_args(self, **kwargs):
        
        try:
            kwargs_items = kwargs.iteritems()
        except AttributeError:
            kwargs_items = kwargs.items()
        for key, val in kwargs_items:
            self.args[key] = val
976232
def clear_silence(self, kwargs):
        
        self._request('POST', '/silenced/clear', data=json.dumps(kwargs))
        return True
187962
def call_modules(auto_discover=()):
    
    for app in settings.INSTALLED_APPS:
        modules = set(auto_discover)
        if app in INSTALLED_APPS_REGISTER:
            modules.update(INSTALLED_APPS_REGISTER[app])
        for module in modules:
            mod = import_module(app)
            try:
                import_module('%s.%s' % (app, module))
                inst = getattr(mod, '__install__', lambda: None)
                inst()
            except:
                if module_has_submodule(mod, module):
                    raise
    app_modules_loaded.send(sender=None)
1175182
def load_and_init(self, modules):
        
        self.load(modules)
        self.get_instances()

        return len(self.configuration_errors) == 0
462285
def mute(self):
        
        fname = "mute"
        cname = self.__class__.__module__ + '.' + self.__class__.__name__
        raise NotImplementedError("%s.%s() is required" % (cname, fname))
1250932
def execute(self, *args, **kwargs):
        '''
        
        '''
        run_modules = []
        orig_arguments = self.arguments

        if args or kwargs:
            self._set_arguments(list(args), kwargs)

        # Run all modules
        for module in self.list():
            obj = self.run(module)

        # Add all loaded modules that marked themselves as enabled to the
        # run_modules list
        for (module, obj) in iterator(self.executed_modules):
            # Report the results if the module is enabled and if it is a
            # primary module or if it reported any results/errors
            if obj.enabled and (obj.PRIMARY or obj.results or obj.errors):
                run_modules.append(obj)

        self.arguments = orig_arguments

        return run_modules
469464
def add_to_loaded_modules(self, modules):
        
        modules = util.return_set(modules)
        for module in modules:
            if not isinstance(module, str):
                module = module.__name__
            self.loaded_modules.add(module)
1092826
def mark_module_reloadable(self, module_name):
        """"""
        try:
            del self.skip_modules[module_name]
        except KeyError:
            pass
        self.modules[module_name] = True
10201
def call_multiple_modules(module_gen):
    
    for args_seq in module_gen:
        module_name_or_path = args_seq[0]
        with replace_sys_args(args_seq):
            if re.match(VALID_PACKAGE_RE, module_name_or_path):
                runpy.run_module(module_name_or_path,
                                 run_name='__main__')
            else:
                runpy.run_path(module_name_or_path,
                               run_name='__main__')
829083
def delete_module(modname):
    
    try:
        _ = sys.modules[modname]
    except KeyError:
        raise ValueError("Module not found in sys.modules: '{}'".format(modname))

    for module in list(sys.modules.keys()):
        if module and module.startswith(modname):
            del sys.modules[module]
808615
def _get_args_kwargs(options, module):
    

    if module == 'emp':
        options = _emp_extra_options(options)
    arg_names, kw_names = _arg_kwarg_lists(module, options['analysis'])

    # Create list of values for arg_names
    args = []
    for arg_name in arg_names:

        if arg_name == 'patch':  # For patch arg, append actual patch obj
            args.append(options['patch'])
            continue
        if arg_name == 'self':  # Ignore self from class methods
            continue
        if arg_name == 'k':  # scipy dists use k and x, we always use x
            arg_name = 'x'

        try:
            exec 'args.append(eval("%s"))' % options[arg_name]
        except SyntaxError: # eval failing because option is a string
            args.append(options[arg_name])
        except:
            raise ValueError, ("Value for required argument %s not provided"
                               % arg_name)

    # Create dict with vals for kw_names
    kwargs = {}
    for kw_name in kw_names:
        if kw_name in options.keys():  # If a value is given for this kwarg
            try:
                exec 'kwargs[kw_name] = eval("%s")' % options[kw_name]
            except SyntaxError:  # eval failing because value is a string
                kwargs[kw_name] = options[kw_name]
            except:
                raise ValueError, ("Value for optional argument %s is invalid"
                                   % kw_name)

    return args, kwargs
1216125
def set_monitoring(module):
    
    def monitoring(is_monitoring,
                   track_data=None,
                   track_grad=None,
                   track_update=None,
                   track_update_ratio=None):
        """
        Turn monitoring on or off. If any of the keyword arguments
        are not None, they will be overwritten.
        """
        module.is_monitoring = is_monitoring
        module.track_data = track_data if track_data is not None else module.track_data
        module.track_grad = track_grad if track_grad is not None else module.track_grad
        module.track_update = track_update if track_update is not None else module.track_update
        module.track_update_ratio = track_update_ratio if track_update_ratio is not None else module.track_update_ratio
    module.monitoring = monitoring
1153073
def _deprecated_kwargs(kwargs, arg_newarg):
    
    warn_for = []
    for (arg, new_kw) in arg_newarg:
        if arg in kwargs.keys():
            val = kwargs.pop(arg)
            kwargs[new_kw] = val
            warn_for.append((arg, new_kw))
    if len(warn_for) > 0:
        if len(warn_for) == 1:
            warnings.warn("Argument '{}' is deprecated. Use {} instead".
                          format(warn_for[0][0], warn_for[0][1]),
                          DeprecationWarning, stacklevel=4)
        else:
            args = ", ".join([x[0] for x in warn_for])
            repl = ", ".join([x[1] for x in warn_for])
            warnings.warn(
                "Arguments '{}' are deprecated. Use '{}' instead respectively".
                format(args, repl),
                DeprecationWarning, stacklevel=4)
    return kwargs
796727
def __infer_setup_kwargs(module, kwargs):
    
    # Get project name from the module
    #if 'name' not in kwargs:
    #    kwargs['name'] = module.__name__
    #else:
    #    raise AssertionError('must specify module name!')
    name = kwargs['name']
    # Our projects depend on utool
    #if kwargs['name'] != 'utool':
    #    install_requires = kwargs.get('install_requires', [])
    #    if 'utool' not in install_requires:
    #        install_requires.append('utool')
    #    kwargs['install_requires'] = install_requires

    packages = kwargs.get('packages', [])
    if name not in packages:
        packages.append(name)
        kwargs['packages'] = packages

    if 'version' not in kwargs:
        version = parse_package_for_version(name)
        kwargs['version'] = version

    # Parse version
    #if 'version' not in kwargs:
    #    if module is None:
    #        version_errmsg = 'You must include a version (preferably one that matches the __version__ variable in your modules init file'
    #        raise AssertionError(version_errmsg)
    #    else:
    # Parse license
    if 'license' not in kwargs:
        try:
            kwargs['license'] = read_license('LICENSE')
        except IOError:
            pass
    # Parse readme
    if 'long_description' not in kwargs:
        kwargs['long_description'] = parse_readme()
551621
def set_logging_level(level_name=None):
    
    can_logger = logging.getLogger('can')

    try:
        can_logger.setLevel(getattr(logging, level_name.upper()))
    except AttributeError:
        can_logger.setLevel(logging.DEBUG)
    log.debug("Logging set to {}".format(level_name))