88from bsag .bsagio import BSAGIO
99from bsag .utils .datetimes import ZERO_TD , format_datetime
1010
11- from ._types import METADATA_KEY , SubmissionMetadata , Results , RESULTS_KEY
11+ from ._types import METADATA_KEY , RESULTS_KEY , Results , SubmissionMetadata
1212
1313EXTRA_TOKENS_KEY = "extra_tokens"
1414"""Used by `gradescope.limit_velocity` to add extra velocity tokens. If not present, then 0 tokens are added.
@@ -32,6 +32,7 @@ class LimitVelocityConfig(BaseStepConfig):
3232 windows : list [Window ]
3333
3434 @validator ("windows" )
35+ # pylint: disable-next=no-self-argument
3536 def windows_must_be_strictly_asc (cls , windows : list [Window ]) -> list [Window ]:
3637 for i in range (len (windows ) - 1 ):
3738 if windows [i + 1 ].start_time - windows [i ].start_time <= ZERO_TD :
@@ -40,6 +41,7 @@ def windows_must_be_strictly_asc(cls, windows: list[Window]) -> list[Window]:
4041 return windows
4142
4243 @validator ("windows" , each_item = True )
44+ # pylint: disable-next=no-self-argument
4345 def windows_must_be_offset_aware (cls , window : Window , values : dict [str , Any ]) -> Window :
4446 config_tz = timezone (values ["time_zone" ])
4547 if not window .start_time .tzinfo :
@@ -53,7 +55,7 @@ def name() -> str:
5355 return "gradescope.limit_velocity"
5456
5557 @classmethod
56- def display_name (cls , config : LimitVelocityConfig ) -> str :
58+ def display_name (cls , _config : LimitVelocityConfig ) -> str :
5759 return "Limit Velocity"
5860
5961 @classmethod
@@ -68,8 +70,9 @@ def run(cls, bsagio: BSAGIO, config: LimitVelocityConfig) -> bool:
6870 start_time = datetime .utcfromtimestamp (0 ).astimezone (timezone (config .time_zone )),
6971 max_tokens = 1 ,
7072 recharge_time = ZERO_TD ,
71- )
72- ] + config .windows
73+ ),
74+ * config .windows ,
75+ ]
7376
7477 # Latest window with start time before current submission
7578 w_idx , active_window = [(i , w ) for i , w in enumerate (windows ) if w .start_time < curr_sub_create_time ][- 1 ]
0 commit comments