Returns True if scripting is available. Checks are done in the client
        library (redis-py) AND the redis server. Result is cached, so done only
        one time.
966168
def support_scripting(self):
        
        if not hasattr(self, '_support_scripting'):
            try:
                self._support_scripting = self.redis_version >= (2, 5) \
                    and hasattr(self.connection, 'register_script')
            except:
                self._support_scripting = False
        return self._support_scripting
826270
def is_python_script(filename):
    '''
    '''
    if filename.lower().endswith('.py'):
        return True

    if not os.path.isfile(filename):
        return False

    try:
        with open(filename, 'rb') as fp:
            if fp.read(2) != b'#!':
                return False
            return re.match(r'.*python', str_(fp.readline()))
    except IOError:
        pass

    return False
277063
def download_script(script_file_name):
    ''''''
    return "Sorry! Temporarily disabled."
    if script_file_name[:-3] in registered_modules:
        loaded_module = registered_modules[script_file_name[:-3]]
        package_path = os.sep.join(loaded_module.__package__.split('.')[1:])
        return send_from_directory(directory=os.path.join(
                                      app.config['SCRIPTS_DIR'],
                                      package_path),
                                   filename=script_file_name)
    else:
        return "ERROR"
1037170
def is_available(self):
        
        # if the availability flag is raised, return True immediately.
        # NOTE: subsequent API failures will lower this flag. we do this here
        # to ensure we don't keep hitting Joe with requests while availability
        # is there.
        if self.server_available:
            return True

        # otherwise, we have to check with the cloud.
        else:

            try:
                self.server_available = self.jbx.server_online()
                return self.server_available
            except jbxapi.JoeException:
                pass

        self.server_available = False
        return False
350309
def is_delayed(self) -> bool:
        """"""
        if not self.redis_key_delayed:
            return False

        value = self._red.get(self.redis_key_delayed)
        if not value:
            return False

        return True
172311
def available(self):
        

        for module_name in self.packages:
            if importlib.util.find_spec(module_name):
                return True
        return False
1111709
public function isAvailable()
    {
        $available = true;
        try {
            $this->redis->ping();
        } catch (RedisException $e) {
            $available = false;
        }

        return $available;
    }
682798
def check_redis_connected(app_configs, **kwargs):
    
    import redis
    from django_redis import get_redis_connection
    errors = []

    try:
        connection = get_redis_connection('default')
    except redis.ConnectionError as e:
        msg = 'Could not connect to redis: {!s}'.format(e)
        errors.append(checks.Error(msg, id=health.ERROR_CANNOT_CONNECT_REDIS))
    except NotImplementedError as e:
        msg = 'Redis client not available: {!s}'.format(e)
        errors.append(checks.Error(msg, id=health.ERROR_MISSING_REDIS_CLIENT))
    except ImproperlyConfigured as e:
        msg = 'Redis misconfigured: "{!s}"'.format(e)
        errors.append(checks.Error(msg, id=health.ERROR_MISCONFIGURED_REDIS))
    else:
        result = connection.ping()
        if not result:
            msg = 'Redis ping failed'
            errors.append(checks.Error(msg, id=health.ERROR_REDIS_PING_FAILED))
    return errors
214410
function() {
			if (Loader.loading) { return false; }

			var count	= 0;

			if (some(this.pending, function(script) {
				count++;
				if (script.satisfied()) {
					Loader.loading = script;
					script.module.install();
					script.load();
					return true;
				}
				return false;
			}) || count === 0) { return true; }
			return false;
		}
1360948
def checkAvailable(from_module):
        
        if txrequests is None and treq is None:
            config.error("neither txrequests nor treq is installed, but {} is requiring it\n\n{}".format(
                from_module, HTTPClientService.TREQ_PROS_AND_CONS))
112338
public function isAvailable()
    {
        // check if apache module is installed
        if (function_exists('apache_get_modules')) {
            foreach (apache_get_modules() as $name) {
                if (strpos($name, 'geoip') !== false) {
                    return true;
                }
            }
        }

        $available = !empty($_SERVER[self::TEST_SERVER_VAR])
            || !empty($_SERVER[self::TEST_SERVER_VAR_ALT])
            || !empty($_SERVER[self::TEST_SERVER_VAR_ALT_IPV6])
        ;

        if ($available) {
            return true;
        }

        // if not available return message w/ extra info
        if (!function_exists('apache_get_modules')) {
            return Piwik::translate('General_Note') . ':&nbsp;' . Piwik::translate('UserCountry_AssumingNonApache');
        }

        $message = "<strong>" . Piwik::translate('General_Note') . ':&nbsp;'
            . Piwik::translate('UserCountry_FoundApacheModules')
            . "</strong>:<br/><br/>\n<ul style=\"list-style:disc;margin-left:24px\">\n";
        foreach (apache_get_modules() as $name) {
            $message .= "<li>$name</li>\n";
        }
        $message .= "</ul>";
        return $message;
    }
982594
def is_program(self):
        
        from automate.callables import Empty
        return not (isinstance(self.on_activate, Empty)
                    and isinstance(self.on_deactivate, Empty)
                    and isinstance(self.on_update, Empty))
889063
def is_for_driver_task(self):
        
        return all(
            len(x) == 0
            for x in [self.module_name, self.class_name, self.function_name])
1002890
def evaluate_script(self):
        

        editor = self.get_current_editor()
        if not editor:
            return False

        LOGGER.debug("> Evaluating 'Script Editor' content.")
        if self.evaluate_code(foundations.strings.to_string(editor.toPlainText().toUtf8())):
            self.ui_refresh.emit()
            return True
269230
public static boolean isP2WSH(Script script) {
        if (!isP2WH(script))
            return false;
        List<ScriptChunk> chunks = script.chunks;
        if (!chunks.get(0).equalsOpCode(OP_0))
            return false;
        byte[] chunk1data = chunks.get(1).data;
        return chunk1data != null && chunk1data.length == SegwitAddress.WITNESS_PROGRAM_LENGTH_SH;
    }
1315129
def is_ready_for_command(self, timeout=0):
        
        while True:
            try:
                return self.check_is_ready_for_command(timeout)
            except (select.error, IOError) as ex:
                if self.errno_from_exception(ex) == errno.EINTR:
                    continue
                return False
541380
def busy(self):
        
        if self.handle.isexecuting():
            return True
        elif self.used_by is None:
            return False
        return not self.used_by() is None