Did I find the right examples for you? yes no

All Samples(12)  |  Call(7)  |  Derive(0)  |  Import(5)

        def is_true(s):
    return s.lower() in ('1', 't', 'true', 'y', 'yes')
        


src/d/e/denyhosts-HEAD/DenyHosts/deny_hosts.py   denyhosts(Download)
import re
 
from util import die, is_true, is_false, send_email
from allowedhosts import AllowedHosts
from loginattempt import LoginAttempt
        self.__first_time = first_time
        self.__noemail = noemail
        self.__report = Report(prefs.get("HOSTNAME_LOOKUP"), is_true(prefs['SYSLOG_REPORT']))
        self.__daemon = daemon
        self.__sync_server = prefs.get('SYNC_SERVER')
        self.__sync_upload = is_true(prefs.get("SYNC_UPLOAD"))
        self.__sync_download = is_true(prefs.get("SYNC_DOWNLOAD"))
            pass
 
        suspicious_always = is_true(self.__prefs.get('SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS'))
 
        login_attempt = LoginAttempt(self.__prefs,

src/d/e/denyhosts-HEAD/DenyHosts/report.py   denyhosts(Download)
from types import ListType, TupleType
import logging
from util import is_true
try:
    import syslog
        if self.use_syslog:
            syslog.openlog("denyhosts")
        self.hostname_lookup = is_true(hostname_lookup)
 
    def empty(self):

src/d/e/denyhosts-HEAD/DenyHosts/loginattempt.py   denyhosts(Download)
import os
import logging
from util import is_true
 
from counter import Counter, CounterRecord
        self.__age_reset_restricted = prefs.get('AGE_RESET_RESTRICTED')
 
        self.__reset_on_success = is_true(prefs.get('RESET_ON_SUCCESS'))
 
        self.__first_time = first_time

src/d/e/denyhosts-HEAD/DenyHosts/allowedhosts.py   denyhosts(Download)
from constants import ALLOWED_HOSTS, ALLOWED_WARNED_HOSTS
from regex import ALLOWED_REGEX_MASK, IP_REGEX
from util import is_true
 
logger = logging.getLogger("AllowedHosts")
    def __init__(self, prefs):
        debug("initializing AllowedHosts")
        work_dir = prefs.get("WORK_DIR")
        self.hostname_lookup = is_true(prefs.get("ALLOWED_HOSTS_HOSTNAME_LOOKUP"))
        self.allowed_path = os.path.join(work_dir, ALLOWED_HOSTS)

src/d/e/denyhosts-HEAD/DenyHosts/prefs.py   denyhosts(Download)
import os, sys, re
from util import die, calculate_seconds, is_true
from regex import PREFS_REGEX
import logging