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

Method _prepare_grouping

dash/dash.py:1580–1595  ·  view source on GitHub ↗

Prepare grouping logic for inputs or outputs.

(self, data_list, indices)

Source from the content-addressed store, hash-verified

1578 return func
1579
1580 def _prepare_grouping(self, data_list, indices):
1581 """Prepare grouping logic for inputs or outputs."""
1582 if not isinstance(data_list, list):
1583 flat_data = [data_list]
1584 else:
1585 flat_data = data_list
1586
1587 if len(flat_data) > 0:
1588 grouping = map_grouping(lambda ind: flat_data[ind], indices)
1589 using_grouping = not isinstance(indices, int) and indices != list(
1590 range(grouping_len(indices))
1591 )
1592 else:
1593 grouping, using_grouping = [], False
1594
1595 return grouping, using_grouping
1596
1597 def _execute_callback(self, func, args, outputs_list, g):
1598 """Execute the callback with the prepared arguments."""

Callers 1

_prepare_callbackMethod · 0.95

Calls 2

map_groupingFunction · 0.85
grouping_lenFunction · 0.85

Tested by

no test coverage detected