Skip to content

Commit 95057fb

Browse files
committed
normalize code
1 parent 1574d5b commit 95057fb

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

test_automl/step2_config.py

+1-26
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import itertools
33
from itertools import combinations
44

5-
import wandb
65
from fun2code import fun2code_dict
76

7+
import wandb
88
from dance.transforms.misc import Compose, SetConfig
99

1010
#TODO register more functions and add more examples
@@ -30,32 +30,7 @@
3030
}
3131
} #Functions registered in the preprocessing process
3232

33-
# def generate_combinations_with_required_elements(elements, r, required_elements=[]):
34-
# """生成元素的所有组合,其中多个元素为必选.
35-
36-
# 参数:
37-
# - elements: 元素的集合
38-
# - r: 每个组合的元素个数
39-
# - required_elements: 必选的元素集合
40-
41-
# 返回:
42-
# 一个包含所有组合的列表
43-
44-
# """
45-
46-
# def combinations_helper(current_combo, remaining_elements, r, required_elements):
47-
# if r == 0 and all(elem in current_combo for elem in required_elements):
48-
# all_combinations.append(tuple(current_combo))
49-
# return
50-
51-
# for i, element in enumerate(remaining_elements):
52-
# print(remaining_elements)
53-
# combinations_helper(current_combo + [element], remaining_elements[i + 1:], r - 1, required_elements)
54-
5533

56-
# all_combinations = []
57-
# combinations_helper([], elements, r, required_elements)
58-
# return all_combinations
5934
def generate_combinations_with_required_elements(elements, required_elements=[]):
6035
optional_elements = [x for x in elements if x not in required_elements]
6136

0 commit comments

Comments
 (0)