code: def accuracy(
      y_true: [list, np.ndarray], y_predicted: [list, np.ndarray]
  ) -> float:
      """
      Calculate accuracy in terms of absolute coincidence
  
      Args:
          y_true: array of true values
          y_predicted: array of predicted values
  
      Returns:
          fraction of absolutely coincidental samples
      """
      examples_len = len(y_true)
      # if y1 and y2 are both arrays, == can be erroneously interpreted as element-wise equality
  
      def _are_equal(y1, y2):
          answer = y1 == y2
          if isinstance(answer, np.ndarray):
              answer = answer.all()
          return answer
  
      equalities = [
          _are_equal(y1, y2) for y1, y2 in zip(y_true, y_predicted)
      ]
      correct = sum(equalities)
      return correct / examples_len if examples_len else 0
  
file_path: DeepPavlov/deeppavlov/metrics/accuracy.py
imports: import itertools
  import re
  from logging import getLogger
  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: accuracy(y_true, y_predicted) and returns: unknown, answer