<commit_before>package state

import (
	"labix.org/v2/mgo/bson"
	"labix.org/v2/mgo/txn"
)

// ActionStatus represents the available status' for an Action
type ActionStatus string

const (
	// ActionPending is the default status of a new action.
	ActionPending ActionStatus = "pending"
	// ActionRunning indicates that the action has been picked up and is running.
	ActionRunning ActionStatus = "running"
)

type actionDoc struct {
	Id      string `bson:"_id"`
	Name    string
	Unit    string
	Payload interface{}
	Status  ActionStatus
}

// Action represents an instruction to do some "action" and is expected to match
// an action definition in a charm.
type Action struct {
	st  *State
	doc actionDoc
}

func newAction(st *State, adoc actionDoc) *Action {
	action := &Action{
		st:  st,
		doc: adoc,
	}
	return action
}

// Name returns the name of the Action
func (a *Action) Name() string {
	return a.doc.Name
}

// Id returns the mongo Id of the Action
func (a *Action) Id() string {
	return a.doc.Id
}<commit_msg>inline return of new Action<commit_after>package state

import (
	"labix.org/v2/mgo/bson"
	"labix.org/v2/mgo/txn"
)

// ActionStatus represents the available status' for an Action
type ActionStatus string

const (
	// ActionPending is the default status of a new action.
	ActionPending ActionStatus = "pending"
	// ActionRunning indicates that the action has been picked up and is running.
	ActionRunning ActionStatus = "running"
)

type actionDoc struct {
	Id      string `bson:"_id"`
	Name    string
	Unit    string
	Payload interface{}
	Status  ActionStatus
}

// Action represents an instruction to do some "action" and is expected to match
// an action definition in a charm.
type Action struct {
	st  *State
	doc actionDoc
}

func newAction(st *State, adoc actionDoc) *Action {
	return &Action{
		st:  st,
		doc: adoc,
	}
}

// Name returns the name of the Action
func (a *Action) Name() string {
	return a.doc.Name
}

// Id returns the mongo Id of the Action
func (a *Action) Id() string {
	return a.doc.Id
}
{'fraction_non_alphanumeric': 0.08849557522123894, 'fraction_numerical': 0.0019665683382497543, 'mean_word_length': 3.532293986636971, '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': '6025197', 'n_tokens_mistral': 652, 'n_tokens_neox': 650, 'n_words': 256}