code: def test_poisson_zero_size_dim():
      """Tests for no error when dealing with zero-size array in calculating PDF of Poisson distribution
      Issue: https://github.com/apache/mxnet/issues/18937
      """
  
      def test_valid_zero_dim():
          lam = mx.nd.array(np.random.rand(0))
          sample = mx.nd.array(np.random.rand(0, 2))
          res = mx.nd.op.random_pdf_poisson(sample=sample, lam=lam)
          assert res.shape == sample.shape
  
      def test_invalid_zero_dim():
          """The shape of *lam* must match the leftmost part of the *sample* shape"""
          lam = mx.nd.array(np.random.rand(0))
          sample = mx.nd.array(np.random.rand(1, 2))
          assertRaises(
              MXNetError, mx.nd.op.random_pdf_poisson, sample, lam
          )
  
      test_valid_zero_dim()
      test_invalid_zero_dim()
  
imports: import os
  import math
  import itertools
  import mxnet
  from mxnet.test_utils import verify_generator, gen_buckets_probs_with_ppf, assert_almost_equal
  import numpy
  import random
  from common import retry, random_seed
  import scipy.stats
  import unittest
  import pytest
  from mxnet.test_utils import *
  from mxnet.base import MXNetError
  from common import assertRaises
label_desc: Use image node_id 32 for calling a global function with example usage: test_poisson_zero_size_dim() without return types