MCPcopy
hub / github.com/pydantic/pydantic / encode

Method encode

pydantic/types.py:2561–2570  ·  view source on GitHub ↗

Encode the data using the specified encoder. Args: value: The data to encode. Returns: The encoded data.

(self, value: bytes)

Source from the content-addressed store, hash-verified

2559 return self.encoder.decode(data)
2560
2561 def encode(self, value: bytes) -> bytes:
2562 """Encode the data using the specified encoder.
2563
2564 Args:
2565 value: The data to encode.
2566
2567 Returns:
2568 The encoded data.
2569 """
2570 return self.encoder.encode(value)
2571
2572 def __hash__(self) -> int:
2573 return hash(self.encoder)

Callers 15

_displayMethod · 0.45
decode_strMethod · 0.45
encode_strMethod · 0.45
resolve_conbytesFunction · 0.45
load_str_bytesFunction · 0.45
bytes_validatorFunction · 0.45
validate_hostMethod · 0.45
load_str_bytesFunction · 0.45
y_strMethod · 0.45
_north_star_data_bytesFunction · 0.45
test_to_stringFunction · 0.45

Calls

no outgoing calls

Tested by 12

y_strMethod · 0.36
_north_star_data_bytesFunction · 0.36
test_to_stringFunction · 0.36
test_bytesFunction · 0.36
test_subclass_bytesFunction · 0.36
test_bytes_base64Function · 0.36
test_union_bool_intFunction · 0.36
test_subclass_strFunction · 0.36
test_complete_validFunction · 0.36