def test_reduce_right_exception(case, exception): raised = False try: _.reduce_right(*case) except exception: raised = True assert raised
def ingredients(x, _path): with open(_path + '/' + x, 'r') as f: xoxo = _.reduce_right(json.load(f), coco_mixer) print(xoxo) if len(xoxo) > 0 and xoxo[0] != None: with open(str(xoxo[0]['output']), 'w') as makefile: for item in xoxo: object_id = str(item['darkchocolate'][0]) center_x = str(item['darkchocolate'][1]) center_y = str(item['darkchocolate'][2]) width = str(item['darkchocolate'][3]) height = str(item['darkchocolate'][4]) spaces = object_id + " " + center_x + " " + center_y + " " + width + " " + height makefile.write('%s\n' % spaces)
def det(): if len(data) == 1: return data else: return [1] + _.reduce_right(data, fn, init)['result']
def reduce_right(self, iteratee=None, initial=None): """Reduce reversed :meth:`all` using `iteratee`.""" return pyd.reduce_right(self.all(), iteratee, initial)
def test_reduce_right(case, expected): assert _.reduce_right(*case) == expected
def reduce_right(self, callback=None, initial=None): """Reduce reversed :meth:`all` using `callback`.""" return pyd.reduce_right(self.all(), callback, initial)