MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / _assert_valid_value

Method _assert_valid_value

scratchattach/cloud/_base.py:398–407  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

396 self.event_stream = None
397
398 def _assert_valid_value(self, value):
399 if not (value in [True, False, float("inf"), -float("inf")]):
400 value = str(value)
401 if len(value) > self.length_limit:
402 raise (exceptions.InvalidCloudValue(f"Value exceeds length limit: {str(value)}"))
403 if not self.allow_non_numeric:
404 x = value.replace(".", "")
405 x = x.replace("-", "")
406 if not (x.isnumeric() or x == ""):
407 raise (exceptions.InvalidCloudValue("Value not numeric"))
408
409 def _enforce_ratelimit(self, *, n):
410 # n is the amount of variables being set

Callers 2

set_varMethod · 0.95
set_varsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected