View module source on GitHub

EvaluateContainerWithVariables

class EvaluateContainerWithVariables()

Evaluate container with variables.

This class provides functionality to manage evaluators with variables.

__init__

def __init__(id: str, entity: Entity, log_writer: LogWriter,
             for_evaluators: List[str]) -> None

Initialize the evaluate container with variables.

Arguments:

NameTypeDescription
idstrThe ID of the evaluate container.
entityEntityThe entity of the evaluate container.
log_writerLogWriterThe log writer of the evaluate container.
for_evaluatorsList[str]The evaluators of the evaluate container.

with_variables

def with_variables(variables: Dict[str, str])

With variables.

Arguments:

NameTypeDescription
variablesDict[str, str]The variables to use for the evaluate container.

EvaluateContainer

class EvaluateContainer()

Evaluate container.

This class provides functionality to manage evaluators for a specific entity.

Attributes:

NameTypeDescription
entityEntityThe entity associated with these evaluators.
writerLogWriterThe log writer used for committing evaluator actions.
evaluatorsList[str]A list of evaluator identifiers.
idstrA unique identifier for this set of evaluators.

Methods:

  • with_variables - Allows adding variables to be used by the evaluators.

__init__

def __init__(id: str, entity: Entity, log_writer: LogWriter) -> None

Initialize the evaluate container.

Arguments:

NameTypeDescription
idstrThe ID of the evaluate container.
entityEntityThe entity of the evaluate container.
log_writerLogWriterThe log writer of the evaluate container.

with_variables

def with_variables(variables: Dict[str, str], for_evaluators: List[str])

With variables.

Arguments:

NameTypeDescription
variablesDict[str, str]The variables to use for the evaluate container.
for_evaluatorsList[str]The evaluators of the evaluate container.

with_evaluators

def with_evaluators(*evaluators: str) -> EvaluateContainerWithVariables

With evaluators.

Arguments:

NameTypeDescription
*evaluatorsstrThe evaluators to use for the evaluate container.

Returns:

NameDescription
[EvaluateContainerWithVariables](/sdk/python/references/logger/components/base)The evaluate container with variables.

BaseContainer

class BaseContainer()

Base container.

This class provides functionality to manage containers for a specific entity.

__init__

def __init__(entity: Entity, config: BaseConfig, writer: LogWriter)

Initialize the base container.

Arguments:

NameTypeDescription
entityEntityThe entity of the base container.
configBaseConfigThe config of the base container.
writerLogWriterThe writer of the base container.

id

@property
def id() -> str

Get the ID of the base container.

Returns:

NameDescription
strThe ID of the base container.

evaluate

def evaluate() -> EvaluateContainer

Evaluate the base container.

Returns:

NameDescription
[EvaluateContainer](/sdk/python/references/logger/components/base)The evaluate container.

_evaluate_

@staticmethod
def _evaluate_(writer: LogWriter, entity: Entity,
               id: str) -> EvaluateContainer

Evaluate the base container.

Arguments:

NameTypeDescription
writerLogWriterThe writer of the base container.
entityEntityThe entity of the base container.
idstrThe ID of the base container.

add_metadata

def add_metadata(metadata: Dict[str, Any]) -> None

Add metadata to the base container.

Arguments:

NameTypeDescription
metadataDict[str, Any]The metadata to add to the base container.

add_metadata_

@staticmethod
def add_metadata_(writer: LogWriter, entity: Entity, id: str,
                  metadata: Dict[str, Any]) -> None

Add metadata to the base container.

Arguments:

NameTypeDescription
writerLogWriterThe writer of the base container.
entityEntityThe entity of the base container.
idstrThe ID of the base container.
metadataDict[str, Any]The metadata to add to the base container.

add_tag

def add_tag(key: str, value: str)

Add a tag to the base container.

Arguments:

NameTypeDescription
keystrThe key of the tag.
valuestrThe value of the tag.

_add_tag_

@staticmethod
def _add_tag_(writer: LogWriter, entity: Entity, id: str, key: str,
              value: str)

Add a tag to the base container.

Arguments:

NameTypeDescription
writerLogWriterThe writer of the base container.
entityEntityThe entity of the base container.
idstrThe ID of the base container.
keystrThe key of the tag.
valuestrThe value of the tag.

end

def end()

End the base container.

This method is used to end the base container.

_end_

@staticmethod
def _end_(writer: LogWriter,
          entity: Entity,
          id: str,
          data: Optional[Dict[str, Any]] = None)

End the base container.

Arguments:

NameTypeDescription
writerLogWriterThe writer of the base container.
entityEntityThe entity of the base container.
idstrThe ID of the base container.
dataOptional[Dict[str, Any]]The data to add to the base container.

data

def data() -> Dict[str, Any]

Get the data of the base container.

Returns:

Dict[str, Any]: The data of the base container.

_commit_

@staticmethod
def _commit_(writer: LogWriter,
             entity: Entity,
             id: str,
             action: str,
             data: Optional[Dict[str, Any]] = None)

Commit the base container.

Arguments:

NameTypeDescription
writerLogWriterThe writer of the base container.
entityEntityThe entity of the base container.
idstrThe ID of the base container.
actionstrThe action to commit.
dataOptional[Dict[str, Any]]The data to commit.

EventEmittingBaseContainer

class EventEmittingBaseContainer(BaseContainer)

_event_

@staticmethod
def _event_(writer: LogWriter,
            entity: Entity,
            entity_id: str,
            id: str,
            name: str,
            tags: Optional[Dict[str, str]] = None,
            metadata: Optional[Dict[str, Any]] = None)

Add an event to the base container.

Arguments:

NameTypeDescription
writerLogWriterThe writer of the base container.
entityEntityThe entity of the base container.
entity_idstrThe ID of the entity.
idstrThe ID of the event.
namestrThe name of the event.
tagsOptional[Dict[str, str]]The tags of the event.
metadataOptional[Dict[str, Any]]The metadata of the event.

event

def event(id: str,
          name: str,
          tags: Optional[Dict[str, str]] = None,
          metadata: Optional[Dict[str, Any]] = None)

Add an event to the base container.

Arguments:

NameTypeDescription
idstrThe ID of the event.
namestrThe name of the event.
tagsOptional[Dict[str, str]]The tags of the event.
metadataOptional[Dict[str, Any]]The metadata of the event.