code: def accuracy(x, t, ignore_label):
      x_ = numpy.rollaxis(x, 1, x.ndim).reshape(t.size, -1)
      t_ = t.ravel()
  
      if ignore_label is not None:
          count = 0
          for i in six.moves.range(t_.size):
              pred = x_[i].argmax()
              if t_[i] != ignore_label and pred == t_[i]:
                  count += 1
          total = (t_ != ignore_label).sum()
      else:
          count = 0
          for i in six.moves.range(t_.size):
              pred = x_[i].argmax()
              if pred == t_[i]:
                  count += 1
          total = t_.size
  
      if total == 0:
          return 0.0
      else:
          return float(count) / total
  
imports: import unittest
  import numpy
  import six
  import chainer
  from chainer.backends import cuda
  from chainer import functions
  from chainer import testing
  from chainer.testing import attr
  from chainer.utils import force_array
  from chainer.utils import type_check
label_desc: Use image node_id 1 for calling a global function with example usage: accuracy(x, t, ignore_label) and returns: int, unknown