AdithyaSK's picture
AdithyaSK HF Staff
Publish 100 swe_next Harbor tasks
d40299b verified
Raw History Blame Contribute Delete
404 Bytes
from __future__ import annotations
from typing import TYPE_CHECKING, Any, TypeVar
if TYPE_CHECKING:
from collections.abc import Callable
F = TypeVar("F", bound="Callable[..., Any]")
def add_attributes(**attrs: object) -> Callable[[F], F]:
def decorator(func: F) -> F:
for name, value in attrs.items():
setattr(func, name, value)
return func
return decorator