File: RcppExports.R

package info (click to toggle)
r-cran-reticulate 1.41.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,088 kB
  • sloc: cpp: 5,154; python: 620; sh: 13; makefile: 2
file content (375 lines) | stat: -rw-r--r-- 9,511 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

write_stdout <- function(text) {
    .Call(`_reticulate_write_stdout`, text)
}

write_stderr <- function(text) {
    .Call(`_reticulate_write_stderr`, text)
}

is_python3 <- function() {
    .Call(`_reticulate_is_python3`)
}

was_python_initialized_by_reticulate <- function() {
    .Call(`_reticulate_was_python_initialized_by_reticulate`)
}

#' Check if a Python object is a null externalptr
#'
#' @param x Python object
#'
#' @return Logical indicating whether the object is a null externalptr
#'
#' @details When Python objects are serialized within a persisted R
#'  environment (e.g. .RData file) they are deserialized into null
#'  externalptr objects (since the Python session they were originally
#'  connected to no longer exists). This function allows you to safely
#'  check whether whether a Python object is a null externalptr.
#'
#'  The `py_validate` function is a convenience function which calls
#'  `py_is_null_xptr` and throws an error in the case that the xptr
#'  is `NULL`.
#'
#' @export
py_is_null_xptr <- function(x) {
    .Call(`_reticulate_py_is_null_xptr`, x)
}

#' @rdname py_is_null_xptr
#' @export
py_validate_xptr <- function(x) {
    invisible(.Call(`_reticulate_py_validate_xptr`, x))
}

py_flush_output <- function() {
    .Call(`_reticulate_py_flush_output`)
}

conditionMessage_from_py_exception <- function(exc) {
    .Call(`_reticulate_conditionMessage_from_py_exception`, exc)
}

py_none_impl <- function() {
    .Call(`_reticulate_py_none_impl`)
}

py_is_callable <- function(x) {
    .Call(`_reticulate_py_is_callable`, x)
}

#' Check if x is a Python object
#'
#' Checks if `x` is a Python object, more efficiently
#' than `inherits(x, "python.builtin.object")`.
#'
#' @param x An \R or Python.
#'
#' @return \code{TRUE} or \code{FALSE}.
#' @export
#' @keywords internal
is_py_object <- function(x) {
    .Call(`_reticulate_is_py_object`, x)
}

py_to_r_cpp <- function(x) {
    .Call(`_reticulate_py_to_r_cpp`, x)
}

py_get_formals <- function(callable) {
    .Call(`_reticulate_py_get_formals`, callable)
}

r_to_py_impl <- function(object, convert) {
    .Call(`_reticulate_r_to_py_impl`, object, convert)
}

install_interrupt_handlers <- function() {
    invisible(.Call(`_reticulate_install_interrupt_handlers`))
}

py_activate_virtualenv <- function(script) {
    invisible(.Call(`_reticulate_py_activate_virtualenv`, script))
}

main_process_python_info <- function() {
    .Call(`_reticulate_main_process_python_info`)
}

py_clear_error <- function() {
    invisible(.Call(`_reticulate_py_clear_error`))
}

py_initialize <- function(python, libpython, pythonhome, virtualenv_activate, python_major_version, python_minor_version, interactive, numpy_load_error) {
    invisible(.Call(`_reticulate_py_initialize`, python, libpython, pythonhome, virtualenv_activate, python_major_version, python_minor_version, interactive, numpy_load_error))
}

py_finalize <- function() {
    invisible(.Call(`_reticulate_py_finalize`))
}

py_is_none <- function(x) {
    .Call(`_reticulate_py_is_none`, x)
}

py_compare_impl <- function(a, b, op) {
    .Call(`_reticulate_py_compare_impl`, a, b, op)
}

py_str_impl <- function(x) {
    .Call(`_reticulate_py_str_impl`, x)
}

#' @export
#' @rdname py_str
py_repr <- function(object) {
    .Call(`_reticulate_py_repr`, object)
}

py_print <- function(x) {
    invisible(.Call(`_reticulate_py_print`, x))
}

py_is_function <- function(x) {
    .Call(`_reticulate_py_is_function`, x)
}

py_numpy_available_impl <- function() {
    .Call(`_reticulate_py_numpy_available_impl`)
}

py_list_attributes_impl <- function(x) {
    .Call(`_reticulate_py_list_attributes_impl`, x)
}

py_get_convert <- function(x) {
    .Call(`_reticulate_py_get_convert`, x)
}

py_set_convert <- function(x, value) {
    .Call(`_reticulate_py_set_convert`, x, value)
}

py_new_ref <- function(x, convert) {
    .Call(`_reticulate_py_new_ref`, x, convert)
}

#' Check if a Python object has an attribute
#'
#' Check whether a Python object \code{x} has an attribute
#' \code{name}.
#'
#' @param x A python object.
#' @param name The attribute to be accessed.
#'
#' @return \code{TRUE} if the object has the attribute \code{name}, and
#'   \code{FALSE} otherwise.
#' @export
py_has_attr <- function(x, name) {
    .Call(`_reticulate_py_has_attr`, x, name)
}

#' Get an attribute of a Python object
#'
#' @param x Python object
#' @param name Attribute name
#' @param silent \code{TRUE} to return \code{NULL} if the attribute
#'  doesn't exist (default is \code{FALSE} which will raise an error)
#'
#' @return Attribute of Python object
#' @export
py_get_attr <- function(x, name, silent = FALSE) {
    .Call(`_reticulate_py_get_attr`, x, name, silent)
}

