<commit_before><?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<Class name="CPM.Registry.GitHubApi">
<IncludeCode>CPM.LIB</IncludeCode>
<Super>%RegisteredObject</Super>
<TimeCreated>64004,11169.348775</TimeCreated>

<Parameter name="ApiServer">
<Default>api.github.com</Default>
</Parameter>

<Method name="GetCertificate">
<Description>
Get SSL Configuration by Server as a name for configuration</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>Server:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    new $namespace
    zn "%SYS" 
    quit:##class(Security.SSLConfigs).Exists(Server) Server

    do {
        set tSC=##class(Security.SSLConfigs).Create(Server)
        $$$ThrowOnError(tSC)
    } while 0
    
    quit Server
]]></Implementation>
</Method>

<Method name="SendSimpleHttpRequest">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[server:%String="api.github.com",location:%String,&responseText:%String,authorization:%String=""]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    #dim req as %Net.HttpRequest = ##class(%Net.HttpRequest).%New()
    set req.Server = server
    set req.Https  = 1
    set req.ContentType = "application/json"
    set req.AcceptGzip  = 1
    set req.Timeout     = $$$GetParam(Params,"timeout", 30)
    set req.SSLConfiguration = ..GetCertificate(server)
    if authorization '= "" {
        set req.Authorization = authorization
    }
    
    #dim k as %String = ""
    #dim v as %String = ""
    
    #dim status as %Status = $$$OK
    set status = req.Get(location)

    if ($$$ISOK(status)) {
        #dim response as %String = ""
        #dim res as %Net.HttpResponse = req.HttpResponse
            
        #dim responseLength as %Integer = $$$MaxReasonableResponseSize
        set response = res.Data.Read(.responseLength)
        
        set responseText = response
    } else {
        set responseText = ""
    }
        
    quit status
]]></Implementation>
</Method><commit_msg>(few more stylistic tunes)<commit_after><?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<Class name="CPM.Registry.GitHubApi">
<IncludeCode>CPM.LIB</IncludeCode>
<Super>%RegisteredObject</Super>
<TimeCreated>64004,11169.348775</TimeCreated>

<Parameter name="ApiServer">
<Default>api.github.com</Default>
</Parameter>

<Method name="GetCertificate">
<Description>
Get SSL Configuration by Server as a name for configuration</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>Server:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    new $namespace
    zn "%SYS" 
    quit:##class(Security.SSLConfigs).Exists(Server) Server

    do {
        set tSC=##class(Security.SSLConfigs).Create(Server)
        $$$ThrowOnError(tSC)
    } while 0
    
    quit Server
]]></Implementation>
</Method>

<Method name="SendSimpleHttpRequest">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[server:%String="api.github.com",location:%String,&responseText:%String,authorization:%String=""]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    #dim req as %Net.HttpRequest = ##class(%Net.HttpRequest).%New()
    set req.Server      = server
    set req.Https       = 1
    set req.ContentType = "application/json"
    set req.AcceptGzip  = 1
    set req.Timeout     = $$$GetParam(Params, "timeout", 30)
    set req.SSLConfiguration = ..GetCertificate(server)
    if authorization '= "" {
        set req.Authorization = authorization
    }
    
    #dim status as %Status = $$$OK
    set status = req.Get(location)

    if ($$$ISOK(status)) {
        #dim response as %String = ""
        #dim res as %Net.HttpResponse = req.HttpResponse
            
        #dim responseLength as %Integer = $$$MaxReasonableResponseSize
        set response = res.Data.Read(.responseLength)
        
        set responseText = response
    } else {
        set responseText = ""
    }
        
    quit status
]]></Implementation>
</Method>
{'fraction_non_alphanumeric': 0.14969021065675342, 'fraction_numerical': 0.013878562577447335, 'mean_word_length': 3.748235294117647, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 2, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '218947', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1231, 'n_words': 251}