class_docstr: A class to rename SerDe classes.
class_docstr_tok: ["A","class","to","rename","SerDe","classes","."]
docstr: Updates the name and namespace of the ``ast.Call`` node, as applicable.
  
  This method modifies the ``ast.Call`` node to use the SerDe classes
  available in version 2.0 and later of the Python SDK:
  
  - ``sagemaker.serializers.CSVSerializer``
  - ``sagemaker.serializers.JSONSerializer``
  - ``sagemaker.serializers.NumpySerializer``
  - ``sagemaker.deserializers.CSVDeserializer``
  - ``sagemaker.deserializers.BytesDeserializer``
  - ``sagemaker.deserializers.StringDeserializer``
  - ``sagemaker.deserializers.StreamDeserializer``
  - ``sagemaker.deserializers.NumpyDeserializer``
  - ``sagemaker.deserializers._JsonDeserializer``
  - ``sagemaker.amazon.common.RecordSerializer``
  - ``sagemaker.amazon.common.RecordDeserializer``
  
  Args:
      node (ast.Call): a node that represents a SerDe constructor.
  
  Returns:
      ast.Call: a node that represents the instantiation of a SerDe object.
docstr_tok: ["Updates","the","name","and","namespace","of","the","``","ast.Call","``","node",",","as","applicable",".","This","method","modifies","the","``","ast.Call","``","node","to","use","the","SerDe","classes","available","in","version","2.0","and","later","of","the","Python","SDK",":","-","``","sagemaker.serializers.CSVSerializer","``","-","``","sagemaker.serializers.JSONSerializer","``","-","``","sagemaker.serializers.NumpySerializer","``","-","``","sagemaker.deserializers.CSVDeserializer","``","-","``","sagemaker.deserializers.BytesDeserializer","``","-","``","sagemaker.deserializers.StringDeserializer","``","-","``","sagemaker.deserializers.StreamDeserializer","``","-","``","sagemaker.deserializers.NumpyDeserializer","``","-","``","sagemaker.deserializers._JsonDeserializer","``","-","``","sagemaker.amazon.common.RecordSerializer","``","-","``","sagemaker.amazon.common.RecordDeserializer","``","Args",":","node","(","ast.Call",")",":","a","node","that","represents","a","SerDe","constructor",".","Returns",":","ast.Call",":","a","node","that","represents","the","instantiation","of","a","SerDe","object","."]
code: def modify_node(self, node):
      """Updates the name and namespace of the ``ast.Call`` node, as applicable.
  
      This method modifies the ``ast.Call`` node to use the SerDe classes
      available in version 2.0 and later of the Python SDK:
  
      - ``sagemaker.serializers.CSVSerializer``
      - ``sagemaker.serializers.JSONSerializer``
      - ``sagemaker.serializers.NumpySerializer``
      - ``sagemaker.deserializers.CSVDeserializer``
      - ``sagemaker.deserializers.BytesDeserializer``
      - ``sagemaker.deserializers.StringDeserializer``
      - ``sagemaker.deserializers.StreamDeserializer``
      - ``sagemaker.deserializers.NumpyDeserializer``
      - ``sagemaker.deserializers._JsonDeserializer``
      - ``sagemaker.amazon.common.RecordSerializer``
      - ``sagemaker.amazon.common.RecordDeserializer``
  
      Args:
          node (ast.Call): a node that represents a SerDe constructor.
  
      Returns:
          ast.Call: a node that represents the instantiation of a SerDe object.
      """
      class_name = (
          node.func.id
          if isinstance(node.func, ast.Name)
          else node.func.attr
      )
      new_class_name = OLD_CLASS_NAME_TO_NEW_CLASS_NAME[class_name]
  
      # We don't change the namespace for Amazon SerDe.
      if class_name in OLD_AMAZON_CLASS_NAMES:
          if isinstance(node.func, ast.Name):
              node.func.id = new_class_name
          elif isinstance(node.func, ast.Attribute):
              node.func.attr = new_class_name
          return node
  
      namespace_name = NEW_CLASS_NAME_TO_NAMESPACES[new_class_name][0]
      subpackage_name = namespace_name.split(".")[1]
      return ast.Call(
          func=ast.Attribute(
              value=ast.Name(id=subpackage_name), attr=new_class_name
          ),
          args=[],
          keywords=[],
      )
  
imports: from __future__ import absolute_import
  import ast
  from sagemaker.cli.compatibility.v2.modifiers import matching
  from sagemaker.cli.compatibility.v2.modifiers.modifier import Modifier
label_desc: Use image node_id 2 for calling the SerdeConstructorRenamer obj's underlying member method code with example usage: obj.modify_node(node) and returns: ast, node