<commit_before>package web

import (
    "github.com/docker/docker/image"
    "github.com/docker/distribution/reference"
    "github.com/docker/distribution/registry/client"
    "github.com/docker/distribution/context"
    "fmt"
    "github.com/gin-gonic/gin"
    "github.com/docker/distribution/manifest/schema2"
    "github.com/jfrazelle/go/canonical/json"
    "github.com/spacexnice/ctlplane/pro/api"
    "strings"
)



func (h *WebHandler)  PTest(c *gin.Context){
    h.image("admin/bob","v2")
}

func (h * WebHandler) image(vrepo,vtag string)(*schema2.DeserializedManifest,*image.Image,error){
    ctx := context.Background()
    repo, err := reference.ParseNamed(vrepo)
    if err != nil {
        return nil,nil,err
    }
    rp, err := client.NewRepository(ctx, repo, h.RegURL, nil)
    if err != nil {
        return nil,nil,err
    }

    descriptor, err := rp.Tags(ctx).Get(ctx,vtag)
    if err != nil{
        return nil,nil,err
    }

    msvc,err := rp.Manifests(ctx)
    if err != nil{
        return nil,nil,err
    }

    mf,err := msvc.Get(ctx,descriptor.Digest)
    if err != nil{<commit_msg>import json error<commit_after>package web

import (
    "github.com/docker/docker/image"
    "github.com/docker/distribution/reference"
    "github.com/docker/distribution/registry/client"
    "github.com/docker/distribution/context"
    "fmt"
    "github.com/gin-gonic/gin"
    "github.com/docker/distribution/manifest/schema2"
    "github.com/spacexnice/ctlplane/pro/api"
    "strings"
"encoding/json"
)



func (h *WebHandler)  PTest(c *gin.Context){
    h.image("admin/bob","v2")
}

func (h * WebHandler) image(vrepo,vtag string)(*schema2.DeserializedManifest,*image.Image,error){
    ctx := context.Background()
    repo, err := reference.ParseNamed(vrepo)
    if err != nil {
        return nil,nil,err
    }
    rp, err := client.NewRepository(ctx, repo, h.RegURL, nil)
    if err != nil {
        return nil,nil,err
    }

    descriptor, err := rp.Tags(ctx).Get(ctx,vtag)
    if err != nil{
        return nil,nil,err
    }

    msvc,err := rp.Manifests(ctx)
    if err != nil{
        return nil,nil,err
    }

    mf,err := msvc.Get(ctx,descriptor.Digest)
    if err != nil{
{'fraction_non_alphanumeric': 0.14929449248975876, 'fraction_numerical': 0.0027309968138370506, 'mean_word_length': 2.9603603603603603, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2317301', 'n_tokens_mistral': 814, 'n_tokens_neox': 774, 'n_words': 131}