Did I find the right examples for you? yes no

All Samples(164)  |  Call(125)  |  Derive(0)  |  Import(39)
Checks if a value is either ``None`` or an instance of the specified type.

Use with ``isinstance()`` as in::

    isinstance(X, maybe(T))

src/h/t/HTSQL-2.3.3/src/htsql/core/domain.py   HTSQL(Download)
 
 
from .util import (maybe, oneof, listof, Clonable, Hashable, Printable,
        TextBuffer, to_literal, urlquote, isfinite)
import re
            A native Python object representing the same value.
        """
        assert isinstance(text, maybe(unicode))
 
        # `None` values are passed through.
    def parse(text):
        # Sanity check on the argument.
        assert isinstance(data, maybe(unicode))
        # No conversion is required.
        return text
 
    @staticmethod
    def dump(data):
        # Sanity check on the argument.
        assert isinstance(data, maybe(unicode))
    def parse(text):
        assert isinstance(text, maybe(unicode))
 
        # `None` -> `None`, `'true'` -> `True`, `'false'` -> `False`.
        if text is None:

src/h/t/HTSQL-2.3.3/src/htsql/core/syn/grammar.py   HTSQL(Download)
 
 
from ..util import (maybe, oneof, listof, omapof, trim_doc, toposort, omap,
        TextBuffer, Printable)
from ..error import Error, Mark, parse_guard, point
        """
        assert isinstance(descriptor, str)
        assert isinstance(error, maybe(str))
        assert isinstance(is_junk, bool)
        assert isinstance(is_symbol, bool)
        assert isinstance(pop, maybe(int))
        assert isinstance(push, maybe(str))
    def __init__(self, name, pattern, error, is_junk, is_symbol,
                 unquote, pop, push, doc):
        assert isinstance(name, unicode)
        assert isinstance(pattern, Pattern)
        assert isinstance(error, maybe(str))

