forked from p15670423/monkey
Removed unused files
This commit is contained in:
parent
aaab4a479c
commit
d693b216a7
|
@ -1,9 +0,0 @@
|
|||
from itertools import chain, combinations
|
||||
|
||||
|
||||
def power_set(iterable):
|
||||
"""
|
||||
https://docs.python.org/3/library/itertools.html#itertools-recipes
|
||||
"""
|
||||
s = list(iterable)
|
||||
return [list(x) for x in list(chain.from_iterable(combinations(s, r) for r in range(1, len(s) + 1)))]
|
|
@ -1,18 +0,0 @@
|
|||
from unittest import TestCase
|
||||
|
||||
|
||||
class TestPower_set(TestCase):
|
||||
def test_power_set(self):
|
||||
before = ('a', 'b', 'c')
|
||||
after_expected = [
|
||||
['a'],
|
||||
['b'],
|
||||
['c'],
|
||||
['a', 'b'],
|
||||
['a', 'c'],
|
||||
['b', 'c'],
|
||||
['a', 'b', 'c'],
|
||||
]
|
||||
|
||||
from common.utils.itertools_extensions import power_set
|
||||
self.assertEquals(power_set(before), after_expected)
|
Loading…
Reference in New Issue