'Recursively check an element'

def check_element(self, element_id, element_type, element_name, element_level, element_position, element_size, element_data, element, ignore_element_types=None, ignore_element_names=None, max_level=None):

    self.assertTrue((element.id == element_id))
    self.assertTrue((element.type == element_type))
    self.assertTrue((element.name == element_name))
    self.assertTrue((element.level == element_level))
    self.assertTrue((element.position == element_position))
    self.assertTrue((element.size == element_size))
    if (not isinstance(element_data, list)):
        self.assertTrue((type(element) == ebml.Element))
        if (element_type != ebml.BINARY):
            self.assertTrue((element.data == element_data))
        return
    if (ignore_element_types is not None):
        element_data = [e for e in element_data if (e[1] not in ignore_element_types)]
    if (ignore_element_names is not None):
        element_data = [e for e in element_data if (e[2] not in ignore_element_names)]
    if (element.level == max_level):
        self.assertTrue((element.data is None))
        return
    self.assertTrue((len(element.data) == len(element_data)))
    for i in range(len(element.data)):
        self.check_element(element_data[i][0], element_data[i][1], element_data[i][2], element_data[i][3], element_data[i][4], element_data[i][5], element_data[i][6], element.data[i], ignore_element_types, ignore_element_names, max_level)
