Wrap the enable method to call pre and post enable signals and update
        module status
484769
def enable_wrapper(cls, enable, new_class):
        
        def _wrapped(self, *args, **kwargs):
            if not self.installed:
                raise AssertionError('Module %s cannot be enabled'
                                     ', you should install it first'
                                     % self.verbose_name)

            if self.enabled:
                raise AssertionError('Module %s is already enabled'
                                     % self.verbose_name)

            logger.info("Enabling %s module" % self.verbose_name)
            pre_enable.send(sender=self)
            res = enable(self, *args, **kwargs)

            # Register interfaces (if present)
            if isinstance(self, DropletInterface):
                self.register()

            post_enable.send(sender=self)

            info = self._info
            info.status = ModuleInfo.ENABLED
            info.save()

            logger.info("Enabled %s module" % self.verbose_name)
            return res

        return _wrapped
632496
@Deprecated
  public final OkHttpChannelBuilder enableKeepAlive(boolean enable) {
    if (enable) {
      return keepAliveTime(DEFAULT_KEEPALIVE_TIME_NANOS, TimeUnit.NANOSECONDS);
    } else {
      return keepAliveTime(KEEPALIVE_TIME_NANOS_DISABLED, TimeUnit.NANOSECONDS);
    }
  }
912912
def setsemod(module, state):
    '''
    
    '''
    if state.lower() == 'enabled':
        cmd = 'semodule -e {0}'.format(module)
    elif state.lower() == 'disabled':
        cmd = 'semodule -d {0}'.format(module)
    return not __salt__['cmd.retcode'](cmd)
672428
function enable(app, route, repoDir){
  expressApp = app;
  routePfx = route;
  if(repoDir){
    reader.setRepoDir(repoDir);
  }
  app.post(route, androidUpdate.updater);

  app.get(route, function (req, res){
    res.send(reader.available());
  });
}
497624
def enable(self, cmd="sudo su", pattern="ssword", re_flags=re.IGNORECASE):
        """"""
        delay_factor = self.select_delay_factor(delay_factor=0)
        output = ""
        if not self.check_enable_mode():
            self.write_channel(self.normalize_cmd(cmd))
            time.sleep(0.3 * delay_factor)
            try:
                output += self.read_channel()
                if re.search(pattern, output, flags=re_flags):
                    self.write_channel(self.normalize_cmd(self.secret))
                self.set_base_prompt()
            except socket.timeout:
                raise NetMikoTimeoutException(
                    "Timed-out reading channel, data not available."
                )
            if not self.check_enable_mode():
                msg = (
                    "Failed to enter enable mode. Please ensure you pass "
                    "the 'secret' argument to ConnectHandler."
                )
                raise ValueError(msg)
        return output
257024
public void enable() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "enable chain " + this);
        }
        enabled = true;
    }
507342
def prepend_status(func):
    """"""

    @ft.wraps(func)
    def wrapper(self, *args, **kwargs):
        """Wrapper stub."""
        res = func(self, *args, **kwargs)
        if self.status is not StepResult.UNSET:
            res = "[{status}]".format(status=self.status.name) + res
        return res

    return wrapper
1314507
def enable(self):
        
        payload = {
            "new_state": "1"
        }
        data = json.dumps(payload)
        req = self.request(self.mist_client.uri+'/clouds/'+self.id, data=data)
        req.post()
        self.enabled = True
        self.mist_client.update_clouds()
297735
public static void enable() {
        final MetaClassRegistry metaClassRegistry = GroovySystem.getMetaClassRegistry();
        synchronized (metaClassRegistry) {
            if (metaClassRegistry.getMetaClassCreationHandler() != instance) {
                ClassInfo.clearModifiedExpandos();
                metaClassRegistry.setMetaClassCreationHandle(instance);
            }
        }
    }
108149
def enable(self):
        """"""
        ret = self.get('enable')
        if ret is None:
            return False
        else:
            return ret.lower().startswith('true')
214752
def _post_activate_injection(self):
        
        self.active = True
        self.app.signals.send("plugin_activate_post", self)
1271566
def celery_enable_all():
    """"""
    from celery.signals import task_prerun, task_postrun, task_failure
    task_prerun.connect(prerun_handler)
    task_postrun.connect(postrun_handler)
    # Also have to cleanup on failure.
    task_failure.connect(postrun_handler)
1067535
def enable_reload=(reload)
      raise ArgumentError, 'Argument must be true or false.' unless [true, false].include?(reload)
      self.enable_reload = reload
    end
275178
def enable_notifications(self):
        
        # todo: #783 create a dedicated brok for global parameters
        if not self.my_conf.enable_notifications:
            self.my_conf.modified_attributes |= \
                DICT_MODATTR["MODATTR_NOTIFICATIONS_ENABLED"].value
            self.my_conf.enable_notifications = True
            self.my_conf.explode_global_conf()
            self.daemon.update_program_status()
98246
function enableCommand(consoleService, moduleId, msg, cb) {
    if (!moduleId) {
        logger.error(`fail to enable admin module for ${moduleId}`);
        cb('empty moduleId');
        return;
    }

    const modules = consoleService.modules;
    if (!modules[moduleId]) {
        cb(null, protocol.PRO_FAIL);
        return;
    }

    if (consoleService.master) {
        consoleService.enable(moduleId);
        consoleService.agent.notifyCommand('enable', moduleId, msg);
        cb(null, protocol.PRO_OK);
    } else {
        consoleService.enable(moduleId);
        cb(null, protocol.PRO_OK);
    }
}
972616
def enable_script(zap_helper, script_name):
    """"""
    with zap_error_handler():
        console.debug('Enabling script "{0}"'.format(script_name))
        result = zap_helper.zap.script.enable(script_name)

        if result != 'OK':
            raise ZAPError('Error enabling script: {0}'.format(result))

    console.info('Script "{0}" enabled'.format(script_name))
1262532
function (depMap) {
                var mod = getOwn(registry, depMap.id);
                if (mod) {
                    getModule(depMap).enable();
                }
            }