code: def rand_gumbel(shape):
      """Sample from the Gumbel distribution, protect from overflows."""
      uniform_samples = torch.rand(shape) * 0.99998 + 0.00001
      return -torch.log(-torch.log(uniform_samples))
  
imports: import math
  import numpy
  import torch
  from torch import nn
  from torch.nn import functional
label_desc: Use image node_id 6 for calling a global function with example usage: rand_gumbel(shape) and returns: unknown