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

Method validate_coerce

_plotly_utils/basevalidators.py:2369–2383  ·  view source on GitHub ↗
(self, v)

Source from the content-addressed store, hash-verified

2367 return desc
2368
2369 def validate_coerce(self, v):
2370 if v is None:
2371 pass
2372 elif isinstance(v, str):
2373 # Future possibilities:
2374 # - Detect filesystem system paths and convert to URI
2375 # - Validate either url or data uri
2376 pass
2377 elif self._PIL and isinstance(v, self._PIL.Image.Image):
2378 # Convert PIL image to png data uri string
2379 v = self.pil_image_to_uri(v)
2380 else:
2381 self.raise_invalid_val(v)
2382
2383 return v
2384
2385 @staticmethod
2386 def pil_image_to_uri(v):

Callers

nothing calls this directly

Calls 2

pil_image_to_uriMethod · 0.95
raise_invalid_valMethod · 0.80

Tested by

no test coverage detected