<commit_before>#include "depthai-shared/datatype/DatatypeEnum.hpp"

#include <functional>
#include <type_traits>
#include <unordered_map>
#include <vector>

// DatatypeEnum hash specialization
namespace std {

template <>
struct hash<dai::DatatypeEnum> {
    std::size_t operator()(const dai::DatatypeEnum& s) const {
        using Type = typename underlying_type<dai::DatatypeEnum>::type;
        return std::hash<Type>{}(static_cast<Type>(s));
    }
};

}  // namespace std

namespace dai {

const std::unordered_map<DatatypeEnum, std::vector<DatatypeEnum>> hierarchy = {
    {DatatypeEnum::Buffer,
     {DatatypeEnum::ImgFrame,
      DatatypeEnum::NNData,
      DatatypeEnum::ImageManipConfig,
      DatatypeEnum::CameraControl,
      DatatypeEnum::ImgDetections,
      DatatypeEnum::SpatialImgDetections,
      DatatypeEnum::SystemInformation,
      DatatypeEnum::SpatialLocationCalculatorConfig,
      DatatypeEnum::SpatialLocationCalculatorData,
      DatatypeEnum::Tracklets}},
    {DatatypeEnum::ImgFrame, {}},
    {DatatypeEnum::NNData, {}},
    {DatatypeEnum::ImageManipConfig, {}},
    {DatatypeEnum::CameraControl, {}},
    {DatatypeEnum::ImgDetections, {DatatypeEnum::SpatialImgDetections}},
    {DatatypeEnum::SpatialImgDetections, {}},
    {DatatypeEnum::SystemInformation, {}},
    {DatatypeEnum::SpatialLocationCalculatorConfig, {}},
    {DatatypeEnum::SpatialLocationCalculatorData, {}},
    {DatatypeEnum::Tracklets, {}},
};

bool isDatatypeSubclassOf(DatatypeEnum parent, DatatypeEnum children) {
    for(const auto& d : hierarchy.at(parent)) {
        if(d == children) return true;
        if(isDatatypeSubclassOf(d, children)) return true;<commit_msg>Removed hash specialization for DatatypeEnum<commit_after>#include "depthai-shared/datatype/DatatypeEnum.hpp"

#include <functional>
#include <type_traits>
#include <unordered_map>
#include <vector>

namespace dai {

const std::unordered_map<DatatypeEnum, std::vector<DatatypeEnum>> hierarchy = {
    {DatatypeEnum::Buffer,
     {DatatypeEnum::ImgFrame,
      DatatypeEnum::NNData,
      DatatypeEnum::ImageManipConfig,
      DatatypeEnum::CameraControl,
      DatatypeEnum::ImgDetections,
      DatatypeEnum::SpatialImgDetections,
      DatatypeEnum::SystemInformation,
      DatatypeEnum::SpatialLocationCalculatorConfig,
      DatatypeEnum::SpatialLocationCalculatorData,
      DatatypeEnum::Tracklets}},
    {DatatypeEnum::ImgFrame, {}},
    {DatatypeEnum::NNData, {}},
    {DatatypeEnum::ImageManipConfig, {}},
    {DatatypeEnum::CameraControl, {}},
    {DatatypeEnum::ImgDetections, {DatatypeEnum::SpatialImgDetections}},
    {DatatypeEnum::SpatialImgDetections, {}},
    {DatatypeEnum::SystemInformation, {}},
    {DatatypeEnum::SpatialLocationCalculatorConfig, {}},
    {DatatypeEnum::SpatialLocationCalculatorData, {}},
    {DatatypeEnum::Tracklets, {}},
};

bool isDatatypeSubclassOf(DatatypeEnum parent, DatatypeEnum children) {
    for(const auto& d : hierarchy.at(parent)) {
        if(d == children) return true;
        if(isDatatypeSubclassOf(d, children)) return true;
{'fraction_non_alphanumeric': 0.13174239947695326, 'fraction_numerical': 0.0, 'mean_word_length': 5.455696202531645, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '5874563', 'n_tokens_mistral': 964, 'n_tokens_neox': 941, 'n_words': 134}