<commit_before>#pragma once

#include <string>
#include <exception>
#include "EasyBMP.h"
#include "bmp_data.hh"

namespace DG {
namespace Image {
class BMP {
 public:
  struct Invalid_format_exception : public std::exception {
    virtual const char* what() const throw() {
      return "BMP: Invalid_format_exception";
    }
  } invalid_format;

  BMP() {}
  BMP(const std::string& fname) { open(fname); }
  void open(const std::string& fname);
  void write(const std::string& fname);

  // masks a byte from the byte array with the specified mask
  // setting bits to 1 if they are not already 1
  // eg masking 11110000 with 00001111 sets the byte to 1111111<commit_msg>Added comments<commit_after>#pragma once

#include <string>
#include <exception>
#include "EasyBMP.h"
#include "bmp_data.hh"

namespace DG {
namespace Image {
class BMP {
 public:
  struct Invalid_format_exception : public std::exception {
    virtual const char* what() const throw() {
      return "BMP: Invalid_format_exception";
    }
  } invalid_format;

  BMP() {}
  BMP(const std::string& fname) { open(fname); }

  // opens a bmp file fname and stores it
  void open(const std::string& fname);

  // saves the bmp data out to the file fname
  void write(const std::string& fname);

  // masks a byte from the byte array with the specified mask
  // setting bits to 1 if they are not already 1
  // eg masking 11110000 with 00001111 sets the byte to 1111111
{'fraction_non_alphanumeric': 0.10160055671537926, 'fraction_numerical': 0.03479471120389701, 'mean_word_length': 3.8417508417508417, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '3464292', 'n_tokens_mistral': 497, 'n_tokens_neox': 440, 'n_words': 167}