'Run code or file specified at the command-line'

def _run_cmd_line_code(self):

    if self.code_to_run:
        line = self.code_to_run
        try:
            self.log.info(('Running    code    given    at    command    line    (c=):    %s' % line))
            self.shell.run_cell(line, store_history=False)
        except:
            self.log.warning(('Error    in    executing    line    in    user    namespace:    %s' % line))
            self.shell.showtraceback()
            if (not self.interact):
                self.exit(1)
    elif self.file_to_run:
        fname = self.file_to_run
        if os.path.isdir(fname):
            fname = os.path.join(fname, '__main__.py')
        try:
            self._exec_file(fname, shell_futures=True)
        except:
            self.shell.showtraceback(tb_offset=4)
            if (not self.interact):
                self.exit(1)
