class_docstr: Constructs a Pop2Piano tokenizer. This tokenizer does not require training.
  
  This tokenizer inherits from [`PreTrainedTokenizer`] which contains most of the main methods. Users should refer to
  this superclass for more information regarding those methods.
  
  Args:
      vocab (`str`):
          Path to the vocab file which contains the vocabulary.
      default_velocity (`int`, *optional*, defaults to 77):
          Determines the default velocity to be used while creating midi Notes.
      num_bars (`int`, *optional*, defaults to 2):
          Determines cutoff_time_idx in for each token.
docstr: Encodes the Midi tokens to transformer generated token ids.
  
  Args:
      token (`int`):
          This denotes the token value.
      token_type (`str`):
          This denotes the type of the token. There are four types of midi tokens such as "TOKEN_TIME",
          "TOKEN_VELOCITY", "TOKEN_NOTE" and "TOKEN_SPECIAL".
  
  Returns:
      `int`: returns the id of the token.
docstr_tok: ["Encodes","the","Midi","tokens","to","transformer","generated","token","ids",".","Args",":","token","(","`","int","`",")",":","This","denotes","the","token","value",".","token_type","(","`","str","`",")",":","This","denotes","the","type","of","the","token",".","There","are","four","types","of","midi","tokens","such","as","``","TOKEN_TIME","''",",","``","TOKEN_VELOCITY","''",",","``","TOKEN_NOTE","''","and","``","TOKEN_SPECIAL","''",".","Returns",":","`","int","`",":","returns","the","id","of","the","token","."]
code: def _convert_token_to_id(self, token, token_type="TOKEN_TIME") -> int:
      """
      Encodes the Midi tokens to transformer generated token ids.
  
      Args:
          token (`int`):
              This denotes the token value.
          token_type (`str`):
              This denotes the type of the token. There are four types of midi tokens such as "TOKEN_TIME",
              "TOKEN_VELOCITY", "TOKEN_NOTE" and "TOKEN_SPECIAL".
  
      Returns:
          `int`: returns the id of the token.
      """
      return self.encoder.get(
          f"{token}_{token_type}", int(self.unk_token)
      )
  
imports: import json
  import os
  from typing import List, Optional, Tuple, Union
  import numpy
  from ...feature_extraction_utils import BatchFeature
  from ...tokenization_utils import AddedToken, BatchEncoding, PaddingStrategy, PreTrainedTokenizer, TruncationStrategy
  from ...utils import TensorType, is_pretty_midi_available, logging, requires_backends, to_numpy
label_desc: Use image node_id 5 for calling the Pop2PianoTokenizer obj's underlying member method code with example usage: obj._convert_token_to_id(token, token_type) and returns: self