code: def test_poisson(rate: float) -> None:
      """
      Test to check that maximizing the likelihood recovers the parameters
      """
      # generate samples
      rates = torch.zeros((NUM_SAMPLES,)) + rate
  
      poisson_distr = Poisson(rate=rates)
      samples = poisson_distr.sample()
  
      init_biases = [
          inv_softplus(rate - START_TOL_MULTIPLE * TOL * rate)
      ]
  
      (rate_hat,) = maximum_likelihood_estimate_sgd(
          PoissonOutput(),
          samples,
          init_biases=init_biases,
          num_epochs=20,
          learning_rate=0.05,
      )
  
      assert (
          np.abs(rate_hat - rate) < TOL * rate
      ), f"rate did not match: rate = {rate}, rate_hat = {rate_hat}"
  
imports: from typing import List
  import numpy
  import pytest
  import torch
  import torch.nn
  from scipy.special import softmax
  from torch.distributions import Beta, Gamma, NegativeBinomial, Normal, Poisson, StudentT
  from torch.nn.utils import clip_grad_norm_
  from torch.optim import SGD
  from torch.utils.data import DataLoader, TensorDataset
  from gluonts.pydantic import PositiveFloat, PositiveInt
  from gluonts.torch.distributions import BetaOutput, DistributionOutput, GammaOutput, NegativeBinomialOutput, NormalOutput, PoissonOutput, SplicedBinnedPareto, SplicedBinnedParetoOutput, StudentTOutput
label_desc: Use image node_id 9 for calling a global function with example usage: test_poisson(rate) without return types