code: def serialize_payload_to_bytes(self, np_array: object) -> bytes:
      buffer = io.BytesIO()
      np.save(buffer, np_array)
      return buffer.getvalue()
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/serve/utils/test_predictors.py
imports: from __future__ import absolute_import
  import io
  import unittest
  from unittest.mock import patch, ANY
  import numpy
  from sagemaker.serve.builder.schema_builder import SchemaBuilder
  from sagemaker.serve.marshalling.custom_payload_translator import CustomPayloadTranslator
  from sagemaker.serve.utils.predictors import retrieve_predictor
label_desc: Use image node_id 1 for calling the MyNumpyTranslator obj's underlying member method code with example usage: obj.serialize_payload_to_bytes(np_array) and returns: buffer