harbor run -t openthoughts/tasktrove-exp-rpt-stack-pytest-large-stack-pytest-0236harbor download openthoughts/tasktrove-exp-rpt-stack-pytest-large-stack-pytest-0236Task: Implement a time-series utility module under /app/gs_quant that provides the functionality exercised by the provided pytest tests, exposing a timeseries module with specific functions, a value error, and an enum.
What you must implement
Exceptions and types
class MqValueError(Exception): a simple exception used by last_value when given an empty series.
class LagMode(Enum):
Public functions (all operate on pandas Series, preserving or transforming their index as shown in tests)
def first(x: pd.Series) -> pd.Series
def last(x: pd.Series) -> pd.Series
def last_value(x: pd.Series) -> float
def count(x: pd.Series) -> pd.Series
def diff(x: pd.Series, n: int = 1) -> pd.Series
def lag(x: pd.Series, periods: Union[int, str] = 1, mode: LagMode = LagMode.EXTEND) -> pd.Series
Notes and edge cases the implementation must handle
Important note for the task description