#' Set an attribute of a Python object
#'
#' @param x Python object
#' @param name Attribute name
#' @param value Attribute value
#'
#' @export
py_set_attr <- function(x, name, value) {
    invisible(.Call(`_reticulate_py_set_attr`, x, name, value))
}

#' Delete an attribute of a Python object
#'
#' @param x A Python object.
#' @param name The attribute name.
#'
#' @export
py_del_attr <- function(x, name) {
    invisible(.Call(`_reticulate_py_del_attr`, x, name))
}

#' @rdname py_get_item
#' @export
py_get_item <- function(x, key, silent = FALSE) {
    .Call(`_reticulate_py_get_item`, x, key, silent)
}

#' @rdname py_get_item
#' @export
py_set_item <- function(x, key, value) {
    invisible(.Call(`_reticulate_py_set_item`, x, key, value))
}

#' @rdname py_get_item
#' @export
py_del_item <- function(x, key) {
    invisible(.Call(`_reticulate_py_del_item`, x, key))
}

py_get_attr_types <- function(x, attrs, resolve_properties = FALSE) {
    .Call(`_reticulate_py_get_attr_types`, x, attrs, resolve_properties)
}

py_ref_to_r_with_convert <- function(x, convert) {
    .Call(`_reticulate_py_ref_to_r_with_convert`, x, convert)
}

py_ref_to_r <- function(x) {
    .Call(`_reticulate_py_ref_to_r`, x)
}

py_call_impl <- function(x, args = NULL, keywords = NULL) {
    .Call(`_reticulate_py_call_impl`, x, args, keywords)
}

py_dict_impl <- function(keys, items, convert) {
    .Call(`_reticulate_py_dict_impl`, keys, items, convert)
}

py_dict_get_item <- function(dict, key) {
    .Call(`_reticulate_py_dict_get_item`, dict, key)
}

py_dict_set_item <- function(dict, key, val) {
    invisible(.Call(`_reticulate_py_dict_set_item`, dict, key, val))
}

py_dict_length <- function(dict) {
    .Call(`_reticulate_py_dict_length`, dict)
}

py_dict_get_keys <- function(dict) {
    .Call(`_reticulate_py_dict_get_keys`, dict)
}

py_dict_get_keys_as_str <- function(dict) {
    .Call(`_reticulate_py_dict_get_keys_as_str`, dict)
}

py_tuple <- function(items, convert) {
    .Call(`_reticulate_py_tuple`, items, convert)
}

py_tuple_length <- function(tuple) {
    .Call(`_reticulate_py_tuple_length`, tuple)
}

py_module_import <- function(module, convert) {
    .Call(`_reticulate_py_module_import`, module, convert)
}

py_module_proxy_import <- function(proxy) {
    invisible(.Call(`_reticulate_py_module_proxy_import`, proxy))
}

py_list_submodules <- function(module) {
    .Call(`_reticulate_py_list_submodules`, module)
}

py_run_string_impl <- function(code, local = FALSE, convert = TRUE) {
    .Call(`_reticulate_py_run_string_impl`, code, local, convert)
}

py_run_file_impl <- function(file, local = FALSE, convert = TRUE) {
    .Call(`_reticulate_py_run_file_impl`, file, local, convert)
}

py_eval_impl <- function(code, convert = TRUE) {
    .Call(`_reticulate_py_eval_impl`, code, convert)
}

py_convert_pandas_series <- function(series_) {
    .Call(`_reticulate_py_convert_pandas_series`, series_)
}

py_convert_pandas_df <- function(df) {
    .Call(`_reticulate_py_convert_pandas_df`, df)
}

r_convert_dataframe <- function(dataframe, convert) {
    .Call(`_reticulate_r_convert_dataframe`, dataframe, convert)
}

r_convert_date <- function(dates, convert) {
    .Call(`_reticulate_r_convert_date`, dates, convert)
}

py_list_length <- function(x) {
    .Call(`_reticulate_py_list_length`, x)
}

py_len_impl <- function(x, defaultValue = NULL) {
    .Call(`_reticulate_py_len_impl`, x, defaultValue)
}

py_bool_impl <- function(x, silent = FALSE) {
    .Call(`_reticulate_py_bool_impl`, x, silent)
}

py_has_method <- function(object, name) {
    .Call(`_reticulate_py_has_method`, object, name)
}

#' Unique identifer for Python object
#'
#' Get a globally unique identifier for a Python object.
#'
#' @note In the current implementation of CPython this is the
#'  memory address of the object.
#'
#' @param object Python object
#'
#' @return Unique identifer (as string) or `NULL`
#'
#' @export
py_id <- function(object) {
    .Call(`_reticulate_py_id`, object)
}

py_capsule <- function(x) {
    .Call(`_reticulate_py_capsule`, x)
}

py_slice <- function(start = NULL, stop = NULL, step = NULL) {
    .Call(`_reticulate_py_slice`, start, stop, step)
}

#' @rdname iterate
#' @export
as_iterator <- function(x) {
    .Call(`_reticulate_as_iterator`, x)
}

py_iter_next <- function(iterator, completed) {
    .Call(`_reticulate_py_iter_next`, iterator, completed)
}

py_iterate <- function(x, f, simplify = TRUE) {
    .Call(`_reticulate_py_iterate`, x, f, simplify)
}

py_allow_threads_impl <- function(allow = TRUE) {
    .Call(`_reticulate_py_allow_threads_impl`, allow)
}

readline <- function(prompt) {
    .Call(`_reticulate_readline`, prompt)
}