code: def encode(A: np.ndarray):
      """
      A: (N, D) 2D array
      """
      assert isinstance(A, np.ndarray)
      # n_dims = len(A.shape)
      # assert n_dims >= 1 and n_dims <= 2
  
      shape = A.shape
      A = A.reshape([-1])
      A = A.astype(object)  # cast to object to hold enough precision
      A = np.expand_dims(A, axis=-1)
      A = np.concatenate((A, np.zeros(A.shape, dtype=object)), axis=-1)
  
      def _encode(tupl):
          integer = int(tupl[0]) & ((1 << 128) - 1)
          return np.frombuffer(
              integer.to_bytes(16, "little"), dtype=np.int64
          )
  
      A = np.apply_along_axis(_encode, -1, A)
      A = A.reshape(shape + (2,))
      return A
  
imports: import logging
  import os
  import numpy
  import tensorflow
  from tensorflow.python.framework.errors import NotFoundError
  import tf_encrypted
label_desc: Use image node_id 2 for calling a global function with example usage: encode(A) and returns: A, np