MCPcopy Create free account
hub / github.com/microsoft/debugpy / validate

Function validate

src/debugpy/common/json.py:117–127  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

115 assert not len(kwargs)
116
117 def validate(value):
118 if (optional and value == ()) or isinstance(value, classinfo):
119 return value
120 else:
121 converted_value = _converter(value, classinfo)
122 if converted_value:
123 return converted_value
124
125 if not optional and value == ():
126 raise ValueError("must be specified")
127 raise TypeError("must be " + " or ".join(t.__name__ for t in classinfo))
128
129 return validate
130

Callers 2

__call__Method · 0.85
__init__Method · 0.85

Calls 5

_converterFunction · 0.85
of_typeFunction · 0.85
reprFunction · 0.85
itemsMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…