MCPcopy Create free account
hub / github.com/ccxt/ccxt / __call__

Method __call__

python/ccxt/static_dependencies/marshmallow/validate.py:258–280  ·  view source on GitHub ↗
(self, value: str)

Source from the content-addressed store, hash-verified

256 return self.error.format(input=value)
257
258 def __call__(self, value: str) -> str:
259 message = self._format_error(value)
260
261 if not value or "@" not in value:
262 raise ValidationError(message)
263
264 user_part, domain_part = value.rsplit("@", 1)
265
266 if not self.USER_REGEX.match(user_part):
267 raise ValidationError(message)
268
269 if domain_part not in self.DOMAIN_WHITELIST:
270 if not self.DOMAIN_REGEX.match(domain_part):
271 try:
272 domain_part = domain_part.encode("idna").decode("ascii")
273 except UnicodeError:
274 pass
275 else:
276 if self.DOMAIN_REGEX.match(domain_part):
277 return value
278 raise ValidationError(message)
279
280 return value
281
282
283class Range(Validator):

Callers

nothing calls this directly

Calls 5

_format_errorMethod · 0.95
ValidationErrorClass · 0.70
matchMethod · 0.45
decodeMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected