<s> """<STR_LIT>""" <EOL> import re <EOL> import sys <EOL> import os <EOL> from os . path import dirname , join , pardir , pathsep , abspath <EOL> import IPython <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> ivy_filename = sys . argv [ <NUM_LIT:1> ] <EOL> notebook_source = r"""<STR_LIT>""" . replace ( '<STR_LIT>' , repr ( ivy_filename ) ) <EOL> notebook_filename = ivy_filename [ : - <NUM_LIT:4> ] + '<STR_LIT>' <EOL> if os . path . isfile ( notebook_filename ) : <EOL> print "<STR_LIT>" . format ( notebook_filename ) <EOL> else : <EOL> notebook_filename = ivy_filename + '<STR_LIT>' <EOL> print "<STR_LIT>" . format ( notebook_filename ) <EOL> open ( notebook_filename , '<STR_LIT:w>' ) . write ( notebook_source ) <EOL> d = dirname ( __file__ ) <EOL> os . environ [ '<STR_LIT>' ] = pathsep . join ( [ <EOL> os . environ [ '<STR_LIT>' ] , <EOL> d , <EOL> join ( d , pardir , '<STR_LIT:src>' , '<STR_LIT>' ) , <EOL> ] ) <EOL> sys . argv = [ '<STR_LIT>' , '<STR_LIT>' , notebook_filename ] <EOL> sys . argv [ <NUM_LIT:0> ] = re . sub ( r'<STR_LIT>' , '<STR_LIT>' , sys . argv [ <NUM_LIT:0> ] ) <EOL> sys . exit ( IPython . start_ipython ( ) ) </s>
