code: def elmo_loss2ppl(losses: List[np.ndarray]) -> float:
      """Calculates perplexity by loss
  
      Args:
          losses: list of numpy arrays of model losses
  
      Returns:
          perplexity : float
      """
      avg_loss = np.mean(losses)
      return float(np.exp(avg_loss))
  
imports: from typing import List
  import numpy
  from deeppavlov.core.common.metrics_registry import register_metric
label_desc: Use image node_id 1 for calling a global function with example usage: elmo_loss2ppl(losses) and returns: float