code: def _im2col(
      prot: Pond,
      x: PondTensor,
      pool_size: Tuple[int, int],
      strides: Tuple[int, int],
      padding: str,
  ) -> Tuple[AbstractTensor, AbstractTensor]:
      """Compute im2col on a tensor."""
  
      x_on_0, x_on_1 = x.unwrapped
      batch, channels, height, width = x.shape
  
      if padding == "SAME":
          out_height = math.ceil(int(height) / strides[0])
          out_width = math.ceil(int(width) / strides[1])
      else:
          out_height = math.ceil(
              (int(height) - pool_size[0] + 1) / strides[0]
          )
          out_width = math.ceil(
              (int(width) - pool_size[1] + 1) / strides[1]
          )
  
      batch, channels, height, width = x.shape
      pool_height, pool_width = pool_size
  
      with tf.device(prot.server_0.device_name):
          x_split = x_on_0.reshape((batch * channels, 1, height, width))
          y_on_0 = x_split.im2col(
              pool_height, pool_width, strides[0], padding
          )
  
      with tf.device(prot.server_1.device_name):
          x_split = x_on_1.reshape((batch * channels, 1, height, width))
          y_on_1 = x_split.im2col(
              pool_height, pool_width, strides[0], padding
          )
  
      return (
          y_on_0,
          y_on_1,
          [out_height, out_width, int(batch), int(channels)],
      )
  
imports: from __future__ import absolute_import
  import math
  import random
  import sys
  from typing import Optional
  from typing import Tuple
  import numpy
  import tensorflow
  from tf_encrypted.config import get_config
  from tf_encrypted.player import Player
  from tf_encrypted.protocol import memoize
  from tf_encrypted.protocol.pond import Pond
  from tf_encrypted.protocol.pond import PondMaskedTensor
  from tf_encrypted.protocol.pond import PondPrivateTensor
  from tf_encrypted.protocol.pond import PondPublicTensor
  from tf_encrypted.protocol.pond import PondTensor
  from tf_encrypted.protocol.pond import _type
  from tf_encrypted.protocol.protocol import nodes
  from tf_encrypted.protocol.securenn.odd_tensor import oddint64_factory
  from tf_encrypted.tensor import int64factory
  from tf_encrypted.tensor import native_factory
  from tf_encrypted.tensor.factory import AbstractFactory
  from tf_encrypted.tensor.factory import AbstractTensor
label_desc: Use image node_id 7 for calling a global function with example usage: _im2col(prot, x, pool_size, strides, padding) and returns: y_on_0,  y_on_1,  list