MCPcopy Index your code
hub / github.com/huggingface/datasets / encode_example

Method encode_example

src/datasets/features/features.py:2150–2162  ·  view source on GitHub ↗

Encode example into a format for Arrow. Args: example (`dict[str, Any]`): Data in a Dataset row. Returns: `dict[str, Any]`

(self, example)

Source from the content-addressed store, hash-verified

2148 return cls.from_dict(from_yaml_inner(yaml_data))
2149
2150 def encode_example(self, example):
2151 """
2152 Encode example into a format for Arrow.
2153
2154 Args:
2155 example (`dict[str, Any]`):
2156 Data in a Dataset row.
2157
2158 Returns:
2159 `dict[str, Any]`
2160 """
2161 example = cast_to_python_objects(example)
2162 return encode_nested_example(self, example)
2163
2164 def encode_column(self, column, column_name: str):
2165 """

Calls 2

cast_to_python_objectsFunction · 0.85
encode_nested_exampleFunction · 0.85

Tested by 3

test_encode_exampleFunction · 0.76