;ELC   
;;; Compiled
;;; in Emacs version 24.5.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\302\303\304\"\207" [require ob add-to-list org-babel-tangle-lang-exts ("python" . "py")] 3)
(defvar org-babel-default-header-args:python nil)
(byte-code "\300\301\302\303\304\305\306\307\310\311\312\313&\210\300\314\315\316\310\311\304\305\306\317\312\320&\210\300\321\322\323\310\311\304\305\306\324\312\313&\210\300\325\326\327\310\311\304\305\306\330\312\320&\207" [custom-declare-variable org-babel-python-command "python" "Name of the command for executing Python code." :version "24.4" :package-version (Org . "8.0") :group org-babel :type string org-babel-python-mode (if (or (featurep 'xemacs) (featurep 'python-mode)) 'python-mode 'python) "Preferred python mode for use in running python interactively.\nThis will typically be either 'python or 'python-mode." (Org . "8.0") symbol org-babel-python-hline-to "None" "Replace hlines in incoming tables with this when translating to python." (Org . "8.0") org-babel-python-None-to 'hline "Replace 'None' in python tables with this before returning." (Org . "8.0")] 12)
#@102 Execute a block of Python code with Babel.
This function is called by `org-babel-execute-src-block'.
(defalias 'org-babel-execute:python #[(body params) "\306\307\310\"A!\307\311\"A\307\312\"A\211\313=\205$ 	?\205$ \307\314\"A\307\315\"A\307\316\"A\2065 \317\f\203E \320\321\f\"\202F \322P\323!#\324	\n%\325\326\307\327\"A\307\330\"A\"\326\307\331\"A\307\332\"A\"#.\207" [params session result-params result-type return-val preamble org-babel-python-initiate-session assoc :session :result-params :result-type value :return :preamble :python org-babel-expand-body:generic format "\nreturn %s" "" org-babel-variable-assignments:python org-babel-python-evaluate org-babel-reassemble-table org-babel-pick-name :colname-names :colnames :rowname-names :rownames org-babel-python-command body full-body result] 9 (#$ . 1466)])
#@105 Prepare SESSION according to the header arguments in PARAMS.
VARS contains resolved variable references
(defalias 'org-babel-prep-session:python #[(session params) "\305!\306	!\307!\204 \310\311\"\210\312 \313\216rq\210\314\315\316\n\"\210,*\207" [session params var-lines save-match-data-internal comint-input-filter org-babel-python-initiate-session org-babel-variable-assignments:python org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) #[(input) "\300\207" [nil] 1] mapc #[(var) "\302\210c\210\303 \210\304	!\207" [var session 1 comint-send-input org-babel-comint-wait-for-output] 2]] 3 (#$ . 2328)])
#@25 Load BODY into SESSION.
(defalias 'org-babel-load-session:python #[(session body params) "\305 \306\216\307	\n\"rq\210\310\311p!!b\210\312\f!c\210)+\207" [#1=#:wconfig session params buffer body current-window-configuration ((set-window-configuration #1#)) org-babel-prep-session:python process-mark get-buffer-process org-babel-chomp] 3 (#$ . 3079)])
#@69 Return a list of Python statements assigning the block's variables.
(defalias 'org-babel-variable-assignments:python #[(params) "\301\302\301\303\304\305\"\"\"\207" [params mapcar #[(pair) "\301\302@\303A!#\207" [pair format "%s=%s" org-babel-python-var-to-python] 5] cdr org-babel-get-header :var] 7 (#$ . 3441)])
#@152 Convert an elisp value to a python variable.
Convert an elisp value, VAR, into a string of python source code
specifying a variable of the same value.
(defalias 'org-babel-python-var-to-python #[(var) "<\203 \302\303\304\305#\306Q\207\307\232\203 	\207\310;\203' \311\312\"\203' \313\202( \314;\2033 \315!\2024 \"\207" [var org-babel-python-hline-to "[" mapconcat org-babel-python-var-to-python ", " "]" hline format string-match "[\n]" "\"\"%S\"\"" "%S" substring-no-properties] 5 (#$ . 3766)])
#@178 Convert RESULTS into an appropriate elisp value.
If the results look like a list or tuple, then convert them into an
Emacs-lisp table, otherwise return the results as a string.
(defalias 'org-babel-python-table-or-string #[(results) "\302!\211<\203 \303\304	\"\202 	)\207" [results res org-babel-script-escape mapcar #[(el) "\302\232\203 	\207\207" [el org-babel-python-None-to None] 2]] 4 (#$ . 4280)])
(defvar org-babel-python-buffers '((:default . "*Python*")))
#@44 Return the buffer associated with SESSION.
(defalias 'org-babel-python-session-buffer #[(session) "\302	\"A\207" [session org-babel-python-buffers assoc] 3 (#$ . 4758)])
(defalias 'org-babel-python-with-earmuffs #[(session) ";\203	 \202 \302\303\"\211\304\305O\306\230\203& 	\211GS\307O\306\230\203& 	\202* \302\310	\")\207" [session name format "%s" 0 1 "*" nil "*%s*"] 4])
(defalias 'org-babel-python-without-earmuffs #[(session) ";\203	 \202 \302\303\"\211\304\305O\306\230\203+ 	\211GS\307O\306\230\203+ 	\305	GSO\202, 	)\207" [session name format "%s" 0 1 "*" nil] 4])
#@135 Initiate a python session.
If there is not a current inferior-process-buffer in SESSION
then create.  Return the initialized session.
(defalias 'org-babel-python-initiate-session-by-key #[(&optional session) "\306!\210\307 \310\216\n\203 \311\n!\202 \312\313\n!\f\314\235\203% \315P\202& !\316=\203Z \317\320!\203Z \321\322\"\"\204D \320!!\210\202\227 \204L \323\n!\324!#\320!!\210)\202\227 \325=\203\223 \317\326!\203\223 \327$!\210\203} \330!\203} \331\332\333#\202\202 \334\335\n!P\211%&\326 \210\323%!*\202\227 \336\337!\210\nB\340\n'\"B'\n-\207" [org-babel-python-mode #1=#:wconfig session python-buffer system-type org-babel-python-command require current-window-configuration ((set-window-configuration #1#)) intern :default org-babel-python-session-buffer (cygwin windows-nt ms-dos) " -i" python fboundp run-python version< "24.1" org-babel-python-with-earmuffs org-babel-python-without-earmuffs python-mode py-shell py-toggle-shells buffer-live-p replace-regexp-in-string "^\\*\\([^*]+\\)\\*$" "\\1" "Python-" symbol-name error "No function available for running an inferior Python" assq-delete-all cmd emacs-version python-shell-buffer-name py-default-interpreter bufname py-which-bufname org-babel-python-buffers] 5 (#$ . 5350)])
#@53 Create a session named SESSION according to PARAMS.
(defalias 'org-babel-python-initiate-session #[(&optional session params) "\301\230?\205\f \302\303!!\207" [session "none" org-babel-python-session-buffer org-babel-python-initiate-session-by-key] 3 (#$ . 6626)])
#@53 A string to indicate that evaluation has completed.
(defvar org-babel-python-eoe-indicator "'org_babel_python_eoe'" (#$ . 6899))
(defconst org-babel-python-wrapper-method "\ndef main():\n%s\n\nopen('%s', 'w').write( str(main()) )")
(defconst org-babel-python-pp-wrapper-method "\nimport pprint\ndef main():\n%s\n\nopen('%s', 'w').write( pprint.pformat(main()) )")
#@31 Evaluate BODY as Python code.
(defalias 'org-babel-python-evaluate #[(session body &optional result-type result-params preamble) "\203 \305	\n$\207\306	\n\f$\207" [session body result-type result-params preamble org-babel-python-evaluate-session org-babel-python-evaluate-external-process] 5 (#$ . 7269)])
#@207 Evaluate BODY in external python process.
If RESULT-TYPE equals 'output then return standard output as a
string.  If RESULT-TYPE equals 'value then return the value of the
last statement in BODY, as elisp.
(defalias 'org-babel-python-evaluate-external-process #[(body &optional result-type result-params preamble) "\306\307\"\203 \310	\n\205 \n\311PP\"\202T \306\312\"\205T \313\314!\310	\n\203- \n\311P\202. \315\316\317\235\203: %\202< &\320\321\322\323\324!!\325\"\311#\326\f\327\"#P\"\210\330\f!)'(\331(\235?\205\271 \332(\235\204\256 \333(\235\204\256 \334(\235\204\256 \335(\235\204\256 \317(\235\204\256 \336(\235\204\256 \337(\235\204\247 \340(\235\204\247 \341(\235\204\247 \342(\235\203\263 \343(\235\204\263 '\202\271 \344\324'!!*\207" [result-type org-babel-python-command preamble body tmp-file result-params eql output org-babel-eval "\n" value org-babel-temp-file "python-" "" format "pp" mapconcat #[(line) "\301\302\"\207" [line format "	%s"] 3] split-string org-remove-indentation org-babel-trim "[\n]" org-babel-process-file-name noquote org-babel-eval-read-file "none" "scalar" "verbatim" "html" "code" "file" "output" "raw" "org" "drawer" "table" org-babel-python-table-or-string org-babel-python-pp-wrapper-method org-babel-python-wrapper-method raw #1=#:--params] 11 (#$ . 7587)])
#@209 Pass BODY to the Python process in SESSION.
If RESULT-TYPE equals 'output then return standard output as a
string.  If RESULT-TYPE equals 'value then return the value of the
last statement in BODY, as elisp.
(defalias 'org-babel-python-evaluate-session #[(session body &optional result-type result-params) "\306\307\310\311\312\"\203\277 \313\314\315\316\f!\204 \317\320\f\"\210\321 \322\216r\fq\210\323:\324;\325<B<\326\211=>\327\330p!!b\210`d?\211@?{=@?|\210*\nA!\210 \210 \210Bc\210 \210Cb\210\212\331\332B!\326\333#\205x \331D\326\333#)\204\205 \334\330p!!\210\202b \327\330p!!b\210=c\210A\203\260 \335\336\337\340\332A\206\240 \324!#;\"\203\260 ;\341\225\326O>\342;D\".\343\"\337#\202f\311\344\"\205f\345\346!E\316\f!\204\326 \317\320\f\"\210\321 \347\216r\fq\210\350:\324;\351<B<\326\211=>\327\330p!!b\210`d?\211@?{=@?|\210*\326F\nA!\210	E\352G\235\"\210 \210 \210Bc\210 \210)Cb\210\212\331\332B!\326\333#\205@\331D\326\333#)\204M\334\330p!!\210\202*\327\330p!!b\210=c\210\342;D\"\210.\353E!)HB\354\355OH\230?\205\327GI\356I\235?\205\326\357I\235\204\315\360I\235\204\315\361I\235\204\315\362I\235\204\315\352I\235\204\315\363I\235\204\315\364I\235\204\306\365I\235\204\306\366I\235\204\306\367I\235\203\322\370I\235\204\322H\202\326\371H!),\207" [send-wait dump-last-value input-body result-type session save-match-data-internal #[nil "\300\301\302\"\210\303\304\305\"\207" [comint-send-input nil t sleep-for 0 5] 3] #[(tmp-file pp) "\302\303\203 \304\305\306\307	\310\"\"D\202 \305\311\307	\310\"\"C\"\207" [pp tmp-file mapc #[(statement) "c\210	 \207" [statement send-wait] 1] "import pprint" format "open('%s', 'w').write(pprint.pformat(_))" org-babel-process-file-name noquote "open('%s', 'w').write(str(_))"] 8] #[(body) "\302\303\304\305\"\"\210	 \207" [body send-wait mapc #[(line) "c\210	 \207" [line send-wait] 1] split-string "[\n]"] 5] eql output mapconcat org-babel-trim butlast org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) #[#1=(input) "\300\207" [nil] 1] "" #[#2=(text) "	P\211\207" [string-buffer text] 2] nil process-mark get-buffer-process re-search-forward regexp-quote t accept-process-output string-match replace-regexp-in-string "\n" "[\n]+" 0 split-string 2 value org-babel-temp-file "python-" ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) #[#1# "\300\207" [nil] 1] #[#2# "	P\211\207" [string-buffer text] 2] "pp" org-babel-eval-read-file 1 -1 "none" "scalar" "verbatim" "html" "code" "file" "output" "raw" "org" "drawer" "table" org-babel-python-table-or-string comint-input-filter string-buffer comint-output-filter-functions dangling-text raw end start body org-babel-python-eoe-indicator comint-last-input-end comint-prompt-regexp tmp-file comint-process-echoes result-params results #3=#:--params] 10 (#$ . 8927)])
#@37 Strip 's from around Python string.
(defalias 'org-babel-python-read-string #[(string) "\301\302\"\203\f \303\304\"\207\207" [string string-match "^'\\([^ ]+\\)'$" match-string 1] 3 (#$ . 11971)])
(provide 'ob-python)
