MCPcopy Index your code
hub / github.com/plotly/plotly.py / _checks

Function _checks

plotly/_subplots.py:397–421  ·  view source on GitHub ↗
(item, defaults)

Source from the content-addressed store, hash-verified

395 # ### Helper to validate coerce elements of lists of dictionaries ###
396 def _check_keys_and_fill(name, arg, defaults):
397 def _checks(item, defaults):
398 if item is None:
399 return
400 if not isinstance(item, dict):
401 raise ValueError(
402 """
403Elements of the '{name}' argument to make_subplots must be dictionaries \
404or None.
405 Received value of type {typ}: {val}""".format(
406 name=name, typ=type(item), val=repr(item)
407 )
408 )
409
410 for k in item:
411 if k not in defaults:
412 raise ValueError(
413 """
414Invalid key specified in an element of the '{name}' argument to \
415make_subplots: {k}
416 Valid keys include: {valid_keys}""".format(
417 k=repr(k), name=name, valid_keys=repr(list(defaults))
418 )
419 )
420 for k, v in defaults.items():
421 item.setdefault(k, v)
422
423 for arg_i in arg:
424 if isinstance(arg_i, (list, tuple)):

Callers 1

_check_keys_and_fillFunction · 0.85

Calls 2

formatMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected