ó
~9­\c           @   s=   d  d l  m Z d  d l m Z d  d l m Z d „  Z d S(   iÿÿÿÿ(   t   chain(   t   Dummy(   t   PythonCodePrinterc         C   s”   t  ƒ  } | j |  ƒ } | j d rD d j d „  | j Dƒ ƒ } nD d j g  | j j ƒ  D]% \ } } d | d j | ƒ f ^ qZ ƒ } | d | S(   s=    Renders python code as a module (with the required imports) t   fully_qualified_moduless   
c         s   s   |  ] } d  | Vq d S(   s	   import %sN(    (   t   .0t   k(    (    s4   lib/python2.7/site-packages/sympy/codegen/pyutils.pys	   <genexpr>   s    s   from %s import %ss   , s   

(   R   t   doprintt	   _settingst   joint   module_importst   items(   t   contentt   printert   pystrt   module_imports_strR   t   v(    (    s4   lib/python2.7/site-packages/sympy/codegen/pyutils.pyt   render_as_module   s    		;N(   t	   itertoolsR    t   sympy.core.symbolR   t   sympy.printing.pycodeR   R   (    (    (    s4   lib/python2.7/site-packages/sympy/codegen/pyutils.pyt   <module>   s   