コード例 #1
0
ファイル: test_utils.py プロジェクト: vikkamath/Theano-1
def test_remove():
    def even(x):
        return x % 2 == 0

    def odd(x):
        return x % 2 == 1
    # The list are needed as with python 3, remove and filter return generators
    # and we can't compare generators.
    assert list(remove(even, range(5))) == list(filter(odd, range(5)))
コード例 #2
0
def test_remove():
    even = lambda x: x % 2 == 0
    odd = lambda x: x % 2 == 1
    # The list are neede as with python 3, remove and filter return generators
    # and we can't compare generators.
    assert list(remove(even, range(5))) == list(filter(odd, range(5)))
コード例 #3
0
ファイル: basic_sympy.py プロジェクト: truell20/grammarVAE
 def c_support_code(self):
     c_code = self._sympy_c_code()
     return '\n'.join(remove(include_line, c_code.split('\n')))
コード例 #4
0
 def c_support_code(self):
     c_code = self._sympy_c_code()
     return "\n".join(remove(include_line, c_code.split("\n")))
コード例 #5
0
ファイル: test_utils.py プロジェクト: flashus/Theano
def test_remove():
    even = lambda x: x % 2 == 0
    odd  = lambda x: x % 2 == 1
    assert remove(even, range(5)) == filter(odd, range(5))
コード例 #6
0
ファイル: test_utils.py プロジェクト: 317070/Theano
def test_remove():
    even = lambda x: x % 2 == 0
    odd = lambda x: x % 2 == 1
    # The list are neede as with python 3, remove and filter return generators
    # and we can't compare generators.
    assert list(remove(even, range(5))) == list(filter(odd, range(5)))
コード例 #7
0
ファイル: basic_sympy.py プロジェクト: Ambier/Theano
 def c_support_code(self):
     c_code = self._sympy_c_code()
     return '\n'.join(remove(include_line, c_code.split('\n')))