<commit_before>package client

import (
	"github.com/godbus/dbus"
	"github.com/muka/device-manager/objects"
	"github.com/muka/device-manager/util"
	"log"
)

// NewDeviceManager create a new DeviceManager client
func NewDeviceManager() *DeviceManager {
	d := new(DeviceManager)
	d.client = NewClient(objects.DeviceManagerInterface, objects.DeviceManagerPath)
	d.logger = util.Logger()
	return d
}

// DeviceManager client
type DeviceManager struct {
	client *Client
	logger *log.Logger
}

// Create a new device
func (d *DeviceManager) Create(dev objects.DeviceDefinition) (dbus.ObjectPath, error) {
	var s dbus.ObjectPath
	err := d.client.Call("Create", 0, dev).Store(&s)
	util.CheckError(err)
	d.logger.Printf("Created device at path\n %v\n", s)
	return s, nil
}
<commit_msg>added find method to dbus client<commit_after>package client

import (
	"github.com/godbus/dbus"
	"github.com/muka/device-manager/objects"
	"github.com/muka/device-manager/util"
	"log"
)

// NewDeviceManager create a new DeviceManager client
func NewDeviceManager() *DeviceManager {
	d := new(DeviceManager)
	d.client = NewClient(objects.DeviceManagerInterface, objects.DeviceManagerPath)
	d.logger = util.Logger()
	return d
}

// DeviceManager client
type DeviceManager struct {
	client *Client
	logger *log.Logger
}

// Find a list of device
func (d *DeviceManager) Find(q *objects.BaseQuery) []dbus.ObjectPath {
	var s []dbus.ObjectPath
	err := d.client.Call("Find", 0, q).Store(&s)
	util.CheckError(err)
	return s
}

// Create a new device
func (d *DeviceManager) Create(dev objects.DeviceDefinition) (dbus.ObjectPath, error) {
	var s dbus.ObjectPath
	err := d.client.Call("Create", 0, dev).Store(&s)
	util.CheckError(err)
	d.logger.Printf("Created device at path\n %v\n", s)
	return s, nil
}

{'fraction_non_alphanumeric': 0.1308516638465877, 'fraction_numerical': 0.001692047377326565, 'mean_word_length': 4.741100323624596, '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': '7022206', 'n_tokens_mistral': 609, 'n_tokens_neox': 607, 'n_words': 150}