(decorators: Sequence[cst.Decorator], decorator_name: str)
| 371 | |
| 372 | @staticmethod |
| 373 | def get_decorators(decorators: Sequence[cst.Decorator], decorator_name: str) -> list[dict[str, Any]]: |
| 374 | return [ |
| 375 | { |
| 376 | k: v |
| 377 | for k, v in [ |
| 378 | (arg.keyword.value, cst_to_python(arg.value)) |
| 379 | for arg in args |
| 380 | if isinstance(arg, cst.Arg) and isinstance(arg.keyword, cst.Name) |
| 381 | ] |
| 382 | } |
| 383 | for decorator in decorators |
| 384 | for decorator in [decorator.decorator] |
| 385 | if isinstance(decorator, cst.Call) |
| 386 | and isinstance(decorator.func, cst.Name) |
| 387 | and decorator.func.value == decorator_name |
| 388 | for args in [decorator.args] |
| 389 | if len(args) > 0 |
| 390 | for name in [args[0].value] |
| 391 | if isinstance(name, SimpleString) |
| 392 | ] |
| 393 | |
| 394 | @classmethod |
| 395 | def create_subscript(cls, name: str) -> cst.Subscript: |
no test coverage detected