code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def get_token_network_identifiers( chain_state: ChainState, payment_network_id: PaymentNetworkID, ) -> List[TokenNetworkID]: """ Return the list of token networks registered with the given payment network. """ payment_network = chain_state.identifiers_to_paymentnetworks.get(payment_network_id) ...
def function[get_token_network_identifiers, parameter[chain_state, payment_network_id]]: constant[ Return the list of token networks registered with the given payment network. ] variable[payment_network] assign[=] call[name[chain_state].identifiers_to_paymentnetworks.get, parameter[name[payment_network_...
keyword[def] identifier[get_token_network_identifiers] ( identifier[chain_state] : identifier[ChainState] , identifier[payment_network_id] : identifier[PaymentNetworkID] , )-> identifier[List] [ identifier[TokenNetworkID] ]: literal[string] identifier[payment_network] = identifier[chain_state] . identifi...
def get_token_network_identifiers(chain_state: ChainState, payment_network_id: PaymentNetworkID) -> List[TokenNetworkID]: """ Return the list of token networks registered with the given payment network. """ payment_network = chain_state.identifiers_to_paymentnetworks.get(payment_network_id) if payment_netwo...
def visit_Program(self, node): """Vsitor for `Program` AST node.""" for child in node.children: if not isinstance(child, FunctionDeclaration): self.visit(child)
def function[visit_Program, parameter[self, node]]: constant[Vsitor for `Program` AST node.] for taget[name[child]] in starred[name[node].children] begin[:] if <ast.UnaryOp object at 0x7da1b0ab8a00> begin[:] call[name[self].visit, parameter[name[child]]]
keyword[def] identifier[visit_Program] ( identifier[self] , identifier[node] ): literal[string] keyword[for] identifier[child] keyword[in] identifier[node] . identifier[children] : keyword[if] keyword[not] identifier[isinstance] ( identifier[child] , identifier[FunctionDeclaration...
def visit_Program(self, node): """Vsitor for `Program` AST node.""" for child in node.children: if not isinstance(child, FunctionDeclaration): self.visit(child) # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['child']]
def update_snapshot(self, snapshot, display_name=None, display_description=None): """ Update the specified values on the specified snapshot. You may specify one or more values to update. """ return snapshot.update(display_name=display_name, display_des...
def function[update_snapshot, parameter[self, snapshot, display_name, display_description]]: constant[ Update the specified values on the specified snapshot. You may specify one or more values to update. ] return[call[name[snapshot].update, parameter[]]]
keyword[def] identifier[update_snapshot] ( identifier[self] , identifier[snapshot] , identifier[display_name] = keyword[None] , identifier[display_description] = keyword[None] ): literal[string] keyword[return] identifier[snapshot] . identifier[update] ( identifier[display_name] = identifier[disp...
def update_snapshot(self, snapshot, display_name=None, display_description=None): """ Update the specified values on the specified snapshot. You may specify one or more values to update. """ return snapshot.update(display_name=display_name, display_description=display_description)
def delete(self, file_, delete_file=True): """ Deletes file_ references in Key Value store and optionally the file_ it self. """ image_file = ImageFile(file_) if delete_file: image_file.delete() default.kvstore.delete(image_file)
def function[delete, parameter[self, file_, delete_file]]: constant[ Deletes file_ references in Key Value store and optionally the file_ it self. ] variable[image_file] assign[=] call[name[ImageFile], parameter[name[file_]]] if name[delete_file] begin[:] ...
keyword[def] identifier[delete] ( identifier[self] , identifier[file_] , identifier[delete_file] = keyword[True] ): literal[string] identifier[image_file] = identifier[ImageFile] ( identifier[file_] ) keyword[if] identifier[delete_file] : identifier[image_file] . identifier[d...
def delete(self, file_, delete_file=True): """ Deletes file_ references in Key Value store and optionally the file_ it self. """ image_file = ImageFile(file_) if delete_file: image_file.delete() # depends on [control=['if'], data=[]] default.kvstore.delete(image_file)
def release(button=LEFT): """ Sends an up event for the specified button, using the provided constants """ location = get_position() button_code, _, button_up, _ = _button_mapping[button] e = Quartz.CGEventCreateMouseEvent( None, button_up, location, button_code) if ...
def function[release, parameter[button]]: constant[ Sends an up event for the specified button, using the provided constants ] variable[location] assign[=] call[name[get_position], parameter[]] <ast.Tuple object at 0x7da1b1bfaa10> assign[=] call[name[_button_mapping]][name[button]] varia...
keyword[def] identifier[release] ( identifier[button] = identifier[LEFT] ): literal[string] identifier[location] = identifier[get_position] () identifier[button_code] , identifier[_] , identifier[button_up] , identifier[_] = identifier[_button_mapping] [ identifier[button] ] identifier[e] = ident...
def release(button=LEFT): """ Sends an up event for the specified button, using the provided constants """ location = get_position() (button_code, _, button_up, _) = _button_mapping[button] e = Quartz.CGEventCreateMouseEvent(None, button_up, location, button_code) if _last_click['time'] is not None ...
async def get_devices(self, covers_only: bool = True) -> list: """Get a list of all devices associated with the account.""" from .device import MyQDevice _LOGGER.debug('Retrieving list of devices') devices_resp = await self._request('get', DEVICE_LIST_ENDPOINT) # print(json.dump...
<ast.AsyncFunctionDef object at 0x7da1b15165f0>
keyword[async] keyword[def] identifier[get_devices] ( identifier[self] , identifier[covers_only] : identifier[bool] = keyword[True] )-> identifier[list] : literal[string] keyword[from] . identifier[device] keyword[import] identifier[MyQDevice] identifier[_LOGGER] . identifier[debug] (...
async def get_devices(self, covers_only: bool=True) -> list: """Get a list of all devices associated with the account.""" from .device import MyQDevice _LOGGER.debug('Retrieving list of devices') devices_resp = await self._request('get', DEVICE_LIST_ENDPOINT) # print(json.dumps(devices_resp, indent=...
def extend(self, extendwith): """ Appends an irsb to the current irsb. The irsb that is appended is invalidated. The appended irsb's jumpkind and default exit are used. :param extendwith: The IRSB to append to this IRSB :vartype extendwith: :class:`IRSB` """ ...
def function[extend, parameter[self, extendwith]]: constant[ Appends an irsb to the current irsb. The irsb that is appended is invalidated. The appended irsb's jumpkind and default exit are used. :param extendwith: The IRSB to append to this IRSB :vartype extendwith: :class...
keyword[def] identifier[extend] ( identifier[self] , identifier[extendwith] ): literal[string] keyword[if] identifier[self] . identifier[stmts_used] == literal[int] : identifier[self] . identifier[_from_py] ( identifier[extendwith] ) keyword[return] identifier[...
def extend(self, extendwith): """ Appends an irsb to the current irsb. The irsb that is appended is invalidated. The appended irsb's jumpkind and default exit are used. :param extendwith: The IRSB to append to this IRSB :vartype extendwith: :class:`IRSB` """ if self...
def get_collections_for_image(self, image_id): """Get identifier of all collections that contain a given image. Parameters ---------- image_id : string Unique identifierof image object Returns ------- List(string) List of image collection...
def function[get_collections_for_image, parameter[self, image_id]]: constant[Get identifier of all collections that contain a given image. Parameters ---------- image_id : string Unique identifierof image object Returns ------- List(string) ...
keyword[def] identifier[get_collections_for_image] ( identifier[self] , identifier[image_id] ): literal[string] identifier[result] =[] keyword[for] identifier[document] keyword[in] identifier[self] . identifier[collection] . identifier[find] ({ literal[string] : keyword[True] ,...
def get_collections_for_image(self, image_id): """Get identifier of all collections that contain a given image. Parameters ---------- image_id : string Unique identifierof image object Returns ------- List(string) List of image collection ide...
def localize(self, i, **kwargs): r"""Localize the kernels at a node (to visualize them). That is particularly useful to visualize a filter in the vertex domain. A kernel is localized on vertex :math:`v_i` by filtering a Kronecker delta :math:`\delta_i` as .. math:: (g(L) \delt...
def function[localize, parameter[self, i]]: constant[Localize the kernels at a node (to visualize them). That is particularly useful to visualize a filter in the vertex domain. A kernel is localized on vertex :math:`v_i` by filtering a Kronecker delta :math:`\delta_i` as .. ma...
keyword[def] identifier[localize] ( identifier[self] , identifier[i] ,** identifier[kwargs] ): literal[string] identifier[s] = identifier[np] . identifier[zeros] ( identifier[self] . identifier[G] . identifier[N] ) identifier[s] [ identifier[i] ]= literal[int] keyword[return] id...
def localize(self, i, **kwargs): """Localize the kernels at a node (to visualize them). That is particularly useful to visualize a filter in the vertex domain. A kernel is localized on vertex :math:`v_i` by filtering a Kronecker delta :math:`\\delta_i` as .. math:: (g(L) \\delta_i...
def is_bool(dtype): """Returns whether this is a boolean data type.""" dtype = tf.as_dtype(dtype) if hasattr(dtype, 'is_bool'): return dtype.is_bool # We use `kind` because: # np.issubdtype(np.uint8, np.bool) == True. return np.dtype(dtype).kind == 'b'
def function[is_bool, parameter[dtype]]: constant[Returns whether this is a boolean data type.] variable[dtype] assign[=] call[name[tf].as_dtype, parameter[name[dtype]]] if call[name[hasattr], parameter[name[dtype], constant[is_bool]]] begin[:] return[name[dtype].is_bool] return[comp...
keyword[def] identifier[is_bool] ( identifier[dtype] ): literal[string] identifier[dtype] = identifier[tf] . identifier[as_dtype] ( identifier[dtype] ) keyword[if] identifier[hasattr] ( identifier[dtype] , literal[string] ): keyword[return] identifier[dtype] . identifier[is_bool] keywor...
def is_bool(dtype): """Returns whether this is a boolean data type.""" dtype = tf.as_dtype(dtype) if hasattr(dtype, 'is_bool'): return dtype.is_bool # depends on [control=['if'], data=[]] # We use `kind` because: # np.issubdtype(np.uint8, np.bool) == True. return np.dtype(dtype).kind ==...
def tracker_print(msg): """Print message to the tracker. This function can be used to communicate the information of the progress to the tracker Parameters ---------- msg : str The message to be printed to tracker. """ if not isinstance(msg, str): msg = str(msg) _LI...
def function[tracker_print, parameter[msg]]: constant[Print message to the tracker. This function can be used to communicate the information of the progress to the tracker Parameters ---------- msg : str The message to be printed to tracker. ] if <ast.UnaryOp object at ...
keyword[def] identifier[tracker_print] ( identifier[msg] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[msg] , identifier[str] ): identifier[msg] = identifier[str] ( identifier[msg] ) identifier[_LIB] . identifier[RabitTrackerPrint] ( identifier[ctypes] . id...
def tracker_print(msg): """Print message to the tracker. This function can be used to communicate the information of the progress to the tracker Parameters ---------- msg : str The message to be printed to tracker. """ if not isinstance(msg, str): msg = str(msg) # depe...
def group_barh(self, column_label, **vargs): """Plot a horizontal bar chart for the table. The values of the specified column are grouped and counted, and one bar is produced for each group. Note: This differs from ``barh`` in that there is no need to specify bar heights; the s...
def function[group_barh, parameter[self, column_label]]: constant[Plot a horizontal bar chart for the table. The values of the specified column are grouped and counted, and one bar is produced for each group. Note: This differs from ``barh`` in that there is no need to specify ...
keyword[def] identifier[group_barh] ( identifier[self] , identifier[column_label] ,** identifier[vargs] ): literal[string] identifier[self] . identifier[group] ( identifier[column_label] ). identifier[barh] ( identifier[column_label] ,** identifier[vargs] )
def group_barh(self, column_label, **vargs): """Plot a horizontal bar chart for the table. The values of the specified column are grouped and counted, and one bar is produced for each group. Note: This differs from ``barh`` in that there is no need to specify bar heights; the size ...
def _discovery_resp(self, data): """ Handle a discovery response. :param data: Payload. :param addr: Address tuple. :returns: MAC and reversed MAC. """ if _is_discovery_response(data): _LOGGER.debug("Discovered MAC of %s: %s", self.host, ...
def function[_discovery_resp, parameter[self, data]]: constant[ Handle a discovery response. :param data: Payload. :param addr: Address tuple. :returns: MAC and reversed MAC. ] if call[name[_is_discovery_response], parameter[name[data]]] begin[:] call[nam...
keyword[def] identifier[_discovery_resp] ( identifier[self] , identifier[data] ): literal[string] keyword[if] identifier[_is_discovery_response] ( identifier[data] ): identifier[_LOGGER] . identifier[debug] ( literal[string] , identifier[self] . identifier[host] , identif...
def _discovery_resp(self, data): """ Handle a discovery response. :param data: Payload. :param addr: Address tuple. :returns: MAC and reversed MAC. """ if _is_discovery_response(data): _LOGGER.debug('Discovered MAC of %s: %s', self.host, binascii.hexlify(data[7:13]).deco...
def image_url(self, pixel_size=None): """ Get the URL for the user icon in the desired pixel size, if it exists. If no size is supplied, give the URL for the full-size image. """ if "profile" not in self._raw: return profile = self._raw["profile"] if (...
def function[image_url, parameter[self, pixel_size]]: constant[ Get the URL for the user icon in the desired pixel size, if it exists. If no size is supplied, give the URL for the full-size image. ] if compare[constant[profile] <ast.NotIn object at 0x7da2590d7190> name[self]._raw...
keyword[def] identifier[image_url] ( identifier[self] , identifier[pixel_size] = keyword[None] ): literal[string] keyword[if] literal[string] keyword[not] keyword[in] identifier[self] . identifier[_raw] : keyword[return] identifier[profile] = identifier[self] . identifier...
def image_url(self, pixel_size=None): """ Get the URL for the user icon in the desired pixel size, if it exists. If no size is supplied, give the URL for the full-size image. """ if 'profile' not in self._raw: return # depends on [control=['if'], data=[]] profile = self._raw...
def _get_voltage_angle_var(self, refs, buses): """ Returns the voltage angle variable set. """ Va = array([b.v_angle * (pi / 180.0) for b in buses]) Vau = Inf * ones(len(buses)) Val = -Vau Vau[refs] = Va[refs] Val[refs] = Va[refs] return Variable("Va", l...
def function[_get_voltage_angle_var, parameter[self, refs, buses]]: constant[ Returns the voltage angle variable set. ] variable[Va] assign[=] call[name[array], parameter[<ast.ListComp object at 0x7da1b2518d00>]] variable[Vau] assign[=] binary_operation[name[Inf] * call[name[ones], param...
keyword[def] identifier[_get_voltage_angle_var] ( identifier[self] , identifier[refs] , identifier[buses] ): literal[string] identifier[Va] = identifier[array] ([ identifier[b] . identifier[v_angle] *( identifier[pi] / literal[int] ) keyword[for] identifier[b] keyword[in] identifier[buses] ]) ...
def _get_voltage_angle_var(self, refs, buses): """ Returns the voltage angle variable set. """ Va = array([b.v_angle * (pi / 180.0) for b in buses]) Vau = Inf * ones(len(buses)) Val = -Vau Vau[refs] = Va[refs] Val[refs] = Va[refs] return Variable('Va', len(buses), Va, Val, Vau)
def set_headers(context): """ Parameters: +--------------+---------------+ | header_name | header_value | +==============+===============+ | header1 | value1 | +--------------+---------------+ | header2 | value2 | +--------------...
def function[set_headers, parameter[context]]: constant[ Parameters: +--------------+---------------+ | header_name | header_value | +==============+===============+ | header1 | value1 | +--------------+---------------+ | header2 | value2 ...
keyword[def] identifier[set_headers] ( identifier[context] ): literal[string] identifier[safe_add_http_request_context_to_behave_context] ( identifier[context] ) identifier[headers] = identifier[dict] () keyword[for] identifier[row] keyword[in] identifier[context] . identifier[table] : ...
def set_headers(context): """ Parameters: +--------------+---------------+ | header_name | header_value | +==============+===============+ | header1 | value1 | +--------------+---------------+ | header2 | value2 | +--------------...
def score(count_bigram, count1, count2, n_words): """Collocation score""" if n_words <= count1 or n_words <= count2: # only one words appears in the whole document return 0 N = n_words c12 = count_bigram c1 = count1 c2 = count2 p = c2 / N p1 = c12 / c1 p2 = (c2 - c12)...
def function[score, parameter[count_bigram, count1, count2, n_words]]: constant[Collocation score] if <ast.BoolOp object at 0x7da20c992590> begin[:] return[constant[0]] variable[N] assign[=] name[n_words] variable[c12] assign[=] name[count_bigram] variable[c1] assign[=] n...
keyword[def] identifier[score] ( identifier[count_bigram] , identifier[count1] , identifier[count2] , identifier[n_words] ): literal[string] keyword[if] identifier[n_words] <= identifier[count1] keyword[or] identifier[n_words] <= identifier[count2] : keyword[return] literal[int] ide...
def score(count_bigram, count1, count2, n_words): """Collocation score""" if n_words <= count1 or n_words <= count2: # only one words appears in the whole document return 0 # depends on [control=['if'], data=[]] N = n_words c12 = count_bigram c1 = count1 c2 = count2 p = c2 /...
def VerifySignature(message, signature, public_key, unhex=True): """ Verify the integrity of the message. Args: message (str): the message to verify. signature (bytearray): the signature belonging to the message. public_key (ECPoint|bytes): the public key to ...
def function[VerifySignature, parameter[message, signature, public_key, unhex]]: constant[ Verify the integrity of the message. Args: message (str): the message to verify. signature (bytearray): the signature belonging to the message. public_key (ECPoint|byte...
keyword[def] identifier[VerifySignature] ( identifier[message] , identifier[signature] , identifier[public_key] , identifier[unhex] = keyword[True] ): literal[string] keyword[if] identifier[type] ( identifier[public_key] ) keyword[is] identifier[EllipticCurve] . identifier[ECPoint] : ...
def VerifySignature(message, signature, public_key, unhex=True): """ Verify the integrity of the message. Args: message (str): the message to verify. signature (bytearray): the signature belonging to the message. public_key (ECPoint|bytes): the public key to use ...
def prompt_choice_list(msg, a_list, default=1, help_string=None): """Prompt user to select from a list of possible choices. :param msg:A message displayed to the user before the choice list :type msg: str :param a_list:The list of choices (list of strings or list of dicts with 'name' & 'desc') "typ...
def function[prompt_choice_list, parameter[msg, a_list, default, help_string]]: constant[Prompt user to select from a list of possible choices. :param msg:A message displayed to the user before the choice list :type msg: str :param a_list:The list of choices (list of strings or list of dicts with '...
keyword[def] identifier[prompt_choice_list] ( identifier[msg] , identifier[a_list] , identifier[default] = literal[int] , identifier[help_string] = keyword[None] ): literal[string] identifier[verify_is_a_tty] () identifier[options] = literal[string] . identifier[join] ([ literal[string] . identif...
def prompt_choice_list(msg, a_list, default=1, help_string=None): """Prompt user to select from a list of possible choices. :param msg:A message displayed to the user before the choice list :type msg: str :param a_list:The list of choices (list of strings or list of dicts with 'name' & 'desc') "typ...
def find_first_stop_codon(nucleotide_sequence): """ Given a sequence of codons (expected to have length multiple of three), return index of first stop codon, or -1 if none is in the sequence. """ n_mutant_codons = len(nucleotide_sequence) // 3 for i in range(n_mutant_codons): codon = nuc...
def function[find_first_stop_codon, parameter[nucleotide_sequence]]: constant[ Given a sequence of codons (expected to have length multiple of three), return index of first stop codon, or -1 if none is in the sequence. ] variable[n_mutant_codons] assign[=] binary_operation[call[name[len], pa...
keyword[def] identifier[find_first_stop_codon] ( identifier[nucleotide_sequence] ): literal[string] identifier[n_mutant_codons] = identifier[len] ( identifier[nucleotide_sequence] )// literal[int] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[n_mutant_codons] ): id...
def find_first_stop_codon(nucleotide_sequence): """ Given a sequence of codons (expected to have length multiple of three), return index of first stop codon, or -1 if none is in the sequence. """ n_mutant_codons = len(nucleotide_sequence) // 3 for i in range(n_mutant_codons): codon = nuc...
def reconcile(constraint): ''' Returns an assignment of type variable names to types that makes this constraint satisfiable, or a Refutation ''' if isinstance(constraint.subtype, NamedType): if isinstance(constraint.supertype, NamedType): if constraint.subtype.name == constr...
def function[reconcile, parameter[constraint]]: constant[ Returns an assignment of type variable names to types that makes this constraint satisfiable, or a Refutation ] if call[name[isinstance], parameter[name[constraint].subtype, name[NamedType]]] begin[:] if call[name[isin...
keyword[def] identifier[reconcile] ( identifier[constraint] ): literal[string] keyword[if] identifier[isinstance] ( identifier[constraint] . identifier[subtype] , identifier[NamedType] ): keyword[if] identifier[isinstance] ( identifier[constraint] . identifier[supertype] , identifier[NamedType]...
def reconcile(constraint): """ Returns an assignment of type variable names to types that makes this constraint satisfiable, or a Refutation """ if isinstance(constraint.subtype, NamedType): if isinstance(constraint.supertype, NamedType): if constraint.subtype.name == constraint....
def _update_event_type(self_, watcher, event, triggered): """ Returns an updated Event object with the type field set appropriately. """ if triggered: event_type = 'triggered' else: event_type = 'changed' if watcher.onlychanged else 'set' return Ev...
def function[_update_event_type, parameter[self_, watcher, event, triggered]]: constant[ Returns an updated Event object with the type field set appropriately. ] if name[triggered] begin[:] variable[event_type] assign[=] constant[triggered] return[call[name[Event], pa...
keyword[def] identifier[_update_event_type] ( identifier[self_] , identifier[watcher] , identifier[event] , identifier[triggered] ): literal[string] keyword[if] identifier[triggered] : identifier[event_type] = literal[string] keyword[else] : identifier[event_typ...
def _update_event_type(self_, watcher, event, triggered): """ Returns an updated Event object with the type field set appropriately. """ if triggered: event_type = 'triggered' # depends on [control=['if'], data=[]] else: event_type = 'changed' if watcher.onlychanged else 'se...
def store_integers(items, allow_zero=True): """Store integers from the given list in a storage. This is an example function to show autodoc style. Return :class:`Storage` instance with integers from the given list. Examples:: >>> storage = store_integers([1, 'foo', 2, 'bar', 0]) >>> ...
def function[store_integers, parameter[items, allow_zero]]: constant[Store integers from the given list in a storage. This is an example function to show autodoc style. Return :class:`Storage` instance with integers from the given list. Examples:: >>> storage = store_integers([1, 'foo', ...
keyword[def] identifier[store_integers] ( identifier[items] , identifier[allow_zero] = keyword[True] ): literal[string] identifier[ints] =[ identifier[x] keyword[for] identifier[x] keyword[in] identifier[items] keyword[if] identifier[isinstance] ( identifier[x] , identifier[int] ) keyword[and] ( iden...
def store_integers(items, allow_zero=True): """Store integers from the given list in a storage. This is an example function to show autodoc style. Return :class:`Storage` instance with integers from the given list. Examples:: >>> storage = store_integers([1, 'foo', 2, 'bar', 0]) >>> ...
def change_column_name( conn, table, old_column_name, new_column_name, schema=None ): """ Changes given `activity` jsonb data column key. This function is useful when you want to reflect column name changes to activity table. :: from alembic import op from postgresq...
def function[change_column_name, parameter[conn, table, old_column_name, new_column_name, schema]]: constant[ Changes given `activity` jsonb data column key. This function is useful when you want to reflect column name changes to activity table. :: from alembic import op from postg...
keyword[def] identifier[change_column_name] ( identifier[conn] , identifier[table] , identifier[old_column_name] , identifier[new_column_name] , identifier[schema] = keyword[None] ): literal[string] identifier[activity_table] = identifier[get_activity_table] ( identifier[schema] = identifier[schema] ...
def change_column_name(conn, table, old_column_name, new_column_name, schema=None): """ Changes given `activity` jsonb data column key. This function is useful when you want to reflect column name changes to activity table. :: from alembic import op from postgresql_audit import change_...
def dist_abs(self, src, tar, cost=(0, 1, 2), local=False): """Return the Editex distance between two strings. Parameters ---------- src : str Source string for comparison tar : str Target string for comparison cost : tuple A 3-tuple re...
def function[dist_abs, parameter[self, src, tar, cost, local]]: constant[Return the Editex distance between two strings. Parameters ---------- src : str Source string for comparison tar : str Target string for comparison cost : tuple A...
keyword[def] identifier[dist_abs] ( identifier[self] , identifier[src] , identifier[tar] , identifier[cost] =( literal[int] , literal[int] , literal[int] ), identifier[local] = keyword[False] ): literal[string] identifier[match_cost] , identifier[group_cost] , identifier[mismatch_cost] = identifier...
def dist_abs(self, src, tar, cost=(0, 1, 2), local=False): """Return the Editex distance between two strings. Parameters ---------- src : str Source string for comparison tar : str Target string for comparison cost : tuple A 3-tuple repres...
def set_sampling_strategies(self, filter, strategy_and_parms): """Set sampling strategies for filtered sensors - these sensors have to exsist""" result_list = yield self.list_sensors(filter=filter) sensor_dict = {} for result in result_list: sensor_name = result.object.normal...
def function[set_sampling_strategies, parameter[self, filter, strategy_and_parms]]: constant[Set sampling strategies for filtered sensors - these sensors have to exsist] variable[result_list] assign[=] <ast.Yield object at 0x7da1b054a110> variable[sensor_dict] assign[=] dictionary[[], []] ...
keyword[def] identifier[set_sampling_strategies] ( identifier[self] , identifier[filter] , identifier[strategy_and_parms] ): literal[string] identifier[result_list] = keyword[yield] identifier[self] . identifier[list_sensors] ( identifier[filter] = identifier[filter] ) identifier[sensor_d...
def set_sampling_strategies(self, filter, strategy_and_parms): """Set sampling strategies for filtered sensors - these sensors have to exsist""" result_list = (yield self.list_sensors(filter=filter)) sensor_dict = {} for result in result_list: sensor_name = result.object.normalised_name ...
def html_print_file(self, catalog, destination): """ Prints text_file in html. :param catalog: text file you wish to pretty print :param destination: where you wish to save the HTML data :return: output in html_file.html. """ with open(destination, mode='r+', enco...
def function[html_print_file, parameter[self, catalog, destination]]: constant[ Prints text_file in html. :param catalog: text file you wish to pretty print :param destination: where you wish to save the HTML data :return: output in html_file.html. ] with call[nam...
keyword[def] identifier[html_print_file] ( identifier[self] , identifier[catalog] , identifier[destination] ): literal[string] keyword[with] identifier[open] ( identifier[destination] , identifier[mode] = literal[string] , identifier[encoding] = literal[string] ) keyword[as] identifier[t_f] : ...
def html_print_file(self, catalog, destination): """ Prints text_file in html. :param catalog: text file you wish to pretty print :param destination: where you wish to save the HTML data :return: output in html_file.html. """ with open(destination, mode='r+', encoding='ut...
def send(self, test=None): ''' Send the email through the Postmark system. Pass test=True to just print out the resulting JSON message being sent to Postmark ''' self._check_values() # Set up message dictionary json_message = self.to_json_message() ...
def function[send, parameter[self, test]]: constant[ Send the email through the Postmark system. Pass test=True to just print out the resulting JSON message being sent to Postmark ] call[name[self]._check_values, parameter[]] variable[json_message] assign[=] call[...
keyword[def] identifier[send] ( identifier[self] , identifier[test] = keyword[None] ): literal[string] identifier[self] . identifier[_check_values] () identifier[json_message] = identifier[self] . identifier[to_json_message] () keywo...
def send(self, test=None): """ Send the email through the Postmark system. Pass test=True to just print out the resulting JSON message being sent to Postmark """ self._check_values() # Set up message dictionary json_message = self.to_json_message() # if (self.__html_b...
def _count_relevant_tb_levels(tb): """Return the number of frames in ``tb`` before all that's left is unittest frames. Unlike its namesake in unittest, this doesn't bail out as soon as it hits a unittest frame, which means we don't bail out as soon as somebody uses the mock library, which defines ``__u...
def function[_count_relevant_tb_levels, parameter[tb]]: constant[Return the number of frames in ``tb`` before all that's left is unittest frames. Unlike its namesake in unittest, this doesn't bail out as soon as it hits a unittest frame, which means we don't bail out as soon as somebody uses the mo...
keyword[def] identifier[_count_relevant_tb_levels] ( identifier[tb] ): literal[string] identifier[length] = identifier[contiguous_unittest_frames] = literal[int] keyword[while] identifier[tb] : identifier[length] += literal[int] keyword[if] identifier[_is_unittest_frame] ( identi...
def _count_relevant_tb_levels(tb): """Return the number of frames in ``tb`` before all that's left is unittest frames. Unlike its namesake in unittest, this doesn't bail out as soon as it hits a unittest frame, which means we don't bail out as soon as somebody uses the mock library, which defines ``__u...
def _lazy_turbo_mapping(initial, pre_size): ''' _lazy_turbo_mapping is a blatant copy of the pyrsistent._pmap._turbo_mapping function, except it works for lazy maps; this seems like the only way to fully overload PMap. ''' size = pre_size or (2 * len(initial)) or 8 buckets = size * [None] if...
def function[_lazy_turbo_mapping, parameter[initial, pre_size]]: constant[ _lazy_turbo_mapping is a blatant copy of the pyrsistent._pmap._turbo_mapping function, except it works for lazy maps; this seems like the only way to fully overload PMap. ] variable[size] assign[=] <ast.BoolOp object ...
keyword[def] identifier[_lazy_turbo_mapping] ( identifier[initial] , identifier[pre_size] ): literal[string] identifier[size] = identifier[pre_size] keyword[or] ( literal[int] * identifier[len] ( identifier[initial] )) keyword[or] literal[int] identifier[buckets] = identifier[size] *[ keyword[None]...
def _lazy_turbo_mapping(initial, pre_size): """ _lazy_turbo_mapping is a blatant copy of the pyrsistent._pmap._turbo_mapping function, except it works for lazy maps; this seems like the only way to fully overload PMap. """ size = pre_size or 2 * len(initial) or 8 buckets = size * [None] if n...
def maxind_numba(block): """ filter for indels """ ## remove terminal edges inds = 0 for row in xrange(block.shape[0]): where = np.where(block[row] != 45)[0] if len(where) == 0: obs = 100 else: left = np.min(where) right = np.max(where) ...
def function[maxind_numba, parameter[block]]: constant[ filter for indels ] variable[inds] assign[=] constant[0] for taget[name[row]] in starred[call[name[xrange], parameter[call[name[block].shape][constant[0]]]]] begin[:] variable[where] assign[=] call[call[name[np].where, param...
keyword[def] identifier[maxind_numba] ( identifier[block] ): literal[string] identifier[inds] = literal[int] keyword[for] identifier[row] keyword[in] identifier[xrange] ( identifier[block] . identifier[shape] [ literal[int] ]): identifier[where] = identifier[np] . identifier[where] (...
def maxind_numba(block): """ filter for indels """ ## remove terminal edges inds = 0 for row in xrange(block.shape[0]): where = np.where(block[row] != 45)[0] if len(where) == 0: obs = 100 # depends on [control=['if'], data=[]] else: left = np.min(where) ...
def _call(self, method, *args, **kwargs): """Call the remote service and return the response data.""" assert self.session if not kwargs.get('verify'): kwargs['verify'] = self.SSL_VERIFY response = self.session.request(method, *args, **kwargs) response_json = respon...
def function[_call, parameter[self, method]]: constant[Call the remote service and return the response data.] assert[name[self].session] if <ast.UnaryOp object at 0x7da204622fe0> begin[:] call[name[kwargs]][constant[verify]] assign[=] name[self].SSL_VERIFY variable[response] ...
keyword[def] identifier[_call] ( identifier[self] , identifier[method] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[assert] identifier[self] . identifier[session] keyword[if] keyword[not] identifier[kwargs] . identifier[get] ( literal[string] ): ...
def _call(self, method, *args, **kwargs): """Call the remote service and return the response data.""" assert self.session if not kwargs.get('verify'): kwargs['verify'] = self.SSL_VERIFY # depends on [control=['if'], data=[]] response = self.session.request(method, *args, **kwargs) response_...
def load_from_store(self): """Load index from store. :return: Whether index was correctly loaded or not :rtype: bool :raise AttributeError: If no datastore is defined """ if not self._store: raise AttributeError('No datastore defined!') if self._stor...
def function[load_from_store, parameter[self]]: constant[Load index from store. :return: Whether index was correctly loaded or not :rtype: bool :raise AttributeError: If no datastore is defined ] if <ast.UnaryOp object at 0x7da1b1834be0> begin[:] <ast.Raise obje...
keyword[def] identifier[load_from_store] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_store] : keyword[raise] identifier[AttributeError] ( literal[string] ) keyword[if] identifier[self] . identifier[_store] . identifier[has_...
def load_from_store(self): """Load index from store. :return: Whether index was correctly loaded or not :rtype: bool :raise AttributeError: If no datastore is defined """ if not self._store: raise AttributeError('No datastore defined!') # depends on [control=['if'], da...
def _request(self, method, identifier, key=None, value=None): """Perform request with identifier.""" params = {'id': identifier} if key is not None and value is not None: params[key] = value result = yield from self._transact(method, params) return result.get(key)
def function[_request, parameter[self, method, identifier, key, value]]: constant[Perform request with identifier.] variable[params] assign[=] dictionary[[<ast.Constant object at 0x7da1b02e5f00>], [<ast.Name object at 0x7da1b02e73d0>]] if <ast.BoolOp object at 0x7da1b02e7ca0> begin[:] ...
keyword[def] identifier[_request] ( identifier[self] , identifier[method] , identifier[identifier] , identifier[key] = keyword[None] , identifier[value] = keyword[None] ): literal[string] identifier[params] ={ literal[string] : identifier[identifier] } keyword[if] identifier[key] keyword...
def _request(self, method, identifier, key=None, value=None): """Perform request with identifier.""" params = {'id': identifier} if key is not None and value is not None: params[key] = value # depends on [control=['if'], data=[]] result = (yield from self._transact(method, params)) return r...
def update(self, force=[]): """Update the filters according to `self.rtdc_ds.config["filtering"]` Parameters ---------- force : list A list of feature names that must be refiltered with min/max values. """ # These lists may help us become very fa...
def function[update, parameter[self, force]]: constant[Update the filters according to `self.rtdc_ds.config["filtering"]` Parameters ---------- force : list A list of feature names that must be refiltered with min/max values. ] variable[newkeys] a...
keyword[def] identifier[update] ( identifier[self] , identifier[force] =[]): literal[string] identifier[newkeys] =[] identifier[oldvals] =[] identifier[newvals] =[] identifier[cfg_cur] = identifier[self] . identifier[rtdc_ds] . identifier[config] [ literal[stri...
def update(self, force=[]): """Update the filters according to `self.rtdc_ds.config["filtering"]` Parameters ---------- force : list A list of feature names that must be refiltered with min/max values. """ # These lists may help us become very fast in the...
def type(self): """ Type of a valid object. Type may be a JSON type name or a list of such names. Valid JSON type names are ``string``, ``number``, ``integer``, ``boolean``, ``object``, ``array``, ``any`` (default). """ value = self._schema.get("type", "any") ...
def function[type, parameter[self]]: constant[ Type of a valid object. Type may be a JSON type name or a list of such names. Valid JSON type names are ``string``, ``number``, ``integer``, ``boolean``, ``object``, ``array``, ``any`` (default). ] variable[value] as...
keyword[def] identifier[type] ( identifier[self] ): literal[string] identifier[value] = identifier[self] . identifier[_schema] . identifier[get] ( literal[string] , literal[string] ) keyword[if] keyword[not] identifier[isinstance] ( identifier[value] ,( identifier[basestring] , identifie...
def type(self): """ Type of a valid object. Type may be a JSON type name or a list of such names. Valid JSON type names are ``string``, ``number``, ``integer``, ``boolean``, ``object``, ``array``, ``any`` (default). """ value = self._schema.get('type', 'any') if not ...
def update_file(self, value, relativePath, description=False, dump=False, pull=False, raiseError=True, ntrials=3): """ Update the value of a file that is already in the Repository.\n If file is not registered in repository, and error will be thrown.\n If file is...
def function[update_file, parameter[self, value, relativePath, description, dump, pull, raiseError, ntrials]]: constant[ Update the value of a file that is already in the Repository. If file is not registered in repository, and error will be thrown. If file is missing in the system, it...
keyword[def] identifier[update_file] ( identifier[self] , identifier[value] , identifier[relativePath] , identifier[description] = keyword[False] , identifier[dump] = keyword[False] , identifier[pull] = keyword[False] , identifier[raiseError] = keyword[True] , identifier[ntrials] = literal[int] ): literal[s...
def update_file(self, value, relativePath, description=False, dump=False, pull=False, raiseError=True, ntrials=3): """ Update the value of a file that is already in the Repository. If file is not registered in repository, and error will be thrown. If file is missing in the system, it will ...
def _get_flag(which, flags): """ Find 'which' entry in 'flags'. """ res = [this for this in flags if this.is_equal(which)] if len(res) == 0: return None if len(res) == 1: return res[0] assert()
def function[_get_flag, parameter[which, flags]]: constant[ Find 'which' entry in 'flags'. ] variable[res] assign[=] <ast.ListComp object at 0x7da1b0833e80> if compare[call[name[len], parameter[name[res]]] equal[==] constant[0]] begin[:] return[constant[None]] if compare[call[nam...
keyword[def] identifier[_get_flag] ( identifier[which] , identifier[flags] ): literal[string] identifier[res] =[ identifier[this] keyword[for] identifier[this] keyword[in] identifier[flags] keyword[if] identifier[this] . identifier[is_equal] ( identifier[which] )] keyword[if] identifier[len] ( ...
def _get_flag(which, flags): """ Find 'which' entry in 'flags'. """ res = [this for this in flags if this.is_equal(which)] if len(res) == 0: return None # depends on [control=['if'], data=[]] if len(res) == 1: return res[0] # depends on [control=['if'], data=[]] assert ()
def select_subreddit(self): """ Store the selected subreddit and return to the subreddit page """ name = self.get_selected_item()['name'] self.selected_page = self.open_subreddit_page(name)
def function[select_subreddit, parameter[self]]: constant[ Store the selected subreddit and return to the subreddit page ] variable[name] assign[=] call[call[name[self].get_selected_item, parameter[]]][constant[name]] name[self].selected_page assign[=] call[name[self].open_subred...
keyword[def] identifier[select_subreddit] ( identifier[self] ): literal[string] identifier[name] = identifier[self] . identifier[get_selected_item] ()[ literal[string] ] identifier[self] . identifier[selected_page] = identifier[self] . identifier[open_subreddit_page] ( identifier[name] )
def select_subreddit(self): """ Store the selected subreddit and return to the subreddit page """ name = self.get_selected_item()['name'] self.selected_page = self.open_subreddit_page(name)
def format(self): """PixelFormat: The raw format of the texture. The actual format may differ, but pixel transfers will use this format. """ fmt = ffi.new('Uint32 *') check_int_err(lib.SDL_QueryTexture(self._ptr, fmt, ffi.NULL, ffi.NULL, ffi.NULL)) return ...
def function[format, parameter[self]]: constant[PixelFormat: The raw format of the texture. The actual format may differ, but pixel transfers will use this format. ] variable[fmt] assign[=] call[name[ffi].new, parameter[constant[Uint32 *]]] call[name[check_int_err...
keyword[def] identifier[format] ( identifier[self] ): literal[string] identifier[fmt] = identifier[ffi] . identifier[new] ( literal[string] ) identifier[check_int_err] ( identifier[lib] . identifier[SDL_QueryTexture] ( identifier[self] . identifier[_ptr] , identifier[fmt] , identifier[ffi]...
def format(self): """PixelFormat: The raw format of the texture. The actual format may differ, but pixel transfers will use this format. """ fmt = ffi.new('Uint32 *') check_int_err(lib.SDL_QueryTexture(self._ptr, fmt, ffi.NULL, ffi.NULL, ffi.NULL)) return PixelFormat(fmt[...
def _escaped_token_to_subtoken_strings(self, escaped_token): """ Converts an escaped token string to a list of subtoken strings. Args: escaped_token: An escaped token as a unicode string. Returns: A list of subtokens as unicode strings. """ # NOTE: This algor...
def function[_escaped_token_to_subtoken_strings, parameter[self, escaped_token]]: constant[ Converts an escaped token string to a list of subtoken strings. Args: escaped_token: An escaped token as a unicode string. Returns: A list of subtokens as unicode strings. ] ...
keyword[def] identifier[_escaped_token_to_subtoken_strings] ( identifier[self] , identifier[escaped_token] ): literal[string] identifier[ret] =[] identifier[start] = literal[int] identifier[token_len] = identifier[len] ( identifier[escaped_token] ) keyw...
def _escaped_token_to_subtoken_strings(self, escaped_token): """ Converts an escaped token string to a list of subtoken strings. Args: escaped_token: An escaped token as a unicode string. Returns: A list of subtokens as unicode strings. """ # NOTE: This algorithm is ...
def ingest_from_dataframe(self, df, ingestion_properties): """Enqueuing an ingest command from local files. :param pandas.DataFrame df: input dataframe to ingest. :param azure.kusto.ingest.IngestionProperties ingestion_properties: Ingestion properties. """ from pandas i...
def function[ingest_from_dataframe, parameter[self, df, ingestion_properties]]: constant[Enqueuing an ingest command from local files. :param pandas.DataFrame df: input dataframe to ingest. :param azure.kusto.ingest.IngestionProperties ingestion_properties: Ingestion properties. ...
keyword[def] identifier[ingest_from_dataframe] ( identifier[self] , identifier[df] , identifier[ingestion_properties] ): literal[string] keyword[from] identifier[pandas] keyword[import] identifier[DataFrame] keyword[if] keyword[not] identifier[isinstance] ( identifier[df] , identif...
def ingest_from_dataframe(self, df, ingestion_properties): """Enqueuing an ingest command from local files. :param pandas.DataFrame df: input dataframe to ingest. :param azure.kusto.ingest.IngestionProperties ingestion_properties: Ingestion properties. """ from pandas import Dat...
def urijoin(base, ref, strict=False): """Convert a URI reference relative to a base URI to its target URI string. """ if isinstance(base, type(ref)): return urisplit(base).transform(ref, strict).geturi() elif isinstance(base, bytes): return urisplit(base.decode()).transform(ref, str...
def function[urijoin, parameter[base, ref, strict]]: constant[Convert a URI reference relative to a base URI to its target URI string. ] if call[name[isinstance], parameter[name[base], call[name[type], parameter[name[ref]]]]] begin[:] return[call[call[call[name[urisplit], parameter[name...
keyword[def] identifier[urijoin] ( identifier[base] , identifier[ref] , identifier[strict] = keyword[False] ): literal[string] keyword[if] identifier[isinstance] ( identifier[base] , identifier[type] ( identifier[ref] )): keyword[return] identifier[urisplit] ( identifier[base] ). identifier[tran...
def urijoin(base, ref, strict=False): """Convert a URI reference relative to a base URI to its target URI string. """ if isinstance(base, type(ref)): return urisplit(base).transform(ref, strict).geturi() # depends on [control=['if'], data=[]] elif isinstance(base, bytes): return ur...
def _GetIdentifierFromPath(self, parser_mediator): """Extracts a container or a graph ID from a JSON file's path. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. Returns: str: container or graph identifier...
def function[_GetIdentifierFromPath, parameter[self, parser_mediator]]: constant[Extracts a container or a graph ID from a JSON file's path. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. Returns: str...
keyword[def] identifier[_GetIdentifierFromPath] ( identifier[self] , identifier[parser_mediator] ): literal[string] identifier[file_entry] = identifier[parser_mediator] . identifier[GetFileEntry] () identifier[path] = identifier[file_entry] . identifier[path_spec] . identifier[location] identifi...
def _GetIdentifierFromPath(self, parser_mediator): """Extracts a container or a graph ID from a JSON file's path. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. Returns: str: container or graph identifier...
def userpass(self, dir="ppcoin"): """Reads config file for username/password""" source = os.path.expanduser("~/.{0}/{0}.conf").format(dir) dest = open(source, "r") with dest as conf: for line in conf: if line.startswith("rpcuser"): usernam...
def function[userpass, parameter[self, dir]]: constant[Reads config file for username/password] variable[source] assign[=] call[call[name[os].path.expanduser, parameter[constant[~/.{0}/{0}.conf]]].format, parameter[name[dir]]] variable[dest] assign[=] call[name[open], parameter[name[source], con...
keyword[def] identifier[userpass] ( identifier[self] , identifier[dir] = literal[string] ): literal[string] identifier[source] = identifier[os] . identifier[path] . identifier[expanduser] ( literal[string] ). identifier[format] ( identifier[dir] ) identifier[dest] = identifier[open] ( ide...
def userpass(self, dir='ppcoin'): """Reads config file for username/password""" source = os.path.expanduser('~/.{0}/{0}.conf').format(dir) dest = open(source, 'r') with dest as conf: for line in conf: if line.startswith('rpcuser'): username = line.split('=')[1].strip(...
def uniformly_refine_triangulation(self, faces=False, trisect=False): """ return points defining a refined triangulation obtained by bisection of all edges in the triangulation """ if faces: x_v1, y_v1 = self._add_face_centroids() else: if not tr...
def function[uniformly_refine_triangulation, parameter[self, faces, trisect]]: constant[ return points defining a refined triangulation obtained by bisection of all edges in the triangulation ] if name[faces] begin[:] <ast.Tuple object at 0x7da1b246c850> assign[=]...
keyword[def] identifier[uniformly_refine_triangulation] ( identifier[self] , identifier[faces] = keyword[False] , identifier[trisect] = keyword[False] ): literal[string] keyword[if] identifier[faces] : identifier[x_v1] , identifier[y_v1] = identifier[self] . identifier[_add_face_cent...
def uniformly_refine_triangulation(self, faces=False, trisect=False): """ return points defining a refined triangulation obtained by bisection of all edges in the triangulation """ if faces: (x_v1, y_v1) = self._add_face_centroids() # depends on [control=['if'], data=[]] eli...
def capture(self, tunnel_addr, tunnel_port, filename=None, bucket=None, destination=None): """ Captures memory based on the provided OutputDestination :type tunnel_addr: str :param tunnel_port: ssh tunnel hostname or ip :type tunnel_port: int :param tunne...
def function[capture, parameter[self, tunnel_addr, tunnel_port, filename, bucket, destination]]: constant[ Captures memory based on the provided OutputDestination :type tunnel_addr: str :param tunnel_port: ssh tunnel hostname or ip :type tunnel_port: int :param tunnel_po...
keyword[def] identifier[capture] ( identifier[self] , identifier[tunnel_addr] , identifier[tunnel_port] , identifier[filename] = keyword[None] , identifier[bucket] = keyword[None] , identifier[destination] = keyword[None] ): literal[string] keyword[if] identifier[filename] keyword[is] keyword[N...
def capture(self, tunnel_addr, tunnel_port, filename=None, bucket=None, destination=None): """ Captures memory based on the provided OutputDestination :type tunnel_addr: str :param tunnel_port: ssh tunnel hostname or ip :type tunnel_port: int :param tunnel_port: ssh tunnel p...
def checked_add_with_arr(arr, b, arr_mask=None, b_mask=None): """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, w...
def function[checked_add_with_arr, parameter[arr, b, arr_mask, b_mask]]: constant[ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are i...
keyword[def] identifier[checked_add_with_arr] ( identifier[arr] , identifier[b] , identifier[arr_mask] = keyword[None] , identifier[b_mask] = keyword[None] ): literal[string] identifier[b2] = identifier[np] . identifier[broadcast_to] ( identifier[b] , identifier[arr] . identifier[shape] ) ke...
def checked_add_with_arr(arr, b, arr_mask=None, b_mask=None): """ Perform array addition that checks for underflow and overflow. Performs the addition of an int64 array and an int64 integer (or array) but checks that they do not result in overflow first. For elements that are indicated to be NaN, w...
def create_policy(name, policy_name, policy_type, policy, region=None, key=None, keyid=None, profile=None): ''' Create an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.create_policy myelb mypolicy LBCookieStickinessPolic...
def function[create_policy, parameter[name, policy_name, policy_type, policy, region, key, keyid, profile]]: constant[ Create an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.create_policy myelb mypolicy LBCookieStickinessPolicyType '...
keyword[def] identifier[create_policy] ( identifier[name] , identifier[policy_name] , identifier[policy_type] , identifier[policy] , identifier[region] = keyword[None] , identifier[key] = keyword[None] , identifier[keyid] = keyword[None] , identifier[profile] = keyword[None] ): literal[string] identifier[...
def create_policy(name, policy_name, policy_type, policy, region=None, key=None, keyid=None, profile=None): """ Create an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.create_policy myelb mypolicy LBCookieStickinessPolicyType '{"CookieExp...
def _canonicalize(self, filename): """Use .collection as extension unless provided""" path, ext = os.path.splitext(filename) if not ext: ext = ".collection" return path + ext
def function[_canonicalize, parameter[self, filename]]: constant[Use .collection as extension unless provided] <ast.Tuple object at 0x7da207f99a80> assign[=] call[name[os].path.splitext, parameter[name[filename]]] if <ast.UnaryOp object at 0x7da18bc72260> begin[:] variable[ext] a...
keyword[def] identifier[_canonicalize] ( identifier[self] , identifier[filename] ): literal[string] identifier[path] , identifier[ext] = identifier[os] . identifier[path] . identifier[splitext] ( identifier[filename] ) keyword[if] keyword[not] identifier[ext] : identifier[ex...
def _canonicalize(self, filename): """Use .collection as extension unless provided""" (path, ext) = os.path.splitext(filename) if not ext: ext = '.collection' # depends on [control=['if'], data=[]] return path + ext
def read(self, identifier, path=None): """ Read a text object given an identifier and a path :param identifier: Identifier of the text :param path: Path of the text files :return: Text """ if self.CACHE_FULL_TEI is True: o = self.cache.get(_cache_key(self.tex...
def function[read, parameter[self, identifier, path]]: constant[ Read a text object given an identifier and a path :param identifier: Identifier of the text :param path: Path of the text files :return: Text ] if compare[name[self].CACHE_FULL_TEI is constant[True]] begin[...
keyword[def] identifier[read] ( identifier[self] , identifier[identifier] , identifier[path] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[CACHE_FULL_TEI] keyword[is] keyword[True] : identifier[o] = identifier[self] . identifier[cache] . identifier[get...
def read(self, identifier, path=None): """ Read a text object given an identifier and a path :param identifier: Identifier of the text :param path: Path of the text files :return: Text """ if self.CACHE_FULL_TEI is True: o = self.cache.get(_cache_key(self.texts_parsed_ca...
def _brentq_cdf(self, value): """Helper function to compute percent_point. As scipy.stats.gaussian_kde doesn't provide this functionality out of the box we need to make a numerical approach: - First we scalarize and bound cumulative_distribution. - Then we define a function `f(...
def function[_brentq_cdf, parameter[self, value]]: constant[Helper function to compute percent_point. As scipy.stats.gaussian_kde doesn't provide this functionality out of the box we need to make a numerical approach: - First we scalarize and bound cumulative_distribution. - Th...
keyword[def] identifier[_brentq_cdf] ( identifier[self] , identifier[value] ): literal[string] identifier[bound_cdf] = identifier[partial] ( identifier[scalarize] ( identifier[GaussianKDE] . identifier[cumulative_distribution] ), identifier[self] ) keyword[def] identifier[f] ( i...
def _brentq_cdf(self, value): """Helper function to compute percent_point. As scipy.stats.gaussian_kde doesn't provide this functionality out of the box we need to make a numerical approach: - First we scalarize and bound cumulative_distribution. - Then we define a function `f(x) =...
def minimize(bed_file): """ strip a BED file down to its three necessary columns: chrom start end """ if not bed_file: return bed_file else: sorted_bed = bt.BedTool(bed_file).cut(range(3)).sort() if not sorted_bed.fn.endswith(".bed"): return sorted_bed.moveto(sort...
def function[minimize, parameter[bed_file]]: constant[ strip a BED file down to its three necessary columns: chrom start end ] if <ast.UnaryOp object at 0x7da1b1844280> begin[:] return[name[bed_file]]
keyword[def] identifier[minimize] ( identifier[bed_file] ): literal[string] keyword[if] keyword[not] identifier[bed_file] : keyword[return] identifier[bed_file] keyword[else] : identifier[sorted_bed] = identifier[bt] . identifier[BedTool] ( identifier[bed_file] ). identifier[cut]...
def minimize(bed_file): """ strip a BED file down to its three necessary columns: chrom start end """ if not bed_file: return bed_file # depends on [control=['if'], data=[]] else: sorted_bed = bt.BedTool(bed_file).cut(range(3)).sort() if not sorted_bed.fn.endswith('.bed'): ...
def do_mv(self, subcmd, opts, message, folder): """${cmd_name}: move the specified message to the specified folder ${cmd_usage} """ client = MdClient(self.maildir, filesystem=self.filesystem) client.move(message, folder)
def function[do_mv, parameter[self, subcmd, opts, message, folder]]: constant[${cmd_name}: move the specified message to the specified folder ${cmd_usage} ] variable[client] assign[=] call[name[MdClient], parameter[name[self].maildir]] call[name[client].move, parameter[name[mess...
keyword[def] identifier[do_mv] ( identifier[self] , identifier[subcmd] , identifier[opts] , identifier[message] , identifier[folder] ): literal[string] identifier[client] = identifier[MdClient] ( identifier[self] . identifier[maildir] , identifier[filesystem] = identifier[self] . identifier[filesys...
def do_mv(self, subcmd, opts, message, folder): """${cmd_name}: move the specified message to the specified folder ${cmd_usage} """ client = MdClient(self.maildir, filesystem=self.filesystem) client.move(message, folder)
def write_run_output(run, **kwargs): """Writes PolyChord output files corresponding to the input nested sampling run. The file root is .. code-block:: python root = os.path.join(run['output']['base_dir'], run['output']['file_root']) Output files which can be made w...
def function[write_run_output, parameter[run]]: constant[Writes PolyChord output files corresponding to the input nested sampling run. The file root is .. code-block:: python root = os.path.join(run['output']['base_dir'], run['output']['file_root']) Output file...
keyword[def] identifier[write_run_output] ( identifier[run] ,** identifier[kwargs] ): literal[string] identifier[write_dead] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[True] ) identifier[write_stats] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[True] ) ...
def write_run_output(run, **kwargs): """Writes PolyChord output files corresponding to the input nested sampling run. The file root is .. code-block:: python root = os.path.join(run['output']['base_dir'], run['output']['file_root']) Output files which can be made w...
def attention_bias_same_segment(query_segment_id, memory_segment_id): """Create an bias tensor to be added to attention logits. Positions with the same segment_ids can see each other. Args: query_segment_id: a float `Tensor` with shape [batch, query_length]. memory_segment_id: a float `Tensor` with shap...
def function[attention_bias_same_segment, parameter[query_segment_id, memory_segment_id]]: constant[Create an bias tensor to be added to attention logits. Positions with the same segment_ids can see each other. Args: query_segment_id: a float `Tensor` with shape [batch, query_length]. memory_segme...
keyword[def] identifier[attention_bias_same_segment] ( identifier[query_segment_id] , identifier[memory_segment_id] ): literal[string] identifier[ret] =( identifier[tf] . identifier[to_float] ( identifier[tf] . identifier[not_equal] ( identifier[tf] . identifier[expand_dims] ( identifier[query_segment_id...
def attention_bias_same_segment(query_segment_id, memory_segment_id): """Create an bias tensor to be added to attention logits. Positions with the same segment_ids can see each other. Args: query_segment_id: a float `Tensor` with shape [batch, query_length]. memory_segment_id: a float `Tensor` with sh...
def cume_dist(expr, sort=None, ascending=True): """ Calculate cumulative ratio of a sequence expression. :param expr: expression for calculation :param sort: name of the sort column :param ascending: whether to sort in ascending order :return: calculated column """ return _rank_op(expr,...
def function[cume_dist, parameter[expr, sort, ascending]]: constant[ Calculate cumulative ratio of a sequence expression. :param expr: expression for calculation :param sort: name of the sort column :param ascending: whether to sort in ascending order :return: calculated column ] re...
keyword[def] identifier[cume_dist] ( identifier[expr] , identifier[sort] = keyword[None] , identifier[ascending] = keyword[True] ): literal[string] keyword[return] identifier[_rank_op] ( identifier[expr] , identifier[CumeDist] , identifier[types] . identifier[float64] , identifier[sort] = identifier[sort]...
def cume_dist(expr, sort=None, ascending=True): """ Calculate cumulative ratio of a sequence expression. :param expr: expression for calculation :param sort: name of the sort column :param ascending: whether to sort in ascending order :return: calculated column """ return _rank_op(expr,...
def get_archives(self, title_id, language_code): """Get the archive list from a given `title_id` and `language_code`. :param int title_id: title id. :param int language_code: language code. :return: the archives. :rtype: list of :class:`LegendasTVArchive` """ lo...
def function[get_archives, parameter[self, title_id, language_code]]: constant[Get the archive list from a given `title_id` and `language_code`. :param int title_id: title id. :param int language_code: language code. :return: the archives. :rtype: list of :class:`LegendasTVArchi...
keyword[def] identifier[get_archives] ( identifier[self] , identifier[title_id] , identifier[language_code] ): literal[string] identifier[logger] . identifier[info] ( literal[string] , identifier[title_id] , identifier[language_code] ) identifier[archives] =[] identifier[page] = l...
def get_archives(self, title_id, language_code): """Get the archive list from a given `title_id` and `language_code`. :param int title_id: title id. :param int language_code: language code. :return: the archives. :rtype: list of :class:`LegendasTVArchive` """ logger.inf...
def run_wagtail_migration_before_core_34(apps, schema_editor): """ Migration 34 needs migration 0040 from wagtail core and this Migration will run wagtail migration before molo core migration 34 """ db_alias = schema_editor.connection.alias emit_pre_migrate_signal(verbosity=2, interactive=Fa...
def function[run_wagtail_migration_before_core_34, parameter[apps, schema_editor]]: constant[ Migration 34 needs migration 0040 from wagtail core and this Migration will run wagtail migration before molo core migration 34 ] variable[db_alias] assign[=] name[schema_editor].connection.alia...
keyword[def] identifier[run_wagtail_migration_before_core_34] ( identifier[apps] , identifier[schema_editor] ): literal[string] identifier[db_alias] = identifier[schema_editor] . identifier[connection] . identifier[alias] identifier[emit_pre_migrate_signal] ( identifier[verbosity] = literal[int] , id...
def run_wagtail_migration_before_core_34(apps, schema_editor): """ Migration 34 needs migration 0040 from wagtail core and this Migration will run wagtail migration before molo core migration 34 """ db_alias = schema_editor.connection.alias emit_pre_migrate_signal(verbosity=2, interactive=Fa...
def setDerivedTypeContents(self, extensions=None, restrictions=None): """For derived types set appropriate parameter and """ if extensions: ofwhat = list(self.ofwhat) if type(extensions) in _seqtypes: ofwhat += list(extensions) else: ...
def function[setDerivedTypeContents, parameter[self, extensions, restrictions]]: constant[For derived types set appropriate parameter and ] if name[extensions] begin[:] variable[ofwhat] assign[=] call[name[list], parameter[name[self].ofwhat]] if compare[call[name...
keyword[def] identifier[setDerivedTypeContents] ( identifier[self] , identifier[extensions] = keyword[None] , identifier[restrictions] = keyword[None] ): literal[string] keyword[if] identifier[extensions] : identifier[ofwhat] = identifier[list] ( identifier[self] . identifier[ofwhat] ...
def setDerivedTypeContents(self, extensions=None, restrictions=None): """For derived types set appropriate parameter and """ if extensions: ofwhat = list(self.ofwhat) if type(extensions) in _seqtypes: ofwhat += list(extensions) # depends on [control=['if'], data=[]] ...
def get_stock_quote(self, code_list): """ 获取订阅股票报价的实时数据,有订阅要求限制。 对于异步推送,参见StockQuoteHandlerBase :param code_list: 股票代码列表,必须确保code_list中的股票均订阅成功后才能够执行 :return: (ret, data) ret == RET_OK 返回pd dataframe数据,数据列格式如下 ret != RET_OK 返回错误字符串 ...
def function[get_stock_quote, parameter[self, code_list]]: constant[ 获取订阅股票报价的实时数据,有订阅要求限制。 对于异步推送,参见StockQuoteHandlerBase :param code_list: 股票代码列表,必须确保code_list中的股票均订阅成功后才能够执行 :return: (ret, data) ret == RET_OK 返回pd dataframe数据,数据列格式如下 ret != ...
keyword[def] identifier[get_stock_quote] ( identifier[self] , identifier[code_list] ): literal[string] identifier[code_list] = identifier[unique_and_normalize_list] ( identifier[code_list] ) keyword[if] keyword[not] identifier[code_list] : identifier[error_str] = identifier[...
def get_stock_quote(self, code_list): """ 获取订阅股票报价的实时数据,有订阅要求限制。 对于异步推送,参见StockQuoteHandlerBase :param code_list: 股票代码列表,必须确保code_list中的股票均订阅成功后才能够执行 :return: (ret, data) ret == RET_OK 返回pd dataframe数据,数据列格式如下 ret != RET_OK 返回错误字符串 ...
def make_compare(key, value, obj): "Map a key name to a specific comparison function" if '__' not in key: # If no __ exists, default to doing an "exact" comparison key, comp = key, 'exact' else: key, comp = key.rsplit('__', 1) # Check if comp is valid if hasattr(Compare, comp...
def function[make_compare, parameter[key, value, obj]]: constant[Map a key name to a specific comparison function] if compare[constant[__] <ast.NotIn object at 0x7da2590d7190> name[key]] begin[:] <ast.Tuple object at 0x7da20c6e4b50> assign[=] tuple[[<ast.Name object at 0x7da20c6e5f30>, <...
keyword[def] identifier[make_compare] ( identifier[key] , identifier[value] , identifier[obj] ): literal[string] keyword[if] literal[string] keyword[not] keyword[in] identifier[key] : identifier[key] , identifier[comp] = identifier[key] , literal[string] keyword[else] : ide...
def make_compare(key, value, obj): """Map a key name to a specific comparison function""" if '__' not in key: # If no __ exists, default to doing an "exact" comparison (key, comp) = (key, 'exact') # depends on [control=['if'], data=['key']] else: (key, comp) = key.rsplit('__', 1) ...
def variants(case_id): """Show all variants for a case.""" filters = parse_filters() values = [value for key, value in iteritems(filters) if not isinstance(value, dict) and key != 'skip'] is_active = any(values) variants, nr_of_variants = app.db.variants( case_id, skip=...
def function[variants, parameter[case_id]]: constant[Show all variants for a case.] variable[filters] assign[=] call[name[parse_filters], parameter[]] variable[values] assign[=] <ast.ListComp object at 0x7da18f09f610> variable[is_active] assign[=] call[name[any], parameter[name[values]]]...
keyword[def] identifier[variants] ( identifier[case_id] ): literal[string] identifier[filters] = identifier[parse_filters] () identifier[values] =[ identifier[value] keyword[for] identifier[key] , identifier[value] keyword[in] identifier[iteritems] ( identifier[filters] ) keyword[if] keyword...
def variants(case_id): """Show all variants for a case.""" filters = parse_filters() values = [value for (key, value) in iteritems(filters) if not isinstance(value, dict) and key != 'skip'] is_active = any(values) (variants, nr_of_variants) = app.db.variants(case_id, skip=filters['skip'], filters={'...
def _updateExtraSelections(self): """Highlight current line """ cursorColumnIndex = self.textCursor().positionInBlock() bracketSelections = self._bracketHighlighter.extraSelections(self, self.textCursor().block(), ...
def function[_updateExtraSelections, parameter[self]]: constant[Highlight current line ] variable[cursorColumnIndex] assign[=] call[call[name[self].textCursor, parameter[]].positionInBlock, parameter[]] variable[bracketSelections] assign[=] call[name[self]._bracketHighlighter.extraSelect...
keyword[def] identifier[_updateExtraSelections] ( identifier[self] ): literal[string] identifier[cursorColumnIndex] = identifier[self] . identifier[textCursor] (). identifier[positionInBlock] () identifier[bracketSelections] = identifier[self] . identifier[_bracketHighlighter] . identifie...
def _updateExtraSelections(self): """Highlight current line """ cursorColumnIndex = self.textCursor().positionInBlock() bracketSelections = self._bracketHighlighter.extraSelections(self, self.textCursor().block(), cursorColumnIndex) selections = self._currentLineExtraSelections() + self._rectang...
def create_or_update_user(self, user_id, password, roles): """ Create a new user record, or update an existing one :param user_id: user ID to update or create :param password: new password, or None to leave unchanged :param roles: new roles, o...
def function[create_or_update_user, parameter[self, user_id, password, roles]]: constant[ Create a new user record, or update an existing one :param user_id: user ID to update or create :param password: new password, or None to leave unchanged :param role...
keyword[def] identifier[create_or_update_user] ( identifier[self] , identifier[user_id] , identifier[password] , identifier[roles] ): literal[string] identifier[action] = literal[string] identifier[self] . identifier[con] . identifier[execute] ( literal[string] ,( identifier[user_id] ,)) ...
def create_or_update_user(self, user_id, password, roles): """ Create a new user record, or update an existing one :param user_id: user ID to update or create :param password: new password, or None to leave unchanged :param roles: new roles, or No...
def cli(env, identifier, details): """Invoices and all that mess""" manager = AccountManager(env.client) top_items = manager.get_billing_items(identifier) title = "Invoice %s" % identifier table = formatting.Table(["Item Id", "Category", "Description", "Single", "Mont...
def function[cli, parameter[env, identifier, details]]: constant[Invoices and all that mess] variable[manager] assign[=] call[name[AccountManager], parameter[name[env].client]] variable[top_items] assign[=] call[name[manager].get_billing_items, parameter[name[identifier]]] variable[title...
keyword[def] identifier[cli] ( identifier[env] , identifier[identifier] , identifier[details] ): literal[string] identifier[manager] = identifier[AccountManager] ( identifier[env] . identifier[client] ) identifier[top_items] = identifier[manager] . identifier[get_billing_items] ( identifier[identifie...
def cli(env, identifier, details): """Invoices and all that mess""" manager = AccountManager(env.client) top_items = manager.get_billing_items(identifier) title = 'Invoice %s' % identifier table = formatting.Table(['Item Id', 'Category', 'Description', 'Single', 'Monthly', 'Create Date', 'Location']...
def make_wcs(shape, galactic=False): """ Create a simple celestial WCS object in either the ICRS or Galactic coordinate frame. Parameters ---------- shape : 2-tuple of int The shape of the 2D array to be used with the output `~astropy.wcs.WCS` object. galactic : bool, optio...
def function[make_wcs, parameter[shape, galactic]]: constant[ Create a simple celestial WCS object in either the ICRS or Galactic coordinate frame. Parameters ---------- shape : 2-tuple of int The shape of the 2D array to be used with the output `~astropy.wcs.WCS` object. ...
keyword[def] identifier[make_wcs] ( identifier[shape] , identifier[galactic] = keyword[False] ): literal[string] identifier[wcs] = identifier[WCS] ( identifier[naxis] = literal[int] ) identifier[rho] = identifier[np] . identifier[pi] / literal[int] identifier[scale] = literal[int] / literal[int...
def make_wcs(shape, galactic=False): """ Create a simple celestial WCS object in either the ICRS or Galactic coordinate frame. Parameters ---------- shape : 2-tuple of int The shape of the 2D array to be used with the output `~astropy.wcs.WCS` object. galactic : bool, optio...
def get_eligible_users_for_extension(self, extension_id, options): """GetEligibleUsersForExtension. [Preview API] Returns users that are currently eligible to assign the extension to. the list is filtered based on the value of ExtensionFilterOptions :param str extension_id: The extension to chec...
def function[get_eligible_users_for_extension, parameter[self, extension_id, options]]: constant[GetEligibleUsersForExtension. [Preview API] Returns users that are currently eligible to assign the extension to. the list is filtered based on the value of ExtensionFilterOptions :param str extensio...
keyword[def] identifier[get_eligible_users_for_extension] ( identifier[self] , identifier[extension_id] , identifier[options] ): literal[string] identifier[route_values] ={} keyword[if] identifier[extension_id] keyword[is] keyword[not] keyword[None] : identifier[route_valu...
def get_eligible_users_for_extension(self, extension_id, options): """GetEligibleUsersForExtension. [Preview API] Returns users that are currently eligible to assign the extension to. the list is filtered based on the value of ExtensionFilterOptions :param str extension_id: The extension to check th...
def get_next_event(process, queue): ''' This function polls the process until it returns a valid item or returns PROCESS_DEAD_AND_QUEUE_EMPTY if it is in a state where the process has terminated and the queue is empty Warning: if the child process is in an infinite loop. This will also infinite...
def function[get_next_event, parameter[process, queue]]: constant[ This function polls the process until it returns a valid item or returns PROCESS_DEAD_AND_QUEUE_EMPTY if it is in a state where the process has terminated and the queue is empty Warning: if the child process is in an infinite lo...
keyword[def] identifier[get_next_event] ( identifier[process] , identifier[queue] ): literal[string] keyword[while] keyword[True] : keyword[try] : keyword[return] identifier[queue] . identifier[get] ( identifier[block] = keyword[True] , identifier[timeout] = identifier[TICK] ) ...
def get_next_event(process, queue): """ This function polls the process until it returns a valid item or returns PROCESS_DEAD_AND_QUEUE_EMPTY if it is in a state where the process has terminated and the queue is empty Warning: if the child process is in an infinite loop. This will also infinite...
def mix_columns(state): """ Transformation in the Cipher that takes all of the columns of the State and mixes their data (independently of one another) to produce new columns. """ state = state.reshape(4, 4, 8) return fcat( multiply(MA, state[0]), multiply(MA, state[1]), ...
def function[mix_columns, parameter[state]]: constant[ Transformation in the Cipher that takes all of the columns of the State and mixes their data (independently of one another) to produce new columns. ] variable[state] assign[=] call[name[state].reshape, parameter[constant[4], constant[4],...
keyword[def] identifier[mix_columns] ( identifier[state] ): literal[string] identifier[state] = identifier[state] . identifier[reshape] ( literal[int] , literal[int] , literal[int] ) keyword[return] identifier[fcat] ( identifier[multiply] ( identifier[MA] , identifier[state] [ literal[int] ]), ...
def mix_columns(state): """ Transformation in the Cipher that takes all of the columns of the State and mixes their data (independently of one another) to produce new columns. """ state = state.reshape(4, 4, 8) return fcat(multiply(MA, state[0]), multiply(MA, state[1]), multiply(MA, state[2]), m...
def promote(self, name): """Promote to a PartitionName by combining with a bundle Name.""" return PartitionName(**dict(list(name.dict.items()) + list(self.dict.items())))
def function[promote, parameter[self, name]]: constant[Promote to a PartitionName by combining with a bundle Name.] return[call[name[PartitionName], parameter[]]]
keyword[def] identifier[promote] ( identifier[self] , identifier[name] ): literal[string] keyword[return] identifier[PartitionName] (** identifier[dict] ( identifier[list] ( identifier[name] . identifier[dict] . identifier[items] ())+ identifier[list] ( identifier[self] . identifier[dict] . identi...
def promote(self, name): """Promote to a PartitionName by combining with a bundle Name.""" return PartitionName(**dict(list(name.dict.items()) + list(self.dict.items())))
def generate_py(): """Generate the python output file""" model = {} vk = init() format_vk(vk) model_alias(vk, model) model_typedefs(vk, model) model_enums(vk, model) model_macros(vk, model) model_funcpointers(vk, model) model_exceptions(vk, model) model_constructors(vk, mode...
def function[generate_py, parameter[]]: constant[Generate the python output file] variable[model] assign[=] dictionary[[], []] variable[vk] assign[=] call[name[init], parameter[]] call[name[format_vk], parameter[name[vk]]] call[name[model_alias], parameter[name[vk], name[model]]]...
keyword[def] identifier[generate_py] (): literal[string] identifier[model] ={} identifier[vk] = identifier[init] () identifier[format_vk] ( identifier[vk] ) identifier[model_alias] ( identifier[vk] , identifier[model] ) identifier[model_typedefs] ( identifier[vk] , identifier[model] ) ...
def generate_py(): """Generate the python output file""" model = {} vk = init() format_vk(vk) model_alias(vk, model) model_typedefs(vk, model) model_enums(vk, model) model_macros(vk, model) model_funcpointers(vk, model) model_exceptions(vk, model) model_constructors(vk, model...
def gregorian_date(year, julian_day): """ Gregorian Date is defined as a year and a julian day (1-based index into the days of the year). >>> gregorian_date(2007, 15) datetime.date(2007, 1, 15) """ result = datetime.date(year, 1, 1) result += datetime.timedelta(days=julian_day - 1) return result
def function[gregorian_date, parameter[year, julian_day]]: constant[ Gregorian Date is defined as a year and a julian day (1-based index into the days of the year). >>> gregorian_date(2007, 15) datetime.date(2007, 1, 15) ] variable[result] assign[=] call[name[datetime].date, parameter[name[year], ...
keyword[def] identifier[gregorian_date] ( identifier[year] , identifier[julian_day] ): literal[string] identifier[result] = identifier[datetime] . identifier[date] ( identifier[year] , literal[int] , literal[int] ) identifier[result] += identifier[datetime] . identifier[timedelta] ( identifier[days] = identifi...
def gregorian_date(year, julian_day): """ Gregorian Date is defined as a year and a julian day (1-based index into the days of the year). >>> gregorian_date(2007, 15) datetime.date(2007, 1, 15) """ result = datetime.date(year, 1, 1) result += datetime.timedelta(days=julian_day - 1) return result
def _write_handle(self, conn, handle, ack, value, timeout=1.0): """Write to a BLE device characteristic by its handle Args: conn (int): The connection handle for the device we should read from handle (int): The characteristics handle we should read ack (bool): Should...
def function[_write_handle, parameter[self, conn, handle, ack, value, timeout]]: constant[Write to a BLE device characteristic by its handle Args: conn (int): The connection handle for the device we should read from handle (int): The characteristics handle we should read ...
keyword[def] identifier[_write_handle] ( identifier[self] , identifier[conn] , identifier[handle] , identifier[ack] , identifier[value] , identifier[timeout] = literal[int] ): literal[string] identifier[conn_handle] = identifier[conn] identifier[char_handle] = identifier[handle] ...
def _write_handle(self, conn, handle, ack, value, timeout=1.0): """Write to a BLE device characteristic by its handle Args: conn (int): The connection handle for the device we should read from handle (int): The characteristics handle we should read ack (bool): Should thi...
def summarize_mutation(mutation_name, event, inputs, outputs, isAsync=False): """ This function provides a standard representation of mutations to be used when services announce themselves """ return dict( name=mutation_name, event=event, isAsync=isAsync, inpu...
def function[summarize_mutation, parameter[mutation_name, event, inputs, outputs, isAsync]]: constant[ This function provides a standard representation of mutations to be used when services announce themselves ] return[call[name[dict], parameter[]]]
keyword[def] identifier[summarize_mutation] ( identifier[mutation_name] , identifier[event] , identifier[inputs] , identifier[outputs] , identifier[isAsync] = keyword[False] ): literal[string] keyword[return] identifier[dict] ( identifier[name] = identifier[mutation_name] , identifier[event] = i...
def summarize_mutation(mutation_name, event, inputs, outputs, isAsync=False): """ This function provides a standard representation of mutations to be used when services announce themselves """ return dict(name=mutation_name, event=event, isAsync=isAsync, inputs=inputs, outputs=outputs)
def split(self, sep=None, maxsplit=None, regex=False): """Split based on seperator, optionally using a regex Capture groups are ignored in regex, the whole pattern is matched and used to split the original FmtStr.""" if maxsplit is not None: raise NotImplementedError('no max...
def function[split, parameter[self, sep, maxsplit, regex]]: constant[Split based on seperator, optionally using a regex Capture groups are ignored in regex, the whole pattern is matched and used to split the original FmtStr.] if compare[name[maxsplit] is_not constant[None]] begin[:] ...
keyword[def] identifier[split] ( identifier[self] , identifier[sep] = keyword[None] , identifier[maxsplit] = keyword[None] , identifier[regex] = keyword[False] ): literal[string] keyword[if] identifier[maxsplit] keyword[is] keyword[not] keyword[None] : keyword[raise] identifier[No...
def split(self, sep=None, maxsplit=None, regex=False): """Split based on seperator, optionally using a regex Capture groups are ignored in regex, the whole pattern is matched and used to split the original FmtStr.""" if maxsplit is not None: raise NotImplementedError('no maxsplit yet') ...
def link_type(arg_type, arg_name=None, include_bt:bool=True): "Create link to documentation." arg_name = arg_name or fn_name(arg_type) if include_bt: arg_name = code_esc(arg_name) if belongs_to_module(arg_type, 'torch') and ('Tensor' not in arg_name): return f'[{arg_name}]({get_pytorch_link(arg_type)})'...
def function[link_type, parameter[arg_type, arg_name, include_bt]]: constant[Create link to documentation.] variable[arg_name] assign[=] <ast.BoolOp object at 0x7da1b1e9a530> if name[include_bt] begin[:] variable[arg_name] assign[=] call[name[code_esc], parameter[name[arg_name]]]...
keyword[def] identifier[link_type] ( identifier[arg_type] , identifier[arg_name] = keyword[None] , identifier[include_bt] : identifier[bool] = keyword[True] ): literal[string] identifier[arg_name] = identifier[arg_name] keyword[or] identifier[fn_name] ( identifier[arg_type] ) keyword[if] identifier...
def link_type(arg_type, arg_name=None, include_bt: bool=True): """Create link to documentation.""" arg_name = arg_name or fn_name(arg_type) if include_bt: arg_name = code_esc(arg_name) # depends on [control=['if'], data=[]] if belongs_to_module(arg_type, 'torch') and 'Tensor' not in arg_name: ...
def transaction_write(self, items, client_request_token): """ Wraps :func:`boto3.DynamoDB.Client.db.transact_write_items`. :param items: Unpacked into "TransactionItems" for :func:`boto3.DynamoDB.Client.transact_write_items` :param client_request_token: Idempotency token valid for 10 mi...
def function[transaction_write, parameter[self, items, client_request_token]]: constant[ Wraps :func:`boto3.DynamoDB.Client.db.transact_write_items`. :param items: Unpacked into "TransactionItems" for :func:`boto3.DynamoDB.Client.transact_write_items` :param client_request_token: Idempo...
keyword[def] identifier[transaction_write] ( identifier[self] , identifier[items] , identifier[client_request_token] ): literal[string] keyword[try] : identifier[self] . identifier[dynamodb_client] . identifier[transact_write_items] ( identifier[TransactItems] = identifier...
def transaction_write(self, items, client_request_token): """ Wraps :func:`boto3.DynamoDB.Client.db.transact_write_items`. :param items: Unpacked into "TransactionItems" for :func:`boto3.DynamoDB.Client.transact_write_items` :param client_request_token: Idempotency token valid for 10 minute...
def tag(self, alt='', use_size=None, **attrs): """ Return a standard XHTML ``<img ... />`` tag for this field. :param alt: The ``alt=""`` text for the tag. Defaults to ``''``. :param use_size: Whether to get the size of the thumbnail image for use in the tag attributes. If ...
def function[tag, parameter[self, alt, use_size]]: constant[ Return a standard XHTML ``<img ... />`` tag for this field. :param alt: The ``alt=""`` text for the tag. Defaults to ``''``. :param use_size: Whether to get the size of the thumbnail image for use in the tag attri...
keyword[def] identifier[tag] ( identifier[self] , identifier[alt] = literal[string] , identifier[use_size] = keyword[None] ,** identifier[attrs] ): literal[string] keyword[if] identifier[use_size] keyword[is] keyword[None] : keyword[if] identifier[getattr] ( identifier[self] , lite...
def tag(self, alt='', use_size=None, **attrs): """ Return a standard XHTML ``<img ... />`` tag for this field. :param alt: The ``alt=""`` text for the tag. Defaults to ``''``. :param use_size: Whether to get the size of the thumbnail image for use in the tag attributes. If ``No...
def _get_keyid(keytype, scheme, key_value, hash_algorithm = 'sha256'): """Return the keyid of 'key_value'.""" # 'keyid' will be generated from an object conformant to KEY_SCHEMA, # which is the format Metadata files (e.g., root.json) store keys. # 'format_keyval_to_metadata()' returns the object needed by _get...
def function[_get_keyid, parameter[keytype, scheme, key_value, hash_algorithm]]: constant[Return the keyid of 'key_value'.] variable[key_meta] assign[=] call[name[format_keyval_to_metadata], parameter[name[keytype], name[scheme], name[key_value]]] variable[key_update_data] assign[=] call[name[se...
keyword[def] identifier[_get_keyid] ( identifier[keytype] , identifier[scheme] , identifier[key_value] , identifier[hash_algorithm] = literal[string] ): literal[string] identifier[key_meta] = identifier[format_keyval_to_metadata] ( identifier[keytype] , identifier[scheme] , identifier[key_value] , id...
def _get_keyid(keytype, scheme, key_value, hash_algorithm='sha256'): """Return the keyid of 'key_value'.""" # 'keyid' will be generated from an object conformant to KEY_SCHEMA, # which is the format Metadata files (e.g., root.json) store keys. # 'format_keyval_to_metadata()' returns the object needed by...
def set_composite_filter(filter_proto, op, *filters): """Set composite filter contraint in the given datastore.Filter proto message. Args: filter_proto: datastore.Filter proto message op: datastore.CompositeFilter.Operation filters: vararg list of datastore.Filter Returns: the same datastore.Filt...
def function[set_composite_filter, parameter[filter_proto, op]]: constant[Set composite filter contraint in the given datastore.Filter proto message. Args: filter_proto: datastore.Filter proto message op: datastore.CompositeFilter.Operation filters: vararg list of datastore.Filter Returns: ...
keyword[def] identifier[set_composite_filter] ( identifier[filter_proto] , identifier[op] ,* identifier[filters] ): literal[string] identifier[filter_proto] . identifier[Clear] () identifier[cf] = identifier[filter_proto] . identifier[composite_filter] identifier[cf] . identifier[op] = identifier[op] ...
def set_composite_filter(filter_proto, op, *filters): """Set composite filter contraint in the given datastore.Filter proto message. Args: filter_proto: datastore.Filter proto message op: datastore.CompositeFilter.Operation filters: vararg list of datastore.Filter Returns: the same datastore.Fi...
def calibrate(self): ''' Calibration involves probing for top plate to get the plate height ''' if self._driver and self._driver.is_connected(): self._driver.probe_plate() # return if successful or not? self._engaged = False
def function[calibrate, parameter[self]]: constant[ Calibration involves probing for top plate to get the plate height ] if <ast.BoolOp object at 0x7da20c7cad10> begin[:] call[name[self]._driver.probe_plate, parameter[]] name[self]._engaged assign[=] const...
keyword[def] identifier[calibrate] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_driver] keyword[and] identifier[self] . identifier[_driver] . identifier[is_connected] (): identifier[self] . identifier[_driver] . identifier[probe_plate] () ...
def calibrate(self): """ Calibration involves probing for top plate to get the plate height """ if self._driver and self._driver.is_connected(): self._driver.probe_plate() # return if successful or not? self._engaged = False # depends on [control=['if'], data=[]]
def setupViewletByName(self, name): """ Constructs a viewlet instance by its name. Viewlet update() and render() method are not called. @return: Viewlet instance of None if viewlet with name does not exist """ context = aq_inner(self.context) request = self.request ...
def function[setupViewletByName, parameter[self, name]]: constant[ Constructs a viewlet instance by its name. Viewlet update() and render() method are not called. @return: Viewlet instance of None if viewlet with name does not exist ] variable[context] assign[=] call[name[aq_in...
keyword[def] identifier[setupViewletByName] ( identifier[self] , identifier[name] ): literal[string] identifier[context] = identifier[aq_inner] ( identifier[self] . identifier[context] ) identifier[request] = identifier[self] . identifier[request] identifier[re...
def setupViewletByName(self, name): """ Constructs a viewlet instance by its name. Viewlet update() and render() method are not called. @return: Viewlet instance of None if viewlet with name does not exist """ context = aq_inner(self.context) request = self.request # Perform vi...
def open_listing_page(trailing_part_of_url): """ Opens a BBC radio tracklisting page based on trailing part of url. Returns a lxml ElementTree derived from that page. trailing_part_of_url: a string, like the pid or e.g. pid/segments.inc """ base_url = 'http://www.bbc.co.uk/programmes/' prin...
def function[open_listing_page, parameter[trailing_part_of_url]]: constant[ Opens a BBC radio tracklisting page based on trailing part of url. Returns a lxml ElementTree derived from that page. trailing_part_of_url: a string, like the pid or e.g. pid/segments.inc ] variable[base_url] as...
keyword[def] identifier[open_listing_page] ( identifier[trailing_part_of_url] ): literal[string] identifier[base_url] = literal[string] identifier[print] ( literal[string] + identifier[base_url] + identifier[trailing_part_of_url] ) keyword[try] : identifier[html] = identifier[requests]...
def open_listing_page(trailing_part_of_url): """ Opens a BBC radio tracklisting page based on trailing part of url. Returns a lxml ElementTree derived from that page. trailing_part_of_url: a string, like the pid or e.g. pid/segments.inc """ base_url = 'http://www.bbc.co.uk/programmes/' prin...
def refresh_content(self, order=None, name=None): """ Re-download all subscriptions and reset the page index """ # reddit.get_my_subreddits() does not support sorting by order if order: self.term.flash() return with self.term.loader(): ...
def function[refresh_content, parameter[self, order, name]]: constant[ Re-download all subscriptions and reset the page index ] if name[order] begin[:] call[name[self].term.flash, parameter[]] return[None] with call[name[self].term.loader, parameter[]] beg...
keyword[def] identifier[refresh_content] ( identifier[self] , identifier[order] = keyword[None] , identifier[name] = keyword[None] ): literal[string] keyword[if] identifier[order] : identifier[self] . identifier[term] . identifier[flash] () keyword[return] ...
def refresh_content(self, order=None, name=None): """ Re-download all subscriptions and reset the page index """ # reddit.get_my_subreddits() does not support sorting by order if order: self.term.flash() return # depends on [control=['if'], data=[]] with self.term.loader...
def split_unit(self, unit_id, indices): '''This function splits a root from the curation tree according to the given unit_id and indices. It creates two new unit_ids and roots that have the split root as a child. This function splits the spike train of the root by the given indices. Parameters ...
def function[split_unit, parameter[self, unit_id, indices]]: constant[This function splits a root from the curation tree according to the given unit_id and indices. It creates two new unit_ids and roots that have the split root as a child. This function splits the spike train of the root by the given in...
keyword[def] identifier[split_unit] ( identifier[self] , identifier[unit_id] , identifier[indices] ): literal[string] identifier[root_ids] =[] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[len] ( identifier[self] . identifier[_roots] )): identifier[r...
def split_unit(self, unit_id, indices): """This function splits a root from the curation tree according to the given unit_id and indices. It creates two new unit_ids and roots that have the split root as a child. This function splits the spike train of the root by the given indices. Parameters ...
def formfield_for_dbfield(self, db_field, **kwargs): """ Same as parent but sets the widget for any OrderFields to HiddenTextInput. """ if isinstance(db_field, fields.OrderField): kwargs['widget'] = widgets.HiddenTextInput return super(ListView, self).formfie...
def function[formfield_for_dbfield, parameter[self, db_field]]: constant[ Same as parent but sets the widget for any OrderFields to HiddenTextInput. ] if call[name[isinstance], parameter[name[db_field], name[fields].OrderField]] begin[:] call[name[kwargs]][constan...
keyword[def] identifier[formfield_for_dbfield] ( identifier[self] , identifier[db_field] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[isinstance] ( identifier[db_field] , identifier[fields] . identifier[OrderField] ): identifier[kwargs] [ literal[string] ]= identif...
def formfield_for_dbfield(self, db_field, **kwargs): """ Same as parent but sets the widget for any OrderFields to HiddenTextInput. """ if isinstance(db_field, fields.OrderField): kwargs['widget'] = widgets.HiddenTextInput # depends on [control=['if'], data=[]] return super(...
def _get_add_trustee_cmd(self, trustee): '''Get tmsh command to add a trusted device. :param trustee: ManagementRoot object -- device to add as trusted :returns: str -- tmsh command to add trustee ''' trustee_info = pollster(get_device_info)(trustee) username = trustee....
def function[_get_add_trustee_cmd, parameter[self, trustee]]: constant[Get tmsh command to add a trusted device. :param trustee: ManagementRoot object -- device to add as trusted :returns: str -- tmsh command to add trustee ] variable[trustee_info] assign[=] call[call[name[polls...
keyword[def] identifier[_get_add_trustee_cmd] ( identifier[self] , identifier[trustee] ): literal[string] identifier[trustee_info] = identifier[pollster] ( identifier[get_device_info] )( identifier[trustee] ) identifier[username] = identifier[trustee] . identifier[_meta_data] [ literal[st...
def _get_add_trustee_cmd(self, trustee): """Get tmsh command to add a trusted device. :param trustee: ManagementRoot object -- device to add as trusted :returns: str -- tmsh command to add trustee """ trustee_info = pollster(get_device_info)(trustee) username = trustee._meta_data['u...
def help(self): """Return full help message for the step wizard. :returns: A message object contains help text. :rtype: m.Message """ message = m.Message() message.add(m.Brand()) message.add(self.help_heading()) message.add(self.help_content()) re...
def function[help, parameter[self]]: constant[Return full help message for the step wizard. :returns: A message object contains help text. :rtype: m.Message ] variable[message] assign[=] call[name[m].Message, parameter[]] call[name[message].add, parameter[call[name[m].Br...
keyword[def] identifier[help] ( identifier[self] ): literal[string] identifier[message] = identifier[m] . identifier[Message] () identifier[message] . identifier[add] ( identifier[m] . identifier[Brand] ()) identifier[message] . identifier[add] ( identifier[self] . identifier[help...
def help(self): """Return full help message for the step wizard. :returns: A message object contains help text. :rtype: m.Message """ message = m.Message() message.add(m.Brand()) message.add(self.help_heading()) message.add(self.help_content()) return message
def article(word, function=INDEFINITE, gender=MALE, role=SUBJECT): """ Returns the indefinite (ein) or definite (der/die/das/die) article for the given word. """ return function == DEFINITE \ and definite_article(word, gender, role) \ or indefinite_article(word, gender, role)
def function[article, parameter[word, function, gender, role]]: constant[ Returns the indefinite (ein) or definite (der/die/das/die) article for the given word. ] return[<ast.BoolOp object at 0x7da1b2346800>]
keyword[def] identifier[article] ( identifier[word] , identifier[function] = identifier[INDEFINITE] , identifier[gender] = identifier[MALE] , identifier[role] = identifier[SUBJECT] ): literal[string] keyword[return] identifier[function] == identifier[DEFINITE] keyword[and] identifier[definite_article] (...
def article(word, function=INDEFINITE, gender=MALE, role=SUBJECT): """ Returns the indefinite (ein) or definite (der/die/das/die) article for the given word. """ return function == DEFINITE and definite_article(word, gender, role) or indefinite_article(word, gender, role)
def infer_type(self, in_type): """infer_type interface. override to create new operators Parameters ---------- in_type : list of np.dtype list of argument types in the same order as declared in list_arguments. Returns ------- in_type : li...
def function[infer_type, parameter[self, in_type]]: constant[infer_type interface. override to create new operators Parameters ---------- in_type : list of np.dtype list of argument types in the same order as declared in list_arguments. Returns -...
keyword[def] identifier[infer_type] ( identifier[self] , identifier[in_type] ): literal[string] keyword[return] identifier[in_type] ,[ identifier[in_type] [ literal[int] ]]* identifier[len] ( identifier[self] . identifier[list_outputs] ()),[ identifier[in_type] [ literal[int] ]]* identifier[len] (...
def infer_type(self, in_type): """infer_type interface. override to create new operators Parameters ---------- in_type : list of np.dtype list of argument types in the same order as declared in list_arguments. Returns ------- in_type : list ...
def OnVideoCell(self, event): """Event handler for video cell toggle button""" if self.video_cell_button_id == event.GetId(): if event.IsChecked(): wildcard = _("Media files") + " (*.*)|*.*" videofile, __ = self.get_filepath_findex_from_user( ...
def function[OnVideoCell, parameter[self, event]]: constant[Event handler for video cell toggle button] if compare[name[self].video_cell_button_id equal[==] call[name[event].GetId, parameter[]]] begin[:] if call[name[event].IsChecked, parameter[]] begin[:] variabl...
keyword[def] identifier[OnVideoCell] ( identifier[self] , identifier[event] ): literal[string] keyword[if] identifier[self] . identifier[video_cell_button_id] == identifier[event] . identifier[GetId] (): keyword[if] identifier[event] . identifier[IsChecked] (): iden...
def OnVideoCell(self, event): """Event handler for video cell toggle button""" if self.video_cell_button_id == event.GetId(): if event.IsChecked(): wildcard = _('Media files') + ' (*.*)|*.*' (videofile, __) = self.get_filepath_findex_from_user(wildcard, 'Choose video or audio fil...
def _in_list(self, original_list, item): """ Check that an item as contained in a list. :param original_list: The list. :type original_list: list(object) :param item: The item. :type item: hatemile.util.html.htmldomelement.HTMLDOMElement :return: True if the item...
def function[_in_list, parameter[self, original_list, item]]: constant[ Check that an item as contained in a list. :param original_list: The list. :type original_list: list(object) :param item: The item. :type item: hatemile.util.html.htmldomelement.HTMLDOMElement ...
keyword[def] identifier[_in_list] ( identifier[self] , identifier[original_list] , identifier[item] ): literal[string] keyword[for] identifier[item_list] keyword[in] identifier[original_list] : keyword[if] identifier[item] keyword[is] identifier[item_list] : ...
def _in_list(self, original_list, item): """ Check that an item as contained in a list. :param original_list: The list. :type original_list: list(object) :param item: The item. :type item: hatemile.util.html.htmldomelement.HTMLDOMElement :return: True if the item con...
def pw( ctx, key_pattern, user_pattern, mode, strict_flag, user_flag, file, edit_subcommand, gen_subcommand, ): """Search for USER and KEY in GPG-encrypted password file.""" # install silent Ctrl-C handler def handle_sigint(*_): click.echo() ctx.exit(1) ...
def function[pw, parameter[ctx, key_pattern, user_pattern, mode, strict_flag, user_flag, file, edit_subcommand, gen_subcommand]]: constant[Search for USER and KEY in GPG-encrypted password file.] def function[handle_sigint, parameter[]]: call[name[click].echo, parameter[]] ...
keyword[def] identifier[pw] ( identifier[ctx] , identifier[key_pattern] , identifier[user_pattern] , identifier[mode] , identifier[strict_flag] , identifier[user_flag] , identifier[file] , identifier[edit_subcommand] , identifier[gen_subcommand] , ): literal[string] keyword[def] identifier[...
def pw(ctx, key_pattern, user_pattern, mode, strict_flag, user_flag, file, edit_subcommand, gen_subcommand): """Search for USER and KEY in GPG-encrypted password file.""" # install silent Ctrl-C handler def handle_sigint(*_): click.echo() ctx.exit(1) signal.signal(signal.SIGINT, handle_...
def binarySearch(self, ip): """ " binary search method " param: ip """ if not ip.isdigit(): ip = self.ip2Long(ip) if self.__indexLen < 1: self.__f.seek(0) b = self.__f.read(8) self.__sPtr = self.getLong(b, 0) endPtr = ...
def function[binarySearch, parameter[self, ip]]: constant[ " binary search method " param: ip ] if <ast.UnaryOp object at 0x7da1b15b1a80> begin[:] variable[ip] assign[=] call[name[self].ip2Long, parameter[name[ip]]] if compare[name[self].__indexLen less[<]...
keyword[def] identifier[binarySearch] ( identifier[self] , identifier[ip] ): literal[string] keyword[if] keyword[not] identifier[ip] . identifier[isdigit] (): identifier[ip] = identifier[self] . identifier[ip2Long] ( identifier[ip] ) keyword[if] identifier[self] . identifier[__indexLen...
def binarySearch(self, ip): """ " binary search method " param: ip """ if not ip.isdigit(): ip = self.ip2Long(ip) # depends on [control=['if'], data=[]] if self.__indexLen < 1: self.__f.seek(0) b = self.__f.read(8) self.__sPtr = self.getLong(b, 0) ...
def _disk_profile(profile, hypervisor, disks=None, vm_name=None, image=None, pool=None, **kwargs): ''' Gather the disk profile from the config or apply the default based on the active hypervisor This is the ``default`` profile for KVM/QEMU, which can be overridden in the configuration: .. code...
def function[_disk_profile, parameter[profile, hypervisor, disks, vm_name, image, pool]]: constant[ Gather the disk profile from the config or apply the default based on the active hypervisor This is the ``default`` profile for KVM/QEMU, which can be overridden in the configuration: .. cod...
keyword[def] identifier[_disk_profile] ( identifier[profile] , identifier[hypervisor] , identifier[disks] = keyword[None] , identifier[vm_name] = keyword[None] , identifier[image] = keyword[None] , identifier[pool] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[default] =[{ literal[st...
def _disk_profile(profile, hypervisor, disks=None, vm_name=None, image=None, pool=None, **kwargs): """ Gather the disk profile from the config or apply the default based on the active hypervisor This is the ``default`` profile for KVM/QEMU, which can be overridden in the configuration: .. code...
def on_new(self): """ Add a new empty code editor to the tab widget """ interpreter, pyserver, args = self._get_backend_parameters() self.setup_editor(self.tabWidget.create_new_document( extension='.py', interpreter=interpreter, server_script=pyserver, arg...
def function[on_new, parameter[self]]: constant[ Add a new empty code editor to the tab widget ] <ast.Tuple object at 0x7da1b00cb070> assign[=] call[name[self]._get_backend_parameters, parameter[]] call[name[self].setup_editor, parameter[call[name[self].tabWidget.create_new_docum...
keyword[def] identifier[on_new] ( identifier[self] ): literal[string] identifier[interpreter] , identifier[pyserver] , identifier[args] = identifier[self] . identifier[_get_backend_parameters] () identifier[self] . identifier[setup_editor] ( identifier[self] . identifier[tabWidget] . ident...
def on_new(self): """ Add a new empty code editor to the tab widget """ (interpreter, pyserver, args) = self._get_backend_parameters() self.setup_editor(self.tabWidget.create_new_document(extension='.py', interpreter=interpreter, server_script=pyserver, args=args)) self.actionRun.setDisa...
def addTab(self, elem, icon, name): """ Extends QTabWidget.addTab to keep an internal list of added tabs. :param elem: tab widget :param icon: tab icon :param name: tab name """ self._widgets.append(elem) return super(TabWidget, self).addTab(elem, icon, n...
def function[addTab, parameter[self, elem, icon, name]]: constant[ Extends QTabWidget.addTab to keep an internal list of added tabs. :param elem: tab widget :param icon: tab icon :param name: tab name ] call[name[self]._widgets.append, parameter[name[elem]]] ...
keyword[def] identifier[addTab] ( identifier[self] , identifier[elem] , identifier[icon] , identifier[name] ): literal[string] identifier[self] . identifier[_widgets] . identifier[append] ( identifier[elem] ) keyword[return] identifier[super] ( identifier[TabWidget] , identifier[self] ). ...
def addTab(self, elem, icon, name): """ Extends QTabWidget.addTab to keep an internal list of added tabs. :param elem: tab widget :param icon: tab icon :param name: tab name """ self._widgets.append(elem) return super(TabWidget, self).addTab(elem, icon, name)
def get_patch_from_uid(self, uid): """ Returns the patch with given uid. :param uid: Patch uid. :type uid: unicode :return: Patch. :rtype: Patch """ for name, patch in self: if patch.uid == uid: return patch
def function[get_patch_from_uid, parameter[self, uid]]: constant[ Returns the patch with given uid. :param uid: Patch uid. :type uid: unicode :return: Patch. :rtype: Patch ] for taget[tuple[[<ast.Name object at 0x7da1b0810ee0>, <ast.Name object at 0x7da1b...
keyword[def] identifier[get_patch_from_uid] ( identifier[self] , identifier[uid] ): literal[string] keyword[for] identifier[name] , identifier[patch] keyword[in] identifier[self] : keyword[if] identifier[patch] . identifier[uid] == identifier[uid] : keyword[return...
def get_patch_from_uid(self, uid): """ Returns the patch with given uid. :param uid: Patch uid. :type uid: unicode :return: Patch. :rtype: Patch """ for (name, patch) in self: if patch.uid == uid: return patch # depends on [control=['if'], da...
def set(self, indexes, values=None): """ Given indexes will set a sub-set of the Series to the values provided. This method will direct to the below methods based on what types are passed in for the indexes. If the indexes contains values not in the Series then new rows or columns will...
def function[set, parameter[self, indexes, values]]: constant[ Given indexes will set a sub-set of the Series to the values provided. This method will direct to the below methods based on what types are passed in for the indexes. If the indexes contains values not in the Series then ne...
keyword[def] identifier[set] ( identifier[self] , identifier[indexes] , identifier[values] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[indexes] ,( identifier[list] , identifier[blist] )): identifier[self] . identifier[set_rows] ( identifier[index...
def set(self, indexes, values=None): """ Given indexes will set a sub-set of the Series to the values provided. This method will direct to the below methods based on what types are passed in for the indexes. If the indexes contains values not in the Series then new rows or columns will be ...