code: def test_neg_binomial(total_count: float, logit: float) -> None:
      """
      Test to check that maximizing the likelihood recovers the parameters
      """
      # generate samples
      total_counts = torch.zeros((NUM_SAMPLES,)) + total_count
      logits = torch.zeros((NUM_SAMPLES,)) + logit
  
      neg_bin_distr = NegativeBinomial(
          total_count=total_counts, logits=logits
      )
      samples = neg_bin_distr.sample()
  
      init_biases = [
          inv_softplus(
              total_count - START_TOL_MULTIPLE * TOL * total_count
          ),
          logit - START_TOL_MULTIPLE * TOL * logit,
      ]
      print("type(init_biases)", type(init_biases))
      print("len(init_biases)", len(init_biases))
      print("type(init_biases[0])", type(init_biases[0]))
  
      total_count_hat, logit_hat = maximum_likelihood_estimate_sgd(
          NegativeBinomialOutput(),
          samples,
          init_biases=init_biases,
          num_epochs=15,
      )
  
      assert (
          np.abs(total_count_hat - total_count) < TOL * total_count
      ), f"total_count did not match: total_count = {total_count}, total_count_hat = {total_count_hat}"
      assert (
          np.abs(logit_hat - logit) < TOL * logit
      ), f"logit did not match: logit = {logit}, logit_hat = {logit_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 10 for calling a global function with example usage: test_neg_binomial(total_count, logit) without return types