<commit_before>package generator

import "text/template"

var NSCopyingText = `
- (instancetype)copyWithZone:(NSZone *)zone
{
    // OCGEN: Autogenerated method. Do not touch
    {{.Name}} *copy = nil;
    {{if not .IsDirectChildOfNSObject -}}
    if([super respondsToSelector:@selector(copyWithZone:)])
    {
        copy = [super copyWithZone:zone];
    }
    else
    {
        copy = [[[self class] allocWithZone:zone] init];
    }
    {{- else -}}
        copy = [[[self class] allocWithZone:zone] init];
    {{- end}}
    if (copy != nil)
    { {{range .Properties}}
        copy{{.Accessor}}{{.Name}} = {{if .IsObject -}}
                                          {{if eq .Class "NSArray" -}}
                                              [[NSArray alloc] initWithArray:self{{.Accessor}}{{.Name}} copyItems:YES];
                                          {{- else if .IsWeak -}}
                                              self{{.Accessor}}{{.Name}};
                                          {{- else -}}
                                              [self{{.Accessor}}{{.Name}} copyWithZone:zone];
                                          {{- end}}
                                      {{- else -}}
                                          self{{.Accessor}}{{.Name}};
                                      {{- end}}
    {{- end}}
    }
    return copy;
}`
var NSCopyingTpl = template.Must(template.New("NSCopying").Parse(NSCopyingText))

var NSCodingInitText = `
- (instancetype)initWithCoder:(NSCoder *)decoder
{
    // OCGEN: Autogenerated method. Do not touch
    {{if not .IsDirectChildOfNSObject -}}
    if([super respondsToSelector:@selector(initWithCoder:)])
    {
        self = [super initWithCoder:decoder];
    }
    else
    {
        self = [super init];
    }
    {{- else -}}
    self = [super init];
    {{- end}}
    if(self != nil)
    { {{range .Properties}}
        _{{.Name}} = {{if .IsObject -}}
                         [decoder decodeObjectForKey:@"{{.Name}}"];
                     {{- else -}}
                         [decoder decode{{.CoderType}}ForKey:@"{{.Name}}"];
                     {{- end}}
    {{- end}}
    }
    return self;
}`
var NSCodingInitTpl = template.Must(template.New("NSCodingInit").Parse(NSCodingInitText))

var NSCodingEncodeText = `
- (void)encodeWithCoder:(NSCoder *)coder
{
    // OCGEN: Autogenerated method. Do not touch
    {{if not .IsDirectChildOfNSObject -}}
    if([super respondsToSelector:@selector(encodeWithCoder:)])
    {
        [super encodeWithCoder:coder];
    }
    {{- end}}{{range .Properties}}
    {{if .IsObject -}}
        {{if .IsWeak -}}
            [coder encodeConditionalObject:_{{.Name}} forKey:@"{{.Name}}"];
        {{- else -}}
            [coder encodeObject:_{{.Name}} forKey:@"{{.Name}}"];
        {{- end}}
    {{- else -}}
        [coder encode{{.CoderType}}:_{{.Name}} forKey:@"{{.Name}}"];
    {{- end}}
{{- end}}
}`
var NSCodingEncodeTpl = template.Must(template.New("NSCodingEncode").Parse(NSCodingEncodeText))<commit_msg>Removed a new line in the generated code<commit_after>package generator

import "text/template"

var NSCopyingText = `
- (instancetype)copyWithZone:(NSZone *)zone
{
    // OCGEN: Autogenerated method. Do not touch
    {{.Name}} *copy = nil;
    {{if not .IsDirectChildOfNSObject -}}
    if([super respondsToSelector:@selector(copyWithZone:)])
    {
        copy = [super copyWithZone:zone];
    }
    else
    {
        copy = [[[self class] allocWithZone:zone] init];
    }
    {{- else -}}
        copy = [[[self class] allocWithZone:zone] init];
    {{- end}}
    if (copy != nil)
    { {{range .Properties}}
        copy{{.Accessor}}{{.Name}} = {{if .IsObject -}}
                                          {{if eq .Class "NSArray" -}}
                                              [[NSArray alloc] initWithArray:self{{.Accessor}}{{.Name}} copyItems:YES];
                                          {{- else if .IsWeak -}}
                                              self{{.Accessor}}{{.Name}};
                                          {{- else -}}
                                              [self{{.Accessor}}{{.Name}} copyWithZone:zone];
                                          {{- end}}
                                      {{- else -}}
                                          self{{.Accessor}}{{.Name}};
                                      {{- end}}
    {{- end}}
    }
    return copy;
}`
var NSCopyingTpl = template.Must(template.New("NSCopying").Parse(NSCopyingText))

var NSCodingInitText = `
- (instancetype)initWithCoder:(NSCoder *)decoder
{
    // OCGEN: Autogenerated method. Do not touch
    {{if not .IsDirectChildOfNSObject -}}
    if([super respondsToSelector:@selector(initWithCoder:)])
    {
        self = [super initWithCoder:decoder];
    }
    else
    {
        self = [super init];
    }
    {{- else -}}
    self = [super init];
    {{- end}}
    if(self != nil)
    { {{range .Properties}}
        _{{.Name}} = {{if .IsObject -}}
                         [decoder decodeObjectForKey:@"{{.Name}}"];
                     {{- else -}}
                         [decoder decode{{.CoderType}}ForKey:@"{{.Name}}"];
                     {{- end}}
    {{- end}}
    }
    return self;
}`
var NSCodingInitTpl = template.Must(template.New("NSCodingInit").Parse(NSCodingInitText))

var NSCodingEncodeText = `
- (void)encodeWithCoder:(NSCoder *)coder
{
    // OCGEN: Autogenerated method. Do not touch
    {{- if not .IsDirectChildOfNSObject}}
    if([super respondsToSelector:@selector(encodeWithCoder:)])
    {
        [super encodeWithCoder:coder];
    }
    {{- end}}{{range .Properties}}
    {{if .IsObject -}}
        {{if .IsWeak -}}
            [coder encodeConditionalObject:_{{.Name}} forKey:@"{{.Name}}"];
        {{- else -}}
            [coder encodeObject:_{{.Name}} forKey:@"{{.Name}}"];
        {{- end}}
    {{- else -}}
        [coder encode{{.CoderType}}:_{{.Name}} forKey:@"{{.Name}}"];
    {{- end}}
{{- end}}
}`
var NSCodingEncodeTpl = template.Must(template.New("NSCodingEncode").Parse(NSCodingEncodeText))
{'fraction_non_alphanumeric': 0.16954164613109907, 'fraction_numerical': 0.0, 'mean_word_length': 1.6795774647887325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3801594', 'n_tokens_mistral': 1841, 'n_tokens_neox': 1750, 'n_words': 320}