Did I find the right examples for you? yes no

All Samples(45964)  |  Call(45949)  |  Derive(15)  |  Import(0)
bool(x) -> bool

Returns True when the argument x is true, False otherwise.
The builtins True and False are the only two instances of the class bool.
The class bool is a subclass of the class int, and cannot be subclassed.

src/d/j/django-admin-report-HEAD/example/lib/sx/w3c/cssDOMElementInterface.py   django-admin-report(Download)
    _pseudoStateHandlerLookup = {
        'first-child':
            lambda self: not bool(self.getPreviousSibling()),
        'not-first-child':
            lambda self: bool(self.getPreviousSibling()),
 
        'last-child':
            lambda self: not bool(self.getNextSibling()),
        'not-last-child':
            lambda self: bool(self.getNextSibling()),
 
        'middle-child':
            lambda self: not bool(self.getPreviousSibling()) and not bool(self.getNextSibling()),
        'not-middle-child':
            lambda self: bool(self.getPreviousSibling()) or bool(self.getNextSibling()),

src/m/y/myhdl-0.8/example/manual/fsm3.py   myhdl(Download)
# SEARCH, CONFIRM, SYNC = range(3)
 
ACTIVE_LOW = bool(0)
FRAME_SIZE = 8
t_State = enum('SEARCH', 'CONFIRM', 'SYNC', encoding="one_hot")
    def FSM():
        if reset_n == ACTIVE_LOW:
            SOF.next = 0
            index.next = 0
            state.next = t_State.SEARCH
def main():
 
    SOF = Signal(bool(0))
    syncFlag = Signal(bool(0))
    clk = Signal(bool(0))

src/m/y/myhdl-0.8/example/manual/fsm2.py   myhdl(Download)
def testbench():
 
    SOF = Signal(bool(0))
    syncFlag = Signal(bool(0))
    clk = Signal(bool(0))
    reset_n = Signal(bool(1))

src/m/y/myhdl-0.8/example/manual/fsm.py   myhdl(Download)
def testbench():
 
    SOF = Signal(bool(0))
    syncFlag = Signal(bool(0))
    clk = Signal(bool(0))
    reset_n = Signal(bool(1))

src/k/i/kitsune-HEAD/vendor/packages/pyparsing/docs/examples/simpleBool.py   kitsune(Download)
                v = eval(a)
            else:
                v = bool(a)
            if not v:
                return False
                v = eval(a)
            else:
                v = bool(a)
            if v:
                return True
    def __nonzero__(self):
        if isinstance(self.arg,basestring):
            v = eval(self.arg)
        else:
            v = bool(self.arg)
for t in test:
    res = boolExpr.parseString(t)[0]
    print t,'\n', res, '=', bool(res),'\n'
 
 

src/k/i/kitsune-HEAD/vendor/packages/pyparsing/examples/simpleBool.py   kitsune(Download)
                v = eval(a)
            else:
                v = bool(a)
            if not v:
                return False
                v = eval(a)
            else:
                v = bool(a)
            if v:
                return True
    def __nonzero__(self):
        if isinstance(self.arg,basestring):
            v = eval(self.arg)
        else:
            v = bool(self.arg)
for t in test:
    res = boolExpr.parseString(t)[0]
    print t,'\n', res, '=', bool(res),'\n'
 
 

src/h/u/hunch-sample-app-HEAD/django/db/models/fields/__init__.py   hunch-sample-app(Download)
    def to_python(self, value):
        if value in (True, False):
            # if value is 1 or 0 than it's equal to True or False, but we want
            # to return a true bool for semantic reasons.
            return bool(value)
        # constructing the list.
        if value in ('1', '0'):
            value = bool(int(value))
        return super(BooleanField, self).get_prep_lookup(lookup_type, value)
 
    def get_prep_value(self, value):
        if value is None:
            return None
        return bool(value)
    def to_python(self, value):
        if value is None:
            return None
        if value in (True, False):
            return bool(value)
        # constructing the list.
        if value in ('1', '0'):
            value = bool(int(value))
        return super(NullBooleanField, self).get_prep_lookup(lookup_type, value)
 

src/m/y/myhdl-0.8/example/uart_tx/uart_tx.py   myhdl(Download)
def tb(uart_tx):   
 
    tx_bit = Signal(bool(1))
    tx_valid = Signal(bool(0))
    tx_byte = Signal(intbv(0)[8:])
    tx_clk = Signal(bool(0))

src/k/u/kuma-lib-HEAD/packages/pyparsing/docs/examples/simpleBool.py   kuma-lib(Download)
                v = eval(a)
            else:
                v = bool(a)
            if not v:
                return False
                v = eval(a)
            else:
                v = bool(a)
            if v:
                return True
    def __nonzero__(self):
        if isinstance(self.arg,basestring):
            v = eval(self.arg)
        else:
            v = bool(self.arg)
for t in test:
    res = boolExpr.parseString(t)[0]
    print t,'\n', res, '=', bool(res),'\n'
 
 

src/i/n/input-lib-HEAD/packages/pyparsing/docs/examples/simpleBool.py   input-lib(Download)
                v = eval(a)
            else:
                v = bool(a)
            if not v:
                return False
                v = eval(a)
            else:
                v = bool(a)
            if v:
                return True
    def __nonzero__(self):
        if isinstance(self.arg,basestring):
            v = eval(self.arg)
        else:
            v = bool(self.arg)
for t in test:
    res = boolExpr.parseString(t)[0]
    print t,'\n', res, '=', bool(res),'\n'
 
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next