Did I find the right examples for you? yes no

All Samples(14505)  |  Call(14441)  |  Derive(0)  |  Import(64)
all(iterable) -> bool

Return True if bool(x) is True for all values x in the iterable.
If the iterable is empty, return True.

src/s/h/shorten-2.0.2/example.py   shorten(Download)
def valid_url(url):
   p = parse(url, rule='URI_reference')
   return all(p['scheme'], p['authority'], p['path'])
 
app = Flask(__name__)

src/s/h/shorten-HEAD/example.py   shorten(Download)
def valid_url(url):
   p = parse(url, rule='URI_reference')
   return all(p['scheme'], p['authority'], p['path'])
 
app = Flask(__name__)

src/p/y/pydstool-HEAD/examples/traj_gt0_test.py   pydstool(Download)
vals1 = traj.sample(tlo=1.8, thi=5.8)
vals2 = traj.sample(tlo=1.8, thi=5.8, dt=0.1)  # dt makes no diff here
assert all(vals1['t'] == vals2['t'])
assert all(vals1['v'] == vals2['v'])
 
# sampling happens in global time by default
vals3 = traj.sample(tlo=1.8, thi=5.8, asGlobalTime=False)
assert all(traj.underlyingMesh()['v'][0] == arange(10))
assert all(vals0 == vals3)
assert vals3['t'][0] == 2
 
vals1_2 = traj.sample(tlo=1.8, thi=5.8)
assert all(traj.underlyingMesh()['v'][0] == arange(10))

src/d/j/django-admin2-HEAD/example/blog/tests/test_views.py   django-admin2(Download)
        )
 
        self.assertTrue(all([
            model1.pk == model2.pk
            for model1, model2 in zipped_queryset
        response = self.client.get(reverse("admin2:blog_post_index"))
 
        self.assertTrue(all([
            not post.published
            for post in response.context["object_list"]
        )
 
        self.assertTrue(all([
            post.published
            for post in response.context["object_list"]
        )
 
        self.assertTrue(all([
            post.published
            for post in response.context["object_list"]

src/m/a/main-HEAD/Runtime/Samples/sympl/python/runtime.py   main(Download)
    def FallbackInvokeMember (self, targetMO, argMOs, errorSuggestionMO):
        ## Defer if any object has no value so that we evaulate their
        ## Expressions and nest a CallSite for the InvokeMember.
        if not targetMO.HasValue or not all(map(lambda x: x.HasValue, argMOs)):
            return self.Defer((targetMO,) + tuple(argMOs))
        ## Defer if any object has no value so that we evaulate their
        ## Expressions and nest a CallSite for the InvokeMember.
        if not targetMO.HasValue or not all(map(lambda x: x.HasValue, argMOs)):
            return self.Defer((targetMO,) + tuple(argMOs))
        ## Try COM object first.
    def FallbackCreateInstance (self, targetMO, argMOs, errorSuggestionMO):
        ## Defer if any object has no value so that we evaulate their
        ## Expressions and nest a CallSite for the CreateInstance.
        if not targetMO.HasValue or not all(map(lambda x: x.HasValue, argMOs)):
            return self.Defer((targetMO,) + tuple(argMOs))
    def FallbackGetIndex (self, targetMO, argMOs, errorSuggestionMO):
        ## Defer if any object has no value so that we evaulate their
        ## Expressions and nest a CallSite for the InvokeMember.
        if not targetMO.HasValue or not all(map(lambda x: x.HasValue, argMOs)):
            return self.Defer((targetMO,) + tuple(argMOs))
    def FallbackSetIndex (self, targetMO, argMOs, valueMO, errorSuggestionMO):
        ## Defer if any object has no value so that we evaulate their
        ## Expressions and nest a CallSite for the SetIndex.
        if (not targetMO.HasValue or not all(map(lambda x: x.HasValue, argMOs)) or
            not valueMO.HasValue):

src/a/i/AIQ-HEAD/refmachines/BF_sampler.py   AIQ(Download)
    # same rewards on each run (excluding first 5 cycles)
    # puts it in the "passive" class
    if  all(r1[4:] == r2[4:])\
    and all(r1[4:] == r3[4:])\
    and all(r1[4:] == r4[4:])\
    and all(r1[4:] == r5[4:]): return 0

src/s/h/shedskin-HEAD/examples/sudoku4.py   shedskin(Download)
def search(values):
    "Using depth-first search and propagation, try all possible values."
    if values is None:
        return None ## Failed earlier
    if all([len(values[s]) == 1 for s in squares]): 
def assign(values, s, d):
    "Eliminate all the other values (except d) from values[s] and propagate."
    if all([eliminate(values, s, d2) for d2 in values[s] if d2 != d]):
        return values
    else:
        ## If there is only one value (d2) left in square, remove it from peers
        d2, = values[s]
        if not all([eliminate(values, s2, d2) for s2 in peers[s]]):
            return None
    ## Now check the places where d appears in the units of s

src/d/e/deap-1.0.1/examples/es/cma_bipop.py   deap(Download)
                conditions["EqualFunVals"] = True
 
            if all(strategy.pc < TOLX) and all(numpy.sqrt(numpy.diag(strategy.C)) < TOLX):
                # All components of pc and sqrt(diag(C)) are smaller than the threshold
                conditions["TolX"] = True
                conditions["ConditionCov"] = True
 
            if all(strategy.centroid == strategy.centroid + 0.1 * strategy.sigma * strategy.diagD[-NOEFFECTAXIS_INDEX] * strategy.B[-NOEFFECTAXIS_INDEX]):
                # The coordinate axis std is too low
                conditions["NoEffectAxis"] = True

src/c/j/cjklib-0.3.2/examples/dictionaryspeed.py   cjklib(Download)
def printResults(timing):
    # check that all results use the same dictionaries
    assert timing and all((timing.values()[0].keys() == runTime.keys())
                          for runTime in timing.values())
 
    methods = sorted(timing.values()[0].values()[0].keys())
    # check that all used methods are the same
    assert timing and all(all((methods == sorted(methodTime.keys()))

src/c/r/crosscat-HEAD/crosscat/utils/sample_utils.py   crosscat(Download)
    elements = [query[2] for query in Q]
    # enforce query rows all same row
    assert(all([query[0]==query_row for query in Q]))
    # enforce query columns observed column
    assert(all([query_column<num_cols for query_column in query_columns]))
    query_columns = [query[1] for query in Q]
    # enforce query rows all same row
    assert(all([query[0]==query_row for query in Q]))
    # enforce query columns observed column
    assert(all([query_column<num_cols for query_column in query_columns]))

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