MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / get_decorators

Method get_decorators

scripts/openapi.py:373–392  ·  view source on GitHub ↗
(decorators: Sequence[cst.Decorator], decorator_name: str)

Source from the content-addressed store, hash-verified

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:

Callers 1

visit_FunctionDefMethod · 0.80

Calls 1

cst_to_pythonFunction · 0.85

Tested by

no test coverage detected