id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
50,500
rosenbrockc/fortpy
fortpy/code.py
CodeParser.reparse
def reparse(self, filepath): """Reparses the specified module file from disk, overwriting any cached representations etc. of the module.""" #The easiest way to do this is to touch the file and then call #the regular parse method so that the cache becomes invalidated. self.tramp.t...
python
def reparse(self, filepath): """Reparses the specified module file from disk, overwriting any cached representations etc. of the module.""" #The easiest way to do this is to touch the file and then call #the regular parse method so that the cache becomes invalidated. self.tramp.t...
[ "def", "reparse", "(", "self", ",", "filepath", ")", ":", "#The easiest way to do this is to touch the file and then call", "#the regular parse method so that the cache becomes invalidated.", "self", ".", "tramp", ".", "touch", "(", "filepath", ")", "self", ".", "parse", "(...
Reparses the specified module file from disk, overwriting any cached representations etc. of the module.
[ "Reparses", "the", "specified", "module", "file", "from", "disk", "overwriting", "any", "cached", "representations", "etc", ".", "of", "the", "module", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L216-L222
50,501
rosenbrockc/fortpy
fortpy/code.py
CodeParser._add_current_codedir
def _add_current_codedir(self, path): """Adds the directory of the file at the specified path as a base path to find other files in. """ dirpath = self.tramp.dirname(path) if dirpath not in self.basepaths: self.basepaths.append(dirpath) self.rescan()
python
def _add_current_codedir(self, path): """Adds the directory of the file at the specified path as a base path to find other files in. """ dirpath = self.tramp.dirname(path) if dirpath not in self.basepaths: self.basepaths.append(dirpath) self.rescan()
[ "def", "_add_current_codedir", "(", "self", ",", "path", ")", ":", "dirpath", "=", "self", ".", "tramp", ".", "dirname", "(", "path", ")", "if", "dirpath", "not", "in", "self", ".", "basepaths", ":", "self", ".", "basepaths", ".", "append", "(", "dirpa...
Adds the directory of the file at the specified path as a base path to find other files in.
[ "Adds", "the", "directory", "of", "the", "file", "at", "the", "specified", "path", "as", "a", "base", "path", "to", "find", "other", "files", "in", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L224-L231
50,502
rosenbrockc/fortpy
fortpy/code.py
CodeParser.isense_parse
def isense_parse(self, filepath, modulename): """Parses the specified file from either memory, cached disk or full disk depending on whether the fetch is via SSH or not and how long it has been since we last checked the modification time of the file. """ #We only want to check wh...
python
def isense_parse(self, filepath, modulename): """Parses the specified file from either memory, cached disk or full disk depending on whether the fetch is via SSH or not and how long it has been since we last checked the modification time of the file. """ #We only want to check wh...
[ "def", "isense_parse", "(", "self", ",", "filepath", ",", "modulename", ")", ":", "#We only want to check whether the file has been modified for reload", "from", "datetime", "import", "datetime", "if", "modulename", "not", "in", "self", ".", "_last_isense_check", ":", "...
Parses the specified file from either memory, cached disk or full disk depending on whether the fetch is via SSH or not and how long it has been since we last checked the modification time of the file.
[ "Parses", "the", "specified", "file", "from", "either", "memory", "cached", "disk", "or", "full", "disk", "depending", "on", "whether", "the", "fetch", "is", "via", "SSH", "or", "not", "and", "how", "long", "it", "has", "been", "since", "we", "last", "ch...
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L233-L247
50,503
rosenbrockc/fortpy
fortpy/code.py
CodeParser.parse
def parse(self, filepath, dependencies=False, recursive=False, greedy=False): """Parses the fortran code in the specified file. :arg dependencies: if true, all folder paths will be searched for modules that have been referenced but aren't loaded in the parser. :arg greedy: if true, when...
python
def parse(self, filepath, dependencies=False, recursive=False, greedy=False): """Parses the fortran code in the specified file. :arg dependencies: if true, all folder paths will be searched for modules that have been referenced but aren't loaded in the parser. :arg greedy: if true, when...
[ "def", "parse", "(", "self", ",", "filepath", ",", "dependencies", "=", "False", ",", "recursive", "=", "False", ",", "greedy", "=", "False", ")", ":", "#If we have already parsed this file path, we should check to see if the", "#module file has changed and needs to be repa...
Parses the fortran code in the specified file. :arg dependencies: if true, all folder paths will be searched for modules that have been referenced but aren't loaded in the parser. :arg greedy: if true, when a module cannot be found using a file name of module_name.f90, all modules in al...
[ "Parses", "the", "fortran", "code", "in", "the", "specified", "file", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L249-L313
50,504
rosenbrockc/fortpy
fortpy/code.py
CodeParser.rescan
def rescan(self): """Rescans the base paths to find new code files.""" self._pathfiles = {} for path in self.basepaths: self.scan_path(path)
python
def rescan(self): """Rescans the base paths to find new code files.""" self._pathfiles = {} for path in self.basepaths: self.scan_path(path)
[ "def", "rescan", "(", "self", ")", ":", "self", ".", "_pathfiles", "=", "{", "}", "for", "path", "in", "self", ".", "basepaths", ":", "self", ".", "scan_path", "(", "path", ")" ]
Rescans the base paths to find new code files.
[ "Rescans", "the", "base", "paths", "to", "find", "new", "code", "files", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L315-L319
50,505
rosenbrockc/fortpy
fortpy/code.py
CodeParser.load_dependency
def load_dependency(self, module_name, dependencies, recursive, greedy, ismapping = False): """Loads the module with the specified name if it isn't already loaded.""" key = module_name.lower() if key not in self.modules: if key == "fortpy": #Manually specify the corre...
python
def load_dependency(self, module_name, dependencies, recursive, greedy, ismapping = False): """Loads the module with the specified name if it isn't already loaded.""" key = module_name.lower() if key not in self.modules: if key == "fortpy": #Manually specify the corre...
[ "def", "load_dependency", "(", "self", ",", "module_name", ",", "dependencies", ",", "recursive", ",", "greedy", ",", "ismapping", "=", "False", ")", ":", "key", "=", "module_name", ".", "lower", "(", ")", "if", "key", "not", "in", "self", ".", "modules"...
Loads the module with the specified name if it isn't already loaded.
[ "Loads", "the", "module", "with", "the", "specified", "name", "if", "it", "isn", "t", "already", "loaded", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L321-L353
50,506
rosenbrockc/fortpy
fortpy/code.py
CodeParser._load_greedy
def _load_greedy(self, module_name, dependencies, recursive): """Keeps loading modules in the filepaths dictionary until all have been loaded or the module is found.""" found = module_name in self.modules allmodules = list(self._pathfiles.keys()) i = 0 while not found an...
python
def _load_greedy(self, module_name, dependencies, recursive): """Keeps loading modules in the filepaths dictionary until all have been loaded or the module is found.""" found = module_name in self.modules allmodules = list(self._pathfiles.keys()) i = 0 while not found an...
[ "def", "_load_greedy", "(", "self", ",", "module_name", ",", "dependencies", ",", "recursive", ")", ":", "found", "=", "module_name", "in", "self", ".", "modules", "allmodules", "=", "list", "(", "self", ".", "_pathfiles", ".", "keys", "(", ")", ")", "i"...
Keeps loading modules in the filepaths dictionary until all have been loaded or the module is found.
[ "Keeps", "loading", "modules", "in", "the", "filepaths", "dictionary", "until", "all", "have", "been", "loaded", "or", "the", "module", "is", "found", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L355-L368
50,507
rosenbrockc/fortpy
fortpy/code.py
CodeParser.scan_path
def scan_path(self, path, result = None): """Determines which valid fortran files reside in the base path. :arg path: the path to the folder to list f90 files in. :arg result: an optional dictionary to add results to in addition to populating the private member dictionary of the parser....
python
def scan_path(self, path, result = None): """Determines which valid fortran files reside in the base path. :arg path: the path to the folder to list f90 files in. :arg result: an optional dictionary to add results to in addition to populating the private member dictionary of the parser....
[ "def", "scan_path", "(", "self", ",", "path", ",", "result", "=", "None", ")", ":", "files", "=", "[", "]", "#Find all the files in the directory", "for", "(", "dirpath", ",", "dirnames", ",", "filenames", ")", "in", "self", ".", "tramp", ".", "walk", "(...
Determines which valid fortran files reside in the base path. :arg path: the path to the folder to list f90 files in. :arg result: an optional dictionary to add results to in addition to populating the private member dictionary of the parser.
[ "Determines", "which", "valid", "fortran", "files", "reside", "in", "the", "base", "path", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L370-L399
50,508
rosenbrockc/fortpy
fortpy/code.py
CodeParser.tree_find
def tree_find(self, symbol, origin, attribute): """Finds the code element corresponding to specified symbol by searching all modules in the parser. :arg symbol: the name of the code element to find. :arg origin: an instance of a Module element who owns the text that is generat...
python
def tree_find(self, symbol, origin, attribute): """Finds the code element corresponding to specified symbol by searching all modules in the parser. :arg symbol: the name of the code element to find. :arg origin: an instance of a Module element who owns the text that is generat...
[ "def", "tree_find", "(", "self", ",", "symbol", ",", "origin", ",", "attribute", ")", ":", "#The symbol must be accessible to the origin module, otherwise", "#it wouldn't compile. Start there, first looking at the origin", "#itself and then the other modules that it depends on.", "#Sin...
Finds the code element corresponding to specified symbol by searching all modules in the parser. :arg symbol: the name of the code element to find. :arg origin: an instance of a Module element who owns the text that is generate the find search. :arg attribute: one of ['depende...
[ "Finds", "the", "code", "element", "corresponding", "to", "specified", "symbol", "by", "searching", "all", "modules", "in", "the", "parser", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L431-L478
50,509
rosenbrockc/fortpy
fortpy/code.py
CodeParser.get_executable
def get_executable(self, fullname): """Gets the executable corresponding to the specified full name. :arg fullname: a string with modulename.executable. """ result = None modname, exname = fullname.split(".") module = self.get(modname) if module is not None: ...
python
def get_executable(self, fullname): """Gets the executable corresponding to the specified full name. :arg fullname: a string with modulename.executable. """ result = None modname, exname = fullname.split(".") module = self.get(modname) if module is not None: ...
[ "def", "get_executable", "(", "self", ",", "fullname", ")", ":", "result", "=", "None", "modname", ",", "exname", "=", "fullname", ".", "split", "(", "\".\"", ")", "module", "=", "self", ".", "get", "(", "modname", ")", "if", "module", "is", "not", "...
Gets the executable corresponding to the specified full name. :arg fullname: a string with modulename.executable.
[ "Gets", "the", "executable", "corresponding", "to", "the", "specified", "full", "name", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L480-L492
50,510
rosenbrockc/fortpy
fortpy/code.py
CodeParser.get_interface
def get_interface(self, fullname): """Gets the interface corresponding to the specified full name. :arg fullname: a string with modulename.interface. """ result = None [modname, iname] = fullname.split(".") module = self.get(modname) if module is not None: ...
python
def get_interface(self, fullname): """Gets the interface corresponding to the specified full name. :arg fullname: a string with modulename.interface. """ result = None [modname, iname] = fullname.split(".") module = self.get(modname) if module is not None: ...
[ "def", "get_interface", "(", "self", ",", "fullname", ")", ":", "result", "=", "None", "[", "modname", ",", "iname", "]", "=", "fullname", ".", "split", "(", "\".\"", ")", "module", "=", "self", ".", "get", "(", "modname", ")", "if", "module", "is", ...
Gets the interface corresponding to the specified full name. :arg fullname: a string with modulename.interface.
[ "Gets", "the", "interface", "corresponding", "to", "the", "specified", "full", "name", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L494-L505
50,511
rosenbrockc/fortpy
fortpy/code.py
CodeParser.get
def get(self, name): """Gets the module with the given name if it exists in this code parser.""" if name not in self.modules: self.load_dependency(name, False, False, False) if name in self.modules: return self.modules[name] else: return None
python
def get(self, name): """Gets the module with the given name if it exists in this code parser.""" if name not in self.modules: self.load_dependency(name, False, False, False) if name in self.modules: return self.modules[name] else: return None
[ "def", "get", "(", "self", ",", "name", ")", ":", "if", "name", "not", "in", "self", ".", "modules", ":", "self", ".", "load_dependency", "(", "name", ",", "False", ",", "False", ",", "False", ")", "if", "name", "in", "self", ".", "modules", ":", ...
Gets the module with the given name if it exists in this code parser.
[ "Gets", "the", "module", "with", "the", "given", "name", "if", "it", "exists", "in", "this", "code", "parser", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/code.py#L507-L516
50,512
rbarrois/throttle
throttle/api.py
Throttler.get_bucket
def get_bucket(self, key, rate=None, capacity=None, **kwargs): """Fetch a Bucket for the given key. rate and capacity might be overridden from the Throttler defaults. Args: rate (float): Units regenerated by second, or None to keep Throttler defaults cap...
python
def get_bucket(self, key, rate=None, capacity=None, **kwargs): """Fetch a Bucket for the given key. rate and capacity might be overridden from the Throttler defaults. Args: rate (float): Units regenerated by second, or None to keep Throttler defaults cap...
[ "def", "get_bucket", "(", "self", ",", "key", ",", "rate", "=", "None", ",", "capacity", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "buckets", ".", "Bucket", "(", "key", "=", "key", ",", "rate", "=", "rate", "or", "self", ".", "rat...
Fetch a Bucket for the given key. rate and capacity might be overridden from the Throttler defaults. Args: rate (float): Units regenerated by second, or None to keep Throttler defaults capacity (int): Maximum units available, or None to keep Throttler ...
[ "Fetch", "a", "Bucket", "for", "the", "given", "key", "." ]
cc00e6b446f3938c81826ee258975ebdc12511a2
https://github.com/rbarrois/throttle/blob/cc00e6b446f3938c81826ee258975ebdc12511a2/throttle/api.py#L28-L44
50,513
rbarrois/throttle
throttle/api.py
Throttler.consume
def consume(self, key, amount=1, rate=None, capacity=None, **kwargs): """Consume an amount for a given key. Non-default rate/capacity can be given to override Throttler defaults. Returns: bool: whether the units could be consumed """ bucket = self.get_bucket(key, ra...
python
def consume(self, key, amount=1, rate=None, capacity=None, **kwargs): """Consume an amount for a given key. Non-default rate/capacity can be given to override Throttler defaults. Returns: bool: whether the units could be consumed """ bucket = self.get_bucket(key, ra...
[ "def", "consume", "(", "self", ",", "key", ",", "amount", "=", "1", ",", "rate", "=", "None", ",", "capacity", "=", "None", ",", "*", "*", "kwargs", ")", ":", "bucket", "=", "self", ".", "get_bucket", "(", "key", ",", "rate", ",", "capacity", ","...
Consume an amount for a given key. Non-default rate/capacity can be given to override Throttler defaults. Returns: bool: whether the units could be consumed
[ "Consume", "an", "amount", "for", "a", "given", "key", "." ]
cc00e6b446f3938c81826ee258975ebdc12511a2
https://github.com/rbarrois/throttle/blob/cc00e6b446f3938c81826ee258975ebdc12511a2/throttle/api.py#L46-L55
50,514
rbarrois/throttle
throttle/api.py
Throttler.throttle
def throttle(self, key, amount=1, rate=None, capacity=None, exc_class=Throttled, **kwargs): """Consume an amount for a given key, or raise a Throttled exception.""" if not self.consume(key, amount, rate, capacity, **kwargs): raise exc_class("Request of %d unit for %s exceeds cap...
python
def throttle(self, key, amount=1, rate=None, capacity=None, exc_class=Throttled, **kwargs): """Consume an amount for a given key, or raise a Throttled exception.""" if not self.consume(key, amount, rate, capacity, **kwargs): raise exc_class("Request of %d unit for %s exceeds cap...
[ "def", "throttle", "(", "self", ",", "key", ",", "amount", "=", "1", ",", "rate", "=", "None", ",", "capacity", "=", "None", ",", "exc_class", "=", "Throttled", ",", "*", "*", "kwargs", ")", ":", "if", "not", "self", ".", "consume", "(", "key", "...
Consume an amount for a given key, or raise a Throttled exception.
[ "Consume", "an", "amount", "for", "a", "given", "key", "or", "raise", "a", "Throttled", "exception", "." ]
cc00e6b446f3938c81826ee258975ebdc12511a2
https://github.com/rbarrois/throttle/blob/cc00e6b446f3938c81826ee258975ebdc12511a2/throttle/api.py#L57-L63
50,515
rbarrois/throttle
throttle/buckets.py
Bucket.leak
def leak(self): """Leak the adequate amount of data from the bucket. This should be called before any consumption takes place. Returns: int: the new capacity of the bucket """ capacity, last_leak = self.storage.mget(self.key_amount, self.key_last_leak, ...
python
def leak(self): """Leak the adequate amount of data from the bucket. This should be called before any consumption takes place. Returns: int: the new capacity of the bucket """ capacity, last_leak = self.storage.mget(self.key_amount, self.key_last_leak, ...
[ "def", "leak", "(", "self", ")", ":", "capacity", ",", "last_leak", "=", "self", ".", "storage", ".", "mget", "(", "self", ".", "key_amount", ",", "self", ".", "key_last_leak", ",", "coherent", "=", "True", ")", "now", "=", "time", ".", "time", "(", ...
Leak the adequate amount of data from the bucket. This should be called before any consumption takes place. Returns: int: the new capacity of the bucket
[ "Leak", "the", "adequate", "amount", "of", "data", "from", "the", "bucket", "." ]
cc00e6b446f3938c81826ee258975ebdc12511a2
https://github.com/rbarrois/throttle/blob/cc00e6b446f3938c81826ee258975ebdc12511a2/throttle/buckets.py#L44-L70
50,516
rbarrois/throttle
throttle/buckets.py
Bucket.consume
def consume(self, amount=1): """Consume one or more units from the bucket.""" # First, cleanup old stock current = self.leak() if current + amount > self.capacity: return False self._incr(amount) return True
python
def consume(self, amount=1): """Consume one or more units from the bucket.""" # First, cleanup old stock current = self.leak() if current + amount > self.capacity: return False self._incr(amount) return True
[ "def", "consume", "(", "self", ",", "amount", "=", "1", ")", ":", "# First, cleanup old stock", "current", "=", "self", ".", "leak", "(", ")", "if", "current", "+", "amount", ">", "self", ".", "capacity", ":", "return", "False", "self", ".", "_incr", "...
Consume one or more units from the bucket.
[ "Consume", "one", "or", "more", "units", "from", "the", "bucket", "." ]
cc00e6b446f3938c81826ee258975ebdc12511a2
https://github.com/rbarrois/throttle/blob/cc00e6b446f3938c81826ee258975ebdc12511a2/throttle/buckets.py#L76-L85
50,517
Diaoul/babelfish
babelfish/converters/__init__.py
ConverterManager.register
def register(self, entry_point): """Register a converter :param string entry_point: converter to register (entry point syntax) :raise: ValueError if already registered """ if entry_point in self.registered_converters: raise ValueError('Already registered') s...
python
def register(self, entry_point): """Register a converter :param string entry_point: converter to register (entry point syntax) :raise: ValueError if already registered """ if entry_point in self.registered_converters: raise ValueError('Already registered') s...
[ "def", "register", "(", "self", ",", "entry_point", ")", ":", "if", "entry_point", "in", "self", ".", "registered_converters", ":", "raise", "ValueError", "(", "'Already registered'", ")", "self", ".", "registered_converters", ".", "insert", "(", "0", ",", "en...
Register a converter :param string entry_point: converter to register (entry point syntax) :raise: ValueError if already registered
[ "Register", "a", "converter" ]
f403000dd63092cfaaae80be9f309fd85c7f20c9
https://github.com/Diaoul/babelfish/blob/f403000dd63092cfaaae80be9f309fd85c7f20c9/babelfish/converters/__init__.py#L267-L276
50,518
rosenbrockc/fortpy
fortpy/scripts/bestprac.py
parse
def parse(): """Parses all the modules in the library specified by the script args. """ from fortpy.code import CodeParser c = CodeParser() if args["verbose"]: c.verbose = True f90files = {} c.scan_path(args["source"], f90files) for fname, fpath in f90files.items(): ...
python
def parse(): """Parses all the modules in the library specified by the script args. """ from fortpy.code import CodeParser c = CodeParser() if args["verbose"]: c.verbose = True f90files = {} c.scan_path(args["source"], f90files) for fname, fpath in f90files.items(): ...
[ "def", "parse", "(", ")", ":", "from", "fortpy", ".", "code", "import", "CodeParser", "c", "=", "CodeParser", "(", ")", "if", "args", "[", "\"verbose\"", "]", ":", "c", ".", "verbose", "=", "True", "f90files", "=", "{", "}", "c", ".", "scan_path", ...
Parses all the modules in the library specified by the script args.
[ "Parses", "all", "the", "modules", "in", "the", "library", "specified", "by", "the", "script", "args", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/scripts/bestprac.py#L4-L20
50,519
rosenbrockc/fortpy
fortpy/scripts/bestprac.py
_check_pointers
def _check_pointers(parser): """Checks the pointer best-practice conditions.""" from fortpy.stats.bp import check_pointers check_pointers(parser, args["source"], args["filter"], args["recursive"])
python
def _check_pointers(parser): """Checks the pointer best-practice conditions.""" from fortpy.stats.bp import check_pointers check_pointers(parser, args["source"], args["filter"], args["recursive"])
[ "def", "_check_pointers", "(", "parser", ")", ":", "from", "fortpy", ".", "stats", ".", "bp", "import", "check_pointers", "check_pointers", "(", "parser", ",", "args", "[", "\"source\"", "]", ",", "args", "[", "\"filter\"", "]", ",", "args", "[", "\"recurs...
Checks the pointer best-practice conditions.
[ "Checks", "the", "pointer", "best", "-", "practice", "conditions", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/scripts/bestprac.py#L22-L25
50,520
rosenbrockc/fortpy
fortpy/parsers/interface.py
InterfaceParser.setup_regex
def setup_regex(self): """Regex definitions for parsing the code elements.""" self._RX_INTERFACE = (r"\n\s*interface\s+(?P<name>[a-z0-9_]+)(\s\((?P<symbol>[.\w+*=/-]+)\))?" r"(?P<contents>.+?)" r"end\s*interface\s+(?P=name)?") self.RE_I...
python
def setup_regex(self): """Regex definitions for parsing the code elements.""" self._RX_INTERFACE = (r"\n\s*interface\s+(?P<name>[a-z0-9_]+)(\s\((?P<symbol>[.\w+*=/-]+)\))?" r"(?P<contents>.+?)" r"end\s*interface\s+(?P=name)?") self.RE_I...
[ "def", "setup_regex", "(", "self", ")", ":", "self", ".", "_RX_INTERFACE", "=", "(", "r\"\\n\\s*interface\\s+(?P<name>[a-z0-9_]+)(\\s\\((?P<symbol>[.\\w+*=/-]+)\\))?\"", "r\"(?P<contents>.+?)\"", "r\"end\\s*interface\\s+(?P=name)?\"", ")", "self", ".", "RE_INTERFACE", "=", "re"...
Regex definitions for parsing the code elements.
[ "Regex", "definitions", "for", "parsing", "the", "code", "elements", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/interface.py#L10-L15
50,521
rosenbrockc/fortpy
fortpy/parsers/interface.py
InterfaceParser.update_docs
def update_docs(self, iface, module): """Updates the documentation for the specified interface using the module predocs.""" #We need to look in the parent module docstrings for this types decorating tags. key = "{}.{}".format(module.name, iface.name) if key in module.predocs: ...
python
def update_docs(self, iface, module): """Updates the documentation for the specified interface using the module predocs.""" #We need to look in the parent module docstrings for this types decorating tags. key = "{}.{}".format(module.name, iface.name) if key in module.predocs: ...
[ "def", "update_docs", "(", "self", ",", "iface", ",", "module", ")", ":", "#We need to look in the parent module docstrings for this types decorating tags.", "key", "=", "\"{}.{}\"", ".", "format", "(", "module", ".", "name", ",", "iface", ".", "name", ")", "if", ...
Updates the documentation for the specified interface using the module predocs.
[ "Updates", "the", "documentation", "for", "the", "specified", "interface", "using", "the", "module", "predocs", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/interface.py#L37-L43
50,522
rosenbrockc/fortpy
fortpy/interop/make.py
makefile
def makefile(identifier, dependencies, makepath, compileid, precompile=False, inclfortpy=True, parser=None, executable=True, extralinks=None, inclfpyaux=False, makefpyaux=False, verbose=False): """Generates a makefile to create the unit testing executable for the specified...
python
def makefile(identifier, dependencies, makepath, compileid, precompile=False, inclfortpy=True, parser=None, executable=True, extralinks=None, inclfpyaux=False, makefpyaux=False, verbose=False): """Generates a makefile to create the unit testing executable for the specified...
[ "def", "makefile", "(", "identifier", ",", "dependencies", ",", "makepath", ",", "compileid", ",", "precompile", "=", "False", ",", "inclfortpy", "=", "True", ",", "parser", "=", "None", ",", "executable", "=", "True", ",", "extralinks", "=", "None", ",", ...
Generates a makefile to create the unit testing executable for the specified test identifier. :arg identifier: the id of the test/library that this makefile should be made for. :arg dependencies: a list of the module names that need to be included in the compilation. :arg makepath: the path to the file...
[ "Generates", "a", "makefile", "to", "create", "the", "unit", "testing", "executable", "for", "the", "specified", "test", "identifier", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/interop/make.py#L4-L92
50,523
rosenbrockc/fortpy
fortpy/interop/make.py
_add_explicit_includes
def _add_explicit_includes(lines, dependencies=None, extralinks=None): """Adds any relevant libraries that need to be explicitly included according to the fortpy configuration file. Libraries are appended to the specified collection of lines. Returns true if relevant libraries were added. """ from f...
python
def _add_explicit_includes(lines, dependencies=None, extralinks=None): """Adds any relevant libraries that need to be explicitly included according to the fortpy configuration file. Libraries are appended to the specified collection of lines. Returns true if relevant libraries were added. """ from f...
[ "def", "_add_explicit_includes", "(", "lines", ",", "dependencies", "=", "None", ",", "extralinks", "=", "None", ")", ":", "from", "fortpy", "import", "config", "import", "sys", "from", "os", "import", "path", "includes", "=", "sys", ".", "modules", "[", "...
Adds any relevant libraries that need to be explicitly included according to the fortpy configuration file. Libraries are appended to the specified collection of lines. Returns true if relevant libraries were added.
[ "Adds", "any", "relevant", "libraries", "that", "need", "to", "be", "explicitly", "included", "according", "to", "the", "fortpy", "configuration", "file", ".", "Libraries", "are", "appended", "to", "the", "specified", "collection", "of", "lines", ".", "Returns",...
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/interop/make.py#L99-L139
50,524
rosenbrockc/fortpy
fortpy/interop/make.py
_get_mapping
def _get_mapping(parser, mapped): """Gets the original file name for a module that was mapped when the module name does not coincide with the file name that the module was defined in.""" if mapped in parser.mappings: return parser.mappings[mapped] else: return mapped + ".f90"
python
def _get_mapping(parser, mapped): """Gets the original file name for a module that was mapped when the module name does not coincide with the file name that the module was defined in.""" if mapped in parser.mappings: return parser.mappings[mapped] else: return mapped + ".f90"
[ "def", "_get_mapping", "(", "parser", ",", "mapped", ")", ":", "if", "mapped", "in", "parser", ".", "mappings", ":", "return", "parser", ".", "mappings", "[", "mapped", "]", "else", ":", "return", "mapped", "+", "\".f90\"" ]
Gets the original file name for a module that was mapped when the module name does not coincide with the file name that the module was defined in.
[ "Gets", "the", "original", "file", "name", "for", "a", "module", "that", "was", "mapped", "when", "the", "module", "name", "does", "not", "coincide", "with", "the", "file", "name", "that", "the", "module", "was", "defined", "in", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/interop/make.py#L253-L260
50,525
hyde/commando
commando/conf.py
ConfigDict.patch
def patch(self, overrides): """ Patches the config with the given overrides. Example: If the current dictionary looks like this: a: 1, b: { c: 3, d: 4 } and `patch` is called with the following overrides: b: { ...
python
def patch(self, overrides): """ Patches the config with the given overrides. Example: If the current dictionary looks like this: a: 1, b: { c: 3, d: 4 } and `patch` is called with the following overrides: b: { ...
[ "def", "patch", "(", "self", ",", "overrides", ")", ":", "overrides", "=", "overrides", "or", "{", "}", "for", "key", ",", "value", "in", "iteritems", "(", "overrides", ")", ":", "current", "=", "self", ".", "get", "(", "key", ")", "if", "isinstance"...
Patches the config with the given overrides. Example: If the current dictionary looks like this: a: 1, b: { c: 3, d: 4 } and `patch` is called with the following overrides: b: { d: 2, e: 4 }, c: 5 ...
[ "Patches", "the", "config", "with", "the", "given", "overrides", "." ]
78dc9f2f329d806049f090e04411bea90129ee4f
https://github.com/hyde/commando/blob/78dc9f2f329d806049f090e04411bea90129ee4f/commando/conf.py#L46-L82
50,526
ptcryan/hydrawiser
hydrawiser/core.py
Hydrawiser.update_controller_info
def update_controller_info(self): """ Pulls controller information. :returns: True if successfull, otherwise False. :rtype: boolean """ # Read the controller information. self.controller_info = customer_details(self._user_token) self.controller_status = ...
python
def update_controller_info(self): """ Pulls controller information. :returns: True if successfull, otherwise False. :rtype: boolean """ # Read the controller information. self.controller_info = customer_details(self._user_token) self.controller_status = ...
[ "def", "update_controller_info", "(", "self", ")", ":", "# Read the controller information.", "self", ".", "controller_info", "=", "customer_details", "(", "self", ".", "_user_token", ")", "self", ".", "controller_status", "=", "status_schedule", "(", "self", ".", "...
Pulls controller information. :returns: True if successfull, otherwise False. :rtype: boolean
[ "Pulls", "controller", "information", "." ]
53acafb08b5cee0f6628414044b9b9f9a0b15e50
https://github.com/ptcryan/hydrawiser/blob/53acafb08b5cee0f6628414044b9b9f9a0b15e50/hydrawiser/core.py#L44-L76
50,527
ptcryan/hydrawiser
hydrawiser/core.py
Hydrawiser.controller
def controller(self): """ Check if multiple controllers are connected. :returns: Return the controller_id of the active controller. :rtype: string """ if hasattr(self, 'controller_id'): if len(self.controller_info['controllers']) > 1: raise T...
python
def controller(self): """ Check if multiple controllers are connected. :returns: Return the controller_id of the active controller. :rtype: string """ if hasattr(self, 'controller_id'): if len(self.controller_info['controllers']) > 1: raise T...
[ "def", "controller", "(", "self", ")", ":", "if", "hasattr", "(", "self", ",", "'controller_id'", ")", ":", "if", "len", "(", "self", ".", "controller_info", "[", "'controllers'", "]", ")", ">", "1", ":", "raise", "TypeError", "(", "'Only one controller pe...
Check if multiple controllers are connected. :returns: Return the controller_id of the active controller. :rtype: string
[ "Check", "if", "multiple", "controllers", "are", "connected", "." ]
53acafb08b5cee0f6628414044b9b9f9a0b15e50
https://github.com/ptcryan/hydrawiser/blob/53acafb08b5cee0f6628414044b9b9f9a0b15e50/hydrawiser/core.py#L78-L92
50,528
ptcryan/hydrawiser
hydrawiser/core.py
Hydrawiser.relay_info
def relay_info(self, relay, attribute=None): """ Return information about a relay. :param relay: The relay being queried. :type relay: int :param attribute: The attribute being queried, or all attributes for that relay if None is specified. :typ...
python
def relay_info(self, relay, attribute=None): """ Return information about a relay. :param relay: The relay being queried. :type relay: int :param attribute: The attribute being queried, or all attributes for that relay if None is specified. :typ...
[ "def", "relay_info", "(", "self", ",", "relay", ",", "attribute", "=", "None", ")", ":", "# Check if the relay number is valid.", "if", "(", "relay", "<", "0", ")", "or", "(", "relay", ">", "(", "self", ".", "num_relays", "-", "1", ")", ")", ":", "# In...
Return information about a relay. :param relay: The relay being queried. :type relay: int :param attribute: The attribute being queried, or all attributes for that relay if None is specified. :type attribute: string or None :returns: The attribute being...
[ "Return", "information", "about", "a", "relay", "." ]
53acafb08b5cee0f6628414044b9b9f9a0b15e50
https://github.com/ptcryan/hydrawiser/blob/53acafb08b5cee0f6628414044b9b9f9a0b15e50/hydrawiser/core.py#L104-L130
50,529
ptcryan/hydrawiser
hydrawiser/core.py
Hydrawiser.suspend_zone
def suspend_zone(self, days, zone=None): """ Suspend or unsuspend a zone or all zones for an amount of time. :param days: Number of days to suspend the zone(s) :type days: int :param zone: The zone to suspend. If no zone is specified then suspend all zones ...
python
def suspend_zone(self, days, zone=None): """ Suspend or unsuspend a zone or all zones for an amount of time. :param days: Number of days to suspend the zone(s) :type days: int :param zone: The zone to suspend. If no zone is specified then suspend all zones ...
[ "def", "suspend_zone", "(", "self", ",", "days", ",", "zone", "=", "None", ")", ":", "if", "zone", "is", "None", ":", "zone_cmd", "=", "'suspendall'", "relay_id", "=", "None", "else", ":", "if", "zone", "<", "0", "or", "zone", ">", "(", "len", "(",...
Suspend or unsuspend a zone or all zones for an amount of time. :param days: Number of days to suspend the zone(s) :type days: int :param zone: The zone to suspend. If no zone is specified then suspend all zones :type zone: int or None :returns: The response...
[ "Suspend", "or", "unsuspend", "a", "zone", "or", "all", "zones", "for", "an", "amount", "of", "time", "." ]
53acafb08b5cee0f6628414044b9b9f9a0b15e50
https://github.com/ptcryan/hydrawiser/blob/53acafb08b5cee0f6628414044b9b9f9a0b15e50/hydrawiser/core.py#L132-L161
50,530
ptcryan/hydrawiser
hydrawiser/core.py
Hydrawiser.run_zone
def run_zone(self, minutes, zone=None): """ Run or stop a zone or all zones for an amount of time. :param minutes: The number of minutes to run. :type minutes: int :param zone: The zone number to run. If no zone is specified then run all zones. :type...
python
def run_zone(self, minutes, zone=None): """ Run or stop a zone or all zones for an amount of time. :param minutes: The number of minutes to run. :type minutes: int :param zone: The zone number to run. If no zone is specified then run all zones. :type...
[ "def", "run_zone", "(", "self", ",", "minutes", ",", "zone", "=", "None", ")", ":", "if", "zone", "is", "None", ":", "zone_cmd", "=", "'runall'", "relay_id", "=", "None", "else", ":", "if", "zone", "<", "0", "or", "zone", ">", "(", "len", "(", "s...
Run or stop a zone or all zones for an amount of time. :param minutes: The number of minutes to run. :type minutes: int :param zone: The zone number to run. If no zone is specified then run all zones. :type zone: int or None :returns: The response from set_z...
[ "Run", "or", "stop", "a", "zone", "or", "all", "zones", "for", "an", "amount", "of", "time", "." ]
53acafb08b5cee0f6628414044b9b9f9a0b15e50
https://github.com/ptcryan/hydrawiser/blob/53acafb08b5cee0f6628414044b9b9f9a0b15e50/hydrawiser/core.py#L163-L194
50,531
ptcryan/hydrawiser
hydrawiser/core.py
Hydrawiser.list_running_zones
def list_running_zones(self): """ Returns the currently active relay. :returns: Returns the running relay number or None if no relays are active. :rtype: string """ self.update_controller_info() if self.running is None or not self.running: ...
python
def list_running_zones(self): """ Returns the currently active relay. :returns: Returns the running relay number or None if no relays are active. :rtype: string """ self.update_controller_info() if self.running is None or not self.running: ...
[ "def", "list_running_zones", "(", "self", ")", ":", "self", ".", "update_controller_info", "(", ")", "if", "self", ".", "running", "is", "None", "or", "not", "self", ".", "running", ":", "return", "None", "return", "int", "(", "self", ".", "running", "["...
Returns the currently active relay. :returns: Returns the running relay number or None if no relays are active. :rtype: string
[ "Returns", "the", "currently", "active", "relay", "." ]
53acafb08b5cee0f6628414044b9b9f9a0b15e50
https://github.com/ptcryan/hydrawiser/blob/53acafb08b5cee0f6628414044b9b9f9a0b15e50/hydrawiser/core.py#L196-L209
50,532
ptcryan/hydrawiser
hydrawiser/core.py
Hydrawiser.is_zone_running
def is_zone_running(self, zone): """ Returns the state of the specified zone. :param zone: The zone to check. :type zone: int :returns: Returns True if the zone is currently running, otherwise returns False if the zone is not running. :rtype: boolean ...
python
def is_zone_running(self, zone): """ Returns the state of the specified zone. :param zone: The zone to check. :type zone: int :returns: Returns True if the zone is currently running, otherwise returns False if the zone is not running. :rtype: boolean ...
[ "def", "is_zone_running", "(", "self", ",", "zone", ")", ":", "self", ".", "update_controller_info", "(", ")", "if", "self", ".", "running", "is", "None", "or", "not", "self", ".", "running", ":", "return", "False", "if", "int", "(", "self", ".", "runn...
Returns the state of the specified zone. :param zone: The zone to check. :type zone: int :returns: Returns True if the zone is currently running, otherwise returns False if the zone is not running. :rtype: boolean
[ "Returns", "the", "state", "of", "the", "specified", "zone", "." ]
53acafb08b5cee0f6628414044b9b9f9a0b15e50
https://github.com/ptcryan/hydrawiser/blob/53acafb08b5cee0f6628414044b9b9f9a0b15e50/hydrawiser/core.py#L211-L230
50,533
ptcryan/hydrawiser
hydrawiser/core.py
Hydrawiser.time_remaining
def time_remaining(self, zone): """ Returns the amount of watering time left in seconds. :param zone: The zone to check. :type zone: int :returns: If the zone is not running returns 0. If the zone doesn't exist returns None. Otherwise returns number of seconds ...
python
def time_remaining(self, zone): """ Returns the amount of watering time left in seconds. :param zone: The zone to check. :type zone: int :returns: If the zone is not running returns 0. If the zone doesn't exist returns None. Otherwise returns number of seconds ...
[ "def", "time_remaining", "(", "self", ",", "zone", ")", ":", "self", ".", "update_controller_info", "(", ")", "if", "zone", "<", "0", "or", "zone", ">", "(", "self", ".", "num_relays", "-", "1", ")", ":", "return", "None", "if", "self", ".", "is_zone...
Returns the amount of watering time left in seconds. :param zone: The zone to check. :type zone: int :returns: If the zone is not running returns 0. If the zone doesn't exist returns None. Otherwise returns number of seconds left in the watering cycle. ...
[ "Returns", "the", "amount", "of", "watering", "time", "left", "in", "seconds", "." ]
53acafb08b5cee0f6628414044b9b9f9a0b15e50
https://github.com/ptcryan/hydrawiser/blob/53acafb08b5cee0f6628414044b9b9f9a0b15e50/hydrawiser/core.py#L232-L252
50,534
rbarrois/throttle
throttle/storage/django.py
DjangoCacheStorage.cache
def cache(self): """Memoize access to the cache backend.""" if self._cache is None: self._cache = django_cache.get_cache(self.cache_name) return self._cache
python
def cache(self): """Memoize access to the cache backend.""" if self._cache is None: self._cache = django_cache.get_cache(self.cache_name) return self._cache
[ "def", "cache", "(", "self", ")", ":", "if", "self", ".", "_cache", "is", "None", ":", "self", ".", "_cache", "=", "django_cache", ".", "get_cache", "(", "self", ".", "cache_name", ")", "return", "self", ".", "_cache" ]
Memoize access to the cache backend.
[ "Memoize", "access", "to", "the", "cache", "backend", "." ]
cc00e6b446f3938c81826ee258975ebdc12511a2
https://github.com/rbarrois/throttle/blob/cc00e6b446f3938c81826ee258975ebdc12511a2/throttle/storage/django.py#L25-L29
50,535
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
Operation.element
def element(self): """Returns the instance of the element who owns the first line number for the operation in the cached source code.""" #We assume here that the entire operation is associated with a single #code element. Since the sequence matcher groups operations by contiguous ...
python
def element(self): """Returns the instance of the element who owns the first line number for the operation in the cached source code.""" #We assume here that the entire operation is associated with a single #code element. Since the sequence matcher groups operations by contiguous ...
[ "def", "element", "(", "self", ")", ":", "#We assume here that the entire operation is associated with a single", "#code element. Since the sequence matcher groups operations by contiguous", "#lines of code to change, this is a safe assumption.", "if", "self", ".", "_element", "is", "Non...
Returns the instance of the element who owns the first line number for the operation in the cached source code.
[ "Returns", "the", "instance", "of", "the", "element", "who", "owns", "the", "first", "line", "number", "for", "the", "operation", "in", "the", "cached", "source", "code", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L201-L215
50,536
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
Operation.docelement
def docelement(self): """Returns the instance of the element whose body owns the docstring in the current operation. """ #This is needed since the decorating documentation #for types and executables is in the body of the module, but when they #get edited, the edit belongs...
python
def docelement(self): """Returns the instance of the element whose body owns the docstring in the current operation. """ #This is needed since the decorating documentation #for types and executables is in the body of the module, but when they #get edited, the edit belongs...
[ "def", "docelement", "(", "self", ")", ":", "#This is needed since the decorating documentation", "#for types and executables is in the body of the module, but when they", "#get edited, the edit belongs to the type/executable because the character", "#falls within the absstart and end attributes."...
Returns the instance of the element whose body owns the docstring in the current operation.
[ "Returns", "the", "instance", "of", "the", "element", "whose", "body", "owns", "the", "docstring", "in", "the", "current", "operation", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L218-L236
50,537
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
Operation.handle
def handle(self): """Handles the real time update of some code from the cached representation of the module. """ #If we have more statements in the buffer than the cached, it doesn't matter, #we just run the first few replacements of the cache concurrently and do #what'...
python
def handle(self): """Handles the real time update of some code from the cached representation of the module. """ #If we have more statements in the buffer than the cached, it doesn't matter, #we just run the first few replacements of the cache concurrently and do #what'...
[ "def", "handle", "(", "self", ")", ":", "#If we have more statements in the buffer than the cached, it doesn't matter, ", "#we just run the first few replacements of the cache concurrently and do ", "#what's left over from the buffer.", "#REVIEW", "if", "self", ".", "mode", "==", "\"in...
Handles the real time update of some code from the cached representation of the module.
[ "Handles", "the", "real", "time", "update", "of", "some", "code", "from", "the", "cached", "representation", "of", "the", "module", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L238-L273
50,538
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
Operation._handle_docstrings
def _handle_docstrings(self): """Searches through the lines affected by this operation to find blocks of adjacent docstrings to parse for the current element. """ #Docstrings have to be continuous sets of lines that start with !! #When they change in any way (i.e. any of the thre...
python
def _handle_docstrings(self): """Searches through the lines affected by this operation to find blocks of adjacent docstrings to parse for the current element. """ #Docstrings have to be continuous sets of lines that start with !! #When they change in any way (i.e. any of the thre...
[ "def", "_handle_docstrings", "(", "self", ")", ":", "#Docstrings have to be continuous sets of lines that start with !!", "#When they change in any way (i.e. any of the three modes), we ", "#have to reparse the entire block because it has XML dependencies", "#Because of that, the cached version of...
Searches through the lines affected by this operation to find blocks of adjacent docstrings to parse for the current element.
[ "Searches", "through", "the", "lines", "affected", "by", "this", "operation", "to", "find", "blocks", "of", "adjacent", "docstrings", "to", "parse", "for", "the", "current", "element", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L275-L325
50,539
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
Operation._docstring_parse
def _docstring_parse(self, blocks): """Parses the XML from the specified blocks of docstrings.""" result = {} for block, docline, doclength, key in blocks: doctext = "<doc>{}</doc>".format(" ".join(block)) try: docs = ET.XML(doctext) docsta...
python
def _docstring_parse(self, blocks): """Parses the XML from the specified blocks of docstrings.""" result = {} for block, docline, doclength, key in blocks: doctext = "<doc>{}</doc>".format(" ".join(block)) try: docs = ET.XML(doctext) docsta...
[ "def", "_docstring_parse", "(", "self", ",", "blocks", ")", ":", "result", "=", "{", "}", "for", "block", ",", "docline", ",", "doclength", ",", "key", "in", "blocks", ":", "doctext", "=", "\"<doc>{}</doc>\"", ".", "format", "(", "\" \"", ".", "join", ...
Parses the XML from the specified blocks of docstrings.
[ "Parses", "the", "XML", "from", "the", "specified", "blocks", "of", "docstrings", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L327-L345
50,540
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
Operation._docstring_getblocks
def _docstring_getblocks(self): """Gets the longest continuous block of docstrings from the buffer code string if any of those lines are docstring lines. """ #If there are no lines to look at, we have nothing to do here. if self.ibuffer[0] == self.ibuffer[1]: return [...
python
def _docstring_getblocks(self): """Gets the longest continuous block of docstrings from the buffer code string if any of those lines are docstring lines. """ #If there are no lines to look at, we have nothing to do here. if self.ibuffer[0] == self.ibuffer[1]: return [...
[ "def", "_docstring_getblocks", "(", "self", ")", ":", "#If there are no lines to look at, we have nothing to do here.", "if", "self", ".", "ibuffer", "[", "0", "]", "==", "self", ".", "ibuffer", "[", "1", "]", ":", "return", "[", "]", "lines", "=", "self", "."...
Gets the longest continuous block of docstrings from the buffer code string if any of those lines are docstring lines.
[ "Gets", "the", "longest", "continuous", "block", "of", "docstrings", "from", "the", "buffer", "code", "string", "if", "any", "of", "those", "lines", "are", "docstring", "lines", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L347-L422
50,541
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
Operation._docstring_key
def _docstring_key(self, line): """Returns the key to use for the docblock immediately preceding the specified line.""" decormatch = self.docparser.RE_DECOR.match(line) if decormatch is not None: key = "{}.{}".format(self.docelement.name, decormatch.group("name")) els...
python
def _docstring_key(self, line): """Returns the key to use for the docblock immediately preceding the specified line.""" decormatch = self.docparser.RE_DECOR.match(line) if decormatch is not None: key = "{}.{}".format(self.docelement.name, decormatch.group("name")) els...
[ "def", "_docstring_key", "(", "self", ",", "line", ")", ":", "decormatch", "=", "self", ".", "docparser", ".", "RE_DECOR", ".", "match", "(", "line", ")", "if", "decormatch", "is", "not", "None", ":", "key", "=", "\"{}.{}\"", ".", "format", "(", "self"...
Returns the key to use for the docblock immediately preceding the specified line.
[ "Returns", "the", "key", "to", "use", "for", "the", "docblock", "immediately", "preceding", "the", "specified", "line", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L424-L433
50,542
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
Operation._update_extent
def _update_extent(self): """Updates the extent of the element being altered by this operation to include the code that has changed.""" #For new instances, their length is being updated by the module #updater and will include *all* statements, so we don't want to #keep changing t...
python
def _update_extent(self): """Updates the extent of the element being altered by this operation to include the code that has changed.""" #For new instances, their length is being updated by the module #updater and will include *all* statements, so we don't want to #keep changing t...
[ "def", "_update_extent", "(", "self", ")", ":", "#For new instances, their length is being updated by the module", "#updater and will include *all* statements, so we don't want to", "#keep changing the endpoints.", "if", "self", ".", "bar_extent", ":", "return", "original", "=", "s...
Updates the extent of the element being altered by this operation to include the code that has changed.
[ "Updates", "the", "extent", "of", "the", "element", "being", "altered", "by", "this", "operation", "to", "include", "the", "code", "that", "has", "changed", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L435-L462
50,543
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
Operation._get_buffered
def _get_buffered(self): """Gets a list of the statements that are new for the real time update.""" lines = self.context.bufferstr[self.ibuffer[0]:self.ibuffer[1]] return self._get_statements(lines, self.ibuffer[0])
python
def _get_buffered(self): """Gets a list of the statements that are new for the real time update.""" lines = self.context.bufferstr[self.ibuffer[0]:self.ibuffer[1]] return self._get_statements(lines, self.ibuffer[0])
[ "def", "_get_buffered", "(", "self", ")", ":", "lines", "=", "self", ".", "context", ".", "bufferstr", "[", "self", ".", "ibuffer", "[", "0", "]", ":", "self", ".", "ibuffer", "[", "1", "]", "]", "return", "self", ".", "_get_statements", "(", "lines"...
Gets a list of the statements that are new for the real time update.
[ "Gets", "a", "list", "of", "the", "statements", "that", "are", "new", "for", "the", "real", "time", "update", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L464-L467
50,544
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
Operation._get_cached
def _get_cached(self): """Gets a list of statements that the operation will affect during the real time update.""" lines = self.context.cachedstr[self.icached[0]:self.icached[1]] return self._get_statements(lines, self.icached[0])
python
def _get_cached(self): """Gets a list of statements that the operation will affect during the real time update.""" lines = self.context.cachedstr[self.icached[0]:self.icached[1]] return self._get_statements(lines, self.icached[0])
[ "def", "_get_cached", "(", "self", ")", ":", "lines", "=", "self", ".", "context", ".", "cachedstr", "[", "self", ".", "icached", "[", "0", "]", ":", "self", ".", "icached", "[", "1", "]", "]", "return", "self", ".", "_get_statements", "(", "lines", ...
Gets a list of statements that the operation will affect during the real time update.
[ "Gets", "a", "list", "of", "statements", "that", "the", "operation", "will", "affect", "during", "the", "real", "time", "update", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L469-L473
50,545
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
ModuleUpdater.update
def update(self, context): """Updates all references in the cached representation of the module with their latest code from the specified source code string that was extracted from the emacs buffer. :arg context: the buffer context information. """ #Get a list of all the...
python
def update(self, context): """Updates all references in the cached representation of the module with their latest code from the specified source code string that was extracted from the emacs buffer. :arg context: the buffer context information. """ #Get a list of all the...
[ "def", "update", "(", "self", ",", "context", ")", ":", "#Get a list of all the operations that need to be performed and then", "#execute them.", "self", ".", "_operations", "=", "self", ".", "_get_operations", "(", "context", ")", "for", "i", "in", "range", "(", "l...
Updates all references in the cached representation of the module with their latest code from the specified source code string that was extracted from the emacs buffer. :arg context: the buffer context information.
[ "Updates", "all", "references", "in", "the", "cached", "representation", "of", "the", "module", "with", "their", "latest", "code", "from", "the", "specified", "source", "code", "string", "that", "was", "extracted", "from", "the", "emacs", "buffer", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L513-L531
50,546
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
ModuleUpdater._get_operations
def _get_operations(self, context): """Returns a list of operations that need to be performed to turn the cached source code into the one in the buffer.""" #Most of the time, the real-time update is going to fire with #incomplete statements that don't result in any changes being made ...
python
def _get_operations(self, context): """Returns a list of operations that need to be performed to turn the cached source code into the one in the buffer.""" #Most of the time, the real-time update is going to fire with #incomplete statements that don't result in any changes being made ...
[ "def", "_get_operations", "(", "self", ",", "context", ")", ":", "#Most of the time, the real-time update is going to fire with", "#incomplete statements that don't result in any changes being made", "#to the module instances. The SequenceMatches caches hashes for the", "#second argument. Logi...
Returns a list of operations that need to be performed to turn the cached source code into the one in the buffer.
[ "Returns", "a", "list", "of", "operations", "that", "need", "to", "be", "performed", "to", "turn", "the", "cached", "source", "code", "into", "the", "one", "in", "the", "buffer", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L542-L584
50,547
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
ModuleUpdater.update_instance_extent
def update_instance_extent(self, instance, module, operation): """Updates a new instance that was added to a module to be complete if the end token is present in any remaining, overlapping operations. """ #Essentially, we want to look in the rest of the statements that are #part ...
python
def update_instance_extent(self, instance, module, operation): """Updates a new instance that was added to a module to be complete if the end token is present in any remaining, overlapping operations. """ #Essentially, we want to look in the rest of the statements that are #part ...
[ "def", "update_instance_extent", "(", "self", ",", "instance", ",", "module", ",", "operation", ")", ":", "#Essentially, we want to look in the rest of the statements that are", "#part of the current operation to see how many more of them pertain ", "#to the new instance that was added."...
Updates a new instance that was added to a module to be complete if the end token is present in any remaining, overlapping operations.
[ "Updates", "a", "new", "instance", "that", "was", "added", "to", "a", "module", "to", "be", "complete", "if", "the", "end", "token", "is", "present", "in", "any", "remaining", "overlapping", "operations", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L586-L627
50,548
rosenbrockc/fortpy
fortpy/isense/rtupdate.py
ModuleUpdater._find_end_token
def _find_end_token(self, end_token, operation): """Looks for a statement in the operation's list that matches the specified end token. Returns the index of the statement in the operation that matches. """ ibuffer, icache = operation.state length = operation.buffered[ibuffer][2] ...
python
def _find_end_token(self, end_token, operation): """Looks for a statement in the operation's list that matches the specified end token. Returns the index of the statement in the operation that matches. """ ibuffer, icache = operation.state length = operation.buffered[ibuffer][2] ...
[ "def", "_find_end_token", "(", "self", ",", "end_token", ",", "operation", ")", ":", "ibuffer", ",", "icache", "=", "operation", ".", "state", "length", "=", "operation", ".", "buffered", "[", "ibuffer", "]", "[", "2", "]", "result", "=", "None", "for", ...
Looks for a statement in the operation's list that matches the specified end token. Returns the index of the statement in the operation that matches.
[ "Looks", "for", "a", "statement", "in", "the", "operation", "s", "list", "that", "matches", "the", "specified", "end", "token", ".", "Returns", "the", "index", "of", "the", "statement", "in", "the", "operation", "that", "matches", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/rtupdate.py#L629-L652
50,549
rbarrois/throttle
throttle/storage/base.py
BaseStorage.mget
def mget(self, *keys, **kwargs): """Retrieve values for a set of keys. Args: keys (str list): the list of keys whose value should be retrieved Keyword arguements: default (object): the value to use for non-existent keys coherent (bool): whether all fetched v...
python
def mget(self, *keys, **kwargs): """Retrieve values for a set of keys. Args: keys (str list): the list of keys whose value should be retrieved Keyword arguements: default (object): the value to use for non-existent keys coherent (bool): whether all fetched v...
[ "def", "mget", "(", "self", ",", "*", "keys", ",", "*", "*", "kwargs", ")", ":", "default", "=", "kwargs", ".", "get", "(", "'default'", ")", "coherent", "=", "kwargs", ".", "get", "(", "'coherent'", ",", "False", ")", "for", "key", "in", "keys", ...
Retrieve values for a set of keys. Args: keys (str list): the list of keys whose value should be retrieved Keyword arguements: default (object): the value to use for non-existent keys coherent (bool): whether all fetched values should be "coherent", ...
[ "Retrieve", "values", "for", "a", "set", "of", "keys", "." ]
cc00e6b446f3938c81826ee258975ebdc12511a2
https://github.com/rbarrois/throttle/blob/cc00e6b446f3938c81826ee258975ebdc12511a2/throttle/storage/base.py#L32-L50
50,550
rbarrois/throttle
throttle/storage/base.py
BaseStorage.mset
def mset(self, values): """Set the value of several keys at once. Args: values (dict): maps a key to its value. """ for key, value in values.items(): self.set(key, value)
python
def mset(self, values): """Set the value of several keys at once. Args: values (dict): maps a key to its value. """ for key, value in values.items(): self.set(key, value)
[ "def", "mset", "(", "self", ",", "values", ")", ":", "for", "key", ",", "value", "in", "values", ".", "items", "(", ")", ":", "self", ".", "set", "(", "key", ",", "value", ")" ]
Set the value of several keys at once. Args: values (dict): maps a key to its value.
[ "Set", "the", "value", "of", "several", "keys", "at", "once", "." ]
cc00e6b446f3938c81826ee258975ebdc12511a2
https://github.com/rbarrois/throttle/blob/cc00e6b446f3938c81826ee258975ebdc12511a2/throttle/storage/base.py#L52-L59
50,551
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator.names
def names(self): """Returns a list of possible completions for the symbol under the cursor in the current user context.""" #This is where the context information is extremely useful in #limiting the extent of the search space we need to examine. if self._names is None: ...
python
def names(self): """Returns a list of possible completions for the symbol under the cursor in the current user context.""" #This is where the context information is extremely useful in #limiting the extent of the search space we need to examine. if self._names is None: ...
[ "def", "names", "(", "self", ")", ":", "#This is where the context information is extremely useful in ", "#limiting the extent of the search space we need to examine.", "if", "self", ".", "_names", "is", "None", ":", "attribute", "=", "self", ".", "get_attribute", "(", ")",...
Returns a list of possible completions for the symbol under the cursor in the current user context.
[ "Returns", "a", "list", "of", "possible", "completions", "for", "the", "symbol", "under", "the", "cursor", "in", "the", "current", "user", "context", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L31-L45
50,552
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator.bracket_complete
def bracket_complete(self): """Returns a function call signature for completion whenever a bracket '(' is pressed.""" #The important thing to keep track of here is that '(' can be #pushed in the following places: # - in a subroutine/function definition # - when calling a ...
python
def bracket_complete(self): """Returns a function call signature for completion whenever a bracket '(' is pressed.""" #The important thing to keep track of here is that '(' can be #pushed in the following places: # - in a subroutine/function definition # - when calling a ...
[ "def", "bracket_complete", "(", "self", ")", ":", "#The important thing to keep track of here is that '(' can be", "#pushed in the following places:", "# - in a subroutine/function definition", "# - when calling a function or subroutine, this includes calls within", "# the argument list of a f...
Returns a function call signature for completion whenever a bracket '(' is pressed.
[ "Returns", "a", "function", "call", "signature", "for", "completion", "whenever", "a", "bracket", "(", "is", "pressed", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L47-L79
50,553
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._bracket_complete_sig
def _bracket_complete_sig(self, symbol, fullsymbol): """Returns the call signature and docstring for the executable immediately preceding a bracket '(' that was typed.""" if symbol != fullsymbol: #We have a sym%sym%... chain and the completion just needs to #be the signat...
python
def _bracket_complete_sig(self, symbol, fullsymbol): """Returns the call signature and docstring for the executable immediately preceding a bracket '(' that was typed.""" if symbol != fullsymbol: #We have a sym%sym%... chain and the completion just needs to #be the signat...
[ "def", "_bracket_complete_sig", "(", "self", ",", "symbol", ",", "fullsymbol", ")", ":", "if", "symbol", "!=", "fullsymbol", ":", "#We have a sym%sym%... chain and the completion just needs to", "#be the signature of the member method.", "target", ",", "targmod", "=", "self...
Returns the call signature and docstring for the executable immediately preceding a bracket '(' that was typed.
[ "Returns", "the", "call", "signature", "and", "docstring", "for", "the", "executable", "immediately", "preceding", "a", "bracket", "(", "that", "was", "typed", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L81-L110
50,554
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._bracket_dim_suggest
def _bracket_dim_suggest(self, variable): """Returns a dictionary of documentation for helping complete the dimensions of a variable.""" if variable is not None: #Look for <dimension> descriptors that are children of the variable #in its docstrings. dims = var...
python
def _bracket_dim_suggest(self, variable): """Returns a dictionary of documentation for helping complete the dimensions of a variable.""" if variable is not None: #Look for <dimension> descriptors that are children of the variable #in its docstrings. dims = var...
[ "def", "_bracket_dim_suggest", "(", "self", ",", "variable", ")", ":", "if", "variable", "is", "not", "None", ":", "#Look for <dimension> descriptors that are children of the variable", "#in its docstrings.", "dims", "=", "variable", ".", "doc_children", "(", "\"dimension...
Returns a dictionary of documentation for helping complete the dimensions of a variable.
[ "Returns", "a", "dictionary", "of", "documentation", "for", "helping", "complete", "the", "dimensions", "of", "a", "variable", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L112-L130
50,555
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator.get_definition
def get_definition(self): """Checks variable and executable code elements based on the current context for a code element whose name matches context.exact_match perfectly. """ #Check the variables first, then the functions. match = self._bracket_exact_var(self.context.exa...
python
def get_definition(self): """Checks variable and executable code elements based on the current context for a code element whose name matches context.exact_match perfectly. """ #Check the variables first, then the functions. match = self._bracket_exact_var(self.context.exa...
[ "def", "get_definition", "(", "self", ")", ":", "#Check the variables first, then the functions.", "match", "=", "self", ".", "_bracket_exact_var", "(", "self", ".", "context", ".", "exact_match", ")", "if", "match", "is", "None", ":", "match", "=", "self", ".",...
Checks variable and executable code elements based on the current context for a code element whose name matches context.exact_match perfectly.
[ "Checks", "variable", "and", "executable", "code", "elements", "based", "on", "the", "current", "context", "for", "a", "code", "element", "whose", "name", "matches", "context", ".", "exact_match", "perfectly", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L132-L142
50,556
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._bracket_exact_var
def _bracket_exact_var(self, symbol): """Checks local first and then module global variables for an exact match to the specified symbol name.""" if isinstance(self.element, Executable): if symbol in self.element.parameters: return self.element.parameters[symbol] ...
python
def _bracket_exact_var(self, symbol): """Checks local first and then module global variables for an exact match to the specified symbol name.""" if isinstance(self.element, Executable): if symbol in self.element.parameters: return self.element.parameters[symbol] ...
[ "def", "_bracket_exact_var", "(", "self", ",", "symbol", ")", ":", "if", "isinstance", "(", "self", ".", "element", ",", "Executable", ")", ":", "if", "symbol", "in", "self", ".", "element", ".", "parameters", ":", "return", "self", ".", "element", ".", ...
Checks local first and then module global variables for an exact match to the specified symbol name.
[ "Checks", "local", "first", "and", "then", "module", "global", "variables", "for", "an", "exact", "match", "to", "the", "specified", "symbol", "name", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L144-L156
50,557
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._bracket_exact_exec
def _bracket_exact_exec(self, symbol): """Checks builtin, local and global executable collections for the specified symbol and returns it as soon as it is found.""" if symbol in self.context.module.executables: return self.context.module.executables[symbol] if symbol in self...
python
def _bracket_exact_exec(self, symbol): """Checks builtin, local and global executable collections for the specified symbol and returns it as soon as it is found.""" if symbol in self.context.module.executables: return self.context.module.executables[symbol] if symbol in self...
[ "def", "_bracket_exact_exec", "(", "self", ",", "symbol", ")", ":", "if", "symbol", "in", "self", ".", "context", ".", "module", ".", "executables", ":", "return", "self", ".", "context", ".", "module", ".", "executables", "[", "symbol", "]", "if", "symb...
Checks builtin, local and global executable collections for the specified symbol and returns it as soon as it is found.
[ "Checks", "builtin", "local", "and", "global", "executable", "collections", "for", "the", "specified", "symbol", "and", "returns", "it", "as", "soon", "as", "it", "is", "found", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L158-L172
50,558
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._compile_signature
def _compile_signature(self, iexec, call_name): """Compiles the signature for the specified executable and returns as a dictionary.""" if iexec is not None: summary = iexec.summary if isinstance(iexec, Function): summary = iexec.returns + "| " + iexec.summ...
python
def _compile_signature(self, iexec, call_name): """Compiles the signature for the specified executable and returns as a dictionary.""" if iexec is not None: summary = iexec.summary if isinstance(iexec, Function): summary = iexec.returns + "| " + iexec.summ...
[ "def", "_compile_signature", "(", "self", ",", "iexec", ",", "call_name", ")", ":", "if", "iexec", "is", "not", "None", ":", "summary", "=", "iexec", ".", "summary", "if", "isinstance", "(", "iexec", ",", "Function", ")", ":", "summary", "=", "iexec", ...
Compiles the signature for the specified executable and returns as a dictionary.
[ "Compiles", "the", "signature", "for", "the", "specified", "executable", "and", "returns", "as", "a", "dictionary", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L174-L203
50,559
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator.signature
def signature(self): """Gets completion or call signature information for the current cursor.""" #We can't really do anything sensible without the name of the function #whose signature we are completing. iexec, execmod = self.context.parser.tree_find(self.context.el_name, ...
python
def signature(self): """Gets completion or call signature information for the current cursor.""" #We can't really do anything sensible without the name of the function #whose signature we are completing. iexec, execmod = self.context.parser.tree_find(self.context.el_name, ...
[ "def", "signature", "(", "self", ")", ":", "#We can't really do anything sensible without the name of the function", "#whose signature we are completing.", "iexec", ",", "execmod", "=", "self", ".", "context", ".", "parser", ".", "tree_find", "(", "self", ".", "context", ...
Gets completion or call signature information for the current cursor.
[ "Gets", "completion", "or", "call", "signature", "information", "for", "the", "current", "cursor", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L221-L234
50,560
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._signature_index
def _signature_index(self, iexec): """Determines where in the call signature the cursor is to decide which parameter needs to have its information returned for the intellisense. """ #Find out where in the signature the cursor is at the moment. call_index = self.context.call_arg_i...
python
def _signature_index(self, iexec): """Determines where in the call signature the cursor is to decide which parameter needs to have its information returned for the intellisense. """ #Find out where in the signature the cursor is at the moment. call_index = self.context.call_arg_i...
[ "def", "_signature_index", "(", "self", ",", "iexec", ")", ":", "#Find out where in the signature the cursor is at the moment.", "call_index", "=", "self", ".", "context", ".", "call_arg_index", "if", "call_index", "is", "not", "None", ":", "#We found the index of the par...
Determines where in the call signature the cursor is to decide which parameter needs to have its information returned for the intellisense.
[ "Determines", "where", "in", "the", "call", "signature", "the", "cursor", "is", "to", "decide", "which", "parameter", "needs", "to", "have", "its", "information", "returned", "for", "the", "intellisense", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L236-L282
50,561
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator.complete
def complete(self): """Gets a list of completion objects for the symbol under the cursor.""" if self._possible is None: self._possible = [] for possible in self.names: c = Completion(self.context, self.names[possible], len(self.context.symbol)) sel...
python
def complete(self): """Gets a list of completion objects for the symbol under the cursor.""" if self._possible is None: self._possible = [] for possible in self.names: c = Completion(self.context, self.names[possible], len(self.context.symbol)) sel...
[ "def", "complete", "(", "self", ")", ":", "if", "self", ".", "_possible", "is", "None", ":", "self", ".", "_possible", "=", "[", "]", "for", "possible", "in", "self", ".", "names", ":", "c", "=", "Completion", "(", "self", ".", "context", ",", "sel...
Gets a list of completion objects for the symbol under the cursor.
[ "Gets", "a", "list", "of", "completion", "objects", "for", "the", "symbol", "under", "the", "cursor", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L284-L292
50,562
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._symbol_in
def _symbol_in(self, symbol, name): """Checks whether the specified symbol is part of the name for completion.""" lsymbol = symbol.lower() lname = name.lower() return lsymbol == lname[:len(symbol)] or "_" + lsymbol in lname
python
def _symbol_in(self, symbol, name): """Checks whether the specified symbol is part of the name for completion.""" lsymbol = symbol.lower() lname = name.lower() return lsymbol == lname[:len(symbol)] or "_" + lsymbol in lname
[ "def", "_symbol_in", "(", "self", ",", "symbol", ",", "name", ")", ":", "lsymbol", "=", "symbol", ".", "lower", "(", ")", "lname", "=", "name", ".", "lower", "(", ")", "return", "lsymbol", "==", "lname", "[", ":", "len", "(", "symbol", ")", "]", ...
Checks whether the specified symbol is part of the name for completion.
[ "Checks", "whether", "the", "specified", "symbol", "is", "part", "of", "the", "name", "for", "completion", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L294-L298
50,563
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._get_chain_parent_symbol
def _get_chain_parent_symbol(self, symbol, fullsymbol): """Gets the code element object for the parent of the specified symbol in the fullsymbol chain.""" #We are only interested in the type of the variable immediately preceding our symbol #in the chain so we can list its members. ...
python
def _get_chain_parent_symbol(self, symbol, fullsymbol): """Gets the code element object for the parent of the specified symbol in the fullsymbol chain.""" #We are only interested in the type of the variable immediately preceding our symbol #in the chain so we can list its members. ...
[ "def", "_get_chain_parent_symbol", "(", "self", ",", "symbol", ",", "fullsymbol", ")", ":", "#We are only interested in the type of the variable immediately preceding our symbol", "#in the chain so we can list its members.", "chain", "=", "fullsymbol", ".", "split", "(", "\"%\"",...
Gets the code element object for the parent of the specified symbol in the fullsymbol chain.
[ "Gets", "the", "code", "element", "object", "for", "the", "parent", "of", "the", "specified", "symbol", "in", "the", "fullsymbol", "chain", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L320-L344
50,564
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._complete_type_chain
def _complete_type_chain(self, symbol, fullsymbol): """Suggests completion for the end of a type chain.""" target, targmod = self._get_chain_parent_symbol(symbol, fullsymbol) if target is None: return {} result = {} #We might know what kind of symbol to limit the com...
python
def _complete_type_chain(self, symbol, fullsymbol): """Suggests completion for the end of a type chain.""" target, targmod = self._get_chain_parent_symbol(symbol, fullsymbol) if target is None: return {} result = {} #We might know what kind of symbol to limit the com...
[ "def", "_complete_type_chain", "(", "self", ",", "symbol", ",", "fullsymbol", ")", ":", "target", ",", "targmod", "=", "self", ".", "_get_chain_parent_symbol", "(", "symbol", ",", "fullsymbol", ")", "if", "target", "is", "None", ":", "return", "{", "}", "r...
Suggests completion for the end of a type chain.
[ "Suggests", "completion", "for", "the", "end", "of", "a", "type", "chain", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L346-L380
50,565
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._complete_sig
def _complete_sig(self, symbol, attribute): """Suggests completion for calling a function or subroutine.""" #Return a list of valid parameters for the function being called fncall = self.context.el_name iexec, execmod = self.context.parser.tree_find(fncall, self.context.module, "executab...
python
def _complete_sig(self, symbol, attribute): """Suggests completion for calling a function or subroutine.""" #Return a list of valid parameters for the function being called fncall = self.context.el_name iexec, execmod = self.context.parser.tree_find(fncall, self.context.module, "executab...
[ "def", "_complete_sig", "(", "self", ",", "symbol", ",", "attribute", ")", ":", "#Return a list of valid parameters for the function being called", "fncall", "=", "self", ".", "context", ".", "el_name", "iexec", ",", "execmod", "=", "self", ".", "context", ".", "p...
Suggests completion for calling a function or subroutine.
[ "Suggests", "completion", "for", "calling", "a", "function", "or", "subroutine", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L382-L402
50,566
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._complete_word
def _complete_word(self, symbol, attribute): """Suggests context completions based exclusively on the word preceding the cursor.""" #The cursor is after a %(,\s and the user is looking for a list #of possibilities that is a bit smarter that regular AC. if self.context.el_call in ...
python
def _complete_word(self, symbol, attribute): """Suggests context completions based exclusively on the word preceding the cursor.""" #The cursor is after a %(,\s and the user is looking for a list #of possibilities that is a bit smarter that regular AC. if self.context.el_call in ...
[ "def", "_complete_word", "(", "self", ",", "symbol", ",", "attribute", ")", ":", "#The cursor is after a %(,\\s and the user is looking for a list", "#of possibilities that is a bit smarter that regular AC.", "if", "self", ".", "context", ".", "el_call", "in", "[", "\"sub\"",...
Suggests context completions based exclusively on the word preceding the cursor.
[ "Suggests", "context", "completions", "based", "exclusively", "on", "the", "word", "preceding", "the", "cursor", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L404-L419
50,567
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._complete_values
def _complete_values(self, symbol = ""): """Compiles a list of possible symbols that can hold a value in place. These consist of local vars, global vars, and functions.""" result = {} #Also add the subroutines from the module and its dependencies. moddict = self._generic_filter_e...
python
def _complete_values(self, symbol = ""): """Compiles a list of possible symbols that can hold a value in place. These consist of local vars, global vars, and functions.""" result = {} #Also add the subroutines from the module and its dependencies. moddict = self._generic_filter_e...
[ "def", "_complete_values", "(", "self", ",", "symbol", "=", "\"\"", ")", ":", "result", "=", "{", "}", "#Also add the subroutines from the module and its dependencies.", "moddict", "=", "self", ".", "_generic_filter_execs", "(", "self", ".", "context", ".", "module"...
Compiles a list of possible symbols that can hold a value in place. These consist of local vars, global vars, and functions.
[ "Compiles", "a", "list", "of", "possible", "symbols", "that", "can", "hold", "a", "value", "in", "place", ".", "These", "consist", "of", "local", "vars", "global", "vars", "and", "functions", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L435-L474
50,568
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator._cond_update
def _cond_update(self, first, second, symbol, maxadd = -1): """Overwrites the keys and values in the first dictionary with those of the second as long as the symbol matches part of the key. :arg maxadd: specifies a limit on the number of entries from the second dict that will be added...
python
def _cond_update(self, first, second, symbol, maxadd = -1): """Overwrites the keys and values in the first dictionary with those of the second as long as the symbol matches part of the key. :arg maxadd: specifies a limit on the number of entries from the second dict that will be added...
[ "def", "_cond_update", "(", "self", ",", "first", ",", "second", ",", "symbol", ",", "maxadd", "=", "-", "1", ")", ":", "if", "symbol", "!=", "\"\"", ":", "added", "=", "0", "for", "key", "in", "second", ":", "if", "self", ".", "_symbol_in", "(", ...
Overwrites the keys and values in the first dictionary with those of the second as long as the symbol matches part of the key. :arg maxadd: specifies a limit on the number of entries from the second dict that will be added to the first.
[ "Overwrites", "the", "keys", "and", "values", "in", "the", "first", "dictionary", "with", "those", "of", "the", "second", "as", "long", "as", "the", "symbol", "matches", "part", "of", "the", "key", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L476-L489
50,569
rosenbrockc/fortpy
fortpy/isense/evaluator.py
Evaluator.get_attribute
def get_attribute(self): """Gets the appropriate module attribute name for a collection corresponding to the context's element type.""" attributes = ['dependencies', 'publics', 'members', 'types', 'executables'] #Find the correct attribute based on the type of...
python
def get_attribute(self): """Gets the appropriate module attribute name for a collection corresponding to the context's element type.""" attributes = ['dependencies', 'publics', 'members', 'types', 'executables'] #Find the correct attribute based on the type of...
[ "def", "get_attribute", "(", "self", ")", ":", "attributes", "=", "[", "'dependencies'", ",", "'publics'", ",", "'members'", ",", "'types'", ",", "'executables'", "]", "#Find the correct attribute based on the type of the context", "if", "self", ".", "context", ".", ...
Gets the appropriate module attribute name for a collection corresponding to the context's element type.
[ "Gets", "the", "appropriate", "module", "attribute", "name", "for", "a", "collection", "corresponding", "to", "the", "context", "s", "element", "type", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/evaluator.py#L491-L504
50,570
rosenbrockc/fortpy
fortpy/docelements.py
DocElement.parse
def parse(self, parser, xml): """Parses the rawtext to extract contents and references.""" #We can only process references if the XML tag has inner-XML if xml.text is not None: matches = parser.RE_REFS.finditer(xml.text) if matches: for match in matches: ...
python
def parse(self, parser, xml): """Parses the rawtext to extract contents and references.""" #We can only process references if the XML tag has inner-XML if xml.text is not None: matches = parser.RE_REFS.finditer(xml.text) if matches: for match in matches: ...
[ "def", "parse", "(", "self", ",", "parser", ",", "xml", ")", ":", "#We can only process references if the XML tag has inner-XML", "if", "xml", ".", "text", "is", "not", "None", ":", "matches", "=", "parser", ".", "RE_REFS", ".", "finditer", "(", "xml", ".", ...
Parses the rawtext to extract contents and references.
[ "Parses", "the", "rawtext", "to", "extract", "contents", "and", "references", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/docelements.py#L105-L117
50,571
rosenbrockc/fortpy
fortpy/base.py
exhandler
def exhandler(function, parser): """If -examples was specified in 'args', the specified function is called and the application exits. :arg function: the function that prints the examples. :arg parser: the initialized instance of the parser that has the additional, script-specific parameters. ...
python
def exhandler(function, parser): """If -examples was specified in 'args', the specified function is called and the application exits. :arg function: the function that prints the examples. :arg parser: the initialized instance of the parser that has the additional, script-specific parameters. ...
[ "def", "exhandler", "(", "function", ",", "parser", ")", ":", "args", "=", "vars", "(", "bparser", ".", "parse_known_args", "(", ")", "[", "0", "]", ")", "if", "args", "[", "\"examples\"", "]", ":", "function", "(", ")", "exit", "(", "0", ")", "if"...
If -examples was specified in 'args', the specified function is called and the application exits. :arg function: the function that prints the examples. :arg parser: the initialized instance of the parser that has the additional, script-specific parameters.
[ "If", "-", "examples", "was", "specified", "in", "args", "the", "specified", "function", "is", "called", "and", "the", "application", "exits", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/base.py#L15-L32
50,572
rosenbrockc/fortpy
fortpy/base.py
_common_parser
def _common_parser(): """Returns a parser with common command-line options for all the scripts in the fortpy suite. """ import argparse parser = argparse.ArgumentParser(add_help=False) parser.add_argument("-examples", action="store_true", help="See detailed help and examp...
python
def _common_parser(): """Returns a parser with common command-line options for all the scripts in the fortpy suite. """ import argparse parser = argparse.ArgumentParser(add_help=False) parser.add_argument("-examples", action="store_true", help="See detailed help and examp...
[ "def", "_common_parser", "(", ")", ":", "import", "argparse", "parser", "=", "argparse", ".", "ArgumentParser", "(", "add_help", "=", "False", ")", "parser", ".", "add_argument", "(", "\"-examples\"", ",", "action", "=", "\"store_true\"", ",", "help", "=", "...
Returns a parser with common command-line options for all the scripts in the fortpy suite.
[ "Returns", "a", "parser", "with", "common", "command", "-", "line", "options", "for", "all", "the", "scripts", "in", "the", "fortpy", "suite", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/base.py#L34-L49
50,573
twaldear/flask-secure-headers
flask_secure_headers/core.py
Secure_Headers._getHeaders
def _getHeaders(self, updateParams=None): """ create headers list for flask wrapper """ if not updateParams: updateParams = {} policies = self.defaultPolicies if len(updateParams) > 0: for k,v in updateParams.items(): k = k.replace('-','_') c = globals()[k](v) try: policies[k] = c.update_...
python
def _getHeaders(self, updateParams=None): """ create headers list for flask wrapper """ if not updateParams: updateParams = {} policies = self.defaultPolicies if len(updateParams) > 0: for k,v in updateParams.items(): k = k.replace('-','_') c = globals()[k](v) try: policies[k] = c.update_...
[ "def", "_getHeaders", "(", "self", ",", "updateParams", "=", "None", ")", ":", "if", "not", "updateParams", ":", "updateParams", "=", "{", "}", "policies", "=", "self", ".", "defaultPolicies", "if", "len", "(", "updateParams", ")", ">", "0", ":", "for", ...
create headers list for flask wrapper
[ "create", "headers", "list", "for", "flask", "wrapper" ]
3eca972b369608a7669b67cbe66679570a6505ce
https://github.com/twaldear/flask-secure-headers/blob/3eca972b369608a7669b67cbe66679570a6505ce/flask_secure_headers/core.py#L59-L74
50,574
twaldear/flask-secure-headers
flask_secure_headers/core.py
Secure_Headers.policyChange
def policyChange(self, updateParams, func): """ update defaultPolicy dict """ for k,v in updateParams.items(): k = k.replace('-','_') c = globals()[k](v) try: self.defaultPolicies[k] = getattr(c,func)(self.defaultPolicies[k]) except Exception, e: raise
python
def policyChange(self, updateParams, func): """ update defaultPolicy dict """ for k,v in updateParams.items(): k = k.replace('-','_') c = globals()[k](v) try: self.defaultPolicies[k] = getattr(c,func)(self.defaultPolicies[k]) except Exception, e: raise
[ "def", "policyChange", "(", "self", ",", "updateParams", ",", "func", ")", ":", "for", "k", ",", "v", "in", "updateParams", ".", "items", "(", ")", ":", "k", "=", "k", ".", "replace", "(", "'-'", ",", "'_'", ")", "c", "=", "globals", "(", ")", ...
update defaultPolicy dict
[ "update", "defaultPolicy", "dict" ]
3eca972b369608a7669b67cbe66679570a6505ce
https://github.com/twaldear/flask-secure-headers/blob/3eca972b369608a7669b67cbe66679570a6505ce/flask_secure_headers/core.py#L81-L89
50,575
twaldear/flask-secure-headers
flask_secure_headers/core.py
Secure_Headers.wrapper
def wrapper(self, updateParams=None): """ create wrapper for flask app route """ def decorator(f): _headers = self._getHeaders(updateParams) """ flask decorator to include headers """ @wraps(f) def decorated_function(*args, **kwargs): resp = make_response(f(*args, **kwargs)) self._setRespHeader(...
python
def wrapper(self, updateParams=None): """ create wrapper for flask app route """ def decorator(f): _headers = self._getHeaders(updateParams) """ flask decorator to include headers """ @wraps(f) def decorated_function(*args, **kwargs): resp = make_response(f(*args, **kwargs)) self._setRespHeader(...
[ "def", "wrapper", "(", "self", ",", "updateParams", "=", "None", ")", ":", "def", "decorator", "(", "f", ")", ":", "_headers", "=", "self", ".", "_getHeaders", "(", "updateParams", ")", "\"\"\" flask decorator to include headers \"\"\"", "@", "wraps", "(", "f"...
create wrapper for flask app route
[ "create", "wrapper", "for", "flask", "app", "route" ]
3eca972b369608a7669b67cbe66679570a6505ce
https://github.com/twaldear/flask-secure-headers/blob/3eca972b369608a7669b67cbe66679570a6505ce/flask_secure_headers/core.py#L99-L111
50,576
rosenbrockc/fortpy
fortpy/serialize.py
Serializer.load_module
def load_module(self, path, changed_time, parser=None): """Attempts to load the specified module from a serialized, cached version. If that fails, the method returns none.""" if settings.use_filesystem_cache == False: return None try: pickle_changed_time ...
python
def load_module(self, path, changed_time, parser=None): """Attempts to load the specified module from a serialized, cached version. If that fails, the method returns none.""" if settings.use_filesystem_cache == False: return None try: pickle_changed_time ...
[ "def", "load_module", "(", "self", ",", "path", ",", "changed_time", ",", "parser", "=", "None", ")", ":", "if", "settings", ".", "use_filesystem_cache", "==", "False", ":", "return", "None", "try", ":", "pickle_changed_time", "=", "self", ".", "_index", "...
Attempts to load the specified module from a serialized, cached version. If that fails, the method returns none.
[ "Attempts", "to", "load", "the", "specified", "module", "from", "a", "serialized", "cached", "version", ".", "If", "that", "fails", "the", "method", "returns", "none", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/serialize.py#L44-L72
50,577
rosenbrockc/fortpy
fortpy/serialize.py
Serializer.save_module
def save_module(self, path, module, change_time=None): """Saves the specified module and its contents to the file system so that it doesn't have to be parsed again unless it has changed.""" #First, get a list of the module paths that have already been #pickled. We will add to that list ...
python
def save_module(self, path, module, change_time=None): """Saves the specified module and its contents to the file system so that it doesn't have to be parsed again unless it has changed.""" #First, get a list of the module paths that have already been #pickled. We will add to that list ...
[ "def", "save_module", "(", "self", ",", "path", ",", "module", ",", "change_time", "=", "None", ")", ":", "#First, get a list of the module paths that have already been ", "#pickled. We will add to that list of pickling this module.", "if", "settings", ".", "use_filesystem_cach...
Saves the specified module and its contents to the file system so that it doesn't have to be parsed again unless it has changed.
[ "Saves", "the", "specified", "module", "and", "its", "contents", "to", "the", "file", "system", "so", "that", "it", "doesn", "t", "have", "to", "be", "parsed", "again", "unless", "it", "has", "changed", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/serialize.py#L74-L98
50,578
rosenbrockc/fortpy
fortpy/serialize.py
Serializer._index
def _index(self): """Keys a list of file paths that have been pickled in this directory. The index is stored in a json file in the same directory as the pickled objects.""" if self.__index is None: try: with open(self._get_path('index.json')) as f: ...
python
def _index(self): """Keys a list of file paths that have been pickled in this directory. The index is stored in a json file in the same directory as the pickled objects.""" if self.__index is None: try: with open(self._get_path('index.json')) as f: ...
[ "def", "_index", "(", "self", ")", ":", "if", "self", ".", "__index", "is", "None", ":", "try", ":", "with", "open", "(", "self", ".", "_get_path", "(", "'index.json'", ")", ")", "as", "f", ":", "data", "=", "json", ".", "load", "(", "f", ")", ...
Keys a list of file paths that have been pickled in this directory. The index is stored in a json file in the same directory as the pickled objects.
[ "Keys", "a", "list", "of", "file", "paths", "that", "have", "been", "pickled", "in", "this", "directory", ".", "The", "index", "is", "stored", "in", "a", "json", "file", "in", "the", "same", "directory", "as", "the", "pickled", "objects", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/serialize.py#L101-L118
50,579
rosenbrockc/fortpy
fortpy/serialize.py
Serializer._cache_directory
def _cache_directory(self): """Returns the full path to the cache directory as specified in settings. """ if settings.unit_testing_mode or settings.use_test_cache: return os.path.join(settings.cache_directory.replace("Fortpy", "Fortpy_Testing"), self.py_tag) else: ...
python
def _cache_directory(self): """Returns the full path to the cache directory as specified in settings. """ if settings.unit_testing_mode or settings.use_test_cache: return os.path.join(settings.cache_directory.replace("Fortpy", "Fortpy_Testing"), self.py_tag) else: ...
[ "def", "_cache_directory", "(", "self", ")", ":", "if", "settings", ".", "unit_testing_mode", "or", "settings", ".", "use_test_cache", ":", "return", "os", ".", "path", ".", "join", "(", "settings", ".", "cache_directory", ".", "replace", "(", "\"Fortpy\"", ...
Returns the full path to the cache directory as specified in settings.
[ "Returns", "the", "full", "path", "to", "the", "cache", "directory", "as", "specified", "in", "settings", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/serialize.py#L147-L153
50,580
grantmcconnaughey/django-lazy-tags
lazy_tags/utils.py
get_lib_and_tag_name
def get_lib_and_tag_name(tag): """ Takes a tag string and returns the tag library and tag name. For example, "app_tags.tag_name" is returned as "app_tags", "tag_name" and "app_tags.sub.tag_name" is returned as "app_tags.sub", "tag_name" """ if '.' not in tag: raise ValueError('Tag string...
python
def get_lib_and_tag_name(tag): """ Takes a tag string and returns the tag library and tag name. For example, "app_tags.tag_name" is returned as "app_tags", "tag_name" and "app_tags.sub.tag_name" is returned as "app_tags.sub", "tag_name" """ if '.' not in tag: raise ValueError('Tag string...
[ "def", "get_lib_and_tag_name", "(", "tag", ")", ":", "if", "'.'", "not", "in", "tag", ":", "raise", "ValueError", "(", "'Tag string must be in the format \"tag_lib.tag_name\"'", ")", "lib", "=", "tag", ".", "rpartition", "(", "'.'", ")", "[", "0", "]", "tag_na...
Takes a tag string and returns the tag library and tag name. For example, "app_tags.tag_name" is returned as "app_tags", "tag_name" and "app_tags.sub.tag_name" is returned as "app_tags.sub", "tag_name"
[ "Takes", "a", "tag", "string", "and", "returns", "the", "tag", "library", "and", "tag", "name", ".", "For", "example", "app_tags", ".", "tag_name", "is", "returned", "as", "app_tags", "tag_name", "and", "app_tags", ".", "sub", ".", "tag_name", "is", "retur...
c24872c1d9f198abd20669c77380a923092374c2
https://github.com/grantmcconnaughey/django-lazy-tags/blob/c24872c1d9f198abd20669c77380a923092374c2/lazy_tags/utils.py#L36-L46
50,581
grantmcconnaughey/django-lazy-tags
lazy_tags/utils.py
get_tag_html
def get_tag_html(tag_id): """ Returns the Django HTML to load the tag library and render the tag. Args: tag_id (str): The tag id for the to return the HTML for. """ tag_data = get_lazy_tag_data(tag_id) tag = tag_data['tag'] args = tag_data['args'] kwargs = tag_data['kwargs'] ...
python
def get_tag_html(tag_id): """ Returns the Django HTML to load the tag library and render the tag. Args: tag_id (str): The tag id for the to return the HTML for. """ tag_data = get_lazy_tag_data(tag_id) tag = tag_data['tag'] args = tag_data['args'] kwargs = tag_data['kwargs'] ...
[ "def", "get_tag_html", "(", "tag_id", ")", ":", "tag_data", "=", "get_lazy_tag_data", "(", "tag_id", ")", "tag", "=", "tag_data", "[", "'tag'", "]", "args", "=", "tag_data", "[", "'args'", "]", "kwargs", "=", "tag_data", "[", "'kwargs'", "]", "lib", ",",...
Returns the Django HTML to load the tag library and render the tag. Args: tag_id (str): The tag id for the to return the HTML for.
[ "Returns", "the", "Django", "HTML", "to", "load", "the", "tag", "library", "and", "render", "the", "tag", "." ]
c24872c1d9f198abd20669c77380a923092374c2
https://github.com/grantmcconnaughey/django-lazy-tags/blob/c24872c1d9f198abd20669c77380a923092374c2/lazy_tags/utils.py#L49-L81
50,582
rosenbrockc/fortpy
fortpy/parsers/docstring.py
_expand_autotag
def _expand_autotag(atag, container): """Expands the contents of the specified auto tag within its parent container. """ if atag.tag != "auto": return if "names" in atag.attrib: i = -1 for name in re.split("[\s,]+", atag.attrib["names"]): if name[0] == '^': ...
python
def _expand_autotag(atag, container): """Expands the contents of the specified auto tag within its parent container. """ if atag.tag != "auto": return if "names" in atag.attrib: i = -1 for name in re.split("[\s,]+", atag.attrib["names"]): if name[0] == '^': ...
[ "def", "_expand_autotag", "(", "atag", ",", "container", ")", ":", "if", "atag", ".", "tag", "!=", "\"auto\"", ":", "return", "if", "\"names\"", "in", "atag", ".", "attrib", ":", "i", "=", "-", "1", "for", "name", "in", "re", ".", "split", "(", "\"...
Expands the contents of the specified auto tag within its parent container.
[ "Expands", "the", "contents", "of", "the", "specified", "auto", "tag", "within", "its", "parent", "container", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L178-L205
50,583
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser.setup_regex
def setup_regex(self): """Sets up the patterns and regex objects for parsing the docstrings.""" #Regex for grabbing out valid XML tags that represent known docstrings that we can work with. self.keywords = [ "summary", "usage", "errors", "member", "group", "local", "co...
python
def setup_regex(self): """Sets up the patterns and regex objects for parsing the docstrings.""" #Regex for grabbing out valid XML tags that represent known docstrings that we can work with. self.keywords = [ "summary", "usage", "errors", "member", "group", "local", "co...
[ "def", "setup_regex", "(", "self", ")", ":", "#Regex for grabbing out valid XML tags that represent known docstrings that we can work with.", "self", ".", "keywords", "=", "[", "\"summary\"", ",", "\"usage\"", ",", "\"errors\"", ",", "\"member\"", ",", "\"group\"", ",", "...
Sets up the patterns and regex objects for parsing the docstrings.
[ "Sets", "up", "the", "patterns", "and", "regex", "objects", "for", "parsing", "the", "docstrings", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L212-L234
50,584
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser.parse_docs
def parse_docs(self, string, container = None): """Parses the docstrings from the specified string that is the contents of container. Returns a dictionary with keys as parent.code_element_name and the values a list of XML elements for corresponding docstrings. :arg container: the insta...
python
def parse_docs(self, string, container = None): """Parses the docstrings from the specified string that is the contents of container. Returns a dictionary with keys as parent.code_element_name and the values a list of XML elements for corresponding docstrings. :arg container: the insta...
[ "def", "parse_docs", "(", "self", ",", "string", ",", "container", "=", "None", ")", ":", "from", "fortpy", ".", "utility", "import", "XML", "result", "=", "{", "}", "if", "container", "is", "None", ":", "#We are working with the code file at the module level. E...
Parses the docstrings from the specified string that is the contents of container. Returns a dictionary with keys as parent.code_element_name and the values a list of XML elements for corresponding docstrings. :arg container: the instance of the element who owns the string.
[ "Parses", "the", "docstrings", "from", "the", "specified", "string", "that", "is", "the", "contents", "of", "container", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L236-L268
50,585
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser._process_docgroup
def _process_docgroup(self, group, code_el, add=True): """Explodes the group members into a list; adds the group to the specified code element and updates the group value for each of the docstring elements in the group. :arg add: when true, docgroups must be unique in the code element; ...
python
def _process_docgroup(self, group, code_el, add=True): """Explodes the group members into a list; adds the group to the specified code element and updates the group value for each of the docstring elements in the group. :arg add: when true, docgroups must be unique in the code element; ...
[ "def", "_process_docgroup", "(", "self", ",", "group", ",", "code_el", ",", "add", "=", "True", ")", ":", "if", "group", ".", "name", "in", "code_el", ".", "groups", "and", "add", ":", "msg", ".", "warn", "(", "\"duplicate group names in code element {}\"", ...
Explodes the group members into a list; adds the group to the specified code element and updates the group value for each of the docstring elements in the group. :arg add: when true, docgroups must be unique in the code element; otherwise, existing groups are overwritten.
[ "Explodes", "the", "group", "members", "into", "a", "list", ";", "adds", "the", "group", "to", "the", "specified", "code", "element", "and", "updates", "the", "group", "value", "for", "each", "of", "the", "docstring", "elements", "in", "the", "group", "." ...
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L270-L286
50,586
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser.process_execdocs
def process_execdocs(self, docs, anexec, key, add=True): """Associates parameter documentation with parameters for the executable and any remaining docs with the executable itself. - key: the module.executable identifier for the function or subroutine. """ #Paramdocs has a list...
python
def process_execdocs(self, docs, anexec, key, add=True): """Associates parameter documentation with parameters for the executable and any remaining docs with the executable itself. - key: the module.executable identifier for the function or subroutine. """ #Paramdocs has a list...
[ "def", "process_execdocs", "(", "self", ",", "docs", ",", "anexec", ",", "key", ",", "add", "=", "True", ")", ":", "#Paramdocs has a list of docstrings for summary, usage, parameters, etc.", "#check which belong to parameters and associate them, otherwise append", "#them to the e...
Associates parameter documentation with parameters for the executable and any remaining docs with the executable itself. - key: the module.executable identifier for the function or subroutine.
[ "Associates", "parameter", "documentation", "with", "parameters", "for", "the", "executable", "and", "any", "remaining", "docs", "with", "the", "executable", "itself", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L288-L323
50,587
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser.process_memberdocs
def process_memberdocs(self, docs, codeEl, add=True): """Associates member type DocElements with their corresponding members in the specified code element. The element must have a dictionary of members already.""" #Now we need to associate the members with their docstrings ...
python
def process_memberdocs(self, docs, codeEl, add=True): """Associates member type DocElements with their corresponding members in the specified code element. The element must have a dictionary of members already.""" #Now we need to associate the members with their docstrings ...
[ "def", "process_memberdocs", "(", "self", ",", "docs", ",", "codeEl", ",", "add", "=", "True", ")", ":", "#Now we need to associate the members with their docstrings", "#Some of the members may be buried inside a group tag and", "#need to be handled separately.", "remainingdocs", ...
Associates member type DocElements with their corresponding members in the specified code element. The element must have a dictionary of members already.
[ "Associates", "member", "type", "DocElements", "with", "their", "corresponding", "members", "in", "the", "specified", "code", "element", ".", "The", "element", "must", "have", "a", "dictionary", "of", "members", "already", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L356-L380
50,588
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser._process_docstrings
def _process_docstrings(self, doc, members, add=True): """Adds the docstrings from the list of DocElements to their respective members. Returns true if the doc element belonged to a member.""" if ((doc.doctype == "member" or doc.doctype == "local") and doc.pointsto is not N...
python
def _process_docstrings(self, doc, members, add=True): """Adds the docstrings from the list of DocElements to their respective members. Returns true if the doc element belonged to a member.""" if ((doc.doctype == "member" or doc.doctype == "local") and doc.pointsto is not N...
[ "def", "_process_docstrings", "(", "self", ",", "doc", ",", "members", ",", "add", "=", "True", ")", ":", "if", "(", "(", "doc", ".", "doctype", "==", "\"member\"", "or", "doc", ".", "doctype", "==", "\"local\"", ")", "and", "doc", ".", "pointsto", "...
Adds the docstrings from the list of DocElements to their respective members. Returns true if the doc element belonged to a member.
[ "Adds", "the", "docstrings", "from", "the", "list", "of", "DocElements", "to", "their", "respective", "members", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L382-L396
50,589
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser.to_doc
def to_doc(self, xmllist, decorates): """Converts the specified xml list to a list of docstring elements.""" result = [] for xitem in xmllist: if xitem.tag != "group": #The docstring allows a single string to point to multiple #names in a comma-separat...
python
def to_doc(self, xmllist, decorates): """Converts the specified xml list to a list of docstring elements.""" result = [] for xitem in xmllist: if xitem.tag != "group": #The docstring allows a single string to point to multiple #names in a comma-separat...
[ "def", "to_doc", "(", "self", ",", "xmllist", ",", "decorates", ")", ":", "result", "=", "[", "]", "for", "xitem", "in", "xmllist", ":", "if", "xitem", ".", "tag", "!=", "\"group\"", ":", "#The docstring allows a single string to point to multiple", "#names in a...
Converts the specified xml list to a list of docstring elements.
[ "Converts", "the", "specified", "xml", "list", "to", "a", "list", "of", "docstring", "elements", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L398-L420
50,590
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser._parse_docblocks
def _parse_docblocks(self, string, container): """Parses all the docstrings out of the specified string. Returns a dictionary of docstrings with the key as parent.code_element_name and the value a list of XML elements that contain docstrings. """ #The easiest way to do this is t...
python
def _parse_docblocks(self, string, container): """Parses all the docstrings out of the specified string. Returns a dictionary of docstrings with the key as parent.code_element_name and the value a list of XML elements that contain docstrings. """ #The easiest way to do this is t...
[ "def", "_parse_docblocks", "(", "self", ",", "string", ",", "container", ")", ":", "#The easiest way to do this is to look at one line at a time and see if it is a docstring", "#When we find a group of docstrings that suddenly ends, the next item is the code element", "#that they were decora...
Parses all the docstrings out of the specified string. Returns a dictionary of docstrings with the key as parent.code_element_name and the value a list of XML elements that contain docstrings.
[ "Parses", "all", "the", "docstrings", "out", "of", "the", "specified", "string", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L422-L476
50,591
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser._parse_docline
def _parse_docline(self, line, container): """Parses a single line of code following a docblock to see if it as a valid code element that can be decorated. If so, return the name of the code element.""" match = self.RE_DECOR.match(line) if match is not None: return "{...
python
def _parse_docline(self, line, container): """Parses a single line of code following a docblock to see if it as a valid code element that can be decorated. If so, return the name of the code element.""" match = self.RE_DECOR.match(line) if match is not None: return "{...
[ "def", "_parse_docline", "(", "self", ",", "line", ",", "container", ")", ":", "match", "=", "self", ".", "RE_DECOR", ".", "match", "(", "line", ")", "if", "match", "is", "not", "None", ":", "return", "\"{}.{}\"", ".", "format", "(", "container", ".", ...
Parses a single line of code following a docblock to see if it as a valid code element that can be decorated. If so, return the name of the code element.
[ "Parses", "a", "single", "line", "of", "code", "following", "a", "docblock", "to", "see", "if", "it", "as", "a", "valid", "code", "element", "that", "can", "be", "decorated", ".", "If", "so", "return", "the", "name", "of", "the", "code", "element", "."...
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L478-L486
50,592
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser.parsexml
def parsexml(self, xmlstring, modules, source=None): """Parses the docstrings out of the specified xml file. :arg source: the path to the file from which the XML string was extracted. """ result = {} from fortpy.utility import XML_fromstring xmlroot = XML_fromstring(xml...
python
def parsexml(self, xmlstring, modules, source=None): """Parses the docstrings out of the specified xml file. :arg source: the path to the file from which the XML string was extracted. """ result = {} from fortpy.utility import XML_fromstring xmlroot = XML_fromstring(xml...
[ "def", "parsexml", "(", "self", ",", "xmlstring", ",", "modules", ",", "source", "=", "None", ")", ":", "result", "=", "{", "}", "from", "fortpy", ".", "utility", "import", "XML_fromstring", "xmlroot", "=", "XML_fromstring", "(", "xmlstring", ",", "source"...
Parses the docstrings out of the specified xml file. :arg source: the path to the file from which the XML string was extracted.
[ "Parses", "the", "docstrings", "out", "of", "the", "specified", "xml", "file", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L488-L531
50,593
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser._xml_update_modules
def _xml_update_modules(self, xmldict, modules): """Updates the docstrings in the specified modules by looking for docstrings in the xmldict.""" for kdecor in xmldict: modname, memname = kdecor.split(".") if modname in modules: module = modules[modname] ...
python
def _xml_update_modules(self, xmldict, modules): """Updates the docstrings in the specified modules by looking for docstrings in the xmldict.""" for kdecor in xmldict: modname, memname = kdecor.split(".") if modname in modules: module = modules[modname] ...
[ "def", "_xml_update_modules", "(", "self", ",", "xmldict", ",", "modules", ")", ":", "for", "kdecor", "in", "xmldict", ":", "modname", ",", "memname", "=", "kdecor", ".", "split", "(", "\".\"", ")", "if", "modname", "in", "modules", ":", "module", "=", ...
Updates the docstrings in the specified modules by looking for docstrings in the xmldict.
[ "Updates", "the", "docstrings", "in", "the", "specified", "modules", "by", "looking", "for", "docstrings", "in", "the", "xmldict", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L533-L557
50,594
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser.rt_update_module
def rt_update_module(self, xmldict, module): """Updates the members, executables and types in the specified module to have the latest docstring information from the xmldict. """ #This keeps track of how many character were added/removed by #updating the docstrings in xmldict. ...
python
def rt_update_module(self, xmldict, module): """Updates the members, executables and types in the specified module to have the latest docstring information from the xmldict. """ #This keeps track of how many character were added/removed by #updating the docstrings in xmldict. ...
[ "def", "rt_update_module", "(", "self", ",", "xmldict", ",", "module", ")", ":", "#This keeps track of how many character were added/removed by", "#updating the docstrings in xmldict.", "delta", "=", "0", "for", "kdecor", "in", "xmldict", ":", "if", "\".\"", "in", "kdec...
Updates the members, executables and types in the specified module to have the latest docstring information from the xmldict.
[ "Updates", "the", "members", "executables", "and", "types", "in", "the", "specified", "module", "to", "have", "the", "latest", "docstring", "information", "from", "the", "xmldict", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L559-L597
50,595
rosenbrockc/fortpy
fortpy/parsers/docstring.py
DocStringParser._rt_update_docindices
def _rt_update_docindices(self, element, docstart, docend): """Updates the docstart, docend, start and end attributes for the specified element using the new limits for the docstring.""" #see how many characters have to be added/removed from the end #of the current doc limits. d...
python
def _rt_update_docindices(self, element, docstart, docend): """Updates the docstart, docend, start and end attributes for the specified element using the new limits for the docstring.""" #see how many characters have to be added/removed from the end #of the current doc limits. d...
[ "def", "_rt_update_docindices", "(", "self", ",", "element", ",", "docstart", ",", "docend", ")", ":", "#see how many characters have to be added/removed from the end", "#of the current doc limits.", "delta", "=", "element", ".", "docend", "-", "docend", "element", ".", ...
Updates the docstart, docend, start and end attributes for the specified element using the new limits for the docstring.
[ "Updates", "the", "docstart", "docend", "start", "and", "end", "attributes", "for", "the", "specified", "element", "using", "the", "new", "limits", "for", "the", "docstring", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/parsers/docstring.py#L599-L610
50,596
ronniedada/tabula
tabula/painter.py
BlessingPainter.paint
def paint(self, tbl): """ Paint the table on terminal Currently only print out basic string format """ if not isinstance(tbl, Table): logging.error("unable to paint table: invalid object") return False self.term.stream.write(self.term.clear) ...
python
def paint(self, tbl): """ Paint the table on terminal Currently only print out basic string format """ if not isinstance(tbl, Table): logging.error("unable to paint table: invalid object") return False self.term.stream.write(self.term.clear) ...
[ "def", "paint", "(", "self", ",", "tbl", ")", ":", "if", "not", "isinstance", "(", "tbl", ",", "Table", ")", ":", "logging", ".", "error", "(", "\"unable to paint table: invalid object\"", ")", "return", "False", "self", ".", "term", ".", "stream", ".", ...
Paint the table on terminal Currently only print out basic string format
[ "Paint", "the", "table", "on", "terminal", "Currently", "only", "print", "out", "basic", "string", "format" ]
ba18bb2f7db75972256b950711415031dc5421c7
https://github.com/ronniedada/tabula/blob/ba18bb2f7db75972256b950711415031dc5421c7/tabula/painter.py#L33-L45
50,597
rosenbrockc/fortpy
fortpy/isense/cache.py
clear_caches
def clear_caches(delete_all=False): """Fortpy caches many things, that should be completed after each completion finishes. :param delete_all: Deletes also the cache that is normally not deleted, like parser cache, which is important for faster parsing. """ global _time_caches if delete...
python
def clear_caches(delete_all=False): """Fortpy caches many things, that should be completed after each completion finishes. :param delete_all: Deletes also the cache that is normally not deleted, like parser cache, which is important for faster parsing. """ global _time_caches if delete...
[ "def", "clear_caches", "(", "delete_all", "=", "False", ")", ":", "global", "_time_caches", "if", "delete_all", ":", "_time_caches", "=", "[", "]", "_parser", "=", "{", "\"default\"", ":", "CodeParser", "(", ")", "}", "else", ":", "# normally just kill the exp...
Fortpy caches many things, that should be completed after each completion finishes. :param delete_all: Deletes also the cache that is normally not deleted, like parser cache, which is important for faster parsing.
[ "Fortpy", "caches", "many", "things", "that", "should", "be", "completed", "after", "each", "completion", "finishes", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/cache.py#L31-L50
50,598
rosenbrockc/fortpy
fortpy/isense/cache.py
cache_call_signatures
def cache_call_signatures(source, user_pos, stmt): """This function calculates the cache key.""" index = user_pos[0] - 1 lines = source.splitlines() or [''] if source and source[-1] == '\n': lines.append('') before_cursor = lines[index][:user_pos[1]] other_lines = lines[stmt.start_pos[0...
python
def cache_call_signatures(source, user_pos, stmt): """This function calculates the cache key.""" index = user_pos[0] - 1 lines = source.splitlines() or [''] if source and source[-1] == '\n': lines.append('') before_cursor = lines[index][:user_pos[1]] other_lines = lines[stmt.start_pos[0...
[ "def", "cache_call_signatures", "(", "source", ",", "user_pos", ",", "stmt", ")", ":", "index", "=", "user_pos", "[", "0", "]", "-", "1", "lines", "=", "source", ".", "splitlines", "(", ")", "or", "[", "''", "]", "if", "source", "and", "source", "[",...
This function calculates the cache key.
[ "This", "function", "calculates", "the", "cache", "key", "." ]
1ed0757c52d549e41d9d44bdea68cb89529293a5
https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/isense/cache.py#L78-L91
50,599
PixelwarStudio/PyTree
Tree/utils.py
Node.make_new_node
def make_new_node(self, distance, angle): """Make a new node from an existing one. This method creates a new node with a distance and angle given. The position of the new node is calculated with: x2 = cos(-angle)*distance+x1 y2 = sin(-angle)*distance+y1 Args: ...
python
def make_new_node(self, distance, angle): """Make a new node from an existing one. This method creates a new node with a distance and angle given. The position of the new node is calculated with: x2 = cos(-angle)*distance+x1 y2 = sin(-angle)*distance+y1 Args: ...
[ "def", "make_new_node", "(", "self", ",", "distance", ",", "angle", ")", ":", "return", "Node", "(", "(", "cos", "(", "-", "angle", ")", "*", "distance", "+", "self", ".", "pos", "[", "0", "]", ",", "sin", "(", "-", "angle", ")", "*", "distance",...
Make a new node from an existing one. This method creates a new node with a distance and angle given. The position of the new node is calculated with: x2 = cos(-angle)*distance+x1 y2 = sin(-angle)*distance+y1 Args: distance (float): The distance of the original node...
[ "Make", "a", "new", "node", "from", "an", "existing", "one", "." ]
f14b25ea145da6b00d836e34251d2a4c823766dc
https://github.com/PixelwarStudio/PyTree/blob/f14b25ea145da6b00d836e34251d2a4c823766dc/Tree/utils.py#L26-L42