MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / get_data_and_view

Function get_data_and_view

bson/__init__.py:247–251  ·  view source on GitHub ↗
(data: Any)

Source from the content-addressed store, hash-verified

245
246
247def get_data_and_view(data: Any) -> Tuple[Any, memoryview]:
248 if isinstance(data, (bytes, bytearray)):
249 return data, memoryview(data)
250 view = memoryview(data)
251 return view.tobytes(), view
252
253
254def _raise_unknown_type(element_type: int, element_name: str) -> NoReturn:

Callers 3

_raw_to_dictFunction · 0.85
_bson_to_dictFunction · 0.85
_decode_allFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected