File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/sagemaker/cli/compatibility/v2/modifiers Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -69,14 +69,26 @@ def modify_node(self, node):
69
69
70
70
71
71
class MethodParamRenamer (ParamRenamer ):
72
- """Abstract class to handle parameter renames for methods that belong to objects."""
72
+ """Abstract class to handle parameter renames for methods that belong to objects.
73
+
74
+ This differs from ``ParamRenamer`` in that a node for a standalone function call
75
+ (i.e. where ``node.func`` is an ``ast.Name`` rather than an ``ast.Attribute``) is not modified.
76
+ """
73
77
74
78
def node_should_be_modified (self , node ):
75
79
"""Checks if the node matches any of the relevant functions and
76
80
contains the parameter to be renamed.
77
81
78
82
This looks for a call of the form ``<object>.<method>``, and
79
83
assumes the method cannot be called on its own.
84
+
85
+ Args:
86
+ node (ast.Call): a node that represents a function call. For more,
87
+ see https://docs.python.org/3/library/ast.html#abstract-grammar.
88
+
89
+ Returns:
90
+ bool: If the ``ast.Call`` matches the relevant function calls and
91
+ contains the parameter to be renamed.
80
92
"""
81
93
if isinstance (node .func , ast .Name ):
82
94
return False
You can’t perform that action at this time.
0 commit comments