class_docstr: Expands all imports into full paths.
  
  Attributes
  ----------
  imports : {str}
      Imported module (python base module name)
  symbols : {str : (str,)}
      Matching between used name and real cxx name.
  
  Examples
  --------
  >>> import gast as ast
  >>> from pythran import passmanager, backend
  >>> node = ast.parse("from math import cos ; cos(2)")
  >>> pm = passmanager.PassManager("test")
  >>> _, node = pm.apply(ExpandImports, node)
  >>> print(pm.dump(backend.Python, node))
  import math as __pythran_import_math
  __pythran_import_math.cos(2)
  >>> node = ast.parse("from os.path import join ; join('a', 'b')")
  >>> _, node = pm.apply(ExpandImports, node)
  >>> print(pm.dump(backend.Python, node))
  import os as __pythran_import_os
  __pythran_import_os.path.join('a', 'b')
docstr: Update import context using overwriting name information.
  
  Examples
  --------
  >> import foo
  >> def bar():
  >>     foo = 2
  >>     print(foo)
  
  In this case, foo can't be used after assign.
docstr_tok: ["Update","import","context","using","overwriting","name","information",".","Examples","--","--","--","--",">",">","import","foo",">",">","def","bar","(",")",":",">",">","foo","=","2",">",">","print","(","foo",")","In","this","case",",","foo","ca","n't","be","used","after","assign","."]
code: def visit_Assign(self, node):
      """
      Update import context using overwriting name information.
  
      Examples
      --------
      >> import foo
      >> def bar():
      >>     foo = 2
      >>     print(foo)
  
      In this case, foo can't be used after assign.
      """
      if (
          isinstance(node.value, ast.Name)
          and node.value.id in self.symbols
      ):
          symbol = path_to_node(self.symbols[node.value.id])
          if not getattr(symbol, "isliteral", lambda: False)():
              for target in node.targets:
                  if not isinstance(target, ast.Name):
                      err = "Unsupported module aliasing"
                      raise PythranSyntaxError(err, target)
                  self.symbols[target.id] = self.symbols[node.value.id]
              return None  # this assignment is no longer needed
      new_node = self.generic_visit(node)
      # no problem if targets contains a subscript, it is not a new assign.
      [
          self.symbols.pop(t.id, None)
          for t in new_node.targets
          if isinstance(t, ast.Name)
      ]
      return new_node
  
file_path: pythran/pythran/transformations/expand_imports.py
imports: from pythran.passmanager import Transformation
  from pythran.utils import path_to_attr, path_to_node
  from pythran.conversion import mangle
  from pythran.syntax import PythranSyntaxError
  from pythran.analyses import Ancestors
  import gast
label_desc: Use image node_id 6 for calling the ExpandImports obj's underlying member method code with example usage: obj.visit_Assign(node) and returns: new_node, None