<commit_before>package py

/*
#include "Python.h"
*/
import "C"
import (
	"fmt"
	"pfi/sensorbee/sensorbee/data"
	"runtime"
	"unsafe"
)

// ObjectInstance is a bind of Python instance, used as `PyInstance`.
type ObjectInstance struct {
	Object
}

// Call calls `name` function.
//  argument type: ...data.Value
//  return type:   data.Value
func (ins *ObjectInstance) Call(name string, args ...data.Value) (data.Value,
	error) {
	return invoke(ins.p, name, args, nil)
}

// CallDirect calls `name` function.
//  argument type: ...data.Value
//  return type:   Object.
//
// This method is suitable for getting the instance object that called method
// returned.
func (ins *ObjectInstance) CallDirect(name string, args []data.Value,
	kwdArg data.Map) (Object, error) {<commit_msg>catch a null pointer access<commit_after>package py

/*
#include "Python.h"
*/
import "C"
import (
	"fmt"
	"pfi/sensorbee/sensorbee/data"
	"runtime"
	"unsafe"
)

// ObjectInstance is a bind of Python instance, used as `PyInstance`.
type ObjectInstance struct {
	Object
}

// Call calls `name` function.
//  argument type: ...data.Value
//  return type:   data.Value
func (ins *ObjectInstance) Call(name string, args ...data.Value) (data.Value,
	error) {
	if ins.p == nil {
		return nil, fmt.Errorf("ins.p of %p is nil while calling %s", ins, name)
	}
	return invoke(ins.p, name, args, nil)
}

// CallDirect calls `name` function.
//  argument type: ...data.Value
//  return type:   Object.
//
// This method is suitable for getting the instance object that called method
// returned.
func (ins *ObjectInstance) CallDirect(name string, args []data.Value,
	kwdArg data.Map) (Object, error) {
{'fraction_non_alphanumeric': 0.14157168566286743, 'fraction_numerical': 0.0, 'mean_word_length': 3.532608695652174, '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': '3338940', 'n_tokens_mistral': 552, 'n_tokens_neox': 546, 'n_words': 185}