<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import , division , print_function <EOL> import json <EOL> import os <EOL> from functools import partial <EOL> from conda . compat import PY3 <EOL> from . environ import get_dict as get_environ <EOL> _setuptools_data = None <EOL> def load_setuptools ( setup_file = '<STR_LIT>' , from_recipe_dir = False , <EOL> recipe_dir = None ) : <EOL> global _setuptools_data <EOL> if _setuptools_data is None : <EOL> _setuptools_data = { } <EOL> def setup ( ** kw ) : <EOL> _setuptools_data . update ( kw ) <EOL> import setuptools <EOL> import distutils . core <EOL> import sys <EOL> sys . path . append ( '<STR_LIT:.>' ) <EOL> if from_recipe_dir and recipe_dir : <EOL> setup_file = os . path . abspath ( os . path . join ( recipe_dir , setup_file ) ) <EOL> setuptools_setup = setuptools . setup <EOL> distutils_setup = distutils . core . setup <EOL> setuptools . setup = distutils . core . setup = setup <EOL> ns = { <EOL> '<STR_LIT>' : '<STR_LIT:__main__>' , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : setup_file , <EOL> } <EOL> code = compile ( open ( setup_file ) . read ( ) , setup_file , '<STR_LIT>' , <EOL> dont_inherit = <NUM_LIT:1> ) <EOL> exec ( code , ns , ns ) <EOL> distutils . core . setup = distutils_setup <EOL> setuptools . setup = setuptools_setup <EOL> del sys . path [ - <NUM_LIT:1> ] <EOL> return _setuptools_data <EOL> def load_npm ( ) : <EOL> mode_dict = { '<STR_LIT>' : '<STR_LIT:r>' , '<STR_LIT>' : '<STR_LIT:utf-8>' } if PY3 else { '<STR_LIT>' : '<STR_LIT:rb>' } <EOL> with open ( '<STR_LIT>' , ** mode_dict ) as pkg : <EOL> return json . load ( pkg ) <EOL> def context_processor ( initial_metadata , recipe_dir ) : <EOL> """<STR_LIT>""" <EOL> ctx = get_environ ( m = initial_metadata ) <EOL> environ = dict ( os . environ ) <EOL> environ . update ( get_environ ( m = initial_metadata ) ) <EOL> ctx . update ( load_setuptools = partial ( load_setuptools , recipe_dir = recipe_dir ) , <EOL> load_npm = load_npm , <EOL> environ = environ ) <EOL> return ctx </s>
