MCPcopy Index your code
hub / github.com/plotly/dash / validate_and_group_input_args

Function validate_and_group_input_args

dash/_validate.py:143–164  ·  view source on GitHub ↗
(flat_args, arg_index_grouping)

Source from the content-addressed store, hash-verified

141
142
143def validate_and_group_input_args(flat_args, arg_index_grouping):
144 if grouping_len(arg_index_grouping) != len(flat_args):
145 raise exceptions.CallbackException("Inputs do not match callback definition")
146
147 args_grouping = map_grouping(lambda ind: flat_args[ind], arg_index_grouping)
148 if isinstance(arg_index_grouping, dict):
149 func_args = []
150 func_kwargs = args_grouping
151 for key in func_kwargs:
152 if not key.isidentifier():
153 raise exceptions.CallbackException(
154 f"{key} is not a valid Python variable name"
155 )
156 elif isinstance(arg_index_grouping, (tuple, list)):
157 func_args = list(args_grouping)
158 func_kwargs = {}
159 else:
160 # Scalar input
161 func_args = [args_grouping]
162 func_kwargs = {}
163
164 return func_args, func_kwargs
165
166
167def validate_multi_return(output_lists, output_values, callback_id):

Callers

nothing calls this directly

Calls 2

grouping_lenFunction · 0.85
map_groupingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…