403Webshell
Server IP : 217.160.0.212  /  Your IP : 216.73.217.75
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1073854427 ( 1073854427)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/share/emacs/28.2/lisp/org/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/emacs/28.2/lisp/org/ob-python.elc
;ELC
;;; Compiled
;;; in Emacs version 28.2
;;; with all optimizations.



(byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\"\207" [require ob org-macs python 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\304DD\305\306\307\310\311\312\313\314\315&\210\300\316\302\303\317DD\320\312\313\306\307\310\321\314\322&\210\300\323\302\303\324DD\325\312\313\306\307\310\326\314\315&\210\300\327\302\303\330DD\331\312\313\306\307\310\332\314\322&\207" [custom-declare-variable org-babel-python-command funcall function #[0 "\300\207" ["python"] 1 #1=""] "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 #[0 "\300\301!\203\301\207\302\207" [featurep python-mode python] 2 #1#] "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 #[0 "\300\207" ["None"] 1 #1#] "Replace hlines in incoming tables with this when translating to python." (Org . "8.0") org-babel-python-None-to #[0 "\300\207" [hline] 1 #1#] "Replace `None' in python tables with this before returning." (Org . "8.0")] 12)
#@120 Execute a block of Python code with Babel.
This function is called by `org-babel-execute-src-block'.

(fn BODY PARAMS)
(defalias 'org-babel-execute:python #[514 "\301\236A\206\302\303\236A!\304\236A\305\236A\211\306=\205!\307\236A\310\236A\311!\312\313\n!#\205D\314\203A\315\202B\316\"P\317	&\320\321\322\f\236A\323
\236A\"\321\324
\236A\325\236A\"#)\207" [org-babel-python-command :python org-babel-python-initiate-session :session :result-params :result-type value :return :preamble org-babel-comint-use-async org-babel-expand-body:generic org-babel-variable-assignments:python format "\n%s" "\nreturn %s" org-babel-python-evaluate org-babel-reassemble-table org-babel-pick-name :colname-names :colnames :rowname-names :rownames] 17 (#$ . 1315)])
#@127 Prepare SESSION according to the header arguments in PARAMS.
VARS contains resolved variable references.

(fn SESSION PARAMS)
(defalias 'org-babel-prep-session:python #[514 "\301!\302!\303!\204\304\305\"\210\306 \307\310\"\216rq\210\212\311\312\307\313\"\"\210,\210\207" [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 make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] #[257 "\300\207" [nil] 2 "\n\n(fn INPUT)"] mapc #[257 "\301\210\211c\210\302 \210\303\300!\207" [V0 1 comint-send-input org-babel-comint-wait-for-output] 3 "\n\n(fn VAR)"]] 9 (#$ . 2113)])
#@51 Load BODY into SESSION.

(fn SESSION BODY PARAMS)
(defalias 'org-babel-load-session:python #[771 "\300 \301\302\"\216\303\"r\211q\210\304\305p!!b\210\306!c\210)\211\262)\207" [current-window-configuration make-closure #[0 "\301\300!\207" [V0 set-window-configuration] 2] org-babel-prep-session:python process-mark get-buffer-process org-babel-chomp] 8 (#$ . 2848)])
#@82 Return a list of Python statements assigning the block's variables.

(fn PARAMS)
(defalias 'org-babel-variable-assignments:python #[257 "\300\301\302!\"\207" [mapcar #[257 "\300\301@\302A!#\207" [format "%s=%s" org-babel-python-var-to-python] 6 "\n\n(fn PAIR)"] org-babel--get-vars] 5 (#$ . 3225)])
#@162 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.

(fn VAR)
(defalias 'org-babel-python-var-to-python #[257 "\211<\203\301\302\303\304#\305Q\207\211\306=\203\207\307;\203'\310\311\"\203'\312\202(\313;\2033\314!\2024\"\207" [org-babel-python-hline-to "[" mapconcat org-babel-python-var-to-python ", " "]" hline format string-match "[\n
]" "\"\"%S\"\"" "%S" substring-no-properties] 6 (#$ . 3534)])
#@192 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.

(fn RESULTS)
(defalias 'org-babel-python-table-or-string #[257 "\300!\211<\203
\301\302\"\207\207" [org-babel-script-escape mapcar #[257 "\211\301=\203\207\207" [org-babel-python-None-to None] 3 "\n\n(fn EL)"]] 5 (#$ . 4055)])
(defvar org-babel-python-buffers '((:default . "*Python*")))
#@58 Return the buffer associated with SESSION.

(fn SESSION)
(defalias 'org-babel-python-session-buffer #[257 "\301\"A\207" [org-babel-python-buffers assoc] 4 (#$ . 4533)])
#@16 

(fn SESSION)
(defalias 'org-babel-python-with-earmuffs #[257 "\211;\203	\211\202
\300\301\"\211\302\303O\304\230\203\"\211GS\305O\304\230\203\"\207\300\306\"\207" [format "%s" 0 1 "*" nil "*%s*"] 5 (#$ . 4710)])
#@16 

(fn SESSION)
(defalias 'org-babel-python-without-earmuffs #[257 "\211;\203	\211\202
\300\301\"\211\302\303O\304\230\203(\211GS\305O\304\230\203(\211\303GSO\207\207" [format "%s" 0 1 "*" nil] 5 (#$ . 4937)])
#@159 Initiate a python session.
If there is not a current inferior-process-buffer in SESSION
then create.  Return the initialized session.

(fn &optional SESSION)
(defalias 'org-babel-python-initiate-session-by-key #[256 "\306 \307\310\"\216\203\311!\202\312\313!\314>\203!	\315P\202\"	\n\316=\203B\2041\317!\262\320!\321!\210\322\323\324\"\210)\202\213\n\325=\203\207\326\327!\203\207\330\325!\210\331\f!\210\203h\332!\203h\333\334\335#\202m\336\337!P\211\317!\262\327\340\211\341	\340\211\341\340&	\210)\210\202\213\342\343!\210B\344%\"B%\266\203)\207" [system-type org-babel-python-command org-babel-python-mode python-shell-buffer-name py-default-interpreter py-which-bufname current-window-configuration make-closure #[0 "\301\300!\207" [V0 set-window-configuration] 2] intern :default org-babel-python-session-buffer (cygwin windows-nt ms-dos) " -i" python org-babel-python-with-earmuffs org-babel-python-without-earmuffs run-python sleep-for 0 10 python-mode fboundp py-shell require py-toggle-shells buffer-live-p replace-regexp-in-string "^\\*\\([^*]+\\)\\*$" "\\1" "Python-" symbol-name nil t error "No function available for running an inferior Python" assq-delete-all org-babel-python-buffers] 16 (#$ . 5160)])
#@84 Create a session named SESSION according to PARAMS.

(fn &optional SESSION PARAMS)
(defalias 'org-babel-python-initiate-session #[512 "\300\230?\205\f\301\302!!\207" ["none" org-babel-python-session-buffer org-babel-python-initiate-session-by-key] 5 (#$ . 6425)])
#@53 A string to indicate that evaluation has completed.
(defvar org-babel-python-eoe-indicator "org_babel_python_eoe" (#$ . 6698))
(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()) )")
#@136 Template for Python session command with output results.

Has a single %s escape, the tempfile containing the source code
to evaluate.
(defconst org-babel-python--exec-tmpfile "with open('%s') as __org_babel_python_tmpfile:\n    exec(compile(__org_babel_python_tmpfile.read(), __org_babel_python_tmpfile.name, 'exec'))" (#$ . 7067))
#@115 Return Python code to evaluate SRC-FILE and write result to RESULT-FILE.

(fn SRC-FILE RESULT-FILE RESULT-PARAMS)
(defalias 'org-babel-python-format-session-value #[771 "\300\301\302\303\"\302\303\"\304\235\203\305\202\306$\207" [format "import ast\nwith open('%s') as __org_babel_python_tmpfile:\n    __org_babel_python_ast = ast.parse(__org_babel_python_tmpfile.read())\n__org_babel_python_final = __org_babel_python_ast.body[-1]\nif isinstance(__org_babel_python_final, ast.Expr):\n    __org_babel_python_ast.body = __org_babel_python_ast.body[:-1]\n    exec(compile(__org_babel_python_ast, '<string>', 'exec'))\n    __org_babel_python_final = eval(compile(ast.Expression(\n        __org_babel_python_final.value), '<string>', 'eval'))\n    with open('%s', 'w') as __org_babel_python_tmpfile:\n        if %s:\n            import pprint\n            __org_babel_python_tmpfile.write(pprint.pformat(__org_babel_python_final))\n        else:\n            __org_babel_python_tmpfile.write(str(__org_babel_python_final))\nelse:\n    exec(compile(__org_babel_python_ast, '<string>', 'exec'))\n    __org_babel_python_final = None" org-babel-process-file-name noquote "pp" "True" "False"] 9 (#$ . 7407)])
#@101 Evaluate BODY as Python code.

(fn SESSION BODY &optional RESULT-TYPE RESULT-PARAMS PREAMBLE ASYNC)
(defalias 'org-babel-python-evaluate #[1538 "\203\211\203\300$\207\301$\207\302$\207" [org-babel-python-async-evaluate-session org-babel-python-evaluate-session org-babel-python-evaluate-external-process] 11 (#$ . 8621)])
#@29 

(fn BODY &optional COUNT)
(defalias 'org-babel-python--shift-right #[513 "\300\301\302\"r\211q\210\303\304\"\216\305 \210c\210eb\210m\2048\306 \3078\205%\3108\262\2042\311\312 \313 #\210\314y\210\202\315 *\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	\302\300!\207" [V0 buffer-name kill-buffer] 2] python-mode syntax-ppss 3 8 python-indent-shift-right line-beginning-position line-end-position 1 buffer-string] 7 (#$ . 8974)])
#@265 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.

(fn BODY &optional RESULT-TYPE RESULT-PARAMS PREAMBLE)
(defalias 'org-babel-python-evaluate-external-process #[1025 "\303\267\202B\304\211\205\305Q\"\202C\306\307!\304\211\205 \305\310\311\235\203,	\202-\n\312!\313\314\"#Q\"\210\315!\262\202C\316\317\235?\205\245\320\235\204\214\321\235\204\214\322\235\204\214\323\235\204\214\311\235\204\214\324\235\204\214\325\235\204\206\326\235\204\206\327\235\204\206\330\235\203\215\331\235\204\215\207\332\316\333\203\231\334\202\232\335\336\333\337\336##\266\202!\207" [org-babel-python-command org-babel-python-pp-wrapper-method org-babel-python-wrapper-method #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (output 6 value 21)) org-babel-eval "\n" org-babel-temp-file "python-" format "pp" org-babel-python--shift-right org-babel-process-file-name noquote org-babel-eval-read-file nil "none" "scalar" "verbatim" "html" "code" "file" "output" "raw" "org" "drawer" "table" org-babel-python-table-or-string replace-regexp-in-string "\\`\\([ 	]*\n\\)+" "\\`[ 	\n
]+" "" "[ 	\n
]+\\'"] 15 (#$ . 9447)])
#@79 Pass BODY to the Python process in SESSION.
Return output.

(fn SESSION BODY)
(defalias 'org-babel-python--send-string #[514 "rq\210\304C\305\306\"B\307\310\311\312\"	#\n\313=\204'\314!\315!\210)\2023\316\313!\210\317\320!\"\210\321	\242\"\204D\322\320p!!\210\2023\323\242\324\211\224O!)\266\202)\207" [comint-output-filter-functions org-babel-python-eoe-indicator org-babel-python-mode python-shell-buffer-name "" make-closure #[257 "\300\211\242P\240\207" [V0] 4 "\n\n(fn TEXT)"] format "try:\n%s\nexcept:\n    raise\nfinally:\n    print('%s')" org-babel-python--shift-right 4 python-mode org-babel-python-without-earmuffs python-shell-send-string require py-shell-send-string get-buffer-process string-match accept-process-output org-babel-chomp 0] 8 (#$ . 10796)])
#@266 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.

(fn SESSION BODY &optional RESULT-TYPE RESULT-PARAMS)
(defalias 'org-babel-python-evaluate-session #[1026 "\301\302!\303\304\305\"\306\307\"\216r\211q\210c\210)r\211q\210\310\311\211\311\312%\210*\210\313\267\202T\314\315\316\"\"\317\"\262\202U\301\302!\320#\317\"\210\321\312\322\"\210\323!\266\202\202U\311\324\235?\205\242\325\235\204\236\326\235\204\236\327\235\204\236\330\235\204\236\331\235\204\236\332\235\204\236\333\235\204\230\334\235\204\230\335\235\204\230\336\235\203\237\337\235\204\237\207\340!\207" [org-babel-python--exec-tmpfile org-babel-temp-file "python-" generate-new-buffer " *temp file*" t make-closure #[0 "\301\300!\205	\302\300!\207" [V0 buffer-name kill-buffer] 2] write-region nil 0 #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (output 40 value 57)) format org-babel-process-file-name noquote org-babel-python--send-string org-babel-python-format-session-value sleep-for 10 org-babel-eval-read-file "none" "scalar" "verbatim" "html" "code" "pp" "file" "output" "raw" "org" "drawer" "table" org-babel-python-table-or-string] 12 (#$ . 11590)])
#@52 Strip \='s from around Python string.

(fn STRING)
(defalias 'org-babel-python-read-string #[257 "\300\301\"\203\302\301\"\203\211\303\304O\207\207" [string-prefix-p "'" string-suffix-p 1 -1] 4 (#$ . 12965)])
(defconst org-babel-python-async-indicator "print ('ob_comint_async_python_%s_%s')")
#@24 

(fn PARAMS TMP-FILE)
(defalias 'org-babel-python-async-value-callback #[514 "\300\236A\301!\302\235?\205T\303\235\204P\304\235\204P\305\235\204P\306\235\204P\307\235\204P\310\235\204P\311\235\204J\312\235\204J\313\235\204J\314\235\203Q\315\235\204Q\207\316!\207" [:result-params org-babel-eval-read-file "none" "scalar" "verbatim" "html" "code" "pp" "file" "output" "raw" "org" "drawer" "table" org-babel-python-table-or-string] 6 (#$ . 13271)])
#@198 Asynchronously evaluate BODY in SESSION.
Returns a placeholder string for insertion, to later be replaced
by `org-babel-comint-async-filter'.

(fn SESSION BODY &optional RESULT-TYPE RESULT-PARAMS)
(defalias 'org-babel-python-async-evaluate-session #[1026 "\302p\303\304\305%\210\306!\307\267\202\227\310\311\312\313!!!\314\315\316\"r\211q\210\317\320\"\216\321	\322#c\210\323c\210c\210\323c\210\321	\324#c\210\325 \210*\210\211\262\202\230\326\327!\326\327!\314\330\316\"\317\331\"\216r\211q\210c\210)r\211q\210\332\333\211\333\334%\210*\210\314\315\316\"r\211q\210\317\335\"\216\336#c\210\323c\210\321	\337#c\210\325 \210*\210\266\202\202\230\333)\207" [python-shell-buffer-name org-babel-python-async-indicator org-babel-comint-async-register "ob_comint_async_python_\\(.+\\)_\\(.+\\)" org-babel-chomp org-babel-python-async-value-callback org-babel-python-without-earmuffs #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (output 18 value 72)) md5 number-to-string random 100000000 generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	\302\300!\207" [V0 buffer-name kill-buffer] 2] format "start" "\n" "end" python-shell-send-buffer org-babel-temp-file "python-" " *temp file*" #[0 "\301\300!\205	\302\300!\207" [V0 buffer-name kill-buffer] 2] write-region nil 0 #[0 "\301\300!\205	\302\300!\207" [V0 buffer-name kill-buffer] 2] org-babel-python-format-session-value "file"] 13 (#$ . 13753)])
(provide 'ob-python)

Youez - 2016 - github.com/yon3zu
LinuXploit