code: def determine_bpi(data, frames, EMPTY=b"\x00" * 10):
      
  
      # count number of tags found as BitPaddedInt and how far past
      o = 0
      asbpi = 0
      while o < len(data) - 10:
          part = data[o:o + 10]
          if part == EMPTY:
              bpioff = -((len(data) - o) % 10)
              break
          name, size, flags = struct.unpack('>4sLH', part)
          size = BitPaddedInt(size)
          o += 10 + size
          if PY3:
              try:
                  name = name.decode("ascii")
              except UnicodeDecodeError:
                  continue
          if name in frames:
              asbpi += 1
      else:
          bpioff = o - len(data)
  
      # count number of tags found as int and how far past
      o = 0
      asint = 0
      while o < len(data) - 10:
          part = data[o:o + 10]
          if part == EMPTY:
              intoff = -((len(data) - o) % 10)
              break
          name, size, flags = struct.unpack('>4sLH', part)
          o += 10 + size
          if PY3:
              try:
                  name = name.decode("ascii")
              except UnicodeDecodeError:
                  continue
          if name in frames:
              asint += 1
      else:
          intoff = o - len(data)
  
      # if more tags as int, or equal and bpi is past and int is not
      if asint > asbpi or (asint == asbpi and (bpioff >= 1 and intoff <= 1)):
          return int
      return BitPaddedInt
docs: Takes id3v2.4 frame data and determines if ints or bitpaddedints
      should be used for parsing. Needed because iTunes used to write
      normal ints for frame sizes.