repo
stringlengths
7
55
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
19
28.4k
docstring
stringlengths
1
46.9k
docstring_tokens
listlengths
1
1.97k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
MediaFire/mediafire-python-open-sdk
mediafire/uploader.py
MediaFireUploader.upload
def upload(self, fd, name=None, folder_key=None, filedrop_key=None, path=None, action_on_duplicate=None): """Upload file, returns UploadResult object fd -- file-like object to upload from, expects exclusive access name -- file name folder_key -- folderkey of the target fo...
python
def upload(self, fd, name=None, folder_key=None, filedrop_key=None, path=None, action_on_duplicate=None): """Upload file, returns UploadResult object fd -- file-like object to upload from, expects exclusive access name -- file name folder_key -- folderkey of the target fo...
[ "def", "upload", "(", "self", ",", "fd", ",", "name", "=", "None", ",", "folder_key", "=", "None", ",", "filedrop_key", "=", "None", ",", "path", "=", "None", ",", "action_on_duplicate", "=", "None", ")", ":", "# Get file handle content length in the most reli...
Upload file, returns UploadResult object fd -- file-like object to upload from, expects exclusive access name -- file name folder_key -- folderkey of the target folder path -- path to file relative to folder_key filedrop_key -- filedrop to use instead of folder_key actio...
[ "Upload", "file", "returns", "UploadResult", "object" ]
8f1f23db1b16f16e026f5c6777aec32d00baa05f
https://github.com/MediaFire/mediafire-python-open-sdk/blob/8f1f23db1b16f16e026f5c6777aec32d00baa05f/mediafire/uploader.py#L198-L289
train
MediaFire/mediafire-python-open-sdk
mediafire/uploader.py
MediaFireUploader._poll_upload
def _poll_upload(self, upload_key, action): """Poll upload until quickkey is found upload_key -- upload_key returned by upload/* functions """ if len(upload_key) != UPLOAD_KEY_LENGTH: # not a regular 11-char-long upload key # There is no API to poll filedrop upl...
python
def _poll_upload(self, upload_key, action): """Poll upload until quickkey is found upload_key -- upload_key returned by upload/* functions """ if len(upload_key) != UPLOAD_KEY_LENGTH: # not a regular 11-char-long upload key # There is no API to poll filedrop upl...
[ "def", "_poll_upload", "(", "self", ",", "upload_key", ",", "action", ")", ":", "if", "len", "(", "upload_key", ")", "!=", "UPLOAD_KEY_LENGTH", ":", "# not a regular 11-char-long upload key", "# There is no API to poll filedrop uploads", "return", "UploadResult", "(", "...
Poll upload until quickkey is found upload_key -- upload_key returned by upload/* functions
[ "Poll", "upload", "until", "quickkey", "is", "found" ]
8f1f23db1b16f16e026f5c6777aec32d00baa05f
https://github.com/MediaFire/mediafire-python-open-sdk/blob/8f1f23db1b16f16e026f5c6777aec32d00baa05f/mediafire/uploader.py#L292-L351
train
MediaFire/mediafire-python-open-sdk
mediafire/uploader.py
MediaFireUploader._upload_check
def _upload_check(self, upload_info, resumable=False): """Wrapper around upload/check""" return self._api.upload_check( filename=upload_info.name, size=upload_info.size, hash_=upload_info.hash_info.file, folder_key=upload_info.folder_key, filed...
python
def _upload_check(self, upload_info, resumable=False): """Wrapper around upload/check""" return self._api.upload_check( filename=upload_info.name, size=upload_info.size, hash_=upload_info.hash_info.file, folder_key=upload_info.folder_key, filed...
[ "def", "_upload_check", "(", "self", ",", "upload_info", ",", "resumable", "=", "False", ")", ":", "return", "self", ".", "_api", ".", "upload_check", "(", "filename", "=", "upload_info", ".", "name", ",", "size", "=", "upload_info", ".", "size", ",", "h...
Wrapper around upload/check
[ "Wrapper", "around", "upload", "/", "check" ]
8f1f23db1b16f16e026f5c6777aec32d00baa05f
https://github.com/MediaFire/mediafire-python-open-sdk/blob/8f1f23db1b16f16e026f5c6777aec32d00baa05f/mediafire/uploader.py#L353-L363
train
MediaFire/mediafire-python-open-sdk
mediafire/uploader.py
MediaFireUploader._upload_none
def _upload_none(self, upload_info, check_result): """Dummy upload function for when we don't actually upload""" return UploadResult( action=None, quickkey=check_result['duplicate_quickkey'], hash_=upload_info.hash_info.file, filename=upload_info.name, ...
python
def _upload_none(self, upload_info, check_result): """Dummy upload function for when we don't actually upload""" return UploadResult( action=None, quickkey=check_result['duplicate_quickkey'], hash_=upload_info.hash_info.file, filename=upload_info.name, ...
[ "def", "_upload_none", "(", "self", ",", "upload_info", ",", "check_result", ")", ":", "return", "UploadResult", "(", "action", "=", "None", ",", "quickkey", "=", "check_result", "[", "'duplicate_quickkey'", "]", ",", "hash_", "=", "upload_info", ".", "hash_in...
Dummy upload function for when we don't actually upload
[ "Dummy", "upload", "function", "for", "when", "we", "don", "t", "actually", "upload" ]
8f1f23db1b16f16e026f5c6777aec32d00baa05f
https://github.com/MediaFire/mediafire-python-open-sdk/blob/8f1f23db1b16f16e026f5c6777aec32d00baa05f/mediafire/uploader.py#L367-L377
train
MediaFire/mediafire-python-open-sdk
mediafire/uploader.py
MediaFireUploader._upload_instant
def _upload_instant(self, upload_info, _=None): """Instant upload and return quickkey Can be used when the file is already stored somewhere in MediaFire upload_info -- UploadInfo object check_result -- ignored """ result = self._api.upload_instant( upload_i...
python
def _upload_instant(self, upload_info, _=None): """Instant upload and return quickkey Can be used when the file is already stored somewhere in MediaFire upload_info -- UploadInfo object check_result -- ignored """ result = self._api.upload_instant( upload_i...
[ "def", "_upload_instant", "(", "self", ",", "upload_info", ",", "_", "=", "None", ")", ":", "result", "=", "self", ".", "_api", ".", "upload_instant", "(", "upload_info", ".", "name", ",", "upload_info", ".", "size", ",", "upload_info", ".", "hash_info", ...
Instant upload and return quickkey Can be used when the file is already stored somewhere in MediaFire upload_info -- UploadInfo object check_result -- ignored
[ "Instant", "upload", "and", "return", "quickkey" ]
8f1f23db1b16f16e026f5c6777aec32d00baa05f
https://github.com/MediaFire/mediafire-python-open-sdk/blob/8f1f23db1b16f16e026f5c6777aec32d00baa05f/mediafire/uploader.py#L380-L407
train
MediaFire/mediafire-python-open-sdk
mediafire/uploader.py
MediaFireUploader._upload_simple
def _upload_simple(self, upload_info, _=None): """Simple upload and return quickkey Can be used for small files smaller than UPLOAD_SIMPLE_LIMIT_BYTES upload_info -- UploadInfo object check_result -- ignored """ upload_result = self._api.upload_simple( uplo...
python
def _upload_simple(self, upload_info, _=None): """Simple upload and return quickkey Can be used for small files smaller than UPLOAD_SIMPLE_LIMIT_BYTES upload_info -- UploadInfo object check_result -- ignored """ upload_result = self._api.upload_simple( uplo...
[ "def", "_upload_simple", "(", "self", ",", "upload_info", ",", "_", "=", "None", ")", ":", "upload_result", "=", "self", ".", "_api", ".", "upload_simple", "(", "upload_info", ".", "fd", ",", "upload_info", ".", "name", ",", "folder_key", "=", "upload_info...
Simple upload and return quickkey Can be used for small files smaller than UPLOAD_SIMPLE_LIMIT_BYTES upload_info -- UploadInfo object check_result -- ignored
[ "Simple", "upload", "and", "return", "quickkey" ]
8f1f23db1b16f16e026f5c6777aec32d00baa05f
https://github.com/MediaFire/mediafire-python-open-sdk/blob/8f1f23db1b16f16e026f5c6777aec32d00baa05f/mediafire/uploader.py#L409-L432
train
MediaFire/mediafire-python-open-sdk
mediafire/uploader.py
MediaFireUploader._upload_resumable_unit
def _upload_resumable_unit(self, uu_info): """Upload a single unit and return raw upload/resumable result uu_info -- UploadUnitInfo instance """ # Get actual unit size unit_size = uu_info.fd.len if uu_info.hash_ is None: raise ValueError('UploadUnitInfo.has...
python
def _upload_resumable_unit(self, uu_info): """Upload a single unit and return raw upload/resumable result uu_info -- UploadUnitInfo instance """ # Get actual unit size unit_size = uu_info.fd.len if uu_info.hash_ is None: raise ValueError('UploadUnitInfo.has...
[ "def", "_upload_resumable_unit", "(", "self", ",", "uu_info", ")", ":", "# Get actual unit size", "unit_size", "=", "uu_info", ".", "fd", ".", "len", "if", "uu_info", ".", "hash_", "is", "None", ":", "raise", "ValueError", "(", "'UploadUnitInfo.hash_ is now requir...
Upload a single unit and return raw upload/resumable result uu_info -- UploadUnitInfo instance
[ "Upload", "a", "single", "unit", "and", "return", "raw", "upload", "/", "resumable", "result" ]
8f1f23db1b16f16e026f5c6777aec32d00baa05f
https://github.com/MediaFire/mediafire-python-open-sdk/blob/8f1f23db1b16f16e026f5c6777aec32d00baa05f/mediafire/uploader.py#L434-L456
train
MediaFire/mediafire-python-open-sdk
mediafire/uploader.py
MediaFireUploader._upload_resumable_all
def _upload_resumable_all(self, upload_info, bitmap, number_of_units, unit_size): """Prepare and upload all resumable units and return upload_key upload_info -- UploadInfo object bitmap -- bitmap node of upload/check number_of_units -- number of units reque...
python
def _upload_resumable_all(self, upload_info, bitmap, number_of_units, unit_size): """Prepare and upload all resumable units and return upload_key upload_info -- UploadInfo object bitmap -- bitmap node of upload/check number_of_units -- number of units reque...
[ "def", "_upload_resumable_all", "(", "self", ",", "upload_info", ",", "bitmap", ",", "number_of_units", ",", "unit_size", ")", ":", "fd", "=", "upload_info", ".", "fd", "upload_key", "=", "None", "for", "unit_id", "in", "range", "(", "number_of_units", ")", ...
Prepare and upload all resumable units and return upload_key upload_info -- UploadInfo object bitmap -- bitmap node of upload/check number_of_units -- number of units requested unit_size -- size of a single upload unit in bytes
[ "Prepare", "and", "upload", "all", "resumable", "units", "and", "return", "upload_key" ]
8f1f23db1b16f16e026f5c6777aec32d00baa05f
https://github.com/MediaFire/mediafire-python-open-sdk/blob/8f1f23db1b16f16e026f5c6777aec32d00baa05f/mediafire/uploader.py#L458-L500
train
MediaFire/mediafire-python-open-sdk
mediafire/uploader.py
MediaFireUploader._upload_resumable
def _upload_resumable(self, upload_info, check_result): """Resumable upload and return quickkey upload_info -- UploadInfo object check_result -- dict of upload/check call result """ resumable_upload = check_result['resumable_upload'] unit_size = int(resumable_upload['u...
python
def _upload_resumable(self, upload_info, check_result): """Resumable upload and return quickkey upload_info -- UploadInfo object check_result -- dict of upload/check call result """ resumable_upload = check_result['resumable_upload'] unit_size = int(resumable_upload['u...
[ "def", "_upload_resumable", "(", "self", ",", "upload_info", ",", "check_result", ")", ":", "resumable_upload", "=", "check_result", "[", "'resumable_upload'", "]", "unit_size", "=", "int", "(", "resumable_upload", "[", "'unit_size'", "]", ")", "number_of_units", ...
Resumable upload and return quickkey upload_info -- UploadInfo object check_result -- dict of upload/check call result
[ "Resumable", "upload", "and", "return", "quickkey" ]
8f1f23db1b16f16e026f5c6777aec32d00baa05f
https://github.com/MediaFire/mediafire-python-open-sdk/blob/8f1f23db1b16f16e026f5c6777aec32d00baa05f/mediafire/uploader.py#L502-L549
train
corpusops/pdbclone
lib/pdb_clone/bdb.py
ModuleFinder.reset
def reset(self): """Remove from sys.modules the modules imported by the debuggee.""" if not self.hooked: self.hooked = True sys.path_hooks.append(self) sys.path.insert(0, self.PATH_ENTRY) return for modname in self: if modname in sys.m...
python
def reset(self): """Remove from sys.modules the modules imported by the debuggee.""" if not self.hooked: self.hooked = True sys.path_hooks.append(self) sys.path.insert(0, self.PATH_ENTRY) return for modname in self: if modname in sys.m...
[ "def", "reset", "(", "self", ")", ":", "if", "not", "self", ".", "hooked", ":", "self", ".", "hooked", "=", "True", "sys", ".", "path_hooks", ".", "append", "(", "self", ")", "sys", ".", "path", ".", "insert", "(", "0", ",", "self", ".", "PATH_EN...
Remove from sys.modules the modules imported by the debuggee.
[ "Remove", "from", "sys", ".", "modules", "the", "modules", "imported", "by", "the", "debuggee", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/bdb.py#L56-L76
train
corpusops/pdbclone
lib/pdb_clone/bdb.py
BdbModule.get_func_lno
def get_func_lno(self, funcname): """The first line number of the last defined 'funcname' function.""" class FuncLineno(ast.NodeVisitor): def __init__(self): self.clss = [] def generic_visit(self, node): for child in ast.iter_child_nodes(node): ...
python
def get_func_lno(self, funcname): """The first line number of the last defined 'funcname' function.""" class FuncLineno(ast.NodeVisitor): def __init__(self): self.clss = [] def generic_visit(self, node): for child in ast.iter_child_nodes(node): ...
[ "def", "get_func_lno", "(", "self", ",", "funcname", ")", ":", "class", "FuncLineno", "(", "ast", ".", "NodeVisitor", ")", ":", "def", "__init__", "(", "self", ")", ":", "self", ".", "clss", "=", "[", "]", "def", "generic_visit", "(", "self", ",", "n...
The first line number of the last defined 'funcname' function.
[ "The", "first", "line", "number", "of", "the", "last", "defined", "funcname", "function", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/bdb.py#L255-L288
train
corpusops/pdbclone
lib/pdb_clone/bdb.py
BdbModule.get_actual_bp
def get_actual_bp(self, lineno): """Get the actual breakpoint line number. When an exact match cannot be found in the lnotab expansion of the module code object or one of its subcodes, pick up the next valid statement line number. Return the statement line defined by the tuple ...
python
def get_actual_bp(self, lineno): """Get the actual breakpoint line number. When an exact match cannot be found in the lnotab expansion of the module code object or one of its subcodes, pick up the next valid statement line number. Return the statement line defined by the tuple ...
[ "def", "get_actual_bp", "(", "self", ",", "lineno", ")", ":", "def", "_distance", "(", "code", ",", "module_level", "=", "False", ")", ":", "\"\"\"The shortest distance to the next valid statement.\"\"\"", "subcodes", "=", "dict", "(", "(", "c", ".", "co_firstline...
Get the actual breakpoint line number. When an exact match cannot be found in the lnotab expansion of the module code object or one of its subcodes, pick up the next valid statement line number. Return the statement line defined by the tuple (code firstlineno, statement line nu...
[ "Get", "the", "actual", "breakpoint", "line", "number", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/bdb.py#L290-L349
train
corpusops/pdbclone
lib/pdb_clone/bdb.py
ModuleBreakpoints.get_breakpoints
def get_breakpoints(self, lineno): """Return the list of breakpoints set at lineno.""" try: firstlineno, actual_lno = self.bdb_module.get_actual_bp(lineno) except BdbSourceError: return [] if firstlineno not in self: return [] code_bps = self[f...
python
def get_breakpoints(self, lineno): """Return the list of breakpoints set at lineno.""" try: firstlineno, actual_lno = self.bdb_module.get_actual_bp(lineno) except BdbSourceError: return [] if firstlineno not in self: return [] code_bps = self[f...
[ "def", "get_breakpoints", "(", "self", ",", "lineno", ")", ":", "try", ":", "firstlineno", ",", "actual_lno", "=", "self", ".", "bdb_module", ".", "get_actual_bp", "(", "lineno", ")", "except", "BdbSourceError", ":", "return", "[", "]", "if", "firstlineno", ...
Return the list of breakpoints set at lineno.
[ "Return", "the", "list", "of", "breakpoints", "set", "at", "lineno", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/bdb.py#L417-L429
train
corpusops/pdbclone
lib/pdb_clone/bdb.py
Tracer.settrace
def settrace(self, do_set): """Set or remove the trace function.""" if do_set: sys.settrace(self.trace_dispatch) else: sys.settrace(None)
python
def settrace(self, do_set): """Set or remove the trace function.""" if do_set: sys.settrace(self.trace_dispatch) else: sys.settrace(None)
[ "def", "settrace", "(", "self", ",", "do_set", ")", ":", "if", "do_set", ":", "sys", ".", "settrace", "(", "self", ".", "trace_dispatch", ")", "else", ":", "sys", ".", "settrace", "(", "None", ")" ]
Set or remove the trace function.
[ "Set", "or", "remove", "the", "trace", "function", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/bdb.py#L587-L592
train
corpusops/pdbclone
lib/pdb_clone/bdb.py
Bdb.restart
def restart(self): """Restart the debugger after source code changes.""" _module_finder.reset() linecache.checkcache() for module_bpts in self.breakpoints.values(): module_bpts.reset()
python
def restart(self): """Restart the debugger after source code changes.""" _module_finder.reset() linecache.checkcache() for module_bpts in self.breakpoints.values(): module_bpts.reset()
[ "def", "restart", "(", "self", ")", ":", "_module_finder", ".", "reset", "(", ")", "linecache", ".", "checkcache", "(", ")", "for", "module_bpts", "in", "self", ".", "breakpoints", ".", "values", "(", ")", ":", "module_bpts", ".", "reset", "(", ")" ]
Restart the debugger after source code changes.
[ "Restart", "the", "debugger", "after", "source", "code", "changes", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/bdb.py#L631-L636
train
corpusops/pdbclone
lib/pdb_clone/bdb.py
Bdb.set_until
def set_until(self, frame, lineno=None): """Stop when the current line number in frame is greater than lineno or when returning from frame.""" if lineno is None: lineno = frame.f_lineno + 1 self._set_stopinfo(frame, lineno)
python
def set_until(self, frame, lineno=None): """Stop when the current line number in frame is greater than lineno or when returning from frame.""" if lineno is None: lineno = frame.f_lineno + 1 self._set_stopinfo(frame, lineno)
[ "def", "set_until", "(", "self", ",", "frame", ",", "lineno", "=", "None", ")", ":", "if", "lineno", "is", "None", ":", "lineno", "=", "frame", ".", "f_lineno", "+", "1", "self", ".", "_set_stopinfo", "(", "frame", ",", "lineno", ")" ]
Stop when the current line number in frame is greater than lineno or when returning from frame.
[ "Stop", "when", "the", "current", "line", "number", "in", "frame", "is", "greater", "than", "lineno", "or", "when", "returning", "from", "frame", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/bdb.py#L713-L718
train
corpusops/pdbclone
lib/pdb_clone/bdb.py
Bdb.set_trace
def set_trace(self, frame=None): """Start debugging from `frame`. If frame is not specified, debugging starts from caller's frame. """ # First disable tracing temporarily as set_trace() may be called while # tracing is in use. For example when called from a signal handler and ...
python
def set_trace(self, frame=None): """Start debugging from `frame`. If frame is not specified, debugging starts from caller's frame. """ # First disable tracing temporarily as set_trace() may be called while # tracing is in use. For example when called from a signal handler and ...
[ "def", "set_trace", "(", "self", ",", "frame", "=", "None", ")", ":", "# First disable tracing temporarily as set_trace() may be called while", "# tracing is in use. For example when called from a signal handler and", "# within a debugging session started with runcall().", "self", ".", ...
Start debugging from `frame`. If frame is not specified, debugging starts from caller's frame.
[ "Start", "debugging", "from", "frame", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/bdb.py#L732-L763
train
corpusops/pdbclone
lib/pdb_clone/bdb.py
Breakpoint.process_hit_event
def process_hit_event(self, frame): """Return (stop_state, delete_temporary) at a breakpoint hit event.""" if not self.enabled: return False, False # Count every hit when breakpoint is enabled. self.hits += 1 # A conditional breakpoint. if self.cond: ...
python
def process_hit_event(self, frame): """Return (stop_state, delete_temporary) at a breakpoint hit event.""" if not self.enabled: return False, False # Count every hit when breakpoint is enabled. self.hits += 1 # A conditional breakpoint. if self.cond: ...
[ "def", "process_hit_event", "(", "self", ",", "frame", ")", ":", "if", "not", "self", ".", "enabled", ":", "return", "False", ",", "False", "# Count every hit when breakpoint is enabled.", "self", ".", "hits", "+=", "1", "# A conditional breakpoint.", "if", "self"...
Return (stop_state, delete_temporary) at a breakpoint hit event.
[ "Return", "(", "stop_state", "delete_temporary", ")", "at", "a", "breakpoint", "hit", "event", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/bdb.py#L1061-L1080
train
kamikaze/webdav
src/webdav/client.py
listdir
def listdir(directory): """Returns list of nested files and directories for local directory by path :param directory: absolute or relative path to local directory :return: list nested of file or directory names """ file_names = list() for filename in os.listdir(directory): file_path = o...
python
def listdir(directory): """Returns list of nested files and directories for local directory by path :param directory: absolute or relative path to local directory :return: list nested of file or directory names """ file_names = list() for filename in os.listdir(directory): file_path = o...
[ "def", "listdir", "(", "directory", ")", ":", "file_names", "=", "list", "(", ")", "for", "filename", "in", "os", ".", "listdir", "(", "directory", ")", ":", "file_path", "=", "os", ".", "path", ".", "join", "(", "directory", ",", "filename", ")", "i...
Returns list of nested files and directories for local directory by path :param directory: absolute or relative path to local directory :return: list nested of file or directory names
[ "Returns", "list", "of", "nested", "files", "and", "directories", "for", "local", "directory", "by", "path" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L28-L40
train
kamikaze/webdav
src/webdav/client.py
get_options
def get_options(option_type, from_options): """Extract options for specified option type from all options :param option_type: the object of specified type of options :param from_options: all options dictionary :return: the dictionary of options for specified type, each option can be filled by value fro...
python
def get_options(option_type, from_options): """Extract options for specified option type from all options :param option_type: the object of specified type of options :param from_options: all options dictionary :return: the dictionary of options for specified type, each option can be filled by value fro...
[ "def", "get_options", "(", "option_type", ",", "from_options", ")", ":", "_options", "=", "dict", "(", ")", "for", "key", "in", "option_type", ".", "keys", ":", "key_with_prefix", "=", "f'{option_type.prefix}{key}'", "if", "key", "not", "in", "from_options", "...
Extract options for specified option type from all options :param option_type: the object of specified type of options :param from_options: all options dictionary :return: the dictionary of options for specified type, each option can be filled by value from all options dictionary or blank in c...
[ "Extract", "options", "for", "specified", "option", "type", "from", "all", "options" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L43-L62
train
kamikaze/webdav
src/webdav/client.py
Client.get_headers
def get_headers(self, action, headers_ext=None): """Returns HTTP headers of specified WebDAV actions. :param action: the identifier of action. :param headers_ext: (optional) the addition headers list witch sgould be added to basic HTTP headers for the specified actio...
python
def get_headers(self, action, headers_ext=None): """Returns HTTP headers of specified WebDAV actions. :param action: the identifier of action. :param headers_ext: (optional) the addition headers list witch sgould be added to basic HTTP headers for the specified actio...
[ "def", "get_headers", "(", "self", ",", "action", ",", "headers_ext", "=", "None", ")", ":", "if", "action", "in", "Client", ".", "http_header", ":", "try", ":", "headers", "=", "Client", ".", "http_header", "[", "action", "]", ".", "copy", "(", ")", ...
Returns HTTP headers of specified WebDAV actions. :param action: the identifier of action. :param headers_ext: (optional) the addition headers list witch sgould be added to basic HTTP headers for the specified action. :return: the dictionary of headers for specified ...
[ "Returns", "HTTP", "headers", "of", "specified", "WebDAV", "actions", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L107-L129
train
kamikaze/webdav
src/webdav/client.py
Client.execute_request
def execute_request(self, action, path, data=None, headers_ext=None): """Generate request to WebDAV server for specified action and path and execute it. :param action: the action for WebDAV server which should be executed. :param path: the path to resource for action :param data: (optio...
python
def execute_request(self, action, path, data=None, headers_ext=None): """Generate request to WebDAV server for specified action and path and execute it. :param action: the action for WebDAV server which should be executed. :param path: the path to resource for action :param data: (optio...
[ "def", "execute_request", "(", "self", ",", "action", ",", "path", ",", "data", "=", "None", ",", "headers_ext", "=", "None", ")", ":", "response", "=", "self", ".", "session", ".", "request", "(", "method", "=", "Client", ".", "requests", "[", "action...
Generate request to WebDAV server for specified action and path and execute it. :param action: the action for WebDAV server which should be executed. :param path: the path to resource for action :param data: (optional) Dictionary or list of tuples ``[(key, value)]`` (will be form-encoded), byte...
[ "Generate", "request", "to", "WebDAV", "server", "for", "specified", "action", "and", "path", "and", "execute", "it", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L147-L172
train
kamikaze/webdav
src/webdav/client.py
Client.valid
def valid(self): """Validates of WebDAV and proxy settings. :return: True in case settings are valid and False otherwise. """ return True if self.webdav.valid() and self.proxy.valid() else False
python
def valid(self): """Validates of WebDAV and proxy settings. :return: True in case settings are valid and False otherwise. """ return True if self.webdav.valid() and self.proxy.valid() else False
[ "def", "valid", "(", "self", ")", ":", "return", "True", "if", "self", ".", "webdav", ".", "valid", "(", ")", "and", "self", ".", "proxy", ".", "valid", "(", ")", "else", "False" ]
Validates of WebDAV and proxy settings. :return: True in case settings are valid and False otherwise.
[ "Validates", "of", "WebDAV", "and", "proxy", "settings", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L227-L232
train
kamikaze/webdav
src/webdav/client.py
Client.list
def list(self, remote_path=root): """Returns list of nested files and directories for remote WebDAV directory by path. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: path to remote directory. :return: list of nested file or...
python
def list(self, remote_path=root): """Returns list of nested files and directories for remote WebDAV directory by path. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: path to remote directory. :return: list of nested file or...
[ "def", "list", "(", "self", ",", "remote_path", "=", "root", ")", ":", "directory_urn", "=", "Urn", "(", "remote_path", ",", "directory", "=", "True", ")", "if", "directory_urn", ".", "path", "(", ")", "!=", "Client", ".", "root", ":", "if", "not", "...
Returns list of nested files and directories for remote WebDAV directory by path. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: path to remote directory. :return: list of nested file or directory names.
[ "Returns", "list", "of", "nested", "files", "and", "directories", "for", "remote", "WebDAV", "directory", "by", "path", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ...
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L235-L251
train
kamikaze/webdav
src/webdav/client.py
Client.free
def free(self): """Returns an amount of free space on remote WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :return: an amount of free space in bytes. """ data = WebDavXmlUtils.create_free_space_request_content() ...
python
def free(self): """Returns an amount of free space on remote WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :return: an amount of free space in bytes. """ data = WebDavXmlUtils.create_free_space_request_content() ...
[ "def", "free", "(", "self", ")", ":", "data", "=", "WebDavXmlUtils", ".", "create_free_space_request_content", "(", ")", "response", "=", "self", ".", "execute_request", "(", "action", "=", "'free'", ",", "path", "=", "''", ",", "data", "=", "data", ")", ...
Returns an amount of free space on remote WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :return: an amount of free space in bytes.
[ "Returns", "an", "amount", "of", "free", "space", "on", "remote", "WebDAV", "server", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#METHOD_PROPFIND" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L254-L262
train
kamikaze/webdav
src/webdav/client.py
Client.check
def check(self, remote_path=root): """Checks an existence of remote resource on WebDAV server by remote path. More information you can find by link http://webdav.org/specs/rfc4918.html#rfc.section.9.4 :param remote_path: (optional) path to resource on WebDAV server. Defaults is root directory o...
python
def check(self, remote_path=root): """Checks an existence of remote resource on WebDAV server by remote path. More information you can find by link http://webdav.org/specs/rfc4918.html#rfc.section.9.4 :param remote_path: (optional) path to resource on WebDAV server. Defaults is root directory o...
[ "def", "check", "(", "self", ",", "remote_path", "=", "root", ")", ":", "urn", "=", "Urn", "(", "remote_path", ")", "try", ":", "response", "=", "self", ".", "execute_request", "(", "action", "=", "'check'", ",", "path", "=", "urn", ".", "quote", "("...
Checks an existence of remote resource on WebDAV server by remote path. More information you can find by link http://webdav.org/specs/rfc4918.html#rfc.section.9.4 :param remote_path: (optional) path to resource on WebDAV server. Defaults is root directory of WebDAV. :return: True if resource is...
[ "Checks", "an", "existence", "of", "remote", "resource", "on", "WebDAV", "server", "by", "remote", "path", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#r...
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L265-L281
train
kamikaze/webdav
src/webdav/client.py
Client.mkdir
def mkdir(self, remote_path): """Makes new directory on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_MKCOL :param remote_path: path to directory :return: True if request executed with code 200 or 201 and False otherwise. """ ...
python
def mkdir(self, remote_path): """Makes new directory on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_MKCOL :param remote_path: path to directory :return: True if request executed with code 200 or 201 and False otherwise. """ ...
[ "def", "mkdir", "(", "self", ",", "remote_path", ")", ":", "directory_urn", "=", "Urn", "(", "remote_path", ",", "directory", "=", "True", ")", "try", ":", "response", "=", "self", ".", "execute_request", "(", "action", "=", "'mkdir'", ",", "path", "=", ...
Makes new directory on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_MKCOL :param remote_path: path to directory :return: True if request executed with code 200 or 201 and False otherwise.
[ "Makes", "new", "directory", "on", "WebDAV", "server", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#METHOD_MKCOL" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L284-L302
train
kamikaze/webdav
src/webdav/client.py
Client.download_from
def download_from(self, buff, remote_path): """Downloads file from WebDAV and writes it in buffer. :param buff: buffer object for writing of downloaded file content. :param remote_path: path to file on WebDAV server. """ urn = Urn(remote_path) if self.is_dir(urn.path()):...
python
def download_from(self, buff, remote_path): """Downloads file from WebDAV and writes it in buffer. :param buff: buffer object for writing of downloaded file content. :param remote_path: path to file on WebDAV server. """ urn = Urn(remote_path) if self.is_dir(urn.path()):...
[ "def", "download_from", "(", "self", ",", "buff", ",", "remote_path", ")", ":", "urn", "=", "Urn", "(", "remote_path", ")", "if", "self", ".", "is_dir", "(", "urn", ".", "path", "(", ")", ")", ":", "raise", "OptionNotValid", "(", "name", "=", "'remot...
Downloads file from WebDAV and writes it in buffer. :param buff: buffer object for writing of downloaded file content. :param remote_path: path to file on WebDAV server.
[ "Downloads", "file", "from", "WebDAV", "and", "writes", "it", "in", "buffer", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L305-L319
train
kamikaze/webdav
src/webdav/client.py
Client.download
def download(self, remote_path, local_path, progress=None): """Downloads remote resource from WebDAV and save it in local path. More information you can find by link http://webdav.org/specs/rfc4918.html#rfc.section.9.4 :param remote_path: the path to remote resource for downloading can be file ...
python
def download(self, remote_path, local_path, progress=None): """Downloads remote resource from WebDAV and save it in local path. More information you can find by link http://webdav.org/specs/rfc4918.html#rfc.section.9.4 :param remote_path: the path to remote resource for downloading can be file ...
[ "def", "download", "(", "self", ",", "remote_path", ",", "local_path", ",", "progress", "=", "None", ")", ":", "urn", "=", "Urn", "(", "remote_path", ")", "if", "self", ".", "is_dir", "(", "urn", ".", "path", "(", ")", ")", ":", "self", ".", "downl...
Downloads remote resource from WebDAV and save it in local path. More information you can find by link http://webdav.org/specs/rfc4918.html#rfc.section.9.4 :param remote_path: the path to remote resource for downloading can be file and directory. :param local_path: the path to save resource loc...
[ "Downloads", "remote", "resource", "from", "WebDAV", "and", "save", "it", "in", "local", "path", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#rfc", ".", ...
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L321-L333
train
kamikaze/webdav
src/webdav/client.py
Client.download_directory
def download_directory(self, remote_path, local_path, progress=None): """Downloads directory and downloads all nested files and directories from remote WebDAV to local. If there is something on local path it deletes directories and files then creates new. :param remote_path: the path to directo...
python
def download_directory(self, remote_path, local_path, progress=None): """Downloads directory and downloads all nested files and directories from remote WebDAV to local. If there is something on local path it deletes directories and files then creates new. :param remote_path: the path to directo...
[ "def", "download_directory", "(", "self", ",", "remote_path", ",", "local_path", ",", "progress", "=", "None", ")", ":", "urn", "=", "Urn", "(", "remote_path", ",", "directory", "=", "True", ")", "if", "not", "self", ".", "is_dir", "(", "urn", ".", "pa...
Downloads directory and downloads all nested files and directories from remote WebDAV to local. If there is something on local path it deletes directories and files then creates new. :param remote_path: the path to directory for downloading form WebDAV server. :param local_path: the path to loc...
[ "Downloads", "directory", "and", "downloads", "all", "nested", "files", "and", "directories", "from", "remote", "WebDAV", "to", "local", ".", "If", "there", "is", "something", "on", "local", "path", "it", "deletes", "directories", "and", "files", "then", "crea...
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L335-L355
train
kamikaze/webdav
src/webdav/client.py
Client.open
def open(self, file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None): """Downloads file from WebDAV server and saves it temprorary, then opens it for further manipulations. Has the same interface as built-in open() :param file: the path to remote fil...
python
def open(self, file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None): """Downloads file from WebDAV server and saves it temprorary, then opens it for further manipulations. Has the same interface as built-in open() :param file: the path to remote fil...
[ "def", "open", "(", "self", ",", "file", ",", "mode", "=", "'r'", ",", "buffering", "=", "-", "1", ",", "encoding", "=", "None", ",", "errors", "=", "None", ",", "newline", "=", "None", ",", "closefd", "=", "True", ",", "opener", "=", "None", ")"...
Downloads file from WebDAV server and saves it temprorary, then opens it for further manipulations. Has the same interface as built-in open() :param file: the path to remote file for opening.
[ "Downloads", "file", "from", "WebDAV", "server", "and", "saves", "it", "temprorary", "then", "opens", "it", "for", "further", "manipulations", ".", "Has", "the", "same", "interface", "as", "built", "-", "in", "open", "()" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L359-L390
train
kamikaze/webdav
src/webdav/client.py
Client.download_file
def download_file(self, remote_path, local_path, progress=None): """Downloads file from WebDAV server and save it locally. More information you can find by link http://webdav.org/specs/rfc4918.html#rfc.section.9.4 :param remote_path: the path to remote file for downloading. :param local...
python
def download_file(self, remote_path, local_path, progress=None): """Downloads file from WebDAV server and save it locally. More information you can find by link http://webdav.org/specs/rfc4918.html#rfc.section.9.4 :param remote_path: the path to remote file for downloading. :param local...
[ "def", "download_file", "(", "self", ",", "remote_path", ",", "local_path", ",", "progress", "=", "None", ")", ":", "urn", "=", "Urn", "(", "remote_path", ")", "if", "self", ".", "is_dir", "(", "urn", ".", "path", "(", ")", ")", ":", "raise", "Option...
Downloads file from WebDAV server and save it locally. More information you can find by link http://webdav.org/specs/rfc4918.html#rfc.section.9.4 :param remote_path: the path to remote file for downloading. :param local_path: the path to save file locally. :param progress: progress func...
[ "Downloads", "file", "from", "WebDAV", "server", "and", "save", "it", "locally", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#rfc", ".", "section", ".", ...
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L393-L417
train
kamikaze/webdav
src/webdav/client.py
Client.download_sync
def download_sync(self, remote_path, local_path, callback=None): """Downloads remote resources from WebDAV server synchronously. :param remote_path: the path to remote resource on WebDAV server. Can be file and directory. :param local_path: the path to save resource locally. :param call...
python
def download_sync(self, remote_path, local_path, callback=None): """Downloads remote resources from WebDAV server synchronously. :param remote_path: the path to remote resource on WebDAV server. Can be file and directory. :param local_path: the path to save resource locally. :param call...
[ "def", "download_sync", "(", "self", ",", "remote_path", ",", "local_path", ",", "callback", "=", "None", ")", ":", "self", ".", "download", "(", "local_path", "=", "local_path", ",", "remote_path", "=", "remote_path", ")", "if", "callback", ":", "callback",...
Downloads remote resources from WebDAV server synchronously. :param remote_path: the path to remote resource on WebDAV server. Can be file and directory. :param local_path: the path to save resource locally. :param callback: the callback which will be invoked when downloading is complete.
[ "Downloads", "remote", "resources", "from", "WebDAV", "server", "synchronously", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L419-L428
train
kamikaze/webdav
src/webdav/client.py
Client.download_async
def download_async(self, remote_path, local_path, callback=None): """Downloads remote resources from WebDAV server asynchronously :param remote_path: the path to remote resource on WebDAV server. Can be file and directory. :param local_path: the path to save resource locally. :param cal...
python
def download_async(self, remote_path, local_path, callback=None): """Downloads remote resources from WebDAV server asynchronously :param remote_path: the path to remote resource on WebDAV server. Can be file and directory. :param local_path: the path to save resource locally. :param cal...
[ "def", "download_async", "(", "self", ",", "remote_path", ",", "local_path", ",", "callback", "=", "None", ")", ":", "target", "=", "(", "lambda", ":", "self", ".", "download_sync", "(", "local_path", "=", "local_path", ",", "remote_path", "=", "remote_path"...
Downloads remote resources from WebDAV server asynchronously :param remote_path: the path to remote resource on WebDAV server. Can be file and directory. :param local_path: the path to save resource locally. :param callback: the callback which will be invoked when downloading is complete.
[ "Downloads", "remote", "resources", "from", "WebDAV", "server", "asynchronously" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L430-L438
train
kamikaze/webdav
src/webdav/client.py
Client.upload_to
def upload_to(self, buff, remote_path): """Uploads file from buffer to remote path on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PUT :param buff: the buffer with content for file. :param remote_path: the path to save file remotely on...
python
def upload_to(self, buff, remote_path): """Uploads file from buffer to remote path on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PUT :param buff: the buffer with content for file. :param remote_path: the path to save file remotely on...
[ "def", "upload_to", "(", "self", ",", "buff", ",", "remote_path", ")", ":", "urn", "=", "Urn", "(", "remote_path", ")", "if", "urn", ".", "is_dir", "(", ")", ":", "raise", "OptionNotValid", "(", "name", "=", "'remote_path'", ",", "value", "=", "remote_...
Uploads file from buffer to remote path on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PUT :param buff: the buffer with content for file. :param remote_path: the path to save file remotely on WebDAV server.
[ "Uploads", "file", "from", "buffer", "to", "remote", "path", "on", "WebDAV", "server", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#METHOD_PUT" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L441-L455
train
kamikaze/webdav
src/webdav/client.py
Client.upload
def upload(self, remote_path, local_path, progress=None): """Uploads resource to remote path on WebDAV server. In case resource is directory it will upload all nested files and directories. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PUT :param remo...
python
def upload(self, remote_path, local_path, progress=None): """Uploads resource to remote path on WebDAV server. In case resource is directory it will upload all nested files and directories. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PUT :param remo...
[ "def", "upload", "(", "self", ",", "remote_path", ",", "local_path", ",", "progress", "=", "None", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "local_path", ")", ":", "self", ".", "upload_directory", "(", "local_path", "=", "local_path", ",", ...
Uploads resource to remote path on WebDAV server. In case resource is directory it will upload all nested files and directories. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PUT :param remote_path: the path for uploading resources on WebDAV server. Can be fi...
[ "Uploads", "resource", "to", "remote", "path", "on", "WebDAV", "server", ".", "In", "case", "resource", "is", "directory", "it", "will", "upload", "all", "nested", "files", "and", "directories", ".", "More", "information", "you", "can", "find", "by", "link",...
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L457-L469
train
kamikaze/webdav
src/webdav/client.py
Client.upload_directory
def upload_directory(self, remote_path, local_path, progress=None): """Uploads directory to remote path on WebDAV server. In case directory is exist on remote server it will delete it and then upload directory with nested files and directories. :param remote_path: the path to directory ...
python
def upload_directory(self, remote_path, local_path, progress=None): """Uploads directory to remote path on WebDAV server. In case directory is exist on remote server it will delete it and then upload directory with nested files and directories. :param remote_path: the path to directory ...
[ "def", "upload_directory", "(", "self", ",", "remote_path", ",", "local_path", ",", "progress", "=", "None", ")", ":", "urn", "=", "Urn", "(", "remote_path", ",", "directory", "=", "True", ")", "if", "not", "urn", ".", "is_dir", "(", ")", ":", "raise",...
Uploads directory to remote path on WebDAV server. In case directory is exist on remote server it will delete it and then upload directory with nested files and directories. :param remote_path: the path to directory for uploading on WebDAV server. :param local_path: the path to local di...
[ "Uploads", "directory", "to", "remote", "path", "on", "WebDAV", "server", ".", "In", "case", "directory", "is", "exist", "on", "remote", "server", "it", "will", "delete", "it", "and", "then", "upload", "directory", "with", "nested", "files", "and", "director...
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L471-L498
train
kamikaze/webdav
src/webdav/client.py
Client.upload_file
def upload_file(self, remote_path, local_path, progress=None): """Uploads file to remote path on WebDAV server. File should be 2Gb or less. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PUT :param remote_path: the path to uploading file on WebDAV server. ...
python
def upload_file(self, remote_path, local_path, progress=None): """Uploads file to remote path on WebDAV server. File should be 2Gb or less. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PUT :param remote_path: the path to uploading file on WebDAV server. ...
[ "def", "upload_file", "(", "self", ",", "remote_path", ",", "local_path", ",", "progress", "=", "None", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "local_path", ")", ":", "raise", "LocalResourceNotFound", "(", "local_path", ")", "urn", ...
Uploads file to remote path on WebDAV server. File should be 2Gb or less. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PUT :param remote_path: the path to uploading file on WebDAV server. :param local_path: the path to local file for uploading. :para...
[ "Uploads", "file", "to", "remote", "path", "on", "WebDAV", "server", ".", "File", "should", "be", "2Gb", "or", "less", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918"...
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L501-L527
train
kamikaze/webdav
src/webdav/client.py
Client.upload_sync
def upload_sync(self, remote_path, local_path, callback=None): """Uploads resource to remote path on WebDAV server synchronously. In case resource is directory it will upload all nested files and directories. :param remote_path: the path for uploading resources on WebDAV server. Can be file and...
python
def upload_sync(self, remote_path, local_path, callback=None): """Uploads resource to remote path on WebDAV server synchronously. In case resource is directory it will upload all nested files and directories. :param remote_path: the path for uploading resources on WebDAV server. Can be file and...
[ "def", "upload_sync", "(", "self", ",", "remote_path", ",", "local_path", ",", "callback", "=", "None", ")", ":", "self", ".", "upload", "(", "local_path", "=", "local_path", ",", "remote_path", "=", "remote_path", ")", "if", "callback", ":", "callback", "...
Uploads resource to remote path on WebDAV server synchronously. In case resource is directory it will upload all nested files and directories. :param remote_path: the path for uploading resources on WebDAV server. Can be file and directory. :param local_path: the path to local resource for uplo...
[ "Uploads", "resource", "to", "remote", "path", "on", "WebDAV", "server", "synchronously", ".", "In", "case", "resource", "is", "directory", "it", "will", "upload", "all", "nested", "files", "and", "directories", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L529-L540
train
kamikaze/webdav
src/webdav/client.py
Client.upload_async
def upload_async(self, remote_path, local_path, callback=None): """Uploads resource to remote path on WebDAV server asynchronously. In case resource is directory it will upload all nested files and directories. :param remote_path: the path for uploading resources on WebDAV server. Can be file a...
python
def upload_async(self, remote_path, local_path, callback=None): """Uploads resource to remote path on WebDAV server asynchronously. In case resource is directory it will upload all nested files and directories. :param remote_path: the path for uploading resources on WebDAV server. Can be file a...
[ "def", "upload_async", "(", "self", ",", "remote_path", ",", "local_path", ",", "callback", "=", "None", ")", ":", "target", "=", "(", "lambda", ":", "self", ".", "upload_sync", "(", "local_path", "=", "local_path", ",", "remote_path", "=", "remote_path", ...
Uploads resource to remote path on WebDAV server asynchronously. In case resource is directory it will upload all nested files and directories. :param remote_path: the path for uploading resources on WebDAV server. Can be file and directory. :param local_path: the path to local resource for upl...
[ "Uploads", "resource", "to", "remote", "path", "on", "WebDAV", "server", "asynchronously", ".", "In", "case", "resource", "is", "directory", "it", "will", "upload", "all", "nested", "files", "and", "directories", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L542-L551
train
kamikaze/webdav
src/webdav/client.py
Client.copy
def copy(self, remote_path_from, remote_path_to): """Copies resource from one place to another on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_COPY :param remote_path_from: the path to resource which will be copied, :param remote_path_...
python
def copy(self, remote_path_from, remote_path_to): """Copies resource from one place to another on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_COPY :param remote_path_from: the path to resource which will be copied, :param remote_path_...
[ "def", "copy", "(", "self", ",", "remote_path_from", ",", "remote_path_to", ")", ":", "urn_from", "=", "Urn", "(", "remote_path_from", ")", "if", "not", "self", ".", "check", "(", "urn_from", ".", "path", "(", ")", ")", ":", "raise", "RemoteResourceNotFoun...
Copies resource from one place to another on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_COPY :param remote_path_from: the path to resource which will be copied, :param remote_path_to: the path where resource will be copied.
[ "Copies", "resource", "from", "one", "place", "to", "another", "on", "WebDAV", "server", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#METHOD_COPY" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L554-L570
train
kamikaze/webdav
src/webdav/client.py
Client.move
def move(self, remote_path_from, remote_path_to, overwrite=False): """Moves resource from one place to another on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_MOVE :param remote_path_from: the path to resource which will be moved, :par...
python
def move(self, remote_path_from, remote_path_to, overwrite=False): """Moves resource from one place to another on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_MOVE :param remote_path_from: the path to resource which will be moved, :par...
[ "def", "move", "(", "self", ",", "remote_path_from", ",", "remote_path_to", ",", "overwrite", "=", "False", ")", ":", "urn_from", "=", "Urn", "(", "remote_path_from", ")", "if", "not", "self", ".", "check", "(", "urn_from", ".", "path", "(", ")", ")", ...
Moves resource from one place to another on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_MOVE :param remote_path_from: the path to resource which will be moved, :param remote_path_to: the path where resource will be moved. :param overw...
[ "Moves", "resource", "from", "one", "place", "to", "another", "on", "WebDAV", "server", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#METHOD_MOVE" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L573-L591
train
kamikaze/webdav
src/webdav/client.py
Client.clean
def clean(self, remote_path): """Cleans (Deletes) a remote resource on WebDAV server. The name of method is not changed for back compatibility with original library. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_DELETE :param remote_path: the remote r...
python
def clean(self, remote_path): """Cleans (Deletes) a remote resource on WebDAV server. The name of method is not changed for back compatibility with original library. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_DELETE :param remote_path: the remote r...
[ "def", "clean", "(", "self", ",", "remote_path", ")", ":", "urn", "=", "Urn", "(", "remote_path", ")", "self", ".", "execute_request", "(", "action", "=", "'clean'", ",", "path", "=", "urn", ".", "quote", "(", ")", ")" ]
Cleans (Deletes) a remote resource on WebDAV server. The name of method is not changed for back compatibility with original library. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_DELETE :param remote_path: the remote resource whisch will be deleted.
[ "Cleans", "(", "Deletes", ")", "a", "remote", "resource", "on", "WebDAV", "server", ".", "The", "name", "of", "method", "is", "not", "changed", "for", "back", "compatibility", "with", "original", "library", ".", "More", "information", "you", "can", "find", ...
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L594-L602
train
kamikaze/webdav
src/webdav/client.py
Client.info
def info(self, remote_path): """Gets information about resource on WebDAV. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: the path to remote resource. :return: a dictionary of information attributes and them values with fol...
python
def info(self, remote_path): """Gets information about resource on WebDAV. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: the path to remote resource. :return: a dictionary of information attributes and them values with fol...
[ "def", "info", "(", "self", ",", "remote_path", ")", ":", "urn", "=", "Urn", "(", "remote_path", ")", "if", "not", "self", ".", "check", "(", "urn", ".", "path", "(", ")", ")", "and", "not", "self", ".", "check", "(", "Urn", "(", "remote_path", "...
Gets information about resource on WebDAV. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: the path to remote resource. :return: a dictionary of information attributes and them values with following keys: `created`:...
[ "Gets", "information", "about", "resource", "on", "WebDAV", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#METHOD_PROPFIND" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L605-L622
train
kamikaze/webdav
src/webdav/client.py
Client.is_dir
def is_dir(self, remote_path): """Checks is the remote resource directory. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: the path to remote resource. :return: True in case the remote resource is directory and False otherwi...
python
def is_dir(self, remote_path): """Checks is the remote resource directory. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: the path to remote resource. :return: True in case the remote resource is directory and False otherwi...
[ "def", "is_dir", "(", "self", ",", "remote_path", ")", ":", "urn", "=", "Urn", "(", "remote_path", ")", "parent_urn", "=", "Urn", "(", "urn", ".", "parent", "(", ")", ")", "if", "not", "self", ".", "check", "(", "urn", ".", "path", "(", ")", ")",...
Checks is the remote resource directory. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: the path to remote resource. :return: True in case the remote resource is directory and False otherwise.
[ "Checks", "is", "the", "remote", "resource", "directory", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#METHOD_PROPFIND" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L625-L639
train
kamikaze/webdav
src/webdav/client.py
Client.get_property
def get_property(self, remote_path, option): """Gets metadata property of remote resource on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: the path to remote resource. :param option: the property attribute a...
python
def get_property(self, remote_path, option): """Gets metadata property of remote resource on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: the path to remote resource. :param option: the property attribute a...
[ "def", "get_property", "(", "self", ",", "remote_path", ",", "option", ")", ":", "urn", "=", "Urn", "(", "remote_path", ")", "if", "not", "self", ".", "check", "(", "urn", ".", "path", "(", ")", ")", ":", "raise", "RemoteResourceNotFound", "(", "urn", ...
Gets metadata property of remote resource on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND :param remote_path: the path to remote resource. :param option: the property attribute as dictionary with following keys: ...
[ "Gets", "metadata", "property", "of", "remote", "resource", "on", "WebDAV", "server", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#METHOD_PROPFIND" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L642-L658
train
kamikaze/webdav
src/webdav/client.py
Client.set_property
def set_property(self, remote_path, option): """Sets metadata property of remote resource on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPPATCH :param remote_path: the path to remote resource. :param option: the property attribute ...
python
def set_property(self, remote_path, option): """Sets metadata property of remote resource on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPPATCH :param remote_path: the path to remote resource. :param option: the property attribute ...
[ "def", "set_property", "(", "self", ",", "remote_path", ",", "option", ")", ":", "self", ".", "set_property_batch", "(", "remote_path", "=", "remote_path", ",", "option", "=", "[", "option", "]", ")" ]
Sets metadata property of remote resource on WebDAV server. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPPATCH :param remote_path: the path to remote resource. :param option: the property attribute as dictionary with following keys: ...
[ "Sets", "metadata", "property", "of", "remote", "resource", "on", "WebDAV", "server", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "html#METHOD_PROPPATCH" ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L661-L671
train
kamikaze/webdav
src/webdav/client.py
Client.set_property_batch
def set_property_batch(self, remote_path, option): """Sets batch metadata properties of remote resource on WebDAV server in batch. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPPATCH :param remote_path: the path to remote resource. :param option: ...
python
def set_property_batch(self, remote_path, option): """Sets batch metadata properties of remote resource on WebDAV server in batch. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPPATCH :param remote_path: the path to remote resource. :param option: ...
[ "def", "set_property_batch", "(", "self", ",", "remote_path", ",", "option", ")", ":", "urn", "=", "Urn", "(", "remote_path", ")", "if", "not", "self", ".", "check", "(", "urn", ".", "path", "(", ")", ")", ":", "raise", "RemoteResourceNotFound", "(", "...
Sets batch metadata properties of remote resource on WebDAV server in batch. More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPPATCH :param remote_path: the path to remote resource. :param option: the property attributes as list of dictionaries with following...
[ "Sets", "batch", "metadata", "properties", "of", "remote", "resource", "on", "WebDAV", "server", "in", "batch", ".", "More", "information", "you", "can", "find", "by", "link", "http", ":", "//", "webdav", ".", "org", "/", "specs", "/", "rfc4918", ".", "h...
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L674-L689
train
kamikaze/webdav
src/webdav/client.py
WebDavXmlUtils.parse_get_list_response
def parse_get_list_response(content): """Parses of response content XML from WebDAV server and extract file and directory names. :param content: the XML content of HTTP response from WebDAV server for getting list of files by remote path. :return: list of extracted file or directory names. ...
python
def parse_get_list_response(content): """Parses of response content XML from WebDAV server and extract file and directory names. :param content: the XML content of HTTP response from WebDAV server for getting list of files by remote path. :return: list of extracted file or directory names. ...
[ "def", "parse_get_list_response", "(", "content", ")", ":", "try", ":", "tree", "=", "etree", ".", "fromstring", "(", "content", ")", "hrees", "=", "[", "Urn", ".", "separate", "+", "unquote", "(", "urlsplit", "(", "hree", ".", "text", ")", ".", "path"...
Parses of response content XML from WebDAV server and extract file and directory names. :param content: the XML content of HTTP response from WebDAV server for getting list of files by remote path. :return: list of extracted file or directory names.
[ "Parses", "of", "response", "content", "XML", "from", "WebDAV", "server", "and", "extract", "file", "and", "directory", "names", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L852-L863
train
kamikaze/webdav
src/webdav/client.py
WebDavXmlUtils.create_free_space_request_content
def create_free_space_request_content(): """Creates an XML for requesting of free space on remote WebDAV server. :return: the XML string of request content. """ root = etree.Element('propfind', xmlns='DAV:') prop = etree.SubElement(root, 'prop') etree.SubElement(prop, 'q...
python
def create_free_space_request_content(): """Creates an XML for requesting of free space on remote WebDAV server. :return: the XML string of request content. """ root = etree.Element('propfind', xmlns='DAV:') prop = etree.SubElement(root, 'prop') etree.SubElement(prop, 'q...
[ "def", "create_free_space_request_content", "(", ")", ":", "root", "=", "etree", ".", "Element", "(", "'propfind'", ",", "xmlns", "=", "'DAV:'", ")", "prop", "=", "etree", ".", "SubElement", "(", "root", ",", "'prop'", ")", "etree", ".", "SubElement", "(",...
Creates an XML for requesting of free space on remote WebDAV server. :return: the XML string of request content.
[ "Creates", "an", "XML", "for", "requesting", "of", "free", "space", "on", "remote", "WebDAV", "server", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L866-L876
train
kamikaze/webdav
src/webdav/client.py
WebDavXmlUtils.parse_free_space_response
def parse_free_space_response(content, hostname): """Parses of response content XML from WebDAV server and extract an amount of free space. :param content: the XML content of HTTP response from WebDAV server for getting free space. :param hostname: the server hostname. :return: an amoun...
python
def parse_free_space_response(content, hostname): """Parses of response content XML from WebDAV server and extract an amount of free space. :param content: the XML content of HTTP response from WebDAV server for getting free space. :param hostname: the server hostname. :return: an amoun...
[ "def", "parse_free_space_response", "(", "content", ",", "hostname", ")", ":", "try", ":", "tree", "=", "etree", ".", "fromstring", "(", "content", ")", "node", "=", "tree", ".", "find", "(", "'.//{DAV:}quota-available-bytes'", ")", "if", "node", "is", "not"...
Parses of response content XML from WebDAV server and extract an amount of free space. :param content: the XML content of HTTP response from WebDAV server for getting free space. :param hostname: the server hostname. :return: an amount of free space in bytes.
[ "Parses", "of", "response", "content", "XML", "from", "WebDAV", "server", "and", "extract", "an", "amount", "of", "free", "space", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L879-L896
train
kamikaze/webdav
src/webdav/client.py
WebDavXmlUtils.parse_info_response
def parse_info_response(content, path, hostname): """Parses of response content XML from WebDAV server and extract an information about resource. :param content: the XML content of HTTP response from WebDAV server. :param path: the path to resource. :param hostname: the server hostname....
python
def parse_info_response(content, path, hostname): """Parses of response content XML from WebDAV server and extract an information about resource. :param content: the XML content of HTTP response from WebDAV server. :param path: the path to resource. :param hostname: the server hostname....
[ "def", "parse_info_response", "(", "content", ",", "path", ",", "hostname", ")", ":", "response", "=", "WebDavXmlUtils", ".", "extract_response_for_path", "(", "content", "=", "content", ",", "path", "=", "path", ",", "hostname", "=", "hostname", ")", "find_at...
Parses of response content XML from WebDAV server and extract an information about resource. :param content: the XML content of HTTP response from WebDAV server. :param path: the path to resource. :param hostname: the server hostname. :return: a dictionary of information attributes and ...
[ "Parses", "of", "response", "content", "XML", "from", "WebDAV", "server", "and", "extract", "an", "information", "about", "resource", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L899-L921
train
kamikaze/webdav
src/webdav/client.py
WebDavXmlUtils.parse_is_dir_response
def parse_is_dir_response(content, path, hostname): """Parses of response content XML from WebDAV server and extract an information about resource. :param content: the XML content of HTTP response from WebDAV server. :param path: the path to resource. :param hostname: the server hostnam...
python
def parse_is_dir_response(content, path, hostname): """Parses of response content XML from WebDAV server and extract an information about resource. :param content: the XML content of HTTP response from WebDAV server. :param path: the path to resource. :param hostname: the server hostnam...
[ "def", "parse_is_dir_response", "(", "content", ",", "path", ",", "hostname", ")", ":", "response", "=", "WebDavXmlUtils", ".", "extract_response_for_path", "(", "content", "=", "content", ",", "path", "=", "path", ",", "hostname", "=", "hostname", ")", "resou...
Parses of response content XML from WebDAV server and extract an information about resource. :param content: the XML content of HTTP response from WebDAV server. :param path: the path to resource. :param hostname: the server hostname. :return: True in case the remote resource is directo...
[ "Parses", "of", "response", "content", "XML", "from", "WebDAV", "server", "and", "extract", "an", "information", "about", "resource", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L924-L940
train
kamikaze/webdav
src/webdav/client.py
WebDavXmlUtils.create_get_property_request_content
def create_get_property_request_content(option): """Creates an XML for requesting of getting a property value of remote WebDAV resource. :param option: the property attributes as dictionary with following keys: `namespace`: (optional) the namespace for XML property which will be ...
python
def create_get_property_request_content(option): """Creates an XML for requesting of getting a property value of remote WebDAV resource. :param option: the property attributes as dictionary with following keys: `namespace`: (optional) the namespace for XML property which will be ...
[ "def", "create_get_property_request_content", "(", "option", ")", ":", "root", "=", "etree", ".", "Element", "(", "'propfind'", ",", "xmlns", "=", "'DAV:'", ")", "prop", "=", "etree", ".", "SubElement", "(", "root", ",", "'prop'", ")", "etree", ".", "SubEl...
Creates an XML for requesting of getting a property value of remote WebDAV resource. :param option: the property attributes as dictionary with following keys: `namespace`: (optional) the namespace for XML property which will be get, `name`: the name of property whi...
[ "Creates", "an", "XML", "for", "requesting", "of", "getting", "a", "property", "value", "of", "remote", "WebDAV", "resource", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L943-L955
train
kamikaze/webdav
src/webdav/client.py
WebDavXmlUtils.parse_get_property_response
def parse_get_property_response(content, name): """Parses of response content XML from WebDAV server for getting metadata property value for some resource. :param content: the XML content of response as string. :param name: the name of property for finding a value in response :return: t...
python
def parse_get_property_response(content, name): """Parses of response content XML from WebDAV server for getting metadata property value for some resource. :param content: the XML content of response as string. :param name: the name of property for finding a value in response :return: t...
[ "def", "parse_get_property_response", "(", "content", ",", "name", ")", ":", "tree", "=", "etree", ".", "fromstring", "(", "content", ")", "return", "tree", ".", "xpath", "(", "'//*[local-name() = $name]'", ",", "name", "=", "name", ")", "[", "0", "]", "."...
Parses of response content XML from WebDAV server for getting metadata property value for some resource. :param content: the XML content of response as string. :param name: the name of property for finding a value in response :return: the value of property if it has been found or None otherwise...
[ "Parses", "of", "response", "content", "XML", "from", "WebDAV", "server", "for", "getting", "metadata", "property", "value", "for", "some", "resource", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L958-L966
train
kamikaze/webdav
src/webdav/client.py
WebDavXmlUtils.create_set_property_batch_request_content
def create_set_property_batch_request_content(options): """Creates an XML for requesting of setting a property values for remote WebDAV resource in batch. :param options: the property attributes as list of dictionaries with following keys: `namespace`: (optional) the namespace fo...
python
def create_set_property_batch_request_content(options): """Creates an XML for requesting of setting a property values for remote WebDAV resource in batch. :param options: the property attributes as list of dictionaries with following keys: `namespace`: (optional) the namespace fo...
[ "def", "create_set_property_batch_request_content", "(", "options", ")", ":", "root_node", "=", "etree", ".", "Element", "(", "'propertyupdate'", ",", "xmlns", "=", "'DAV:'", ")", "set_node", "=", "etree", ".", "SubElement", "(", "root_node", ",", "'set'", ")", ...
Creates an XML for requesting of setting a property values for remote WebDAV resource in batch. :param options: the property attributes as list of dictionaries with following keys: `namespace`: (optional) the namespace for XML property which will be set, `name`: th...
[ "Creates", "an", "XML", "for", "requesting", "of", "setting", "a", "property", "values", "for", "remote", "WebDAV", "resource", "in", "batch", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L969-L985
train
kamikaze/webdav
src/webdav/client.py
WebDavXmlUtils.etree_to_string
def etree_to_string(tree): """Creates string from lxml.etree.ElementTree with XML declaration and UTF-8 encoding. :param tree: the instance of ElementTree :return: the string of XML. """ buff = BytesIO() tree.write(buff, xml_declaration=True, encoding='UTF-8') re...
python
def etree_to_string(tree): """Creates string from lxml.etree.ElementTree with XML declaration and UTF-8 encoding. :param tree: the instance of ElementTree :return: the string of XML. """ buff = BytesIO() tree.write(buff, xml_declaration=True, encoding='UTF-8') re...
[ "def", "etree_to_string", "(", "tree", ")", ":", "buff", "=", "BytesIO", "(", ")", "tree", ".", "write", "(", "buff", ",", "xml_declaration", "=", "True", ",", "encoding", "=", "'UTF-8'", ")", "return", "buff", ".", "getvalue", "(", ")" ]
Creates string from lxml.etree.ElementTree with XML declaration and UTF-8 encoding. :param tree: the instance of ElementTree :return: the string of XML.
[ "Creates", "string", "from", "lxml", ".", "etree", ".", "ElementTree", "with", "XML", "declaration", "and", "UTF", "-", "8", "encoding", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L988-L996
train
kamikaze/webdav
src/webdav/client.py
WebDavXmlUtils.extract_response_for_path
def extract_response_for_path(content, path, hostname): """Extracts single response for specified remote resource. :param content: raw content of response as string. :param path: the path to needed remote resource. :param hostname: the server hostname. :return: XML object of res...
python
def extract_response_for_path(content, path, hostname): """Extracts single response for specified remote resource. :param content: raw content of response as string. :param path: the path to needed remote resource. :param hostname: the server hostname. :return: XML object of res...
[ "def", "extract_response_for_path", "(", "content", ",", "path", ",", "hostname", ")", ":", "try", ":", "tree", "=", "etree", ".", "fromstring", "(", "content", ")", "responses", "=", "tree", ".", "findall", "(", "'{DAV:}response'", ")", "n_path", "=", "Ur...
Extracts single response for specified remote resource. :param content: raw content of response as string. :param path: the path to needed remote resource. :param hostname: the server hostname. :return: XML object of response for the remote resource defined by path.
[ "Extracts", "single", "response", "for", "specified", "remote", "resource", "." ]
6facff7224023d3e28c8e1592f3c58401c91a0e6
https://github.com/kamikaze/webdav/blob/6facff7224023d3e28c8e1592f3c58401c91a0e6/src/webdav/client.py#L999-L1020
train
Nukesor/pueue
pueue/daemon/files.py
cleanup
def cleanup(config_dir): """Remove temporary stderr and stdout files as well as the daemon socket.""" stdout_path = os.path.join(config_dir, 'pueue.stdout') stderr_path = os.path.join(config_dir, 'pueue.stderr') if os._exists(stdout_path): os.remove(stdout_path) if os._exists(stderr_path): ...
python
def cleanup(config_dir): """Remove temporary stderr and stdout files as well as the daemon socket.""" stdout_path = os.path.join(config_dir, 'pueue.stdout') stderr_path = os.path.join(config_dir, 'pueue.stderr') if os._exists(stdout_path): os.remove(stdout_path) if os._exists(stderr_path): ...
[ "def", "cleanup", "(", "config_dir", ")", ":", "stdout_path", "=", "os", ".", "path", ".", "join", "(", "config_dir", ",", "'pueue.stdout'", ")", "stderr_path", "=", "os", ".", "path", ".", "join", "(", "config_dir", ",", "'pueue.stderr'", ")", "if", "os...
Remove temporary stderr and stdout files as well as the daemon socket.
[ "Remove", "temporary", "stderr", "and", "stdout", "files", "as", "well", "as", "the", "daemon", "socket", "." ]
f1d276360454d4dd2738658a13df1e20caa4b926
https://github.com/Nukesor/pueue/blob/f1d276360454d4dd2738658a13df1e20caa4b926/pueue/daemon/files.py#L5-L16
train
Nukesor/pueue
pueue/daemon/files.py
get_descriptor_output
def get_descriptor_output(descriptor, key, handler=None): """Get the descriptor output and handle incorrect UTF-8 encoding of subprocess logs. In case an process contains valid UTF-8 lines as well as invalid lines, we want to preserve the valid and remove the invalid ones. To do this we need to get eac...
python
def get_descriptor_output(descriptor, key, handler=None): """Get the descriptor output and handle incorrect UTF-8 encoding of subprocess logs. In case an process contains valid UTF-8 lines as well as invalid lines, we want to preserve the valid and remove the invalid ones. To do this we need to get eac...
[ "def", "get_descriptor_output", "(", "descriptor", ",", "key", ",", "handler", "=", "None", ")", ":", "line", "=", "'stub'", "lines", "=", "''", "while", "line", "!=", "''", ":", "try", ":", "line", "=", "descriptor", ".", "readline", "(", ")", "lines"...
Get the descriptor output and handle incorrect UTF-8 encoding of subprocess logs. In case an process contains valid UTF-8 lines as well as invalid lines, we want to preserve the valid and remove the invalid ones. To do this we need to get each line and check for an UnicodeDecodeError.
[ "Get", "the", "descriptor", "output", "and", "handle", "incorrect", "UTF", "-", "8", "encoding", "of", "subprocess", "logs", "." ]
f1d276360454d4dd2738658a13df1e20caa4b926
https://github.com/Nukesor/pueue/blob/f1d276360454d4dd2738658a13df1e20caa4b926/pueue/daemon/files.py#L19-L38
train
MediaFire/mediafire-python-open-sdk
mediafire/media/conversion_server_client.py
ConversionServerClient.request
def request(self, hash_, quickkey, doc_type, page=None, output=None, size_id=None, metadata=None, request_conversion_only=None): """Query conversion server hash_: 4 characters of file hash quickkey: File quickkey doc_type: "i" for image, "d" for documents...
python
def request(self, hash_, quickkey, doc_type, page=None, output=None, size_id=None, metadata=None, request_conversion_only=None): """Query conversion server hash_: 4 characters of file hash quickkey: File quickkey doc_type: "i" for image, "d" for documents...
[ "def", "request", "(", "self", ",", "hash_", ",", "quickkey", ",", "doc_type", ",", "page", "=", "None", ",", "output", "=", "None", ",", "size_id", "=", "None", ",", "metadata", "=", "None", ",", "request_conversion_only", "=", "None", ")", ":", "if",...
Query conversion server hash_: 4 characters of file hash quickkey: File quickkey doc_type: "i" for image, "d" for documents page: The page to convert. If page is set to 'initial', the first 10 pages of the document will be provided. (document) output: "pdf", "img",...
[ "Query", "conversion", "server" ]
8f1f23db1b16f16e026f5c6777aec32d00baa05f
https://github.com/MediaFire/mediafire-python-open-sdk/blob/8f1f23db1b16f16e026f5c6777aec32d00baa05f/mediafire/media/conversion_server_client.py#L36-L80
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
user_method
def user_method(user_event): """Decorator of the Pdb user_* methods that controls the RemoteSocket.""" def wrapper(self, *args): stdin = self.stdin is_sock = isinstance(stdin, RemoteSocket) try: try: if is_sock and not stdin.connect(): retu...
python
def user_method(user_event): """Decorator of the Pdb user_* methods that controls the RemoteSocket.""" def wrapper(self, *args): stdin = self.stdin is_sock = isinstance(stdin, RemoteSocket) try: try: if is_sock and not stdin.connect(): retu...
[ "def", "user_method", "(", "user_event", ")", ":", "def", "wrapper", "(", "self", ",", "*", "args", ")", ":", "stdin", "=", "self", ".", "stdin", "is_sock", "=", "isinstance", "(", "stdin", ",", "RemoteSocket", ")", "try", ":", "try", ":", "if", "is_...
Decorator of the Pdb user_* methods that controls the RemoteSocket.
[ "Decorator", "of", "the", "Pdb", "user_", "*", "methods", "that", "controls", "the", "RemoteSocket", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L115-L131
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.user_line
def user_line(self, frame, breakpoint_hits=None): """This function is called when we stop or break at this line.""" if not breakpoint_hits: self.interaction(frame, None) else: commands_result = self.bp_commands(frame, breakpoint_hits) if not commands_result: ...
python
def user_line(self, frame, breakpoint_hits=None): """This function is called when we stop or break at this line.""" if not breakpoint_hits: self.interaction(frame, None) else: commands_result = self.bp_commands(frame, breakpoint_hits) if not commands_result: ...
[ "def", "user_line", "(", "self", ",", "frame", ",", "breakpoint_hits", "=", "None", ")", ":", "if", "not", "breakpoint_hits", ":", "self", ".", "interaction", "(", "frame", ",", "None", ")", "else", ":", "commands_result", "=", "self", ".", "bp_commands", ...
This function is called when we stop or break at this line.
[ "This", "function", "is", "called", "when", "we", "stop", "or", "break", "at", "this", "line", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L518-L532
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.bp_commands
def bp_commands(self, frame, breakpoint_hits): """Call every command that was set for the current active breakpoints. Returns True if the normal interaction function must be called, False otherwise.""" # Handle multiple breakpoints on the same line (issue 14789) effective_bp_lis...
python
def bp_commands(self, frame, breakpoint_hits): """Call every command that was set for the current active breakpoints. Returns True if the normal interaction function must be called, False otherwise.""" # Handle multiple breakpoints on the same line (issue 14789) effective_bp_lis...
[ "def", "bp_commands", "(", "self", ",", "frame", ",", "breakpoint_hits", ")", ":", "# Handle multiple breakpoints on the same line (issue 14789)", "effective_bp_list", ",", "temporaries", "=", "breakpoint_hits", "silent", "=", "True", "doprompt", "=", "False", "atleast_on...
Call every command that was set for the current active breakpoints. Returns True if the normal interaction function must be called, False otherwise.
[ "Call", "every", "command", "that", "was", "set", "for", "the", "current", "active", "breakpoints", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L534-L564
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.user_return
def user_return(self, frame, return_value): """This function is called when a return trap is set here.""" frame.f_locals['__return__'] = return_value self.message('--Return--') self.interaction(frame, None)
python
def user_return(self, frame, return_value): """This function is called when a return trap is set here.""" frame.f_locals['__return__'] = return_value self.message('--Return--') self.interaction(frame, None)
[ "def", "user_return", "(", "self", ",", "frame", ",", "return_value", ")", ":", "frame", ".", "f_locals", "[", "'__return__'", "]", "=", "return_value", "self", ".", "message", "(", "'--Return--'", ")", "self", ".", "interaction", "(", "frame", ",", "None"...
This function is called when a return trap is set here.
[ "This", "function", "is", "called", "when", "a", "return", "trap", "is", "set", "here", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L567-L571
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.user_exception
def user_exception(self, frame, exc_info): """This function is called if an exception occurs, but only if we are to stop at or just below this level.""" exc_type, exc_value, exc_traceback = exc_info frame.f_locals['__exception__'] = exc_type, exc_value # An 'Internal StopIterati...
python
def user_exception(self, frame, exc_info): """This function is called if an exception occurs, but only if we are to stop at or just below this level.""" exc_type, exc_value, exc_traceback = exc_info frame.f_locals['__exception__'] = exc_type, exc_value # An 'Internal StopIterati...
[ "def", "user_exception", "(", "self", ",", "frame", ",", "exc_info", ")", ":", "exc_type", ",", "exc_value", ",", "exc_traceback", "=", "exc_info", "frame", ".", "f_locals", "[", "'__exception__'", "]", "=", "exc_type", ",", "exc_value", "# An 'Internal StopIter...
This function is called if an exception occurs, but only if we are to stop at or just below this level.
[ "This", "function", "is", "called", "if", "an", "exception", "occurs", "but", "only", "if", "we", "are", "to", "stop", "at", "or", "just", "below", "this", "level", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L574-L589
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.precmd
def precmd(self, line): """Handle alias expansion and ';;' separator.""" if not line.strip(): return line args = line.split() while args[0] in self.aliases: line = self.aliases[args[0]] ii = 1 for tmpArg in args[1:]: line = ...
python
def precmd(self, line): """Handle alias expansion and ';;' separator.""" if not line.strip(): return line args = line.split() while args[0] in self.aliases: line = self.aliases[args[0]] ii = 1 for tmpArg in args[1:]: line = ...
[ "def", "precmd", "(", "self", ",", "line", ")", ":", "if", "not", "line", ".", "strip", "(", ")", ":", "return", "line", "args", "=", "line", ".", "split", "(", ")", "while", "args", "[", "0", "]", "in", "self", ".", "aliases", ":", "line", "="...
Handle alias expansion and ';;' separator.
[ "Handle", "alias", "expansion", "and", ";;", "separator", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L683-L706
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.onecmd
def onecmd(self, line): """Interpret the argument as though it had been typed in response to the prompt. Checks whether this line is typed at the normal prompt or in a breakpoint command list definition. """ if not self.commands_defining: return cmd.Cmd.onecm...
python
def onecmd(self, line): """Interpret the argument as though it had been typed in response to the prompt. Checks whether this line is typed at the normal prompt or in a breakpoint command list definition. """ if not self.commands_defining: return cmd.Cmd.onecm...
[ "def", "onecmd", "(", "self", ",", "line", ")", ":", "if", "not", "self", ".", "commands_defining", ":", "return", "cmd", ".", "Cmd", ".", "onecmd", "(", "self", ",", "line", ")", "else", ":", "return", "self", ".", "handle_command_def", "(", "line", ...
Interpret the argument as though it had been typed in response to the prompt. Checks whether this line is typed at the normal prompt or in a breakpoint command list definition.
[ "Interpret", "the", "argument", "as", "though", "it", "had", "been", "typed", "in", "response", "to", "the", "prompt", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L708-L718
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.handle_command_def
def handle_command_def(self, line): """Handles one command line during command list definition.""" cmd, arg, line = self.parseline(line) if not cmd: return if cmd == 'silent': self.commands_silent[self.commands_bnum] = True return # continue to handle ...
python
def handle_command_def(self, line): """Handles one command line during command list definition.""" cmd, arg, line = self.parseline(line) if not cmd: return if cmd == 'silent': self.commands_silent[self.commands_bnum] = True return # continue to handle ...
[ "def", "handle_command_def", "(", "self", ",", "line", ")", ":", "cmd", ",", "arg", ",", "line", "=", "self", ".", "parseline", "(", "line", ")", "if", "not", "cmd", ":", "return", "if", "cmd", "==", "'silent'", ":", "self", ".", "commands_silent", "...
Handles one command line during command list definition.
[ "Handles", "one", "command", "line", "during", "command", "list", "definition", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L720-L746
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_commands
def do_commands(self, arg): """commands [bpnumber] (com) ... (com) end (Pdb) Specify a list of commands for breakpoint number bpnumber. The commands themselves are entered on the following lines. Type a line containing just 'end' to terminate the commands. ...
python
def do_commands(self, arg): """commands [bpnumber] (com) ... (com) end (Pdb) Specify a list of commands for breakpoint number bpnumber. The commands themselves are entered on the following lines. Type a line containing just 'end' to terminate the commands. ...
[ "def", "do_commands", "(", "self", ",", "arg", ")", ":", "if", "not", "arg", ":", "bnum", "=", "len", "(", "bdb", ".", "Breakpoint", ".", "bpbynumber", ")", "-", "1", "else", ":", "try", ":", "bnum", "=", "int", "(", "arg", ")", "except", "Except...
commands [bpnumber] (com) ... (com) end (Pdb) Specify a list of commands for breakpoint number bpnumber. The commands themselves are entered on the following lines. Type a line containing just 'end' to terminate the commands. The commands are executed when the br...
[ "commands", "[", "bpnumber", "]", "(", "com", ")", "...", "(", "com", ")", "end", "(", "Pdb", ")" ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L815-L890
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_break
def do_break(self, arg, temporary = 0): """b(reak) [ ([filename:]lineno | function) [, condition] ] Without argument, list all breaks. With a line number argument, set a break at this line in the current file. With a function name, set a break at the first executable line of th...
python
def do_break(self, arg, temporary = 0): """b(reak) [ ([filename:]lineno | function) [, condition] ] Without argument, list all breaks. With a line number argument, set a break at this line in the current file. With a function name, set a break at the first executable line of th...
[ "def", "do_break", "(", "self", ",", "arg", ",", "temporary", "=", "0", ")", ":", "if", "not", "arg", ":", "all_breaks", "=", "'\\n'", ".", "join", "(", "bp", ".", "bpformat", "(", ")", "for", "bp", "in", "bdb", ".", "Breakpoint", ".", "bpbynumber"...
b(reak) [ ([filename:]lineno | function) [, condition] ] Without argument, list all breaks. With a line number argument, set a break at this line in the current file. With a function name, set a break at the first executable line of that function. If a second argument is prese...
[ "b", "(", "reak", ")", "[", "(", "[", "filename", ":", "]", "lineno", "|", "function", ")", "[", "condition", "]", "]", "Without", "argument", "list", "all", "breaks", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L894-L970
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.defaultFile
def defaultFile(self): """Produce a reasonable default.""" filename = self.curframe.f_code.co_filename if filename == '<string>' and self.mainpyfile: filename = self.mainpyfile return filename
python
def defaultFile(self): """Produce a reasonable default.""" filename = self.curframe.f_code.co_filename if filename == '<string>' and self.mainpyfile: filename = self.mainpyfile return filename
[ "def", "defaultFile", "(", "self", ")", ":", "filename", "=", "self", ".", "curframe", ".", "f_code", ".", "co_filename", "if", "filename", "==", "'<string>'", "and", "self", ".", "mainpyfile", ":", "filename", "=", "self", ".", "mainpyfile", "return", "fi...
Produce a reasonable default.
[ "Produce", "a", "reasonable", "default", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L973-L978
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_enable
def do_enable(self, arg): """enable bpnumber [bpnumber ...] Enables the breakpoints given as a space separated list of breakpoint numbers. """ args = arg.split() for i in args: try: bp = self.get_bpbynumber(i) except ValueError as e...
python
def do_enable(self, arg): """enable bpnumber [bpnumber ...] Enables the breakpoints given as a space separated list of breakpoint numbers. """ args = arg.split() for i in args: try: bp = self.get_bpbynumber(i) except ValueError as e...
[ "def", "do_enable", "(", "self", ",", "arg", ")", ":", "args", "=", "arg", ".", "split", "(", ")", "for", "i", "in", "args", ":", "try", ":", "bp", "=", "self", ".", "get_bpbynumber", "(", "i", ")", "except", "ValueError", "as", "err", ":", "self...
enable bpnumber [bpnumber ...] Enables the breakpoints given as a space separated list of breakpoint numbers.
[ "enable", "bpnumber", "[", "bpnumber", "...", "]", "Enables", "the", "breakpoints", "given", "as", "a", "space", "separated", "list", "of", "breakpoint", "numbers", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L998-L1011
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_disable
def do_disable(self, arg): """disable bpnumber [bpnumber ...] Disables the breakpoints given as a space separated list of breakpoint numbers. Disabling a breakpoint means it cannot cause the program to stop execution, but unlike clearing a breakpoint, it remains in the list of b...
python
def do_disable(self, arg): """disable bpnumber [bpnumber ...] Disables the breakpoints given as a space separated list of breakpoint numbers. Disabling a breakpoint means it cannot cause the program to stop execution, but unlike clearing a breakpoint, it remains in the list of b...
[ "def", "do_disable", "(", "self", ",", "arg", ")", ":", "args", "=", "arg", ".", "split", "(", ")", "for", "i", "in", "args", ":", "try", ":", "bp", "=", "self", ".", "get_bpbynumber", "(", "i", ")", "except", "ValueError", "as", "err", ":", "sel...
disable bpnumber [bpnumber ...] Disables the breakpoints given as a space separated list of breakpoint numbers. Disabling a breakpoint means it cannot cause the program to stop execution, but unlike clearing a breakpoint, it remains in the list of breakpoints and can be (re-)ena...
[ "disable", "bpnumber", "[", "bpnumber", "...", "]", "Disables", "the", "breakpoints", "given", "as", "a", "space", "separated", "list", "of", "breakpoint", "numbers", ".", "Disabling", "a", "breakpoint", "means", "it", "cannot", "cause", "the", "program", "to"...
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1015-L1031
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_condition
def do_condition(self, arg): """condition bpnumber [condition] Set a new condition for the breakpoint, an expression which must evaluate to true before the breakpoint is honored. If condition is absent, any existing condition is removed; i.e., the breakpoint is made unconditiona...
python
def do_condition(self, arg): """condition bpnumber [condition] Set a new condition for the breakpoint, an expression which must evaluate to true before the breakpoint is honored. If condition is absent, any existing condition is removed; i.e., the breakpoint is made unconditiona...
[ "def", "do_condition", "(", "self", ",", "arg", ")", ":", "args", "=", "arg", ".", "split", "(", "' '", ",", "1", ")", "try", ":", "cond", "=", "args", "[", "1", "]", "except", "IndexError", ":", "cond", "=", "None", "try", ":", "bp", "=", "sel...
condition bpnumber [condition] Set a new condition for the breakpoint, an expression which must evaluate to true before the breakpoint is honored. If condition is absent, any existing condition is removed; i.e., the breakpoint is made unconditional.
[ "condition", "bpnumber", "[", "condition", "]", "Set", "a", "new", "condition", "for", "the", "breakpoint", "an", "expression", "which", "must", "evaluate", "to", "true", "before", "the", "breakpoint", "is", "honored", ".", "If", "condition", "is", "absent", ...
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1035-L1058
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_ignore
def do_ignore(self, arg): """ignore bpnumber [count] Set the ignore count for the given breakpoint number. If count is omitted, the ignore count is set to 0. A breakpoint becomes active when the ignore count is zero. When non-zero, the count is decremented each time the breakp...
python
def do_ignore(self, arg): """ignore bpnumber [count] Set the ignore count for the given breakpoint number. If count is omitted, the ignore count is set to 0. A breakpoint becomes active when the ignore count is zero. When non-zero, the count is decremented each time the breakp...
[ "def", "do_ignore", "(", "self", ",", "arg", ")", ":", "args", "=", "arg", ".", "split", "(", "' '", ",", "1", ")", "try", ":", "count", "=", "int", "(", "args", "[", "1", "]", ".", "strip", "(", ")", ")", "except", "Exception", ":", "count", ...
ignore bpnumber [count] Set the ignore count for the given breakpoint number. If count is omitted, the ignore count is set to 0. A breakpoint becomes active when the ignore count is zero. When non-zero, the count is decremented each time the breakpoint is reached and the break...
[ "ignore", "bpnumber", "[", "count", "]", "Set", "the", "ignore", "count", "for", "the", "given", "breakpoint", "number", ".", "If", "count", "is", "omitted", "the", "ignore", "count", "is", "set", "to", "0", ".", "A", "breakpoint", "becomes", "active", "...
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1062-L1093
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_clear
def do_clear(self, arg): """cl(ear) filename:lineno\ncl(ear) [bpnumber [bpnumber...]] With a space separated list of breakpoint numbers, clear those breakpoints. Without argument, clear all breaks (but first ask confirmation). With a filename:lineno argument, clear all breaks a...
python
def do_clear(self, arg): """cl(ear) filename:lineno\ncl(ear) [bpnumber [bpnumber...]] With a space separated list of breakpoint numbers, clear those breakpoints. Without argument, clear all breaks (but first ask confirmation). With a filename:lineno argument, clear all breaks a...
[ "def", "do_clear", "(", "self", ",", "arg", ")", ":", "if", "not", "arg", ":", "try", ":", "if", "PY3", ":", "reply", "=", "input", "(", "'Clear all breaks? '", ")", "else", ":", "reply", "=", "raw_input", "(", "'Clear all breaks? '", ")", "except", "E...
cl(ear) filename:lineno\ncl(ear) [bpnumber [bpnumber...]] With a space separated list of breakpoint numbers, clear those breakpoints. Without argument, clear all breaks (but first ask confirmation). With a filename:lineno argument, clear all breaks at that line in that file.
[ "cl", "(", "ear", ")", "filename", ":", "lineno", "\\", "ncl", "(", "ear", ")", "[", "bpnumber", "[", "bpnumber", "...", "]]", "With", "a", "space", "separated", "list", "of", "breakpoint", "numbers", "clear", "those", "breakpoints", ".", "Without", "arg...
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1100-L1148
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_up
def do_up(self, arg): """u(p) [count] Move the current frame count (default one) levels up in the stack trace (to an older frame). """ if self.curindex == 0: self.error('Oldest frame') return try: count = int(arg or 1) except Va...
python
def do_up(self, arg): """u(p) [count] Move the current frame count (default one) levels up in the stack trace (to an older frame). """ if self.curindex == 0: self.error('Oldest frame') return try: count = int(arg or 1) except Va...
[ "def", "do_up", "(", "self", ",", "arg", ")", ":", "if", "self", ".", "curindex", "==", "0", ":", "self", ".", "error", "(", "'Oldest frame'", ")", "return", "try", ":", "count", "=", "int", "(", "arg", "or", "1", ")", "except", "ValueError", ":", ...
u(p) [count] Move the current frame count (default one) levels up in the stack trace (to an older frame).
[ "u", "(", "p", ")", "[", "count", "]", "Move", "the", "current", "frame", "count", "(", "default", "one", ")", "levels", "up", "in", "the", "stack", "trace", "(", "to", "an", "older", "frame", ")", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1171-L1188
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_down
def do_down(self, arg): """d(own) [count] Move the current frame count (default one) levels down in the stack trace (to a newer frame). """ if self.curindex + 1 == len(self.stack): self.error('Newest frame') return try: count = int(arg ...
python
def do_down(self, arg): """d(own) [count] Move the current frame count (default one) levels down in the stack trace (to a newer frame). """ if self.curindex + 1 == len(self.stack): self.error('Newest frame') return try: count = int(arg ...
[ "def", "do_down", "(", "self", ",", "arg", ")", ":", "if", "self", ".", "curindex", "+", "1", "==", "len", "(", "self", ".", "stack", ")", ":", "self", ".", "error", "(", "'Newest frame'", ")", "return", "try", ":", "count", "=", "int", "(", "arg...
d(own) [count] Move the current frame count (default one) levels down in the stack trace (to a newer frame).
[ "d", "(", "own", ")", "[", "count", "]", "Move", "the", "current", "frame", "count", "(", "default", "one", ")", "levels", "down", "in", "the", "stack", "trace", "(", "to", "a", "newer", "frame", ")", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1191-L1208
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_until
def do_until(self, arg): """unt(il) [lineno] Without argument, continue execution until the line with a number greater than the current one is reached. With a line number, continue execution until a line with a number greater or equal to that is reached. In both cases, also sto...
python
def do_until(self, arg): """unt(il) [lineno] Without argument, continue execution until the line with a number greater than the current one is reached. With a line number, continue execution until a line with a number greater or equal to that is reached. In both cases, also sto...
[ "def", "do_until", "(", "self", ",", "arg", ")", ":", "if", "arg", ":", "try", ":", "lineno", "=", "int", "(", "arg", ")", "except", "ValueError", ":", "self", ".", "error", "(", "'Error in argument: %r'", "%", "arg", ")", "return", "if", "lineno", "...
unt(il) [lineno] Without argument, continue execution until the line with a number greater than the current one is reached. With a line number, continue execution until a line with a number greater or equal to that is reached. In both cases, also stop when the current frame ret...
[ "unt", "(", "il", ")", "[", "lineno", "]", "Without", "argument", "continue", "execution", "until", "the", "line", "with", "a", "number", "greater", "than", "the", "current", "one", "is", "reached", ".", "With", "a", "line", "number", "continue", "executio...
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1211-L1233
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_run
def do_run(self, arg): """run [args...] Restart the debugged python program. If a string is supplied it is splitted with "shlex", and the result is used as the new sys.argv. History, breakpoints, actions and debugger options are preserved. "restart" is an alias for "run". ...
python
def do_run(self, arg): """run [args...] Restart the debugged python program. If a string is supplied it is splitted with "shlex", and the result is used as the new sys.argv. History, breakpoints, actions and debugger options are preserved. "restart" is an alias for "run". ...
[ "def", "do_run", "(", "self", ",", "arg", ")", ":", "if", "arg", ":", "argv0", "=", "sys", ".", "argv", "[", "0", ":", "1", "]", "sys", ".", "argv", "=", "shlex", ".", "split", "(", "arg", ")", "sys", ".", "argv", "[", ":", "0", "]", "=", ...
run [args...] Restart the debugged python program. If a string is supplied it is splitted with "shlex", and the result is used as the new sys.argv. History, breakpoints, actions and debugger options are preserved. "restart" is an alias for "run".
[ "run", "[", "args", "...", "]", "Restart", "the", "debugged", "python", "program", ".", "If", "a", "string", "is", "supplied", "it", "is", "splitted", "with", "shlex", "and", "the", "result", "is", "used", "as", "the", "new", "sys", ".", "argv", ".", ...
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1257-L1269
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_jump
def do_jump(self, arg): """j(ump) lineno Set the next line that will be executed. Only available in the bottom-most frame. This lets you jump back and execute code again, or jump forward to skip code that you don't want to run. It should be noted that not all jumps are...
python
def do_jump(self, arg): """j(ump) lineno Set the next line that will be executed. Only available in the bottom-most frame. This lets you jump back and execute code again, or jump forward to skip code that you don't want to run. It should be noted that not all jumps are...
[ "def", "do_jump", "(", "self", ",", "arg", ")", ":", "if", "self", ".", "curindex", "+", "1", "!=", "len", "(", "self", ".", "stack", ")", ":", "self", ".", "error", "(", "'You can only jump within the bottom frame'", ")", "return", "try", ":", "arg", ...
j(ump) lineno Set the next line that will be executed. Only available in the bottom-most frame. This lets you jump back and execute code again, or jump forward to skip code that you don't want to run. It should be noted that not all jumps are allowed -- for instance it...
[ "j", "(", "ump", ")", "lineno", "Set", "the", "next", "line", "that", "will", "be", "executed", ".", "Only", "available", "in", "the", "bottom", "-", "most", "frame", ".", "This", "lets", "you", "jump", "back", "and", "execute", "code", "again", "or", ...
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1291-L1317
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_debug
def do_debug(self, arg): """debug code Enter a recursive debugger that steps through the code argument (which is an arbitrary expression or statement to be executed in the current environment). """ self.settrace(False) globals = self.curframe.f_globals loc...
python
def do_debug(self, arg): """debug code Enter a recursive debugger that steps through the code argument (which is an arbitrary expression or statement to be executed in the current environment). """ self.settrace(False) globals = self.curframe.f_globals loc...
[ "def", "do_debug", "(", "self", ",", "arg", ")", ":", "self", ".", "settrace", "(", "False", ")", "globals", "=", "self", ".", "curframe", ".", "f_globals", "locals", "=", "self", ".", "get_locals", "(", "self", ".", "curframe", ")", "p", "=", "Pdb",...
debug code Enter a recursive debugger that steps through the code argument (which is an arbitrary expression or statement to be executed in the current environment).
[ "debug", "code", "Enter", "a", "recursive", "debugger", "that", "steps", "through", "the", "code", "argument", "(", "which", "is", "an", "arbitrary", "expression", "or", "statement", "to", "be", "executed", "in", "the", "current", "environment", ")", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1320-L1335
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_quit
def do_quit(self, arg): """q(uit)\nexit Quit from the debugger. The program being executed is aborted. """ if isinstance(self.stdin, RemoteSocket) and not self.is_debug_instance: return self.do_detach(arg) self._user_requested_quit = True self.set_quit() ...
python
def do_quit(self, arg): """q(uit)\nexit Quit from the debugger. The program being executed is aborted. """ if isinstance(self.stdin, RemoteSocket) and not self.is_debug_instance: return self.do_detach(arg) self._user_requested_quit = True self.set_quit() ...
[ "def", "do_quit", "(", "self", ",", "arg", ")", ":", "if", "isinstance", "(", "self", ".", "stdin", ",", "RemoteSocket", ")", "and", "not", "self", ".", "is_debug_instance", ":", "return", "self", ".", "do_detach", "(", "arg", ")", "self", ".", "_user_...
q(uit)\nexit Quit from the debugger. The program being executed is aborted.
[ "q", "(", "uit", ")", "\\", "nexit", "Quit", "from", "the", "debugger", ".", "The", "program", "being", "executed", "is", "aborted", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1349-L1357
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_args
def do_args(self, arg): """a(rgs) Print the argument list of the current function. """ co = self.curframe.f_code dict = self.get_locals(self.curframe) n = co.co_argcount if co.co_flags & 4: n = n+1 if co.co_flags & 8: n = n+1 for i in range(n): ...
python
def do_args(self, arg): """a(rgs) Print the argument list of the current function. """ co = self.curframe.f_code dict = self.get_locals(self.curframe) n = co.co_argcount if co.co_flags & 4: n = n+1 if co.co_flags & 8: n = n+1 for i in range(n): ...
[ "def", "do_args", "(", "self", ",", "arg", ")", ":", "co", "=", "self", ".", "curframe", ".", "f_code", "dict", "=", "self", ".", "get_locals", "(", "self", ".", "curframe", ")", "n", "=", "co", ".", "co_argcount", "if", "co", ".", "co_flags", "&",...
a(rgs) Print the argument list of the current function.
[ "a", "(", "rgs", ")", "Print", "the", "argument", "list", "of", "the", "current", "function", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1369-L1383
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_retval
def do_retval(self, arg): """retval Print the return value for the last return of a function. """ locals = self.get_locals(self.curframe) if '__return__' in locals: self.message(bdb.safe_repr(locals['__return__'])) else: self.error('Not yet returne...
python
def do_retval(self, arg): """retval Print the return value for the last return of a function. """ locals = self.get_locals(self.curframe) if '__return__' in locals: self.message(bdb.safe_repr(locals['__return__'])) else: self.error('Not yet returne...
[ "def", "do_retval", "(", "self", ",", "arg", ")", ":", "locals", "=", "self", ".", "get_locals", "(", "self", ".", "curframe", ")", "if", "'__return__'", "in", "locals", ":", "self", ".", "message", "(", "bdb", ".", "safe_repr", "(", "locals", "[", "...
retval Print the return value for the last return of a function.
[ "retval", "Print", "the", "return", "value", "for", "the", "last", "return", "of", "a", "function", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1386-L1394
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_p
def do_p(self, arg): """p expression Print the value of the expression. """ try: self.message(bdb.safe_repr(self._getval(arg))) except Exception: pass
python
def do_p(self, arg): """p expression Print the value of the expression. """ try: self.message(bdb.safe_repr(self._getval(arg))) except Exception: pass
[ "def", "do_p", "(", "self", ",", "arg", ")", ":", "try", ":", "self", ".", "message", "(", "bdb", ".", "safe_repr", "(", "self", ".", "_getval", "(", "arg", ")", ")", ")", "except", "Exception", ":", "pass" ]
p expression Print the value of the expression.
[ "p", "expression", "Print", "the", "value", "of", "the", "expression", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1418-L1425
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_pp
def do_pp(self, arg): """pp expression Pretty-print the value of the expression. """ obj = self._getval(arg) try: repr(obj) except Exception: self.message(bdb.safe_repr(obj)) else: self.message(pprint.pformat(obj))
python
def do_pp(self, arg): """pp expression Pretty-print the value of the expression. """ obj = self._getval(arg) try: repr(obj) except Exception: self.message(bdb.safe_repr(obj)) else: self.message(pprint.pformat(obj))
[ "def", "do_pp", "(", "self", ",", "arg", ")", ":", "obj", "=", "self", ".", "_getval", "(", "arg", ")", "try", ":", "repr", "(", "obj", ")", "except", "Exception", ":", "self", ".", "message", "(", "bdb", ".", "safe_repr", "(", "obj", ")", ")", ...
pp expression Pretty-print the value of the expression.
[ "pp", "expression", "Pretty", "-", "print", "the", "value", "of", "the", "expression", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1427-L1437
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_list
def do_list(self, arg): """l(ist) [first [,last] | .] List source code for the current file. Without arguments, list 11 lines around the current line or continue the previous listing. With . as argument, list 11 lines around the current line. With one argument, list 11 lines ...
python
def do_list(self, arg): """l(ist) [first [,last] | .] List source code for the current file. Without arguments, list 11 lines around the current line or continue the previous listing. With . as argument, list 11 lines around the current line. With one argument, list 11 lines ...
[ "def", "do_list", "(", "self", ",", "arg", ")", ":", "self", ".", "lastcmd", "=", "'list'", "last", "=", "None", "if", "arg", "and", "arg", "!=", "'.'", ":", "try", ":", "if", "','", "in", "arg", ":", "first", ",", "last", "=", "arg", ".", "spl...
l(ist) [first [,last] | .] List source code for the current file. Without arguments, list 11 lines around the current line or continue the previous listing. With . as argument, list 11 lines around the current line. With one argument, list 11 lines starting at that line. With...
[ "l", "(", "ist", ")", "[", "first", "[", "last", "]", "|", ".", "]" ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1443-L1491
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_longlist
def do_longlist(self, arg): """longlist | ll List the whole source code for the current function or frame. """ filename = self.curframe.f_code.co_filename breaklist = self.get_file_breaks(filename) try: lines, lineno = getsourcelines(self.curframe, ...
python
def do_longlist(self, arg): """longlist | ll List the whole source code for the current function or frame. """ filename = self.curframe.f_code.co_filename breaklist = self.get_file_breaks(filename) try: lines, lineno = getsourcelines(self.curframe, ...
[ "def", "do_longlist", "(", "self", ",", "arg", ")", ":", "filename", "=", "self", ".", "curframe", ".", "f_code", ".", "co_filename", "breaklist", "=", "self", ".", "get_file_breaks", "(", "filename", ")", "try", ":", "lines", ",", "lineno", "=", "getsou...
longlist | ll List the whole source code for the current function or frame.
[ "longlist", "|", "ll", "List", "the", "whole", "source", "code", "for", "the", "current", "function", "or", "frame", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1494-L1506
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_source
def do_source(self, arg): """source expression Try to get source code for the given object and display it. """ try: obj = self._getval(arg) except Exception: return try: lines, lineno = getsourcelines(obj, self.get_locals(self.curframe)...
python
def do_source(self, arg): """source expression Try to get source code for the given object and display it. """ try: obj = self._getval(arg) except Exception: return try: lines, lineno = getsourcelines(obj, self.get_locals(self.curframe)...
[ "def", "do_source", "(", "self", ",", "arg", ")", ":", "try", ":", "obj", "=", "self", ".", "_getval", "(", "arg", ")", "except", "Exception", ":", "return", "try", ":", "lines", ",", "lineno", "=", "getsourcelines", "(", "obj", ",", "self", ".", "...
source expression Try to get source code for the given object and display it.
[ "source", "expression", "Try", "to", "get", "source", "code", "for", "the", "given", "object", "and", "display", "it", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1509-L1522
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb._print_lines
def _print_lines(self, lines, start, breaks=(), frame=None): """Print a range of lines.""" if frame: current_lineno = frame.f_lineno exc_lineno = self.tb_lineno.get(frame, -1) else: current_lineno = exc_lineno = -1 for lineno, line in enumerate(lines, ...
python
def _print_lines(self, lines, start, breaks=(), frame=None): """Print a range of lines.""" if frame: current_lineno = frame.f_lineno exc_lineno = self.tb_lineno.get(frame, -1) else: current_lineno = exc_lineno = -1 for lineno, line in enumerate(lines, ...
[ "def", "_print_lines", "(", "self", ",", "lines", ",", "start", ",", "breaks", "=", "(", ")", ",", "frame", "=", "None", ")", ":", "if", "frame", ":", "current_lineno", "=", "frame", ".", "f_lineno", "exc_lineno", "=", "self", ".", "tb_lineno", ".", ...
Print a range of lines.
[ "Print", "a", "range", "of", "lines", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1526-L1545
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_whatis
def do_whatis(self, arg): """whatis arg Print the type of the argument. """ try: value = self._getval(arg) except Exception: # _getval() already printed the error return code = None # Is it a function? try: c...
python
def do_whatis(self, arg): """whatis arg Print the type of the argument. """ try: value = self._getval(arg) except Exception: # _getval() already printed the error return code = None # Is it a function? try: c...
[ "def", "do_whatis", "(", "self", ",", "arg", ")", ":", "try", ":", "value", "=", "self", ".", "_getval", "(", "arg", ")", "except", "Exception", ":", "# _getval() already printed the error", "return", "code", "=", "None", "# Is it a function?", "try", ":", "...
whatis arg Print the type of the argument.
[ "whatis", "arg", "Print", "the", "type", "of", "the", "argument", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1547-L1578
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_display
def do_display(self, arg): """display [expression] Display the value of the expression if it changed, each time execution stops in the current frame. Without expression, list all display expressions for the current frame. """ if not arg: self.message('Curren...
python
def do_display(self, arg): """display [expression] Display the value of the expression if it changed, each time execution stops in the current frame. Without expression, list all display expressions for the current frame. """ if not arg: self.message('Curren...
[ "def", "do_display", "(", "self", ",", "arg", ")", ":", "if", "not", "arg", ":", "self", ".", "message", "(", "'Currently displaying:'", ")", "for", "item", "in", "self", ".", "displaying", ".", "get", "(", "self", ".", "curframe", ",", "{", "}", ")"...
display [expression] Display the value of the expression if it changed, each time execution stops in the current frame. Without expression, list all display expressions for the current frame.
[ "display", "[", "expression", "]" ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1582-L1597
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_undisplay
def do_undisplay(self, arg): """undisplay [expression] Do not display the expression any more in the current frame. Without expression, clear all display expressions for the current frame. """ if arg: try: del self.displaying.get(self.curframe, {})[a...
python
def do_undisplay(self, arg): """undisplay [expression] Do not display the expression any more in the current frame. Without expression, clear all display expressions for the current frame. """ if arg: try: del self.displaying.get(self.curframe, {})[a...
[ "def", "do_undisplay", "(", "self", ",", "arg", ")", ":", "if", "arg", ":", "try", ":", "del", "self", ".", "displaying", ".", "get", "(", "self", ".", "curframe", ",", "{", "}", ")", "[", "arg", "]", "except", "KeyError", ":", "self", ".", "erro...
undisplay [expression] Do not display the expression any more in the current frame. Without expression, clear all display expressions for the current frame.
[ "undisplay", "[", "expression", "]" ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1601-L1614
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_interact
def do_interact(self, arg): """interact Start an interative interpreter whose global namespace contains all the (global and local) names found in the current scope. """ def readfunc(prompt): self.stdout.write(prompt) self.stdout.flush() line =...
python
def do_interact(self, arg): """interact Start an interative interpreter whose global namespace contains all the (global and local) names found in the current scope. """ def readfunc(prompt): self.stdout.write(prompt) self.stdout.flush() line =...
[ "def", "do_interact", "(", "self", ",", "arg", ")", ":", "def", "readfunc", "(", "prompt", ")", ":", "self", ".", "stdout", ".", "write", "(", "prompt", ")", "self", ".", "stdout", ".", "flush", "(", ")", "line", "=", "self", ".", "stdin", ".", "...
interact Start an interative interpreter whose global namespace contains all the (global and local) names found in the current scope.
[ "interact" ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1620-L1648
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_alias
def do_alias(self, arg): """alias [name [command [parameter parameter ...] ]] Create an alias called 'name' that executes 'command'. The command must *not* be enclosed in quotes. Replaceable parameters can be indicated by %1, %2, and so on, while %* is replaced by all the param...
python
def do_alias(self, arg): """alias [name [command [parameter parameter ...] ]] Create an alias called 'name' that executes 'command'. The command must *not* be enclosed in quotes. Replaceable parameters can be indicated by %1, %2, and so on, while %* is replaced by all the param...
[ "def", "do_alias", "(", "self", ",", "arg", ")", ":", "args", "=", "arg", ".", "split", "(", ")", "if", "len", "(", "args", ")", "==", "0", ":", "keys", "=", "sorted", "(", "self", ".", "aliases", ".", "keys", "(", ")", ")", "for", "alias", "...
alias [name [command [parameter parameter ...] ]] Create an alias called 'name' that executes 'command'. The command must *not* be enclosed in quotes. Replaceable parameters can be indicated by %1, %2, and so on, while %* is replaced by all the parameters. If no command is given, the ...
[ "alias", "[", "name", "[", "command", "[", "parameter", "parameter", "...", "]", "]]", "Create", "an", "alias", "called", "name", "that", "executes", "command", ".", "The", "command", "must", "*", "not", "*", "be", "enclosed", "in", "quotes", ".", "Repla...
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1650-L1683
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_unalias
def do_unalias(self, arg): """unalias name Delete the specified alias. """ args = arg.split() if len(args) == 0: return if args[0] in self.aliases: del self.aliases[args[0]]
python
def do_unalias(self, arg): """unalias name Delete the specified alias. """ args = arg.split() if len(args) == 0: return if args[0] in self.aliases: del self.aliases[args[0]]
[ "def", "do_unalias", "(", "self", ",", "arg", ")", ":", "args", "=", "arg", ".", "split", "(", ")", "if", "len", "(", "args", ")", "==", "0", ":", "return", "if", "args", "[", "0", "]", "in", "self", ".", "aliases", ":", "del", "self", ".", "...
unalias name Delete the specified alias.
[ "unalias", "name", "Delete", "the", "specified", "alias", "." ]
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1685-L1692
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_thread
def do_thread(self, arg): """th(read) [threadnumber] Without argument, display a summary of all active threads. The summary prints for each thread: 1. the thread number assigned by pdb 2. the thread name 3. the python thread identifier 4. the current s...
python
def do_thread(self, arg): """th(read) [threadnumber] Without argument, display a summary of all active threads. The summary prints for each thread: 1. the thread number assigned by pdb 2. the thread name 3. the python thread identifier 4. the current s...
[ "def", "do_thread", "(", "self", ",", "arg", ")", ":", "# Import the threading module in the main interpreter to get an", "# enumeration of the main interpreter threads.", "if", "PY3", ":", "try", ":", "import", "threading", "except", "ImportError", ":", "import", "dummy_th...
th(read) [threadnumber] Without argument, display a summary of all active threads. The summary prints for each thread: 1. the thread number assigned by pdb 2. the thread name 3. the python thread identifier 4. the current stack frame summary for that thread ...
[ "th", "(", "read", ")", "[", "threadnumber", "]", "Without", "argument", "display", "a", "summary", "of", "all", "active", "threads", ".", "The", "summary", "prints", "for", "each", "thread", ":", "1", ".", "the", "thread", "number", "assigned", "by", "p...
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1740-L1790
train
corpusops/pdbclone
lib/pdb_clone/pdb.py
Pdb.do_help
def do_help(self, arg): """h(elp) Without argument, print the list of available commands. With a command name as argument, print help about that command. "help pdb" shows the full pdb documentation. "help exec" gives help on the ! command. """ if not arg: ...
python
def do_help(self, arg): """h(elp) Without argument, print the list of available commands. With a command name as argument, print help about that command. "help pdb" shows the full pdb documentation. "help exec" gives help on the ! command. """ if not arg: ...
[ "def", "do_help", "(", "self", ",", "arg", ")", ":", "if", "not", "arg", ":", "return", "cmd", ".", "Cmd", ".", "do_help", "(", "self", ",", "arg", ")", "try", ":", "try", ":", "topic", "=", "getattr", "(", "self", ",", "'help_'", "+", "arg", "...
h(elp) Without argument, print the list of available commands. With a command name as argument, print help about that command. "help pdb" shows the full pdb documentation. "help exec" gives help on the ! command.
[ "h", "(", "elp", ")", "Without", "argument", "print", "the", "list", "of", "available", "commands", ".", "With", "a", "command", "name", "as", "argument", "print", "help", "about", "that", "command", ".", "help", "pdb", "shows", "the", "full", "pdb", "do...
f781537c243a4874b246d43dbdef8c4279f0094d
https://github.com/corpusops/pdbclone/blob/f781537c243a4874b246d43dbdef8c4279f0094d/lib/pdb_clone/pdb.py#L1825-L1847
train