code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def getLTime(): """Returns a formatted string with the current local time.""" _ltime = _time.localtime(_time.time()) tlm_str = _time.strftime('%H:%M:%S (%d/%m/%Y)', _ltime) return tlm_str
def function[getLTime, parameter[]]: constant[Returns a formatted string with the current local time.] variable[_ltime] assign[=] call[name[_time].localtime, parameter[call[name[_time].time, parameter[]]]] variable[tlm_str] assign[=] call[name[_time].strftime, parameter[constant[%H:%M:%S (%d/%m/...
keyword[def] identifier[getLTime] (): literal[string] identifier[_ltime] = identifier[_time] . identifier[localtime] ( identifier[_time] . identifier[time] ()) identifier[tlm_str] = identifier[_time] . identifier[strftime] ( literal[string] , identifier[_ltime] ) keyword[return] identifier[tlm_...
def getLTime(): """Returns a formatted string with the current local time.""" _ltime = _time.localtime(_time.time()) tlm_str = _time.strftime('%H:%M:%S (%d/%m/%Y)', _ltime) return tlm_str
def _next_id(self): """ Return the next available slide ID as an int. Valid slide IDs start at 256. The next integer value greater than the max value in use is chosen, which minimizes that chance of reusing the id of a deleted slide. """ id_str_lst = self.xpath('....
def function[_next_id, parameter[self]]: constant[ Return the next available slide ID as an int. Valid slide IDs start at 256. The next integer value greater than the max value in use is chosen, which minimizes that chance of reusing the id of a deleted slide. ] v...
keyword[def] identifier[_next_id] ( identifier[self] ): literal[string] identifier[id_str_lst] = identifier[self] . identifier[xpath] ( literal[string] ) keyword[return] identifier[max] ([ literal[int] ]+[ identifier[int] ( identifier[id_str] ) keyword[for] identifier[id_str] keyword[in...
def _next_id(self): """ Return the next available slide ID as an int. Valid slide IDs start at 256. The next integer value greater than the max value in use is chosen, which minimizes that chance of reusing the id of a deleted slide. """ id_str_lst = self.xpath('./p:sldId...
def _execute(self, command, # type: str args, # type: List[str] env_vars=None, # type: EnvVars shim=None # type: OptStr ): # type: (...) -> Tuple[int, bytes, bytes] """Execute a pip command with ...
def function[_execute, parameter[self, command, args, env_vars, shim]]: constant[Execute a pip command with the given arguments.] variable[main_args] assign[=] binary_operation[list[[<ast.Name object at 0x7da2054a4d90>]] + name[args]] call[name[logger].debug, parameter[constant[calling pip %s], ...
keyword[def] identifier[_execute] ( identifier[self] , identifier[command] , identifier[args] , identifier[env_vars] = keyword[None] , identifier[shim] = keyword[None] ): literal[string] identifier[main_args] =[ identifier[command] ]+ identifier[args] identifier[logger] . identifier...
def _execute(self, command, args, env_vars=None, shim=None): # type: str # type: List[str] # type: EnvVars # type: OptStr # type: (...) -> Tuple[int, bytes, bytes] 'Execute a pip command with the given arguments.' main_args = [command] + args logger.debug('calling pip %s', ' '.join(main_arg...
def del_stream(self, bucket, label): '''Delete a bitstream. This needs more testing - file deletion in a zipfile is problematic. Alternate method is to create second zipfile without the files in question, which is not a nice method for large zip archives. ''' if self.exists(bucke...
def function[del_stream, parameter[self, bucket, label]]: constant[Delete a bitstream. This needs more testing - file deletion in a zipfile is problematic. Alternate method is to create second zipfile without the files in question, which is not a nice method for large zip archives. ] ...
keyword[def] identifier[del_stream] ( identifier[self] , identifier[bucket] , identifier[label] ): literal[string] keyword[if] identifier[self] . identifier[exists] ( identifier[bucket] , identifier[label] ): identifier[name] = identifier[self] . identifier[_zf] ( identifier[bucket] ,...
def del_stream(self, bucket, label): """Delete a bitstream. This needs more testing - file deletion in a zipfile is problematic. Alternate method is to create second zipfile without the files in question, which is not a nice method for large zip archives. """ if self.exists(bucket, label...
def calc_mdl(yx_dist, y_dist): """ Function calculates mdl with given label distributions. yx_dist: list of dictionaries - for every split it contains a dictionary with label distributions y_dist: dictionary - all label distributions Reference: Igor Kononenko. On biases in estimating mult...
def function[calc_mdl, parameter[yx_dist, y_dist]]: constant[ Function calculates mdl with given label distributions. yx_dist: list of dictionaries - for every split it contains a dictionary with label distributions y_dist: dictionary - all label distributions Reference: Igor Kononenk...
keyword[def] identifier[calc_mdl] ( identifier[yx_dist] , identifier[y_dist] ): literal[string] identifier[prior] = identifier[multinomLog2] ( identifier[y_dist] . identifier[values] ()) identifier[prior] += identifier[multinomLog2] ([ identifier[len] ( identifier[y_dist] . identifier[keys] ())- liter...
def calc_mdl(yx_dist, y_dist): """ Function calculates mdl with given label distributions. yx_dist: list of dictionaries - for every split it contains a dictionary with label distributions y_dist: dictionary - all label distributions Reference: Igor Kononenko. On biases in estimating mult...
def record_modify_subfield(rec, tag, subfield_code, value, subfield_position, field_position_global=None, field_position_local=None): """Modify subfield at specified position. Specify the subfield by tag, field number and subfield position. """ subf...
def function[record_modify_subfield, parameter[rec, tag, subfield_code, value, subfield_position, field_position_global, field_position_local]]: constant[Modify subfield at specified position. Specify the subfield by tag, field number and subfield position. ] variable[subfields] assign[=] call[...
keyword[def] identifier[record_modify_subfield] ( identifier[rec] , identifier[tag] , identifier[subfield_code] , identifier[value] , identifier[subfield_position] , identifier[field_position_global] = keyword[None] , identifier[field_position_local] = keyword[None] ): literal[string] identifier[subfield...
def record_modify_subfield(rec, tag, subfield_code, value, subfield_position, field_position_global=None, field_position_local=None): """Modify subfield at specified position. Specify the subfield by tag, field number and subfield position. """ subfields = record_get_subfields(rec, tag, field_position_...
def get_program_python(cmd): """Get the full path to a python version linked to the command. Allows finding python based programs in python 2 versus python 3 environments. """ full_cmd = os.path.realpath(which(cmd)) cmd_python = os.path.join(os.path.dirname(full_cmd), "python") env_python =...
def function[get_program_python, parameter[cmd]]: constant[Get the full path to a python version linked to the command. Allows finding python based programs in python 2 versus python 3 environments. ] variable[full_cmd] assign[=] call[name[os].path.realpath, parameter[call[name[which], para...
keyword[def] identifier[get_program_python] ( identifier[cmd] ): literal[string] identifier[full_cmd] = identifier[os] . identifier[path] . identifier[realpath] ( identifier[which] ( identifier[cmd] )) identifier[cmd_python] = identifier[os] . identifier[path] . identifier[join] ( identifier[os] . ide...
def get_program_python(cmd): """Get the full path to a python version linked to the command. Allows finding python based programs in python 2 versus python 3 environments. """ full_cmd = os.path.realpath(which(cmd)) cmd_python = os.path.join(os.path.dirname(full_cmd), 'python') env_python =...
def fso_readlink(self, path): 'overlays os.readlink()' path = self.deref(path, to_parent=True) st = self.fso_lstat(path) if not stat.S_ISLNK(st.st_mode): raise OSError(22, 'Invalid argument', path) if st.st_overlay: return self.entries[path].content return self.originals['os:readlink...
def function[fso_readlink, parameter[self, path]]: constant[overlays os.readlink()] variable[path] assign[=] call[name[self].deref, parameter[name[path]]] variable[st] assign[=] call[name[self].fso_lstat, parameter[name[path]]] if <ast.UnaryOp object at 0x7da1b004be80> begin[:] <...
keyword[def] identifier[fso_readlink] ( identifier[self] , identifier[path] ): literal[string] identifier[path] = identifier[self] . identifier[deref] ( identifier[path] , identifier[to_parent] = keyword[True] ) identifier[st] = identifier[self] . identifier[fso_lstat] ( identifier[path] ) keywor...
def fso_readlink(self, path): """overlays os.readlink()""" path = self.deref(path, to_parent=True) st = self.fso_lstat(path) if not stat.S_ISLNK(st.st_mode): raise OSError(22, 'Invalid argument', path) # depends on [control=['if'], data=[]] if st.st_overlay: return self.entries[path...
def high(data, test=None, queue=False, **kwargs): ''' Execute the compound calls stored in a single set of high data This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.high '...
def function[high, parameter[data, test, queue]]: constant[ Execute the compound calls stored in a single set of high data This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' st...
keyword[def] identifier[high] ( identifier[data] , identifier[test] = keyword[None] , identifier[queue] = keyword[False] ,** identifier[kwargs] ): literal[string] identifier[conflict] = identifier[_check_queue] ( identifier[queue] , identifier[kwargs] ) keyword[if] identifier[conflict] keyword[is] ...
def high(data, test=None, queue=False, **kwargs): """ Execute the compound calls stored in a single set of high data This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.high '...
def class_url(cls): """Returns a versioned URI string for this class""" base = 'v{0}'.format(getattr(cls, 'RESOURCE_VERSION', '1')) return "/{0}/{1}".format(base, class_to_api_name(cls.class_name()))
def function[class_url, parameter[cls]]: constant[Returns a versioned URI string for this class] variable[base] assign[=] call[constant[v{0}].format, parameter[call[name[getattr], parameter[name[cls], constant[RESOURCE_VERSION], constant[1]]]]] return[call[constant[/{0}/{1}].format, parameter[name[b...
keyword[def] identifier[class_url] ( identifier[cls] ): literal[string] identifier[base] = literal[string] . identifier[format] ( identifier[getattr] ( identifier[cls] , literal[string] , literal[string] )) keyword[return] literal[string] . identifier[format] ( identifier[base] , identifi...
def class_url(cls): """Returns a versioned URI string for this class""" base = 'v{0}'.format(getattr(cls, 'RESOURCE_VERSION', '1')) return '/{0}/{1}'.format(base, class_to_api_name(cls.class_name()))
def hide_node(self, node): """ Hides a node from the graph. The incoming and outgoing edges of the node will also be hidden. The node may be unhidden at some later time. """ try: all_edges = self.all_edges(node) self.hidden_nodes[node] = (self.nodes[node...
def function[hide_node, parameter[self, node]]: constant[ Hides a node from the graph. The incoming and outgoing edges of the node will also be hidden. The node may be unhidden at some later time. ] <ast.Try object at 0x7da1b0c53640>
keyword[def] identifier[hide_node] ( identifier[self] , identifier[node] ): literal[string] keyword[try] : identifier[all_edges] = identifier[self] . identifier[all_edges] ( identifier[node] ) identifier[self] . identifier[hidden_nodes] [ identifier[node] ]=( identifier[se...
def hide_node(self, node): """ Hides a node from the graph. The incoming and outgoing edges of the node will also be hidden. The node may be unhidden at some later time. """ try: all_edges = self.all_edges(node) self.hidden_nodes[node] = (self.nodes[node], all_edges) ...
def translate_markers(pipfile_entry): """Take a pipfile entry and normalize its markers Provide a pipfile entry which may have 'markers' as a key or it may have any valid key from `packaging.markers.marker_context.keys()` and standardize the format into {'markers': 'key == "some_value"'}. :param p...
def function[translate_markers, parameter[pipfile_entry]]: constant[Take a pipfile entry and normalize its markers Provide a pipfile entry which may have 'markers' as a key or it may have any valid key from `packaging.markers.marker_context.keys()` and standardize the format into {'markers': 'key =...
keyword[def] identifier[translate_markers] ( identifier[pipfile_entry] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[pipfile_entry] , identifier[Mapping] ): keyword[raise] identifier[TypeError] ( literal[string] ) keyword[from] . identifier[vendor] . ident...
def translate_markers(pipfile_entry): """Take a pipfile entry and normalize its markers Provide a pipfile entry which may have 'markers' as a key or it may have any valid key from `packaging.markers.marker_context.keys()` and standardize the format into {'markers': 'key == "some_value"'}. :param p...
def save(self, output_path=None, title=None): """Saves the current figure with carpet visualization to disk. Parameters ---------- output_path : str Path to where the figure needs to be saved to. title : str text to overlay and annotate the visualizatio...
def function[save, parameter[self, output_path, title]]: constant[Saves the current figure with carpet visualization to disk. Parameters ---------- output_path : str Path to where the figure needs to be saved to. title : str text to overlay and annotate...
keyword[def] identifier[save] ( identifier[self] , identifier[output_path] = keyword[None] , identifier[title] = keyword[None] ): literal[string] keyword[try] : identifier[save_figure] ( identifier[self] . identifier[fig] , identifier[output_path] = identifier[output_path] , identifie...
def save(self, output_path=None, title=None): """Saves the current figure with carpet visualization to disk. Parameters ---------- output_path : str Path to where the figure needs to be saved to. title : str text to overlay and annotate the visualization (d...
def add_watermark(pdf_file_in, pdf_file_mark, pdf_file_out): """添加水印 """ pdf_output = PdfFileWriter() input_stream = open(pdf_file_in, 'rb') pdf_input = PdfFileReader(input_stream) # PDF文件被加密了 if pdf_input.getIsEncrypted(): print('该PDF文件被加密了.') # 尝试用空密码解密 try: ...
def function[add_watermark, parameter[pdf_file_in, pdf_file_mark, pdf_file_out]]: constant[添加水印 ] variable[pdf_output] assign[=] call[name[PdfFileWriter], parameter[]] variable[input_stream] assign[=] call[name[open], parameter[name[pdf_file_in], constant[rb]]] variable[pdf_input] as...
keyword[def] identifier[add_watermark] ( identifier[pdf_file_in] , identifier[pdf_file_mark] , identifier[pdf_file_out] ): literal[string] identifier[pdf_output] = identifier[PdfFileWriter] () identifier[input_stream] = identifier[open] ( identifier[pdf_file_in] , literal[string] ) identifier[pdf...
def add_watermark(pdf_file_in, pdf_file_mark, pdf_file_out): """添加水印 """ pdf_output = PdfFileWriter() input_stream = open(pdf_file_in, 'rb') pdf_input = PdfFileReader(input_stream) # PDF文件被加密了 if pdf_input.getIsEncrypted(): print('该PDF文件被加密了.') # 尝试用空密码解密 try: ...
def _duration(start, end): """ Return time delta. """ if start and end: if start > end: return None else: return end - start elif start: return time.time() - start else: return None
def function[_duration, parameter[start, end]]: constant[ Return time delta. ] if <ast.BoolOp object at 0x7da2044c3040> begin[:] if compare[name[start] greater[>] name[end]] begin[:] return[constant[None]]
keyword[def] identifier[_duration] ( identifier[start] , identifier[end] ): literal[string] keyword[if] identifier[start] keyword[and] identifier[end] : keyword[if] identifier[start] > identifier[end] : keyword[return] keyword[None] keyword[else] : keyword[...
def _duration(start, end): """ Return time delta. """ if start and end: if start > end: return None # depends on [control=['if'], data=[]] else: return end - start # depends on [control=['if'], data=[]] elif start: return time.time() - start # depends o...
async def emitters(self, key, value): """ Single-channel emitter """ while True: await asyncio.sleep(value['schedule'].total_seconds()) await self.channel_layer.send(key, { "type": value['type'], "message": value['message'] ...
<ast.AsyncFunctionDef object at 0x7da1b1080e50>
keyword[async] keyword[def] identifier[emitters] ( identifier[self] , identifier[key] , identifier[value] ): literal[string] keyword[while] keyword[True] : keyword[await] identifier[asyncio] . identifier[sleep] ( identifier[value] [ literal[string] ]. identifier[total_seconds] ()) ...
async def emitters(self, key, value): """ Single-channel emitter """ while True: await asyncio.sleep(value['schedule'].total_seconds()) await self.channel_layer.send(key, {'type': value['type'], 'message': value['message']}) # depends on [control=['while'], data=[]]
def load_fw(path): """Open firmware file and return a binary string.""" fname = os.path.realpath(path) exists = os.path.isfile(fname) if not exists or not os.access(fname, os.R_OK): _LOGGER.error( 'Firmware path %s does not exist or is not readable', path) return ...
def function[load_fw, parameter[path]]: constant[Open firmware file and return a binary string.] variable[fname] assign[=] call[name[os].path.realpath, parameter[name[path]]] variable[exists] assign[=] call[name[os].path.isfile, parameter[name[fname]]] if <ast.BoolOp object at 0x7da20cab...
keyword[def] identifier[load_fw] ( identifier[path] ): literal[string] identifier[fname] = identifier[os] . identifier[path] . identifier[realpath] ( identifier[path] ) identifier[exists] = identifier[os] . identifier[path] . identifier[isfile] ( identifier[fname] ) keyword[if] keyword[not] ide...
def load_fw(path): """Open firmware file and return a binary string.""" fname = os.path.realpath(path) exists = os.path.isfile(fname) if not exists or not os.access(fname, os.R_OK): _LOGGER.error('Firmware path %s does not exist or is not readable', path) return None # depends on [contr...
def expand_tpm(tpm): """Broadcast a state-by-node TPM so that singleton dimensions are expanded over the full network. """ unconstrained = np.ones([2] * (tpm.ndim - 1) + [tpm.shape[-1]]) return tpm * unconstrained
def function[expand_tpm, parameter[tpm]]: constant[Broadcast a state-by-node TPM so that singleton dimensions are expanded over the full network. ] variable[unconstrained] assign[=] call[name[np].ones, parameter[binary_operation[binary_operation[list[[<ast.Constant object at 0x7da207f022f0>]] * ...
keyword[def] identifier[expand_tpm] ( identifier[tpm] ): literal[string] identifier[unconstrained] = identifier[np] . identifier[ones] ([ literal[int] ]*( identifier[tpm] . identifier[ndim] - literal[int] )+[ identifier[tpm] . identifier[shape] [- literal[int] ]]) keyword[return] identifier[tpm] * id...
def expand_tpm(tpm): """Broadcast a state-by-node TPM so that singleton dimensions are expanded over the full network. """ unconstrained = np.ones([2] * (tpm.ndim - 1) + [tpm.shape[-1]]) return tpm * unconstrained
def load_plume_package(package, plume_dir, accept_defaults): """Loads a canari package into Plume.""" from canari.commands.load_plume_package import load_plume_package load_plume_package(package, plume_dir, accept_defaults)
def function[load_plume_package, parameter[package, plume_dir, accept_defaults]]: constant[Loads a canari package into Plume.] from relative_module[canari.commands.load_plume_package] import module[load_plume_package] call[name[load_plume_package], parameter[name[package], name[plume_dir], name[acce...
keyword[def] identifier[load_plume_package] ( identifier[package] , identifier[plume_dir] , identifier[accept_defaults] ): literal[string] keyword[from] identifier[canari] . identifier[commands] . identifier[load_plume_package] keyword[import] identifier[load_plume_package] identifier[load_plume_p...
def load_plume_package(package, plume_dir, accept_defaults): """Loads a canari package into Plume.""" from canari.commands.load_plume_package import load_plume_package load_plume_package(package, plume_dir, accept_defaults)
def deriv1(x,y,i,n): """ alternative way to smooth the derivative of a noisy signal using least square fit. x=array of x axis y=array of y axis n=smoothing factor i= position in this method the slope in position i is calculated by least square fit of n points before and after positi...
def function[deriv1, parameter[x, y, i, n]]: constant[ alternative way to smooth the derivative of a noisy signal using least square fit. x=array of x axis y=array of y axis n=smoothing factor i= position in this method the slope in position i is calculated by least square fit of n ...
keyword[def] identifier[deriv1] ( identifier[x] , identifier[y] , identifier[i] , identifier[n] ): literal[string] identifier[m_] , identifier[x_] , identifier[y_] , identifier[xy_] , identifier[x_2] = literal[int] , literal[int] , literal[int] , literal[int] , literal[int] keyword[for] identifier[i...
def deriv1(x, y, i, n): """ alternative way to smooth the derivative of a noisy signal using least square fit. x=array of x axis y=array of y axis n=smoothing factor i= position in this method the slope in position i is calculated by least square fit of n points before and after pos...
def add_distinguished_name(list_name, item_name): ''' Adds a distinguished name to a distinguished name list. list_name(str): The name of the specific policy distinguished name list to append to. item_name(str): The distinguished name to append. CLI Example: .. code-block:: bash sal...
def function[add_distinguished_name, parameter[list_name, item_name]]: constant[ Adds a distinguished name to a distinguished name list. list_name(str): The name of the specific policy distinguished name list to append to. item_name(str): The distinguished name to append. CLI Example: .....
keyword[def] identifier[add_distinguished_name] ( identifier[list_name] , identifier[item_name] ): literal[string] identifier[payload] ={ literal[string] : literal[string] , literal[string] : literal[string] , literal[string] : literal[string] , literal[string] :[ identifier[list_name] ,{ li...
def add_distinguished_name(list_name, item_name): """ Adds a distinguished name to a distinguished name list. list_name(str): The name of the specific policy distinguished name list to append to. item_name(str): The distinguished name to append. CLI Example: .. code-block:: bash sal...
def get_other_gene_names(cls, entry): """ get list of `models.OtherGeneName` objects from XML node entry :param entry: XML node entry :return: list of :class:`pyuniprot.manager.models.models.OtherGeneName` objects """ alternative_gene_names = [] for alternative_...
def function[get_other_gene_names, parameter[cls, entry]]: constant[ get list of `models.OtherGeneName` objects from XML node entry :param entry: XML node entry :return: list of :class:`pyuniprot.manager.models.models.OtherGeneName` objects ] variable[alternative_gene_na...
keyword[def] identifier[get_other_gene_names] ( identifier[cls] , identifier[entry] ): literal[string] identifier[alternative_gene_names] =[] keyword[for] identifier[alternative_gene_name] keyword[in] identifier[entry] . identifier[iterfind] ( literal[string] ): keyword[i...
def get_other_gene_names(cls, entry): """ get list of `models.OtherGeneName` objects from XML node entry :param entry: XML node entry :return: list of :class:`pyuniprot.manager.models.models.OtherGeneName` objects """ alternative_gene_names = [] for alternative_gene_name in ...
def get_unresolved_variables(f): """ Gets unresolved vars from file """ reporter = RReporter() checkPath(f, reporter=reporter) return dict(reporter.messages)
def function[get_unresolved_variables, parameter[f]]: constant[ Gets unresolved vars from file ] variable[reporter] assign[=] call[name[RReporter], parameter[]] call[name[checkPath], parameter[name[f]]] return[call[name[dict], parameter[name[reporter].messages]]]
keyword[def] identifier[get_unresolved_variables] ( identifier[f] ): literal[string] identifier[reporter] = identifier[RReporter] () identifier[checkPath] ( identifier[f] , identifier[reporter] = identifier[reporter] ) keyword[return] identifier[dict] ( identifier[reporter] . identifier[messages...
def get_unresolved_variables(f): """ Gets unresolved vars from file """ reporter = RReporter() checkPath(f, reporter=reporter) return dict(reporter.messages)
def replace_keywords(self, sentence): """Searches in the string for all keywords present in corpus. Keywords present are replaced by the clean name and a new string is returned. Args: sentence (str): Line of text where we will replace keywords Returns: new_sente...
def function[replace_keywords, parameter[self, sentence]]: constant[Searches in the string for all keywords present in corpus. Keywords present are replaced by the clean name and a new string is returned. Args: sentence (str): Line of text where we will replace keywords Ret...
keyword[def] identifier[replace_keywords] ( identifier[self] , identifier[sentence] ): literal[string] keyword[if] keyword[not] identifier[sentence] : keyword[return] identifier[sentence] identifier[new_sentence] =[] identifier[orig_sentence] = identifier...
def replace_keywords(self, sentence): """Searches in the string for all keywords present in corpus. Keywords present are replaced by the clean name and a new string is returned. Args: sentence (str): Line of text where we will replace keywords Returns: new_sentence ...
def send_scp(self, *args, **kwargs): """Transmit an SCP Packet to a specific board. Automatically determines the appropriate connection to use. See the arguments for :py:meth:`~rig.machine_control.scp_connection.SCPConnection` for details. Parameters ----------...
def function[send_scp, parameter[self]]: constant[Transmit an SCP Packet to a specific board. Automatically determines the appropriate connection to use. See the arguments for :py:meth:`~rig.machine_control.scp_connection.SCPConnection` for details. Parameters ...
keyword[def] identifier[send_scp] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[cabinet] = identifier[kwargs] . identifier[pop] ( literal[string] ) identifier[frame] = identifier[kwargs] . identifier[pop] ( literal[string] ) ...
def send_scp(self, *args, **kwargs): """Transmit an SCP Packet to a specific board. Automatically determines the appropriate connection to use. See the arguments for :py:meth:`~rig.machine_control.scp_connection.SCPConnection` for details. Parameters ---------- ...
def log_info(msg, logger="TaskLogger"): """Log an INFO message Convenience function to log a message to the default Logger Parameters ---------- msg : str Message to be logged logger : str, optional (default: "TaskLogger") Unique name of the logger to retrieve Returns ...
def function[log_info, parameter[msg, logger]]: constant[Log an INFO message Convenience function to log a message to the default Logger Parameters ---------- msg : str Message to be logged logger : str, optional (default: "TaskLogger") Unique name of the logger to retrieve...
keyword[def] identifier[log_info] ( identifier[msg] , identifier[logger] = literal[string] ): literal[string] identifier[tasklogger] = identifier[get_tasklogger] ( identifier[logger] ) identifier[tasklogger] . identifier[info] ( identifier[msg] ) keyword[return] identifier[tasklogger]
def log_info(msg, logger='TaskLogger'): """Log an INFO message Convenience function to log a message to the default Logger Parameters ---------- msg : str Message to be logged logger : str, optional (default: "TaskLogger") Unique name of the logger to retrieve Returns ...
def p_import(self, p): 'import : IMPORT ID NL' p[0] = AstImport(self.path, p.lineno(1), p.lexpos(1), p[2])
def function[p_import, parameter[self, p]]: constant[import : IMPORT ID NL] call[name[p]][constant[0]] assign[=] call[name[AstImport], parameter[name[self].path, call[name[p].lineno, parameter[constant[1]]], call[name[p].lexpos, parameter[constant[1]]], call[name[p]][constant[2]]]]
keyword[def] identifier[p_import] ( identifier[self] , identifier[p] ): literal[string] identifier[p] [ literal[int] ]= identifier[AstImport] ( identifier[self] . identifier[path] , identifier[p] . identifier[lineno] ( literal[int] ), identifier[p] . identifier[lexpos] ( literal[int] ), identifier[...
def p_import(self, p): """import : IMPORT ID NL""" p[0] = AstImport(self.path, p.lineno(1), p.lexpos(1), p[2])
def irr(values, guess = None): """ Function to calculate the internal rate of return (IRR) using payments and periodic dates. It resembles the excel function IRR(). Excel reference: https://support.office.com/en-us/article/IRR-function-64925eaa-9988-495b-b290-3ad0c163c1bc :param values: the paymen...
def function[irr, parameter[values, guess]]: constant[ Function to calculate the internal rate of return (IRR) using payments and periodic dates. It resembles the excel function IRR(). Excel reference: https://support.office.com/en-us/article/IRR-function-64925eaa-9988-495b-b290-3ad0c163c1bc :...
keyword[def] identifier[irr] ( identifier[values] , identifier[guess] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[values] , identifier[Range] ): identifier[values] = identifier[values] . identifier[values] keyword[if] identifier[guess] keyword[is] ...
def irr(values, guess=None): """ Function to calculate the internal rate of return (IRR) using payments and periodic dates. It resembles the excel function IRR(). Excel reference: https://support.office.com/en-us/article/IRR-function-64925eaa-9988-495b-b290-3ad0c163c1bc :param values: the payments...
def underlying_order_book_id(self): """ [str] 合约标的代码,目前除股指期货(IH, IF, IC)之外的期货合约,这一字段全部为’null’(期货专用) """ try: return self.__dict__["underlying_order_book_id"] except (KeyError, ValueError): raise AttributeError( "Instrument(order_book_id={})...
def function[underlying_order_book_id, parameter[self]]: constant[ [str] 合约标的代码,目前除股指期货(IH, IF, IC)之外的期货合约,这一字段全部为’null’(期货专用) ] <ast.Try object at 0x7da1b2185db0>
keyword[def] identifier[underlying_order_book_id] ( identifier[self] ): literal[string] keyword[try] : keyword[return] identifier[self] . identifier[__dict__] [ literal[string] ] keyword[except] ( identifier[KeyError] , identifier[ValueError] ): keyword[raise] i...
def underlying_order_book_id(self): """ [str] 合约标的代码,目前除股指期货(IH, IF, IC)之外的期货合约,这一字段全部为’null’(期货专用) """ try: return self.__dict__['underlying_order_book_id'] # depends on [control=['try'], data=[]] except (KeyError, ValueError): raise AttributeError("Instrument(order_book_id...
def perc_fltr(dem, perc=(1.0, 99.0)): """Percentile filter """ rangelim = malib.calcperc(dem, perc) print('Excluding values outside of percentile range: {0:0.2f} to {1:0.2f}'.format(*perc)) out = range_fltr(dem, rangelim) return out
def function[perc_fltr, parameter[dem, perc]]: constant[Percentile filter ] variable[rangelim] assign[=] call[name[malib].calcperc, parameter[name[dem], name[perc]]] call[name[print], parameter[call[constant[Excluding values outside of percentile range: {0:0.2f} to {1:0.2f}].format, paramete...
keyword[def] identifier[perc_fltr] ( identifier[dem] , identifier[perc] =( literal[int] , literal[int] )): literal[string] identifier[rangelim] = identifier[malib] . identifier[calcperc] ( identifier[dem] , identifier[perc] ) identifier[print] ( literal[string] . identifier[format] (* identifier[perc]...
def perc_fltr(dem, perc=(1.0, 99.0)): """Percentile filter """ rangelim = malib.calcperc(dem, perc) print('Excluding values outside of percentile range: {0:0.2f} to {1:0.2f}'.format(*perc)) out = range_fltr(dem, rangelim) return out
def threadpooled( func: None = None, *, loop_getter: typing.Union[None, typing.Callable[..., asyncio.AbstractEventLoop], asyncio.AbstractEventLoop] = None, loop_getter_need_context: bool = False, ) -> ThreadPooled: """Overload: No function."""
def function[threadpooled, parameter[func]]: constant[Overload: No function.]
keyword[def] identifier[threadpooled] ( identifier[func] : keyword[None] = keyword[None] , *, identifier[loop_getter] : identifier[typing] . identifier[Union] [ keyword[None] , identifier[typing] . identifier[Callable] [..., identifier[asyncio] . identifier[AbstractEventLoop] ], identifier[asyncio] . identifier[Abs...
def threadpooled(func: None=None, *, loop_getter: typing.Union[None, typing.Callable[..., asyncio.AbstractEventLoop], asyncio.AbstractEventLoop]=None, loop_getter_need_context: bool=False) -> ThreadPooled: """Overload: No function."""
def getlibversion(): """Get the library version info. Args: no argument Returns: 4-element tuple with the following components: -major version number (int) -minor version number (int) -complete library version number (int) -additional information (string) C ...
def function[getlibversion, parameter[]]: constant[Get the library version info. Args: no argument Returns: 4-element tuple with the following components: -major version number (int) -minor version number (int) -complete library version number (int) -addition...
keyword[def] identifier[getlibversion] (): literal[string] identifier[status] , identifier[major_v] , identifier[minor_v] , identifier[release] , identifier[info] = identifier[_C] . identifier[Hgetlibversion] () identifier[_checkErr] ( literal[string] , identifier[status] , literal[string] ) key...
def getlibversion(): """Get the library version info. Args: no argument Returns: 4-element tuple with the following components: -major version number (int) -minor version number (int) -complete library version number (int) -additional information (string) C ...
def known_remotes(self): """The names of the configured remote repositories (a list of :class:`.Remote` objects).""" objects = [] for line in self.context.capture('hg', 'paths').splitlines(): name, _, location = line.partition('=') if name and location: na...
def function[known_remotes, parameter[self]]: constant[The names of the configured remote repositories (a list of :class:`.Remote` objects).] variable[objects] assign[=] list[[]] for taget[name[line]] in starred[call[call[name[self].context.capture, parameter[constant[hg], constant[paths]]].spli...
keyword[def] identifier[known_remotes] ( identifier[self] ): literal[string] identifier[objects] =[] keyword[for] identifier[line] keyword[in] identifier[self] . identifier[context] . identifier[capture] ( literal[string] , literal[string] ). identifier[splitlines] (): iden...
def known_remotes(self): """The names of the configured remote repositories (a list of :class:`.Remote` objects).""" objects = [] for line in self.context.capture('hg', 'paths').splitlines(): (name, _, location) = line.partition('=') if name and location: name = name.strip() ...
def rels_xml_for(self, source_uri): """ Return rels item XML for source with *source_uri*, or None if the item has no rels item. """ try: rels_xml = self.blob_for(source_uri.rels_uri) except IOError: rels_xml = None return rels_xml
def function[rels_xml_for, parameter[self, source_uri]]: constant[ Return rels item XML for source with *source_uri*, or None if the item has no rels item. ] <ast.Try object at 0x7da1b21788e0> return[name[rels_xml]]
keyword[def] identifier[rels_xml_for] ( identifier[self] , identifier[source_uri] ): literal[string] keyword[try] : identifier[rels_xml] = identifier[self] . identifier[blob_for] ( identifier[source_uri] . identifier[rels_uri] ) keyword[except] identifier[IOError] : ...
def rels_xml_for(self, source_uri): """ Return rels item XML for source with *source_uri*, or None if the item has no rels item. """ try: rels_xml = self.blob_for(source_uri.rels_uri) # depends on [control=['try'], data=[]] except IOError: rels_xml = None # depends ...
def is_valid_catalog(self, catalog=None): """Valida que un archivo `data.json` cumpla con el schema definido. Chequea que el data.json tiene todos los campos obligatorios y que tanto los campos obligatorios como los opcionales siguen la estructura definida en el schema. Args: ...
def function[is_valid_catalog, parameter[self, catalog]]: constant[Valida que un archivo `data.json` cumpla con el schema definido. Chequea que el data.json tiene todos los campos obligatorios y que tanto los campos obligatorios como los opcionales siguen la estructura definida en el sc...
keyword[def] identifier[is_valid_catalog] ( identifier[self] , identifier[catalog] = keyword[None] ): literal[string] identifier[catalog] = identifier[catalog] keyword[or] identifier[self] keyword[return] identifier[validation] . identifier[is_valid_catalog] ( identifier[catalog] , ide...
def is_valid_catalog(self, catalog=None): """Valida que un archivo `data.json` cumpla con el schema definido. Chequea que el data.json tiene todos los campos obligatorios y que tanto los campos obligatorios como los opcionales siguen la estructura definida en el schema. Args: ...
def _line_start_indexes(self): """ Array pointing to the start indexes of all the lines. """ # Cache, because this is often reused. (If it is used, it's often used # many times. And this has to be fast for editing big documents!) if self._cache.line_indexes is None: ...
def function[_line_start_indexes, parameter[self]]: constant[ Array pointing to the start indexes of all the lines. ] if compare[name[self]._cache.line_indexes is constant[None]] begin[:] variable[line_lengths] assign[=] call[name[map], parameter[name[len], name[self].lin...
keyword[def] identifier[_line_start_indexes] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_cache] . identifier[line_indexes] keyword[is] keyword[None] : identifier[line_lengths] = identifier[map] ( identifier[len] , ident...
def _line_start_indexes(self): """ Array pointing to the start indexes of all the lines. """ # Cache, because this is often reused. (If it is used, it's often used # many times. And this has to be fast for editing big documents!) if self._cache.line_indexes is None: # Create list...
def replace_constraint(self,name,selectfrac_skip=False,distribution_skip=False): """ Re-apply constraint that had been removed :param name: Name of constraint to replace :param selectfrac_skip,distribution_skip: (optional) Same as :func:`StarPopulation.apply_con...
def function[replace_constraint, parameter[self, name, selectfrac_skip, distribution_skip]]: constant[ Re-apply constraint that had been removed :param name: Name of constraint to replace :param selectfrac_skip,distribution_skip: (optional) Same as :func:`StarPo...
keyword[def] identifier[replace_constraint] ( identifier[self] , identifier[name] , identifier[selectfrac_skip] = keyword[False] , identifier[distribution_skip] = keyword[False] ): literal[string] identifier[hidden_constraints] = identifier[self] . identifier[hidden_constraints] keyword[i...
def replace_constraint(self, name, selectfrac_skip=False, distribution_skip=False): """ Re-apply constraint that had been removed :param name: Name of constraint to replace :param selectfrac_skip,distribution_skip: (optional) Same as :func:`StarPopulation.apply_cons...
def to_ts(s): """Parses an NGINX timestamp from "30/Apr/2014:07:32:09 +0000" and returns it as ISO 8601" """ # Strip TZ portion if present m = Nginx.DATE_FMT.match(s) if m: s = m.group(1) delta = timedelta(seconds=int(m.group(3)) * (-1 if m.group(2) == '-' else ...
def function[to_ts, parameter[s]]: constant[Parses an NGINX timestamp from "30/Apr/2014:07:32:09 +0000" and returns it as ISO 8601" ] variable[m] assign[=] call[name[Nginx].DATE_FMT.match, parameter[name[s]]] if name[m] begin[:] variable[s] assign[=] call[name[m].group, paramete...
keyword[def] identifier[to_ts] ( identifier[s] ): literal[string] identifier[m] = identifier[Nginx] . identifier[DATE_FMT] . identifier[match] ( identifier[s] ) keyword[if] identifier[m] : identifier[s] = identifier[m] . identifier[group] ( literal[int] ) ...
def to_ts(s): """Parses an NGINX timestamp from "30/Apr/2014:07:32:09 +0000" and returns it as ISO 8601" """ # Strip TZ portion if present m = Nginx.DATE_FMT.match(s) if m: s = m.group(1) delta = timedelta(seconds=int(m.group(3)) * (-1 if m.group(2) == '-' else 1)) # Offset from GMT #...
def _to_patches(self, X): """ Reshapes input to patches of the size of classifier's receptive field. For example: input X shape: [n_samples, n_pixels_y, n_pixels_x, n_bands] output: [n_samples * n_pixels_y/receptive_field_y * n_pixels_x/receptive_field_x, ...
def function[_to_patches, parameter[self, X]]: constant[ Reshapes input to patches of the size of classifier's receptive field. For example: input X shape: [n_samples, n_pixels_y, n_pixels_x, n_bands] output: [n_samples * n_pixels_y/receptive_field_y * n_pixels_x/receptive_fie...
keyword[def] identifier[_to_patches] ( identifier[self] , identifier[X] ): literal[string] identifier[window] = identifier[self] . identifier[receptive_field] identifier[asteps] = identifier[self] . identifier[receptive_field] keyword[if] identifier[len] ( identifier[X]...
def _to_patches(self, X): """ Reshapes input to patches of the size of classifier's receptive field. For example: input X shape: [n_samples, n_pixels_y, n_pixels_x, n_bands] output: [n_samples * n_pixels_y/receptive_field_y * n_pixels_x/receptive_field_x, receptiv...
def report_events(self, start_date, end_date, type="system"): """ Create a report for all client events or all system events. Uses GET to /reports/events/{clients,system} interface :Args: * *start_date*: (datetime) Start time for report generation * *end_date*: (date...
def function[report_events, parameter[self, start_date, end_date, type]]: constant[ Create a report for all client events or all system events. Uses GET to /reports/events/{clients,system} interface :Args: * *start_date*: (datetime) Start time for report generation *...
keyword[def] identifier[report_events] ( identifier[self] , identifier[start_date] , identifier[end_date] , identifier[type] = literal[string] ): literal[string] identifier[start_str] , identifier[end_str] = identifier[self] . identifier[_format_input_dates] ( identifier[start_date] , identifier[...
def report_events(self, start_date, end_date, type='system'): """ Create a report for all client events or all system events. Uses GET to /reports/events/{clients,system} interface :Args: * *start_date*: (datetime) Start time for report generation * *end_date*: (datetime...
def _set_virtual_mac(self, v, load=False): """ Setter method for virtual_mac, mapped from YANG variable /rbridge_id/interface/ve/ipv6/vrrpv3e/virtual_mac (container) If this variable is read-only (config: false) in the source YANG file, then _set_virtual_mac is considered as a private method. Backen...
def function[_set_virtual_mac, parameter[self, v, load]]: constant[ Setter method for virtual_mac, mapped from YANG variable /rbridge_id/interface/ve/ipv6/vrrpv3e/virtual_mac (container) If this variable is read-only (config: false) in the source YANG file, then _set_virtual_mac is considered as a p...
keyword[def] identifier[_set_virtual_mac] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : id...
def _set_virtual_mac(self, v, load=False): """ Setter method for virtual_mac, mapped from YANG variable /rbridge_id/interface/ve/ipv6/vrrpv3e/virtual_mac (container) If this variable is read-only (config: false) in the source YANG file, then _set_virtual_mac is considered as a private method. Backen...
def MakeDestinationKey(directory, filename): """Creates a name that identifies a database file.""" return utils.SmartStr(utils.JoinPath(directory, filename)).lstrip("/")
def function[MakeDestinationKey, parameter[directory, filename]]: constant[Creates a name that identifies a database file.] return[call[call[name[utils].SmartStr, parameter[call[name[utils].JoinPath, parameter[name[directory], name[filename]]]]].lstrip, parameter[constant[/]]]]
keyword[def] identifier[MakeDestinationKey] ( identifier[directory] , identifier[filename] ): literal[string] keyword[return] identifier[utils] . identifier[SmartStr] ( identifier[utils] . identifier[JoinPath] ( identifier[directory] , identifier[filename] )). identifier[lstrip] ( literal[string] )
def MakeDestinationKey(directory, filename): """Creates a name that identifies a database file.""" return utils.SmartStr(utils.JoinPath(directory, filename)).lstrip('/')
def _getIndxChop(self, indx): ''' A helper method for Type subclasses to use for a simple way to truncate indx bytes. ''' # cut down an index value to 256 bytes... if len(indx) <= 256: return indx base = indx[:248] sufx = xxhash.xxh64(indx).di...
def function[_getIndxChop, parameter[self, indx]]: constant[ A helper method for Type subclasses to use for a simple way to truncate indx bytes. ] if compare[call[name[len], parameter[name[indx]]] less_or_equal[<=] constant[256]] begin[:] return[name[indx]] variab...
keyword[def] identifier[_getIndxChop] ( identifier[self] , identifier[indx] ): literal[string] keyword[if] identifier[len] ( identifier[indx] )<= literal[int] : keyword[return] identifier[indx] identifier[base] = identifier[indx] [: literal[int] ] identif...
def _getIndxChop(self, indx): """ A helper method for Type subclasses to use for a simple way to truncate indx bytes. """ # cut down an index value to 256 bytes... if len(indx) <= 256: return indx # depends on [control=['if'], data=[]] base = indx[:248] sufx = xxhash...
def add_reporting_args(parser): """Add reporting arguments to an argument parser. Parameters ---------- parser: `argparse.ArgumentParser` Returns ------- `argparse.ArgumentGroup` The argument group created. """ g = parser.add_argument_group('Reporting options') g.add_a...
def function[add_reporting_args, parameter[parser]]: constant[Add reporting arguments to an argument parser. Parameters ---------- parser: `argparse.ArgumentParser` Returns ------- `argparse.ArgumentGroup` The argument group created. ] variable[g] assign[=] call[nam...
keyword[def] identifier[add_reporting_args] ( identifier[parser] ): literal[string] identifier[g] = identifier[parser] . identifier[add_argument_group] ( literal[string] ) identifier[g] . identifier[add_argument] ( literal[string] , literal[string] , identifier[default] = keyword[None] , id...
def add_reporting_args(parser): """Add reporting arguments to an argument parser. Parameters ---------- parser: `argparse.ArgumentParser` Returns ------- `argparse.ArgumentGroup` The argument group created. """ g = parser.add_argument_group('Reporting options') g.add_ar...
def summarize_provenance(self): """Utility function to summarize provenance files for cached items used by a Cohort. At the moment, most PROVENANCE files contain details about packages used to generate files. However, this function is generic & so it summarizes the contents of those fil...
def function[summarize_provenance, parameter[self]]: constant[Utility function to summarize provenance files for cached items used by a Cohort. At the moment, most PROVENANCE files contain details about packages used to generate files. However, this function is generic & so it summarizes the co...
keyword[def] identifier[summarize_provenance] ( identifier[self] ): literal[string] identifier[provenance_per_cache] = identifier[self] . identifier[summarize_provenance_per_cache] () identifier[summary_provenance] = keyword[None] identifier[num_discrepant] = literal[int] ...
def summarize_provenance(self): """Utility function to summarize provenance files for cached items used by a Cohort. At the moment, most PROVENANCE files contain details about packages used to generate files. However, this function is generic & so it summarizes the contents of those files i...
def parse_options(settings): '''Parse command line options''' optlist, args = getopt(sys.argv, 'x', []) settings['configfile'] = args[1] return settings
def function[parse_options, parameter[settings]]: constant[Parse command line options] <ast.Tuple object at 0x7da1b09bb250> assign[=] call[name[getopt], parameter[name[sys].argv, constant[x], list[[]]]] call[name[settings]][constant[configfile]] assign[=] call[name[args]][constant[1]] return...
keyword[def] identifier[parse_options] ( identifier[settings] ): literal[string] identifier[optlist] , identifier[args] = identifier[getopt] ( identifier[sys] . identifier[argv] , literal[string] ,[]) identifier[settings] [ literal[string] ]= identifier[args] [ literal[int] ] keyword[return] ide...
def parse_options(settings): """Parse command line options""" (optlist, args) = getopt(sys.argv, 'x', []) settings['configfile'] = args[1] return settings
def on_configuration_changed(self, config): """ Handles a screen configuration change. """ self.width = config['width'] self.height = config['height'] self.orientation = ('square', 'portrait', 'landscape')[ config['orientation']]
def function[on_configuration_changed, parameter[self, config]]: constant[ Handles a screen configuration change. ] name[self].width assign[=] call[name[config]][constant[width]] name[self].height assign[=] call[name[config]][constant[height]] name[self].orientation assign[=] ca...
keyword[def] identifier[on_configuration_changed] ( identifier[self] , identifier[config] ): literal[string] identifier[self] . identifier[width] = identifier[config] [ literal[string] ] identifier[self] . identifier[height] = identifier[config] [ literal[string] ] identifier[self...
def on_configuration_changed(self, config): """ Handles a screen configuration change. """ self.width = config['width'] self.height = config['height'] self.orientation = ('square', 'portrait', 'landscape')[config['orientation']]
def numberOfConnectedDistalSynapses(self, cells=None): """ Returns the number of connected distal synapses on these cells. Parameters: ---------------------------- @param cells (iterable) Indices of the cells. If None return count for all cells. """ if cells is None: cell...
def function[numberOfConnectedDistalSynapses, parameter[self, cells]]: constant[ Returns the number of connected distal synapses on these cells. Parameters: ---------------------------- @param cells (iterable) Indices of the cells. If None return count for all cells. ] ...
keyword[def] identifier[numberOfConnectedDistalSynapses] ( identifier[self] , identifier[cells] = keyword[None] ): literal[string] keyword[if] identifier[cells] keyword[is] keyword[None] : identifier[cells] = identifier[xrange] ( identifier[self] . identifier[numberOfCells] ()) identifier[n...
def numberOfConnectedDistalSynapses(self, cells=None): """ Returns the number of connected distal synapses on these cells. Parameters: ---------------------------- @param cells (iterable) Indices of the cells. If None return count for all cells. """ if cells is None: ce...
def _setup_logging(args): """ Set up logging for the script, based on the configuration specified by the 'logging' attribute of the command line arguments. :param args: A Namespace object containing a 'logging' attribute specifying the name of a logging configuration file ...
def function[_setup_logging, parameter[args]]: constant[ Set up logging for the script, based on the configuration specified by the 'logging' attribute of the command line arguments. :param args: A Namespace object containing a 'logging' attribute specifying the name of a loggi...
keyword[def] identifier[_setup_logging] ( identifier[args] ): literal[string] identifier[log_conf] = identifier[getattr] ( identifier[args] , literal[string] , keyword[None] ) keyword[if] identifier[log_conf] : identifier[logging] . identifier[config] . identifier[fileConfig] ( identifier[l...
def _setup_logging(args): """ Set up logging for the script, based on the configuration specified by the 'logging' attribute of the command line arguments. :param args: A Namespace object containing a 'logging' attribute specifying the name of a logging configuration file ...
def index_buses(self, buses=None, start=0): """ Updates the indices of all buses. @param start: Starting index, typically 0 or 1. @type start: int """ bs = self.connected_buses if buses is None else buses for i, b in enumerate(bs): b._i = start + i
def function[index_buses, parameter[self, buses, start]]: constant[ Updates the indices of all buses. @param start: Starting index, typically 0 or 1. @type start: int ] variable[bs] assign[=] <ast.IfExp object at 0x7da1b25d1030> for taget[tuple[[<ast.Name object at 0x7da...
keyword[def] identifier[index_buses] ( identifier[self] , identifier[buses] = keyword[None] , identifier[start] = literal[int] ): literal[string] identifier[bs] = identifier[self] . identifier[connected_buses] keyword[if] identifier[buses] keyword[is] keyword[None] keyword[else] identifier[bu...
def index_buses(self, buses=None, start=0): """ Updates the indices of all buses. @param start: Starting index, typically 0 or 1. @type start: int """ bs = self.connected_buses if buses is None else buses for (i, b) in enumerate(bs): b._i = start + i # depends on [control=[...
def apply(self, collection, ops, resource=None, **kwargs): """Filter given collection.""" mfield = self.mfield or resource.meta.model._meta.fields.get(self.field.attribute) if mfield: collection = collection.where(*[op(mfield, val) for op, val in ops]) return collection
def function[apply, parameter[self, collection, ops, resource]]: constant[Filter given collection.] variable[mfield] assign[=] <ast.BoolOp object at 0x7da1b0a9d2d0> if name[mfield] begin[:] variable[collection] assign[=] call[name[collection].where, parameter[<ast.Starred object ...
keyword[def] identifier[apply] ( identifier[self] , identifier[collection] , identifier[ops] , identifier[resource] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[mfield] = identifier[self] . identifier[mfield] keyword[or] identifier[resource] . identifier[meta] . identifier...
def apply(self, collection, ops, resource=None, **kwargs): """Filter given collection.""" mfield = self.mfield or resource.meta.model._meta.fields.get(self.field.attribute) if mfield: collection = collection.where(*[op(mfield, val) for (op, val) in ops]) # depends on [control=['if'], data=[]] r...
def parse_response(self, response): """ Evaluates the action-call response from a FritzBox. The response is a xml byte-string. Returns a dictionary with the received arguments-value pairs. The values are converted according to the given data_types. TODO: boolean and signe...
def function[parse_response, parameter[self, response]]: constant[ Evaluates the action-call response from a FritzBox. The response is a xml byte-string. Returns a dictionary with the received arguments-value pairs. The values are converted according to the given data_types. ...
keyword[def] identifier[parse_response] ( identifier[self] , identifier[response] ): literal[string] identifier[result] ={} identifier[root] = identifier[etree] . identifier[fromstring] ( identifier[response] ) keyword[for] identifier[argument] keyword[in] identifier[self] . id...
def parse_response(self, response): """ Evaluates the action-call response from a FritzBox. The response is a xml byte-string. Returns a dictionary with the received arguments-value pairs. The values are converted according to the given data_types. TODO: boolean and signed in...
def _algo_check_for_section_problems(self, ro_rw_zi): """! @brief Return a string describing any errors with the layout or None if good""" s_ro, s_rw, s_zi = ro_rw_zi if s_ro is None: return "RO section is missing" if s_rw is None: return "RW section is missing" ...
def function[_algo_check_for_section_problems, parameter[self, ro_rw_zi]]: constant[! @brief Return a string describing any errors with the layout or None if good] <ast.Tuple object at 0x7da18f723640> assign[=] name[ro_rw_zi] if compare[name[s_ro] is constant[None]] begin[:] return[const...
keyword[def] identifier[_algo_check_for_section_problems] ( identifier[self] , identifier[ro_rw_zi] ): literal[string] identifier[s_ro] , identifier[s_rw] , identifier[s_zi] = identifier[ro_rw_zi] keyword[if] identifier[s_ro] keyword[is] keyword[None] : keyword[return] li...
def _algo_check_for_section_problems(self, ro_rw_zi): """! @brief Return a string describing any errors with the layout or None if good""" (s_ro, s_rw, s_zi) = ro_rw_zi if s_ro is None: return 'RO section is missing' # depends on [control=['if'], data=[]] if s_rw is None: return 'RW sec...
def _prepare_by_column_dtype(self, X): """Get distance functions for each column's dtype""" if not isinstance(X, pandas.DataFrame): raise TypeError('X must be a pandas DataFrame') numeric_columns = [] nominal_columns = [] numeric_ranges = [] fit_data = numpy...
def function[_prepare_by_column_dtype, parameter[self, X]]: constant[Get distance functions for each column's dtype] if <ast.UnaryOp object at 0x7da1b17e3130> begin[:] <ast.Raise object at 0x7da1b17e0610> variable[numeric_columns] assign[=] list[[]] variable[nominal_columns] assi...
keyword[def] identifier[_prepare_by_column_dtype] ( identifier[self] , identifier[X] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[X] , identifier[pandas] . identifier[DataFrame] ): keyword[raise] identifier[TypeError] ( literal[string] ) ...
def _prepare_by_column_dtype(self, X): """Get distance functions for each column's dtype""" if not isinstance(X, pandas.DataFrame): raise TypeError('X must be a pandas DataFrame') # depends on [control=['if'], data=[]] numeric_columns = [] nominal_columns = [] numeric_ranges = [] fit_da...
def __lists_to_str(self): """ There are some data lists that we collected across the dataset that need to be concatenated into a single string before writing to the text file. :return none: """ # ["archive_type", "sensor_genus", "sensor_species", "investigator"] i...
def function[__lists_to_str, parameter[self]]: constant[ There are some data lists that we collected across the dataset that need to be concatenated into a single string before writing to the text file. :return none: ] if call[name[self].lsts_tmp][constant[archive]] begin...
keyword[def] identifier[__lists_to_str] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[lsts_tmp] [ literal[string] ]: identifier[self] . identifier[noaa_data_sorted] [ literal[string] ][ literal[string] ]= literal[string] . identifier[join] ( ...
def __lists_to_str(self): """ There are some data lists that we collected across the dataset that need to be concatenated into a single string before writing to the text file. :return none: """ # ["archive_type", "sensor_genus", "sensor_species", "investigator"] if self.lsts_...
def str_replace(x, pat, repl, n=-1, flags=0, regex=False): """Replace occurences of a pattern/regex in a column with some other string. :param str pattern: string or a regex pattern :param str replace: a replacement string :param int n: number of replacements to be made from the start. If -1 make all r...
def function[str_replace, parameter[x, pat, repl, n, flags, regex]]: constant[Replace occurences of a pattern/regex in a column with some other string. :param str pattern: string or a regex pattern :param str replace: a replacement string :param int n: number of replacements to be made from the sta...
keyword[def] identifier[str_replace] ( identifier[x] , identifier[pat] , identifier[repl] , identifier[n] =- literal[int] , identifier[flags] = literal[int] , identifier[regex] = keyword[False] ): literal[string] identifier[sl] = identifier[_to_string_sequence] ( identifier[x] ). identifier[replace] ( iden...
def str_replace(x, pat, repl, n=-1, flags=0, regex=False): """Replace occurences of a pattern/regex in a column with some other string. :param str pattern: string or a regex pattern :param str replace: a replacement string :param int n: number of replacements to be made from the start. If -1 make all r...
def data_uuids(self, uuids, start, end, archiver="", timeout=DEFAULT_TIMEOUT): """ With the given list of UUIDs, retrieves all RAW data between the 2 given timestamps Arguments: [uuids]: list of UUIDs [start, end]: time references: [archiver]: if specified, this is the a...
def function[data_uuids, parameter[self, uuids, start, end, archiver, timeout]]: constant[ With the given list of UUIDs, retrieves all RAW data between the 2 given timestamps Arguments: [uuids]: list of UUIDs [start, end]: time references: [archiver]: if specified, this ...
keyword[def] identifier[data_uuids] ( identifier[self] , identifier[uuids] , identifier[start] , identifier[end] , identifier[archiver] = literal[string] , identifier[timeout] = identifier[DEFAULT_TIMEOUT] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[uuids] , id...
def data_uuids(self, uuids, start, end, archiver='', timeout=DEFAULT_TIMEOUT): """ With the given list of UUIDs, retrieves all RAW data between the 2 given timestamps Arguments: [uuids]: list of UUIDs [start, end]: time references: [archiver]: if specified, this is the archi...
def _ParseArgs(self, args, known_only): """Helper function to do the main argument parsing. This function goes through args and does the bulk of the flag parsing. It will find the corresponding flag in our flag dictionary, and call its .parse() method on the flag value. Args: args: List of s...
def function[_ParseArgs, parameter[self, args, known_only]]: constant[Helper function to do the main argument parsing. This function goes through args and does the bulk of the flag parsing. It will find the corresponding flag in our flag dictionary, and call its .parse() method on the flag value. ...
keyword[def] identifier[_ParseArgs] ( identifier[self] , identifier[args] , identifier[known_only] ): literal[string] identifier[unknown_flags] , identifier[unparsed_args] , identifier[undefok] =[],[], identifier[set] () identifier[flag_dict] = identifier[self] . identifier[FlagDict] () identifi...
def _ParseArgs(self, args, known_only): """Helper function to do the main argument parsing. This function goes through args and does the bulk of the flag parsing. It will find the corresponding flag in our flag dictionary, and call its .parse() method on the flag value. Args: args: List of s...
def get_child_work_units(self, worker_id): '''Get work units assigned to a worker's children. Returns a dictionary mapping worker ID to :class:`WorkUnit`. If a child exists but is idle, that worker ID will map to :const:`None`. The work unit may already be expired or assigned t...
def function[get_child_work_units, parameter[self, worker_id]]: constant[Get work units assigned to a worker's children. Returns a dictionary mapping worker ID to :class:`WorkUnit`. If a child exists but is idle, that worker ID will map to :const:`None`. The work unit may already be ex...
keyword[def] identifier[get_child_work_units] ( identifier[self] , identifier[worker_id] ): literal[string] identifier[result] ={} keyword[with] identifier[self] . identifier[registry] . identifier[lock] ( identifier[identifier] = identifier[worker_id] ) keyword[as] identifier[session] :...
def get_child_work_units(self, worker_id): """Get work units assigned to a worker's children. Returns a dictionary mapping worker ID to :class:`WorkUnit`. If a child exists but is idle, that worker ID will map to :const:`None`. The work unit may already be expired or assigned to a ...
def get_provider(): '''Get the current provider from config''' name = get_config('provider') available = entrypoints.get_all('udata.avatars') if name not in available: raise ValueError('Unknown avatar provider: {0}'.format(name)) return available[name]
def function[get_provider, parameter[]]: constant[Get the current provider from config] variable[name] assign[=] call[name[get_config], parameter[constant[provider]]] variable[available] assign[=] call[name[entrypoints].get_all, parameter[constant[udata.avatars]]] if compare[name[name] <...
keyword[def] identifier[get_provider] (): literal[string] identifier[name] = identifier[get_config] ( literal[string] ) identifier[available] = identifier[entrypoints] . identifier[get_all] ( literal[string] ) keyword[if] identifier[name] keyword[not] keyword[in] identifier[available] : ...
def get_provider(): """Get the current provider from config""" name = get_config('provider') available = entrypoints.get_all('udata.avatars') if name not in available: raise ValueError('Unknown avatar provider: {0}'.format(name)) # depends on [control=['if'], data=['name']] return available...
def clear(self): """Executes an HTTP request to clear all contents of a queue.""" url = "queues/%s/messages" % self.name result = self.client.delete(url = url, body = json.dumps({}), headers={'Content-Type': 'application/jso...
def function[clear, parameter[self]]: constant[Executes an HTTP request to clear all contents of a queue.] variable[url] assign[=] binary_operation[constant[queues/%s/messages] <ast.Mod object at 0x7da2590d6920> name[self].name] variable[result] assign[=] call[name[self].client.delete, parameter...
keyword[def] identifier[clear] ( identifier[self] ): literal[string] identifier[url] = literal[string] % identifier[self] . identifier[name] identifier[result] = identifier[self] . identifier[client] . identifier[delete] ( identifier[url] = identifier[url] , identifier[body] = id...
def clear(self): """Executes an HTTP request to clear all contents of a queue.""" url = 'queues/%s/messages' % self.name result = self.client.delete(url=url, body=json.dumps({}), headers={'Content-Type': 'application/json'}) return result['body']
def google_cloud_to_local(self, file_name): """ Checks whether the file specified by file_name is stored in Google Cloud Storage (GCS), if so, downloads the file and saves it locally. The full path of the saved file will be returned. Otherwise the local file_name will be returned...
def function[google_cloud_to_local, parameter[self, file_name]]: constant[ Checks whether the file specified by file_name is stored in Google Cloud Storage (GCS), if so, downloads the file and saves it locally. The full path of the saved file will be returned. Otherwise the local file_na...
keyword[def] identifier[google_cloud_to_local] ( identifier[self] , identifier[file_name] ): literal[string] keyword[if] keyword[not] identifier[file_name] . identifier[startswith] ( literal[string] ): keyword[return] identifier[file_name] identi...
def google_cloud_to_local(self, file_name): """ Checks whether the file specified by file_name is stored in Google Cloud Storage (GCS), if so, downloads the file and saves it locally. The full path of the saved file will be returned. Otherwise the local file_name will be returned imm...
def track_change(self, instance, resolution_level=0): """ Change tracking options for the already tracked object 'instance'. If instance is not tracked, a KeyError will be raised. """ tobj = self.objects[id(instance)] tobj.set_resolution_level(resolution_level)
def function[track_change, parameter[self, instance, resolution_level]]: constant[ Change tracking options for the already tracked object 'instance'. If instance is not tracked, a KeyError will be raised. ] variable[tobj] assign[=] call[name[self].objects][call[name[id], paramete...
keyword[def] identifier[track_change] ( identifier[self] , identifier[instance] , identifier[resolution_level] = literal[int] ): literal[string] identifier[tobj] = identifier[self] . identifier[objects] [ identifier[id] ( identifier[instance] )] identifier[tobj] . identifier[set_resolution...
def track_change(self, instance, resolution_level=0): """ Change tracking options for the already tracked object 'instance'. If instance is not tracked, a KeyError will be raised. """ tobj = self.objects[id(instance)] tobj.set_resolution_level(resolution_level)
def call_api(event, app_name, app_swagger_path, logger, strict_validation=True, validate_responses=True, cache_app=True): """Wire up the incoming Lambda/API Gateway request to an application. :param dict event: Dictionary containing the entire request template. This can vary wildly ...
def function[call_api, parameter[event, app_name, app_swagger_path, logger, strict_validation, validate_responses, cache_app]]: constant[Wire up the incoming Lambda/API Gateway request to an application. :param dict event: Dictionary containing the entire request template. This can vary wildly ...
keyword[def] identifier[call_api] ( identifier[event] , identifier[app_name] , identifier[app_swagger_path] , identifier[logger] , identifier[strict_validation] = keyword[True] , identifier[validate_responses] = keyword[True] , identifier[cache_app] = keyword[True] ): literal[string] identifier[app] = ide...
def call_api(event, app_name, app_swagger_path, logger, strict_validation=True, validate_responses=True, cache_app=True): """Wire up the incoming Lambda/API Gateway request to an application. :param dict event: Dictionary containing the entire request template. This can vary wildly depending on...
async def close_interface(self, conn_id, interface): """Close an interface on this IOTile device. See :meth:`AbstractDeviceAdapter.close_interface`. """ adapter_id = self._get_property(conn_id, 'adapter') await self.adapters[adapter_id].close_interface(conn_id, interface)
<ast.AsyncFunctionDef object at 0x7da2046232b0>
keyword[async] keyword[def] identifier[close_interface] ( identifier[self] , identifier[conn_id] , identifier[interface] ): literal[string] identifier[adapter_id] = identifier[self] . identifier[_get_property] ( identifier[conn_id] , literal[string] ) keyword[await] identifier[self] . i...
async def close_interface(self, conn_id, interface): """Close an interface on this IOTile device. See :meth:`AbstractDeviceAdapter.close_interface`. """ adapter_id = self._get_property(conn_id, 'adapter') await self.adapters[adapter_id].close_interface(conn_id, interface)
def set_release_actions(self, actions): """Set the widget that gives users options about the release, e.g. importing references :param actions: Release actions that define the sanity checks and cleanup actions :type actions: :class:`jukeboxcore.release.ReleaseActions` :returns: None ...
def function[set_release_actions, parameter[self, actions]]: constant[Set the widget that gives users options about the release, e.g. importing references :param actions: Release actions that define the sanity checks and cleanup actions :type actions: :class:`jukeboxcore.release.ReleaseActions`...
keyword[def] identifier[set_release_actions] ( identifier[self] , identifier[actions] ): literal[string] identifier[self] . identifier[release_actions] = identifier[actions] identifier[self] . identifier[option_widget] = identifier[self] . identifier[release_actions] . identifier[option_w...
def set_release_actions(self, actions): """Set the widget that gives users options about the release, e.g. importing references :param actions: Release actions that define the sanity checks and cleanup actions :type actions: :class:`jukeboxcore.release.ReleaseActions` :returns: None ...
def ListChildren(self, limit=None, age=NEWEST_TIME): """Yields RDFURNs of all the children of this object. Args: limit: Total number of items we will attempt to retrieve. age: The age of the items to retrieve. Should be one of ALL_TIMES, NEWEST_TIME or a range in microseconds. Yields: ...
def function[ListChildren, parameter[self, limit, age]]: constant[Yields RDFURNs of all the children of this object. Args: limit: Total number of items we will attempt to retrieve. age: The age of the items to retrieve. Should be one of ALL_TIMES, NEWEST_TIME or a range in microseconds....
keyword[def] identifier[ListChildren] ( identifier[self] , identifier[limit] = keyword[None] , identifier[age] = identifier[NEWEST_TIME] ): literal[string] keyword[for] identifier[predicate] , identifier[timestamp] keyword[in] identifier[data_store] . identifier[DB] . identifier[AFF4FetchChildren] ...
def ListChildren(self, limit=None, age=NEWEST_TIME): """Yields RDFURNs of all the children of this object. Args: limit: Total number of items we will attempt to retrieve. age: The age of the items to retrieve. Should be one of ALL_TIMES, NEWEST_TIME or a range in microseconds. Yields: ...
def locate_module(module_id: str, module_type: str = None): """ Locate module by module ID Args: module_id: Module ID module_type: Type of module, one of ``'master'``, ``'slave'`` and ``'middleware'`` """ entry_point = None if module_type: entry_point = 'ehforwarderbot...
def function[locate_module, parameter[module_id, module_type]]: constant[ Locate module by module ID Args: module_id: Module ID module_type: Type of module, one of ``'master'``, ``'slave'`` and ``'middleware'`` ] variable[entry_point] assign[=] constant[None] if name...
keyword[def] identifier[locate_module] ( identifier[module_id] : identifier[str] , identifier[module_type] : identifier[str] = keyword[None] ): literal[string] identifier[entry_point] = keyword[None] keyword[if] identifier[module_type] : identifier[entry_point] = literal[string] % identif...
def locate_module(module_id: str, module_type: str=None): """ Locate module by module ID Args: module_id: Module ID module_type: Type of module, one of ``'master'``, ``'slave'`` and ``'middleware'`` """ entry_point = None if module_type: entry_point = 'ehforwarderbot.%s'...
def traverse_tree(cls, static_dir): """traverse the static folders an look for at least one file ending in .scss/.sass""" for root, dirs, files in os.walk(static_dir): for filename in files: if cls._pattern.match(filename): APPS_INCLUDE_DIRS.append(static_...
def function[traverse_tree, parameter[cls, static_dir]]: constant[traverse the static folders an look for at least one file ending in .scss/.sass] for taget[tuple[[<ast.Name object at 0x7da20c7cb610>, <ast.Name object at 0x7da20c7c9bd0>, <ast.Name object at 0x7da20c7c8b80>]]] in starred[call[name[os].wa...
keyword[def] identifier[traverse_tree] ( identifier[cls] , identifier[static_dir] ): literal[string] keyword[for] identifier[root] , identifier[dirs] , identifier[files] keyword[in] identifier[os] . identifier[walk] ( identifier[static_dir] ): keyword[for] identifier[filename] key...
def traverse_tree(cls, static_dir): """traverse the static folders an look for at least one file ending in .scss/.sass""" for (root, dirs, files) in os.walk(static_dir): for filename in files: if cls._pattern.match(filename): APPS_INCLUDE_DIRS.append(static_dir) ...
def stretch(self, factor, window=20): '''Change the audio duration (but not its pitch). **Unless factor is close to 1, use the tempo effect instead.** This effect is broadly equivalent to the tempo effect with search set to zero, so in general, its results are comparatively poor; it is ...
def function[stretch, parameter[self, factor, window]]: constant[Change the audio duration (but not its pitch). **Unless factor is close to 1, use the tempo effect instead.** This effect is broadly equivalent to the tempo effect with search set to zero, so in general, its results are co...
keyword[def] identifier[stretch] ( identifier[self] , identifier[factor] , identifier[window] = literal[int] ): literal[string] keyword[if] keyword[not] identifier[is_number] ( identifier[factor] ) keyword[or] identifier[factor] <= literal[int] : keyword[raise] identifier[ValueErro...
def stretch(self, factor, window=20): """Change the audio duration (but not its pitch). **Unless factor is close to 1, use the tempo effect instead.** This effect is broadly equivalent to the tempo effect with search set to zero, so in general, its results are comparatively poor; it is ...
def get_allowed_geometries(layer_purpose_key): """Helper function to get all possible geometry :param layer_purpose_key: A layer purpose key. :type layer_purpose_key: str :returns: List of all allowed geometries. :rtype: list """ preferred_order = [ 'point', 'line', ...
def function[get_allowed_geometries, parameter[layer_purpose_key]]: constant[Helper function to get all possible geometry :param layer_purpose_key: A layer purpose key. :type layer_purpose_key: str :returns: List of all allowed geometries. :rtype: list ] variable[preferred_order] a...
keyword[def] identifier[get_allowed_geometries] ( identifier[layer_purpose_key] ): literal[string] identifier[preferred_order] =[ literal[string] , literal[string] , literal[string] , literal[string] ] identifier[allowed_geometries] = identifier[set] () identifier[all_lay...
def get_allowed_geometries(layer_purpose_key): """Helper function to get all possible geometry :param layer_purpose_key: A layer purpose key. :type layer_purpose_key: str :returns: List of all allowed geometries. :rtype: list """ preferred_order = ['point', 'line', 'polygon', 'raster'] ...
def invokeCmd(rh): """ Invoke the command in the virtual machine's operating system. Input: Request Handle with the following properties: function - 'CMDVM' subfunction - 'CMD' userid - userid of the virtual machine parms['cmd'] - Command to send ...
def function[invokeCmd, parameter[rh]]: constant[ Invoke the command in the virtual machine's operating system. Input: Request Handle with the following properties: function - 'CMDVM' subfunction - 'CMD' userid - userid of the virtual machine parms...
keyword[def] identifier[invokeCmd] ( identifier[rh] ): literal[string] identifier[rh] . identifier[printSysLog] ( literal[string] + identifier[rh] . identifier[userid] ) identifier[results] = identifier[execCmdThruIUCV] ( identifier[rh] , identifier[rh] . identifier[userid] , identifier[rh] . identi...
def invokeCmd(rh): """ Invoke the command in the virtual machine's operating system. Input: Request Handle with the following properties: function - 'CMDVM' subfunction - 'CMD' userid - userid of the virtual machine parms['cmd'] - Command to send ...
def _pre_install(): '''Initialize the parse table at install time''' # Generate the parsetab.dat file at setup time dat = join(setup_dir, 'src', 'hcl', 'parsetab.dat') if exists(dat): os.unlink(dat) sys.path.insert(0, join(setup_dir, 'src')) import hcl from hcl.parser import HclPa...
def function[_pre_install, parameter[]]: constant[Initialize the parse table at install time] variable[dat] assign[=] call[name[join], parameter[name[setup_dir], constant[src], constant[hcl], constant[parsetab.dat]]] if call[name[exists], parameter[name[dat]]] begin[:] call[name[...
keyword[def] identifier[_pre_install] (): literal[string] identifier[dat] = identifier[join] ( identifier[setup_dir] , literal[string] , literal[string] , literal[string] ) keyword[if] identifier[exists] ( identifier[dat] ): identifier[os] . identifier[unlink] ( identifier[dat] ) ...
def _pre_install(): """Initialize the parse table at install time""" # Generate the parsetab.dat file at setup time dat = join(setup_dir, 'src', 'hcl', 'parsetab.dat') if exists(dat): os.unlink(dat) # depends on [control=['if'], data=[]] sys.path.insert(0, join(setup_dir, 'src')) import...
def Glide(self): """Return the snapshot in glide.lock form """ dict = { "hash": "???", "updated": str(datetime.datetime.now(tz=pytz.utc).isoformat()), "imports": [], } decomposer = ImportPathsDecomposerBuilder().buildLocalDecomposer() ...
def function[Glide, parameter[self]]: constant[Return the snapshot in glide.lock form ] variable[dict] assign[=] dictionary[[<ast.Constant object at 0x7da1b2392200>, <ast.Constant object at 0x7da1b2390040>, <ast.Constant object at 0x7da1b23900d0>], [<ast.Constant object at 0x7da1b2390f10>, <ast....
keyword[def] identifier[Glide] ( identifier[self] ): literal[string] identifier[dict] ={ literal[string] : literal[string] , literal[string] : identifier[str] ( identifier[datetime] . identifier[datetime] . identifier[now] ( identifier[tz] = identifier[pytz] . identifier[utc] ). i...
def Glide(self): """Return the snapshot in glide.lock form """ dict = {'hash': '???', 'updated': str(datetime.datetime.now(tz=pytz.utc).isoformat()), 'imports': []} decomposer = ImportPathsDecomposerBuilder().buildLocalDecomposer() decomposer.decompose(self._packages.keys()) classes = decomp...
def inasafe_place_value_name(number, feature, parent): """Given a number, it will return the place value name. For instance: * inasafe_place_value_name(10) -> Ten \n * inasafe_place_value_name(1700) -> Thousand It needs to be used with inasafe_place_value_coefficient. """ _ = feature, pa...
def function[inasafe_place_value_name, parameter[number, feature, parent]]: constant[Given a number, it will return the place value name. For instance: * inasafe_place_value_name(10) -> Ten * inasafe_place_value_name(1700) -> Thousand It needs to be used with inasafe_place_value_coefficien...
keyword[def] identifier[inasafe_place_value_name] ( identifier[number] , identifier[feature] , identifier[parent] ): literal[string] identifier[_] = identifier[feature] , identifier[parent] keyword[if] identifier[number] keyword[is] keyword[None] : keyword[return] keyword[None] ide...
def inasafe_place_value_name(number, feature, parent): """Given a number, it will return the place value name. For instance: * inasafe_place_value_name(10) -> Ten * inasafe_place_value_name(1700) -> Thousand It needs to be used with inasafe_place_value_coefficient. """ _ = (feature, pa...
def get_collection(self, service_name, collection_name, base_class=None): """ Returns a ``Collection`` **class** for a given service. :param service_name: A string that specifies the name of the desired service. Ex. ``sqs``, ``sns``, ``dynamodb``, etc. :type service_name: st...
def function[get_collection, parameter[self, service_name, collection_name, base_class]]: constant[ Returns a ``Collection`` **class** for a given service. :param service_name: A string that specifies the name of the desired service. Ex. ``sqs``, ``sns``, ``dynamodb``, etc. ...
keyword[def] identifier[get_collection] ( identifier[self] , identifier[service_name] , identifier[collection_name] , identifier[base_class] = keyword[None] ): literal[string] keyword[try] : keyword[return] identifier[self] . identifier[cache] . identifier[get_collection] ( ...
def get_collection(self, service_name, collection_name, base_class=None): """ Returns a ``Collection`` **class** for a given service. :param service_name: A string that specifies the name of the desired service. Ex. ``sqs``, ``sns``, ``dynamodb``, etc. :type service_name: string...
def IsWalletTransaction(self, tx): """ Verifies if a transaction belongs to the wallet. Args: tx (TransactionOutput):an instance of type neo.Core.TX.Transaction.TransactionOutput to verify. Returns: bool: True, if transaction belongs to wallet. False, if not. ...
def function[IsWalletTransaction, parameter[self, tx]]: constant[ Verifies if a transaction belongs to the wallet. Args: tx (TransactionOutput):an instance of type neo.Core.TX.Transaction.TransactionOutput to verify. Returns: bool: True, if transaction belongs t...
keyword[def] identifier[IsWalletTransaction] ( identifier[self] , identifier[tx] ): literal[string] keyword[for] identifier[key] , identifier[contract] keyword[in] identifier[self] . identifier[_contracts] . identifier[items] (): keyword[for] identifier[output] keyword[in] ident...
def IsWalletTransaction(self, tx): """ Verifies if a transaction belongs to the wallet. Args: tx (TransactionOutput):an instance of type neo.Core.TX.Transaction.TransactionOutput to verify. Returns: bool: True, if transaction belongs to wallet. False, if not. ...
def _iterate(self, delay=None, fromqt=False): """See twisted.internet.interfaces.IReactorCore.iterate. """ self.runUntilCurrent() self.doIteration(delay, fromqt)
def function[_iterate, parameter[self, delay, fromqt]]: constant[See twisted.internet.interfaces.IReactorCore.iterate. ] call[name[self].runUntilCurrent, parameter[]] call[name[self].doIteration, parameter[name[delay], name[fromqt]]]
keyword[def] identifier[_iterate] ( identifier[self] , identifier[delay] = keyword[None] , identifier[fromqt] = keyword[False] ): literal[string] identifier[self] . identifier[runUntilCurrent] () identifier[self] . identifier[doIteration] ( identifier[delay] , identifier[fromqt] )
def _iterate(self, delay=None, fromqt=False): """See twisted.internet.interfaces.IReactorCore.iterate. """ self.runUntilCurrent() self.doIteration(delay, fromqt)
def get_record(self, xml_file): """ Reads a xml file in JATS format and returns a xml string in marc format """ self.document = parse(xml_file) if get_value_in_tag(self.document, "meta"): raise ApsPackageXMLError("The XML format of %s is not correct" ...
def function[get_record, parameter[self, xml_file]]: constant[ Reads a xml file in JATS format and returns a xml string in marc format ] name[self].document assign[=] call[name[parse], parameter[name[xml_file]]] if call[name[get_value_in_tag], parameter[name[self].document, constant[...
keyword[def] identifier[get_record] ( identifier[self] , identifier[xml_file] ): literal[string] identifier[self] . identifier[document] = identifier[parse] ( identifier[xml_file] ) keyword[if] identifier[get_value_in_tag] ( identifier[self] . identifier[document] , literal[string] ): ...
def get_record(self, xml_file): """ Reads a xml file in JATS format and returns a xml string in marc format """ self.document = parse(xml_file) if get_value_in_tag(self.document, 'meta'): raise ApsPackageXMLError('The XML format of %s is not correct' % (xml_file,)) # depends on [control...
def create_userpass(self, username, password, policies, mount_point='userpass', **kwargs): """POST /auth/<mount point>/users/<username> :param username: :type username: :param password: :type password: :param policies: :type policies: :param mount_point: ...
def function[create_userpass, parameter[self, username, password, policies, mount_point]]: constant[POST /auth/<mount point>/users/<username> :param username: :type username: :param password: :type password: :param policies: :type policies: :param mount_p...
keyword[def] identifier[create_userpass] ( identifier[self] , identifier[username] , identifier[password] , identifier[policies] , identifier[mount_point] = literal[string] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[isinstance] ( identifier[policies] ,( ide...
def create_userpass(self, username, password, policies, mount_point='userpass', **kwargs): """POST /auth/<mount point>/users/<username> :param username: :type username: :param password: :type password: :param policies: :type policies: :param mount_point: ...
def _parse_value_pb(value_pb, field_type): """Convert a Value protobuf to cell data. :type value_pb: :class:`~google.protobuf.struct_pb2.Value` :param value_pb: protobuf to convert :type field_type: :class:`~google.cloud.spanner_v1.proto.type_pb2.Type` :param field_type: type code for the value ...
def function[_parse_value_pb, parameter[value_pb, field_type]]: constant[Convert a Value protobuf to cell data. :type value_pb: :class:`~google.protobuf.struct_pb2.Value` :param value_pb: protobuf to convert :type field_type: :class:`~google.cloud.spanner_v1.proto.type_pb2.Type` :param field_t...
keyword[def] identifier[_parse_value_pb] ( identifier[value_pb] , identifier[field_type] ): literal[string] keyword[if] identifier[value_pb] . identifier[HasField] ( literal[string] ): keyword[return] keyword[None] keyword[if] identifier[field_type] . identifier[code] == identifier[type_p...
def _parse_value_pb(value_pb, field_type): """Convert a Value protobuf to cell data. :type value_pb: :class:`~google.protobuf.struct_pb2.Value` :param value_pb: protobuf to convert :type field_type: :class:`~google.cloud.spanner_v1.proto.type_pb2.Type` :param field_type: type code for the value ...
def _connect(self, context): """Initialize the database connection.""" if __debug__: log.info("Connecting " + self.engine.partition(':')[0] + " database layer.", extra=dict( uri = redact_uri(self.uri, self.protect), config = self.config, alias = self.alias, )) self.connection = context...
def function[_connect, parameter[self, context]]: constant[Initialize the database connection.] if name[__debug__] begin[:] call[name[log].info, parameter[binary_operation[binary_operation[constant[Connecting ] + call[call[name[self].engine.partition, parameter[constant[:]]]][constant[0]...
keyword[def] identifier[_connect] ( identifier[self] , identifier[context] ): literal[string] keyword[if] identifier[__debug__] : identifier[log] . identifier[info] ( literal[string] + identifier[self] . identifier[engine] . identifier[partition] ( literal[string] )[ literal[int] ]+ literal[string] , ide...
def _connect(self, context): """Initialize the database connection.""" if __debug__: log.info('Connecting ' + self.engine.partition(':')[0] + ' database layer.', extra=dict(uri=redact_uri(self.uri, self.protect), config=self.config, alias=self.alias)) # depends on [control=['if'], data=[]] self.con...
def __experimental_range(start, stop, var, cond, loc={}): '''Utility function made to reproduce range() with unit integer step but with the added possibility of specifying a condition on the looping variable (e.g. var % 2 == 0) ''' locals().update(loc) if start < stop: for __ in ...
def function[__experimental_range, parameter[start, stop, var, cond, loc]]: constant[Utility function made to reproduce range() with unit integer step but with the added possibility of specifying a condition on the looping variable (e.g. var % 2 == 0) ] call[call[name[locals], parame...
keyword[def] identifier[__experimental_range] ( identifier[start] , identifier[stop] , identifier[var] , identifier[cond] , identifier[loc] ={}): literal[string] identifier[locals] (). identifier[update] ( identifier[loc] ) keyword[if] identifier[start] < identifier[stop] : keyword[for] ide...
def __experimental_range(start, stop, var, cond, loc={}): """Utility function made to reproduce range() with unit integer step but with the added possibility of specifying a condition on the looping variable (e.g. var % 2 == 0) """ locals().update(loc) if start < stop: for __ in ...
def getpaths(struct): """ Maps all Tasks in a structured data object to their .output(). """ if isinstance(struct, Task): return struct.output() elif isinstance(struct, dict): return struct.__class__((k, getpaths(v)) for k, v in six.iteritems(struct)) elif isinstance(struct, (lis...
def function[getpaths, parameter[struct]]: constant[ Maps all Tasks in a structured data object to their .output(). ] if call[name[isinstance], parameter[name[struct], name[Task]]] begin[:] return[call[name[struct].output, parameter[]]]
keyword[def] identifier[getpaths] ( identifier[struct] ): literal[string] keyword[if] identifier[isinstance] ( identifier[struct] , identifier[Task] ): keyword[return] identifier[struct] . identifier[output] () keyword[elif] identifier[isinstance] ( identifier[struct] , identifier[dict] ):...
def getpaths(struct): """ Maps all Tasks in a structured data object to their .output(). """ if isinstance(struct, Task): return struct.output() # depends on [control=['if'], data=[]] elif isinstance(struct, dict): return struct.__class__(((k, getpaths(v)) for (k, v) in six.iteritem...
def tickEFP(self, tickerId, tickType, basisPoints, formattedBasisPoints, totalDividends, holdDays, futureExpiry, dividendImpact, dividendsToExpiry): """tickEFP(EWrapper self, TickerId tickerId, TickType tickType, double basisPoints, IBString const & formattedBasisPoints, double totalDividends, int holdDays, IBS...
def function[tickEFP, parameter[self, tickerId, tickType, basisPoints, formattedBasisPoints, totalDividends, holdDays, futureExpiry, dividendImpact, dividendsToExpiry]]: constant[tickEFP(EWrapper self, TickerId tickerId, TickType tickType, double basisPoints, IBString const & formattedBasisPoints, double totalD...
keyword[def] identifier[tickEFP] ( identifier[self] , identifier[tickerId] , identifier[tickType] , identifier[basisPoints] , identifier[formattedBasisPoints] , identifier[totalDividends] , identifier[holdDays] , identifier[futureExpiry] , identifier[dividendImpact] , identifier[dividendsToExpiry] ): literal...
def tickEFP(self, tickerId, tickType, basisPoints, formattedBasisPoints, totalDividends, holdDays, futureExpiry, dividendImpact, dividendsToExpiry): """tickEFP(EWrapper self, TickerId tickerId, TickType tickType, double basisPoints, IBString const & formattedBasisPoints, double totalDividends, int holdDays, IBStrin...
def _generate_struct_class_custom_annotations(self, ns, data_type): """ The _process_custom_annotations function allows client code to access custom annotations defined in the spec. """ self.emit('def _process_custom_annotations(self, annotation_type, field_path, processor):') ...
def function[_generate_struct_class_custom_annotations, parameter[self, ns, data_type]]: constant[ The _process_custom_annotations function allows client code to access custom annotations defined in the spec. ] call[name[self].emit, parameter[constant[def _process_custom_annotati...
keyword[def] identifier[_generate_struct_class_custom_annotations] ( identifier[self] , identifier[ns] , identifier[data_type] ): literal[string] identifier[self] . identifier[emit] ( literal[string] ) keyword[with] identifier[self] . identifier[indent] (), identifier[emit_pass_if_nothin...
def _generate_struct_class_custom_annotations(self, ns, data_type): """ The _process_custom_annotations function allows client code to access custom annotations defined in the spec. """ self.emit('def _process_custom_annotations(self, annotation_type, field_path, processor):') with s...
def instruction_LSL_memory(self, opcode, ea, m): """ Logical shift left memory location / Arithmetic shift of memory left """ r = self.LSL(m) # log.debug("$%x LSL memory value $%x << 1 = $%x and write it to $%x \t| %s" % ( # self.program_counter, # m, r, ea, ...
def function[instruction_LSL_memory, parameter[self, opcode, ea, m]]: constant[ Logical shift left memory location / Arithmetic shift of memory left ] variable[r] assign[=] call[name[self].LSL, parameter[name[m]]] return[tuple[[<ast.Name object at 0x7da2054a63e0>, <ast.BinOp object a...
keyword[def] identifier[instruction_LSL_memory] ( identifier[self] , identifier[opcode] , identifier[ea] , identifier[m] ): literal[string] identifier[r] = identifier[self] . identifier[LSL] ( identifier[m] ) keyword[return] identifier[ea] , id...
def instruction_LSL_memory(self, opcode, ea, m): """ Logical shift left memory location / Arithmetic shift of memory left """ r = self.LSL(m) # log.debug("$%x LSL memory value $%x << 1 = $%x and write it to $%x \t| %s" % ( # self.program_counter, # m, r, ...
def _add_channel(self, chn, color_min, color_max): """Adds a channel to the image object """ if isinstance(chn, np.ma.core.MaskedArray): chn_data = chn.data chn_mask = chn.mask else: chn_data = np.array(chn) chn_mask = False scaled ...
def function[_add_channel, parameter[self, chn, color_min, color_max]]: constant[Adds a channel to the image object ] if call[name[isinstance], parameter[name[chn], name[np].ma.core.MaskedArray]] begin[:] variable[chn_data] assign[=] name[chn].data variable[chn_ma...
keyword[def] identifier[_add_channel] ( identifier[self] , identifier[chn] , identifier[color_min] , identifier[color_max] ): literal[string] keyword[if] identifier[isinstance] ( identifier[chn] , identifier[np] . identifier[ma] . identifier[core] . identifier[MaskedArray] ): identifi...
def _add_channel(self, chn, color_min, color_max): """Adds a channel to the image object """ if isinstance(chn, np.ma.core.MaskedArray): chn_data = chn.data chn_mask = chn.mask # depends on [control=['if'], data=[]] else: chn_data = np.array(chn) chn_mask = False ...
def Initialize(api_key, api_secret, api_host="localhost", api_port=443, api_ssl=True, asyncblock=False, timeout=10, req_method="get"): """ Initializes the Cloudstack API Accepts arguments: api_host (localhost) api_port (443) api_ssl (True) api_key ...
def function[Initialize, parameter[api_key, api_secret, api_host, api_port, api_ssl, asyncblock, timeout, req_method]]: constant[ Initializes the Cloudstack API Accepts arguments: api_host (localhost) api_port (443) api_ssl (True) api_key api_...
keyword[def] identifier[Initialize] ( identifier[api_key] , identifier[api_secret] , identifier[api_host] = literal[string] , identifier[api_port] = literal[int] , identifier[api_ssl] = keyword[True] , identifier[asyncblock] = keyword[False] , identifier[timeout] = literal[int] , identifier[req_method] = literal[stri...
def Initialize(api_key, api_secret, api_host='localhost', api_port=443, api_ssl=True, asyncblock=False, timeout=10, req_method='get'): """ Initializes the Cloudstack API Accepts arguments: api_host (localhost) api_port (443) api_ssl (True) api_key ...
def create_partition(analysis_request, request, analyses, sample_type=None, container=None, preservation=None, skip_fields=None, remove_primary_analyses=True): """ Creates a partition for the analysis_request (primary) passed in :param analysis_request: uid/brain/ob...
def function[create_partition, parameter[analysis_request, request, analyses, sample_type, container, preservation, skip_fields, remove_primary_analyses]]: constant[ Creates a partition for the analysis_request (primary) passed in :param analysis_request: uid/brain/object of IAnalysisRequest type :p...
keyword[def] identifier[create_partition] ( identifier[analysis_request] , identifier[request] , identifier[analyses] , identifier[sample_type] = keyword[None] , identifier[container] = keyword[None] , identifier[preservation] = keyword[None] , identifier[skip_fields] = keyword[None] , identifier[remove_primary_ana...
def create_partition(analysis_request, request, analyses, sample_type=None, container=None, preservation=None, skip_fields=None, remove_primary_analyses=True): """ Creates a partition for the analysis_request (primary) passed in :param analysis_request: uid/brain/object of IAnalysisRequest type :param r...
def set_field(self, field, rate, approach='linear', mode='persistent', wait_for_stability=True, delay=1): """Sets the magnetic field. :param field: The target field in Oersted. .. note:: The conversion is 1 Oe = 0.1 mT. :param rate: The field rate in Oersted per ...
def function[set_field, parameter[self, field, rate, approach, mode, wait_for_stability, delay]]: constant[Sets the magnetic field. :param field: The target field in Oersted. .. note:: The conversion is 1 Oe = 0.1 mT. :param rate: The field rate in Oersted per minute. :par...
keyword[def] identifier[set_field] ( identifier[self] , identifier[field] , identifier[rate] , identifier[approach] = literal[string] , identifier[mode] = literal[string] , identifier[wait_for_stability] = keyword[True] , identifier[delay] = literal[int] ): literal[string] identifier[self] . ident...
def set_field(self, field, rate, approach='linear', mode='persistent', wait_for_stability=True, delay=1): """Sets the magnetic field. :param field: The target field in Oersted. .. note:: The conversion is 1 Oe = 0.1 mT. :param rate: The field rate in Oersted per minute. :param...
def dict_filter_update(base, updates): # type: (dict, dict) -> None """ Update dict with None values filtered out. """ base.update((k, v) for k, v in updates.items() if v is not None)
def function[dict_filter_update, parameter[base, updates]]: constant[ Update dict with None values filtered out. ] call[name[base].update, parameter[<ast.GeneratorExp object at 0x7da1b0948bb0>]]
keyword[def] identifier[dict_filter_update] ( identifier[base] , identifier[updates] ): literal[string] identifier[base] . identifier[update] (( identifier[k] , identifier[v] ) keyword[for] identifier[k] , identifier[v] keyword[in] identifier[updates] . identifier[items] () keyword[if] identifier[v] ...
def dict_filter_update(base, updates): # type: (dict, dict) -> None '\n Update dict with None values filtered out.\n ' base.update(((k, v) for (k, v) in updates.items() if v is not None))
def _get_hanging_wall_term(self, C, dists, rup): """ Compute and return hanging wall model term, see page 1038. """ if rup.dip == 90.0: return np.zeros_like(dists.rx) else: Fhw = np.zeros_like(dists.rx) Fhw[dists.rx > 0] = 1. # Comp...
def function[_get_hanging_wall_term, parameter[self, C, dists, rup]]: constant[ Compute and return hanging wall model term, see page 1038. ] if compare[name[rup].dip equal[==] constant[90.0]] begin[:] return[call[name[np].zeros_like, parameter[name[dists].rx]]]
keyword[def] identifier[_get_hanging_wall_term] ( identifier[self] , identifier[C] , identifier[dists] , identifier[rup] ): literal[string] keyword[if] identifier[rup] . identifier[dip] == literal[int] : keyword[return] identifier[np] . identifier[zeros_like] ( identifier[dists] . id...
def _get_hanging_wall_term(self, C, dists, rup): """ Compute and return hanging wall model term, see page 1038. """ if rup.dip == 90.0: return np.zeros_like(dists.rx) # depends on [control=['if'], data=[]] else: Fhw = np.zeros_like(dists.rx) Fhw[dists.rx > 0] = 1.0 ...
def min_volatility(self): """ Minimise volatility. :return: asset weights for the volatility-minimising portfolio :rtype: dict """ args = (self.cov_matrix, self.gamma) result = sco.minimize( objective_functions.volatility, x0=self.initial_...
def function[min_volatility, parameter[self]]: constant[ Minimise volatility. :return: asset weights for the volatility-minimising portfolio :rtype: dict ] variable[args] assign[=] tuple[[<ast.Attribute object at 0x7da204565870>, <ast.Attribute object at 0x7da204566650>]...
keyword[def] identifier[min_volatility] ( identifier[self] ): literal[string] identifier[args] =( identifier[self] . identifier[cov_matrix] , identifier[self] . identifier[gamma] ) identifier[result] = identifier[sco] . identifier[minimize] ( identifier[objective_functions] . iden...
def min_volatility(self): """ Minimise volatility. :return: asset weights for the volatility-minimising portfolio :rtype: dict """ args = (self.cov_matrix, self.gamma) result = sco.minimize(objective_functions.volatility, x0=self.initial_guess, args=args, method='SLSQP', bou...
def idle_task(self): '''handle missing log data''' if self.download_last_timestamp is not None and time.time() - self.download_last_timestamp > 0.7: self.download_last_timestamp = time.time() self.handle_log_data_missing()
def function[idle_task, parameter[self]]: constant[handle missing log data] if <ast.BoolOp object at 0x7da18f09f6a0> begin[:] name[self].download_last_timestamp assign[=] call[name[time].time, parameter[]] call[name[self].handle_log_data_missing, parameter[]]
keyword[def] identifier[idle_task] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[download_last_timestamp] keyword[is] keyword[not] keyword[None] keyword[and] identifier[time] . identifier[time] ()- identifier[self] . identifier[download_last_timestamp] > lite...
def idle_task(self): """handle missing log data""" if self.download_last_timestamp is not None and time.time() - self.download_last_timestamp > 0.7: self.download_last_timestamp = time.time() self.handle_log_data_missing() # depends on [control=['if'], data=[]]
def search_conf_item(start_path, item_type, item_name): """ search expected function or variable recursive upward @param start_path: search start path item_type: "function" or "variable" item_name: function name or variable name e.g. search_...
def function[search_conf_item, parameter[start_path, item_type, item_name]]: constant[ search expected function or variable recursive upward @param start_path: search start path item_type: "function" or "variable" item_name: function name or variable name e.g....
keyword[def] identifier[search_conf_item] ( identifier[start_path] , identifier[item_type] , identifier[item_name] ): literal[string] identifier[dir_path] = identifier[os] . identifier[path] . identifier[dirname] ( identifier[os] . identifier[path] . identifier[abspath] ( identifier[start_path] )...
def search_conf_item(start_path, item_type, item_name): """ search expected function or variable recursive upward @param start_path: search start path item_type: "function" or "variable" item_name: function name or variable name e.g. search_conf_item('...
def addToCache(self, localFilePath, jobStoreFileID, callingFunc, mutable=False): """ Used to process the caching of a file. This depends on whether a file is being written to file store, or read from it. WRITING The file is in localTempDir. It needs to be linked into cache if pos...
def function[addToCache, parameter[self, localFilePath, jobStoreFileID, callingFunc, mutable]]: constant[ Used to process the caching of a file. This depends on whether a file is being written to file store, or read from it. WRITING The file is in localTempDir. It needs to be lin...
keyword[def] identifier[addToCache] ( identifier[self] , identifier[localFilePath] , identifier[jobStoreFileID] , identifier[callingFunc] , identifier[mutable] = keyword[False] ): literal[string] keyword[assert] identifier[callingFunc] keyword[in] ( literal[string] , literal[string] ) ke...
def addToCache(self, localFilePath, jobStoreFileID, callingFunc, mutable=False): """ Used to process the caching of a file. This depends on whether a file is being written to file store, or read from it. WRITING The file is in localTempDir. It needs to be linked into cache if possibl...
def get_rubric(self): """Gets the rubric. return: (osid.assessment.AssessmentTaken) - the assessment taken raise: IllegalState - ``has_rubric()`` is ``false`` raise: OperationFailed - unable to complete request *compliance: mandatory -- This method must be implemented.* ...
def function[get_rubric, parameter[self]]: constant[Gets the rubric. return: (osid.assessment.AssessmentTaken) - the assessment taken raise: IllegalState - ``has_rubric()`` is ``false`` raise: OperationFailed - unable to complete request *compliance: mandatory -- This method m...
keyword[def] identifier[get_rubric] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[bool] ( identifier[self] . identifier[_my_map] [ literal[string] ]): keyword[raise] identifier[errors] . identifier[IllegalState] ( literal[string] ) ident...
def get_rubric(self): """Gets the rubric. return: (osid.assessment.AssessmentTaken) - the assessment taken raise: IllegalState - ``has_rubric()`` is ``false`` raise: OperationFailed - unable to complete request *compliance: mandatory -- This method must be implemented.* "...
def psit(t, xp, x): """ score of the model (gradient of log-likelihood at theta=theta_0) """ if t == 0: return -0.5 / sigma0**2 + \ (0.5 * (1. - phi0**2) / sigma0**4) * (x - mu0)**2 else: return -0.5 / sigma0**2 + (0.5 / sigma0**4) * \ ((x - mu0) - phi0 * (xp - mu...
def function[psit, parameter[t, xp, x]]: constant[ score of the model (gradient of log-likelihood at theta=theta_0) ] if compare[name[t] equal[==] constant[0]] begin[:] return[binary_operation[binary_operation[<ast.UnaryOp object at 0x7da20e957dc0> / binary_operation[name[sigma0] ** constant...
keyword[def] identifier[psit] ( identifier[t] , identifier[xp] , identifier[x] ): literal[string] keyword[if] identifier[t] == literal[int] : keyword[return] - literal[int] / identifier[sigma0] ** literal[int] +( literal[int] *( literal[int] - identifier[phi0] ** literal[int] )/ identifier[sigma0...
def psit(t, xp, x): """ score of the model (gradient of log-likelihood at theta=theta_0) """ if t == 0: return -0.5 / sigma0 ** 2 + 0.5 * (1.0 - phi0 ** 2) / sigma0 ** 4 * (x - mu0) ** 2 # depends on [control=['if'], data=[]] else: return -0.5 / sigma0 ** 2 + 0.5 / sigma0 ** 4 * (x - mu...
def _image_gradients(self, input_csvlines, label, image_column_name): """Compute gradients from prob of label to image. Used by integrated gradients (probe).""" with tf.Graph().as_default() as g, tf.Session() as sess: logging_level = tf.logging.get_verbosity() try: ...
def function[_image_gradients, parameter[self, input_csvlines, label, image_column_name]]: constant[Compute gradients from prob of label to image. Used by integrated gradients (probe).] with call[call[name[tf].Graph, parameter[]].as_default, parameter[]] begin[:] variable[logging_level] ...
keyword[def] identifier[_image_gradients] ( identifier[self] , identifier[input_csvlines] , identifier[label] , identifier[image_column_name] ): literal[string] keyword[with] identifier[tf] . identifier[Graph] (). identifier[as_default] () keyword[as] identifier[g] , identifier[tf] . identifier[...
def _image_gradients(self, input_csvlines, label, image_column_name): """Compute gradients from prob of label to image. Used by integrated gradients (probe).""" with tf.Graph().as_default() as g, tf.Session() as sess: logging_level = tf.logging.get_verbosity() try: tf.logging.set_ver...