src/h/t/HTSQL-2.3.3/src/htsql/core/tr/binding.py   HTSQL(Download)
 
 
from ..util import maybe, listof, tupleof, Clonable, Printable, Hashable
from ..entity import TableEntity, ColumnEntity, Join
from ..domain import (Domain, VoidDomain, BooleanDomain, ListDomain,
    def __init__(self, base, domain, syntax):
        assert isinstance(base, maybe(Binding))
        assert base is not None or isinstance(self, (RootBinding, VoidBinding))
        assert isinstance(domain, Domain)
        assert isinstance(syntax, Syntax)
    def __init__(self, base, column, link, syntax):
        assert isinstance(column, ColumnEntity)
        assert isinstance(link, maybe(Binding))
        super(ColumnBinding, self).__init__(base, column.domain, syntax)
        self.column = column
    def __init__(self, base, seed, images, condition, syntax):
        assert isinstance(images, listof(tupleof(Binding, Binding)))
        assert isinstance(condition, maybe(Binding))
        if condition is not None:
            assert isinstance(condition.domain, BooleanDomain)
    def __init__(self, base, seed, order, limit, offset, syntax):
        assert isinstance(seed, Binding)
        assert isinstance(order, listof(tupleof(Binding, int)))
        assert isinstance(limit, maybe(int))
        assert isinstance(offset, maybe(int))

src/h/t/HTSQL-2.3.3/src/htsql/core/tr/flow.py   HTSQL(Download)
 
 
from ..util import (maybe, listof, tupleof, Clonable, Hashable, Printable,
                    cachedproperty)
from ..entity import TableEntity, ColumnEntity, Join
    def __init__(self, segment, binding):
        assert isinstance(segment, maybe(SegmentCode))
        assert isinstance(binding, QueryBinding)
        super(QueryExpr, self).__init__(binding)
        self.segment = segment
    def __init__(self, base, family, is_contracting, is_expanding, binding):
        assert isinstance(base, maybe(Flow))
        assert isinstance(family, Family)
        assert isinstance(is_contracting, bool)
        assert isinstance(is_expanding, bool)
        assert not base.spans(seed)
        assert isinstance(images, listof(tupleof(Code, Code)))
        assert isinstance(filter, maybe(Code))
        if filter is not None:
            assert isinstance(filter.domain, BooleanDomain)
        assert seed.spans(base)
        assert not base.spans(seed)
        assert isinstance(limit, maybe(int))
        assert isinstance(offset, maybe(int))
        assert isinstance(companions, listof(Code))

src/h/t/HTSQL-2.3.3/src/htsql/core/application.py   HTSQL(Download)
from .addon import addon_registry
from .adapter import ComponentRegistry
from .util import maybe, oneof, listof, dictof, tupleof
from .wsgi import wsgi
from .cmd.command import UniversalCmd
    def __init__(self, db, *extensions):
        assert isinstance(list(extensions),
                listof(oneof(str,
                             tupleof(str, maybe(dictof(str, object))),
                             dictof(str, maybe(dictof(str, object))))))

src/h/t/HTSQL-2.3.3/src/htsql/core/tr/frame.py   HTSQL(Download)
 
 
from ..util import listof, tupleof, maybe, Clonable, Hashable, Printable
from ..entity import TableEntity, ColumnEntity
from ..domain import Domain, BooleanDomain
        assert isinstance(embed, listof(NestedFrame))
        assert isinstance(select, listof(Phrase)) and len(select) > 0
        assert isinstance(where, maybe(Phrase))
        assert isinstance(group, listof(Phrase))
        assert isinstance(having, maybe(Phrase))
        assert isinstance(order, listof(Phrase))
        assert isinstance(limit, maybe(int))
        assert isinstance(offset, maybe(int))

src/h/t/HTSQL-2.3.3/src/htsql/core/tr/term.py   HTSQL(Download)
 
 
from ..util import (listof, dictof, tupleof, maybe,
                    Clonable, Printable, Hashable)
from ..domain import BooleanDomain
    def __init__(self, tag, kid, order, limit, offset,
                 flow, baseline, routes):
        assert isinstance(order, listof(tupleof(Code, int)))
        assert isinstance(limit, maybe(int))
        assert isinstance(offset, maybe(int))
    def __init__(self, segment, expression):
        assert isinstance(segment, maybe(SegmentTerm))
        assert isinstance(expression, QueryExpr)
        super(QueryTerm, self).__init__(expression)
        self.segment = segment

src/h/t/HTSQL-2.3.3/src/htsql/core/model.py   HTSQL(Download)
 
 
from .util import Hashable, Printable, Clonable, maybe, listof, tupleof
from .domain import Domain
from .entity import TableEntity, ColumnEntity, Join
    def __init__(self, origin, target, arity, is_expanding, is_contracting):
        assert isinstance(origin, Node)
        assert isinstance(target, Node)
        assert isinstance(arity, maybe(int))
        assert isinstance(is_expanding, bool)
    def __init__(self, table, column, link=None):
        assert isinstance(table, TableEntity)
        assert isinstance(column, ColumnEntity) and column.table is table
        assert isinstance(link, maybe(Arc))
        if link is not None:
    def __init__(self, origin, parameters, syntax):
        assert isinstance(parameters, maybe(listof(tupleof(unicode, bool))))
        assert isinstance(syntax, Syntax)
        super(SyntaxArc, self).__init__(
                origin=origin,

src/h/t/HTSQL-2.3.3/src/htsql/core/syn/syntax.py   HTSQL(Download)
 
 
from ..util import (maybe, listof, oneof, Clonable, Hashable, Printable,
        to_name, to_literal)
import re
    def __init__(self, larms, rarms):
        assert isinstance(larms, listof(oneof(IdentifierSyntax,
                                              ReferenceSyntax)))
        assert len(larms) > 0
        assert isinstance(rarms, maybe(listof(oneof(IdentifierSyntax,

src/h/t/HTSQL-2.3.3/src/htsql/core/validator.py   HTSQL(Download)
 
 
from .util import DB, maybe, oneof, listof, tupleof, dictof, to_name
from .domain import Record
import re
    def __init__(self, pattern=None, is_nullable=False):
        # Sanity check on the arguments.
        assert isinstance(pattern, maybe(str))
        assert isinstance(is_nullable, bool)
 
    def __init__(self, min_bound=None, max_bound=None, is_nullable=False):
        # Sanity check on the arguments.
        assert isinstance(min_bound, maybe(oneof(int, long)))
        assert isinstance(max_bound, maybe(oneof(int, long)))
        assert isinstance(is_nullable, bool)
    def __init__(self, min_bound=None, max_bound=None, is_nullable=False):
        # Sanity check on the arguments.
        assert isinstance(min_bound, maybe(float))
        assert isinstance(max_bound, maybe(float))
        assert isinstance(is_nullable, bool)

  1 | 2 | 3 | 4  Next