class_docstr: Replace list nodes by tuple nodes when possible
  
  >>> import gast as ast
  >>> from pythran import passmanager, backend
  >>> node = ast.parse("def foo(n): import numpy; return numpy.ones([n,n])")
  >>> pm = passmanager.PassManager("test")
  >>> _, node = pm.apply(ListToTuple, node)
  >>> print(pm.dump(backend.Python, node))
  def foo(n):
      import numpy
      return numpy.ones((n, n))
docstr: Replace list calls by static_list calls when possible
  
  >>> import gast as ast
  >>> from pythran import passmanager, backend
  >>> node = ast.parse("def foo(n):\n"
  ...                  "    x = builtins.list(n)\n"
  ...                  "    x[0] = 0\n"
  ...                  "    return builtins.tuple(x)")
  >>> pm = passmanager.PassManager("test")
  >>> _, node = pm.apply(ListToTuple, node)
  >>> print(pm.dump(backend.Python, node))
  def foo(n):
      x = builtins.pythran.static_list(n)
      x[0] = 0
      return builtins.tuple(x)
  
  >>> node = ast.parse("def foo(n):\n"
  ...                  "    x = builtins.list(n)\n"
  ...                  "    x[0] = 0\n"
  ...                  "    return x")
  >>> pm = passmanager.PassManager("test")
  >>> _, node = pm.apply(ListToTuple, node)
  >>> print(pm.dump(backend.Python, node))
  def foo(n):
      x = builtins.list(n)
      x[0] = 0
      return x
docstr_tok: ["Replace","list","calls","by","static_list","calls","when","possible",">",">",">","import","gast","as","ast",">",">",">","from","pythran","import","passmanager",",","backend",">",">",">","node","=","ast.parse","(","``","def","foo","(","n",")",":","\\n","''","...","``","x","=","builtins.list","(","n",")","\\n","''","...","``","x","[","0","]","=","0\\n","''","...","``","return","builtins.tuple","(","x",")","''",")",">",">",">","pm","=","passmanager.PassManager","(","``","test","''",")",">",">",">","_",",","node","=","pm.apply","(","ListToTuple",",","node",")",">",">",">","print","(","pm.dump","(","backend.Python",",","node",")",")","def","foo","(","n",")",":","x","=","builtins.pythran.static_list","(","n",")","x","[","0","]","=","0","return","builtins.tuple","(","x",")",">",">",">","node","=","ast.parse","(","``","def","foo","(","n",")",":","\\n","''","...","``","x","=","builtins.list","(","n",")","\\n","''","...","``","x","[","0","]","=","0\\n","''","...","``","return","x","''",")",">",">",">","pm","=","passmanager.PassManager","(","``","test","''",")",">",">",">","_",",","node","=","pm.apply","(","ListToTuple",",","node",")",">",">",">","print","(","pm.dump","(","backend.Python",",","node",")",")","def","foo","(","n",")",":","x","=","builtins.list","(","n",")","x","[","0","]","=","0","return","x"]
code: def visit_Assign(self, node):
      """
      Replace list calls by static_list calls when possible
  
      >>> import gast as ast
      >>> from pythran import passmanager, backend
      >>> node = ast.parse("def foo(n):\\n"
      ...                  "    x = builtins.list(n)\\n"
      ...                  "    x[0] = 0\\n"
      ...                  "    return builtins.tuple(x)")
      >>> pm = passmanager.PassManager("test")
      >>> _, node = pm.apply(ListToTuple, node)
      >>> print(pm.dump(backend.Python, node))
      def foo(n):
          x = builtins.pythran.static_list(n)
          x[0] = 0
          return builtins.tuple(x)
  
      >>> node = ast.parse("def foo(n):\\n"
      ...                  "    x = builtins.list(n)\\n"
      ...                  "    x[0] = 0\\n"
      ...                  "    return x")
      >>> pm = passmanager.PassManager("test")
      >>> _, node = pm.apply(ListToTuple, node)
      >>> print(pm.dump(backend.Python, node))
      def foo(n):
          x = builtins.list(n)
          x[0] = 0
          return x
      """
      self.generic_visit(node)
      if node.value not in self.fixed_size_list:
          return node
  
      node.value = self.convert(node.value)
      return node
  
file_path: catboost/contrib/python/pythran/pythran/optimizations/list_to_tuple.py
imports: from pythran.analyses import Aliases, FixedSizeList
  from pythran.tables import MODULES
  from pythran.passmanager import Transformation
  from pythran.utils import path_to_attr
  import gast
label_desc: Use image node_id 5 for calling the ListToTuple obj's underlying member method code with example usage: obj.visit_Assign(node) and returns: node, node