MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 18.117.158.174
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/emacs/24.3/lisp/org/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/emacs/24.3/lisp/org/ob-python.elc
;ELC
;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:06:43 2024
;;; from file /builddir/build/BUILD/emacs-24.3/lisp/org/ob-python.el
;;; in Emacs version 24.3.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\300\302!\210\300\303!\210\300\304!\210\305\306\307\"\207" [require ob ob-ref ob-comint ob-eval add-to-list org-babel-tangle-lang-exts ("python" . "py")] 3)
(defvar org-babel-default-header-args:python nil)
#@48 Name of the command for executing Python code.
(defvar org-babel-python-command "python" (#$ . 788))
#@119 Preferred python mode for use in running python interactively.
This will typically be either 'python or 'python-mode.
(defvar org-babel-python-mode 'python (#$ . 896))
#@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\316\f\2039\317\320\f\"\202:\321P\322!#\323	\n
%\324\325\307\326\"A\307\327\"A\"\325\307\330\"A\307\331\"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 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 body full-body result] 9 (#$ . 1071)])
#@105 Prepare SESSION according to the header arguments in PARAMS.
VARS contains resolved variable references
(defalias 'org-babel-prep-session:python #[(session params) "\304!\305	!\212\306 \307\216\310!\204\311\312\"\210q\210\313\314\n\"\210+*\207" [session params var-lines save-match-data-internal org-babel-python-initiate-session org-babel-variable-assignments:python match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" mapc #[(var) "\302\210c\210\303 \210\304	!\207" [var session 1 comint-send-input org-babel-comint-wait-for-output] 2]] 3 (#$ . 1878)])
#@25 Load BODY into SESSION.
(defalias 'org-babel-load-session:python #[(session body params) "\305 \306\216\307	\n\"rq\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 (#$ . 2577)])
#@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@\303A!#\207" [pair format "%s=%s" org-babel-python-var-to-python] 5] cdr org-babel-get-header :var] 7 (#$ . 2939)])
#@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\301\302\303\304#\305Q\207\306\232\203\307\207\310;\203'\311\312\"\203'\313\202(\314\"\207" [var "[" mapconcat org-babel-python-var-to-python ", " "]" hline "None" format string-match "[\n
]" "\"\"%S\"\"" "%S"] 5 (#$ . 3264)])
#@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) "\301!\207" [results org-babel-script-escape] 2 (#$ . 3718)])
(defvar org-babel-python-buffers '((:default)))
#@44 Return the buffer associated with SESSION.
(defalias 'org-babel-python-session-buffer #[(session) "\302	\"A\207" [session org-babel-python-buffers assoc] 3 (#$ . 4068)])
#@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!\314=\2039\315\316!\2039\317\320\f\"\2033\316
!\210\202w\316 \210\202w\321=\203s\315\322!\203s\323!\210\203\\\324!\203\\\325\326\327#\202a\330\331\n!P\211 \322 \210\332\332Q*\202w\333\334!\210\nB\335\n!\"B!\n,\207" [org-babel-python-mode #1=#:wconfig session python-buffer emacs-version org-babel-python-command require current-window-configuration ((set-window-configuration #1#)) intern :default org-babel-python-session-buffer python fboundp run-python version< "24.1" 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 py-default-interpreter bufname py-which-bufname org-babel-python-buffers] 5 (#$ . 4246)])
#@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 (#$ . 5316)])
#@53 A string to indicate that evaluation has completed.
(defvar org-babel-python-eoe-indicator "'org_babel_python_eoe'" (#$ . 5589))
(defvar org-babel-python-wrapper-method "\ndef main():\n%s\n\nopen('%s', 'w').write( str(main()) )")
(defvar 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 (#$ . 5955)])
#@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\203\n\311P\202\312P\"\202X\306\313\"\205X\314\315!\310	\n\2031\n\311P\2022\312\316\317
\235\203>\202@\320\321\322\323\324!!\325\"\311#\326\f\327\"#P\"\210\330\f!)\331
\235\204r\317
\235\204r\332
\235\203w\333
\235\204w\202}\334\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 "code" "output" "table" org-babel-python-table-or-string org-babel-python-pp-wrapper-method org-babel-python-wrapper-method raw] 11 (#$ . 6273)])
#@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\212\316 \317\216\320
!\204!\321\322
\"\210
q\210\323\324\211234\3255B5\326\216\327\330p!!b\210`d6\21176{376|\210*\n8!\210 \210 \2109c\210 \210:b\210\212\331\3329!\324\333#\205w\331;\324\333#)\204\204\334\330p!!\210\202a\327\330p!!b\2103c\210)8\203\260\335\336\337\340\3328\206\240\323!#4\"\203\2604\341\225\324O2\3424;\".\343\"\337#\202f\311\344\"\205f\345\346!<\212\316 \347\216\320
!\204\334\321\322
\"\210
q\210\323\324\211234\3505B5\351\216\327\330p!!b\210`d6\21176{376|\210*\324=\n8!\210	<\352>\235\"\210 \210 \2109c\210 \210):b\210\212\331\3329!\324\333#\205?\331;\324\333#)\204L\334\330p!!\210\202)\327\330p!!b\2103c\210)\3424;\"\210.\353<!)?9\354\355O?\230?\205\231\356>\235\204\220\352>\235\204\220\357>\235\203\225\360>\235\204\225?\202\231\361?!,\207" [send-wait dump-last-value input-body result-type save-match-data-internal session #[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 match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" "" nil #[#1=(text) "	P\211\207" [string-buffer text] 2] ((byte-code "A\301\207" [comint-output-filter-functions nil] 1)) 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# "	P\211\207" [string-buffer text] 2] ((byte-code "A\301\207" [comint-output-filter-functions nil] 1)) "pp" org-babel-eval-read-file 1 -1 "code" "output" "table" org-babel-python-table-or-string raw dangling-text string-buffer comint-output-filter-functions end start body org-babel-python-eoe-indicator comint-last-input-end comint-prompt-regexp tmp-file comint-process-echoes result-params results] 10 (#$ . 7372)])
#@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 (#$ . 10243)])
(provide 'ob-python)

MMCT - 2023