@@ -67,15 +67,15 @@ def as_individual_args(*args, **kwargs):
6767 # Check that all list arguments have the same length,
6868 # and find out what that length is
6969 # If there are no list arguments, length is 1
70- list_lengths = [len (v ) for v in args + tuple (kwargs .values ()) if isinstance (v , list )]
70+ list_lengths = [
71+ len (v ) for v in args + tuple (kwargs .values ()) if isinstance (v , list )
72+ ]
7173 if list_lengths and len (set (list_lengths )) > 1 :
7274 raise ValueError ("All list arguments must have the same length." )
7375 list_length = list_lengths [0 ] if list_lengths else 1
7476
7577 # Expand all arguments to lists of the same length
76- expanded_args = [
77- [v ] * list_length if not isinstance (v , list ) else v for v in args
78- ]
78+ expanded_args = [[v ] * list_length if not isinstance (v , list ) else v for v in args ]
7979 expanded_kwargs = {
8080 k : [v ] * list_length if not isinstance (v , list ) else v
8181 for k , v in kwargs .items ()
@@ -87,7 +87,9 @@ def as_individual_args(*args, **kwargs):
8787
8888 # Reshape into a list of dictionaries
8989 # Each dictionary represents the keyword arguments for a single function call
90- list_of_kwargs = [{k : v [i ] for k , v in expanded_kwargs .items ()} for i in range (list_length )]
90+ list_of_kwargs = [
91+ {k : v [i ] for k , v in expanded_kwargs .items ()} for i in range (list_length )
92+ ]
9193
9294 return list_of_args , list_of_kwargs
9395
0 commit comments