MCPcopy Index your code
hub / github.com/clips/pattern / product

Function product

pattern/vector/__init__.py:1945–1952  ·  view source on GitHub ↗
(*args)

Source from the content-addressed store, hash-verified

1943 > (0.535, 0.424, 0.551, 0.454), {"c": 0.1}
1944 """
1945 def product(*args):
1946 # Yields the cartesian product of given iterables:
1947 # list(product([1, 2], [3, 4])) => [(1, 3), (1, 4), (2, 3), (2, 4)]
1948 p = [[]]
1949 for iterable in args:
1950 p = [x + [y] for x in p for y in iterable]
1951 for p in p:
1952 yield tuple(p)
1953 s = [] # [((A, P, R, F), parameters), ...]
1954 p = [] # [[("c", 0.1), ("c", 10), ...],
1955 # [("gamma", 0.1), ("gamma", 0.2), ...], ...]

Callers 1

gridsearchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…