Runs Django ``collectstatic`` command in silent mode.

    :return: always ``True``
199417
def collect_static() -> bool:
    
    from django.core.management import execute_from_command_line
    # from django.conf import settings
    # if not os.listdir(settings.STATIC_ROOT):
    wf('Collecting static files... ', False)
    execute_from_command_line(['./manage.py', 'collectstatic', '-c', '--noinput', '-v0'])
    wf('[+]\n')
    return True
1306415
def _run_check_onlyif(self, low_data, cmd_opts):
        '''
        
        '''
        ret = {'result': False}

        if not isinstance(low_data['onlyif'], list):
            low_data_onlyif = [low_data['onlyif']]
        else:
            low_data_onlyif = low_data['onlyif']

        def _check_cmd(cmd):
            if cmd != 0 and ret['result'] is False:
                ret.update({'comment': 'onlyif condition is false',
                            'skip_watch': True,
                            'result': True})
            elif cmd == 0:
                ret.update({'comment': 'onlyif condition is true', 'result': False})

        for entry in low_data_onlyif:
            if isinstance(entry, six.string_types):
                cmd = self.functions['cmd.retcode'](
                    entry, ignore_retcode=True, python_shell=True, **cmd_opts)
                log.debug('Last command return code: %s', cmd)
                _check_cmd(cmd)
            elif isinstance(entry, dict):
                if 'fun' not in entry:
                    ret['comment'] = 'no `fun` argument in onlyif: {0}'.format(entry)
                    log.warning(ret['comment'])
                    return ret
                result = self.functions[entry.pop('fun')](**entry)
                if self.state_con.get('retcode', 0):
                    _check_cmd(self.state_con['retcode'])
                elif not result:
                    ret.update({'comment': 'onlyif condition is false',
                                'skip_watch': True,
                                'result': True})
                else:
                    ret.update({'comment': 'onlyif condition is true',
                                'result': False})

            else:
                ret.update({'comment': 'onlyif execution failed, bad type passed', 'result': False})
        return ret
842191
def _any_source_silent(sources):
    """"""
    return np.any(np.all(np.sum(
        sources, axis=tuple(range(2, sources.ndim))) == 0, axis=1))
14298
def start_accepting_passive_svc_checks(self):
        
        # todo: #783 create a dedicated brok for global parameters
        if not self.my_conf.accept_passive_service_checks:
            self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value
            self.my_conf.accept_passive_service_checks = True
            self.my_conf.explode_global_conf()
            self.daemon.update_program_status()
1204182
def silence(temporary_level = ::Logger::ERROR)
      begin
        old_logger_level, self.level = level, temporary_level
        yield self
      ensure
        self.level = old_logger_level
      end
    end
375455
def command(settings_module,
            command,
            bin_env=None,
            pythonpath=None,
            env=None,
            runas=None,
            *args, **kwargs):
    '''
    
    '''
    dja = _get_django_admin(bin_env)
    cmd = '{0} {1} --settings={2}'.format(dja, command, settings_module)

    if pythonpath:
        cmd = '{0} --pythonpath={1}'.format(cmd, pythonpath)

    for arg in args:
        cmd = '{0} --{1}'.format(cmd, arg)

    for key, value in six.iteritems(kwargs):
        if not key.startswith('__'):
            cmd = '{0} --{1}={2}'.format(cmd, key, value)
    return __salt__['cmd.run'](cmd, env=env, runas=runas, python_shell=False)
87075
def start_accepting_passive_host_checks(self):
        
        # todo: #783 create a dedicated brok for global parameters
        if not self.my_conf.accept_passive_host_checks:
            self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value
            self.my_conf.accept_passive_host_checks = True
            self.my_conf.explode_global_conf()
            self.daemon.update_program_status()
459508
def post_silence_request(self, kwargs):
        
        self._request('POST', '/silenced', data=json.dumps(kwargs))
        return True
592879
def managepy(cmd, extra=None):
    """"""

    extra = extra.split() if extra else []
    run_django_cli(['invoke', cmd] + extra)
1104768
def silent(cmd, **kwargs):
    
    return call(cmd, shell=True, stdout=NULL, stderr=NULL, **kwargs)
1013194
def cli(parser):
    '''
    
    '''
    parser.add_argument('-n', '--dry-run', action='store_true', help='Print cleanup actions without running')
    opts = parser.parse_args()

    for sitedir in site.getsitepackages():
        cleanup(sitedir, execute=not opts.dry_run, verbose=opts.verbose or opts.dry_run)
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)
976232
def clear_silence(self, kwargs):
        
        self._request('POST', '/silenced/clear', data=json.dumps(kwargs))
        return True
255838
def _mod_run_check(cmd_kwargs, onlyif, unless):
    '''
    
    '''
    if onlyif:
        if __salt__['cmd.retcode'](onlyif, **cmd_kwargs) != 0:
            return {'comment': 'onlyif condition is false',
                    'skip_watch': True,
                    'result': True}

    if unless:
        if __salt__['cmd.retcode'](unless, **cmd_kwargs) == 0:
            return {'comment': 'unless condition is true',
                    'skip_watch': True,
                    'result': True}

    # No reason to stop, return True
    return True
1203970
def run_in_background(*args, &block)
      command_line = normalize_command_line(*args, &block)

      pid, out, err = spawn_process(command_line)
      Process.detach(pid)
      at_exit do
        kill_process(pid)
      end
      return collect_result(command_line, pid, out, err)
    end
1270416
def run(quiet, args):
    
    if not args:
        raise ClickException('pass a command to run')

    cmd = ' '.join(args)
    application = get_current_application()
    name = application.name
    settings = os.environ.get('DJANGO_SETTINGS_MODULE', '%s.settings' % name)
    return application.run(
        cmd,
        verbose=not quiet,
        abort=False,
        capture=True,
        env={
            'DJANGO_SETTINGS_MODULE': settings
        }
    )
691535
def set_quiet(mres, parent, global_options):
    
    quiet = global_options.get('quiet')
    if quiet is not None:
        mres._quiet = quiet
    else:
        mres._quiet = parent.quiet