<commit_before>use std::fs::File;
use std::io::Read;
use std::io::Seek;
use std::io::SeekFrom::Start;
use std::io;
use std::fmt;
use std::slice;

#[repr(C)]
#[derive(Clone, PartialEq)]
pub struct Sym {
    pub st_name: u32, // Symbol name (string tbl index)
    pub st_info: u8, // Symbol type and binding
    pub st_other: u8, // Symbol visibility
    pub st_shndx: u16, // Section index
    pub st_value: u64, // Symbol value
    pub st_size: u64, // Symbol size
}

pub const SIZEOF_SYM: usize = 4 + 1 + 1 + 2 + 8 + 8;

#[inline(always)]
pub fn st_bind(info: u8) -> u8 {
    info >> 4
}

#[inline(always)]
pub fn st_type(info: u8) -> u8 {
    info & 0xf
}

#[inline(always)]
pub fn is_import(sym: &Sym) -> bool {
    let binding = st_bind(sym.st_info);
    binding == STB_GLOBAL && sym.st_value == 0
}

// sym bindings
pub const STB_LOCAL: u8 = 0; // Local symbol
pub const STB_GLOBAL: u8 = 1; // Global symbol<commit_msg>elf.sym: add Copy derived trait<commit_after>use std::fs::File;
use std::io::Read;
use std::io::Seek;
use std::io::SeekFrom::Start;
use std::io;
use std::fmt;
use std::slice;

#[repr(C)]
#[derive(Clone, Copy, PartialEq)]
pub struct Sym {
    pub st_name: u32, // Symbol name (string tbl index)
    pub st_info: u8, // Symbol type and binding
    pub st_other: u8, // Symbol visibility
    pub st_shndx: u16, // Section index
    pub st_value: u64, // Symbol value
    pub st_size: u64, // Symbol size
}

pub const SIZEOF_SYM: usize = 4 + 1 + 1 + 2 + 8 + 8;

#[inline(always)]
pub fn st_bind(info: u8) -> u8 {
    info >> 4
}

#[inline(always)]
pub fn st_type(info: u8) -> u8 {
    info & 0xf
}

#[inline(always)]
pub fn is_import(sym: &Sym) -> bool {
    let binding = st_bind(sym.st_info);
    binding == STB_GLOBAL && sym.st_value == 0
}

// sym bindings
pub const STB_LOCAL: u8 = 0; // Local symbol
pub const STB_GLOBAL: u8 = 1; // Global symbol
{'fraction_non_alphanumeric': 0.15651709401709402, 'fraction_numerical': 0.028846153846153848, 'mean_word_length': 3.3457076566125292, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6836525', 'n_tokens_mistral': 746, 'n_tokens_neox': 729, 'n_words': 224}