stubber.codemod.utils ===================== .. py:module:: stubber.codemod.utils Classes ------- .. autoapisummary:: stubber.codemod.utils.ScopeableMatcherTransformer Functions --------- .. autoapisummary:: stubber.codemod.utils.shallow_copy_function Module Contents --------------- .. py:function:: shallow_copy_function(func: Any) -> types.FunctionType Create a shallow copy of the given function. The returned function is unbound and does not copy attributes defined on the function. .. py:class:: ScopeableMatcherTransformer Bases: :py:obj:`libcst.matchers.MatcherDecoratableTransformer` MatcherDecoratableTransformer that can be reused with different scopes. .. py:attribute:: scope_matcher :type: Optional[libcst.matchers.BaseMatcherNode] .. py:method:: _build_scoped_meth(method_name: str, scope_matcher: libcst.matchers.BaseMatcherNode) Build unbound scoped method from parent class. .. py:method:: with_scope(scope_matcher: libcst.matchers.BaseMatcherNode) -> libcst.matchers.MatcherDecoratableTransformer Construct a copy of this matcher with visitors scoped to `scope_matcher.`