From 0dcf51b616a5862c4d7fecfca99685bc73455e87 Mon Sep 17 00:00:00 2001 From: Imogen Date: Tue, 26 Dec 2023 20:51:46 +0100 Subject: [PATCH] format --- algobattle/cli.py | 12 +++++++++++- algobattle/problem.py | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/algobattle/cli.py b/algobattle/cli.py index 9535961c..da371128 100644 --- a/algobattle/cli.py +++ b/algobattle/cli.py @@ -52,7 +52,17 @@ from algobattle.match import AlgobattleConfig, EmptyUi, Match, MatchConfig, MatchupStr, Ui, ProjectConfig from algobattle.problem import Instance, Problem, Solution from algobattle.program import Generator, Matchup, Solver -from algobattle.util import BuildError, DockerNotRunning, EncodableModel, ExceptionInfo, Role, RunningTimer, BaseModel, TempDir, timestamp +from algobattle.util import ( + BuildError, + DockerNotRunning, + EncodableModel, + ExceptionInfo, + Role, + RunningTimer, + BaseModel, + TempDir, + timestamp, +) from algobattle.templates import Language, PartialTemplateArgs, TemplateArgs, write_problem_template, write_templates diff --git a/algobattle/problem.py b/algobattle/problem.py index 05236502..6d19f7a7 100644 --- a/algobattle/problem.py +++ b/algobattle/problem.py @@ -522,7 +522,9 @@ def __get_pydantic_core_schema__(cls, source: type[BaseModel], handler: GetCoreS def validate_with_self(input: object, validate: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Self: self: Self = validate(input) if info.context is None or "self" not in info.context: - self = cast(Self, cls.model_validate(input, context=(info.context or {}) | {"self": self, model_type: self})) + self = cast( + Self, cls.model_validate(input, context=(info.context or {}) | {"self": self, model_type: self}) + ) return self schema = with_info_wrap_validator_function(validate_with_self, schema)