• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(90322)  |  Call(87865)  |  Derive(2447)  |  Import(10)
list() -> new empty list
list(iterable) -> new list initialized from iterable's items

src/s/h/shedskin-HEAD/examples/sha.py   shedskin(Download)
        """
 
        inBuf = list(inBufseq)   # make it a list
 
        leninBuf = len(inBuf)
 
        if leninBuf >= partLen:
            self.input[index:] = list(inBuf[:partLen])
 
            self._transform(_bytelist2longBigEndian(self.input))
            i = partLen
            while i + 63 < leninBuf:
                self._transform(_bytelist2longBigEndian(list(inBuf[i:i+64])))
                i = i + 64
            else:
                self.input = list(inBuf[i:leninBuf])
        else:
            i = 0
            self.input = self.input + list(inBuf)

src/d/i/diksel-HEAD/trunk/thirdparty/pyjamasdev/examples/libtest/ListTest.py   diksel(Download)
    def testConstructor(self):
        l1 = list()
        self.assertEqual(len(l1),0)
 
        # only accept list or iterator
        l2 = list()
        self.assertEqual(len(l2),0)
 
        l3 = list([])
        self.assertEqual(len(l3),0)
 
        l4 = list([10,])
        self.assertEqual(len(l4),1)
        self.assertEqual(l4[0],10)
 
        l5 = list(range(10,40,10))

src/r/d/rdf-0.9a6/examples/swap_primer.py   rdf(Download)
 
from pprint import pprint
pprint(list(primer))
 
 
# just think .whatever((s, p, o))
# here we report on what we know
 
pprint(list(primer.subjects()))
pprint(list(primer.predicates()))
pprint(list(primer.subjects()))
pprint(list(primer.predicates()))
pprint(list(primer.objects()))
 
# and other things that make sense
 
# what do we know about pat?
pprint(list(primer.predicate_objects(myNS.pat)))

src/i/p/ipython-py3k-HEAD/docs/examples/newparallel/davinci/pwordfreq.py   ipython-py3k(Download)
    word_set = set()
    for f in freqs_list:
        word_set.update(list(f.keys()))
    freqs = dict(list(zip(word_set, repeat(0))))
    for f in freqs_list:
    print("Took %.3f s to calcluate on %i engines"%(toc-tic, len(view.targets)))
    # cleanup split files
    list(map(os.remove, fnames))
 

src/p/r/processing-0.52/examples/ex_pool.py   processing(Download)
 
    t = time.time()
    C = list(pool.imap(pow3, xrange(N), chunksize=N//8))
    print '\tlist(pool.imap(pow3, xrange(%d), chunksize=%d)):\n\t\t%s' \
          ' seconds' % (N, N//8, time.time() - t)
 
    assert A == B == C, (len(A), len(B), len(C))
 
    t = time.time()
    C = list(pool.imap(noop, L, chunksize=len(L)//8))
    print '\tlist(pool.imap(noop, L, chunksize=%d)):\n\t\t%s seconds' % \
          (len(L)//8, time.time() - t)
 
    assert A == B == C, (len(A), len(B), len(C))

src/p/y/PyProp-HEAD/examples/tensor/helium_stabilization/plot_poster.py   PyProp(Download)
def SandbjergMakePlotIonization():
	e0, single, double = GetIonizationProbabilityScan()
 
	#add zeros to start and end to get proper closed polys
	e0 = array([0] + list(e0) + [e0[-1]+1])
	single = array([0] + list(single) + [0])
	double = array([0] + list(double) + [0])

src/p/y/PyProp-HEAD/examples/tensor/helium_stabilization/plot_paper.py   PyProp(Download)
 
	#add zeros to start and end to get proper closed polys
	e0 = array([0] + list(e0) + [e0[-1]+1])
	single = array([0] + list(single) + [0])
	double = array([0] + list(double) + [0])

src/p/y/pyDatalog-0.12.0/pyDatalog/examples/test.py   pyDatalog(Download)
    assert (A.c[X]=='a') == [(a,)]
    assert (A.c[X]=='a')[0] == (a,)
    assert list(X) == [a]
    assert X.v() == a
    assert ((A.c[a]==X) >= X) == 'a'
    assert ((A.c[a]==X) & (A.c[a]==X) >= X) == 'a'
    assert ((A.c[a]==X) & (A.c[b]==X) >= X) == None
    (A.c[X]=='b') & (A.b[X]=='a')
    assert list(X) == []
    assert list(X) == []
    (A.c[X]=='a') & (A.b[X]=='a')
    assert list(X) == [a]
    result = (A.c[X]=='a') & (A.b[X]=='a')
    assert result == [(a,)]
    assert (A.b[X]!='z') == [(a,), (b,)]
    assert (A.b[a]!='a') == []
    assert list(A.b[b]!='a') == [()]
    assert ((A.b[b]!='a') & (A.b[b]!='z')) == [()]
 
    assert (Z.z[X]=='z') == [(z,)]
    assert ((Z.z[X]=='z') & (Z.z[X]>'a')) == [(z,)]
    assert list(X) == [z]
    try:
        a.z == 'z'

src/s/y/sympy-0.7.2/examples/advanced/pyglet_plotting.py   sympy(Download)
                iu.v_steps /= 5
                iv.v_steps /= 5
                Gvl = list(list([FF(u, v), FG(u, v)]
                        for v in iv.frange())
                        for u in iu.frange())

src/b/a/badger-lib-HEAD/packages/pyparsing/examples/pymicko.py   badger-lib(Download)
            if DEBUG > 2: return
        #iterate through all multiplications/divisions
        m = list(mul)
        while len(m) > 1:
            if not self.symtab.same_types(m[0], m[2]):
            if DEBUG > 2: return
        #iterate through all additions/substractions
        n = list(num)
        while len(n) > 1:
            if not self.symtab.same_types(n[0], n[2]):

Previous  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10  Next