Search is not available for this dataset
text stringlengths 75 104k |
|---|
def getargspec_permissive(func):
"""
An `inspect.getargspec` with a relaxed sanity check to support Cython.
Motivation:
A Cython-compiled function is *not* an instance of Python's
types.FunctionType. That is the sanity check the standard Py2
library uses in `inspect.getargspec()`.... |
def dispatch(parser, argv=None, add_help_command=True,
completion=True, pre_call=None,
output_file=sys.stdout, errors_file=sys.stderr,
raw_output=False, namespace=None,
skip_unknown_args=False):
"""
Parses given list of arguments using given parser, calls the ... |
def _execute_command(function, namespace_obj, errors_file, pre_call=None):
"""
Assumes that `function` is a callable. Tries different approaches
to call it (with `namespace_obj` or with ordinary signature).
Yields the results line by line.
If :class:`~argh.exceptions.CommandError` is raised, its m... |
def dispatch_command(function, *args, **kwargs):
"""
A wrapper for :func:`dispatch` that creates a one-command parser.
Uses :attr:`PARSER_FORMATTER`.
This::
dispatch_command(foo)
...is a shortcut for::
parser = ArgumentParser()
set_default_command(parser, foo)
dis... |
def dispatch_commands(functions, *args, **kwargs):
"""
A wrapper for :func:`dispatch` that creates a parser, adds commands to
the parser and dispatches them.
Uses :attr:`PARSER_FORMATTER`.
This::
dispatch_commands([foo, bar])
...is a shortcut for::
parser = ArgumentParser()
... |
def safe_input(prompt):
"""
Prompts user for input. Correctly handles prompt message encoding.
"""
if sys.version_info < (3,0):
if isinstance(prompt, compat.text_type):
# Python 2.x: unicode → bytes
encoding = locale.getpreferredencoding() or 'utf-8'
prompt ... |
def encode_output(value, output_file):
"""
Encodes given value so it can be written to given file object.
Value may be Unicode, binary string or any other data type.
The exact behaviour depends on the Python version:
Python 3.x
`sys.stdout` is a `_io.TextIOWrapper` instance that accepts ... |
def dump(raw_data, output_file):
"""
Writes given line to given output file.
See :func:`encode_output` for details.
"""
data = encode_output(raw_data, output_file)
output_file.write(data) |
def autocomplete(parser):
"""
Adds support for shell completion via argcomplete_ by patching given
`argparse.ArgumentParser` (sub)class.
If completion is not enabled, logs a debug-level message.
"""
if COMPLETION_ENABLED:
argcomplete.autocomplete(parser)
elif 'bash' in os.getenv('SH... |
def parse_args(self, args=None, namespace=None):
"""
Wrapper for :meth:`argparse.ArgumentParser.parse_args`. If `namespace`
is not defined, :class:`argh.dispatching.ArghNamespace` is used.
This is required for functions to be properly used as commands.
"""
namespace = na... |
def _expand_help(self, action):
"""
This method is copied verbatim from ArgumentDefaultsHelpFormatter with
a couple of lines added just before the end. Reason: we need to
`repr()` default values instead of simply inserting them as is.
This helps notice, for example, an empty str... |
def _guess(kwargs):
"""
Adds types, actions, etc. to given argument specification.
For example, ``default=3`` implies ``type=int``.
:param arg: a :class:`argh.utils.Arg` instance
"""
guessed = {}
# Parser actions that accept argument 'type'
TYPE_AWARE_ACTIONS = 'store', 'append'
#... |
def set_default_command(parser, function):
"""
Sets default command (i.e. a function) for given parser.
If `parser.description` is empty and the function has a docstring,
it is used as the description.
.. note::
An attempt to set default command to a parser which already has
subpars... |
def add_commands(parser, functions, namespace=None, namespace_kwargs=None,
func_kwargs=None,
# deprecated args:
title=None, description=None, help=None):
"""
Adds given functions as commands to given parser.
:param parser:
an :class:`argparse.Argu... |
def add_subcommands(parser, namespace, functions, **namespace_kwargs):
"""
A wrapper for :func:`add_commands`.
These examples are equivalent::
add_commands(parser, [get, put], namespace='db',
namespace_kwargs={
'title': 'database commands',
... |
def get_subparsers(parser, create=False):
"""
Returns the :class:`argparse._SubParsersAction` instance for given
:class:`ArgumentParser` instance as would have been returned by
:meth:`ArgumentParser.add_subparsers`. The problem with the latter is that
it only works once and raises an exception on th... |
def get_arg_spec(function):
"""
Returns argument specification for given function. Omits special
arguments of instance methods (`self`) and static methods (usually `cls`
or something like this).
"""
while hasattr(function, '__wrapped__'):
function = function.__wrapped__
spec = compa... |
def named(new_name):
"""
Sets given string as command name instead of the function name.
The string is used verbatim without further processing.
Usage::
@named('load')
def do_load_some_stuff_and_keep_the_original_function_name(args):
...
The resulting command will be a... |
def aliases(*names):
"""
Defines alternative command name(s) for given function (along with its
original name). Usage::
@aliases('co', 'check')
def checkout(args):
...
The resulting command will be available as ``checkout``, ``check`` and ``co``.
.. note::
This... |
def arg(*args, **kwargs):
"""
Declares an argument for given function. Does not register the function
anywhere, nor does it modify the function in any way.
The signature of the decorator matches that of
:meth:`argparse.ArgumentParser.add_argument`, only some keywords are not
required if they ca... |
def wrap_errors(errors=None, processor=None, *args):
"""
Decorator. Wraps given exceptions into
:class:`~argh.exceptions.CommandError`. Usage::
@wrap_errors([AssertionError])
def foo(x=None, y=None):
assert x or y, 'x or y must be specified'
If the assertion fails, its mess... |
def confirm(action, default=None, skip=False):
"""
A shortcut for typical confirmation prompt.
:param action:
a string describing the action, e.g. "Apply changes". A question mark
will be appended.
:param default:
`bool` or `None`. Determines what happens when user hits :kbd:... |
def select(self, *column_names, **kwargs):
'''
Select the provided column names from the model, do not return an entity,
do not involve the rom session, just get the raw and/or processed column
data from Redis.
Keyword-only arguments:
* *include_pk=False* - whether ... |
def replace(self, **kwargs):
'''
Copy the Query object, optionally replacing the filters, order_by, or
limit information on the copy. This is mostly an internal detail that
you can ignore.
'''
data = {
'model': self._model,
'filters': self._filters... |
def filter(self, **kwargs):
'''
Only columns/attributes that have been specified as having an index with
the ``index=True`` option on the column definition can be filtered with
this method. Prefix, suffix, and pattern match filters must be provided
using the ``.startswith()``, ``... |
def startswith(self, **kwargs):
'''
When provided with keyword arguments of the form ``col=prefix``, this
will limit the entities returned to those that have a word with the
provided prefix in the specified column(s). This requires that the
``prefix=True`` option was provided dur... |
def endswith(self, **kwargs):
'''
When provided with keyword arguments of the form ``col=suffix``, this
will limit the entities returned to those that have a word with the
provided suffix in the specified column(s). This requires that the
``suffix=True`` option was provided durin... |
def like(self, **kwargs):
'''
When provided with keyword arguments of the form ``col=pattern``, this
will limit the entities returned to those that include the provided
pattern. Note that 'like' queries require that the ``prefix=True``
option must have been provided as part of th... |
def order_by(self, column):
'''
When provided with a column name, will sort the results of your query::
# returns all users, ordered by the created_at column in
# descending order
User.query.order_by('-created_at').execute()
'''
cname = column.lstrip(... |
def count(self):
'''
Will return the total count of the objects that match the specified
filters.::
# counts the number of users created in the last 24 hours
User.query.filter(created_at=(time.time()-86400, time.time())).count()
'''
filters = self._filter... |
def iter_result(self, timeout=30, pagesize=100, no_hscan=False):
'''
Iterate over the results of your query instead of getting them all with
`.all()`. Will only perform a single query. If you expect that your
processing will take more than 30 seconds to process 100 items, you
sho... |
def cached_result(self, timeout):
'''
This will execute the query, returning the key where a ZSET of your
results will be stored for pagination, further operations, etc.
The timeout must be a positive integer number of seconds for which to
set the expiration time on the key (thi... |
def first(self):
'''
Returns only the first result from the query, if any.
'''
lim = [0, 1]
if self._limit:
lim[0] = self._limit[0]
if not self._filters and not self._order_by:
for ent in self:
return ent
return None
... |
def delete(self, blocksize=100):
'''
Will delete the entities that match at the time the query is executed.
Used like::
MyModel.query.filter(email=...).delete()
MyModel.query.endswith(email='@host.com').delete()
.. warning:: can't be used on models on either si... |
def _on_delete(ent):
'''
This function handles all on_delete semantics defined on OneToMany columns.
This function only exists because 'cascade' is *very* hard to get right.
'''
seen_d = set([ent._pk])
to_delete = [ent]
seen_s = set()
to_save = []
def _set_default(ent, attr, de=NUL... |
def redis_prefix_lua(conn, dest, index, prefix, is_first, pattern=None):
'''
Performs the actual prefix, suffix, and pattern match operations.
'''
tkey = '%s:%s'%(index.partition(':')[0], uuid.uuid4())
start, end = _start_end(prefix)
return _redis_prefix_lua(conn,
[dest, tkey, index],
... |
def estimate_work_lua(conn, index, prefix):
'''
Estimates the total work necessary to calculate the prefix match over the
given index with the provided prefix.
'''
if index.endswith(':idx'):
args = [] if not prefix else list(prefix)
if args:
args[0] = '-inf' if args[0] is... |
def search(self, conn, filters, order_by, offset=None, count=None, timeout=None):
'''
Search for model ids that match the provided filters.
Arguments:
* *filters* - A list of filters that apply to the search of one of
the following two forms:
1. ``'co... |
def count(self, conn, filters):
'''
Returns the count of the items that match the provided filters.
For the meaning of what the ``filters`` argument means, see the
``.search()`` method docs.
'''
pipe, intersect, temp_id = self._prepare(conn, filters)
pipe.zcard(t... |
def _connect(obj):
'''
Tries to get the _conn attribute from a model. Barring that, gets the
global default connection using other methods.
'''
from .columns import MODELS
if isinstance(obj, MODELS['Model']):
obj = obj.__class__
if hasattr(obj, '_conn'):
return obj._conn
... |
def FULL_TEXT(val):
'''
This is a basic full-text index keygen function. Words are lowercased, split
by whitespace, and stripped of punctuation from both ends before an inverted
index is created for term searching.
'''
if isinstance(val, float):
val = repr(val)
elif val in (None, '')... |
def SIMPLE(val):
'''
This is a basic case-sensitive "sorted order" index keygen function for
strings. This will return a value that is suitable to be used for ordering
by a 7-byte prefix of a string (that is 7 characters from a byte-string, and
1.75-7 characters from a unicode string, depending on c... |
def IDENTITY(val):
'''
This is a basic "equality" index keygen, primarily meant to be used for
things like::
Model.query.filter(col='value')
Where ``FULL_TEXT`` would transform a sentence like "A Simple Sentence" into
an inverted index searchable by the words "a", "simple", and/or "sentenc... |
def refresh_indices(model, block_size=100):
'''
This utility function will iterate over all entities of a provided model,
refreshing their indices. This is primarily useful after adding an index
on a column.
Arguments:
* *model* - the model whose entities you want to reindex
* *blo... |
def clean_old_index(model, block_size=100, **kwargs):
'''
This utility function will clean out old index data that was accidentally
left during item deletion in rom versions <= 0.27.0 . You should run this
after you have upgraded all of your clients to version 0.28.0 or later.
Arguments:
*... |
def show_progress(job):
'''
This utility function will print the progress of a passed iterator job as
started by ``refresh_indices()`` and ``clean_old_index()``.
Usage example::
class RomTest(Model):
pass
for i in xrange(1000):
RomTest().save()
util.sh... |
def _script_load(script):
'''
Borrowed/modified from my book, Redis in Action:
https://github.com/josiahcarlson/redis-in-action/blob/master/python/ch11_listing_source.py
Used for Lua scripting support when writing against Redis 2.6+ to allow
for multiple unique columns per model.
'''
script... |
def EntityLock(entity, acquire_timeout, lock_timeout):
'''
Useful when you want exclusive access to an entity across all writers.::
# example
import rom
class Document(rom.Model):
owner = rom.ManyToOne('User', on_delete='restrict')
...
def change_owner(... |
def add(self, obj):
'''
Adds an entity to the session.
'''
if self.null_session:
return
self._init()
pk = obj._pk
if not pk.endswith(':None'):
self.known[pk] = obj
self.wknown[pk] = obj |
def forget(self, obj):
'''
Forgets about an entity (automatically called when an entity is
deleted). Call this to ensure that an entity that you've modified is
not automatically saved on ``session.commit()`` .
'''
self._init()
self.known.pop(obj._pk, None)
... |
def get(self, pk):
'''
Fetches an entity from the session based on primary key.
'''
self._init()
return self.known.get(pk) or self.wknown.get(pk) |
def flush(self, full=False, all=False, force=False):
'''
Call ``.save()`` on all modified entities in the session. Use when you
want to flush changes to Redis, but don't want to lose your local
session cache.
See the ``.commit()`` method for arguments and their meanings.
... |
def commit(self, full=False, all=False, force=False):
'''
Call ``.save()`` on all modified entities in the session. Also forgets
all known entities in the session, so this should only be called at
the end of a request.
Arguments:
* *full* - pass ``True`` to force sa... |
def save(self, *objects, **kwargs):
'''
This method is an alternate API for saving many entities (possibly not
tracked by the session). You can call::
session.save(obj)
session.save(obj1, obj2, ...)
session.save([obj1, obj2, ...])
And the entities wi... |
def delete(self, *objects, **kwargs):
'''
This method offers the ability to delete multiple entities in a single
round trip to Redis (assuming your models are all stored on the same
server). You can call::
session.delete(obj)
session.delete(obj1, obj2, ...)
... |
def refresh(self, *objects, **kwargs):
'''
This method is an alternate API for refreshing many entities (possibly
not tracked by the session). You can call::
session.refresh(obj)
session.refresh(obj1, obj2, ...)
session.refresh([obj1, obj2, ...])
And... |
def refresh_all(self, *objects, **kwargs):
'''
This method is an alternate API for refreshing all entities tracked
by the session. You can call::
session.refresh_all()
session.refresh_all(force=True)
And all entities known by the session will be reloaded from Re... |
def redis_writer_lua(conn, pkey, namespace, id, unique, udelete, delete,
data, keys, scored, prefix, suffix, geo, old_data, is_delete):
'''
... Actually write data to Redis. This is an internal detail. Please don't
call me directly.
'''
ldata = []
for pair in data.items():
... |
def save(self, full=False, force=False):
'''
Saves the current entity to Redis. Will only save changed data by
default, but you can force a full save by passing ``full=True``.
If the underlying entity was deleted and you want to re-save the entity,
you can pass ``force=True`` to... |
def delete(self, **kwargs):
'''
Deletes the entity immediately. Also performs any on_delete operations
specified as part of column definitions.
'''
if kwargs.get('skip_on_delete_i_really_mean_it') is not SKIP_ON_DELETE:
# handle the pre-commit hook
self._b... |
def copy(self):
'''
Creates a shallow copy of the given entity (any entities that can be
retrieved from a OneToMany relationship will not be copied).
'''
x = self.to_dict()
x.pop(self._pkey)
return self.__class__(**x) |
def get(cls, ids):
'''
Will fetch one or more entities of this type from the session or
Redis.
Used like::
MyModel.get(5)
MyModel.get([1, 6, 2, 4])
Passing a list or a tuple will return multiple entities, in the same
order that the ids were pass... |
def get_by(cls, **kwargs):
'''
This method offers a simple query method for fetching entities of this
type via attribute numeric ranges (such columns must be ``indexed``),
or via ``unique`` columns.
Some examples::
user = User.get_by(email_address='user@domain.com')... |
def update(self, *args, **kwargs):
'''
Updates multiple attributes in a model. If ``args`` are provided, this
method will assign attributes in the order returned by
``list(self._columns)`` until one or both are exhausted.
If ``kwargs`` are provided, this method will assign attri... |
def dump(obj, file, reducers=None, protocol=None):
'''Replacement for pickle.dump() using _LokyPickler.'''
global _LokyPickler
_LokyPickler(file, reducers=reducers, protocol=protocol).dump(obj) |
def register(cls, type, reduce_func):
"""Attach a reducer function to a given type in the dispatch table."""
if sys.version_info < (3,):
# Python 2 pickler dispatching is not explicitly customizable.
# Let us use a closure to workaround this limitation.
def dispatcher... |
def _sem_open(name, value=None):
""" Construct or retrieve a semaphore with the given name
If value is None, try to retrieve an existing named semaphore.
Else create a new semaphore with the given value
"""
if value is None:
handle = pthread.sem_open(ctypes.c_char_p(name), 0)
else:
... |
def cpu_count():
"""Return the number of CPUs the current process can use.
The returned number of CPUs accounts for:
* the number of CPUs in the system, as given by
``multiprocessing.cpu_count``;
* the CPU affinity settings of the current process
(available with Python 3.4+ on some Unix... |
def Queue(self, maxsize=0, reducers=None):
'''Returns a queue object'''
from .queues import Queue
return Queue(maxsize, reducers=reducers,
ctx=self.get_context()) |
def SimpleQueue(self, reducers=None):
'''Returns a queue object'''
from .queues import SimpleQueue
return SimpleQueue(reducers=reducers, ctx=self.get_context()) |
def _get_chunks(chunksize, *iterables):
"""Iterates over zip()ed iterables in chunks. """
if sys.version_info < (3, 3):
it = itertools.izip(*iterables)
else:
it = zip(*iterables)
while True:
chunk = tuple(itertools.islice(it, chunksize))
if not chunk:
return
... |
def _sendback_result(result_queue, work_id, result=None, exception=None):
"""Safely send back the given result or exception"""
try:
result_queue.put(_ResultItem(work_id, result=result,
exception=exception))
except BaseException as e:
exc = _ExceptionWithT... |
def _process_worker(call_queue, result_queue, initializer, initargs,
processes_management_lock, timeout, worker_exit_lock,
current_depth):
"""Evaluates calls from call_queue and places the results in result_queue.
This worker is run in a separate process.
Args:
... |
def _add_call_item_to_queue(pending_work_items,
running_work_items,
work_ids,
call_queue):
"""Fills call_queue with _WorkItems from pending_work_items.
This function never blocks.
Args:
pending_work_items: A dict m... |
def _queue_management_worker(executor_reference,
executor_flags,
processes,
pending_work_items,
running_work_items,
work_ids_queue,
call_queue,
... |
def _ensure_executor_running(self):
"""ensures all workers and management thread are running
"""
with self._processes_management_lock:
if len(self._processes) != self._max_workers:
self._adjust_process_count()
self._start_queue_management_thread() |
def map(self, fn, *iterables, **kwargs):
"""Returns an iterator equivalent to map(fn, iter).
Args:
fn: A callable that will take as many arguments as there are
passed iterables.
timeout: The maximum number of seconds to wait. If None, then there
i... |
def wrap_non_picklable_objects(obj, keep_wrapper=True):
"""Wrapper for non-picklable object to use cloudpickle to serialize them.
Note that this wrapper tends to slow down the serialization process as it
is done with cloudpickle which is typically slower compared to pickle. The
proper way to solve seri... |
def start(self, initializer=None, initargs=()):
'''Spawn a server process for this manager object'''
assert self._state.value == State.INITIAL
if (initializer is not None
and not hasattr(initializer, '__call__')):
raise TypeError('initializer must be a callable')
... |
def DupFd(fd):
'''Return a wrapper for an fd.'''
popen_obj = get_spawning_popen()
if popen_obj is not None:
return popen_obj.DupFd(popen_obj.duplicate_for_child(fd))
elif HAVE_SEND_HANDLE and sys.version_info[:2] > (3, 3):
from multiprocessing import resource_sharer
return resour... |
def get_reusable_executor(max_workers=None, context=None, timeout=10,
kill_workers=False, reuse="auto",
job_reducers=None, result_reducers=None,
initializer=None, initargs=()):
"""Return the current ReusableExectutor instance.
Start ... |
def _wait_job_completion(self):
"""Wait for the cache to be empty before resizing the pool."""
# Issue a warning to the user about the bad effect of this usage.
if len(self._pending_work_items) > 0:
warnings.warn("Trying to resize an executor with running jobs: "
... |
def get_preparation_data(name, init_main_module=True):
'''
Return info about parent needed by child to unpickle process object
'''
_check_not_importing_main()
d = dict(
log_to_stderr=util._log_to_stderr,
authkey=bytes(process.current_process().authkey),
)
if util._logger is ... |
def prepare(data):
'''
Try to get current process ready to unpickle process object
'''
if 'name' in data:
process.current_process().name = data['name']
if 'authkey' in data:
process.current_process().authkey = data['authkey']
if 'log_to_stderr' in data and data['log_to_stderr']... |
def wait(object_list, timeout=None):
'''
Wait till an object in object_list is ready/readable.
Returns list of those objects which are ready/readable.
'''
if timeout is not None:
if timeout <= 0:
return _poll(object_list, 0)
else:
deadline = monotonic() + time... |
def close_fds(keep_fds): # pragma: no cover
"""Close all the file descriptors except those in keep_fds."""
# Make sure to keep stdout and stderr open for logging purpose
keep_fds = set(keep_fds).union([1, 2])
# We try to retrieve all the open fds
try:
open_fds = set(int(fd) for fd in os.l... |
def _recursive_terminate_without_psutil(process):
"""Terminate a process and its descendants.
"""
try:
_recursive_terminate(process.pid)
except OSError as e:
warnings.warn("Failed to kill subprocesses on this platform. Please"
"install psutil: https://github.com/gia... |
def _recursive_terminate(pid):
"""Recursively kill the descendants of a process before killing it.
"""
if sys.platform == "win32":
# On windows, the taskkill function with option `/T` terminate a given
# process pid and its children.
try:
subprocess.check_output(
... |
def get_exitcodes_terminated_worker(processes):
"""Return a formated string with the exitcodes of terminated workers.
If necessary, wait (up to .25s) for the system to correctly set the
exitcode of one terminated worker.
"""
patience = 5
# Catch the exitcode of the terminated workers. There sh... |
def _format_exitcodes(exitcodes):
"""Format a list of exit code with names of the signals if possible"""
str_exitcodes = ["{}({})".format(_get_exitcode_name(e), e)
for e in exitcodes if e is not None]
return "{" + ", ".join(str_exitcodes) + "}" |
def main(fd, verbose=0):
'''Run semaphore tracker.'''
# protect the process from ^C and "killall python" etc
signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGTERM, signal.SIG_IGN)
if _HAVE_SIGMASK:
signal.pthread_sigmask(signal.SIG_UNBLOCK, _IGNORED_SIGNALS)
for f i... |
def ensure_running(self):
'''Make sure that semaphore tracker process is running.
This can be run from any process. Usually a child process will use
the semaphore created by its parent.'''
with self._lock:
if self._fd is not None:
# semaphore tracker was lau... |
def event_processor(self, frame, event, arg):
'A simple event processor that prints out events.'
out = self.debugger.intf[-1].output
lineno = frame.f_lineno
filename = self.core.canonic_filename(frame)
filename = self.core.filename(filename)
if not out:
print(... |
def run(self, args):
"""Program counter."""
mainfile = self.core.filename(None)
if self.core.is_running():
curframe = self.proc.curframe
if curframe:
line_no = inspect.getlineno(curframe)
offset = curframe.f_lasti
self.msg(... |
def interact(banner=None, readfunc=None, my_locals=None, my_globals=None):
"""Almost a copy of code.interact
Closely emulate the interactive Python interpreter.
This is a backwards compatible interface to the InteractiveConsole
class. When readfunc is not specified, it attempts to import the
readl... |
def runcode(obj, code_obj):
"""Execute a code object.
When an exception occurs, self.showtraceback() is called to
display a traceback. All exceptions are caught except
SystemExit, which is reraised.
A note about KeyboardInterrupt: this exception may occur
elsewhere in this code, and may not a... |
def adjust_frame(proc_obj, name, pos, absolute_pos):
"""Adjust stack frame by pos positions. If absolute_pos then
pos is an absolute number. Otherwise it is a relative number.
A negative number indexes from the other end."""
if not proc_obj.curframe:
proc_obj.errmsg("No stack.")
return
... |
def parse_list_cmd(proc, args, listsize=10):
"""Parses arguments for the "list" command and returns the tuple:
(filename, first line number, last line number)
or sets these to None if there was some problem."""
text = proc.current_command[len(args[0])+1:].strip()
if text in frozenset(('', '.', '+'... |
def open(self, inp, opts={}):
"""Use this to set where to read from.
Set opts['try_lineedit'] if you want this input to interact
with GNU-like readline library. By default, we will assume to
try importing and using readline. If readline is not
importable, line editing is not ava... |
def readline(self, use_raw=None, prompt=''):
"""Read a line of input. EOFError will be raised on EOF.
Note: some user interfaces may decide to arrange to call
DebuggerOutput.write() first with the prompt rather than pass
it here.. If `use_raw' is set raw_input() will be used in that
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.