def test_chained(self): f = ~X.get('item', '').startswith('Hello') assert f({'item': 'Hello world'}) assert not f({'item': 'Goodbye world'}) assert not f({})
def test_chained(self): f = ~X.get("item", "").startswith("Hello") assert f({"item": "Hello world"}) assert not f({"item": "Goodbye world"}) assert not f({})
def get(self, request, data): bounds = data > maybe | X.get('in_polygon') return ((data or {}) > as_kwargs(get_car_position_data) | where(X['car'] | self.filter) | group_by(X['location'] | (grouping_precision, X, bounds)) | X.iteritems() | foreach({ 'location': X[1][0]['location'], 'cars': X[1] | foreach(X['car']) | self.get_car_data, }) | tuple)