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

Method description

_plotly_utils/basevalidators.py:534–589  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

532 return v
533
534 def description(self):
535 # Separate regular values from regular expressions
536 enum_vals = []
537 enum_regexs = []
538 for v, regex in zip(self.values, self.val_regexs):
539 if regex is not None:
540 enum_regexs.append(regex.pattern)
541 else:
542 enum_vals.append(v)
543 desc = """\
544 The '{name}' property is an enumeration that may be specified as:""".format(
545 name=self.plotly_name
546 )
547
548 if enum_vals:
549 enum_vals_str = "\n".join(
550 textwrap.wrap(
551 repr(enum_vals),
552 initial_indent=" " * 12,
553 subsequent_indent=" " * 12,
554 break_on_hyphens=False,
555 )
556 )
557
558 desc = (
559 desc
560 + """
561 - One of the following enumeration values:
562{enum_vals_str}""".format(enum_vals_str=enum_vals_str)
563 )
564
565 if enum_regexs:
566 enum_regexs_str = "\n".join(
567 textwrap.wrap(
568 repr(enum_regexs),
569 initial_indent=" " * 12,
570 subsequent_indent=" " * 12,
571 break_on_hyphens=False,
572 )
573 )
574
575 desc = (
576 desc
577 + """
578 - A string that matches one of the following regular expressions:
579{enum_regexs_str}""".format(enum_regexs_str=enum_regexs_str)
580 )
581
582 if self.array_ok:
583 desc = (
584 desc
585 + """
586 - A tuple, list, or one-dimensional numpy array of the above"""
587 )
588
589 return desc
590
591 def in_values(self, e):

Callers

nothing calls this directly

Calls 2

formatMethod · 0.45
wrapMethod · 0.45

Tested by

no test coverage detected