<commit_before># -*- coding: utf-8 -*-

from __future__ import absolute_import

from .base import Type


class IsoBmff(Type):
    """
    Implements the ISO-BMFF base type.
    """
    def __init__(self, *, mime, extension):
        super(IsoBmff, self).__init__(
            mime=mime,
            extension=extension
        )

    def _is_isobmff(self, buf):
        if len(buf) < 16 or buf[4:8] != b'ftyp':
            return False
        if len(buf) < int.from_bytes(buf[0:4], byteorder='big'):
            return False
        return True

    def _get_ftyp(self, buf):
        ftyp_len = int.from_bytes(buf[0:4], byteorder='big')
        major_brand = buf[8:12].decode()
        minor_version = int.from_bytes(buf[12:16], byteorder='big')<commit_msg>fix py2.7 error<commit_after># -*- coding: utf-8 -*-

from __future__ import absolute_import

from .base import Type


class IsoBmff(Type):
    """
    Implements the ISO-BMFF base type.
    """
    def __init__(self, mime, extension):
        super(IsoBmff, self).__init__(
            mime=mime,
            extension=extension
        )

    def _is_isobmff(self, buf):
        if len(buf) < 16 or buf[4:8] != b'ftyp':
            return False
        if len(buf) < int.from_bytes(buf[0:4], byteorder='big'):
            return False
        return True

    def _get_ftyp(self, buf):
        ftyp_len = int.from_bytes(buf[0:4], byteorder='big')
        major_brand = buf[8:12].decode()
        minor_version = int.from_bytes(buf[12:16], byteorder='big')
{'fraction_non_alphanumeric': 0.13399339933993398, 'fraction_numerical': 0.022442244224422443, 'mean_word_length': 2.3914988814317675, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5777655', 'n_tokens_mistral': 531, 'n_tokens_neox': 510, 'n_words': 113}