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

Function make_grouping_by_key

dash/_grouping.py:145–157  ·  view source on GitHub ↗

Create a grouping from a schema by using the schema's scalar values to look up items in the provided source object. :param schema: A grouping of potential keys in source :param source: Dict-like object to use to look up scalar grouping value using scalar grouping values as

(schema, source, default=None)

Source from the content-addressed store, hash-verified

143
144
145def make_grouping_by_key(schema, source, default=None):
146 """
147 Create a grouping from a schema by using the schema's scalar values to look up
148 items in the provided source object.
149
150 :param schema: A grouping of potential keys in source
151 :param source: Dict-like object to use to look up scalar grouping value using
152 scalar grouping values as keys
153 :param default: Default scalar value to use if grouping scalar key is not present
154 in source
155 :return: grouping
156 """
157 return map_grouping(lambda s: source.get(s, default), schema)
158
159
160class SchemaTypeValidationError(InvalidCallbackReturnValue):

Calls 2

map_groupingFunction · 0.85
getMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…