MCPcopy
hub / github.com/pydantic/pydantic / decode

Method decode

pydantic/types.py:2550–2559  ·  view source on GitHub ↗

Decode the data using the specified encoder. Args: data: The data to decode. Returns: The decoded data.

(self, data: bytes, _: core_schema.ValidationInfo)

Source from the content-addressed store, hash-verified

2548 )
2549
2550 def decode(self, data: bytes, _: core_schema.ValidationInfo) -> bytes:
2551 """Decode the data using the specified encoder.
2552
2553 Args:
2554 data: The data to decode.
2555
2556 Returns:
2557 The decoded data.
2558 """
2559 return self.encoder.decode(data)
2560
2561 def encode(self, value: bytes) -> bytes:
2562 """Encode the data using the specified encoder.

Callers 15

open_pull_requestFunction · 0.45
create_github_releaseFunction · 0.45
decode_strMethod · 0.45
encode_strMethod · 0.45
model_dump_jsonMethod · 0.45
path_validatorMethod · 0.45
git_revisionFunction · 0.45
parse_dateFunction · 0.45
parse_timeFunction · 0.45
parse_datetimeFunction · 0.45
parse_durationFunction · 0.45

Calls

no outgoing calls

Tested by 14

test_to_jsonFunction · 0.36
test_complex_jsonFunction · 0.36
test_datetime_jsonFunction · 0.36
test_decimal_jsonFunction · 0.36
test_uuid_jsonFunction · 0.36
cMethod · 0.36
test_str_ensure_asciiFunction · 0.36
fFunction · 0.36