Собрали в одном месте самые важные ссылки
читайте нас в Telegram
from trender import TRender template = '@greet world!' compiled = TRender(template) output = compiled.render({'greet': 'Hello'}) print(output) # => Hello world!
from datetimerange import DateTimeRange time_range = DateTimeRange() print time_range.is_set() time_range.set_time_range("2015-03-22T10:00:00+0900", "2015-03-22T10:10:00+0900") print time_range.is_set()
from genty import genty, genty_repeat, genty_dataset from unittest import TestCase # Here's the class under test class MyClass(object): def add_one(self, x): return x + 1 # Here's the test code @genty class MyClassTests(TestCase): @genty_dataset( (0, 1), (100000, 100001), ) def test_add_one(self, value, expected_result): actual_result = MyClass().add_one(value) self.assertEqual(expected_result, actual_result)
>>> from mpmath import mp >>> mp.dps = 50 >>> print(mp.quad(lambda x: mp.exp(-x**2), [-mp.inf, mp.inf]) ** 2) 3.1415926535897932384626433832795028841971693993751
[In] cant.remember(inp=5, expected=15, args=3) [Out] [{'arity': '1', 'callable': '__mul__', 'input': 5, 'namespace': 'self'}, {'arity': '1', 'callable': '__rmul__', 'input': 5, 'namespace': 'self'}]
Написан на flask