class_docstr:     Calculate precision, recall, F1 for each labels
  
  Parameters
  ----------
  metrics: list
      Indicate the metric for the class to return.
      Note that each metric must be one of ``precision``, ``recall``, ``F1``, ``accuracy``.
      And the results' order is the same as the metrics.
class_docstr_tok: ["Calculate","precision",",","recall",",","F1","for","each","labels","Parameters","--","--","--","--","--","metrics",":","list","Indicate","the","metric","for","the","class","to","return",".","Note","that","each","metric","must","be","one","of","``","precision","``",",","``","recall","``",",","``","F1","``",",","``","accuracy","``",".","And","the","results","'","order","is","the","same","as","the","metrics","."]
docstr:     The function to check the parameters.
      If all tests are passed, it will convert the tensor to numpy.
  
  Parameters
  ----------
  ground_truth: Any
  predict: Any
  zero_division: Any
  
  Returns
  -------
  ground_truth: numpy.ndarray
      numpy version of tensor ground_truth
  predict: numpy.ndarray
      numpy version of tensor predict
  
  Raises
  -------
  TypeError: TypeError
  ValueError: ValueError
docstr_tok: ["The","function","to","check","the","parameters",".","If","all","tests","are","passed",",","it","will","convert","the","tensor","to","numpy",".","Parameters","--","--","--","--","--","ground_truth",":","Any","predict",":","Any","zero_division",":","Any","Returns","--","--","--","-","ground_truth",":","numpy.ndarray","numpy","version","of","tensor","ground_truth","predict",":","numpy.ndarray","numpy","version","of","tensor","predict","Raises","--","--","--","-","TypeError",":","TypeError","ValueError",":","ValueError"]
code: def _check_available(ground_truth, predict, zero_division):
      """
          The function to check the parameters.
          If all tests are passed, it will convert the tensor to numpy.
  
      Parameters
      ----------
      ground_truth: Any
      predict: Any
      zero_division: Any
  
      Returns
      -------
      ground_truth: numpy.ndarray
          numpy version of tensor ground_truth
      predict: numpy.ndarray
          numpy version of tensor predict
  
      Raises
      -------
      TypeError: TypeError
      ValueError: ValueError
      """
      if not isinstance(ground_truth, torch.Tensor):
          raise TypeError("argument ground_truth must be torch.tensor")
      if not isinstance(predict, torch.Tensor):
          raise TypeError("argument predict must be torch.tensor")
      if ground_truth.dtype not in [
          torch.int,
          torch.int8,
          torch.int16,
          torch.int32,
          torch.int64,
      ]:
          raise TypeError("argument ground_truth must be int tensor")
      if predict.dtype not in [
          torch.int,
          torch.int8,
          torch.int16,
          torch.int32,
          torch.int64,
      ]:
          raise TypeError("argument predict must be int tensor")
      if len(ground_truth.shape) != 1:
          raise TypeError("argument ground_truth must be 1d tensor")
      if len(predict.shape) != 1:
          raise TypeError("argument predict must be 1d tensor")
      if ground_truth.shape[0] != predict.shape[0]:
          raise ValueError(
              "argument ground_truth and predict must be the same shape"
          )
  
      zero_division_ok = False
      if isinstance(zero_division, str) and zero_division == "warning":
          zero_division_ok = True
      elif isinstance(
          zero_division, (int, float)
      ) and zero_division in [0, 1]:
          zero_division_ok = True
  
      if not zero_division_ok:
          raise ValueError(
              "argument zero_division must be in ['warning', 0, 1]"
          )
  
      return ground_truth.numpy(), predict.numpy()
  
file_path: graph4nlp/graph4nlp/pytorch/modules/evaluation/accuracy.py
imports: import copy
  import warnings
  import numpy
  import torch
  from graph4nlp.pytorch.modules.evaluation.base import EvaluationMetricBase
label_desc: Use image node_id 4 for calling the Accuracy obj's underlying member method code with example usage: obj._check_available(ground_truth, predict, zero_division) and returns: ground_truth,  predict