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

Function generate_class

dash/development/_py_components_generation.py:312–344  ·  view source on GitHub ↗

Generate a Python class object given a class string. Parameters ---------- typename props description namespace Returns -------

(
    typename, props, description, namespace, prop_reorder_exceptions=None
)

Source from the content-addressed store, hash-verified

310
311
312def generate_class(
313 typename, props, description, namespace, prop_reorder_exceptions=None
314):
315 """Generate a Python class object given a class string.
316 Parameters
317 ----------
318 typename
319 props
320 description
321 namespace
322 Returns
323 -------
324 """
325 string = generate_class_string(
326 typename, props, description, namespace, prop_reorder_exceptions
327 )
328 scope = {
329 "Component": Component,
330 "ComponentType": ComponentType,
331 "_explicitize_args": _explicitize_args,
332 "typing": typing,
333 "numbers": numbers,
334 "TypedDict": TypedDict,
335 "NotRequired": NotRequired,
336 "Literal": Literal,
337 "NumberType": typing.Union[
338 typing.SupportsFloat, typing.SupportsComplex, typing.SupportsInt
339 ],
340 }
341 # pylint: disable=exec-used
342 exec(string, scope)
343 result = scope[typename]
344 return result
345
346
347def required_props(props):

Callers 2

component_classFunction · 0.90
component_written_classFunction · 0.90

Calls 1

generate_class_stringFunction · 0.70

Tested by 2

component_classFunction · 0.72
component_written_classFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…