<commit_before>package server

import (
	"github.com/cri-o/cri-o/internal/oci"
	"github.com/cri-o/cri-o/server/cri/types"
	json "github.com/json-iterator/go"
	spec "github.com/opencontainers/runtime-spec/specs-go"
	"github.com/pkg/errors"
	"golang.org/x/net/context"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)

// PodSandboxStatus returns the Status of the PodSandbox.
func (s *Server) PodSandboxStatus(ctx context.Context, req *types.PodSandboxStatusRequest) (*types.PodSandboxStatusResponse, error) {
	sb, err := s.getPodSandboxFromRequest(req.PodSandboxID)
	if err != nil {
		return nil, status.Errorf(codes.NotFound, "could not find pod %q: %v", req.PodSandboxID, err)
	}

	rStatus := types.PodSandboxStateSandboxNotReady
	if sb.Ready(true) {
		rStatus = types.PodSandboxStateSandboxReady
	}

	var linux *types.LinuxPodSandboxStatus
	if sb.NamespaceOptions() != nil {
		linux = &types.LinuxPodSandboxStatus{
			Namespaces: &types.Namespace{
				Options: &types.NamespaceOption{
					Network: types.NamespaceMode(sb.NamespaceOptions().Network),
					Ipc:     types.NamespaceMode(sb.NamespaceOptions().Ipc),
					Pid:     types.NamespaceMode(sb.NamespaceOptions().Pid),
				},
			},<commit_msg>Fix unnecessary conversion lint report<commit_after>package server

import (
	"github.com/cri-o/cri-o/internal/oci"
	"github.com/cri-o/cri-o/server/cri/types"
	json "github.com/json-iterator/go"
	spec "github.com/opencontainers/runtime-spec/specs-go"
	"github.com/pkg/errors"
	"golang.org/x/net/context"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)

// PodSandboxStatus returns the Status of the PodSandbox.
func (s *Server) PodSandboxStatus(ctx context.Context, req *types.PodSandboxStatusRequest) (*types.PodSandboxStatusResponse, error) {
	sb, err := s.getPodSandboxFromRequest(req.PodSandboxID)
	if err != nil {
		return nil, status.Errorf(codes.NotFound, "could not find pod %q: %v", req.PodSandboxID, err)
	}

	rStatus := types.PodSandboxStateSandboxNotReady
	if sb.Ready(true) {
		rStatus = types.PodSandboxStateSandboxReady
	}

	var linux *types.LinuxPodSandboxStatus
	if sb.NamespaceOptions() != nil {
		linux = &types.LinuxPodSandboxStatus{
			Namespaces: &types.Namespace{
				Options: &types.NamespaceOption{
					Network: sb.NamespaceOptions().Network,
					Ipc:     sb.NamespaceOptions().Ipc,
					Pid:     sb.NamespaceOptions().Pid,
				},
			},
{'fraction_non_alphanumeric': 0.13363863447127394, 'fraction_numerical': 0.0, 'mean_word_length': 4.511467889908257, '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': '4005056', 'n_tokens_mistral': 929, 'n_tokens_neox': 842, 'n_words': 144}