code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def _get_symbolic_function_initial_state(self, function_addr, fastpath_mode_state=None): """ Symbolically execute the first basic block of the specified function, then returns it. We prepares the state using the already existing state in fastpath mode (if avaiable). :param functi...
def function[_get_symbolic_function_initial_state, parameter[self, function_addr, fastpath_mode_state]]: constant[ Symbolically execute the first basic block of the specified function, then returns it. We prepares the state using the already existing state in fastpath mode (if avaiable)....
keyword[def] identifier[_get_symbolic_function_initial_state] ( identifier[self] , identifier[function_addr] , identifier[fastpath_mode_state] = keyword[None] ): literal[string] keyword[if] identifier[function_addr] keyword[is] keyword[None] : keyword[return] keyword[None] ...
def _get_symbolic_function_initial_state(self, function_addr, fastpath_mode_state=None): """ Symbolically execute the first basic block of the specified function, then returns it. We prepares the state using the already existing state in fastpath mode (if avaiable). :param function_a...
def plot_accuracy(data, output_dir_path='.', output_filename='accuracy.png', width=10, height=8): """Plot accuracy. Args: data: Panda dataframe in *the* format. """ output_path = os.path.join(output_dir_path, output_filename) max_val_data = get_epoch_max_val_acc(da...
def function[plot_accuracy, parameter[data, output_dir_path, output_filename, width, height]]: constant[Plot accuracy. Args: data: Panda dataframe in *the* format. ] variable[output_path] assign[=] call[name[os].path.join, parameter[name[output_dir_path], name[output_filename]]] ...
keyword[def] identifier[plot_accuracy] ( identifier[data] , identifier[output_dir_path] = literal[string] , identifier[output_filename] = literal[string] , identifier[width] = literal[int] , identifier[height] = literal[int] ): literal[string] identifier[output_path] = identifier[os] . identifier[path] . ...
def plot_accuracy(data, output_dir_path='.', output_filename='accuracy.png', width=10, height=8): """Plot accuracy. Args: data: Panda dataframe in *the* format. """ output_path = os.path.join(output_dir_path, output_filename) max_val_data = get_epoch_max_val_acc(data) max_val_lab...
def gpsWeek(year, month, day): "returns (full) gpsWeek for given date (in UTC)" hr = 12 #make sure you fall into right day, middle is save return gpsFromUTC(year, month, day, hr, 0, 0.0)[0]
def function[gpsWeek, parameter[year, month, day]]: constant[returns (full) gpsWeek for given date (in UTC)] variable[hr] assign[=] constant[12] return[call[call[name[gpsFromUTC], parameter[name[year], name[month], name[day], name[hr], constant[0], constant[0.0]]]][constant[0]]]
keyword[def] identifier[gpsWeek] ( identifier[year] , identifier[month] , identifier[day] ): literal[string] identifier[hr] = literal[int] keyword[return] identifier[gpsFromUTC] ( identifier[year] , identifier[month] , identifier[day] , identifier[hr] , literal[int] , literal[int] )[ literal[int] ]
def gpsWeek(year, month, day): """returns (full) gpsWeek for given date (in UTC)""" hr = 12 #make sure you fall into right day, middle is save return gpsFromUTC(year, month, day, hr, 0, 0.0)[0]
def depth(args): """ %prog depth anchorfile --qbed qbedfile --sbed sbedfile Calculate the depths in the two genomes in comparison, given in --qbed and --sbed. The synteny blocks will be layered on the genomes, and the multiplicity will be summarized to stderr. """ from jcvi.utils.range impo...
def function[depth, parameter[args]]: constant[ %prog depth anchorfile --qbed qbedfile --sbed sbedfile Calculate the depths in the two genomes in comparison, given in --qbed and --sbed. The synteny blocks will be layered on the genomes, and the multiplicity will be summarized to stderr. ] ...
keyword[def] identifier[depth] ( identifier[args] ): literal[string] keyword[from] identifier[jcvi] . identifier[utils] . identifier[range] keyword[import] identifier[range_depth] identifier[p] = identifier[OptionParser] ( identifier[depth] . identifier[__doc__] ) identifier[p] . identifier[...
def depth(args): """ %prog depth anchorfile --qbed qbedfile --sbed sbedfile Calculate the depths in the two genomes in comparison, given in --qbed and --sbed. The synteny blocks will be layered on the genomes, and the multiplicity will be summarized to stderr. """ from jcvi.utils.range impo...
def set_poolmember_state(self, id_pools, pools): """ Enable/Disable pool member by list """ data = dict() uri = "api/v3/pool/real/%s/member/status/" % ';'.join(id_pools) data["server_pools"] = pools return self.put(uri, data=data)
def function[set_poolmember_state, parameter[self, id_pools, pools]]: constant[ Enable/Disable pool member by list ] variable[data] assign[=] call[name[dict], parameter[]] variable[uri] assign[=] binary_operation[constant[api/v3/pool/real/%s/member/status/] <ast.Mod object at 0x7...
keyword[def] identifier[set_poolmember_state] ( identifier[self] , identifier[id_pools] , identifier[pools] ): literal[string] identifier[data] = identifier[dict] () identifier[uri] = literal[string] % literal[string] . identifier[join] ( identifier[id_pools] ) identifier[data]...
def set_poolmember_state(self, id_pools, pools): """ Enable/Disable pool member by list """ data = dict() uri = 'api/v3/pool/real/%s/member/status/' % ';'.join(id_pools) data['server_pools'] = pools return self.put(uri, data=data)
def image_task(self): """ Returns a json-schema document that represents an task entity. """ uri = "/%s/task" % self.uri_base resp, resp_body = self.api.method_get(uri) return resp_body
def function[image_task, parameter[self]]: constant[ Returns a json-schema document that represents an task entity. ] variable[uri] assign[=] binary_operation[constant[/%s/task] <ast.Mod object at 0x7da2590d6920> name[self].uri_base] <ast.Tuple object at 0x7da1b052a110> assign[=]...
keyword[def] identifier[image_task] ( identifier[self] ): literal[string] identifier[uri] = literal[string] % identifier[self] . identifier[uri_base] identifier[resp] , identifier[resp_body] = identifier[self] . identifier[api] . identifier[method_get] ( identifier[uri] ) keyword...
def image_task(self): """ Returns a json-schema document that represents an task entity. """ uri = '/%s/task' % self.uri_base (resp, resp_body) = self.api.method_get(uri) return resp_body
def put(bucket, path=None, return_bin=False, action=None, local_file=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None, headers=None, full_headers=False): ''' Create a new bucket, or upload an o...
def function[put, parameter[bucket, path, return_bin, action, local_file, key, keyid, service_url, verify_ssl, kms_keyid, location, role_arn, path_style, https_enable, headers, full_headers]]: constant[ Create a new bucket, or upload an object to a bucket. CLI Example to create a bucket: .. code-b...
keyword[def] identifier[put] ( identifier[bucket] , identifier[path] = keyword[None] , identifier[return_bin] = keyword[False] , identifier[action] = keyword[None] , identifier[local_file] = keyword[None] , identifier[key] = keyword[None] , identifier[keyid] = keyword[None] , identifier[service_url] = keyword[None] ...
def put(bucket, path=None, return_bin=False, action=None, local_file=None, key=None, keyid=None, service_url=None, verify_ssl=None, kms_keyid=None, location=None, role_arn=None, path_style=None, https_enable=None, headers=None, full_headers=False): """ Create a new bucket, or upload an object to a bucket. ...
def file_info(self, path): """Returns the file info for the given remote file :param path: path to the remote file :returns: file info :rtype: :class:`FileInfo` object or `None` if file was not found :raises: HTTPResponseError in case an HTTP error status was returne...
def function[file_info, parameter[self, path]]: constant[Returns the file info for the given remote file :param path: path to the remote file :returns: file info :rtype: :class:`FileInfo` object or `None` if file was not found :raises: HTTPResponseError in case an HT...
keyword[def] identifier[file_info] ( identifier[self] , identifier[path] ): literal[string] identifier[res] = identifier[self] . identifier[_make_dav_request] ( literal[string] , identifier[path] , identifier[headers] ={ literal[string] : literal[string] }) keyword[if] identifier[res] : ...
def file_info(self, path): """Returns the file info for the given remote file :param path: path to the remote file :returns: file info :rtype: :class:`FileInfo` object or `None` if file was not found :raises: HTTPResponseError in case an HTTP error status was returned ...
def unmounted(name, device=None, config='/etc/fstab', persist=False, user=None, **kwargs): ''' .. versionadded:: 0.17.0 Verify that a device is not mounted name The path to the location where the device is to be unmounted fr...
def function[unmounted, parameter[name, device, config, persist, user]]: constant[ .. versionadded:: 0.17.0 Verify that a device is not mounted name The path to the location where the device is to be unmounted from device The device to be unmounted. This is optional because t...
keyword[def] identifier[unmounted] ( identifier[name] , identifier[device] = keyword[None] , identifier[config] = literal[string] , identifier[persist] = keyword[False] , identifier[user] = keyword[None] , ** identifier[kwargs] ): literal[string] identifier[ret] ={ literal[string] : identifier[name] , ...
def unmounted(name, device=None, config='/etc/fstab', persist=False, user=None, **kwargs): """ .. versionadded:: 0.17.0 Verify that a device is not mounted name The path to the location where the device is to be unmounted from device The device to be unmounted. This is optional b...
def get_bucket(self, environment, name, filename, source): """Return a cache bucket for the given template. All arguments are mandatory but filename may be `None`. """ key = self.get_cache_key(name, filename) checksum = self.get_source_checksum(source) bucket = Bucket(en...
def function[get_bucket, parameter[self, environment, name, filename, source]]: constant[Return a cache bucket for the given template. All arguments are mandatory but filename may be `None`. ] variable[key] assign[=] call[name[self].get_cache_key, parameter[name[name], name[filename]]] ...
keyword[def] identifier[get_bucket] ( identifier[self] , identifier[environment] , identifier[name] , identifier[filename] , identifier[source] ): literal[string] identifier[key] = identifier[self] . identifier[get_cache_key] ( identifier[name] , identifier[filename] ) identifier[checksum]...
def get_bucket(self, environment, name, filename, source): """Return a cache bucket for the given template. All arguments are mandatory but filename may be `None`. """ key = self.get_cache_key(name, filename) checksum = self.get_source_checksum(source) bucket = Bucket(environment, key, ...
def get_crash_signature(error_line): """Try to get a crash signature from the given error_line string.""" search_term = None match = CRASH_RE.match(error_line) if match and is_helpful_search_term(match.group(1)): search_term = match.group(1) return search_term
def function[get_crash_signature, parameter[error_line]]: constant[Try to get a crash signature from the given error_line string.] variable[search_term] assign[=] constant[None] variable[match] assign[=] call[name[CRASH_RE].match, parameter[name[error_line]]] if <ast.BoolOp object at 0x7...
keyword[def] identifier[get_crash_signature] ( identifier[error_line] ): literal[string] identifier[search_term] = keyword[None] identifier[match] = identifier[CRASH_RE] . identifier[match] ( identifier[error_line] ) keyword[if] identifier[match] keyword[and] identifier[is_helpful_search_term...
def get_crash_signature(error_line): """Try to get a crash signature from the given error_line string.""" search_term = None match = CRASH_RE.match(error_line) if match and is_helpful_search_term(match.group(1)): search_term = match.group(1) # depends on [control=['if'], data=[]] return sea...
def fb_get(self, quant, fb=16): """Return a fixed bit number quant: number of bits to read fb: number of bits in the integer and decimal part of the output default is 16, resulting in a 16.16 fixed bit""" raw_number = self.s_get(quant) if quant == 1: # ...
def function[fb_get, parameter[self, quant, fb]]: constant[Return a fixed bit number quant: number of bits to read fb: number of bits in the integer and decimal part of the output default is 16, resulting in a 16.16 fixed bit] variable[raw_number] assign[=] call[name[self].s...
keyword[def] identifier[fb_get] ( identifier[self] , identifier[quant] , identifier[fb] = literal[int] ): literal[string] identifier[raw_number] = identifier[self] . identifier[s_get] ( identifier[quant] ) keyword[if] identifier[quant] == literal[int] : keyword[ret...
def fb_get(self, quant, fb=16): """Return a fixed bit number quant: number of bits to read fb: number of bits in the integer and decimal part of the output default is 16, resulting in a 16.16 fixed bit""" raw_number = self.s_get(quant) if quant == 1: # special case, just...
def getLogger(*args, **kwargs): """ Wrapper around ``logging.getLogger`` that respects `overrideLogLevel <#setOverrideLogLevel>`_. """ logger = logging.getLogger(*args, **kwargs) if _overrideLogLevel is not None: logger.setLevel(logging.NOTSET) return logger
def function[getLogger, parameter[]]: constant[ Wrapper around ``logging.getLogger`` that respects `overrideLogLevel <#setOverrideLogLevel>`_. ] variable[logger] assign[=] call[name[logging].getLogger, parameter[<ast.Starred object at 0x7da1b2344ee0>]] if compare[name[_overrideLogLevel] ...
keyword[def] identifier[getLogger] (* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[logger] = identifier[logging] . identifier[getLogger] (* identifier[args] ,** identifier[kwargs] ) keyword[if] identifier[_overrideLogLevel] keyword[is] keyword[not] keyword[None] : ...
def getLogger(*args, **kwargs): """ Wrapper around ``logging.getLogger`` that respects `overrideLogLevel <#setOverrideLogLevel>`_. """ logger = logging.getLogger(*args, **kwargs) if _overrideLogLevel is not None: logger.setLevel(logging.NOTSET) # depends on [control=['if'], data=[]] ret...
def JoinTokens(tokens): """Join tokens (which may be a mix of unicode and str values). See notes on unicode at the top. This function allows mixing encoded utf-8 byte string tokens with unicode tokens. (Python's default encoding is ASCII, and we don't want to change that.) We also want to support pure b...
def function[JoinTokens, parameter[tokens]]: constant[Join tokens (which may be a mix of unicode and str values). See notes on unicode at the top. This function allows mixing encoded utf-8 byte string tokens with unicode tokens. (Python's default encoding is ASCII, and we don't want to change that.) ...
keyword[def] identifier[JoinTokens] ( identifier[tokens] ): literal[string] keyword[try] : keyword[return] literal[string] . identifier[join] ( identifier[tokens] ) keyword[except] identifier[UnicodeDecodeError] : keyword[return] literal[string] . identifier[join] ( identifie...
def JoinTokens(tokens): """Join tokens (which may be a mix of unicode and str values). See notes on unicode at the top. This function allows mixing encoded utf-8 byte string tokens with unicode tokens. (Python's default encoding is ASCII, and we don't want to change that.) We also want to support pure b...
def readSentence(self): """ Read every word untill empty word (NULL byte) is received. :return: Reply word, tuple with read words. """ sentence = tuple(word for word in iter(self.readWord, b'')) self.log('--->', *sentence) reply_word, words = sentence[0], sentenc...
def function[readSentence, parameter[self]]: constant[ Read every word untill empty word (NULL byte) is received. :return: Reply word, tuple with read words. ] variable[sentence] assign[=] call[name[tuple], parameter[<ast.GeneratorExp object at 0x7da1b1083ca0>]] call[nam...
keyword[def] identifier[readSentence] ( identifier[self] ): literal[string] identifier[sentence] = identifier[tuple] ( identifier[word] keyword[for] identifier[word] keyword[in] identifier[iter] ( identifier[self] . identifier[readWord] , literal[string] )) identifier[self] . identifie...
def readSentence(self): """ Read every word untill empty word (NULL byte) is received. :return: Reply word, tuple with read words. """ sentence = tuple((word for word in iter(self.readWord, b''))) self.log('--->', *sentence) (reply_word, words) = (sentence[0], sentence[1:]) ...
def check_available_aac_encoders(): """Returns the available AAC encoders Returns ---------- codecs : list(str) List of available encoder codecs """ cmd = [ 'ffmpeg', '-v', 'error', '-codecs' ] output = sp.check_output(cmd) aac_codecs = [ x ...
def function[check_available_aac_encoders, parameter[]]: constant[Returns the available AAC encoders Returns ---------- codecs : list(str) List of available encoder codecs ] variable[cmd] assign[=] list[[<ast.Constant object at 0x7da1b04d9fc0>, <ast.Constant object at 0x7da1b04d...
keyword[def] identifier[check_available_aac_encoders] (): literal[string] identifier[cmd] =[ literal[string] , literal[string] , literal[string] , literal[string] ] identifier[output] = identifier[sp] . identifier[check_output] ( identifier[cmd] ) identifier[aac_codecs] =[ ...
def check_available_aac_encoders(): """Returns the available AAC encoders Returns ---------- codecs : list(str) List of available encoder codecs """ cmd = ['ffmpeg', '-v', 'error', '-codecs'] output = sp.check_output(cmd) aac_codecs = [x for x in output.splitlines() if 'AAC (Adv...
def normalize_so_name(name): """ Handle different types of python installations """ if "cpython" in name: return os.path.splitext(os.path.splitext(name)[0])[0] # XXX: Special handling for Fedora python2 distribution # See: https://github.com/python-rope/rope/issues/211 if name == "ti...
def function[normalize_so_name, parameter[name]]: constant[ Handle different types of python installations ] if compare[constant[cpython] in name[name]] begin[:] return[call[call[name[os].path.splitext, parameter[call[call[name[os].path.splitext, parameter[name[name]]]][constant[0]]]]][c...
keyword[def] identifier[normalize_so_name] ( identifier[name] ): literal[string] keyword[if] literal[string] keyword[in] identifier[name] : keyword[return] identifier[os] . identifier[path] . identifier[splitext] ( identifier[os] . identifier[path] . identifier[splitext] ( identifier[name] )[ ...
def normalize_so_name(name): """ Handle different types of python installations """ if 'cpython' in name: return os.path.splitext(os.path.splitext(name)[0])[0] # depends on [control=['if'], data=['name']] # XXX: Special handling for Fedora python2 distribution # See: https://github.com/...
def _is_version_duplicate(self): """ Define should new version be created for object or no. Reasons to provide custom check instead of default `ignore_revision_duplicates`: - no need to compare all revisions - it is OK if right object version exists in any revision; - need...
def function[_is_version_duplicate, parameter[self]]: constant[ Define should new version be created for object or no. Reasons to provide custom check instead of default `ignore_revision_duplicates`: - no need to compare all revisions - it is OK if right object version exists in any re...
keyword[def] identifier[_is_version_duplicate] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[id] keyword[is] keyword[None] : keyword[return] keyword[False] keyword[try] : identifier[latest_version] = identifier[Version] . ide...
def _is_version_duplicate(self): """ Define should new version be created for object or no. Reasons to provide custom check instead of default `ignore_revision_duplicates`: - no need to compare all revisions - it is OK if right object version exists in any revision; - need to ...
def download_series_gui(frame, urls, directory, min_file_size, max_file_size, no_redirects): """ called when user wants serial downloading """ # create directory to save files if not os.path.exists(directory): os.makedirs(directory) app = progress_class(frame, urls, directory, min_file_size, max_file_size, no_...
def function[download_series_gui, parameter[frame, urls, directory, min_file_size, max_file_size, no_redirects]]: constant[ called when user wants serial downloading ] if <ast.UnaryOp object at 0x7da207f002b0> begin[:] call[name[os].makedirs, parameter[name[directory]]] variabl...
keyword[def] identifier[download_series_gui] ( identifier[frame] , identifier[urls] , identifier[directory] , identifier[min_file_size] , identifier[max_file_size] , identifier[no_redirects] ): literal[string] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[direc...
def download_series_gui(frame, urls, directory, min_file_size, max_file_size, no_redirects): """ called when user wants serial downloading """ # create directory to save files if not os.path.exists(directory): os.makedirs(directory) # depends on [control=['if'], data=[]] app = progress_class(fra...
def create_typedef(self, typedef_name, unused=None, with_defaults=True): """returns string, that contains valid C++ code, that defines typedef to function type :param name: the desired name of typedef """ return free_function_type_t.TYPEDEF_NAME_TEMPLATE % { 'typede...
def function[create_typedef, parameter[self, typedef_name, unused, with_defaults]]: constant[returns string, that contains valid C++ code, that defines typedef to function type :param name: the desired name of typedef ] return[binary_operation[name[free_function_type_t].TYPEDEF_NAME...
keyword[def] identifier[create_typedef] ( identifier[self] , identifier[typedef_name] , identifier[unused] = keyword[None] , identifier[with_defaults] = keyword[True] ): literal[string] keyword[return] identifier[free_function_type_t] . identifier[TYPEDEF_NAME_TEMPLATE] %{ literal[string...
def create_typedef(self, typedef_name, unused=None, with_defaults=True): """returns string, that contains valid C++ code, that defines typedef to function type :param name: the desired name of typedef """ return free_function_type_t.TYPEDEF_NAME_TEMPLATE % {'typedef_name': typedef_name,...
def dragMoveEvent(self, event): """Reimplement Qt method""" index = self.indexAt(event.pos()) if index: dst = self.get_filename(index) if osp.isdir(dst): event.acceptProposedAction() else: event.ignore() else: ...
def function[dragMoveEvent, parameter[self, event]]: constant[Reimplement Qt method] variable[index] assign[=] call[name[self].indexAt, parameter[call[name[event].pos, parameter[]]]] if name[index] begin[:] variable[dst] assign[=] call[name[self].get_filename, parameter[name[inde...
keyword[def] identifier[dragMoveEvent] ( identifier[self] , identifier[event] ): literal[string] identifier[index] = identifier[self] . identifier[indexAt] ( identifier[event] . identifier[pos] ()) keyword[if] identifier[index] : identifier[dst] = identifier[self] . ident...
def dragMoveEvent(self, event): """Reimplement Qt method""" index = self.indexAt(event.pos()) if index: dst = self.get_filename(index) if osp.isdir(dst): event.acceptProposedAction() # depends on [control=['if'], data=[]] else: event.ignore() # depends on [c...
def next_occurrences(self, n=None, since=None): """Yield the next planned occurrences after the date "since" The `since` argument can be either a date or datetime onject. If not given, it defaults to the date of the last event that's already planned. If `n` is given, the result...
def function[next_occurrences, parameter[self, n, since]]: constant[Yield the next planned occurrences after the date "since" The `since` argument can be either a date or datetime onject. If not given, it defaults to the date of the last event that's already planned. If `n` is ...
keyword[def] identifier[next_occurrences] ( identifier[self] , identifier[n] = keyword[None] , identifier[since] = keyword[None] ): literal[string] identifier[scheme] = identifier[self] . identifier[recurrence_scheme] keyword[if] identifier[scheme] keyword[is] keyword[None] : ...
def next_occurrences(self, n=None, since=None): """Yield the next planned occurrences after the date "since" The `since` argument can be either a date or datetime onject. If not given, it defaults to the date of the last event that's already planned. If `n` is given, the result is ...
async def shutdown(self): """ Shut down this Looper. """ logger.display("Looper shutting down now...", extra={"cli": False}) self.running = False start = time.perf_counter() if not self.runFut.done(): await self.runFut self.stopall() lo...
<ast.AsyncFunctionDef object at 0x7da1b170c580>
keyword[async] keyword[def] identifier[shutdown] ( identifier[self] ): literal[string] identifier[logger] . identifier[display] ( literal[string] , identifier[extra] ={ literal[string] : keyword[False] }) identifier[self] . identifier[running] = keyword[False] identifier[start] ...
async def shutdown(self): """ Shut down this Looper. """ logger.display('Looper shutting down now...', extra={'cli': False}) self.running = False start = time.perf_counter() if not self.runFut.done(): await self.runFut # depends on [control=['if'], data=[]] self.stopall(...
def normalized(self): """ Return a version of this object represented entirely using integer values for the relative attributes. >>> relativedelta(days=1.5, hours=2).normalized() relativedelta(days=1, hours=14) :return: Returns a :class:`dateutil.relativedel...
def function[normalized, parameter[self]]: constant[ Return a version of this object represented entirely using integer values for the relative attributes. >>> relativedelta(days=1.5, hours=2).normalized() relativedelta(days=1, hours=14) :return: Returns a :...
keyword[def] identifier[normalized] ( identifier[self] ): literal[string] identifier[days] = identifier[int] ( identifier[self] . identifier[days] ) identifier[hours_f] = identifier[round] ( identifier[self] . identifier[hours] + literal[int] *( identifier[self] . identi...
def normalized(self): """ Return a version of this object represented entirely using integer values for the relative attributes. >>> relativedelta(days=1.5, hours=2).normalized() relativedelta(days=1, hours=14) :return: Returns a :class:`dateutil.relativedelta.r...
def getABCD(slh, a0=None, doubled_up=True): """Calculate the ABCD-linearization of an SLH model Return the A, B, C, D and (a, c) matrices that linearize an SLH model about a coherent displacement amplitude a0. The equations of motion and the input-output relation are then: dX = (A X + a) dt + B d...
def function[getABCD, parameter[slh, a0, doubled_up]]: constant[Calculate the ABCD-linearization of an SLH model Return the A, B, C, D and (a, c) matrices that linearize an SLH model about a coherent displacement amplitude a0. The equations of motion and the input-output relation are then: dX...
keyword[def] identifier[getABCD] ( identifier[slh] , identifier[a0] = keyword[None] , identifier[doubled_up] = keyword[True] ): literal[string] keyword[from] identifier[qnet] . identifier[algebra] . identifier[library] . identifier[fock_operators] keyword[import] identifier[Create] , identifier[Destroy]...
def getABCD(slh, a0=None, doubled_up=True): """Calculate the ABCD-linearization of an SLH model Return the A, B, C, D and (a, c) matrices that linearize an SLH model about a coherent displacement amplitude a0. The equations of motion and the input-output relation are then: dX = (A X + a) dt + B d...
def torecarray(*args, **kwargs): """ Convenient shorthand for ``toarray(*args, **kwargs).view(np.recarray)``. """ import numpy as np return toarray(*args, **kwargs).view(np.recarray)
def function[torecarray, parameter[]]: constant[ Convenient shorthand for ``toarray(*args, **kwargs).view(np.recarray)``. ] import module[numpy] as alias[np] return[call[call[name[toarray], parameter[<ast.Starred object at 0x7da204564490>]].view, parameter[name[np].recarray]]]
keyword[def] identifier[torecarray] (* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[import] identifier[numpy] keyword[as] identifier[np] keyword[return] identifier[toarray] (* identifier[args] ,** identifier[kwargs] ). identifier[view] ( identifier[np] . identifier[recarray...
def torecarray(*args, **kwargs): """ Convenient shorthand for ``toarray(*args, **kwargs).view(np.recarray)``. """ import numpy as np return toarray(*args, **kwargs).view(np.recarray)
def _output_validators(self): """Output common validator types based on usage.""" if self._walk_for_type('Boolean'): print("from .validators import boolean") if self._walk_for_type('Integer'): print("from .validators import integer") vlist = self.override.get_vali...
def function[_output_validators, parameter[self]]: constant[Output common validator types based on usage.] if call[name[self]._walk_for_type, parameter[constant[Boolean]]] begin[:] call[name[print], parameter[constant[from .validators import boolean]]] if call[name[self]._walk_fo...
keyword[def] identifier[_output_validators] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_walk_for_type] ( literal[string] ): identifier[print] ( literal[string] ) keyword[if] identifier[self] . identifier[_walk_for_type] ( literal[string] ...
def _output_validators(self): """Output common validator types based on usage.""" if self._walk_for_type('Boolean'): print('from .validators import boolean') # depends on [control=['if'], data=[]] if self._walk_for_type('Integer'): print('from .validators import integer') # depends on [con...
def small_factors(x, max_prime): """ Factorizing x up to max_prime limit. :param x: :param max_prime: :return: """ factors = DlogFprint.prime_factors(x, limit=max_prime) return DlogFprint.factor_list_to_map(factors)
def function[small_factors, parameter[x, max_prime]]: constant[ Factorizing x up to max_prime limit. :param x: :param max_prime: :return: ] variable[factors] assign[=] call[name[DlogFprint].prime_factors, parameter[name[x]]] return[call[name[DlogFprint].factor...
keyword[def] identifier[small_factors] ( identifier[x] , identifier[max_prime] ): literal[string] identifier[factors] = identifier[DlogFprint] . identifier[prime_factors] ( identifier[x] , identifier[limit] = identifier[max_prime] ) keyword[return] identifier[DlogFprint] . identifier[fact...
def small_factors(x, max_prime): """ Factorizing x up to max_prime limit. :param x: :param max_prime: :return: """ factors = DlogFprint.prime_factors(x, limit=max_prime) return DlogFprint.factor_list_to_map(factors)
def check_between(v_min, v_max, **params): """Checks parameters are in a specified range Parameters ---------- v_min : float, minimum allowed value (inclusive) v_max : float, maximum allowed value (inclusive) params : object Named arguments, parameters to be checked Raises -...
def function[check_between, parameter[v_min, v_max]]: constant[Checks parameters are in a specified range Parameters ---------- v_min : float, minimum allowed value (inclusive) v_max : float, maximum allowed value (inclusive) params : object Named arguments, parameters to be chec...
keyword[def] identifier[check_between] ( identifier[v_min] , identifier[v_max] ,** identifier[params] ): literal[string] keyword[for] identifier[p] keyword[in] identifier[params] : keyword[if] identifier[params] [ identifier[p] ]< identifier[v_min] keyword[or] identifier[params] [ identifier...
def check_between(v_min, v_max, **params): """Checks parameters are in a specified range Parameters ---------- v_min : float, minimum allowed value (inclusive) v_max : float, maximum allowed value (inclusive) params : object Named arguments, parameters to be checked Raises -...
def xVal(self): """ Return the ``<c:xVal>`` element for this series as an oxml element. This element contains the X values for this series. """ xml = self._xVal_tmpl.format(**{ 'nsdecls': ' %s' % nsdecls('c'), 'numRef_xml': self.numRef_xml( ...
def function[xVal, parameter[self]]: constant[ Return the ``<c:xVal>`` element for this series as an oxml element. This element contains the X values for this series. ] variable[xml] assign[=] call[name[self]._xVal_tmpl.format, parameter[]] return[call[name[parse_xml], parame...
keyword[def] identifier[xVal] ( identifier[self] ): literal[string] identifier[xml] = identifier[self] . identifier[_xVal_tmpl] . identifier[format] (**{ literal[string] : literal[string] % identifier[nsdecls] ( literal[string] ), literal[string] : identifier[self] . identifier[nu...
def xVal(self): """ Return the ``<c:xVal>`` element for this series as an oxml element. This element contains the X values for this series. """ xml = self._xVal_tmpl.format(**{'nsdecls': ' %s' % nsdecls('c'), 'numRef_xml': self.numRef_xml(self._series.x_values_ref, self._series.number_fo...
def get_stars_of_children_of(self, component): """ same as get_children_of except if any of the children are orbits, this will recursively follow the tree to return a list of all children (grandchildren, etc) stars under that orbit """ stars = self.get_stars() orbits = s...
def function[get_stars_of_children_of, parameter[self, component]]: constant[ same as get_children_of except if any of the children are orbits, this will recursively follow the tree to return a list of all children (grandchildren, etc) stars under that orbit ] variable[stars] ass...
keyword[def] identifier[get_stars_of_children_of] ( identifier[self] , identifier[component] ): literal[string] identifier[stars] = identifier[self] . identifier[get_stars] () identifier[orbits] = identifier[self] . identifier[get_orbits] () identifier[stars_children] =[] ...
def get_stars_of_children_of(self, component): """ same as get_children_of except if any of the children are orbits, this will recursively follow the tree to return a list of all children (grandchildren, etc) stars under that orbit """ stars = self.get_stars() orbits = self.get_orbit...
def hoverEnterEvent( self, event ): """ Prompts the tool tip for this node based on the inputed event. :param event | <QHoverEvent> """ # process the parent event super(XNode, self).hoverEnterEvent(event) # hover over a hotspot hotsp...
def function[hoverEnterEvent, parameter[self, event]]: constant[ Prompts the tool tip for this node based on the inputed event. :param event | <QHoverEvent> ] call[call[name[super], parameter[name[XNode], name[self]]].hoverEnterEvent, parameter[name[event]]] ...
keyword[def] identifier[hoverEnterEvent] ( identifier[self] , identifier[event] ): literal[string] identifier[super] ( identifier[XNode] , identifier[self] ). identifier[hoverEnterEvent] ( identifier[event] ) identifier[hotspot] = identifier[self] . identifier[hotspotAt]...
def hoverEnterEvent(self, event): """ Prompts the tool tip for this node based on the inputed event. :param event | <QHoverEvent> """ # process the parent event super(XNode, self).hoverEnterEvent(event) # hover over a hotspot hotspot = self.hotspotAt(event.pos()...
async def create_text_channel(self, name, *, overwrites=None, reason=None, **options): """|coro| A shortcut method to :meth:`Guild.create_text_channel` to create a :class:`TextChannel` in the category. """ return await self.guild.create_text_channel(name, overwrites=overwrites, category...
<ast.AsyncFunctionDef object at 0x7da1b20407f0>
keyword[async] keyword[def] identifier[create_text_channel] ( identifier[self] , identifier[name] ,*, identifier[overwrites] = keyword[None] , identifier[reason] = keyword[None] ,** identifier[options] ): literal[string] keyword[return] keyword[await] identifier[self] . identifier[guild] . ident...
async def create_text_channel(self, name, *, overwrites=None, reason=None, **options): """|coro| A shortcut method to :meth:`Guild.create_text_channel` to create a :class:`TextChannel` in the category. """ return await self.guild.create_text_channel(name, overwrites=overwrites, category=self, r...
def get_record_revisions(recid, from_date): """Get record revisions.""" try: from invenio.dbquery import run_sql except ImportError: from invenio.legacy.dbquery import run_sql return run_sql( 'SELECT job_date, marcxml ' 'FROM hstRECORD WHERE id_bibrec = %s AND job_date >...
def function[get_record_revisions, parameter[recid, from_date]]: constant[Get record revisions.] <ast.Try object at 0x7da1b013d180> return[call[name[run_sql], parameter[constant[SELECT job_date, marcxml FROM hstRECORD WHERE id_bibrec = %s AND job_date >= %s ORDER BY job_date ASC], tuple[[<ast.Name objec...
keyword[def] identifier[get_record_revisions] ( identifier[recid] , identifier[from_date] ): literal[string] keyword[try] : keyword[from] identifier[invenio] . identifier[dbquery] keyword[import] identifier[run_sql] keyword[except] identifier[ImportError] : keyword[from] identi...
def get_record_revisions(recid, from_date): """Get record revisions.""" try: from invenio.dbquery import run_sql # depends on [control=['try'], data=[]] except ImportError: from invenio.legacy.dbquery import run_sql # depends on [control=['except'], data=[]] return run_sql('SELECT job_...
def raster_statistics(raster_file): """Get basic statistics of raster data. Args: raster_file: raster file path. Returns: min, max, mean, std. """ ds = gdal_Open(raster_file) band = ds.GetRasterBand(1) minv, maxv, meanv, std = band.Comput...
def function[raster_statistics, parameter[raster_file]]: constant[Get basic statistics of raster data. Args: raster_file: raster file path. Returns: min, max, mean, std. ] variable[ds] assign[=] call[name[gdal_Open], parameter[name[raster_file]]] ...
keyword[def] identifier[raster_statistics] ( identifier[raster_file] ): literal[string] identifier[ds] = identifier[gdal_Open] ( identifier[raster_file] ) identifier[band] = identifier[ds] . identifier[GetRasterBand] ( literal[int] ) identifier[minv] , identifier[maxv] , identifie...
def raster_statistics(raster_file): """Get basic statistics of raster data. Args: raster_file: raster file path. Returns: min, max, mean, std. """ ds = gdal_Open(raster_file) band = ds.GetRasterBand(1) (minv, maxv, meanv, std) = band.ComputeStatistics(Fa...
def find_node_with_payload(self, point, point_payload, cur_node = None): """! @brief Find node with specified coordinates and payload. @details If node with specified parameters does not exist then None will be returned, otherwise required node will be returned. ...
def function[find_node_with_payload, parameter[self, point, point_payload, cur_node]]: constant[! @brief Find node with specified coordinates and payload. @details If node with specified parameters does not exist then None will be returned, otherwise required node will be retu...
keyword[def] identifier[find_node_with_payload] ( identifier[self] , identifier[point] , identifier[point_payload] , identifier[cur_node] = keyword[None] ): literal[string] identifier[rule_search] = keyword[lambda] identifier[node] , identifier[point] = identifier[point] , identifier[payload] ...
def find_node_with_payload(self, point, point_payload, cur_node=None): """! @brief Find node with specified coordinates and payload. @details If node with specified parameters does not exist then None will be returned, otherwise required node will be returned. @pa...
def ema(eqdata, **kwargs): """ Exponential moving average with the given span. Parameters ---------- eqdata : DataFrame Must have exactly 1 column on which to calculate EMA span : int, optional Span for exponential moving average. Cf. `pandas.stats.moments.ewma <http://...
def function[ema, parameter[eqdata]]: constant[ Exponential moving average with the given span. Parameters ---------- eqdata : DataFrame Must have exactly 1 column on which to calculate EMA span : int, optional Span for exponential moving average. Cf. `pandas.stats.moments.e...
keyword[def] identifier[ema] ( identifier[eqdata] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[len] ( identifier[eqdata] . identifier[shape] )> literal[int] keyword[and] identifier[eqdata] . identifier[shape] [ literal[int] ]!= literal[int] : identifier[_selection] = identif...
def ema(eqdata, **kwargs): """ Exponential moving average with the given span. Parameters ---------- eqdata : DataFrame Must have exactly 1 column on which to calculate EMA span : int, optional Span for exponential moving average. Cf. `pandas.stats.moments.ewma <http://...
async def get_files_to_delete(self) -> List[str]: """ Determine the files to delete when rolling over. """ dir_name, base_name = os.path.split(self.absolute_file_path) file_names = await self.loop.run_in_executor( None, lambda: os.listdir(dir_name) ) r...
<ast.AsyncFunctionDef object at 0x7da2049606d0>
keyword[async] keyword[def] identifier[get_files_to_delete] ( identifier[self] )-> identifier[List] [ identifier[str] ]: literal[string] identifier[dir_name] , identifier[base_name] = identifier[os] . identifier[path] . identifier[split] ( identifier[self] . identifier[absolute_file_path] ) ...
async def get_files_to_delete(self) -> List[str]: """ Determine the files to delete when rolling over. """ (dir_name, base_name) = os.path.split(self.absolute_file_path) file_names = await self.loop.run_in_executor(None, lambda : os.listdir(dir_name)) result = [] prefix = base_name +...
def set_http_port(port=80): ''' Configure the port HTTP should listen on CLI Example: .. code-block:: bash salt '*' ilo.set_http_port 8080 ''' _current = global_settings() if _current['Global Settings']['HTTP_PORT']['VALUE'] == port: return True _xml = """<RIBCL VERS...
def function[set_http_port, parameter[port]]: constant[ Configure the port HTTP should listen on CLI Example: .. code-block:: bash salt '*' ilo.set_http_port 8080 ] variable[_current] assign[=] call[name[global_settings], parameter[]] if compare[call[call[call[name[_cu...
keyword[def] identifier[set_http_port] ( identifier[port] = literal[int] ): literal[string] identifier[_current] = identifier[global_settings] () keyword[if] identifier[_current] [ literal[string] ][ literal[string] ][ literal[string] ]== identifier[port] : keyword[return] keyword[True] ...
def set_http_port(port=80): """ Configure the port HTTP should listen on CLI Example: .. code-block:: bash salt '*' ilo.set_http_port 8080 """ _current = global_settings() if _current['Global Settings']['HTTP_PORT']['VALUE'] == port: return True # depends on [control=['if...
def consume_vertices(self): """ Consumes all consecutive vertices. NOTE: There is no guarantee this will consume all vertices since other statements can also occur in the vertex list """ while True: # Vertex color if len(self.values) == 7: ...
def function[consume_vertices, parameter[self]]: constant[ Consumes all consecutive vertices. NOTE: There is no guarantee this will consume all vertices since other statements can also occur in the vertex list ] while constant[True] begin[:] if compare[cal...
keyword[def] identifier[consume_vertices] ( identifier[self] ): literal[string] keyword[while] keyword[True] : keyword[if] identifier[len] ( identifier[self] . identifier[values] )== literal[int] : keyword[yield] ( identifier[float] ( identi...
def consume_vertices(self): """ Consumes all consecutive vertices. NOTE: There is no guarantee this will consume all vertices since other statements can also occur in the vertex list """ while True: # Vertex color if len(self.values) == 7: yield (float...
def getDBusEndpoints(reactor, busAddress, client=True): """ Creates DBus endpoints. @param busAddress: 'session', 'system', or a valid bus address as defined by the DBus specification. If 'session' (the default) or 'system' is supplied, the contents of the DBUS_SESSION_BUS_ADDRESS or ...
def function[getDBusEndpoints, parameter[reactor, busAddress, client]]: constant[ Creates DBus endpoints. @param busAddress: 'session', 'system', or a valid bus address as defined by the DBus specification. If 'session' (the default) or 'system' is supplied, the contents of the DBUS_SES...
keyword[def] identifier[getDBusEndpoints] ( identifier[reactor] , identifier[busAddress] , identifier[client] = keyword[True] ): literal[string] keyword[if] identifier[busAddress] == literal[string] : identifier[addrString] = identifier[os] . identifier[environ] . identifier[get] ( literal[strin...
def getDBusEndpoints(reactor, busAddress, client=True): """ Creates DBus endpoints. @param busAddress: 'session', 'system', or a valid bus address as defined by the DBus specification. If 'session' (the default) or 'system' is supplied, the contents of the DBUS_SESSION_BUS_ADDRESS or ...
def labeled_accumulate(sequence, keygetter=operator.itemgetter(0), valuegetter=operator.itemgetter(1), accumulator=operator.add): """ Accumulates input elements according to accumulate(), but keeping certain data (per element, from the original sequence/iterable) in the target elements, like behaving as k...
def function[labeled_accumulate, parameter[sequence, keygetter, valuegetter, accumulator]]: constant[ Accumulates input elements according to accumulate(), but keeping certain data (per element, from the original sequence/iterable) in the target elements, like behaving as keys or legends. :param s...
keyword[def] identifier[labeled_accumulate] ( identifier[sequence] , identifier[keygetter] = identifier[operator] . identifier[itemgetter] ( literal[int] ), identifier[valuegetter] = identifier[operator] . identifier[itemgetter] ( literal[int] ), identifier[accumulator] = identifier[operator] . identifier[add] ): ...
def labeled_accumulate(sequence, keygetter=operator.itemgetter(0), valuegetter=operator.itemgetter(1), accumulator=operator.add): """ Accumulates input elements according to accumulate(), but keeping certain data (per element, from the original sequence/iterable) in the target elements, like behaving as k...
def signature_base_string(http_method, base_str_uri, normalized_encoded_request_parameters): """**Construct the signature base string.** Per `section 3.4.1.1`_ of the spec. For example, the HTTP request:: POST /request?b5=%3D%253D&a3=a&c%40=&a2=r%20b HTTP/1.1 Host...
def function[signature_base_string, parameter[http_method, base_str_uri, normalized_encoded_request_parameters]]: constant[**Construct the signature base string.** Per `section 3.4.1.1`_ of the spec. For example, the HTTP request:: POST /request?b5=%3D%253D&a3=a&c%40=&a2=r%20b HTTP/1.1 ...
keyword[def] identifier[signature_base_string] ( identifier[http_method] , identifier[base_str_uri] , identifier[normalized_encoded_request_parameters] ): literal[string] identifier[base_string] = identifier[utils] . identifier[escape] ( identifier[http_method] . ident...
def signature_base_string(http_method, base_str_uri, normalized_encoded_request_parameters): """**Construct the signature base string.** Per `section 3.4.1.1`_ of the spec. For example, the HTTP request:: POST /request?b5=%3D%253D&a3=a&c%40=&a2=r%20b HTTP/1.1 Host: example.com Cont...
def get_collection(self, url): """ Pages through an object collection from the bitbucket API. Returns an iterator that lazily goes through all the 'values' of all the pages in the collection. """ url = self.BASE_API2 + url while url is not None: response = self.get_da...
def function[get_collection, parameter[self, url]]: constant[ Pages through an object collection from the bitbucket API. Returns an iterator that lazily goes through all the 'values' of all the pages in the collection. ] variable[url] assign[=] binary_operation[name[self].BASE_API2 + nam...
keyword[def] identifier[get_collection] ( identifier[self] , identifier[url] ): literal[string] identifier[url] = identifier[self] . identifier[BASE_API2] + identifier[url] keyword[while] identifier[url] keyword[is] keyword[not] keyword[None] : identifier[response] = iden...
def get_collection(self, url): """ Pages through an object collection from the bitbucket API. Returns an iterator that lazily goes through all the 'values' of all the pages in the collection. """ url = self.BASE_API2 + url while url is not None: response = self.get_data(url) ...
def get_synset_by_id(self, mongo_id): ''' Builds a Synset object from the database entry with the given ObjectId. Arguments: - `mongo_id`: a bson.objectid.ObjectId object ''' cache_hit = None if self._synset_cache is not None: cache_hit = self...
def function[get_synset_by_id, parameter[self, mongo_id]]: constant[ Builds a Synset object from the database entry with the given ObjectId. Arguments: - `mongo_id`: a bson.objectid.ObjectId object ] variable[cache_hit] assign[=] constant[None] if compare...
keyword[def] identifier[get_synset_by_id] ( identifier[self] , identifier[mongo_id] ): literal[string] identifier[cache_hit] = keyword[None] keyword[if] identifier[self] . identifier[_synset_cache] keyword[is] keyword[not] keyword[None] : identifier[cache_hit] = identifie...
def get_synset_by_id(self, mongo_id): """ Builds a Synset object from the database entry with the given ObjectId. Arguments: - `mongo_id`: a bson.objectid.ObjectId object """ cache_hit = None if self._synset_cache is not None: cache_hit = self._synset_cache.g...
def rotated(self, angle_degrees_ccw): """Concatenates a rotation matrix on this matrix""" angle = angle_degrees_ccw / 180.0 * pi c, s = cos(angle), sin(angle) return self @ PdfMatrix((c, s, -s, c, 0, 0))
def function[rotated, parameter[self, angle_degrees_ccw]]: constant[Concatenates a rotation matrix on this matrix] variable[angle] assign[=] binary_operation[binary_operation[name[angle_degrees_ccw] / constant[180.0]] * name[pi]] <ast.Tuple object at 0x7da18ede4190> assign[=] tuple[[<ast.Call ob...
keyword[def] identifier[rotated] ( identifier[self] , identifier[angle_degrees_ccw] ): literal[string] identifier[angle] = identifier[angle_degrees_ccw] / literal[int] * identifier[pi] identifier[c] , identifier[s] = identifier[cos] ( identifier[angle] ), identifier[sin] ( identifier[angl...
def rotated(self, angle_degrees_ccw): """Concatenates a rotation matrix on this matrix""" angle = angle_degrees_ccw / 180.0 * pi (c, s) = (cos(angle), sin(angle)) return self @ PdfMatrix((c, s, -s, c, 0, 0))
def from_url(cls, url, **kwargs): """ Creates an instance of the KubeConfig class from a single URL (useful for interacting with kubectl proxy). """ doc = { "clusters": [ { "name": "self", "cluster": { ...
def function[from_url, parameter[cls, url]]: constant[ Creates an instance of the KubeConfig class from a single URL (useful for interacting with kubectl proxy). ] variable[doc] assign[=] dictionary[[<ast.Constant object at 0x7da1b06fecb0>, <ast.Constant object at 0x7da1b06fece0>...
keyword[def] identifier[from_url] ( identifier[cls] , identifier[url] ,** identifier[kwargs] ): literal[string] identifier[doc] ={ literal[string] :[ { literal[string] : literal[string] , literal[string] :{ literal[string] : identifier[url] , }, ...
def from_url(cls, url, **kwargs): """ Creates an instance of the KubeConfig class from a single URL (useful for interacting with kubectl proxy). """ doc = {'clusters': [{'name': 'self', 'cluster': {'server': url}}], 'contexts': [{'name': 'self', 'context': {'cluster': 'self'}}], 'current...
async def rollback(self): """Roll back this transaction.""" if not self._parent._is_active: return await self._do_rollback() self._is_active = False
<ast.AsyncFunctionDef object at 0x7da1b2262230>
keyword[async] keyword[def] identifier[rollback] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_parent] . identifier[_is_active] : keyword[return] keyword[await] identifier[self] . identifier[_do_rollback] () identif...
async def rollback(self): """Roll back this transaction.""" if not self._parent._is_active: return # depends on [control=['if'], data=[]] await self._do_rollback() self._is_active = False
def update(self): """Calculate the smoothing parameter values. The following example is explained in some detail in module |smoothtools|: >>> from hydpy import pub >>> pub.timegrids = '2000.01.01', '2000.01.03', '1d' >>> from hydpy.models.dam import * >>> parame...
def function[update, parameter[self]]: constant[Calculate the smoothing parameter values. The following example is explained in some detail in module |smoothtools|: >>> from hydpy import pub >>> pub.timegrids = '2000.01.01', '2000.01.03', '1d' >>> from hydpy.models.dam ...
keyword[def] identifier[update] ( identifier[self] ): literal[string] identifier[metapar] = identifier[self] . identifier[subpars] . identifier[pars] . identifier[control] . identifier[remotedischargesafety] identifier[self] . identifier[shape] = identifier[metapar] . identifier[shape] ...
def update(self): """Calculate the smoothing parameter values. The following example is explained in some detail in module |smoothtools|: >>> from hydpy import pub >>> pub.timegrids = '2000.01.01', '2000.01.03', '1d' >>> from hydpy.models.dam import * >>> parameters...
def _apply_filters(self, **filters): """Determine rows to keep in data for given set of filters Parameters ---------- filters: dict dictionary of filters ({col: values}}); uses a pseudo-regexp syntax by default, but accepts `regexp: True` to use regexp directly ...
def function[_apply_filters, parameter[self]]: constant[Determine rows to keep in data for given set of filters Parameters ---------- filters: dict dictionary of filters ({col: values}}); uses a pseudo-regexp syntax by default, but accepts `regexp: True` to use r...
keyword[def] identifier[_apply_filters] ( identifier[self] ,** identifier[filters] ): literal[string] identifier[regexp] = identifier[filters] . identifier[pop] ( literal[string] , keyword[False] ) identifier[keep] = identifier[np] . identifier[array] ([ keyword[True] ]* identifier[len] ( ...
def _apply_filters(self, **filters): """Determine rows to keep in data for given set of filters Parameters ---------- filters: dict dictionary of filters ({col: values}}); uses a pseudo-regexp syntax by default, but accepts `regexp: True` to use regexp directly ...
def get_connection(self, url, proxies=None): """Returns a urllib3 connection for the given URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. :param url: The URL to connect to. :pa...
def function[get_connection, parameter[self, url, proxies]]: constant[Returns a urllib3 connection for the given URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. :param url: The URL to c...
keyword[def] identifier[get_connection] ( identifier[self] , identifier[url] , identifier[proxies] = keyword[None] ): literal[string] identifier[proxy] = identifier[select_proxy] ( identifier[url] , identifier[proxies] ) keyword[if] identifier[proxy] : identifier[proxy] = id...
def get_connection(self, url, proxies=None): """Returns a urllib3 connection for the given URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. :param url: The URL to connect to. :param ...
def tcache(parser, token): """ This will cache the contents of a template fragment for a given amount of time with support tags. Usage:: {% tcache [expire_time] [fragment_name] [tags='tag1,tag2'] %} .. some expensive processing .. {% endtcache %} This tag also supports ...
def function[tcache, parameter[parser, token]]: constant[ This will cache the contents of a template fragment for a given amount of time with support tags. Usage:: {% tcache [expire_time] [fragment_name] [tags='tag1,tag2'] %} .. some expensive processing .. {% endtcache ...
keyword[def] identifier[tcache] ( identifier[parser] , identifier[token] ): literal[string] identifier[nodelist] = identifier[parser] . identifier[parse] (( literal[string] ,)) identifier[parser] . identifier[delete_first_token] () identifier[tokens] = identifier[token] . identifier[split_content...
def tcache(parser, token): """ This will cache the contents of a template fragment for a given amount of time with support tags. Usage:: {% tcache [expire_time] [fragment_name] [tags='tag1,tag2'] %} .. some expensive processing .. {% endtcache %} This tag also supports ...
def on_enter_fit_name(self, event): """ Allows the entering of new fit names in the fit combobox Parameters ---------- event : the wx.ComboBoxEvent that triggers this function Alters ------ current_fit.name """ if self.current_fit == None...
def function[on_enter_fit_name, parameter[self, event]]: constant[ Allows the entering of new fit names in the fit combobox Parameters ---------- event : the wx.ComboBoxEvent that triggers this function Alters ------ current_fit.name ] if...
keyword[def] identifier[on_enter_fit_name] ( identifier[self] , identifier[event] ): literal[string] keyword[if] identifier[self] . identifier[current_fit] == keyword[None] : identifier[self] . identifier[on_btn_add_fit] ( identifier[event] ) identifier[value] = identifier[se...
def on_enter_fit_name(self, event): """ Allows the entering of new fit names in the fit combobox Parameters ---------- event : the wx.ComboBoxEvent that triggers this function Alters ------ current_fit.name """ if self.current_fit == None: ...
def _reconnect(self): """Schedule the next connection attempt if the class is not currently closing. """ if self.idle or self.closed: LOGGER.debug('Attempting RabbitMQ reconnect in %s seconds', self.reconnect_delay) self.io_loop.call_late...
def function[_reconnect, parameter[self]]: constant[Schedule the next connection attempt if the class is not currently closing. ] if <ast.BoolOp object at 0x7da1b0cca830> begin[:] call[name[LOGGER].debug, parameter[constant[Attempting RabbitMQ reconnect in %s seconds], n...
keyword[def] identifier[_reconnect] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[idle] keyword[or] identifier[self] . identifier[closed] : identifier[LOGGER] . identifier[debug] ( literal[string] , identifier[self] . identifier[reconne...
def _reconnect(self): """Schedule the next connection attempt if the class is not currently closing. """ if self.idle or self.closed: LOGGER.debug('Attempting RabbitMQ reconnect in %s seconds', self.reconnect_delay) self.io_loop.call_later(self.reconnect_delay, self.connect) ...
def get_crop_size(crop_w, crop_h, image_w, image_h): """ Determines the correct scale size for the image when img w == crop w and img h > crop h Use these dimensions when img h == crop h and img w > crop w Use these dimensions """ scale1 = float(crop_w) / float(image_w) sca...
def function[get_crop_size, parameter[crop_w, crop_h, image_w, image_h]]: constant[ Determines the correct scale size for the image when img w == crop w and img h > crop h Use these dimensions when img h == crop h and img w > crop w Use these dimensions ] variable[scale...
keyword[def] identifier[get_crop_size] ( identifier[crop_w] , identifier[crop_h] , identifier[image_w] , identifier[image_h] ): literal[string] identifier[scale1] = identifier[float] ( identifier[crop_w] )/ identifier[float] ( identifier[image_w] ) identifier[scale2] = identifier[float] ( identifier[c...
def get_crop_size(crop_w, crop_h, image_w, image_h): """ Determines the correct scale size for the image when img w == crop w and img h > crop h Use these dimensions when img h == crop h and img w > crop w Use these dimensions """ scale1 = float(crop_w) / float(image_w) sca...
def getmtime(self, path=None, client_kwargs=None, header=None): """ Return the time of last access of path. Args: path (str): File path or URL. client_kwargs (dict): Client arguments. header (dict): Object header. Returns: float: The numb...
def function[getmtime, parameter[self, path, client_kwargs, header]]: constant[ Return the time of last access of path. Args: path (str): File path or URL. client_kwargs (dict): Client arguments. header (dict): Object header. Returns: flo...
keyword[def] identifier[getmtime] ( identifier[self] , identifier[path] = keyword[None] , identifier[client_kwargs] = keyword[None] , identifier[header] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[_getmtime_from_header] ( identifier[self] . identifier[...
def getmtime(self, path=None, client_kwargs=None, header=None): """ Return the time of last access of path. Args: path (str): File path or URL. client_kwargs (dict): Client arguments. header (dict): Object header. Returns: float: The number o...
def update(self, friendly_name=values.unset, identity=values.unset, deployment_sid=values.unset, enabled=values.unset): """ Update the DeviceInstance :param unicode friendly_name: A human readable description for this Device. :param unicode identity: An identifier of the ...
def function[update, parameter[self, friendly_name, identity, deployment_sid, enabled]]: constant[ Update the DeviceInstance :param unicode friendly_name: A human readable description for this Device. :param unicode identity: An identifier of the Device user. :param unicode depl...
keyword[def] identifier[update] ( identifier[self] , identifier[friendly_name] = identifier[values] . identifier[unset] , identifier[identity] = identifier[values] . identifier[unset] , identifier[deployment_sid] = identifier[values] . identifier[unset] , identifier[enabled] = identifier[values] . identifier[unset] ...
def update(self, friendly_name=values.unset, identity=values.unset, deployment_sid=values.unset, enabled=values.unset): """ Update the DeviceInstance :param unicode friendly_name: A human readable description for this Device. :param unicode identity: An identifier of the Device user. ...
def current_app(self): """ Return: dict(package, activity, pid?) Raises: RuntimeError """ # try: adb shell dumpsys activity top _activityRE = re.compile(r'ACTIVITY (?P<package>[^/]+)/(?P<activity>[^/\s]+) \w+ pid=(?P<pid>\d+)') m = _activityRE.search(s...
def function[current_app, parameter[self]]: constant[ Return: dict(package, activity, pid?) Raises: RuntimeError ] variable[_activityRE] assign[=] call[name[re].compile, parameter[constant[ACTIVITY (?P<package>[^/]+)/(?P<activity>[^/\s]+) \w+ pid=(?P<pid>\d+)]]] ...
keyword[def] identifier[current_app] ( identifier[self] ): literal[string] identifier[_activityRE] = identifier[re] . identifier[compile] ( literal[string] ) identifier[m] = identifier[_activityRE] . identifier[search] ( identifier[self] . identifier[shell] ( literal[string] , lit...
def current_app(self): """ Return: dict(package, activity, pid?) Raises: RuntimeError """ # try: adb shell dumpsys activity top _activityRE = re.compile('ACTIVITY (?P<package>[^/]+)/(?P<activity>[^/\\s]+) \\w+ pid=(?P<pid>\\d+)') m = _activityRE.search(self.shell('dum...
def get_cimobject_header(obj): """ Return the value for the CIM-XML extension header field 'CIMObject', using the given object. This function implements the rules defined in DSP0200 section 6.3.7 "CIMObject". The format of the CIMObject value is similar but not identical to a local WBEM URI (on...
def function[get_cimobject_header, parameter[obj]]: constant[ Return the value for the CIM-XML extension header field 'CIMObject', using the given object. This function implements the rules defined in DSP0200 section 6.3.7 "CIMObject". The format of the CIMObject value is similar but not identi...
keyword[def] identifier[get_cimobject_header] ( identifier[obj] ): literal[string] keyword[if] identifier[isinstance] ( identifier[obj] , identifier[six] . identifier[string_types] ): keyword[return] identifier[obj] keyword[if] identifier[isinstance] ( identifier[obj] , id...
def get_cimobject_header(obj): """ Return the value for the CIM-XML extension header field 'CIMObject', using the given object. This function implements the rules defined in DSP0200 section 6.3.7 "CIMObject". The format of the CIMObject value is similar but not identical to a local WBEM URI (on...
def from_json(cls, data): """Create a Design Day from a dictionary. Args: data = { "name": string, "day_type": string, "location": ladybug Location schema, "dry_bulb_condition": ladybug DryBulbCondition schema, "humidity_condition"...
def function[from_json, parameter[cls, data]]: constant[Create a Design Day from a dictionary. Args: data = { "name": string, "day_type": string, "location": ladybug Location schema, "dry_bulb_condition": ladybug DryBulbCondition schema, ...
keyword[def] identifier[from_json] ( identifier[cls] , identifier[data] ): literal[string] identifier[required_keys] =( literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] ) keyword[for] identifier[key] keyw...
def from_json(cls, data): """Create a Design Day from a dictionary. Args: data = { "name": string, "day_type": string, "location": ladybug Location schema, "dry_bulb_condition": ladybug DryBulbCondition schema, "humidity_condition": la...
def cee_map_priority_table_map_cos6_pgid(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") cee_map = ET.SubElement(config, "cee-map", xmlns="urn:brocade.com:mgmt:brocade-cee-map") name_key = ET.SubElement(cee_map, "name") name_key.text = kwargs.pop...
def function[cee_map_priority_table_map_cos6_pgid, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[cee_map] assign[=] call[name[ET].SubElement, parameter[name[config], constant[cee-map]]] var...
keyword[def] identifier[cee_map_priority_table_map_cos6_pgid] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[cee_map] = identifier[ET] . identifier[SubElement] ( identifier[config] , lite...
def cee_map_priority_table_map_cos6_pgid(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') cee_map = ET.SubElement(config, 'cee-map', xmlns='urn:brocade.com:mgmt:brocade-cee-map') name_key = ET.SubElement(cee_map, 'name') name_key.text = kwargs.pop('name') priorit...
def html_to_fc(html=None, clean_html=None, clean_visible=None, encoding=None, url=None, timestamp=None, other_features=None): '''`html` is expected to be a raw string received over the wire from a remote webserver, and `encoding`, if provided, is used to decode it. Typically, encoding comes ...
def function[html_to_fc, parameter[html, clean_html, clean_visible, encoding, url, timestamp, other_features]]: constant[`html` is expected to be a raw string received over the wire from a remote webserver, and `encoding`, if provided, is used to decode it. Typically, encoding comes from the Content-Ty...
keyword[def] identifier[html_to_fc] ( identifier[html] = keyword[None] , identifier[clean_html] = keyword[None] , identifier[clean_visible] = keyword[None] , identifier[encoding] = keyword[None] , identifier[url] = keyword[None] , identifier[timestamp] = keyword[None] , identifier[other_features] = keyword[None] ): ...
def html_to_fc(html=None, clean_html=None, clean_visible=None, encoding=None, url=None, timestamp=None, other_features=None): """`html` is expected to be a raw string received over the wire from a remote webserver, and `encoding`, if provided, is used to decode it. Typically, encoding comes from the Conten...
def process_all(self, texts:Collection[str]) -> List[List[str]]: "Process a list of `texts`." if self.n_cpus <= 1: return self._process_all_1(texts) with ProcessPoolExecutor(self.n_cpus) as e: return sum(e.map(self._process_all_1, partition_by_cores(texts, self.n_cpus)), [])
def function[process_all, parameter[self, texts]]: constant[Process a list of `texts`.] if compare[name[self].n_cpus less_or_equal[<=] constant[1]] begin[:] return[call[name[self]._process_all_1, parameter[name[texts]]]] with call[name[ProcessPoolExecutor], parameter[name[self].n_cpus]] ...
keyword[def] identifier[process_all] ( identifier[self] , identifier[texts] : identifier[Collection] [ identifier[str] ])-> identifier[List] [ identifier[List] [ identifier[str] ]]: literal[string] keyword[if] identifier[self] . identifier[n_cpus] <= literal[int] : keyword[return] identifier[self...
def process_all(self, texts: Collection[str]) -> List[List[str]]: """Process a list of `texts`.""" if self.n_cpus <= 1: return self._process_all_1(texts) # depends on [control=['if'], data=[]] with ProcessPoolExecutor(self.n_cpus) as e: return sum(e.map(self._process_all_1, partition_by_cor...
def _CheckLogFileSize(cursor): """Warns if MySQL log file size is not large enough for blob insertions.""" # Do not fail, because users might not be able to change this for their # database. Instead, warn the user about the impacts. innodb_log_file_size = int(_ReadVariable("innodb_log_file_size", cursor)) r...
def function[_CheckLogFileSize, parameter[cursor]]: constant[Warns if MySQL log file size is not large enough for blob insertions.] variable[innodb_log_file_size] assign[=] call[name[int], parameter[call[name[_ReadVariable], parameter[constant[innodb_log_file_size], name[cursor]]]]] variable[req...
keyword[def] identifier[_CheckLogFileSize] ( identifier[cursor] ): literal[string] identifier[innodb_log_file_size] = identifier[int] ( identifier[_ReadVariable] ( literal[string] , identifier[cursor] )) identifier[required_size] = literal[int] * identifier[mysql_blobs] . identifier[BLOB_CHUNK_SIZE]...
def _CheckLogFileSize(cursor): """Warns if MySQL log file size is not large enough for blob insertions.""" # Do not fail, because users might not be able to change this for their # database. Instead, warn the user about the impacts. innodb_log_file_size = int(_ReadVariable('innodb_log_file_size', cursor...
def metadata_converter_help(): """Help message for metadata converter Dialog. .. versionadded:: 4.3 :returns: A message object containing helpful information. :rtype: messaging.message.Message """ message = m.Message() message.add(m.Brand()) message.add(heading()) message.add(conte...
def function[metadata_converter_help, parameter[]]: constant[Help message for metadata converter Dialog. .. versionadded:: 4.3 :returns: A message object containing helpful information. :rtype: messaging.message.Message ] variable[message] assign[=] call[name[m].Message, parameter[]] ...
keyword[def] identifier[metadata_converter_help] (): literal[string] identifier[message] = identifier[m] . identifier[Message] () identifier[message] . identifier[add] ( identifier[m] . identifier[Brand] ()) identifier[message] . identifier[add] ( identifier[heading] ()) identifier[message] ...
def metadata_converter_help(): """Help message for metadata converter Dialog. .. versionadded:: 4.3 :returns: A message object containing helpful information. :rtype: messaging.message.Message """ message = m.Message() message.add(m.Brand()) message.add(heading()) message.add(conte...
def match_check(self, regex, fun): ''' Validate a single regex to function comparison, the function argument can be a list of functions. It is all or nothing for a list of functions ''' vals = [] if isinstance(fun, six.string_types): fun = [fun] ...
def function[match_check, parameter[self, regex, fun]]: constant[ Validate a single regex to function comparison, the function argument can be a list of functions. It is all or nothing for a list of functions ] variable[vals] assign[=] list[[]] if call[name[isinst...
keyword[def] identifier[match_check] ( identifier[self] , identifier[regex] , identifier[fun] ): literal[string] identifier[vals] =[] keyword[if] identifier[isinstance] ( identifier[fun] , identifier[six] . identifier[string_types] ): identifier[fun] =[ identifier[fun] ] ...
def match_check(self, regex, fun): """ Validate a single regex to function comparison, the function argument can be a list of functions. It is all or nothing for a list of functions """ vals = [] if isinstance(fun, six.string_types): fun = [fun] # depends on [control...
def pluralize(count, item_type): """Pluralizes the item_type if the count does not equal one. For example `pluralize(1, 'apple')` returns '1 apple', while `pluralize(0, 'apple') returns '0 apples'. :return The count and inflected item_type together as a string :rtype string """ def pluralize_string(x): ...
def function[pluralize, parameter[count, item_type]]: constant[Pluralizes the item_type if the count does not equal one. For example `pluralize(1, 'apple')` returns '1 apple', while `pluralize(0, 'apple') returns '0 apples'. :return The count and inflected item_type together as a string :rtype string ...
keyword[def] identifier[pluralize] ( identifier[count] , identifier[item_type] ): literal[string] keyword[def] identifier[pluralize_string] ( identifier[x] ): keyword[if] identifier[x] . identifier[endswith] ( literal[string] ): keyword[return] identifier[x] + literal[string] keyword[else]...
def pluralize(count, item_type): """Pluralizes the item_type if the count does not equal one. For example `pluralize(1, 'apple')` returns '1 apple', while `pluralize(0, 'apple') returns '0 apples'. :return The count and inflected item_type together as a string :rtype string """ def pluralize_string...
def collect(self, top, sup, argv=None, parent=""): """ means this element is part of a larger object, hence a property of that object """ try: #objekt = PyGroup("", root=top) (namespace, tag) = _namespace_and_tag(self, self.ref, top) try: ...
def function[collect, parameter[self, top, sup, argv, parent]]: constant[ means this element is part of a larger object, hence a property of that object ] <ast.Try object at 0x7da1b1d54910>
keyword[def] identifier[collect] ( identifier[self] , identifier[top] , identifier[sup] , identifier[argv] = keyword[None] , identifier[parent] = literal[string] ): literal[string] keyword[try] : ( identifier[namespace] , identifier[tag] )= identifier[_namespace_and_tag] ( ide...
def collect(self, top, sup, argv=None, parent=''): """ means this element is part of a larger object, hence a property of that object """ try: #objekt = PyGroup("", root=top) (namespace, tag) = _namespace_and_tag(self, self.ref, top) try: if self.xmlns_map[namespace]...
def __rmfile(path): """Delete a file. Args: path (str): Path to the file that needs to be deleted. Returns: bool: True if the operation is successful, False otherwise. """ logger.info("rmfile: %s" % path) try: os.remove(path) return True except Exception as ...
def function[__rmfile, parameter[path]]: constant[Delete a file. Args: path (str): Path to the file that needs to be deleted. Returns: bool: True if the operation is successful, False otherwise. ] call[name[logger].info, parameter[binary_operation[constant[rmfile: %s] <ast....
keyword[def] identifier[__rmfile] ( identifier[path] ): literal[string] identifier[logger] . identifier[info] ( literal[string] % identifier[path] ) keyword[try] : identifier[os] . identifier[remove] ( identifier[path] ) keyword[return] keyword[True] keyword[except] identifie...
def __rmfile(path): """Delete a file. Args: path (str): Path to the file that needs to be deleted. Returns: bool: True if the operation is successful, False otherwise. """ logger.info('rmfile: %s' % path) try: os.remove(path) return True # depends on [control=[...
def load_plugins(self, *args): """ Loads all plugins :param args: Arguments to pass to the plugins """ for manifest in self._manifests: self.load_plugin(manifest, *args)
def function[load_plugins, parameter[self]]: constant[ Loads all plugins :param args: Arguments to pass to the plugins ] for taget[name[manifest]] in starred[name[self]._manifests] begin[:] call[name[self].load_plugin, parameter[name[manifest], <ast.Starred objec...
keyword[def] identifier[load_plugins] ( identifier[self] ,* identifier[args] ): literal[string] keyword[for] identifier[manifest] keyword[in] identifier[self] . identifier[_manifests] : identifier[self] . identifier[load_plugin] ( identifier[manifest] ,* identifier[args] )
def load_plugins(self, *args): """ Loads all plugins :param args: Arguments to pass to the plugins """ for manifest in self._manifests: self.load_plugin(manifest, *args) # depends on [control=['for'], data=['manifest']]
def delete(self, response, **kwargs): ''' If a record matching the instance id exists in the database, delete it. ''' response_cls = self._get_instance(**kwargs) if response_cls: _action_and_commit(response_cls, session.delete)
def function[delete, parameter[self, response]]: constant[ If a record matching the instance id exists in the database, delete it. ] variable[response_cls] assign[=] call[name[self]._get_instance, parameter[]] if name[response_cls] begin[:] call[name[_action_and_c...
keyword[def] identifier[delete] ( identifier[self] , identifier[response] ,** identifier[kwargs] ): literal[string] identifier[response_cls] = identifier[self] . identifier[_get_instance] (** identifier[kwargs] ) keyword[if] identifier[response_cls] : identifier[_action_and_c...
def delete(self, response, **kwargs): """ If a record matching the instance id exists in the database, delete it. """ response_cls = self._get_instance(**kwargs) if response_cls: _action_and_commit(response_cls, session.delete) # depends on [control=['if'], data=[]]
def _get_music_services_data_xml(soco=None): """Fetch the music services data xml from a Sonos device. Args: soco (SoCo): a SoCo instance to query. If none is specified, a random device will be used. Defaults to `None`. Returns: str: a string containing the ...
def function[_get_music_services_data_xml, parameter[soco]]: constant[Fetch the music services data xml from a Sonos device. Args: soco (SoCo): a SoCo instance to query. If none is specified, a random device will be used. Defaults to `None`. Returns: str: a ...
keyword[def] identifier[_get_music_services_data_xml] ( identifier[soco] = keyword[None] ): literal[string] identifier[device] = identifier[soco] keyword[or] identifier[discovery] . identifier[any_soco] () identifier[log] . identifier[debug] ( literal[string] , identifier[device] ) ...
def _get_music_services_data_xml(soco=None): """Fetch the music services data xml from a Sonos device. Args: soco (SoCo): a SoCo instance to query. If none is specified, a random device will be used. Defaults to `None`. Returns: str: a string containing the musi...
def next_execution(args): """ Returns the next execution datetime of a DAG at the command line. >>> airflow next_execution tutorial 2018-08-31 10:38:00 """ dag = get_dag(args) if dag.is_paused: print("[INFO] Please be reminded this DAG is PAUSED now.") if dag.latest_execution_d...
def function[next_execution, parameter[args]]: constant[ Returns the next execution datetime of a DAG at the command line. >>> airflow next_execution tutorial 2018-08-31 10:38:00 ] variable[dag] assign[=] call[name[get_dag], parameter[name[args]]] if name[dag].is_paused begin[:] ...
keyword[def] identifier[next_execution] ( identifier[args] ): literal[string] identifier[dag] = identifier[get_dag] ( identifier[args] ) keyword[if] identifier[dag] . identifier[is_paused] : identifier[print] ( literal[string] ) keyword[if] identifier[dag] . identifier[latest_executi...
def next_execution(args): """ Returns the next execution datetime of a DAG at the command line. >>> airflow next_execution tutorial 2018-08-31 10:38:00 """ dag = get_dag(args) if dag.is_paused: print('[INFO] Please be reminded this DAG is PAUSED now.') # depends on [control=['if'], ...
def diagonal_basis_commutes(pauli_a, pauli_b): """ Test if `pauli_a` and `pauli_b` share a diagonal basis Example: Check if [A, B] with the constraint that A & B must share a one-qubit diagonalizing basis. If the inputs were [sZ(0), sZ(0) * sZ(1)] then this function would return Tr...
def function[diagonal_basis_commutes, parameter[pauli_a, pauli_b]]: constant[ Test if `pauli_a` and `pauli_b` share a diagonal basis Example: Check if [A, B] with the constraint that A & B must share a one-qubit diagonalizing basis. If the inputs were [sZ(0), sZ(0) * sZ(1)] then this ...
keyword[def] identifier[diagonal_basis_commutes] ( identifier[pauli_a] , identifier[pauli_b] ): literal[string] identifier[overlapping_active_qubits] = identifier[set] ( identifier[pauli_a] . identifier[get_qubits] ())& identifier[set] ( identifier[pauli_b] . identifier[get_qubits] ()) keyword[for] i...
def diagonal_basis_commutes(pauli_a, pauli_b): """ Test if `pauli_a` and `pauli_b` share a diagonal basis Example: Check if [A, B] with the constraint that A & B must share a one-qubit diagonalizing basis. If the inputs were [sZ(0), sZ(0) * sZ(1)] then this function would return Tr...
def _get_streams(self): """ Find the streams for vk.com :return: """ self.session.http.headers.update({'User-Agent': useragents.IPHONE_6}) # If this is a 'videos' catalog URL # with an video ID in the GET request, get that instead url = self.follow_vk_red...
def function[_get_streams, parameter[self]]: constant[ Find the streams for vk.com :return: ] call[name[self].session.http.headers.update, parameter[dictionary[[<ast.Constant object at 0x7da1b2344d30>], [<ast.Attribute object at 0x7da1b23454b0>]]]] variable[url] assign[=]...
keyword[def] identifier[_get_streams] ( identifier[self] ): literal[string] identifier[self] . identifier[session] . identifier[http] . identifier[headers] . identifier[update] ({ literal[string] : identifier[useragents] . identifier[IPHONE_6] }) identifier[url] = identi...
def _get_streams(self): """ Find the streams for vk.com :return: """ self.session.http.headers.update({'User-Agent': useragents.IPHONE_6}) # If this is a 'videos' catalog URL # with an video ID in the GET request, get that instead url = self.follow_vk_redirect(self.url) m...
def safe_mkdir(self, d): """If a directory doesn't exist, create it. If it does exist, print a warning to the logger. If it exists as a file, rais a FileExistsError :param d: directory path to create :type d: str """ if os.path.isfile(d): raise FileE...
def function[safe_mkdir, parameter[self, d]]: constant[If a directory doesn't exist, create it. If it does exist, print a warning to the logger. If it exists as a file, rais a FileExistsError :param d: directory path to create :type d: str ] if call[name[os].path...
keyword[def] identifier[safe_mkdir] ( identifier[self] , identifier[d] ): literal[string] keyword[if] identifier[os] . identifier[path] . identifier[isfile] ( identifier[d] ): keyword[raise] identifier[FileExistsError] ( literal[string] % identifier[d] ) keywo...
def safe_mkdir(self, d): """If a directory doesn't exist, create it. If it does exist, print a warning to the logger. If it exists as a file, rais a FileExistsError :param d: directory path to create :type d: str """ if os.path.isfile(d): raise FileExistsError('C...
def submit(self, command, blocksize, job_name="parsl.auto"): ''' Submits the command onto an Local Resource Manager job of blocksize parallel elements. Submit returns an ID that corresponds to the task that was just submitted. If tasks_per_node < 1: 1/tasks_per_node is provisioned...
def function[submit, parameter[self, command, blocksize, job_name]]: constant[ Submits the command onto an Local Resource Manager job of blocksize parallel elements. Submit returns an ID that corresponds to the task that was just submitted. If tasks_per_node < 1: 1/tasks_per_node ...
keyword[def] identifier[submit] ( identifier[self] , identifier[command] , identifier[blocksize] , identifier[job_name] = literal[string] ): literal[string] identifier[job_name] = literal[string] . identifier[format] ( identifier[job_name] , identifier[time] . identifier[time] ()) ...
def submit(self, command, blocksize, job_name='parsl.auto'): """ Submits the command onto an Local Resource Manager job of blocksize parallel elements. Submit returns an ID that corresponds to the task that was just submitted. If tasks_per_node < 1: 1/tasks_per_node is provisioned ...
def _format_files(cls, files, kind): '''Format the list of files (e. g. assistants or snippets''' lines = [] if files: lines.append('The following {kind} are contained in this DAP:'.format(kind=kind.title())) for f in files: lines.append('* ' + strip_prefi...
def function[_format_files, parameter[cls, files, kind]]: constant[Format the list of files (e. g. assistants or snippets] variable[lines] assign[=] list[[]] if name[files] begin[:] call[name[lines].append, parameter[call[constant[The following {kind} are contained in this DAP:]....
keyword[def] identifier[_format_files] ( identifier[cls] , identifier[files] , identifier[kind] ): literal[string] identifier[lines] =[] keyword[if] identifier[files] : identifier[lines] . identifier[append] ( literal[string] . identifier[format] ( identifier[kind] = identifi...
def _format_files(cls, files, kind): """Format the list of files (e. g. assistants or snippets""" lines = [] if files: lines.append('The following {kind} are contained in this DAP:'.format(kind=kind.title())) for f in files: lines.append('* ' + strip_prefix(f, kind).replace(os.pa...
def _resolve_subkeys(key, separator="."): """Resolve a potentially nested key. If the key contains the ``separator`` (e.g. ``.``) then the key will be split on the first instance of the subkey:: >>> _resolve_subkeys('a.b.c') ('a', 'b.c') >>> _resolve_subkeys('d|e|f', separator='|') ...
def function[_resolve_subkeys, parameter[key, separator]]: constant[Resolve a potentially nested key. If the key contains the ``separator`` (e.g. ``.``) then the key will be split on the first instance of the subkey:: >>> _resolve_subkeys('a.b.c') ('a', 'b.c') >>> _resolve_subkeys...
keyword[def] identifier[_resolve_subkeys] ( identifier[key] , identifier[separator] = literal[string] ): literal[string] identifier[parts] = identifier[key] . identifier[split] ( identifier[separator] , literal[int] ) keyword[if] identifier[len] ( identifier[parts] )> literal[int] : keyword...
def _resolve_subkeys(key, separator='.'): """Resolve a potentially nested key. If the key contains the ``separator`` (e.g. ``.``) then the key will be split on the first instance of the subkey:: >>> _resolve_subkeys('a.b.c') ('a', 'b.c') >>> _resolve_subkeys('d|e|f', separator='|') ...
def make_query(args, other=None, limit=None, strand=None, featuretype=None, extra=None, order_by=None, reverse=False, completely_within=False): """ Multi-purpose, bare-bones ORM function. This function composes queries given some commonly-used kwargs that can be passed to ...
def function[make_query, parameter[args, other, limit, strand, featuretype, extra, order_by, reverse, completely_within]]: constant[ Multi-purpose, bare-bones ORM function. This function composes queries given some commonly-used kwargs that can be passed to FeatureDB methods (like .parents(), .chil...
keyword[def] identifier[make_query] ( identifier[args] , identifier[other] = keyword[None] , identifier[limit] = keyword[None] , identifier[strand] = keyword[None] , identifier[featuretype] = keyword[None] , identifier[extra] = keyword[None] , identifier[order_by] = keyword[None] , identifier[reverse] = keyword[Fals...
def make_query(args, other=None, limit=None, strand=None, featuretype=None, extra=None, order_by=None, reverse=False, completely_within=False): """ Multi-purpose, bare-bones ORM function. This function composes queries given some commonly-used kwargs that can be passed to FeatureDB methods (like .paren...
def deep_documents(self): """ list of all documents find in subtrees of this node """ tree = [] for entry in self.contents: if isinstance(entry, Document): tree.append(entry) else: tree += entry.deep_documents return...
def function[deep_documents, parameter[self]]: constant[ list of all documents find in subtrees of this node ] variable[tree] assign[=] list[[]] for taget[name[entry]] in starred[name[self].contents] begin[:] if call[name[isinstance], parameter[name[entry], name[D...
keyword[def] identifier[deep_documents] ( identifier[self] ): literal[string] identifier[tree] =[] keyword[for] identifier[entry] keyword[in] identifier[self] . identifier[contents] : keyword[if] identifier[isinstance] ( identifier[entry] , identifier[Document] ): ...
def deep_documents(self): """ list of all documents find in subtrees of this node """ tree = [] for entry in self.contents: if isinstance(entry, Document): tree.append(entry) # depends on [control=['if'], data=[]] else: tree += entry.deep_documents #...
def model_performance(self, test_data=None, train=False, valid=False, xval=False): """ Generate model metrics for this model on test_data. :param test_data: Data set for which model metrics shall be computed against. All three of train, valid and xval arguments are ignored if test_d...
def function[model_performance, parameter[self, test_data, train, valid, xval]]: constant[ Generate model metrics for this model on test_data. :param test_data: Data set for which model metrics shall be computed against. All three of train, valid and xval arguments are ignored if te...
keyword[def] identifier[model_performance] ( identifier[self] , identifier[test_data] = keyword[None] , identifier[train] = keyword[False] , identifier[valid] = keyword[False] , identifier[xval] = keyword[False] ): literal[string] keyword[return] { identifier[model] . identifier[model_id] : identif...
def model_performance(self, test_data=None, train=False, valid=False, xval=False): """ Generate model metrics for this model on test_data. :param test_data: Data set for which model metrics shall be computed against. All three of train, valid and xval arguments are ignored if test_data ...
def __FindSupportedVersion(protocol, server, port, path, preferredApiVersions, sslContext): """ Private method that returns the most preferred API version supported by the specified server, @param protocol: What protocol to use for the connection (e.g. https or http). @type protocol: string @param s...
def function[__FindSupportedVersion, parameter[protocol, server, port, path, preferredApiVersions, sslContext]]: constant[ Private method that returns the most preferred API version supported by the specified server, @param protocol: What protocol to use for the connection (e.g. https or http). @ty...
keyword[def] identifier[__FindSupportedVersion] ( identifier[protocol] , identifier[server] , identifier[port] , identifier[path] , identifier[preferredApiVersions] , identifier[sslContext] ): literal[string] identifier[serviceVersionDescription] = identifier[__GetServiceVersionDescription] ( identifier[pro...
def __FindSupportedVersion(protocol, server, port, path, preferredApiVersions, sslContext): """ Private method that returns the most preferred API version supported by the specified server, @param protocol: What protocol to use for the connection (e.g. https or http). @type protocol: string @param ...
def has_role(self, role): """Returns `True` if the user identifies with the specified role. :param role: A role name or `Role` instance""" if isinstance(role, string_types): return role in (role.name for role in self.roles) else: return role in self.roles
def function[has_role, parameter[self, role]]: constant[Returns `True` if the user identifies with the specified role. :param role: A role name or `Role` instance] if call[name[isinstance], parameter[name[role], name[string_types]]] begin[:] return[compare[name[role] in <ast.GeneratorEx...
keyword[def] identifier[has_role] ( identifier[self] , identifier[role] ): literal[string] keyword[if] identifier[isinstance] ( identifier[role] , identifier[string_types] ): keyword[return] identifier[role] keyword[in] ( identifier[role] . identifier[name] keyword[for] identifier...
def has_role(self, role): """Returns `True` if the user identifies with the specified role. :param role: A role name or `Role` instance""" if isinstance(role, string_types): return role in (role.name for role in self.roles) # depends on [control=['if'], data=[]] else: return role i...
def corruptVector(v1, noiseLevel, numActiveCols): """ Corrupts a copy of a binary vector by inverting noiseLevel percent of its bits. @param v1 (array) binary vector whose copy will be corrupted @param noiseLevel (float) amount of noise to be applied on the new vector @param numActiveCols (int) num...
def function[corruptVector, parameter[v1, noiseLevel, numActiveCols]]: constant[ Corrupts a copy of a binary vector by inverting noiseLevel percent of its bits. @param v1 (array) binary vector whose copy will be corrupted @param noiseLevel (float) amount of noise to be applied on the new vector ...
keyword[def] identifier[corruptVector] ( identifier[v1] , identifier[noiseLevel] , identifier[numActiveCols] ): literal[string] identifier[size] = identifier[len] ( identifier[v1] ) identifier[v2] = identifier[np] . identifier[zeros] ( identifier[size] , identifier[dtype] = literal[string] ) identifier[b...
def corruptVector(v1, noiseLevel, numActiveCols): """ Corrupts a copy of a binary vector by inverting noiseLevel percent of its bits. @param v1 (array) binary vector whose copy will be corrupted @param noiseLevel (float) amount of noise to be applied on the new vector @param numActiveCols (int) n...
def commit_config(self): """ If replacement operation, perform 'configure replace' for the entire config. If merge operation, perform copy <file> running-config. """ # Always generate a rollback config on commit self._gen_rollback_cfg() if self.config_replace: ...
def function[commit_config, parameter[self]]: constant[ If replacement operation, perform 'configure replace' for the entire config. If merge operation, perform copy <file> running-config. ] call[name[self]._gen_rollback_cfg, parameter[]] if name[self].config_replace beg...
keyword[def] identifier[commit_config] ( identifier[self] ): literal[string] identifier[self] . identifier[_gen_rollback_cfg] () keyword[if] identifier[self] . identifier[config_replace] : identifier[filename] = identifier[self] . identifier[candidate_cfg] ...
def commit_config(self): """ If replacement operation, perform 'configure replace' for the entire config. If merge operation, perform copy <file> running-config. """ # Always generate a rollback config on commit self._gen_rollback_cfg() if self.config_replace: # Replace ...
def get_times_from_cli(cli_token): """Convert a CLI token to a datetime tuple. Argument: cli_token (str): an isoformat datetime token ([ISO date]:[ISO date]) or a special value among: * thisday * thisweek * thismonth * thisyear...
def function[get_times_from_cli, parameter[cli_token]]: constant[Convert a CLI token to a datetime tuple. Argument: cli_token (str): an isoformat datetime token ([ISO date]:[ISO date]) or a special value among: * thisday * thisweek * thism...
keyword[def] identifier[get_times_from_cli] ( identifier[cli_token] ): literal[string] identifier[today] = identifier[datetime] . identifier[date] . identifier[today] () keyword[if] identifier[cli_token] == literal[string] : keyword[return] identifier[today] , identifier[today] keywo...
def get_times_from_cli(cli_token): """Convert a CLI token to a datetime tuple. Argument: cli_token (str): an isoformat datetime token ([ISO date]:[ISO date]) or a special value among: * thisday * thisweek * thismonth * thisyear...
def decrypt(self, orig_pkt, assoclen=None): """decrypt a MACsec frame for this Secure Association""" hdr = copy.deepcopy(orig_pkt) del hdr[MACsec].payload pktlen = len(orig_pkt) if self.send_sci: hdrlen = NOSCI_LEN + SCI_LEN else: hdrlen = NOSCI_LE...
def function[decrypt, parameter[self, orig_pkt, assoclen]]: constant[decrypt a MACsec frame for this Secure Association] variable[hdr] assign[=] call[name[copy].deepcopy, parameter[name[orig_pkt]]] <ast.Delete object at 0x7da1b1fcb7c0> variable[pktlen] assign[=] call[name[len], parameter[nam...
keyword[def] identifier[decrypt] ( identifier[self] , identifier[orig_pkt] , identifier[assoclen] = keyword[None] ): literal[string] identifier[hdr] = identifier[copy] . identifier[deepcopy] ( identifier[orig_pkt] ) keyword[del] identifier[hdr] [ identifier[MACsec] ]. identifier[payload] ...
def decrypt(self, orig_pkt, assoclen=None): """decrypt a MACsec frame for this Secure Association""" hdr = copy.deepcopy(orig_pkt) del hdr[MACsec].payload pktlen = len(orig_pkt) if self.send_sci: hdrlen = NOSCI_LEN + SCI_LEN # depends on [control=['if'], data=[]] else: hdrlen = ...
def _get_ema(cls, df, column, windows): """ get exponential moving average :param df: data :param column: column to calculate :param windows: collection of window of exponential moving average :return: None """ window = cls.get_only_one_positive_int(windo...
def function[_get_ema, parameter[cls, df, column, windows]]: constant[ get exponential moving average :param df: data :param column: column to calculate :param windows: collection of window of exponential moving average :return: None ] variable[window] assign[=] ...
keyword[def] identifier[_get_ema] ( identifier[cls] , identifier[df] , identifier[column] , identifier[windows] ): literal[string] identifier[window] = identifier[cls] . identifier[get_only_one_positive_int] ( identifier[windows] ) identifier[column_name] = literal[string] . identifier[...
def _get_ema(cls, df, column, windows): """ get exponential moving average :param df: data :param column: column to calculate :param windows: collection of window of exponential moving average :return: None """ window = cls.get_only_one_positive_int(windows) column_n...
def _plot(self): """Plot all dots for series""" r_max = min( self.view.x(1) - self.view.x(0), (self.view.y(0) or 0) - self.view.y(1) ) / (2 * 1.05) for serie in self.series: self.dot(serie, r_max)
def function[_plot, parameter[self]]: constant[Plot all dots for series] variable[r_max] assign[=] binary_operation[call[name[min], parameter[binary_operation[call[name[self].view.x, parameter[constant[1]]] - call[name[self].view.x, parameter[constant[0]]]], binary_operation[<ast.BoolOp object at 0x7da2...
keyword[def] identifier[_plot] ( identifier[self] ): literal[string] identifier[r_max] = identifier[min] ( identifier[self] . identifier[view] . identifier[x] ( literal[int] )- identifier[self] . identifier[view] . identifier[x] ( literal[int] ), ( identifier[self] . identifier[vie...
def _plot(self): """Plot all dots for series""" r_max = min(self.view.x(1) - self.view.x(0), (self.view.y(0) or 0) - self.view.y(1)) / (2 * 1.05) for serie in self.series: self.dot(serie, r_max) # depends on [control=['for'], data=['serie']]
def discharge(self): """Discharge of the element in each layer """ rv = np.zeros(self.aq[0].naq) Qls = self.parameters[:, 0] * self.dischargeinf() Qls.shape = (self.nls, self.nlayers, self.order + 1) Qls = np.sum(Qls, 2) for i, q in enumerate(Qls): ...
def function[discharge, parameter[self]]: constant[Discharge of the element in each layer ] variable[rv] assign[=] call[name[np].zeros, parameter[call[name[self].aq][constant[0]].naq]] variable[Qls] assign[=] binary_operation[call[name[self].parameters][tuple[[<ast.Slice object at 0x7da1...
keyword[def] identifier[discharge] ( identifier[self] ): literal[string] identifier[rv] = identifier[np] . identifier[zeros] ( identifier[self] . identifier[aq] [ literal[int] ]. identifier[naq] ) identifier[Qls] = identifier[self] . identifier[parameters] [:, literal[int] ]* identifier[s...
def discharge(self): """Discharge of the element in each layer """ rv = np.zeros(self.aq[0].naq) Qls = self.parameters[:, 0] * self.dischargeinf() Qls.shape = (self.nls, self.nlayers, self.order + 1) Qls = np.sum(Qls, 2) for (i, q) in enumerate(Qls): rv[self.layers[i]] += q # de...
def simplesurface(idf, bsd, deletebsd=True, setto000=False): """convert a bsd (buildingsurface:detailed) into a simple surface""" funcs = (wallexterior, walladiabatic, wallunderground, wallinterzone, roof, ceilingadiabatic, ceilinginterzone, floorgroundcon...
def function[simplesurface, parameter[idf, bsd, deletebsd, setto000]]: constant[convert a bsd (buildingsurface:detailed) into a simple surface] variable[funcs] assign[=] tuple[[<ast.Name object at 0x7da2041db4c0>, <ast.Name object at 0x7da2041da380>, <ast.Name object at 0x7da2041dbd90>, <ast.Name object...
keyword[def] identifier[simplesurface] ( identifier[idf] , identifier[bsd] , identifier[deletebsd] = keyword[True] , identifier[setto000] = keyword[False] ): literal[string] identifier[funcs] =( identifier[wallexterior] , identifier[walladiabatic] , identifier[wallunderground] , identifier[w...
def simplesurface(idf, bsd, deletebsd=True, setto000=False): """convert a bsd (buildingsurface:detailed) into a simple surface""" funcs = (wallexterior, walladiabatic, wallunderground, wallinterzone, roof, ceilingadiabatic, ceilinginterzone, floorgroundcontact, flooradiabatic, floorinterzone) for func in fu...
def voxelize_ray(mesh, pitch, per_cell=[2, 2], **kwargs): """ Voxelize a mesh using ray queries. Parameters ------------- mesh : Trimesh object Mesh to be voxelized pitch : float Length of voxel cube ...
def function[voxelize_ray, parameter[mesh, pitch, per_cell]]: constant[ Voxelize a mesh using ray queries. Parameters ------------- mesh : Trimesh object Mesh to be voxelized pitch : float Length of voxel cube per_cell : (2,) int ...
keyword[def] identifier[voxelize_ray] ( identifier[mesh] , identifier[pitch] , identifier[per_cell] =[ literal[int] , literal[int] ], ** identifier[kwargs] ): literal[string] identifier[per_cell] = identifier[np] . identifier[array] ( identifier[per_cell] ). identifier[astype] ( identifier[np] . ide...
def voxelize_ray(mesh, pitch, per_cell=[2, 2], **kwargs): """ Voxelize a mesh using ray queries. Parameters ------------- mesh : Trimesh object Mesh to be voxelized pitch : float Length of voxel cube per_cell : (2,) int How many ray ...
def get_node_details(self, node_id: list) -> dict: """Get details of a node. Only the manager nodes can retrieve details of a node Args: node_id (list): List of node ID Returns: dict, details of the node """ # Raise an exception if we are not a...
def function[get_node_details, parameter[self, node_id]]: constant[Get details of a node. Only the manager nodes can retrieve details of a node Args: node_id (list): List of node ID Returns: dict, details of the node ] if <ast.UnaryOp object at...
keyword[def] identifier[get_node_details] ( identifier[self] , identifier[node_id] : identifier[list] )-> identifier[dict] : literal[string] keyword[if] keyword[not] identifier[self] . identifier[_manager] : keyword[raise] identifier[RuntimeError] ( literal[string] ...
def get_node_details(self, node_id: list) -> dict: """Get details of a node. Only the manager nodes can retrieve details of a node Args: node_id (list): List of node ID Returns: dict, details of the node """ # Raise an exception if we are not a manager...
def children(self): """ Returns list of children changesets. """ rev_filter = settings.GIT_REV_FILTER cmd = "rev-list %s --children | grep '^%s'" % (rev_filter, self.raw_id) so, se = self.repository.run_git_command(cmd) children = [] for l in so.splitline...
def function[children, parameter[self]]: constant[ Returns list of children changesets. ] variable[rev_filter] assign[=] name[settings].GIT_REV_FILTER variable[cmd] assign[=] binary_operation[constant[rev-list %s --children | grep '^%s'] <ast.Mod object at 0x7da2590d6920> tuple[[...
keyword[def] identifier[children] ( identifier[self] ): literal[string] identifier[rev_filter] = identifier[settings] . identifier[GIT_REV_FILTER] identifier[cmd] = literal[string] %( identifier[rev_filter] , identifier[self] . identifier[raw_id] ) identifier[so] , identifier[se]...
def children(self): """ Returns list of children changesets. """ rev_filter = settings.GIT_REV_FILTER cmd = "rev-list %s --children | grep '^%s'" % (rev_filter, self.raw_id) (so, se) = self.repository.run_git_command(cmd) children = [] for l in so.splitlines(): childs = l...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'word_count') and self.word_count is not None: _dict['word_count'] = self.word_count if hasattr(self, 'character_count') and self.character_count is not ...
def function[_to_dict, parameter[self]]: constant[Return a json dictionary representing this model.] variable[_dict] assign[=] dictionary[[], []] if <ast.BoolOp object at 0x7da1b1b47940> begin[:] call[name[_dict]][constant[word_count]] assign[=] name[self].word_count if <...
keyword[def] identifier[_to_dict] ( identifier[self] ): literal[string] identifier[_dict] ={} keyword[if] identifier[hasattr] ( identifier[self] , literal[string] ) keyword[and] identifier[self] . identifier[word_count] keyword[is] keyword[not] keyword[None] : identifier[...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'word_count') and self.word_count is not None: _dict['word_count'] = self.word_count # depends on [control=['if'], data=[]] if hasattr(self, 'character_count') and self.character_count is not...
def account_overview(object): """Create layout for user profile""" return Layout( Container( Row( Column2( Panel( 'Avatar', Img(src="{}{}".format(settings.MEDIA_URL, object.avatar)), c...
def function[account_overview, parameter[object]]: constant[Create layout for user profile] return[call[name[Layout], parameter[call[name[Container], parameter[call[name[Row], parameter[call[name[Column2], parameter[call[name[Panel], parameter[constant[Avatar], call[name[Img], parameter[]]]]]], call[name[Co...
keyword[def] identifier[account_overview] ( identifier[object] ): literal[string] keyword[return] identifier[Layout] ( identifier[Container] ( identifier[Row] ( identifier[Column2] ( identifier[Panel] ( literal[string] , identifier[Img] ( identifier[src] = literal[string] . i...
def account_overview(object): """Create layout for user profile""" return Layout(Container(Row(Column2(Panel('Avatar', Img(src='{}{}'.format(settings.MEDIA_URL, object.avatar)), collapse=True)), Column10(Panel('Account information', DescriptionList('email', 'first_name', 'last_name'))))))
def _column_type(values, has_invisible=True): """The least generic type all column values are convertible to. >>> _column_type(["1", "2"]) is _int_type True >>> _column_type(["1", "2.3"]) is _float_type True >>> _column_type(["1", "2.3", "four"]) is _text_type True >>> _column_type(["fo...
def function[_column_type, parameter[values, has_invisible]]: constant[The least generic type all column values are convertible to. >>> _column_type(["1", "2"]) is _int_type True >>> _column_type(["1", "2.3"]) is _float_type True >>> _column_type(["1", "2.3", "four"]) is _text_type True...
keyword[def] identifier[_column_type] ( identifier[values] , identifier[has_invisible] = keyword[True] ): literal[string] keyword[return] identifier[reduce] ( identifier[_more_generic] ,[ identifier[type] ( identifier[v] ) keyword[for] identifier[v] keyword[in] identifier[values] ], identifier[int] )
def _column_type(values, has_invisible=True): """The least generic type all column values are convertible to. >>> _column_type(["1", "2"]) is _int_type True >>> _column_type(["1", "2.3"]) is _float_type True >>> _column_type(["1", "2.3", "four"]) is _text_type True >>> _column_type(["fo...
def spm_hrf_compat(t, peak_delay=6, under_delay=16, peak_disp=1, under_disp=1, p_u_ratio=6, normalize=True, ): """ SPM HRF function from sum of two gamma PDFs This function is de...
def function[spm_hrf_compat, parameter[t, peak_delay, under_delay, peak_disp, under_disp, p_u_ratio, normalize]]: constant[ SPM HRF function from sum of two gamma PDFs This function is designed to be partially compatible with SPMs `spm_hrf.m` function. The SPN HRF is a *peak* gamma PDF (with locat...
keyword[def] identifier[spm_hrf_compat] ( identifier[t] , identifier[peak_delay] = literal[int] , identifier[under_delay] = literal[int] , identifier[peak_disp] = literal[int] , identifier[under_disp] = literal[int] , identifier[p_u_ratio] = literal[int] , identifier[normalize] = keyword[True] , ): literal...
def spm_hrf_compat(t, peak_delay=6, under_delay=16, peak_disp=1, under_disp=1, p_u_ratio=6, normalize=True): """ SPM HRF function from sum of two gamma PDFs This function is designed to be partially compatible with SPMs `spm_hrf.m` function. The SPN HRF is a *peak* gamma PDF (with location `peak_delay...
def set_auto_shutoff(self, timer): """ :param timer: an int, one of [None (never), -1, 30, 60, 120] :return: nothing """ values = { "desired_state": { "auto_shutoff": timer } } response = self.api_interface.set_dev...
def function[set_auto_shutoff, parameter[self, timer]]: constant[ :param timer: an int, one of [None (never), -1, 30, 60, 120] :return: nothing ] variable[values] assign[=] dictionary[[<ast.Constant object at 0x7da1b2631660>], [<ast.Dict object at 0x7da1b26322c0>]] variab...
keyword[def] identifier[set_auto_shutoff] ( identifier[self] , identifier[timer] ): literal[string] identifier[values] ={ literal[string] :{ literal[string] : identifier[timer] } } identifier[response] = identifier[self] . identifier[api_interface]...
def set_auto_shutoff(self, timer): """ :param timer: an int, one of [None (never), -1, 30, 60, 120] :return: nothing """ values = {'desired_state': {'auto_shutoff': timer}} response = self.api_interface.set_device_state(self, values) self._update_state_from_response(response)