# Path: lcs/metrics.py
# def basic_metrics(trial: int, steps: int, reward: int, time: float):
#     return {
#         'trial': trial,
#         'steps_in_trial': steps,
#         'reward': reward,
#         'perf_time': time,
#     }


import logging
import tempfile
import dill
import mlflow
import numpy as np
from collections import namedtuple
from timeit import default_timer as timer
from typing import Callable, List, Tuple
from lcs.metrics import basic_metrics
            OpenAI Gym environment
        n_trials: int
            maximum number of trials
        func: Callable
            Function accepting three parameters: env, steps already made,
             current trial
        decay: bool
            Whether the epsilon is decaying through the whole experiment

        Returns
        -------
        list
            run metrics
        """
        using_mlflow = hasattr(self.get_cfg(), 'use_mlflow') and self.get_cfg().use_mlflow

        current_trial = 1
        steps = 0

        metrics: List = []
        while current_trial <= n_trials:
            start_ts = timer()
            steps_in_trial, reward = func(env, steps, current_trial)
            end_ts = timer()

            steps += steps_in_trial
            self.total_steps += steps_in_trial

            # collect user metrics
            if current_trial % self.get_cfg().metrics_trial_frequency == 0:

# Path: lcs/metrics.py
# def basic_metrics(trial: int, steps: int, reward: int, time: float):
#     return {
#         'trial': trial,
#         'steps_in_trial': steps,
#         'reward': reward,
#         'perf_time': time,
#     }


# Path: lcs/agents/Agent.py
import logging
import tempfile
import dill
import mlflow
import numpy as np
from collections import namedtuple
from timeit import default_timer as timer
from typing import Callable, List, Tuple
from lcs.metrics import basic_metrics

            OpenAI Gym environment
        n_trials: int
            maximum number of trials
        func: Callable
            Function accepting three parameters: env, steps already made,
             current trial
        decay: bool
            Whether the epsilon is decaying through the whole experiment

        Returns
        -------
        list
            run metrics
        """
        using_mlflow = hasattr(self.get_cfg(), 'use_mlflow') and self.get_cfg().use_mlflow

        current_trial = 1
        steps = 0

        metrics: List = []
        while current_trial <= n_trials:
            start_ts = timer()
            steps_in_trial, reward = func(env, steps, current_trial)
            end_ts = timer()

            steps += steps_in_trial
            self.total_steps += steps_in_trial

            # collect user metrics
            if current_trial % self.get_cfg().metrics_trial_frequency == 0:

                m = basic_metrics(