<commit_before>package magick

// #include <stdio.h>
// #include <string.h>
// #include <stdlib.h>
// #include <magick/api.h>
import "C"

import (
	"io"
	"io/ioutil"
	"os"
	"runtime"
	"sync"
	"unsafe"
)

// Image represents an in-memory decoded image.
// Some images (like e.g. GIF animations) might have
// multiple frames. Unless indicated otherwise, functions
// work in the same way with both single a multi-frame images,
// performing coalescing when needed. To operate on a single
// frame use e.g. im.Frame(i).Resize() instead of im.Resize().
// Frames might be added or removed with list related functions,
// like Append() or Remove().
type Image struct {
	image     *C.Image
	parent    *Image
	coalesced bool
	mu        sync.Mutex
}

// Width returns the image width in pixels.
func (im *Image) Width() int {
	return int(im.image.columns)
}

// Height returns the image height in pixels.
func (im *Image) Height() int {
	return int(im.image.rows)
}

// Format returns the format used to decode
// this image.
func (im *Image) Format() string {
	return C.GoString(&im.image.magick[0])
}

// Depth returns the pixel depth of the image,
// usually 8.
func (im *Image) Depth() int {
	return int(im.image.depth)
}

// Delay returns the time this image stays visible in
// an animation, in 1/100ths of a second. If this image
// is not part of a sequence of animated images, it returns 0.
func (im *Image) Delay() int {
	return int(im.image.delay)<commit_msg>Add Rect() function to Image<commit_after>package magick

// #include <stdio.h>
// #include <string.h>
// #include <stdlib.h>
// #include <magick/api.h>
import "C"

import (
	"io"
	"io/ioutil"
	"os"
	"runtime"
	"sync"
	"unsafe"
)

// Image represents an in-memory decoded image.
// Some images (like e.g. GIF animations) might have
// multiple frames. Unless indicated otherwise, functions
// work in the same way with both single a multi-frame images,
// performing coalescing when needed. To operate on a single
// frame use e.g. im.Frame(i).Resize() instead of im.Resize().
// Frames might be added or removed with list related functions,
// like Append() or Remove().
type Image struct {
	image     *C.Image
	parent    *Image
	coalesced bool
	mu        sync.Mutex
}

// Width returns the image width in pixels.
func (im *Image) Width() int {
	return int(im.image.columns)
}

// Height returns the image height in pixels.
func (im *Image) Height() int {
	return int(im.image.rows)
}

// Rect is a conveniency function which returns a Rect
// at (0, 0) with the image dimensions.
func (im *Image) Rect() Rect {
	return Rect{0, 0, uint(im.Width()), uint(im.Height())}
}

// Format returns the format used to decode
// this image.
func (im *Image) Format() string {
	return C.GoString(&im.image.magick[0])
}

// Depth returns the pixel depth of the image,
// usually 8.
func (im *Image) Depth() int {
	return int(im.image.depth)
}

// Delay returns the time this image stays visible in
// an animation, in 1/100ths of a second. If this image
// is not part of a sequence of animated images, it returns 0.
func (im *Image) Delay() int {
	return int(im.image.delay)
{'fraction_non_alphanumeric': 0.12667946257197696, 'fraction_numerical': 0.005758157389635317, 'mean_word_length': 3.29532967032967, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7067335', 'n_tokens_mistral': 1038, 'n_tokens_neox': 1009, 'n_words': 409}