code: def generate_py(
      module_name,
      code,
      optimizations=None,
      module_dir=None,
      report_times=False,
  ):
      """python + pythran spec -> py code
  
      Prints and returns the optimized python code.
  
      """
  
      pm, ir, _ = front_middle_end(
          module_name,
          code,
          optimizations,
          module_dir,
          report_times=report_times,
      )
      return pm.dump(Python, ir)
  
imports: from pythran.backend import Cxx, Python
  from pythran.config import cfg
  from pythran.cxxgen import PythonModule, Include, Line, Statement
  from pythran.cxxgen import FunctionBody, FunctionDeclaration, Value, Block
  from pythran.cxxgen import ReturnStatement
  from pythran.dist import PythranExtension, PythranBuildExt
  from pythran.middlend import refine, mark_unexported_functions
  from pythran.passmanager import PassManager
  from pythran.tables import pythran_ward
  from pythran.types import tog
  from pythran.types.type_dependencies import pytype_to_deps
  from pythran.types.conversion import pytype_to_ctype
  from pythran.spec import load_specfile, Spec
  from pythran.spec import spec_to_string
  from pythran.syntax import check_specs, check_exports, PythranSyntaxError
  from pythran.version import __version__
  from pythran.utils import cxxid
  import pythran.frontend
  import setuptools
  from distutils.errors import CompileError
  from distutils import sysconfig
  from tempfile import mkdtemp, NamedTemporaryFile
  import gast
  import importlib
  import logging
  import os.path
  import shutil
  import glob
  import hashlib
  from functools import reduce
  import sys
label_desc: Use image node_id 6 for calling a global function with example usage: generate_py(module_name, code, optimizations, module_dir, report_times) and returns: pm