partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
SectionMutator.mutate
Mutates current section.
uwsgiconf/contrib/django/uwsgify/toolbox.py
def mutate(self): """Mutates current section.""" section = self.section project_name = self.project_name section.project_name = project_name self.contribute_runtime_dir() main = section.main_process main.set_naming_params(prefix='[%s] ' % project_name) ...
def mutate(self): """Mutates current section.""" section = self.section project_name = self.project_name section.project_name = project_name self.contribute_runtime_dir() main = section.main_process main.set_naming_params(prefix='[%s] ' % project_name) ...
[ "Mutates", "current", "section", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/contrib/django/uwsgify/toolbox.py#L201-L231
[ "def", "mutate", "(", "self", ")", ":", "section", "=", "self", ".", "section", "project_name", "=", "self", ".", "project_name", "section", ".", "project_name", "=", "project_name", "self", ".", "contribute_runtime_dir", "(", ")", "main", "=", "section", "....
475407acb44199edbf7e0a66261bfeb51de1afae
train
register_file_monitor
Maps a specific file/directory modification event to a signal. :param str|unicode filename: File or a directory to watch for its modification. :param int|Signal|str|unicode target: Existing signal to raise or Signal Target to register signal implicitly. Available targets: * ``wor...
uwsgiconf/runtime/monitoring.py
def register_file_monitor(filename, target=None): """Maps a specific file/directory modification event to a signal. :param str|unicode filename: File or a directory to watch for its modification. :param int|Signal|str|unicode target: Existing signal to raise or Signal Target to register signal imp...
def register_file_monitor(filename, target=None): """Maps a specific file/directory modification event to a signal. :param str|unicode filename: File or a directory to watch for its modification. :param int|Signal|str|unicode target: Existing signal to raise or Signal Target to register signal imp...
[ "Maps", "a", "specific", "file", "/", "directory", "modification", "event", "to", "a", "signal", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/monitoring.py#L5-L29
[ "def", "register_file_monitor", "(", "filename", ",", "target", "=", "None", ")", ":", "return", "_automate_signal", "(", "target", ",", "func", "=", "lambda", "sig", ":", "uwsgi", ".", "add_file_monitor", "(", "int", "(", "sig", ")", ",", "filename", ")",...
475407acb44199edbf7e0a66261bfeb51de1afae
train
Metric.set
Sets metric value. :param int|long value: New value. :param str|unicode mode: Update mode. * None - Unconditional update. * max - Sets metric value if it is greater that the current one. * min - Sets metric value if it is less that the current one. :rtype:...
uwsgiconf/runtime/monitoring.py
def set(self, value, mode=None): """Sets metric value. :param int|long value: New value. :param str|unicode mode: Update mode. * None - Unconditional update. * max - Sets metric value if it is greater that the current one. * min - Sets metric value if it is...
def set(self, value, mode=None): """Sets metric value. :param int|long value: New value. :param str|unicode mode: Update mode. * None - Unconditional update. * max - Sets metric value if it is greater that the current one. * min - Sets metric value if it is...
[ "Sets", "metric", "value", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/monitoring.py#L50-L73
[ "def", "set", "(", "self", ",", "value", ",", "mode", "=", "None", ")", ":", "if", "mode", "==", "'max'", ":", "func", "=", "uwsgi", ".", "metric_set_max", "elif", "mode", "==", "'min'", ":", "func", "=", "uwsgi", ".", "metric_set_min", "else", ":", ...
475407acb44199edbf7e0a66261bfeb51de1afae
train
Mule.get_message
Block until a mule message is received and return it. This can be called from multiple threads in the same programmed mule. :param bool signals: Whether to manage signals. :param bool farms: Whether to manage farms. :param int buffer_size: :param int timeout: Seconds. ...
uwsgiconf/runtime/mules.py
def get_message(cls, signals=True, farms=False, buffer_size=65536, timeout=-1): """Block until a mule message is received and return it. This can be called from multiple threads in the same programmed mule. :param bool signals: Whether to manage signals. :param bool farms: Whether to ...
def get_message(cls, signals=True, farms=False, buffer_size=65536, timeout=-1): """Block until a mule message is received and return it. This can be called from multiple threads in the same programmed mule. :param bool signals: Whether to manage signals. :param bool farms: Whether to ...
[ "Block", "until", "a", "mule", "message", "is", "received", "and", "return", "it", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/mules.py#L26-L43
[ "def", "get_message", "(", "cls", ",", "signals", "=", "True", ",", "farms", "=", "False", ",", "buffer_size", "=", "65536", ",", "timeout", "=", "-", "1", ")", ":", "return", "decode", "(", "uwsgi", ".", "mule_get_msg", "(", "signals", ",", "farms", ...
475407acb44199edbf7e0a66261bfeb51de1afae
train
regenerate
Regenerates header files for cmark under ./generated.
noxfile.py
def regenerate(session): """Regenerates header files for cmark under ./generated.""" if platform.system() == 'Windows': output_dir = '../generated/windows' else: output_dir = '../generated/unix' session.run(shutil.rmtree, 'build', ignore_errors=True) session.run(os.makedirs,...
def regenerate(session): """Regenerates header files for cmark under ./generated.""" if platform.system() == 'Windows': output_dir = '../generated/windows' else: output_dir = '../generated/unix' session.run(shutil.rmtree, 'build', ignore_errors=True) session.run(os.makedirs,...
[ "Regenerates", "header", "files", "for", "cmark", "under", ".", "/", "generated", "." ]
theacodes/cmarkgfm
python
https://github.com/theacodes/cmarkgfm/blob/742cc59c7dadbee3c1f54b86167840bd0d3f2d49/noxfile.py#L33-L49
[ "def", "regenerate", "(", "session", ")", ":", "if", "platform", ".", "system", "(", ")", "==", "'Windows'", ":", "output_dir", "=", "'../generated/windows'", "else", ":", "output_dir", "=", "'../generated/unix'", "session", ".", "run", "(", "shutil", ".", "...
742cc59c7dadbee3c1f54b86167840bd0d3f2d49
train
output_capturing
Temporarily captures/redirects stdout.
uwsgiconf/utils.py
def output_capturing(): """Temporarily captures/redirects stdout.""" out = sys.stdout sys.stdout = StringIO() try: yield finally: sys.stdout = out
def output_capturing(): """Temporarily captures/redirects stdout.""" out = sys.stdout sys.stdout = StringIO() try: yield finally: sys.stdout = out
[ "Temporarily", "captures", "/", "redirects", "stdout", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L49-L59
[ "def", "output_capturing", "(", ")", ":", "out", "=", "sys", ".", "stdout", "sys", ".", "stdout", "=", "StringIO", "(", ")", "try", ":", "yield", "finally", ":", "sys", ".", "stdout", "=", "out" ]
475407acb44199edbf7e0a66261bfeb51de1afae
train
filter_locals
Filters a dictionary produced by locals(). :param dict locals_dict: :param list drop: Keys to drop from dict. :param list include: Keys to include into dict. :rtype: dict
uwsgiconf/utils.py
def filter_locals(locals_dict, drop=None, include=None): """Filters a dictionary produced by locals(). :param dict locals_dict: :param list drop: Keys to drop from dict. :param list include: Keys to include into dict. :rtype: dict """ drop = drop or [] drop.extend([ 'self', ...
def filter_locals(locals_dict, drop=None, include=None): """Filters a dictionary produced by locals(). :param dict locals_dict: :param list drop: Keys to drop from dict. :param list include: Keys to include into dict. :rtype: dict """ drop = drop or [] drop.extend([ 'self', ...
[ "Filters", "a", "dictionary", "produced", "by", "locals", "()", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L160-L183
[ "def", "filter_locals", "(", "locals_dict", ",", "drop", "=", "None", ",", "include", "=", "None", ")", ":", "drop", "=", "drop", "or", "[", "]", "drop", ".", "extend", "(", "[", "'self'", ",", "'__class__'", ",", "# py3", "]", ")", "include", "=", ...
475407acb44199edbf7e0a66261bfeb51de1afae
train
get_output
Runs a command and returns its output (stdout + stderr). :param str|unicode cmd: :param str|unicode|list[str|unicode] args: :rtype: str|unicode
uwsgiconf/utils.py
def get_output(cmd, args): """Runs a command and returns its output (stdout + stderr). :param str|unicode cmd: :param str|unicode|list[str|unicode] args: :rtype: str|unicode """ from subprocess import Popen, STDOUT, PIPE command = [cmd] command.extend(listify(args)) process = Po...
def get_output(cmd, args): """Runs a command and returns its output (stdout + stderr). :param str|unicode cmd: :param str|unicode|list[str|unicode] args: :rtype: str|unicode """ from subprocess import Popen, STDOUT, PIPE command = [cmd] command.extend(listify(args)) process = Po...
[ "Runs", "a", "command", "and", "returns", "its", "output", "(", "stdout", "+", "stderr", ")", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L237-L254
[ "def", "get_output", "(", "cmd", ",", "args", ")", ":", "from", "subprocess", "import", "Popen", ",", "STDOUT", ",", "PIPE", "command", "=", "[", "cmd", "]", "command", ".", "extend", "(", "listify", "(", "args", ")", ")", "process", "=", "Popen", "(...
475407acb44199edbf7e0a66261bfeb51de1afae
train
parse_command_plugins_output
Parses ``plugin-list`` command output from uWSGI and returns object containing lists of embedded plugin names. :param str|unicode out: :rtype EmbeddedPlugins:
uwsgiconf/utils.py
def parse_command_plugins_output(out): """Parses ``plugin-list`` command output from uWSGI and returns object containing lists of embedded plugin names. :param str|unicode out: :rtype EmbeddedPlugins: """ out = out.split('--- end of plugins list ---')[0] out = out.partition('plugins ***')...
def parse_command_plugins_output(out): """Parses ``plugin-list`` command output from uWSGI and returns object containing lists of embedded plugin names. :param str|unicode out: :rtype EmbeddedPlugins: """ out = out.split('--- end of plugins list ---')[0] out = out.partition('plugins ***')...
[ "Parses", "plugin", "-", "list", "command", "output", "from", "uWSGI", "and", "returns", "object", "containing", "lists", "of", "embedded", "plugin", "names", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L411-L443
[ "def", "parse_command_plugins_output", "(", "out", ")", ":", "out", "=", "out", ".", "split", "(", "'--- end of plugins list ---'", ")", "[", "0", "]", "out", "=", "out", ".", "partition", "(", "'plugins ***'", ")", "[", "2", "]", "out", "=", "out", ".",...
475407acb44199edbf7e0a66261bfeb51de1afae
train
get_uwsgi_stub_attrs_diff
Returns attributes difference two elements tuple between real uwsgi module and its stub. Might be of use while describing in stub new uwsgi functions. :return: (uwsgi_only_attrs, stub_only_attrs) :rtype: tuple
uwsgiconf/utils.py
def get_uwsgi_stub_attrs_diff(): """Returns attributes difference two elements tuple between real uwsgi module and its stub. Might be of use while describing in stub new uwsgi functions. :return: (uwsgi_only_attrs, stub_only_attrs) :rtype: tuple """ try: import uwsgi except ...
def get_uwsgi_stub_attrs_diff(): """Returns attributes difference two elements tuple between real uwsgi module and its stub. Might be of use while describing in stub new uwsgi functions. :return: (uwsgi_only_attrs, stub_only_attrs) :rtype: tuple """ try: import uwsgi except ...
[ "Returns", "attributes", "difference", "two", "elements", "tuple", "between", "real", "uwsgi", "module", "and", "its", "stub", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L446-L477
[ "def", "get_uwsgi_stub_attrs_diff", "(", ")", ":", "try", ":", "import", "uwsgi", "except", "ImportError", ":", "from", "uwsgiconf", ".", "exceptions", "import", "UwsgiconfException", "raise", "UwsgiconfException", "(", "'`uwsgi` module is unavailable. Calling `get_attrs_di...
475407acb44199edbf7e0a66261bfeb51de1afae
train
ConfModule.spawn_uwsgi
Spawns uWSGI process(es) which will use configuration(s) from the module. Returns list of tuples: (configuration_alias, uwsgi_process_id) If only one configuration found current process (uwsgiconf) is replaced with a new one (uWSGI), otherwise a number of new detached processes is ...
uwsgiconf/utils.py
def spawn_uwsgi(self, only=None): """Spawns uWSGI process(es) which will use configuration(s) from the module. Returns list of tuples: (configuration_alias, uwsgi_process_id) If only one configuration found current process (uwsgiconf) is replaced with a new one (uWSGI), oth...
def spawn_uwsgi(self, only=None): """Spawns uWSGI process(es) which will use configuration(s) from the module. Returns list of tuples: (configuration_alias, uwsgi_process_id) If only one configuration found current process (uwsgiconf) is replaced with a new one (uWSGI), oth...
[ "Spawns", "uWSGI", "process", "(", "es", ")", "which", "will", "use", "configuration", "(", "s", ")", "from", "the", "module", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L79-L110
[ "def", "spawn_uwsgi", "(", "self", ",", "only", "=", "None", ")", ":", "spawned", "=", "[", "]", "configs", "=", "self", ".", "configurations", "if", "len", "(", "configs", ")", "==", "1", ":", "alias", "=", "configs", "[", "0", "]", ".", "alias", ...
475407acb44199edbf7e0a66261bfeb51de1afae
train
ConfModule.configurations
Configurations from uwsgiconf module.
uwsgiconf/utils.py
def configurations(self): """Configurations from uwsgiconf module.""" if self._confs is not None: return self._confs with output_capturing(): module = self.load(self.fpath) confs = getattr(module, CONFIGS_MODULE_ATTR) confs = listify(confs) ...
def configurations(self): """Configurations from uwsgiconf module.""" if self._confs is not None: return self._confs with output_capturing(): module = self.load(self.fpath) confs = getattr(module, CONFIGS_MODULE_ATTR) confs = listify(confs) ...
[ "Configurations", "from", "uwsgiconf", "module", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L113-L126
[ "def", "configurations", "(", "self", ")", ":", "if", "self", ".", "_confs", "is", "not", "None", ":", "return", "self", ".", "_confs", "with", "output_capturing", "(", ")", ":", "module", "=", "self", ".", "load", "(", "self", ".", "fpath", ")", "co...
475407acb44199edbf7e0a66261bfeb51de1afae
train
ConfModule.load
Loads a module and returns its object. :param str|unicode fpath: :rtype: module
uwsgiconf/utils.py
def load(cls, fpath): """Loads a module and returns its object. :param str|unicode fpath: :rtype: module """ module_name = os.path.splitext(os.path.basename(fpath))[0] sys.path.insert(0, os.path.dirname(fpath)) try: module = import_module(module_name...
def load(cls, fpath): """Loads a module and returns its object. :param str|unicode fpath: :rtype: module """ module_name = os.path.splitext(os.path.basename(fpath))[0] sys.path.insert(0, os.path.dirname(fpath)) try: module = import_module(module_name...
[ "Loads", "a", "module", "and", "returns", "its", "object", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L129-L144
[ "def", "load", "(", "cls", ",", "fpath", ")", ":", "module_name", "=", "os", ".", "path", ".", "splitext", "(", "os", ".", "path", ".", "basename", "(", "fpath", ")", ")", "[", "0", "]", "sys", ".", "path", ".", "insert", "(", "0", ",", "os", ...
475407acb44199edbf7e0a66261bfeb51de1afae
train
Fifo.cmd_log
Allows managing of uWSGI log related stuff :param bool reopen: Reopen log file. Could be required after third party rotation. :param bool rotate: Trigger built-in log rotation.
uwsgiconf/utils.py
def cmd_log(self, reopen=False, rotate=False): """Allows managing of uWSGI log related stuff :param bool reopen: Reopen log file. Could be required after third party rotation. :param bool rotate: Trigger built-in log rotation. """ cmd = b'' if reopen: cmd +...
def cmd_log(self, reopen=False, rotate=False): """Allows managing of uWSGI log related stuff :param bool reopen: Reopen log file. Could be required after third party rotation. :param bool rotate: Trigger built-in log rotation. """ cmd = b'' if reopen: cmd +...
[ "Allows", "managing", "of", "uWSGI", "log", "related", "stuff" ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L287-L302
[ "def", "cmd_log", "(", "self", ",", "reopen", "=", "False", ",", "rotate", "=", "False", ")", ":", "cmd", "=", "b''", "if", "reopen", ":", "cmd", "+=", "b'l'", "if", "rotate", ":", "cmd", "+=", "b'L'", "return", "self", ".", "send_command", "(", "c...
475407acb44199edbf7e0a66261bfeb51de1afae
train
Fifo.cmd_reload
Reloads uWSGI master process, workers. :param bool force: Use forced (brutal) reload instead of a graceful one. :param bool workers_only: Reload only workers. :param bool workers_chain: Run chained workers reload (one after another, instead of destroying all of them in bulk).
uwsgiconf/utils.py
def cmd_reload(self, force=False, workers_only=False, workers_chain=False): """Reloads uWSGI master process, workers. :param bool force: Use forced (brutal) reload instead of a graceful one. :param bool workers_only: Reload only workers. :param bool workers_chain: Run chained workers re...
def cmd_reload(self, force=False, workers_only=False, workers_chain=False): """Reloads uWSGI master process, workers. :param bool force: Use forced (brutal) reload instead of a graceful one. :param bool workers_only: Reload only workers. :param bool workers_chain: Run chained workers re...
[ "Reloads", "uWSGI", "master", "process", "workers", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L316-L331
[ "def", "cmd_reload", "(", "self", ",", "force", "=", "False", ",", "workers_only", "=", "False", ",", "workers_chain", "=", "False", ")", ":", "if", "workers_chain", ":", "return", "self", ".", "send_command", "(", "b'c'", ")", "if", "workers_only", ":", ...
475407acb44199edbf7e0a66261bfeb51de1afae
train
Fifo.send_command
Sends a generic command into FIFO. :param bytes cmd: Command chars to send into FIFO.
uwsgiconf/utils.py
def send_command(self, cmd): """Sends a generic command into FIFO. :param bytes cmd: Command chars to send into FIFO. """ if not cmd: return with open(self.fifo, 'wb') as f: f.write(cmd)
def send_command(self, cmd): """Sends a generic command into FIFO. :param bytes cmd: Command chars to send into FIFO. """ if not cmd: return with open(self.fifo, 'wb') as f: f.write(cmd)
[ "Sends", "a", "generic", "command", "into", "FIFO", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L333-L343
[ "def", "send_command", "(", "self", ",", "cmd", ")", ":", "if", "not", "cmd", ":", "return", "with", "open", "(", "self", ".", "fifo", ",", "'wb'", ")", "as", "f", ":", "f", ".", "write", "(", "cmd", ")" ]
475407acb44199edbf7e0a66261bfeb51de1afae
train
UwsgiRunner.get_env_path
Returns PATH environment variable updated to run uwsgiconf in (e.g. for virtualenv). :rtype: str|unicode
uwsgiconf/utils.py
def get_env_path(cls): """Returns PATH environment variable updated to run uwsgiconf in (e.g. for virtualenv). :rtype: str|unicode """ return os.path.dirname(Finder.python()) + os.pathsep + os.environ['PATH']
def get_env_path(cls): """Returns PATH environment variable updated to run uwsgiconf in (e.g. for virtualenv). :rtype: str|unicode """ return os.path.dirname(Finder.python()) + os.pathsep + os.environ['PATH']
[ "Returns", "PATH", "environment", "variable", "updated", "to", "run", "uwsgiconf", "in", "(", "e", ".", "g", ".", "for", "virtualenv", ")", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L372-L378
[ "def", "get_env_path", "(", "cls", ")", ":", "return", "os", ".", "path", ".", "dirname", "(", "Finder", ".", "python", "(", ")", ")", "+", "os", ".", "pathsep", "+", "os", ".", "environ", "[", "'PATH'", "]" ]
475407acb44199edbf7e0a66261bfeb51de1afae
train
UwsgiRunner.prepare_env
Prepares current environment and returns Python binary name. This adds some virtualenv friendliness so that we try use uwsgi from it. :rtype: str|unicode
uwsgiconf/utils.py
def prepare_env(cls): """Prepares current environment and returns Python binary name. This adds some virtualenv friendliness so that we try use uwsgi from it. :rtype: str|unicode """ os.environ['PATH'] = cls.get_env_path() return os.path.basename(Finder.python())
def prepare_env(cls): """Prepares current environment and returns Python binary name. This adds some virtualenv friendliness so that we try use uwsgi from it. :rtype: str|unicode """ os.environ['PATH'] = cls.get_env_path() return os.path.basename(Finder.python())
[ "Prepares", "current", "environment", "and", "returns", "Python", "binary", "name", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L381-L389
[ "def", "prepare_env", "(", "cls", ")", ":", "os", ".", "environ", "[", "'PATH'", "]", "=", "cls", ".", "get_env_path", "(", ")", "return", "os", ".", "path", ".", "basename", "(", "Finder", ".", "python", "(", ")", ")" ]
475407acb44199edbf7e0a66261bfeb51de1afae
train
UwsgiRunner.spawn
Spawns uWSGI using the given configuration module. :param str|unicode filepath: :param str|unicode configuration_alias: :param bool replace: Whether a new process should replace current one.
uwsgiconf/utils.py
def spawn(self, filepath, configuration_alias, replace=False): """Spawns uWSGI using the given configuration module. :param str|unicode filepath: :param str|unicode configuration_alias: :param bool replace: Whether a new process should replace current one. """ # Pass ...
def spawn(self, filepath, configuration_alias, replace=False): """Spawns uWSGI using the given configuration module. :param str|unicode filepath: :param str|unicode configuration_alias: :param bool replace: Whether a new process should replace current one. """ # Pass ...
[ "Spawns", "uWSGI", "using", "the", "given", "configuration", "module", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/utils.py#L391-L408
[ "def", "spawn", "(", "self", ",", "filepath", ",", "configuration_alias", ",", "replace", "=", "False", ")", ":", "# Pass --conf as an argument to have a chance to use", "# touch reloading form .py configuration file change.", "args", "=", "[", "'uwsgi'", ",", "'--ini'", ...
475407acb44199edbf7e0a66261bfeb51de1afae
train
Cache.get
Gets a value from the cache. :param str|unicode key: The cache key to get value for. :param default: Value to return if none found in cache. :param bool as_int: Return 64bit number instead of str. :param callable setter: Setter callable to automatically set cache value if...
uwsgiconf/runtime/caching.py
def get(self, key, default=None, as_int=False, setter=None): """Gets a value from the cache. :param str|unicode key: The cache key to get value for. :param default: Value to return if none found in cache. :param bool as_int: Return 64bit number instead of str. :param callable...
def get(self, key, default=None, as_int=False, setter=None): """Gets a value from the cache. :param str|unicode key: The cache key to get value for. :param default: Value to return if none found in cache. :param bool as_int: Return 64bit number instead of str. :param callable...
[ "Gets", "a", "value", "from", "the", "cache", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/caching.py#L44-L77
[ "def", "get", "(", "self", ",", "key", ",", "default", "=", "None", ",", "as_int", "=", "False", ",", "setter", "=", "None", ")", ":", "if", "as_int", ":", "val", "=", "uwsgi", ".", "cache_num", "(", "key", ",", "self", ".", "name", ")", "else", ...
475407acb44199edbf7e0a66261bfeb51de1afae
train
Cache.set
Sets the specified key value. :param str|unicode key: :param int|str|unicode value: :rtype: bool
uwsgiconf/runtime/caching.py
def set(self, key, value): """Sets the specified key value. :param str|unicode key: :param int|str|unicode value: :rtype: bool """ return uwsgi.cache_set(key, value, self.timeout, self.name)
def set(self, key, value): """Sets the specified key value. :param str|unicode key: :param int|str|unicode value: :rtype: bool """ return uwsgi.cache_set(key, value, self.timeout, self.name)
[ "Sets", "the", "specified", "key", "value", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/caching.py#L81-L90
[ "def", "set", "(", "self", ",", "key", ",", "value", ")", ":", "return", "uwsgi", ".", "cache_set", "(", "key", ",", "value", ",", "self", ".", "timeout", ",", "self", ".", "name", ")" ]
475407acb44199edbf7e0a66261bfeb51de1afae
train
Cache.incr
Increments the specified key value by the specified value. :param str|unicode key: :param int delta: :rtype: bool
uwsgiconf/runtime/caching.py
def incr(self, key, delta=1): """Increments the specified key value by the specified value. :param str|unicode key: :param int delta: :rtype: bool """ return uwsgi.cache_inc(key, delta, self.timeout, self.name)
def incr(self, key, delta=1): """Increments the specified key value by the specified value. :param str|unicode key: :param int delta: :rtype: bool """ return uwsgi.cache_inc(key, delta, self.timeout, self.name)
[ "Increments", "the", "specified", "key", "value", "by", "the", "specified", "value", ".", ":", "param", "str|unicode", "key", ":", ":", "param", "int", "delta", ":" ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/caching.py#L105-L114
[ "def", "incr", "(", "self", ",", "key", ",", "delta", "=", "1", ")", ":", "return", "uwsgi", ".", "cache_inc", "(", "key", ",", "delta", ",", "self", ".", "timeout", ",", "self", ".", "name", ")" ]
475407acb44199edbf7e0a66261bfeb51de1afae
train
Cache.decr
Decrements the specified key value by the specified value. :param str|unicode key: :param int delta: :rtype: bool
uwsgiconf/runtime/caching.py
def decr(self, key, delta=1): """Decrements the specified key value by the specified value. :param str|unicode key: :param int delta: :rtype: bool """ return uwsgi.cache_dec(key, delta, self.timeout, self.name)
def decr(self, key, delta=1): """Decrements the specified key value by the specified value. :param str|unicode key: :param int delta: :rtype: bool """ return uwsgi.cache_dec(key, delta, self.timeout, self.name)
[ "Decrements", "the", "specified", "key", "value", "by", "the", "specified", "value", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/caching.py#L116-L125
[ "def", "decr", "(", "self", ",", "key", ",", "delta", "=", "1", ")", ":", "return", "uwsgi", ".", "cache_dec", "(", "key", ",", "delta", ",", "self", ".", "timeout", ",", "self", ".", "name", ")" ]
475407acb44199edbf7e0a66261bfeb51de1afae
train
Cache.mul
Multiplies the specified key value by the specified value. :param str|unicode key: :param int value: :rtype: bool
uwsgiconf/runtime/caching.py
def mul(self, key, value=2): """Multiplies the specified key value by the specified value. :param str|unicode key: :param int value: :rtype: bool """ return uwsgi.cache_mul(key, value, self.timeout, self.name)
def mul(self, key, value=2): """Multiplies the specified key value by the specified value. :param str|unicode key: :param int value: :rtype: bool """ return uwsgi.cache_mul(key, value, self.timeout, self.name)
[ "Multiplies", "the", "specified", "key", "value", "by", "the", "specified", "value", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/caching.py#L127-L136
[ "def", "mul", "(", "self", ",", "key", ",", "value", "=", "2", ")", ":", "return", "uwsgi", ".", "cache_mul", "(", "key", ",", "value", ",", "self", ".", "timeout", ",", "self", ".", "name", ")" ]
475407acb44199edbf7e0a66261bfeb51de1afae
train
Cache.div
Divides the specified key value by the specified value. :param str|unicode key: :param int value: :rtype: bool
uwsgiconf/runtime/caching.py
def div(self, key, value=2): """Divides the specified key value by the specified value. :param str|unicode key: :param int value: :rtype: bool """ return uwsgi.cache_mul(key, value, self.timeout, self.name)
def div(self, key, value=2): """Divides the specified key value by the specified value. :param str|unicode key: :param int value: :rtype: bool """ return uwsgi.cache_mul(key, value, self.timeout, self.name)
[ "Divides", "the", "specified", "key", "value", "by", "the", "specified", "value", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/caching.py#L138-L147
[ "def", "div", "(", "self", ",", "key", ",", "value", "=", "2", ")", ":", "return", "uwsgi", ".", "cache_mul", "(", "key", ",", "value", ",", "self", ".", "timeout", ",", "self", ".", "name", ")" ]
475407acb44199edbf7e0a66261bfeb51de1afae
train
recv
Receives data from websocket. :param request_context: :param bool non_blocking: :rtype: bytes|str :raises IOError: If unable to receive a message.
uwsgiconf/runtime/websockets.py
def recv(request_context=None, non_blocking=False): """Receives data from websocket. :param request_context: :param bool non_blocking: :rtype: bytes|str :raises IOError: If unable to receive a message. """ if non_blocking: result = uwsgi.websocket_recv_nb(request_context) e...
def recv(request_context=None, non_blocking=False): """Receives data from websocket. :param request_context: :param bool non_blocking: :rtype: bytes|str :raises IOError: If unable to receive a message. """ if non_blocking: result = uwsgi.websocket_recv_nb(request_context) e...
[ "Receives", "data", "from", "websocket", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/websockets.py#L7-L25
[ "def", "recv", "(", "request_context", "=", "None", ",", "non_blocking", "=", "False", ")", ":", "if", "non_blocking", ":", "result", "=", "uwsgi", ".", "websocket_recv_nb", "(", "request_context", ")", "else", ":", "result", "=", "uwsgi", ".", "websocket_re...
475407acb44199edbf7e0a66261bfeb51de1afae
train
send
Sends a message to websocket. :param str message: data to send :param request_context: :raises IOError: If unable to send a message.
uwsgiconf/runtime/websockets.py
def send(message, request_context=None, binary=False): """Sends a message to websocket. :param str message: data to send :param request_context: :raises IOError: If unable to send a message. """ if binary: return uwsgi.websocket_send_binary(message, request_context) return uwsgi....
def send(message, request_context=None, binary=False): """Sends a message to websocket. :param str message: data to send :param request_context: :raises IOError: If unable to send a message. """ if binary: return uwsgi.websocket_send_binary(message, request_context) return uwsgi....
[ "Sends", "a", "message", "to", "websocket", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/websockets.py#L28-L40
[ "def", "send", "(", "message", ",", "request_context", "=", "None", ",", "binary", "=", "False", ")", ":", "if", "binary", ":", "return", "uwsgi", ".", "websocket_send_binary", "(", "message", ",", "request_context", ")", "return", "uwsgi", ".", "websocket_s...
475407acb44199edbf7e0a66261bfeb51de1afae
train
markdown_to_html
Render the given text to Markdown. This is a direct interface to ``cmark_markdown_to_html``. Args: text (str): The text to render to Markdown. options (int): The cmark options. Returns: str: The rendered markdown.
src/cmarkgfm/cmark.py
def markdown_to_html(text, options=0): """Render the given text to Markdown. This is a direct interface to ``cmark_markdown_to_html``. Args: text (str): The text to render to Markdown. options (int): The cmark options. Returns: str: The rendered markdown. """ ...
def markdown_to_html(text, options=0): """Render the given text to Markdown. This is a direct interface to ``cmark_markdown_to_html``. Args: text (str): The text to render to Markdown. options (int): The cmark options. Returns: str: The rendered markdown. """ ...
[ "Render", "the", "given", "text", "to", "Markdown", ".", "This", "is", "a", "direct", "interface", "to", "cmark_markdown_to_html", ".", "Args", ":", "text", "(", "str", ")", ":", "The", "text", "to", "render", "to", "Markdown", ".", "options", "(", "int"...
theacodes/cmarkgfm
python
https://github.com/theacodes/cmarkgfm/blob/742cc59c7dadbee3c1f54b86167840bd0d3f2d49/src/cmarkgfm/cmark.py#L26-L41
[ "def", "markdown_to_html", "(", "text", ",", "options", "=", "0", ")", ":", "encoded_text", "=", "text", ".", "encode", "(", "'utf-8'", ")", "raw_result", "=", "_cmark", ".", "lib", ".", "cmark_markdown_to_html", "(", "encoded_text", ",", "len", "(", "enco...
742cc59c7dadbee3c1f54b86167840bd0d3f2d49
train
markdown_to_html_with_extensions
Render the given text to Markdown, using extensions. This is a high-level wrapper over the various functions needed to enable extensions, attach them to a parser, and render html. Args: text (str): The text to render to Markdown. options (int): The cmark options. extensions...
src/cmarkgfm/cmark.py
def markdown_to_html_with_extensions(text, options=0, extensions=None): """Render the given text to Markdown, using extensions. This is a high-level wrapper over the various functions needed to enable extensions, attach them to a parser, and render html. Args: text (str): The text to re...
def markdown_to_html_with_extensions(text, options=0, extensions=None): """Render the given text to Markdown, using extensions. This is a high-level wrapper over the various functions needed to enable extensions, attach them to a parser, and render html. Args: text (str): The text to re...
[ "Render", "the", "given", "text", "to", "Markdown", "using", "extensions", ".", "This", "is", "a", "high", "-", "level", "wrapper", "over", "the", "various", "functions", "needed", "to", "enable", "extensions", "attach", "them", "to", "a", "parser", "and", ...
theacodes/cmarkgfm
python
https://github.com/theacodes/cmarkgfm/blob/742cc59c7dadbee3c1f54b86167840bd0d3f2d49/src/cmarkgfm/cmark.py#L44-L90
[ "def", "markdown_to_html_with_extensions", "(", "text", ",", "options", "=", "0", ",", "extensions", "=", "None", ")", ":", "if", "extensions", "is", "None", ":", "extensions", "=", "[", "]", "core_extensions_ensure_registered", "(", ")", "cmark_extensions", "="...
742cc59c7dadbee3c1f54b86167840bd0d3f2d49
train
parse_document
Parse a document and return the root node. Args: text (str): The text to parse. options (int): The cmark options. Returns: Any: Opaque reference to the root node of the parsed syntax tree.
src/cmarkgfm/cmark.py
def parse_document(text, options=0): """Parse a document and return the root node. Args: text (str): The text to parse. options (int): The cmark options. Returns: Any: Opaque reference to the root node of the parsed syntax tree. """ encoded_text = text.encode('utf...
def parse_document(text, options=0): """Parse a document and return the root node. Args: text (str): The text to parse. options (int): The cmark options. Returns: Any: Opaque reference to the root node of the parsed syntax tree. """ encoded_text = text.encode('utf...
[ "Parse", "a", "document", "and", "return", "the", "root", "node", ".", "Args", ":", "text", "(", "str", ")", ":", "The", "text", "to", "parse", ".", "options", "(", "int", ")", ":", "The", "cmark", "options", ".", "Returns", ":", "Any", ":", "Opaqu...
theacodes/cmarkgfm
python
https://github.com/theacodes/cmarkgfm/blob/742cc59c7dadbee3c1f54b86167840bd0d3f2d49/src/cmarkgfm/cmark.py#L111-L123
[ "def", "parse_document", "(", "text", ",", "options", "=", "0", ")", ":", "encoded_text", "=", "text", ".", "encode", "(", "'utf-8'", ")", "return", "_cmark", ".", "lib", ".", "cmark_parse_document", "(", "encoded_text", ",", "len", "(", "encoded_text", ")...
742cc59c7dadbee3c1f54b86167840bd0d3f2d49
train
parser_feed
Direct wrapper over cmark_parser_feed.
src/cmarkgfm/cmark.py
def parser_feed(parser, text): """Direct wrapper over cmark_parser_feed.""" encoded_text = text.encode('utf-8') return _cmark.lib.cmark_parser_feed( parser, encoded_text, len(encoded_text))
def parser_feed(parser, text): """Direct wrapper over cmark_parser_feed.""" encoded_text = text.encode('utf-8') return _cmark.lib.cmark_parser_feed( parser, encoded_text, len(encoded_text))
[ "Direct", "wrapper", "over", "cmark_parser_feed", "." ]
theacodes/cmarkgfm
python
https://github.com/theacodes/cmarkgfm/blob/742cc59c7dadbee3c1f54b86167840bd0d3f2d49/src/cmarkgfm/cmark.py#L136-L140
[ "def", "parser_feed", "(", "parser", ",", "text", ")", ":", "encoded_text", "=", "text", ".", "encode", "(", "'utf-8'", ")", "return", "_cmark", ".", "lib", ".", "cmark_parser_feed", "(", "parser", ",", "encoded_text", ",", "len", "(", "encoded_text", ")",...
742cc59c7dadbee3c1f54b86167840bd0d3f2d49
train
render_html
Render a given syntax tree as HTML. Args: root (Any): The reference to the root node of the syntax tree. options (int): The cmark options. extensions (Any): The reference to the syntax extensions, generally from :func:`parser_get_syntax_extensions` Returns: ...
src/cmarkgfm/cmark.py
def render_html(root, options=0, extensions=None): """Render a given syntax tree as HTML. Args: root (Any): The reference to the root node of the syntax tree. options (int): The cmark options. extensions (Any): The reference to the syntax extensions, generally from :f...
def render_html(root, options=0, extensions=None): """Render a given syntax tree as HTML. Args: root (Any): The reference to the root node of the syntax tree. options (int): The cmark options. extensions (Any): The reference to the syntax extensions, generally from :f...
[ "Render", "a", "given", "syntax", "tree", "as", "HTML", ".", "Args", ":", "root", "(", "Any", ")", ":", "The", "reference", "to", "the", "root", "node", "of", "the", "syntax", "tree", ".", "options", "(", "int", ")", ":", "The", "cmark", "options", ...
theacodes/cmarkgfm
python
https://github.com/theacodes/cmarkgfm/blob/742cc59c7dadbee3c1f54b86167840bd0d3f2d49/src/cmarkgfm/cmark.py#L148-L166
[ "def", "render_html", "(", "root", ",", "options", "=", "0", ",", "extensions", "=", "None", ")", ":", "if", "extensions", "is", "None", ":", "extensions", "=", "_cmark", ".", "ffi", ".", "NULL", "raw_result", "=", "_cmark", ".", "lib", ".", "cmark_ren...
742cc59c7dadbee3c1f54b86167840bd0d3f2d49
train
find_syntax_extension
Direct wrapper over cmark_find_syntax_extension.
src/cmarkgfm/cmark.py
def find_syntax_extension(name): """Direct wrapper over cmark_find_syntax_extension.""" encoded_name = name.encode('utf-8') extension = _cmark.lib.cmark_find_syntax_extension(encoded_name) if extension == _cmark.ffi.NULL: return None else: return extension
def find_syntax_extension(name): """Direct wrapper over cmark_find_syntax_extension.""" encoded_name = name.encode('utf-8') extension = _cmark.lib.cmark_find_syntax_extension(encoded_name) if extension == _cmark.ffi.NULL: return None else: return extension
[ "Direct", "wrapper", "over", "cmark_find_syntax_extension", "." ]
theacodes/cmarkgfm
python
https://github.com/theacodes/cmarkgfm/blob/742cc59c7dadbee3c1f54b86167840bd0d3f2d49/src/cmarkgfm/cmark.py#L174-L182
[ "def", "find_syntax_extension", "(", "name", ")", ":", "encoded_name", "=", "name", ".", "encode", "(", "'utf-8'", ")", "extension", "=", "_cmark", ".", "lib", ".", "cmark_find_syntax_extension", "(", "encoded_name", ")", "if", "extension", "==", "_cmark", "."...
742cc59c7dadbee3c1f54b86167840bd0d3f2d49
train
Caching.set_basic_params
:param bool no_expire: Disable auto sweep of expired items. Since uWSGI 1.2, cache item expiration is managed by a thread in the master process, to reduce the risk of deadlock. This thread can be disabled (making item expiry a no-op) with the this option. :param int expire_s...
uwsgiconf/options/caching.py
def set_basic_params(self, no_expire=None, expire_scan_interval=None, report_freed=None): """ :param bool no_expire: Disable auto sweep of expired items. Since uWSGI 1.2, cache item expiration is managed by a thread in the master process, to reduce the risk of deadlock. This thre...
def set_basic_params(self, no_expire=None, expire_scan_interval=None, report_freed=None): """ :param bool no_expire: Disable auto sweep of expired items. Since uWSGI 1.2, cache item expiration is managed by a thread in the master process, to reduce the risk of deadlock. This thre...
[ ":", "param", "bool", "no_expire", ":", "Disable", "auto", "sweep", "of", "expired", "items", ".", "Since", "uWSGI", "1", ".", "2", "cache", "item", "expiration", "is", "managed", "by", "a", "thread", "in", "the", "master", "process", "to", "reduce", "th...
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/caching.py#L19-L37
[ "def", "set_basic_params", "(", "self", ",", "no_expire", "=", "None", ",", "expire_scan_interval", "=", "None", ",", "report_freed", "=", "None", ")", ":", "self", ".", "_set", "(", "'cache-no-expire'", ",", "no_expire", ",", "cast", "=", "bool", ")", "se...
475407acb44199edbf7e0a66261bfeb51de1afae
train
Caching.add_item
Add an item into the given cache. This is a commodity option (mainly useful for testing) allowing you to store an item in a uWSGI cache during startup. :param str|unicode key: :param value: :param str|unicode cache_name: If not set, default will be used.
uwsgiconf/options/caching.py
def add_item(self, key, value, cache_name=None): """Add an item into the given cache. This is a commodity option (mainly useful for testing) allowing you to store an item in a uWSGI cache during startup. :param str|unicode key: :param value: :param str|unicode cache_n...
def add_item(self, key, value, cache_name=None): """Add an item into the given cache. This is a commodity option (mainly useful for testing) allowing you to store an item in a uWSGI cache during startup. :param str|unicode key: :param value: :param str|unicode cache_n...
[ "Add", "an", "item", "into", "the", "given", "cache", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/caching.py#L39-L57
[ "def", "add_item", "(", "self", ",", "key", ",", "value", ",", "cache_name", "=", "None", ")", ":", "cache_name", "=", "cache_name", "or", "''", "value", "=", "'%s %s=%s'", "%", "(", "cache_name", ",", "key", ",", "value", ")", "self", ".", "_set", "...
475407acb44199edbf7e0a66261bfeb51de1afae
train
Caching.add_file
Load a static file in the cache. .. note:: Items are stored with the filepath as is (relative or absolute) as the key. :param str|unicode filepath: :param bool gzip: Use gzip compression. :param str|unicode cache_name: If not set, default will be used.
uwsgiconf/options/caching.py
def add_file(self, filepath, gzip=False, cache_name=None): """Load a static file in the cache. .. note:: Items are stored with the filepath as is (relative or absolute) as the key. :param str|unicode filepath: :param bool gzip: Use gzip compression. :param str|unicode cache_n...
def add_file(self, filepath, gzip=False, cache_name=None): """Load a static file in the cache. .. note:: Items are stored with the filepath as is (relative or absolute) as the key. :param str|unicode filepath: :param bool gzip: Use gzip compression. :param str|unicode cache_n...
[ "Load", "a", "static", "file", "in", "the", "cache", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/caching.py#L59-L81
[ "def", "add_file", "(", "self", ",", "filepath", ",", "gzip", "=", "False", ",", "cache_name", "=", "None", ")", ":", "command", "=", "'load-file-in-cache'", "if", "gzip", ":", "command", "+=", "'-gzip'", "cache_name", "=", "cache_name", "or", "''", "value...
475407acb44199edbf7e0a66261bfeb51de1afae
train
Caching.add_cache
Creates cache. Default mode: single block. .. note:: This uses new generation ``cache2`` option available since uWSGI 1.9. .. note:: When at least one cache is configured without ``full_purge_lru`` and the master is enabled a thread named "the cache sweeper" is started. Its mai...
uwsgiconf/options/caching.py
def add_cache( self, name, max_items, expires=None, store=None, store_sync_interval=None, store_delete=None, hash_algo=None, hash_size=None, key_size=None, udp_clients=None, udp_servers=None, block_size=None, block_count=None, sync_from=None, mode_bitmap=None, use_lastmod=None, ...
def add_cache( self, name, max_items, expires=None, store=None, store_sync_interval=None, store_delete=None, hash_algo=None, hash_size=None, key_size=None, udp_clients=None, udp_servers=None, block_size=None, block_count=None, sync_from=None, mode_bitmap=None, use_lastmod=None, ...
[ "Creates", "cache", ".", "Default", "mode", ":", "single", "block", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/options/caching.py#L83-L196
[ "def", "add_cache", "(", "self", ",", "name", ",", "max_items", ",", "expires", "=", "None", ",", "store", "=", "None", ",", "store_sync_interval", "=", "None", ",", "store_delete", "=", "None", ",", "hash_algo", "=", "None", ",", "hash_size", "=", "None...
475407acb44199edbf7e0a66261bfeb51de1afae
train
register_timer
Add timer. Can be used as a decorator: .. code-block:: python @register_timer(3) def repeat(): do() :param int period: The interval (seconds) at which to raise the signal. :param int|Signal|str|unicode target: Existing signal to raise or Signal Ta...
uwsgiconf/runtime/scheduling.py
def register_timer(period, target=None): """Add timer. Can be used as a decorator: .. code-block:: python @register_timer(3) def repeat(): do() :param int period: The interval (seconds) at which to raise the signal. :param int|Signal|str|unicode targe...
def register_timer(period, target=None): """Add timer. Can be used as a decorator: .. code-block:: python @register_timer(3) def repeat(): do() :param int period: The interval (seconds) at which to raise the signal. :param int|Signal|str|unicode targe...
[ "Add", "timer", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/scheduling.py#L13-L47
[ "def", "register_timer", "(", "period", ",", "target", "=", "None", ")", ":", "return", "_automate_signal", "(", "target", ",", "func", "=", "lambda", "sig", ":", "uwsgi", ".", "add_timer", "(", "int", "(", "sig", ")", ",", "period", ")", ")" ]
475407acb44199edbf7e0a66261bfeb51de1afae
train
register_timer_rb
Add a red-black timer (based on black-red tree). .. code-block:: python @register_timer_rb(3) def repeat(): do() :param int period: The interval (seconds) at which the signal is raised. :param int repeat: How many times to repeat. Default: None - infinitely. ...
uwsgiconf/runtime/scheduling.py
def register_timer_rb(period, repeat=None, target=None): """Add a red-black timer (based on black-red tree). .. code-block:: python @register_timer_rb(3) def repeat(): do() :param int period: The interval (seconds) at which the signal is raised. :param int...
def register_timer_rb(period, repeat=None, target=None): """Add a red-black timer (based on black-red tree). .. code-block:: python @register_timer_rb(3) def repeat(): do() :param int period: The interval (seconds) at which the signal is raised. :param int...
[ "Add", "a", "red", "-", "black", "timer", "(", "based", "on", "black", "-", "red", "tree", ")", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/scheduling.py#L50-L84
[ "def", "register_timer_rb", "(", "period", ",", "repeat", "=", "None", ",", "target", "=", "None", ")", ":", "return", "_automate_signal", "(", "target", ",", "func", "=", "lambda", "sig", ":", "uwsgi", ".", "add_rb_timer", "(", "int", "(", "sig", ")", ...
475407acb44199edbf7e0a66261bfeb51de1afae
train
register_cron
Adds cron. The interface to the uWSGI signal cron facility. .. code-block:: python @register_cron(hour=-3) # Every 3 hours. def repeat(): do() .. note:: Arguments work similarly to a standard crontab, but instead of "*", use -1, and instead of "/2"...
uwsgiconf/runtime/scheduling.py
def register_cron(weekday=None, month=None, day=None, hour=None, minute=None, target=None): """Adds cron. The interface to the uWSGI signal cron facility. .. code-block:: python @register_cron(hour=-3) # Every 3 hours. def repeat(): do() .. note:: Arguments wo...
def register_cron(weekday=None, month=None, day=None, hour=None, minute=None, target=None): """Adds cron. The interface to the uWSGI signal cron facility. .. code-block:: python @register_cron(hour=-3) # Every 3 hours. def repeat(): do() .. note:: Arguments wo...
[ "Adds", "cron", ".", "The", "interface", "to", "the", "uWSGI", "signal", "cron", "facility", "." ]
idlesign/uwsgiconf
python
https://github.com/idlesign/uwsgiconf/blob/475407acb44199edbf7e0a66261bfeb51de1afae/uwsgiconf/runtime/scheduling.py#L87-L221
[ "def", "register_cron", "(", "weekday", "=", "None", ",", "month", "=", "None", ",", "day", "=", "None", ",", "hour", "=", "None", ",", "minute", "=", "None", ",", "target", "=", "None", ")", ":", "task_args_initial", "=", "{", "name", ":", "val", ...
475407acb44199edbf7e0a66261bfeb51de1afae
train
truncate_ellipsis
Truncate a line to the specified length followed by ``...`` unless its shorter than length already.
pyle.py
def truncate_ellipsis(line, length=30): """Truncate a line to the specified length followed by ``...`` unless its shorter than length already.""" l = len(line) return line if l < length else line[:length - 3] + "..."
def truncate_ellipsis(line, length=30): """Truncate a line to the specified length followed by ``...`` unless its shorter than length already.""" l = len(line) return line if l < length else line[:length - 3] + "..."
[ "Truncate", "a", "line", "to", "the", "specified", "length", "followed", "by", "...", "unless", "its", "shorter", "than", "length", "already", "." ]
aljungberg/pyle
python
https://github.com/aljungberg/pyle/blob/e0f25f42f5f35f0cefd0f7f9afafb6c9f37cc499/pyle.py#L43-L47
[ "def", "truncate_ellipsis", "(", "line", ",", "length", "=", "30", ")", ":", "l", "=", "len", "(", "line", ")", "return", "line", "if", "l", "<", "length", "else", "line", "[", ":", "length", "-", "3", "]", "+", "\"...\"" ]
e0f25f42f5f35f0cefd0f7f9afafb6c9f37cc499
train
pyle_evaluate
The main method of pyle.
pyle.py
def pyle_evaluate(expressions=None, modules=(), inplace=False, files=None, print_traceback=False): """The main method of pyle.""" eval_globals = {} eval_globals.update(STANDARD_MODULES) for module_arg in modules or (): for module in module_arg.strip().split(","): module = module.s...
def pyle_evaluate(expressions=None, modules=(), inplace=False, files=None, print_traceback=False): """The main method of pyle.""" eval_globals = {} eval_globals.update(STANDARD_MODULES) for module_arg in modules or (): for module in module_arg.strip().split(","): module = module.s...
[ "The", "main", "method", "of", "pyle", "." ]
aljungberg/pyle
python
https://github.com/aljungberg/pyle/blob/e0f25f42f5f35f0cefd0f7f9afafb6c9f37cc499/pyle.py#L50-L127
[ "def", "pyle_evaluate", "(", "expressions", "=", "None", ",", "modules", "=", "(", ")", ",", "inplace", "=", "False", ",", "files", "=", "None", ",", "print_traceback", "=", "False", ")", ":", "eval_globals", "=", "{", "}", "eval_globals", ".", "update",...
e0f25f42f5f35f0cefd0f7f9afafb6c9f37cc499
train
pyle
Execute pyle with the specified arguments, or sys.argv if no arguments specified.
pyle.py
def pyle(argv=None): """Execute pyle with the specified arguments, or sys.argv if no arguments specified.""" parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("-m", "--modules", dest="modules", action='append', help="import MODULE before evaluation. May be specified more th...
def pyle(argv=None): """Execute pyle with the specified arguments, or sys.argv if no arguments specified.""" parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("-m", "--modules", dest="modules", action='append', help="import MODULE before evaluation. May be specified more th...
[ "Execute", "pyle", "with", "the", "specified", "arguments", "or", "sys", ".", "argv", "if", "no", "arguments", "specified", "." ]
aljungberg/pyle
python
https://github.com/aljungberg/pyle/blob/e0f25f42f5f35f0cefd0f7f9afafb6c9f37cc499/pyle.py#L130-L149
[ "def", "pyle", "(", "argv", "=", "None", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "__doc__", ")", "parser", ".", "add_argument", "(", "\"-m\"", ",", "\"--modules\"", ",", "dest", "=", "\"modules\"", ",", "action"...
e0f25f42f5f35f0cefd0f7f9afafb6c9f37cc499
train
ARPAbet2PhoneticAlphabetConvertor.convert_to_international_phonetic_alphabet
转换成国际音标 :param arpabet: :return:
arpabetandipaconvertor/arpabet2phoneticalphabet.py
def convert_to_international_phonetic_alphabet(self, arpabet): ''' 转换成国际音标 :param arpabet: :return: ''' word = self._convert_to_word(arpabet=arpabet) if not word: return None return word.translate_to_international_phonetic_alphabet()
def convert_to_international_phonetic_alphabet(self, arpabet): ''' 转换成国际音标 :param arpabet: :return: ''' word = self._convert_to_word(arpabet=arpabet) if not word: return None return word.translate_to_international_phonetic_alphabet()
[ "转换成国际音标", ":", "param", "arpabet", ":", ":", "return", ":" ]
chdzq/ARPAbetAndIPAConvertor
python
https://github.com/chdzq/ARPAbetAndIPAConvertor/blob/e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26/arpabetandipaconvertor/arpabet2phoneticalphabet.py#L76-L88
[ "def", "convert_to_international_phonetic_alphabet", "(", "self", ",", "arpabet", ")", ":", "word", "=", "self", ".", "_convert_to_word", "(", "arpabet", "=", "arpabet", ")", "if", "not", "word", ":", "return", "None", "return", "word", ".", "translate_to_intern...
e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26
train
ARPAbet2PhoneticAlphabetConvertor.convert_to_american_phonetic_alphabet
转换成美音 :param arpabet: :return:
arpabetandipaconvertor/arpabet2phoneticalphabet.py
def convert_to_american_phonetic_alphabet(self, arpabet): ''' 转换成美音 :param arpabet: :return: ''' word = self._convert_to_word(arpabet=arpabet) if not word: return None return word.translate_to_american_phonetic_alphabet()
def convert_to_american_phonetic_alphabet(self, arpabet): ''' 转换成美音 :param arpabet: :return: ''' word = self._convert_to_word(arpabet=arpabet) if not word: return None return word.translate_to_american_phonetic_alphabet()
[ "转换成美音", ":", "param", "arpabet", ":", ":", "return", ":" ]
chdzq/ARPAbetAndIPAConvertor
python
https://github.com/chdzq/ARPAbetAndIPAConvertor/blob/e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26/arpabetandipaconvertor/arpabet2phoneticalphabet.py#L90-L102
[ "def", "convert_to_american_phonetic_alphabet", "(", "self", ",", "arpabet", ")", ":", "word", "=", "self", ".", "_convert_to_word", "(", "arpabet", "=", "arpabet", ")", "if", "not", "word", ":", "return", "None", "return", "word", ".", "translate_to_american_ph...
e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26
train
ARPAbet2PhoneticAlphabetConvertor.convert_to_english_phonetic_alphabet
转换成英音 :param arpabet: :return:
arpabetandipaconvertor/arpabet2phoneticalphabet.py
def convert_to_english_phonetic_alphabet(self, arpabet): ''' 转换成英音 :param arpabet: :return: ''' word = self._convert_to_word(arpabet=arpabet) if not word: return None return word.translate_to_english_phonetic_alphabet()
def convert_to_english_phonetic_alphabet(self, arpabet): ''' 转换成英音 :param arpabet: :return: ''' word = self._convert_to_word(arpabet=arpabet) if not word: return None return word.translate_to_english_phonetic_alphabet()
[ "转换成英音", ":", "param", "arpabet", ":", ":", "return", ":" ]
chdzq/ARPAbetAndIPAConvertor
python
https://github.com/chdzq/ARPAbetAndIPAConvertor/blob/e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26/arpabetandipaconvertor/arpabet2phoneticalphabet.py#L104-L116
[ "def", "convert_to_english_phonetic_alphabet", "(", "self", ",", "arpabet", ")", ":", "word", "=", "self", ".", "_convert_to_word", "(", "arpabet", "=", "arpabet", ")", "if", "not", "word", ":", "return", "None", "return", "word", ".", "translate_to_english_phon...
e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26
train
Syllable.translate_to_arpabet
转换成arpabet :return:
arpabetandipaconvertor/model/syllable.py
def translate_to_arpabet(self): ''' 转换成arpabet :return: ''' translations = [] for phoneme in self._phoneme_list: if phoneme.is_vowel: translations.append(phoneme.arpabet + self.stress.mark_arpabet()) else: translat...
def translate_to_arpabet(self): ''' 转换成arpabet :return: ''' translations = [] for phoneme in self._phoneme_list: if phoneme.is_vowel: translations.append(phoneme.arpabet + self.stress.mark_arpabet()) else: translat...
[ "转换成arpabet", ":", "return", ":" ]
chdzq/ARPAbetAndIPAConvertor
python
https://github.com/chdzq/ARPAbetAndIPAConvertor/blob/e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26/arpabetandipaconvertor/model/syllable.py#L41-L55
[ "def", "translate_to_arpabet", "(", "self", ")", ":", "translations", "=", "[", "]", "for", "phoneme", "in", "self", ".", "_phoneme_list", ":", "if", "phoneme", ".", "is_vowel", ":", "translations", ".", "append", "(", "phoneme", ".", "arpabet", "+", "self...
e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26
train
Syllable.translate_to_american_phonetic_alphabet
转换成美音音。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return:
arpabetandipaconvertor/model/syllable.py
def translate_to_american_phonetic_alphabet(self, hide_stress_mark=False): ''' 转换成美音音。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return: ''' translations = self.stress.mark_ipa() if (not hide_stress_mark) and self.have_vowel else "" for phoneme in self._phonem...
def translate_to_american_phonetic_alphabet(self, hide_stress_mark=False): ''' 转换成美音音。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return: ''' translations = self.stress.mark_ipa() if (not hide_stress_mark) and self.have_vowel else "" for phoneme in self._phonem...
[ "转换成美音音。只要一个元音的时候需要隐藏重音标识", ":", "param", "hide_stress_mark", ":", ":", "return", ":" ]
chdzq/ARPAbetAndIPAConvertor
python
https://github.com/chdzq/ARPAbetAndIPAConvertor/blob/e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26/arpabetandipaconvertor/model/syllable.py#L57-L70
[ "def", "translate_to_american_phonetic_alphabet", "(", "self", ",", "hide_stress_mark", "=", "False", ")", ":", "translations", "=", "self", ".", "stress", ".", "mark_ipa", "(", ")", "if", "(", "not", "hide_stress_mark", ")", "and", "self", ".", "have_vowel", ...
e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26
train
Syllable.translate_to_english_phonetic_alphabet
转换成英音。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return:
arpabetandipaconvertor/model/syllable.py
def translate_to_english_phonetic_alphabet(self, hide_stress_mark=False): ''' 转换成英音。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return: ''' translations = self.stress.mark_ipa() if (not hide_stress_mark) and self.have_vowel else "" for phoneme in self._phoneme_l...
def translate_to_english_phonetic_alphabet(self, hide_stress_mark=False): ''' 转换成英音。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return: ''' translations = self.stress.mark_ipa() if (not hide_stress_mark) and self.have_vowel else "" for phoneme in self._phoneme_l...
[ "转换成英音。只要一个元音的时候需要隐藏重音标识", ":", "param", "hide_stress_mark", ":", ":", "return", ":" ]
chdzq/ARPAbetAndIPAConvertor
python
https://github.com/chdzq/ARPAbetAndIPAConvertor/blob/e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26/arpabetandipaconvertor/model/syllable.py#L72-L84
[ "def", "translate_to_english_phonetic_alphabet", "(", "self", ",", "hide_stress_mark", "=", "False", ")", ":", "translations", "=", "self", ".", "stress", ".", "mark_ipa", "(", ")", "if", "(", "not", "hide_stress_mark", ")", "and", "self", ".", "have_vowel", "...
e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26
train
Syllable.translate_to_international_phonetic_alphabet
转换成国际音标。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return:
arpabetandipaconvertor/model/syllable.py
def translate_to_international_phonetic_alphabet(self, hide_stress_mark=False): ''' 转换成国际音标。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return: ''' translations = self.stress.mark_ipa() if (not hide_stress_mark) and self.have_vowel else "" for phoneme in self._p...
def translate_to_international_phonetic_alphabet(self, hide_stress_mark=False): ''' 转换成国际音标。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return: ''' translations = self.stress.mark_ipa() if (not hide_stress_mark) and self.have_vowel else "" for phoneme in self._p...
[ "转换成国际音标。只要一个元音的时候需要隐藏重音标识", ":", "param", "hide_stress_mark", ":", ":", "return", ":" ]
chdzq/ARPAbetAndIPAConvertor
python
https://github.com/chdzq/ARPAbetAndIPAConvertor/blob/e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26/arpabetandipaconvertor/model/syllable.py#L86-L98
[ "def", "translate_to_international_phonetic_alphabet", "(", "self", ",", "hide_stress_mark", "=", "False", ")", ":", "translations", "=", "self", ".", "stress", ".", "mark_ipa", "(", ")", "if", "(", "not", "hide_stress_mark", ")", "and", "self", ".", "have_vowel...
e8b2fdbb5b7134c4f779f4d6dcd5dc30979a0a26
train
ExampleHomePage.get_login_form_component
Initializes and returns the login form component @rtype: LoginForm @return: Initialized component
example/example_app/page_objects/example_home_page.py
def get_login_form_component(self): """Initializes and returns the login form component @rtype: LoginForm @return: Initialized component """ self.dw.wait_until( lambda: self.dw.is_present(LoginForm.locators.form), failure_message='login form was never pre...
def get_login_form_component(self): """Initializes and returns the login form component @rtype: LoginForm @return: Initialized component """ self.dw.wait_until( lambda: self.dw.is_present(LoginForm.locators.form), failure_message='login form was never pre...
[ "Initializes", "and", "returns", "the", "login", "form", "component" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/example/example_app/page_objects/example_home_page.py#L30-L46
[ "def", "get_login_form_component", "(", "self", ")", ":", "self", ".", "dw", ".", "wait_until", "(", "lambda", ":", "self", ".", "dw", ".", "is_present", "(", "LoginForm", ".", "locators", ".", "form", ")", ",", "failure_message", "=", "'login form was never...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
objectify
Converts a dictionary into a named tuple (shallow)
coyote_framework/util/apps/objects.py
def objectify(dictionary, name='Object'): """Converts a dictionary into a named tuple (shallow) """ o = namedtuple(name, dictionary.keys())(*dictionary.values()) return o
def objectify(dictionary, name='Object'): """Converts a dictionary into a named tuple (shallow) """ o = namedtuple(name, dictionary.keys())(*dictionary.values()) return o
[ "Converts", "a", "dictionary", "into", "a", "named", "tuple", "(", "shallow", ")" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/util/apps/objects.py#L6-L12
[ "def", "objectify", "(", "dictionary", ",", "name", "=", "'Object'", ")", ":", "o", "=", "namedtuple", "(", "name", ",", "dictionary", ".", "keys", "(", ")", ")", "(", "*", "dictionary", ".", "values", "(", ")", ")", "return", "o" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
train
create_directory
Creates a directory if it does not exist (in a thread-safe way) @param directory: The directory to create @return: The directory specified
coyote_framework/mixins/filesystem.py
def create_directory(directory): """Creates a directory if it does not exist (in a thread-safe way) @param directory: The directory to create @return: The directory specified """ try: os.makedirs(directory) except OSError, e: if e.errno == errno.EEXIST and os.path.isdir(director...
def create_directory(directory): """Creates a directory if it does not exist (in a thread-safe way) @param directory: The directory to create @return: The directory specified """ try: os.makedirs(directory) except OSError, e: if e.errno == errno.EEXIST and os.path.isdir(director...
[ "Creates", "a", "directory", "if", "it", "does", "not", "exist", "(", "in", "a", "thread", "-", "safe", "way", ")" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/mixins/filesystem.py#L7-L19
[ "def", "create_directory", "(", "directory", ")", ":", "try", ":", "os", ".", "makedirs", "(", "directory", ")", "except", "OSError", ",", "e", ":", "if", "e", ".", "errno", "==", "errno", ".", "EEXIST", "and", "os", ".", "path", ".", "isdir", "(", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.__add_query_comment
Adds a comment line to the query to be executed containing the line number of the calling function. This is useful for debugging slow queries, as the comment will show in the slow query log @type sql: str @param sql: sql needing comment @return:
coyote_framework/database/coyote_db.py
def __add_query_comment(sql): """ Adds a comment line to the query to be executed containing the line number of the calling function. This is useful for debugging slow queries, as the comment will show in the slow query log @type sql: str @param sql: sql needing comment...
def __add_query_comment(sql): """ Adds a comment line to the query to be executed containing the line number of the calling function. This is useful for debugging slow queries, as the comment will show in the slow query log @type sql: str @param sql: sql needing comment...
[ "Adds", "a", "comment", "line", "to", "the", "query", "to", "be", "executed", "containing", "the", "line", "number", "of", "the", "calling", "function", ".", "This", "is", "useful", "for", "debugging", "slow", "queries", "as", "the", "comment", "will", "sh...
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L74-L95
[ "def", "__add_query_comment", "(", "sql", ")", ":", "# Inspect the call stack for the originating call", "file_name", "=", "''", "line_number", "=", "''", "caller_frames", "=", "inspect", ".", "getouterframes", "(", "inspect", ".", "currentframe", "(", ")", ")", "fo...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.get_single_instance
Returns an instance of class_type populated with attributes from the DB record; throws an error if no records are found @param sql: Sql statement to execute @param class_type: The type of class to instantiate and populate with DB record @return: Return an instance with attributes set to...
coyote_framework/database/coyote_db.py
def get_single_instance(sql, class_type, *args, **kwargs): """Returns an instance of class_type populated with attributes from the DB record; throws an error if no records are found @param sql: Sql statement to execute @param class_type: The type of class to instantiate and populate wit...
def get_single_instance(sql, class_type, *args, **kwargs): """Returns an instance of class_type populated with attributes from the DB record; throws an error if no records are found @param sql: Sql statement to execute @param class_type: The type of class to instantiate and populate wit...
[ "Returns", "an", "instance", "of", "class_type", "populated", "with", "attributes", "from", "the", "DB", "record", ";", "throws", "an", "error", "if", "no", "records", "are", "found" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L109-L126
[ "def", "get_single_instance", "(", "sql", ",", "class_type", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "record", "=", "CoyoteDb", ".", "get_single_record", "(", "sql", ",", "*", "args", ",", "*", "*", "kwargs", ")", "try", ":", "instance", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.get_all_instances
Returns a list of instances of class_type populated with attributes from the DB record @param sql: Sql statement to execute @param class_type: The type of class to instantiate and populate with DB record @return: Return a list of instances with attributes set to values from DB
coyote_framework/database/coyote_db.py
def get_all_instances(sql, class_type, *args, **kwargs): """Returns a list of instances of class_type populated with attributes from the DB record @param sql: Sql statement to execute @param class_type: The type of class to instantiate and populate with DB record @return: Return a list ...
def get_all_instances(sql, class_type, *args, **kwargs): """Returns a list of instances of class_type populated with attributes from the DB record @param sql: Sql statement to execute @param class_type: The type of class to instantiate and populate with DB record @return: Return a list ...
[ "Returns", "a", "list", "of", "instances", "of", "class_type", "populated", "with", "attributes", "from", "the", "DB", "record" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L129-L141
[ "def", "get_all_instances", "(", "sql", ",", "class_type", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "records", "=", "CoyoteDb", ".", "get_all_records", "(", "sql", ",", "*", "args", ",", "*", "*", "kwargs", ")", "instances", "=", "[", "Co...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.escape_dictionary
Escape dictionary values with keys as column names and values column values @type dictionary: dict @param dictionary: Key-values
coyote_framework/database/coyote_db.py
def escape_dictionary(dictionary, datetime_format='%Y-%m-%d %H:%M:%S'): """Escape dictionary values with keys as column names and values column values @type dictionary: dict @param dictionary: Key-values """ for k, v in dictionary.iteritems(): if isinstance(v, dateti...
def escape_dictionary(dictionary, datetime_format='%Y-%m-%d %H:%M:%S'): """Escape dictionary values with keys as column names and values column values @type dictionary: dict @param dictionary: Key-values """ for k, v in dictionary.iteritems(): if isinstance(v, dateti...
[ "Escape", "dictionary", "values", "with", "keys", "as", "column", "names", "and", "values", "column", "values" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L144-L167
[ "def", "escape_dictionary", "(", "dictionary", ",", "datetime_format", "=", "'%Y-%m-%d %H:%M:%S'", ")", ":", "for", "k", ",", "v", "in", "dictionary", ".", "iteritems", "(", ")", ":", "if", "isinstance", "(", "v", ",", "datetime", ".", "datetime", ")", ":"...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.get_insert_fields_and_values_from_dict
Formats a dictionary to strings of fields and values for insert statements @param dictionary: The dictionary whose keys and values are to be inserted @param db_escape: If true, will db escape values @return: Tuple of strings containing string fields and values, e.g. ('user_id, username', '5, "p...
coyote_framework/database/coyote_db.py
def get_insert_fields_and_values_from_dict(dictionary, datetime_format='%Y-%m-%d %H:%M:%S', db_escape=True): """Formats a dictionary to strings of fields and values for insert statements @param dictionary: The dictionary whose keys and values are to be inserted @param db_escape: If true, will d...
def get_insert_fields_and_values_from_dict(dictionary, datetime_format='%Y-%m-%d %H:%M:%S', db_escape=True): """Formats a dictionary to strings of fields and values for insert statements @param dictionary: The dictionary whose keys and values are to be inserted @param db_escape: If true, will d...
[ "Formats", "a", "dictionary", "to", "strings", "of", "fields", "and", "values", "for", "insert", "statements" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L170-L183
[ "def", "get_insert_fields_and_values_from_dict", "(", "dictionary", ",", "datetime_format", "=", "'%Y-%m-%d %H:%M:%S'", ",", "db_escape", "=", "True", ")", ":", "if", "db_escape", ":", "CoyoteDb", ".", "escape_dictionary", "(", "dictionary", ",", "datetime_format", "=...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.get_kwargs
This method should be used in query functions where user can query on any number of fields >>> def get_instances(entity_id=NOTSET, my_field=NOTSET): >>> kwargs = CoyoteDb.get_kwargs(entity_id=entity_id, my_field=my_field)
coyote_framework/database/coyote_db.py
def get_kwargs(**kwargs): """This method should be used in query functions where user can query on any number of fields >>> def get_instances(entity_id=NOTSET, my_field=NOTSET): >>> kwargs = CoyoteDb.get_kwargs(entity_id=entity_id, my_field=my_field) """ d = dict() ...
def get_kwargs(**kwargs): """This method should be used in query functions where user can query on any number of fields >>> def get_instances(entity_id=NOTSET, my_field=NOTSET): >>> kwargs = CoyoteDb.get_kwargs(entity_id=entity_id, my_field=my_field) """ d = dict() ...
[ "This", "method", "should", "be", "used", "in", "query", "functions", "where", "user", "can", "query", "on", "any", "number", "of", "fields" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L186-L196
[ "def", "get_kwargs", "(", "*", "*", "kwargs", ")", ":", "d", "=", "dict", "(", ")", "for", "k", ",", "v", "in", "kwargs", ".", "iteritems", "(", ")", ":", "if", "v", "is", "not", "NOTSET", ":", "d", "[", "k", "]", "=", "v", "return", "d" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.get_update_clause_from_dict
Builds the update values clause of an update statement based on the dictionary representation of an instance
coyote_framework/database/coyote_db.py
def get_update_clause_from_dict(dictionary, datetime_format='%Y-%m-%d %H:%M:%S'): """Builds the update values clause of an update statement based on the dictionary representation of an instance""" items = [] CoyoteDb.escape_dictionary(dictionary, datetime_format=datetime_format) ...
def get_update_clause_from_dict(dictionary, datetime_format='%Y-%m-%d %H:%M:%S'): """Builds the update values clause of an update statement based on the dictionary representation of an instance""" items = [] CoyoteDb.escape_dictionary(dictionary, datetime_format=datetime_format) ...
[ "Builds", "the", "update", "values", "clause", "of", "an", "update", "statement", "based", "on", "the", "dictionary", "representation", "of", "an", "instance" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L199-L209
[ "def", "get_update_clause_from_dict", "(", "dictionary", ",", "datetime_format", "=", "'%Y-%m-%d %H:%M:%S'", ")", ":", "items", "=", "[", "]", "CoyoteDb", ".", "escape_dictionary", "(", "dictionary", ",", "datetime_format", "=", "datetime_format", ")", "for", "k", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.get_where_clause_from_dict
Builds a where clause from a dictionary
coyote_framework/database/coyote_db.py
def get_where_clause_from_dict(dictionary, join_operator='AND'): """Builds a where clause from a dictionary """ CoyoteDb.escape_dictionary(dictionary) clause = join_operator.join( (' {k} is {v} ' if str(v).lower() == 'null' else ' {k} = {v} ').format(k=k, v=v) # IS should be...
def get_where_clause_from_dict(dictionary, join_operator='AND'): """Builds a where clause from a dictionary """ CoyoteDb.escape_dictionary(dictionary) clause = join_operator.join( (' {k} is {v} ' if str(v).lower() == 'null' else ' {k} = {v} ').format(k=k, v=v) # IS should be...
[ "Builds", "a", "where", "clause", "from", "a", "dictionary" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L212-L219
[ "def", "get_where_clause_from_dict", "(", "dictionary", ",", "join_operator", "=", "'AND'", ")", ":", "CoyoteDb", ".", "escape_dictionary", "(", "dictionary", ")", "clause", "=", "join_operator", ".", "join", "(", "(", "' {k} is {v} '", "if", "str", "(", "v", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.get_dictionary_representation_of_object_attributes
Returns a dictionary of object's attributes, ignoring methods @param obj: The object to represent as dict @param omit_null_fields: If true, will not include fields in the dictionary that are null @return: Dictionary of the object's attributes
coyote_framework/database/coyote_db.py
def get_dictionary_representation_of_object_attributes(obj, omit_null_fields=False): """Returns a dictionary of object's attributes, ignoring methods @param obj: The object to represent as dict @param omit_null_fields: If true, will not include fields in the dictionary that are null @re...
def get_dictionary_representation_of_object_attributes(obj, omit_null_fields=False): """Returns a dictionary of object's attributes, ignoring methods @param obj: The object to represent as dict @param omit_null_fields: If true, will not include fields in the dictionary that are null @re...
[ "Returns", "a", "dictionary", "of", "object", "s", "attributes", "ignoring", "methods" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L222-L239
[ "def", "get_dictionary_representation_of_object_attributes", "(", "obj", ",", "omit_null_fields", "=", "False", ")", ":", "obj_dictionary", "=", "obj", ".", "__dict__", "obj_dictionary_temp", "=", "obj_dictionary", ".", "copy", "(", ")", "for", "k", ",", "v", "in"...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.get_object_from_dictionary_representation
Instantiates a new class (that takes no init params) and populates its attributes with a dictionary @type dictionary: dict @param dictionary: Dictionary representation of the object @param class_type: type @return: None
coyote_framework/database/coyote_db.py
def get_object_from_dictionary_representation(dictionary, class_type): """Instantiates a new class (that takes no init params) and populates its attributes with a dictionary @type dictionary: dict @param dictionary: Dictionary representation of the object @param class_type: type ...
def get_object_from_dictionary_representation(dictionary, class_type): """Instantiates a new class (that takes no init params) and populates its attributes with a dictionary @type dictionary: dict @param dictionary: Dictionary representation of the object @param class_type: type ...
[ "Instantiates", "a", "new", "class", "(", "that", "takes", "no", "init", "params", ")", "and", "populates", "its", "attributes", "with", "a", "dictionary" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L242-L256
[ "def", "get_object_from_dictionary_representation", "(", "dictionary", ",", "class_type", ")", ":", "assert", "inspect", ".", "isclass", "(", "class_type", ")", ",", "'Cannot instantiate an object that is not a class'", "instance", "=", "class_type", "(", ")", "CoyoteDb",...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.build_where_clause
Constructs the where clause based on a dictionary of values >>> build_where_clause({'id': 456, 'name': 'myrecord'}, operator='OR') >>> 'WHERE id = 456 OR name = "myrecord" '
coyote_framework/database/coyote_db.py
def build_where_clause(mappings, operator='AND'): """Constructs the where clause based on a dictionary of values >>> build_where_clause({'id': 456, 'name': 'myrecord'}, operator='OR') >>> 'WHERE id = 456 OR name = "myrecord" ' """ where_clause_mappings = {} where_clause...
def build_where_clause(mappings, operator='AND'): """Constructs the where clause based on a dictionary of values >>> build_where_clause({'id': 456, 'name': 'myrecord'}, operator='OR') >>> 'WHERE id = 456 OR name = "myrecord" ' """ where_clause_mappings = {} where_clause...
[ "Constructs", "the", "where", "clause", "based", "on", "a", "dictionary", "of", "values" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L259-L273
[ "def", "build_where_clause", "(", "mappings", ",", "operator", "=", "'AND'", ")", ":", "where_clause_mappings", "=", "{", "}", "where_clause_mappings", ".", "update", "(", "mappings", ")", "where_clause", "=", "'WHERE '", "+", "' {} '", ".", "format", "(", "op...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.execute
Executes the sql statement, but does not commit. Returns the cursor to commit @return: DB and cursor instance following sql execution
coyote_framework/database/coyote_db.py
def execute(*args, **kwargs): """Executes the sql statement, but does not commit. Returns the cursor to commit @return: DB and cursor instance following sql execution """ # Inspect the call stack for the originating call args = CoyoteDb.__add_query_comment(args[0]) db =...
def execute(*args, **kwargs): """Executes the sql statement, but does not commit. Returns the cursor to commit @return: DB and cursor instance following sql execution """ # Inspect the call stack for the originating call args = CoyoteDb.__add_query_comment(args[0]) db =...
[ "Executes", "the", "sql", "statement", "but", "does", "not", "commit", ".", "Returns", "the", "cursor", "to", "commit" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L276-L293
[ "def", "execute", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Inspect the call stack for the originating call", "args", "=", "CoyoteDb", ".", "__add_query_comment", "(", "args", "[", "0", "]", ")", "db", "=", "CoyoteDb", ".", "__get_db_write_instance...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.execute_read_only
Executes the sql statement, but does not commit. Returns the cursor to commit @return: DB and cursor instance following sql execution
coyote_framework/database/coyote_db.py
def execute_read_only(*args, **kwargs): # TODO: consolidate with execute """Executes the sql statement, but does not commit. Returns the cursor to commit @return: DB and cursor instance following sql execution """ # Inspect the call stack for the originating call args =...
def execute_read_only(*args, **kwargs): # TODO: consolidate with execute """Executes the sql statement, but does not commit. Returns the cursor to commit @return: DB and cursor instance following sql execution """ # Inspect the call stack for the originating call args =...
[ "Executes", "the", "sql", "statement", "but", "does", "not", "commit", ".", "Returns", "the", "cursor", "to", "commit" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L296-L313
[ "def", "execute_read_only", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# TODO: consolidate with execute", "# Inspect the call stack for the originating call", "args", "=", "CoyoteDb", ".", "__add_query_comment", "(", "args", "[", "0", "]", ")", "# Execute t...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.execute_and_commit
Executes and commits the sql statement @return: None
coyote_framework/database/coyote_db.py
def execute_and_commit(*args, **kwargs): """Executes and commits the sql statement @return: None """ db, cursor = CoyoteDb.execute(*args, **kwargs) db.commit() return cursor
def execute_and_commit(*args, **kwargs): """Executes and commits the sql statement @return: None """ db, cursor = CoyoteDb.execute(*args, **kwargs) db.commit() return cursor
[ "Executes", "and", "commits", "the", "sql", "statement" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L316-L323
[ "def", "execute_and_commit", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "db", ",", "cursor", "=", "CoyoteDb", ".", "execute", "(", "*", "args", ",", "*", "*", "kwargs", ")", "db", ".", "commit", "(", ")", "return", "cursor" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.insert_instance
Inserts an object's values into a given table, will not populate Nonetype values @param instance: Instance of an object to insert @param table: Table in which to insert instance values @return: ID of the last inserted row
coyote_framework/database/coyote_db.py
def insert_instance(instance, table, **kwargs): """Inserts an object's values into a given table, will not populate Nonetype values @param instance: Instance of an object to insert @param table: Table in which to insert instance values @return: ID of the last inserted row """ ...
def insert_instance(instance, table, **kwargs): """Inserts an object's values into a given table, will not populate Nonetype values @param instance: Instance of an object to insert @param table: Table in which to insert instance values @return: ID of the last inserted row """ ...
[ "Inserts", "an", "object", "s", "values", "into", "a", "given", "table", "will", "not", "populate", "Nonetype", "values" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L343-L366
[ "def", "insert_instance", "(", "instance", ",", "table", ",", "*", "*", "kwargs", ")", ":", "instancedict", "=", "instance", ".", "__dict__", ".", "copy", "(", ")", "instancedictclone", "=", "instancedict", ".", "copy", "(", ")", "# Remove all Nonetype values"...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.update
Updates and commits with an insert sql statement, returns the record, but with a small chance of a race condition @param sql: sql to execute @return: The last row inserted
coyote_framework/database/coyote_db.py
def update(sql, *args, **kwargs): """Updates and commits with an insert sql statement, returns the record, but with a small chance of a race condition @param sql: sql to execute @return: The last row inserted """ assert "update" in sql.lower(), 'This function requires an...
def update(sql, *args, **kwargs): """Updates and commits with an insert sql statement, returns the record, but with a small chance of a race condition @param sql: sql to execute @return: The last row inserted """ assert "update" in sql.lower(), 'This function requires an...
[ "Updates", "and", "commits", "with", "an", "insert", "sql", "statement", "returns", "the", "record", "but", "with", "a", "small", "chance", "of", "a", "race", "condition" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L369-L382
[ "def", "update", "(", "sql", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "assert", "\"update\"", "in", "sql", ".", "lower", "(", ")", ",", "'This function requires an update statement, provided: {}'", ".", "format", "(", "sql", ")", "cursor", "=", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.delete
Deletes and commits with an insert sql statement
coyote_framework/database/coyote_db.py
def delete(sql, *args, **kwargs): """Deletes and commits with an insert sql statement""" assert "delete" in sql.lower(), 'This function requires a delete statement, provided: {}'.format(sql) CoyoteDb.execute_and_commit(sql, *args, **kwargs)
def delete(sql, *args, **kwargs): """Deletes and commits with an insert sql statement""" assert "delete" in sql.lower(), 'This function requires a delete statement, provided: {}'.format(sql) CoyoteDb.execute_and_commit(sql, *args, **kwargs)
[ "Deletes", "and", "commits", "with", "an", "insert", "sql", "statement" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L385-L388
[ "def", "delete", "(", "sql", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "assert", "\"delete\"", "in", "sql", ".", "lower", "(", ")", ",", "'This function requires a delete statement, provided: {}'", ".", "format", "(", "sql", ")", "CoyoteDb", ".", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.update_object_from_dictionary_representation
Given a dictionary and an object instance, will set all object attributes equal to the dictionary's keys and values. Assumes dictionary does not have any keys for which object does not have attributes @type dictionary: dict @param dictionary: Dictionary representation of the object @par...
coyote_framework/database/coyote_db.py
def update_object_from_dictionary_representation(dictionary, instance): """Given a dictionary and an object instance, will set all object attributes equal to the dictionary's keys and values. Assumes dictionary does not have any keys for which object does not have attributes @type dictionary: d...
def update_object_from_dictionary_representation(dictionary, instance): """Given a dictionary and an object instance, will set all object attributes equal to the dictionary's keys and values. Assumes dictionary does not have any keys for which object does not have attributes @type dictionary: d...
[ "Given", "a", "dictionary", "and", "an", "object", "instance", "will", "set", "all", "object", "attributes", "equal", "to", "the", "dictionary", "s", "keys", "and", "values", ".", "Assumes", "dictionary", "does", "not", "have", "any", "keys", "for", "which",...
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L391-L404
[ "def", "update_object_from_dictionary_representation", "(", "dictionary", ",", "instance", ")", ":", "for", "key", ",", "value", "in", "dictionary", ".", "iteritems", "(", ")", ":", "if", "hasattr", "(", "instance", ",", "key", ")", ":", "setattr", "(", "ins...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.format_time
Formats a time to be Shapeways database-compatible @param time: Datetime or string object to format @rtype: str @return: Time formatted as a string
coyote_framework/database/coyote_db.py
def format_time(time): """Formats a time to be Shapeways database-compatible @param time: Datetime or string object to format @rtype: str @return: Time formatted as a string """ # Handle time typing try: time = time.isoformat() except Attribut...
def format_time(time): """Formats a time to be Shapeways database-compatible @param time: Datetime or string object to format @rtype: str @return: Time formatted as a string """ # Handle time typing try: time = time.isoformat() except Attribut...
[ "Formats", "a", "time", "to", "be", "Shapeways", "database", "-", "compatible" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L407-L421
[ "def", "format_time", "(", "time", ")", ":", "# Handle time typing", "try", ":", "time", "=", "time", ".", "isoformat", "(", ")", "except", "AttributeError", ":", "# Not a datetime object", "time", "=", "str", "(", "time", ")", "time", "=", "parser", ".", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDb.format_date
Formats a date to be Shapeways database-compatible @param date: Datetime or string object to format @rtype: str @return: Date formatted as a string
coyote_framework/database/coyote_db.py
def format_date(date): """Formats a date to be Shapeways database-compatible @param date: Datetime or string object to format @rtype: str @return: Date formatted as a string """ # Handle time typing try: date = date.isoformat() except Attribut...
def format_date(date): """Formats a date to be Shapeways database-compatible @param date: Datetime or string object to format @rtype: str @return: Date formatted as a string """ # Handle time typing try: date = date.isoformat() except Attribut...
[ "Formats", "a", "date", "to", "be", "Shapeways", "database", "-", "compatible" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_db.py#L424-L438
[ "def", "format_date", "(", "date", ")", ":", "# Handle time typing", "try", ":", "date", "=", "date", ".", "isoformat", "(", ")", "except", "AttributeError", ":", "# Not a datetime object", "date", "=", "str", "(", "date", ")", "date", "=", "parser", ".", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.visit
Driver gets the provided url in the browser, returns True if successful url -- An absolute or relative url stored as a string
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def visit(self, url=''): """ Driver gets the provided url in the browser, returns True if successful url -- An absolute or relative url stored as a string """ def _visit(url): if len(url) > 0 and url[0] == '/': # url's first character is a forward sla...
def visit(self, url=''): """ Driver gets the provided url in the browser, returns True if successful url -- An absolute or relative url stored as a string """ def _visit(url): if len(url) > 0 and url[0] == '/': # url's first character is a forward sla...
[ "Driver", "gets", "the", "provided", "url", "in", "the", "browser", "returns", "True", "if", "successful" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L201-L224
[ "def", "visit", "(", "self", ",", "url", "=", "''", ")", ":", "def", "_visit", "(", "url", ")", ":", "if", "len", "(", "url", ")", ">", "0", "and", "url", "[", "0", "]", "==", "'/'", ":", "# url's first character is a forward slash; treat as relative pat...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.is_alert_present
Tests if an alert is present @return: True if alert is present, False otherwise
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def is_alert_present(self): """Tests if an alert is present @return: True if alert is present, False otherwise """ current_frame = None try: current_frame = self.driver.current_window_handle a = self.driver.switch_to_alert() a.text exc...
def is_alert_present(self): """Tests if an alert is present @return: True if alert is present, False otherwise """ current_frame = None try: current_frame = self.driver.current_window_handle a = self.driver.switch_to_alert() a.text exc...
[ "Tests", "if", "an", "alert", "is", "present" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L258-L277
[ "def", "is_alert_present", "(", "self", ")", ":", "current_frame", "=", "None", "try", ":", "current_frame", "=", "self", ".", "driver", ".", "current_window_handle", "a", "=", "self", ".", "driver", ".", "switch_to_alert", "(", ")", "a", ".", "text", "exc...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.find
Attempts to locate an element, trying the number of times specified by the driver wrapper; Will throw a WebDriverWrapperException if no element is found @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query the element ...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def find(self, locator, find_all=False, search_object=None, force_find=False, exclude_invisible=False): """ Attempts to locate an element, trying the number of times specified by the driver wrapper; Will throw a WebDriverWrapperException if no element is found @type locator: we...
def find(self, locator, find_all=False, search_object=None, force_find=False, exclude_invisible=False): """ Attempts to locate an element, trying the number of times specified by the driver wrapper; Will throw a WebDriverWrapperException if no element is found @type locator: we...
[ "Attempts", "to", "locate", "an", "element", "trying", "the", "number", "of", "times", "specified", "by", "the", "driver", "wrapper", ";", "Will", "throw", "a", "WebDriverWrapperException", "if", "no", "element", "is", "found" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L318-L387
[ "def", "find", "(", "self", ",", "locator", ",", "find_all", "=", "False", ",", "search_object", "=", "None", ",", "force_find", "=", "False", ",", "exclude_invisible", "=", "False", ")", ":", "search_object", "=", "self", ".", "driver", "if", "search_obje...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper._find_immediately
Attempts to immediately find elements on the page without waiting @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @type search_object: webdriverwrapper.WebElementWrapper @param search_object: Optional WebElement to ...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def _find_immediately(self, locator, search_object=None): ''' Attempts to immediately find elements on the page without waiting @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @type search_object: webdriverwra...
def _find_immediately(self, locator, search_object=None): ''' Attempts to immediately find elements on the page without waiting @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @type search_object: webdriverwra...
[ "Attempts", "to", "immediately", "find", "elements", "on", "the", "page", "without", "waiting" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L389-L404
[ "def", "_find_immediately", "(", "self", ",", "locator", ",", "search_object", "=", "None", ")", ":", "search_object", "=", "self", ".", "driver", "if", "search_object", "is", "None", "else", "search_object", "elements", "=", "self", ".", "locator_handler", "....
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.find_all
Find all elements matching locator @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @rtype: list[WebElementWrapper] @return: list of WebElementWrappers
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def find_all(self, locator, search_object=None, force_find=False): ''' Find all elements matching locator @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @rtype: list[WebElementWrapper] @...
def find_all(self, locator, search_object=None, force_find=False): ''' Find all elements matching locator @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @rtype: list[WebElementWrapper] @...
[ "Find", "all", "elements", "matching", "locator" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L406-L416
[ "def", "find_all", "(", "self", ",", "locator", ",", "search_object", "=", "None", ",", "force_find", "=", "False", ")", ":", "return", "self", ".", "find", "(", "locator", "=", "locator", ",", "find_all", "=", "True", ",", "search_object", "=", "search_...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.find_by_dynamic_locator
Find with dynamic locator @type template_locator: webdriverwrapper.support.locator.Locator @param template_locator: Template locator w/ formatting bits to insert @type variables: dict @param variables: Dictionary of variable substitutions ...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def find_by_dynamic_locator(self, template_locator, variables, find_all=False, search_object=None): ''' Find with dynamic locator @type template_locator: webdriverwrapper.support.locator.Locator @param template_locator: Template locator w/ formatting bits to insert ...
def find_by_dynamic_locator(self, template_locator, variables, find_all=False, search_object=None): ''' Find with dynamic locator @type template_locator: webdriverwrapper.support.locator.Locator @param template_locator: Template locator w/ formatting bits to insert ...
[ "Find", "with", "dynamic", "locator" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L418-L446
[ "def", "find_by_dynamic_locator", "(", "self", ",", "template_locator", ",", "variables", ",", "find_all", "=", "False", ",", "search_object", "=", "None", ")", ":", "template_variable_character", "=", "'%'", "# raise an exception if user passed non-dictionary variables", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.is_present
Determines whether an element is present on the page, retrying once if unable to locate @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query the element @type search_object: webdriverwrapper.W...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def is_present(self, locator, search_object=None): """ Determines whether an element is present on the page, retrying once if unable to locate @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query...
def is_present(self, locator, search_object=None): """ Determines whether an element is present on the page, retrying once if unable to locate @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query...
[ "Determines", "whether", "an", "element", "is", "present", "on", "the", "page", "retrying", "once", "if", "unable", "to", "locate" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L463-L478
[ "def", "is_present", "(", "self", ",", "locator", ",", "search_object", "=", "None", ")", ":", "all_elements", "=", "self", ".", "_find_immediately", "(", "locator", ",", "search_object", "=", "search_object", ")", "if", "all_elements", "is", "not", "None", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.is_present_no_wait
Determines whether an element is present on the page with no wait @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query the element
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def is_present_no_wait(self, locator): """ Determines whether an element is present on the page with no wait @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query the element """ # first attempt to locate the el...
def is_present_no_wait(self, locator): """ Determines whether an element is present on the page with no wait @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query the element """ # first attempt to locate the el...
[ "Determines", "whether", "an", "element", "is", "present", "on", "the", "page", "with", "no", "wait" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L481-L498
[ "def", "is_present_no_wait", "(", "self", ",", "locator", ")", ":", "# first attempt to locate the element", "def", "execute", "(", ")", ":", "'''\n Generic function to execute wait\n '''", "return", "True", "if", "len", "(", "self", ".", "locator_ha...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until
Base wait method: called by other wait functions to execute wait @type wait_function: types.FunctionType @param wait_function: Generic function to be executed @type failure_message: str @param failure_message: Message to fail with if exception is raised @type timeout: ...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until(self, wait_function, failure_message=None, timeout=None): """ Base wait method: called by other wait functions to execute wait @type wait_function: types.FunctionType @param wait_function: Generic function to be executed @type failure_message: str @p...
def wait_until(self, wait_function, failure_message=None, timeout=None): """ Base wait method: called by other wait functions to execute wait @type wait_function: types.FunctionType @param wait_function: Generic function to be executed @type failure_message: str @p...
[ "Base", "wait", "method", ":", "called", "by", "other", "wait", "functions", "to", "execute", "wait" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L505-L529
[ "def", "wait_until", "(", "self", ",", "wait_function", ",", "failure_message", "=", "None", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "failure_message", "=", "fa...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_present
Waits for an element to be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: ...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_present(self, locator, timeout=None, failure_message='Timeout waiting for element to be present'): """ Waits for an element to be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @...
def wait_until_present(self, locator, timeout=None, failure_message='Timeout waiting for element to be present'): """ Waits for an element to be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @...
[ "Waits", "for", "an", "element", "to", "be", "present" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L544-L567
[ "def", "wait_until_present", "(", "self", ",", "locator", ",", "timeout", "=", "None", ",", "failure_message", "=", "'Timeout waiting for element to be present'", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "ti...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_not_present
Waits for an element to no longer be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @r...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_not_present(self, locator, timeout=None): """ Waits for an element to no longer be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the...
def wait_until_not_present(self, locator, timeout=None): """ Waits for an element to no longer be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the...
[ "Waits", "for", "an", "element", "to", "no", "longer", "be", "present" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L569-L592
[ "def", "wait_until_not_present", "(", "self", ",", "locator", ",", "timeout", "=", "None", ")", ":", "# TODO: rethink about neg case with is_present and waiting too long", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout",...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_invisibility_of
Waits for an element to be invisible @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: ...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_invisibility_of(self, locator, timeout=None): """ Waits for an element to be invisible @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the max...
def wait_until_invisibility_of(self, locator, timeout=None): """ Waits for an element to be invisible @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the max...
[ "Waits", "for", "an", "element", "to", "be", "invisible" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L624-L647
[ "def", "wait_until_invisibility_of", "(", "self", ",", "locator", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait fun...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_clickable
Waits for an element to be clickable @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: ...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_clickable(self, locator, timeout=None): """ Waits for an element to be clickable @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum n...
def wait_until_clickable(self, locator, timeout=None): """ Waits for an element to be clickable @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum n...
[ "Waits", "for", "an", "element", "to", "be", "clickable" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L649-L673
[ "def", "wait_until_clickable", "(", "self", ",", "locator", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait function ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_stale
Waits for an element to be stale in the DOM @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rt...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_stale(self, locator, timeout=None): """ Waits for an element to be stale in the DOM @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximu...
def wait_until_stale(self, locator, timeout=None): """ Waits for an element to be stale in the DOM @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximu...
[ "Waits", "for", "an", "element", "to", "be", "stale", "in", "the", "DOM" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L675-L699
[ "def", "wait_until_stale", "(", "self", ",", "locator", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait function pass...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_title_contains
Waits for title to contain <partial_title> @type partial_title: str @param partial_title: the partial title to locate @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverw...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_title_contains(self, partial_title, timeout=None): """ Waits for title to contain <partial_title> @type partial_title: str @param partial_title: the partial title to locate @type timeout: int @param timeout: the maximum number of seco...
def wait_until_title_contains(self, partial_title, timeout=None): """ Waits for title to contain <partial_title> @type partial_title: str @param partial_title: the partial title to locate @type timeout: int @param timeout: the maximum number of seco...
[ "Waits", "for", "title", "to", "contain", "<partial_title", ">" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L702-L723
[ "def", "wait_until_title_contains", "(", "self", ",", "partial_title", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wai...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_title_is
Waits for title to be exactly <partial_title> @type title: str @param title: the exact title to locate @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverwrapper.WebEleme...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_title_is(self, title, timeout=None): """ Waits for title to be exactly <partial_title> @type title: str @param title: the exact title to locate @type timeout: int @param timeout: the maximum number of seconds the driver will wait befo...
def wait_until_title_is(self, title, timeout=None): """ Waits for title to be exactly <partial_title> @type title: str @param title: the exact title to locate @type timeout: int @param timeout: the maximum number of seconds the driver will wait befo...
[ "Waits", "for", "title", "to", "be", "exactly", "<partial_title", ">" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L725-L746
[ "def", "wait_until_title_is", "(", "self", ",", "title", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait function pas...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_alert_is_present
Waits for an alert to be present @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverwrapper.WebElementWrapper @return: Returns the element found
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_alert_is_present(self, timeout=None): """ Waits for an alert to be present @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverwrapper.WebElementWrapper ...
def wait_until_alert_is_present(self, timeout=None): """ Waits for an alert to be present @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverwrapper.WebElementWrapper ...
[ "Waits", "for", "an", "alert", "to", "be", "present" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L747-L767
[ "def", "wait_until_alert_is_present", "(", "self", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "locator", "=", "None", "def", "wait", "(", ")", ":", "'''\n ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_text_contains
Waits for an element's text to contain <text> @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type text: str @param text: the text to search for @type timeout: int @par...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_text_contains(self, locator, text, timeout=None): """ Waits for an element's text to contain <text> @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type text: str @param tex...
def wait_until_text_contains(self, locator, text, timeout=None): """ Waits for an element's text to contain <text> @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type text: str @param tex...
[ "Waits", "for", "an", "element", "s", "text", "to", "contain", "<text", ">" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L769-L796
[ "def", "wait_until_text_contains", "(", "self", ",", "locator", ",", "text", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "this", "=", "self", "self", ".", "wait_f...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_text_is_not_empty
Waits for an element's text to not be empty @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out ...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_text_is_not_empty(self, locator, timeout=None): """ Waits for an element's text to not be empty @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type timeout: int @param timeout...
def wait_until_text_is_not_empty(self, locator, timeout=None): """ Waits for an element's text to not be empty @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type timeout: int @param timeout...
[ "Waits", "for", "an", "element", "s", "text", "to", "not", "be", "empty" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L827-L851
[ "def", "wait_until_text_is_not_empty", "(", "self", ",", "locator", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "self", ".", "wait_for", "(", "locator", ")", "# fir...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_page_source_contains
Waits for the page source to contain <text> @type text: str @param text: the text to search for @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverwrapp...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_page_source_contains(self, text, timeout=None): """ Waits for the page source to contain <text> @type text: str @param text: the text to search for @type timeout: int @param timeout: the maximum number of seconds the...
def wait_until_page_source_contains(self, text, timeout=None): """ Waits for the page source to contain <text> @type text: str @param text: the text to search for @type timeout: int @param timeout: the maximum number of seconds the...
[ "Waits", "for", "the", "page", "source", "to", "contain", "<text", ">" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L853-L875
[ "def", "wait_until_page_source_contains", "(", "self", ",", "text", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait f...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.wait_until_jquery_requests_are_closed
Waits for AJAX requests made through @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @return: None
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def wait_until_jquery_requests_are_closed(self, timeout=None): """Waits for AJAX requests made through @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @return: None """ timeout = timeout if timeout is not Non...
def wait_until_jquery_requests_are_closed(self, timeout=None): """Waits for AJAX requests made through @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @return: None """ timeout = timeout if timeout is not Non...
[ "Waits", "for", "AJAX", "requests", "made", "through" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L877-L895
[ "def", "wait_until_jquery_requests_are_closed", "(", "self", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait function pas...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.execute_and_handle_webdriver_exceptions
Executor for wait functions @type function_to_execute: types.FunctionType @param function_to_execute: wait function specifying the type of wait @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @type...
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def execute_and_handle_webdriver_exceptions(self, function_to_execute, timeout=None, locator=None, failure_message=None): """ Executor for wait functions @type function_to_execute: types.FunctionType @param function_to_execute: wait function specifying the type of wait @type ti...
def execute_and_handle_webdriver_exceptions(self, function_to_execute, timeout=None, locator=None, failure_message=None): """ Executor for wait functions @type function_to_execute: types.FunctionType @param function_to_execute: wait function specifying the type of wait @type ti...
[ "Executor", "for", "wait", "functions" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L897-L948
[ "def", "execute_and_handle_webdriver_exceptions", "(", "self", ",", "function_to_execute", ",", "timeout", "=", "None", ",", "locator", "=", "None", ",", "failure_message", "=", "None", ")", ":", "logger", "=", "logging", ".", "getLogger", "(", "__name__", ")", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.pause_and_wait_for_user
Injects a radio button into the page and waits for the user to click it; will raise an exception if the radio to resume is never checked @return: None
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def pause_and_wait_for_user(self, timeout=None, prompt_text='Click to resume (WebDriver is paused)'): """Injects a radio button into the page and waits for the user to click it; will raise an exception if the radio to resume is never checked @return: None """ timeout = timeout i...
def pause_and_wait_for_user(self, timeout=None, prompt_text='Click to resume (WebDriver is paused)'): """Injects a radio button into the page and waits for the user to click it; will raise an exception if the radio to resume is never checked @return: None """ timeout = timeout i...
[ "Injects", "a", "radio", "button", "into", "the", "page", "and", "waits", "for", "the", "user", "to", "click", "it", ";", "will", "raise", "an", "exception", "if", "the", "radio", "to", "resume", "is", "never", "checked" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L975-L1029
[ "def", "pause_and_wait_for_user", "(", "self", ",", "timeout", "=", "None", ",", "prompt_text", "=", "'Click to resume (WebDriver is paused)'", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "user_wait_timeout", "# ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.get_browser_log
Gets the console log of the browser @type levels: @return: List of browser log entries
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def get_browser_log(self, levels=None): """Gets the console log of the browser @type levels: @return: List of browser log entries """ logs = self.driver.get_log('browser') self.browser_logs += logs if levels is not None: logs = [entry for entry in log...
def get_browser_log(self, levels=None): """Gets the console log of the browser @type levels: @return: List of browser log entries """ logs = self.driver.get_log('browser') self.browser_logs += logs if levels is not None: logs = [entry for entry in log...
[ "Gets", "the", "console", "log", "of", "the", "browser" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L1093-L1103
[ "def", "get_browser_log", "(", "self", ",", "levels", "=", "None", ")", ":", "logs", "=", "self", ".", "driver", ".", "get_log", "(", "'browser'", ")", "self", ".", "browser_logs", "+=", "logs", "if", "levels", "is", "not", "None", ":", "logs", "=", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
WebDriverWrapper.quit
Close driver and kill all associated displays
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
def quit(self): """Close driver and kill all associated displays """ # Kill the driver def _quit(): try: self.driver.quit() except Exception, err_driver: os.kill(self.driver_pid, signal.SIGKILL) raise f...
def quit(self): """Close driver and kill all associated displays """ # Kill the driver def _quit(): try: self.driver.quit() except Exception, err_driver: os.kill(self.driver_pid, signal.SIGKILL) raise f...
[ "Close", "driver", "and", "kill", "all", "associated", "displays" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L1120-L1140
[ "def", "quit", "(", "self", ")", ":", "# Kill the driver", "def", "_quit", "(", ")", ":", "try", ":", "self", ".", "driver", ".", "quit", "(", ")", "except", "Exception", ",", "err_driver", ":", "os", ".", "kill", "(", "self", ".", "driver_pid", ",",...
cb29899b984a21d56bf65d0b1d907073948fe16c
train
CoyoteDriver.visit
Visit the url, checking for rr errors in the response @param url: URL @return: Visit result
coyote_framework/drivers/coyote_driver.py
def visit(self, url=''): """Visit the url, checking for rr errors in the response @param url: URL @return: Visit result """ result = super(CoyoteDriver, self).visit(url) source = self.page_source() return result
def visit(self, url=''): """Visit the url, checking for rr errors in the response @param url: URL @return: Visit result """ result = super(CoyoteDriver, self).visit(url) source = self.page_source() return result
[ "Visit", "the", "url", "checking", "for", "rr", "errors", "in", "the", "response" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/drivers/coyote_driver.py#L8-L16
[ "def", "visit", "(", "self", ",", "url", "=", "''", ")", ":", "result", "=", "super", "(", "CoyoteDriver", ",", "self", ")", ".", "visit", "(", "url", ")", "source", "=", "self", ".", "page_source", "(", ")", "return", "result" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
train
load_config_vars
Loads all attributes from source config into target config @type target_config: TestRunConfigManager @param target_config: Config to dump variables into @type source_config: TestRunConfigManager @param source_config: The other config @return: True
coyote_framework/config/abstract_config.py
def load_config_vars(target_config, source_config): """Loads all attributes from source config into target config @type target_config: TestRunConfigManager @param target_config: Config to dump variables into @type source_config: TestRunConfigManager @param source_config: The other config @retur...
def load_config_vars(target_config, source_config): """Loads all attributes from source config into target config @type target_config: TestRunConfigManager @param target_config: Config to dump variables into @type source_config: TestRunConfigManager @param source_config: The other config @retur...
[ "Loads", "all", "attributes", "from", "source", "config", "into", "target", "config" ]
Shapeways/coyote_framework
python
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/config/abstract_config.py#L100-L116
[ "def", "load_config_vars", "(", "target_config", ",", "source_config", ")", ":", "# Overwrite all attributes in config with new config", "for", "attr", "in", "dir", "(", "source_config", ")", ":", "# skip all private class attrs", "if", "attr", ".", "startswith", "(", "...
cb29899b984a21d56bf65d0b1d907073948fe16c