Disable CRSF proection during testing.
357901
def validate_csrf_token(self, field):
        """"""
        if current_app.testing:
            return
        super(InvenioBaseForm, self).validate_csrf_token(field)
849465
def stop_scan_request(self):
        ''''''
        command=HCI_Cmd_LE_Scan_Enable(False,False)
        self.transport.write(command.encode())
893639
def disable(name, **kwargs):
    '''
    
    '''
    if _service_is_upstart(name):
        return _upstart_disable(name)
    executable = _get_service_exec()
    cmd = [executable, '-f', name, 'remove']
    return not __salt__['cmd.retcode'](cmd, python_shell=False)
647244
def disable():
    
    Benchmark.enable = False
    ComparisonBenchmark.enable = False
    BenchmarkedFunction.enable = False
    BenchmarkedClass.enable = False
729519
private void tearDownShiro()
  {
    try
    {
      SecurityManager securityManager = SecurityUtils.getSecurityManager();

      LifecycleUtils.destroy(securityManager);
      ThreadContext.unbindSecurityManager();
      ThreadContext.unbindSubject();
      ThreadContext.remove();
    }
    catch (UnavailableSecurityManagerException e)
    {

      // we don't care about this when cleaning up the test environment
      // (for example, maybe the subclass is a unit test and it didn't
      // need a SecurityManager instance because it was using only mock Subject instances)
    }

    SecurityUtils.setSecurityManager(null);
  }
174840
def disable_reporting(self):
        """"""
        self.reporting = False
        msg = bytearray([REPORT_DIGITAL + self.port_number, 0])
        self.board.sp.write(msg)
494378
public function disable()
    {
        $updatedCheck = $this->ohDear->disableCheck($this->id);

        $this->enabled = $updatedCheck->enabled;
    }
769433
private function disableAll()
    {
        // set all non-error endpoints to disabled
        $this->getEndpoints()->map(function (Endpoint $endpoint) {
            if ($endpoint->isError() === false) {
                $endpoint->setStatus(Endpoint::STATUS_DISABLED);
            }
        });
    }
1107645
public void disable() {
        if (disabled) {
            return;
        }
        disabled = true;
        try {
            for (Region region : regions) {
                beaconManager.stopMonitoringBeaconsInRegion(region);
            }
        } catch (RemoteException e) {
            LogManager.e(e, TAG, "Can't stop bootstrap regions");
        }
        beaconManager.unbind(beaconConsumer);
    }
339206
def disable_passive_host_checks(self, host):
        
        if host.passive_checks_enabled:
            host.modified_attributes |= DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value
            host.passive_checks_enabled = False
            self.send_an_element(host.get_update_status_brok())
945192
def _remove_creds(creds_file=None):
    
    if creds_file is None:
        creds_file = os.path.expanduser("~/.onecodex")

    try:
        os.remove(creds_file)
    except Exception as e:
        if e.errno == errno.ENOENT:
            return False
        elif e.errno == errno.EACCES:
            click.echo(
                "Please check the permissions on {}".format(collapse_user(creds_file)), err=True
            )
            sys.exit(1)
        else:
            raise

    return True
151143
def remove_vuln_check(check_id)
      checks = REXML::XPath.first(@xml, '//VulnerabilityChecks')
      checks.elements.delete("Disabled/Check[@id='#{check_id}']")
      checks.elements.delete("Enabled/Check[@id='#{check_id}']")
    end
348325
def disable():
        """"""
        if os.name != 'nt' or not Windows.is_enabled():
            return False

        getattr(sys.stderr, '_reset_colors', lambda: False)()
        getattr(sys.stdout, '_reset_colors', lambda: False)()

        if isinstance(sys.stderr, _WindowsStream):
            sys.stderr = getattr(sys.stderr, 'original_stream')
        if isinstance(sys.stderr, _WindowsStream):
            sys.stdout = getattr(sys.stdout, 'original_stream')

        return True
1024815
public static synchronized void disable() {
        if (!enabled) {
            return;
        }
        RxJavaPlugins.setOnObservableAssembly(oldOnObservableAssembly);
        oldOnObservableAssembly = null;
        RxJavaPlugins.setOnConnectableObservableAssembly(oldOnConnectableObservableAssembly);
        oldOnConnectableObservableAssembly = null;
        RxJavaPlugins.setOnCompletableAssembly(oldOnCompletableAssembly);
        oldOnCompletableAssembly = null;
        RxJavaPlugins.setOnSingleAssembly(oldOnSingleAssembly);
        oldOnSingleAssembly = null;
        RxJavaPlugins.setOnMaybeAssembly(oldOnMaybeAssembly);
        oldOnMaybeAssembly = null;
        RxJavaPlugins.setOnFlowableAssembly(oldOnFlowableAssembly);
        oldOnFlowableAssembly = null;
        RxJavaPlugins.setOnConnectableFlowableAssembly(oldOnConnectableFlowableAssembly);
        oldOnConnectableFlowableAssembly = null;
        RxJavaPlugins.setOnParallelAssembly(oldOnParallelAssembly);
        oldOnParallelAssembly = null;
        enabled = false;
    }
1004197
private void suppressSeleniumJavaUtilLogging() {
        if ( ! seleniumLoggingSuppressed.getAndSet(true) ) {
            try {
                // Log4j logging is annoyingly difficult to turn off, it usually requires a config file but we can also do it with an InputStream
                Properties properties = new Properties();
                properties.setProperty("org.openqa.selenium.remote.ProtocolHandshake.level", "OFF");
                properties.setProperty("org.openqa.selenium.remote.ProtocolHandshake.useParentHandlers", "false");

                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                properties.store(byteArrayOutputStream, "seleniumLoggingProperties");
                byte[] bytes = byteArrayOutputStream.toByteArray();

                ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
                LogManager.getLogManager().readConfiguration(byteArrayInputStream);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
810429
def _none():
    """"""

    Mock = type("Mock", (), {"__getattr__": lambda Qt, attr: None})

    Qt.__binding__ = "None"
    Qt.__qt_version__ = "0.0.0"
    Qt.__binding_version__ = "0.0.0"
    Qt.QtCompat.loadUi = lambda uifile, baseinstance=None: None
    Qt.QtCompat.setSectionResizeMode = lambda *args, **kwargs: None

    for submodule in _common_members.keys():
        setattr(Qt, submodule, Mock())
        setattr(Qt, "_" + submodule, Mock())
1246304
protected function setSslVerification()
    {
        if ($this->getTestMode())
            $this->httpClient->setSslVerification(false, false, 0); // disable ssl cert check
        else
            $this->httpClient->setSslVerification(); // set to defaults
    }