code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def default_update_function(self, n: Tuple[str, dict]) -> List[float]: """ The default update function for a CAG node. n: A 2-tuple containing the node name and node data. Returns: A list of values corresponding to the distribution of the value of the real-valued var...
def function[default_update_function, parameter[self, n]]: constant[ The default update function for a CAG node. n: A 2-tuple containing the node name and node data. Returns: A list of values corresponding to the distribution of the value of the real-valued variable ...
keyword[def] identifier[default_update_function] ( identifier[self] , identifier[n] : identifier[Tuple] [ identifier[str] , identifier[dict] ])-> identifier[List] [ identifier[float] ]: literal[string] keyword[return] [ identifier[self] . identifier[transition_matrix_collection] [ identifi...
def default_update_function(self, n: Tuple[str, dict]) -> List[float]: """ The default update function for a CAG node. n: A 2-tuple containing the node name and node data. Returns: A list of values corresponding to the distribution of the value of the real-valued variabl...
def fasper(x, y, ofac, hifac, n_threads, MACC=4): """ Given abscissas x (which need not be equally spaced) and ordinates y, and given a desired oversampling factor ofac (a typical value being 4 or larger). this routine creates an array wk1 with a sequence of nout increasing frequencies (not angular ...
def function[fasper, parameter[x, y, ofac, hifac, n_threads, MACC]]: constant[ Given abscissas x (which need not be equally spaced) and ordinates y, and given a desired oversampling factor ofac (a typical value being 4 or larger). this routine creates an array wk1 with a sequence of nout increas...
keyword[def] identifier[fasper] ( identifier[x] , identifier[y] , identifier[ofac] , identifier[hifac] , identifier[n_threads] , identifier[MACC] = literal[int] ): literal[string] identifier[n] = identifier[long] ( identifier[len] ( identifier[x] )) keyword[if] identifier[n] != identifier[len] (...
def fasper(x, y, ofac, hifac, n_threads, MACC=4): """ Given abscissas x (which need not be equally spaced) and ordinates y, and given a desired oversampling factor ofac (a typical value being 4 or larger). this routine creates an array wk1 with a sequence of nout increasing frequencies (not angular ...
def execute_deploy_from_linked_clone(self, si, logger, vcenter_data_model, reservation_id, deployment_params, cancellation_context, folder_manager): """ Calls the deployer to deploy vm from snapshot :param cancellation_context: :param str reservation_id: :param si: :param...
def function[execute_deploy_from_linked_clone, parameter[self, si, logger, vcenter_data_model, reservation_id, deployment_params, cancellation_context, folder_manager]]: constant[ Calls the deployer to deploy vm from snapshot :param cancellation_context: :param str reservation_id: ...
keyword[def] identifier[execute_deploy_from_linked_clone] ( identifier[self] , identifier[si] , identifier[logger] , identifier[vcenter_data_model] , identifier[reservation_id] , identifier[deployment_params] , identifier[cancellation_context] , identifier[folder_manager] ): literal[string] identif...
def execute_deploy_from_linked_clone(self, si, logger, vcenter_data_model, reservation_id, deployment_params, cancellation_context, folder_manager): """ Calls the deployer to deploy vm from snapshot :param cancellation_context: :param str reservation_id: :param si: :param log...
def coverage(ctx, opts=""): """ Execute all tests (normal and slow) with coverage enabled. """ return test(ctx, coverage=True, include_slow=True, opts=opts)
def function[coverage, parameter[ctx, opts]]: constant[ Execute all tests (normal and slow) with coverage enabled. ] return[call[name[test], parameter[name[ctx]]]]
keyword[def] identifier[coverage] ( identifier[ctx] , identifier[opts] = literal[string] ): literal[string] keyword[return] identifier[test] ( identifier[ctx] , identifier[coverage] = keyword[True] , identifier[include_slow] = keyword[True] , identifier[opts] = identifier[opts] )
def coverage(ctx, opts=''): """ Execute all tests (normal and slow) with coverage enabled. """ return test(ctx, coverage=True, include_slow=True, opts=opts)
def load(self, path): """ Loads all tensors from a file defined by *path* and adds them to the root set. """ path = os.path.expandvars(os.path.expanduser(path)) with open(path, "rb") as f: roots = pickle.load(f) for key, tensor in roots.items(): s...
def function[load, parameter[self, path]]: constant[ Loads all tensors from a file defined by *path* and adds them to the root set. ] variable[path] assign[=] call[name[os].path.expandvars, parameter[call[name[os].path.expanduser, parameter[name[path]]]]] with call[name[open], pa...
keyword[def] identifier[load] ( identifier[self] , identifier[path] ): literal[string] identifier[path] = identifier[os] . identifier[path] . identifier[expandvars] ( identifier[os] . identifier[path] . identifier[expanduser] ( identifier[path] )) keyword[with] identifier[open] ( identifi...
def load(self, path): """ Loads all tensors from a file defined by *path* and adds them to the root set. """ path = os.path.expandvars(os.path.expanduser(path)) with open(path, 'rb') as f: roots = pickle.load(f) # depends on [control=['with'], data=['f']] for (key, tensor) in ro...
def nested_to_ring(nested_index, nside): """ Convert a HEALPix 'nested' index to a HEALPix 'ring' index Parameters ---------- nested_index : int or `~numpy.ndarray` Healpix index using the 'nested' ordering nside : int or `~numpy.ndarray` Number of pixels along the side of each ...
def function[nested_to_ring, parameter[nested_index, nside]]: constant[ Convert a HEALPix 'nested' index to a HEALPix 'ring' index Parameters ---------- nested_index : int or `~numpy.ndarray` Healpix index using the 'nested' ordering nside : int or `~numpy.ndarray` Number of...
keyword[def] identifier[nested_to_ring] ( identifier[nested_index] , identifier[nside] ): literal[string] identifier[nside] = identifier[np] . identifier[asarray] ( identifier[nside] , identifier[dtype] = identifier[np] . identifier[intc] ) keyword[return] identifier[_core] . identifier[nested_to_r...
def nested_to_ring(nested_index, nside): """ Convert a HEALPix 'nested' index to a HEALPix 'ring' index Parameters ---------- nested_index : int or `~numpy.ndarray` Healpix index using the 'nested' ordering nside : int or `~numpy.ndarray` Number of pixels along the side of each ...
def try_call(self, client_data=None, api_data=None, aux_data=None, *args, **kwargs): """ Calls the request catching all exceptions :param client_data: :param api_data: :param aux_data: :param args: :param kwargs: :return: """ try: ...
def function[try_call, parameter[self, client_data, api_data, aux_data]]: constant[ Calls the request catching all exceptions :param client_data: :param api_data: :param aux_data: :param args: :param kwargs: :return: ] <ast.Try object at 0x7da1...
keyword[def] identifier[try_call] ( identifier[self] , identifier[client_data] = keyword[None] , identifier[api_data] = keyword[None] , identifier[aux_data] = keyword[None] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[try] : keyword[return] identifier[self] . ...
def try_call(self, client_data=None, api_data=None, aux_data=None, *args, **kwargs): """ Calls the request catching all exceptions :param client_data: :param api_data: :param aux_data: :param args: :param kwargs: :return: """ try: return se...
def run(query, container=Null): """ THIS FUNCTION IS SIMPLY SWITCHING BASED ON THE query["from"] CONTAINER, BUT IT IS ALSO PROCESSING A list CONTAINER; SEPARATE TO A ListContainer """ if container == None: container = wrap(query)["from"] query_op = QueryOp.wrap(query, container=conta...
def function[run, parameter[query, container]]: constant[ THIS FUNCTION IS SIMPLY SWITCHING BASED ON THE query["from"] CONTAINER, BUT IT IS ALSO PROCESSING A list CONTAINER; SEPARATE TO A ListContainer ] if compare[name[container] equal[==] constant[None]] begin[:] variable[c...
keyword[def] identifier[run] ( identifier[query] , identifier[container] = identifier[Null] ): literal[string] keyword[if] identifier[container] == keyword[None] : identifier[container] = identifier[wrap] ( identifier[query] )[ literal[string] ] identifier[query_op] = identifier[QueryOp]...
def run(query, container=Null): """ THIS FUNCTION IS SIMPLY SWITCHING BASED ON THE query["from"] CONTAINER, BUT IT IS ALSO PROCESSING A list CONTAINER; SEPARATE TO A ListContainer """ if container == None: container = wrap(query)['from'] query_op = QueryOp.wrap(query, container=conta...
def pre_change_receiver(self, instance: Model, action: Action): """ Entry point for triggering the old_binding from save signals. """ if action == Action.CREATE: group_names = set() else: group_names = set(self.group_names(instance)) # use a threa...
def function[pre_change_receiver, parameter[self, instance, action]]: constant[ Entry point for triggering the old_binding from save signals. ] if compare[name[action] equal[==] name[Action].CREATE] begin[:] variable[group_names] assign[=] call[name[set], parameter[]] ...
keyword[def] identifier[pre_change_receiver] ( identifier[self] , identifier[instance] : identifier[Model] , identifier[action] : identifier[Action] ): literal[string] keyword[if] identifier[action] == identifier[Action] . identifier[CREATE] : identifier[group_names] = identifier[set]...
def pre_change_receiver(self, instance: Model, action: Action): """ Entry point for triggering the old_binding from save signals. """ if action == Action.CREATE: group_names = set() # depends on [control=['if'], data=[]] else: group_names = set(self.group_names(instance)) ...
def generate_dylib_load_command(header, libary_install_name): """ Generates a LC_LOAD_DYLIB command for the given header and a library install path. Note: the header must already contain at least one LC_LOAD_DYLIB command (see code comments). Returns a ready-for-use load_command in terms of macholib. """ # One...
def function[generate_dylib_load_command, parameter[header, libary_install_name]]: constant[ Generates a LC_LOAD_DYLIB command for the given header and a library install path. Note: the header must already contain at least one LC_LOAD_DYLIB command (see code comments). Returns a ready-for-use load_command i...
keyword[def] identifier[generate_dylib_load_command] ( identifier[header] , identifier[libary_install_name] ): literal[string] identifier[lc] = keyword[None] identifier[cmd] = keyword[None] keyword[for] ( identifier[command] , identifier[internal_cmd] , identifier[data] ) keyword[in] identifi...
def generate_dylib_load_command(header, libary_install_name): """ Generates a LC_LOAD_DYLIB command for the given header and a library install path. Note: the header must already contain at least one LC_LOAD_DYLIB command (see code comments). Returns a ready-for-use load_command in terms of macholib. """ # On...
def _try_parse_formula(self, compound_id, s): """Try to parse the given compound formula string. Logs a warning if the formula could not be parsed. """ s = s.strip() if s == '': return None try: # Do not return the parsed formula. For now it is b...
def function[_try_parse_formula, parameter[self, compound_id, s]]: constant[Try to parse the given compound formula string. Logs a warning if the formula could not be parsed. ] variable[s] assign[=] call[name[s].strip, parameter[]] if compare[name[s] equal[==] constant[]] begin[...
keyword[def] identifier[_try_parse_formula] ( identifier[self] , identifier[compound_id] , identifier[s] ): literal[string] identifier[s] = identifier[s] . identifier[strip] () keyword[if] identifier[s] == literal[string] : keyword[return] keyword[None] keyword[tr...
def _try_parse_formula(self, compound_id, s): """Try to parse the given compound formula string. Logs a warning if the formula could not be parsed. """ s = s.strip() if s == '': return None # depends on [control=['if'], data=[]] try: # Do not return the parsed formula. ...
def xml_to_metrics(xmlstr, object_type): '''Converts xml response to service bus metrics objects The xml format for MetricProperties <entry> <id>https://sbgm.windows.net/Metrics(\'listeners.active\')</id> <title/> <updated>2014-10-09T11:56:50Z</updated> <author> <name/> </au...
def function[xml_to_metrics, parameter[xmlstr, object_type]]: constant[Converts xml response to service bus metrics objects The xml format for MetricProperties <entry> <id>https://sbgm.windows.net/Metrics('listeners.active')</id> <title/> <updated>2014-10-09T11:56:50Z</updated> <author>...
keyword[def] identifier[xml_to_metrics] ( identifier[xmlstr] , identifier[object_type] ): literal[string] identifier[xmldoc] = identifier[minidom] . identifier[parseString] ( identifier[xmlstr] ) identifier[return_obj] = identifier[object_type] () identifier[members] = identifie...
def xml_to_metrics(xmlstr, object_type): """Converts xml response to service bus metrics objects The xml format for MetricProperties <entry> <id>https://sbgm.windows.net/Metrics('listeners.active')</id> <title/> <updated>2014-10-09T11:56:50Z</updated> <author> <name/> </author> ...
def run(self, sqlTail = '', raw = False) : """Compile filters and run the query and returns the entire result. You can use sqlTail to add things such as order by. If raw, returns the raw tuple data (not wrapped into a raba object)""" sql, sqlValues = self.getSQLQuery() cur = self.con.execute('%s %s'% (sql, sqlTai...
def function[run, parameter[self, sqlTail, raw]]: constant[Compile filters and run the query and returns the entire result. You can use sqlTail to add things such as order by. If raw, returns the raw tuple data (not wrapped into a raba object)] <ast.Tuple object at 0x7da1b0a851e0> assign[=] call[name[se...
keyword[def] identifier[run] ( identifier[self] , identifier[sqlTail] = literal[string] , identifier[raw] = keyword[False] ): literal[string] identifier[sql] , identifier[sqlValues] = identifier[self] . identifier[getSQLQuery] () identifier[cur] = identifier[self] . identifier[con] . identifier[execute] ( l...
def run(self, sqlTail='', raw=False): """Compile filters and run the query and returns the entire result. You can use sqlTail to add things such as order by. If raw, returns the raw tuple data (not wrapped into a raba object)""" (sql, sqlValues) = self.getSQLQuery() cur = self.con.execute('%s %s' % (sql, sq...
def setWhitespaceChars( self, chars ): """ Overrides the default whitespace chars """ self.skipWhitespace = True self.whiteChars = chars self.copyDefaultWhiteChars = False return self
def function[setWhitespaceChars, parameter[self, chars]]: constant[ Overrides the default whitespace chars ] name[self].skipWhitespace assign[=] constant[True] name[self].whiteChars assign[=] name[chars] name[self].copyDefaultWhiteChars assign[=] constant[False] retur...
keyword[def] identifier[setWhitespaceChars] ( identifier[self] , identifier[chars] ): literal[string] identifier[self] . identifier[skipWhitespace] = keyword[True] identifier[self] . identifier[whiteChars] = identifier[chars] identifier[self] . identifier[copyDefaultWhiteChars] ...
def setWhitespaceChars(self, chars): """ Overrides the default whitespace chars """ self.skipWhitespace = True self.whiteChars = chars self.copyDefaultWhiteChars = False return self
def _get_all_services(crypto=None, just_exchange=False): """ Go through the crypto_data structure and return all list of all (unique) installed services. Optionally filter by crypto-currency. """ from moneywagon.crypto_data import crypto_data if not crypto: # no currency specified, get ...
def function[_get_all_services, parameter[crypto, just_exchange]]: constant[ Go through the crypto_data structure and return all list of all (unique) installed services. Optionally filter by crypto-currency. ] from relative_module[moneywagon.crypto_data] import module[crypto_data] if <as...
keyword[def] identifier[_get_all_services] ( identifier[crypto] = keyword[None] , identifier[just_exchange] = keyword[False] ): literal[string] keyword[from] identifier[moneywagon] . identifier[crypto_data] keyword[import] identifier[crypto_data] keyword[if] keyword[not] identifier[crypto] : ...
def _get_all_services(crypto=None, just_exchange=False): """ Go through the crypto_data structure and return all list of all (unique) installed services. Optionally filter by crypto-currency. """ from moneywagon.crypto_data import crypto_data if not crypto: # no currency specified, get a...
def _strip_commas(cls, kw): "Strip out any leading/training commas from the token" kw = kw[:-1] if kw[-1]==',' else kw return kw[1:] if kw[0]==',' else kw
def function[_strip_commas, parameter[cls, kw]]: constant[Strip out any leading/training commas from the token] variable[kw] assign[=] <ast.IfExp object at 0x7da20e9612a0> return[<ast.IfExp object at 0x7da20e9618a0>]
keyword[def] identifier[_strip_commas] ( identifier[cls] , identifier[kw] ): literal[string] identifier[kw] = identifier[kw] [:- literal[int] ] keyword[if] identifier[kw] [- literal[int] ]== literal[string] keyword[else] identifier[kw] keyword[return] identifier[kw] [ literal[int] :] ...
def _strip_commas(cls, kw): """Strip out any leading/training commas from the token""" kw = kw[:-1] if kw[-1] == ',' else kw return kw[1:] if kw[0] == ',' else kw
def list_nics(access_token, subscription_id): '''List the network interfaces in a subscription. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. Returns: HTTP response. JSON body of NICs list with properties. ''' en...
def function[list_nics, parameter[access_token, subscription_id]]: constant[List the network interfaces in a subscription. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. Returns: HTTP response. JSON body of NICs list ...
keyword[def] identifier[list_nics] ( identifier[access_token] , identifier[subscription_id] ): literal[string] identifier[endpoint] = literal[string] . identifier[join] ([ identifier[get_rm_endpoint] (), literal[string] , identifier[subscription_id] , literal[string] , literal[string] , iden...
def list_nics(access_token, subscription_id): """List the network interfaces in a subscription. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. Returns: HTTP response. JSON body of NICs list with properties. """ en...
def construct(self, method, name, lowcut, highcut, samp_rate, filt_order, prepick, **kwargs): """ Construct a template using a given method. :param method: Method to make the template, see :mod:`eqcorrscan.core.template_gen` for possible methods. ...
def function[construct, parameter[self, method, name, lowcut, highcut, samp_rate, filt_order, prepick]]: constant[ Construct a template using a given method. :param method: Method to make the template, see :mod:`eqcorrscan.core.template_gen` for possible methods. ...
keyword[def] identifier[construct] ( identifier[self] , identifier[method] , identifier[name] , identifier[lowcut] , identifier[highcut] , identifier[samp_rate] , identifier[filt_order] , identifier[prepick] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[method] keyword[in] [ l...
def construct(self, method, name, lowcut, highcut, samp_rate, filt_order, prepick, **kwargs): """ Construct a template using a given method. :param method: Method to make the template, see :mod:`eqcorrscan.core.template_gen` for possible methods. :type method: str ...
def _merge_simple_selectors(a, b): """Merge two simple selectors, for the purposes of the LCS algorithm below. In practice this returns the more specific selector if one is a subset of the other, else it returns None. """ # TODO what about combinators if a.is_superset_of(b): return b ...
def function[_merge_simple_selectors, parameter[a, b]]: constant[Merge two simple selectors, for the purposes of the LCS algorithm below. In practice this returns the more specific selector if one is a subset of the other, else it returns None. ] if call[name[a].is_superset_of, parameter[na...
keyword[def] identifier[_merge_simple_selectors] ( identifier[a] , identifier[b] ): literal[string] keyword[if] identifier[a] . identifier[is_superset_of] ( identifier[b] ): keyword[return] identifier[b] keyword[elif] identifier[b] . identifier[is_superset_of] ( identifier[a] ): ...
def _merge_simple_selectors(a, b): """Merge two simple selectors, for the purposes of the LCS algorithm below. In practice this returns the more specific selector if one is a subset of the other, else it returns None. """ # TODO what about combinators if a.is_superset_of(b): return b #...
def _xfs_info_get_kv(serialized): ''' Parse one line of the XFS info output. ''' # No need to know sub-elements here if serialized.startswith("="): serialized = serialized[1:].strip() serialized = serialized.replace(" = ", "=*** ").replace(" =", "=") # Keywords has no spaces, value...
def function[_xfs_info_get_kv, parameter[serialized]]: constant[ Parse one line of the XFS info output. ] if call[name[serialized].startswith, parameter[constant[=]]] begin[:] variable[serialized] assign[=] call[call[name[serialized]][<ast.Slice object at 0x7da207f007c0>].strip, ...
keyword[def] identifier[_xfs_info_get_kv] ( identifier[serialized] ): literal[string] keyword[if] identifier[serialized] . identifier[startswith] ( literal[string] ): identifier[serialized] = identifier[serialized] [ literal[int] :]. identifier[strip] () identifier[serialized] = identi...
def _xfs_info_get_kv(serialized): """ Parse one line of the XFS info output. """ # No need to know sub-elements here if serialized.startswith('='): serialized = serialized[1:].strip() # depends on [control=['if'], data=[]] serialized = serialized.replace(' = ', '=*** ').replace(' =', '=...
def _fire_ret_load_specific_fun(self, load, fun_index=0): ''' Helper function for fire_ret_load ''' if isinstance(load['fun'], list): # Multi-function job fun = load['fun'][fun_index] # 'retcode' was already validated to exist and be non-zero ...
def function[_fire_ret_load_specific_fun, parameter[self, load, fun_index]]: constant[ Helper function for fire_ret_load ] if call[name[isinstance], parameter[call[name[load]][constant[fun]], name[list]]] begin[:] variable[fun] assign[=] call[call[name[load]][constant[fun...
keyword[def] identifier[_fire_ret_load_specific_fun] ( identifier[self] , identifier[load] , identifier[fun_index] = literal[int] ): literal[string] keyword[if] identifier[isinstance] ( identifier[load] [ literal[string] ], identifier[list] ): identifier[fun] = identifier[loa...
def _fire_ret_load_specific_fun(self, load, fun_index=0): """ Helper function for fire_ret_load """ if isinstance(load['fun'], list): # Multi-function job fun = load['fun'][fun_index] # 'retcode' was already validated to exist and be non-zero # for the given funct...
def get_context(self, name, value, attrs): """ Some widgets require a modified rendering context, if they contain angular directives. """ context = super(NgWidgetMixin, self).get_context(name, value, attrs) if callable(getattr(self._field, 'update_widget_rendering_context', None)...
def function[get_context, parameter[self, name, value, attrs]]: constant[ Some widgets require a modified rendering context, if they contain angular directives. ] variable[context] assign[=] call[call[name[super], parameter[name[NgWidgetMixin], name[self]]].get_context, parameter[name[na...
keyword[def] identifier[get_context] ( identifier[self] , identifier[name] , identifier[value] , identifier[attrs] ): literal[string] identifier[context] = identifier[super] ( identifier[NgWidgetMixin] , identifier[self] ). identifier[get_context] ( identifier[name] , identifier[value] , identifier...
def get_context(self, name, value, attrs): """ Some widgets require a modified rendering context, if they contain angular directives. """ context = super(NgWidgetMixin, self).get_context(name, value, attrs) if callable(getattr(self._field, 'update_widget_rendering_context', None)): s...
def get_event_data(event_abi, log_entry): """ Given an event ABI and a log entry for that event, return the decoded event data """ if event_abi['anonymous']: log_topics = log_entry['topics'] elif not log_entry['topics']: raise MismatchedABI("Expected non-anonymous event to have 1...
def function[get_event_data, parameter[event_abi, log_entry]]: constant[ Given an event ABI and a log entry for that event, return the decoded event data ] if call[name[event_abi]][constant[anonymous]] begin[:] variable[log_topics] assign[=] call[name[log_entry]][constant[top...
keyword[def] identifier[get_event_data] ( identifier[event_abi] , identifier[log_entry] ): literal[string] keyword[if] identifier[event_abi] [ literal[string] ]: identifier[log_topics] = identifier[log_entry] [ literal[string] ] keyword[elif] keyword[not] identifier[log_entry] [ literal[st...
def get_event_data(event_abi, log_entry): """ Given an event ABI and a log entry for that event, return the decoded event data """ if event_abi['anonymous']: log_topics = log_entry['topics'] # depends on [control=['if'], data=[]] elif not log_entry['topics']: raise MismatchedABI...
def PartialDynamicSystem(self, ieq, variable): """ returns dynamical system blocks associated to output variable """ if ieq == 0: # U1=0 if variable == self.physical_nodes[0].variable: v = Step('Ground', 0) return[Gain(v, variable, ...
def function[PartialDynamicSystem, parameter[self, ieq, variable]]: constant[ returns dynamical system blocks associated to output variable ] if compare[name[ieq] equal[==] constant[0]] begin[:] if compare[name[variable] equal[==] call[name[self].physical_nodes][constant[...
keyword[def] identifier[PartialDynamicSystem] ( identifier[self] , identifier[ieq] , identifier[variable] ): literal[string] keyword[if] identifier[ieq] == literal[int] : keyword[if] identifier[variable] == identifier[self] . identifier[physical_nodes] [ literal[int] ]. iden...
def PartialDynamicSystem(self, ieq, variable): """ returns dynamical system blocks associated to output variable """ if ieq == 0: # U1=0 if variable == self.physical_nodes[0].variable: v = Step('Ground', 0) return [Gain(v, variable, 1)] # depends on [cont...
def peek(self, size=-1): """ Return bytes from the stream without advancing the position. Args: size (int): Number of bytes to read. -1 to read the full stream. Returns: bytes: bytes read """ if not self._readable: rai...
def function[peek, parameter[self, size]]: constant[ Return bytes from the stream without advancing the position. Args: size (int): Number of bytes to read. -1 to read the full stream. Returns: bytes: bytes read ] if <ast.UnaryOp ...
keyword[def] identifier[peek] ( identifier[self] , identifier[size] =- literal[int] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_readable] : keyword[raise] identifier[UnsupportedOperation] ( literal[string] ) keyword[with] identifier[self] . ...
def peek(self, size=-1): """ Return bytes from the stream without advancing the position. Args: size (int): Number of bytes to read. -1 to read the full stream. Returns: bytes: bytes read """ if not self._readable: raise Unsupport...
def _create_delete_one_query(self, row_id, ctx): """ Delete row by id query creation. :param int row_id: Identifier of the deleted row. :param ResourceQueryContext ctx: The context of this delete query. """ assert isinstance(ctx, ResourceQueryContext) return sel...
def function[_create_delete_one_query, parameter[self, row_id, ctx]]: constant[ Delete row by id query creation. :param int row_id: Identifier of the deleted row. :param ResourceQueryContext ctx: The context of this delete query. ] assert[call[name[isinstance], parameter[nam...
keyword[def] identifier[_create_delete_one_query] ( identifier[self] , identifier[row_id] , identifier[ctx] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[ctx] , identifier[ResourceQueryContext] ) keyword[return] identifier[self] . identifier[_orm] . identifier[q...
def _create_delete_one_query(self, row_id, ctx): """ Delete row by id query creation. :param int row_id: Identifier of the deleted row. :param ResourceQueryContext ctx: The context of this delete query. """ assert isinstance(ctx, ResourceQueryContext) return self._orm.query(...
def size_as_drawn(lines, screen_width): """Get the bottom-right corner of some text as would be drawn by draw_lines""" y = 0 x = 0 for line in lines: wrapped = list(wc_wrap(line, screen_width)) if len(wrapped) > 0: for wrapped_line in wrapped: x = len(wrapped_...
def function[size_as_drawn, parameter[lines, screen_width]]: constant[Get the bottom-right corner of some text as would be drawn by draw_lines] variable[y] assign[=] constant[0] variable[x] assign[=] constant[0] for taget[name[line]] in starred[name[lines]] begin[:] varia...
keyword[def] identifier[size_as_drawn] ( identifier[lines] , identifier[screen_width] ): literal[string] identifier[y] = literal[int] identifier[x] = literal[int] keyword[for] identifier[line] keyword[in] identifier[lines] : identifier[wrapped] = identifier[list] ( identifier[wc_wra...
def size_as_drawn(lines, screen_width): """Get the bottom-right corner of some text as would be drawn by draw_lines""" y = 0 x = 0 for line in lines: wrapped = list(wc_wrap(line, screen_width)) if len(wrapped) > 0: for wrapped_line in wrapped: x = len(wrapped_...
def toxml(self): """ Exports this object into a LEMS XML object """ xmlstr = '<OnCondition test="{0}"'.format(self.test) chxmlstr = '' for action in self.actions: chxmlstr += action.toxml() if chxmlstr: xmlstr += '>' + chxmlstr + '</OnC...
def function[toxml, parameter[self]]: constant[ Exports this object into a LEMS XML object ] variable[xmlstr] assign[=] call[constant[<OnCondition test="{0}"].format, parameter[name[self].test]] variable[chxmlstr] assign[=] constant[] for taget[name[action]] in starred[na...
keyword[def] identifier[toxml] ( identifier[self] ): literal[string] identifier[xmlstr] = literal[string] . identifier[format] ( identifier[self] . identifier[test] ) identifier[chxmlstr] = literal[string] keyword[for] identifier[action] keyword[in] identifier[self] . ident...
def toxml(self): """ Exports this object into a LEMS XML object """ xmlstr = '<OnCondition test="{0}"'.format(self.test) chxmlstr = '' for action in self.actions: chxmlstr += action.toxml() # depends on [control=['for'], data=['action']] if chxmlstr: xmlstr += '>' + ...
def teardown_global_logging(): """Disable global logging of stdio, warnings, and exceptions.""" global global_logging_started if not global_logging_started: return stdout_logger = logging.getLogger(__name__ + '.stdout') stderr_logger = logging.getLogger(__name__ + '.stderr') if sys.std...
def function[teardown_global_logging, parameter[]]: constant[Disable global logging of stdio, warnings, and exceptions.] <ast.Global object at 0x7da1b0ff3070> if <ast.UnaryOp object at 0x7da1b0ff2fe0> begin[:] return[None] variable[stdout_logger] assign[=] call[name[logging].getLogge...
keyword[def] identifier[teardown_global_logging] (): literal[string] keyword[global] identifier[global_logging_started] keyword[if] keyword[not] identifier[global_logging_started] : keyword[return] identifier[stdout_logger] = identifier[logging] . identifier[getLogger] ( identifie...
def teardown_global_logging(): """Disable global logging of stdio, warnings, and exceptions.""" global global_logging_started if not global_logging_started: return # depends on [control=['if'], data=[]] stdout_logger = logging.getLogger(__name__ + '.stdout') stderr_logger = logging.getLogge...
def get_command(all_pkg, hook): """ Collect the command-line interface names by querying ``hook`` in ``all_pkg`` Parameters ---------- all_pkg: list list of package files hook: str A variable where the command is stored. ``__cli__`` by default. Returns ------- list ...
def function[get_command, parameter[all_pkg, hook]]: constant[ Collect the command-line interface names by querying ``hook`` in ``all_pkg`` Parameters ---------- all_pkg: list list of package files hook: str A variable where the command is stored. ``__cli__`` by default. ...
keyword[def] identifier[get_command] ( identifier[all_pkg] , identifier[hook] ): literal[string] identifier[ret] =[] keyword[for] identifier[r] keyword[in] identifier[all_pkg] : identifier[module] = identifier[importlib] . identifier[import_module] ( identifier[__name__] + literal[string] ...
def get_command(all_pkg, hook): """ Collect the command-line interface names by querying ``hook`` in ``all_pkg`` Parameters ---------- all_pkg: list list of package files hook: str A variable where the command is stored. ``__cli__`` by default. Returns ------- list ...
def tokenize_documents(docs): """Convert the imported documents to :py:class:'~estnltk.text.Text' instances.""" sep = '\n\n' texts = [] for doc in docs: text = '\n\n'.join(['\n'.join(para[SENTENCES]) for para in doc[PARAGRAPHS]]) doc[TEXT] = text del doc[PARAGRAPHS] texts...
def function[tokenize_documents, parameter[docs]]: constant[Convert the imported documents to :py:class:'~estnltk.text.Text' instances.] variable[sep] assign[=] constant[ ] variable[texts] assign[=] list[[]] for taget[name[doc]] in starred[name[docs]] begin[:] variable[t...
keyword[def] identifier[tokenize_documents] ( identifier[docs] ): literal[string] identifier[sep] = literal[string] identifier[texts] =[] keyword[for] identifier[doc] keyword[in] identifier[docs] : identifier[text] = literal[string] . identifier[join] ([ literal[string] . identifier[...
def tokenize_documents(docs): """Convert the imported documents to :py:class:'~estnltk.text.Text' instances.""" sep = '\n\n' texts = [] for doc in docs: text = '\n\n'.join(['\n'.join(para[SENTENCES]) for para in doc[PARAGRAPHS]]) doc[TEXT] = text del doc[PARAGRAPHS] texts...
def _fill_col_borders(self): """Add the first and last column to the data by extrapolation. """ first = True last = True if self.col_indices[0] == self.hcol_indices[0]: first = False if self.col_indices[-1] == self.hcol_indices[-1]: last = False ...
def function[_fill_col_borders, parameter[self]]: constant[Add the first and last column to the data by extrapolation. ] variable[first] assign[=] constant[True] variable[last] assign[=] constant[True] if compare[call[name[self].col_indices][constant[0]] equal[==] call[name[self]...
keyword[def] identifier[_fill_col_borders] ( identifier[self] ): literal[string] identifier[first] = keyword[True] identifier[last] = keyword[True] keyword[if] identifier[self] . identifier[col_indices] [ literal[int] ]== identifier[self] . identifier[hcol_indices] [ literal[i...
def _fill_col_borders(self): """Add the first and last column to the data by extrapolation. """ first = True last = True if self.col_indices[0] == self.hcol_indices[0]: first = False # depends on [control=['if'], data=[]] if self.col_indices[-1] == self.hcol_indices[-1]: las...
def pypirc_temp(index_url): """ Create a temporary pypirc file for interaction with twine """ pypirc_file = tempfile.NamedTemporaryFile(suffix='.pypirc', delete=False) print(pypirc_file.name) with open(pypirc_file.name, 'w') as fh: fh.write(PYPIRC_TEMPLATE.format(index_name=PYPIRC_TEMP_INDEX_NAM...
def function[pypirc_temp, parameter[index_url]]: constant[ Create a temporary pypirc file for interaction with twine ] variable[pypirc_file] assign[=] call[name[tempfile].NamedTemporaryFile, parameter[]] call[name[print], parameter[name[pypirc_file].name]] with call[name[open], parameter...
keyword[def] identifier[pypirc_temp] ( identifier[index_url] ): literal[string] identifier[pypirc_file] = identifier[tempfile] . identifier[NamedTemporaryFile] ( identifier[suffix] = literal[string] , identifier[delete] = keyword[False] ) identifier[print] ( identifier[pypirc_file] . identifier[name] ...
def pypirc_temp(index_url): """ Create a temporary pypirc file for interaction with twine """ pypirc_file = tempfile.NamedTemporaryFile(suffix='.pypirc', delete=False) print(pypirc_file.name) with open(pypirc_file.name, 'w') as fh: fh.write(PYPIRC_TEMPLATE.format(index_name=PYPIRC_TEMP_INDEX_NAM...
def progress(status_code): """Translate PROGRESS status codes from GnuPG to messages.""" lookup = { 'pk_dsa': 'DSA key generation', 'pk_elg': 'Elgamal key generation', 'primegen': 'Prime generation', 'need_entropy': 'Waiting for new entropy in the RNG', 'tick': 'Generic t...
def function[progress, parameter[status_code]]: constant[Translate PROGRESS status codes from GnuPG to messages.] variable[lookup] assign[=] dictionary[[<ast.Constant object at 0x7da20c6aae60>, <ast.Constant object at 0x7da20c6ab7c0>, <ast.Constant object at 0x7da20c6a8220>, <ast.Constant object at 0x7d...
keyword[def] identifier[progress] ( identifier[status_code] ): literal[string] identifier[lookup] ={ literal[string] : literal[string] , literal[string] : literal[string] , literal[string] : literal[string] , literal[string] : literal[string] , literal[string] : literal[string] , ...
def progress(status_code): """Translate PROGRESS status codes from GnuPG to messages.""" lookup = {'pk_dsa': 'DSA key generation', 'pk_elg': 'Elgamal key generation', 'primegen': 'Prime generation', 'need_entropy': 'Waiting for new entropy in the RNG', 'tick': 'Generic tick without any special meaning - still w...
def real(self, nested_scope=None): """Return the correspond floating point number.""" operation = self.children[0].operation() expr = self.children[1].real(nested_scope) return operation(expr)
def function[real, parameter[self, nested_scope]]: constant[Return the correspond floating point number.] variable[operation] assign[=] call[call[name[self].children][constant[0]].operation, parameter[]] variable[expr] assign[=] call[call[name[self].children][constant[1]].real, parameter[name[ne...
keyword[def] identifier[real] ( identifier[self] , identifier[nested_scope] = keyword[None] ): literal[string] identifier[operation] = identifier[self] . identifier[children] [ literal[int] ]. identifier[operation] () identifier[expr] = identifier[self] . identifier[children] [ literal[int...
def real(self, nested_scope=None): """Return the correspond floating point number.""" operation = self.children[0].operation() expr = self.children[1].real(nested_scope) return operation(expr)
def functions_to_table(mod, colwidth=[27, 48]): r""" Given a module of functions, returns a ReST formatted text string that outputs a table when printed. Parameters ---------- mod : module The module containing the functions to be included in the table, such as 'porespy.filters'...
def function[functions_to_table, parameter[mod, colwidth]]: constant[ Given a module of functions, returns a ReST formatted text string that outputs a table when printed. Parameters ---------- mod : module The module containing the functions to be included in the table, such ...
keyword[def] identifier[functions_to_table] ( identifier[mod] , identifier[colwidth] =[ literal[int] , literal[int] ]): literal[string] identifier[temp] = identifier[mod] . identifier[__dir__] () identifier[funcs] =[ identifier[i] keyword[for] identifier[i] keyword[in] identifier[temp] keyword[if...
def functions_to_table(mod, colwidth=[27, 48]): """ Given a module of functions, returns a ReST formatted text string that outputs a table when printed. Parameters ---------- mod : module The module containing the functions to be included in the table, such as 'porespy.filters'....
def resample(self,N): """Returns a bootstrap resampling of provided samples. Parameters ---------- N : int Number of samples. """ inds = rand.randint(len(self.samples),size=N) return self.samples[inds]
def function[resample, parameter[self, N]]: constant[Returns a bootstrap resampling of provided samples. Parameters ---------- N : int Number of samples. ] variable[inds] assign[=] call[name[rand].randint, parameter[call[name[len], parameter[name[self].sample...
keyword[def] identifier[resample] ( identifier[self] , identifier[N] ): literal[string] identifier[inds] = identifier[rand] . identifier[randint] ( identifier[len] ( identifier[self] . identifier[samples] ), identifier[size] = identifier[N] ) keyword[return] identifier[self] . identifier[...
def resample(self, N): """Returns a bootstrap resampling of provided samples. Parameters ---------- N : int Number of samples. """ inds = rand.randint(len(self.samples), size=N) return self.samples[inds]
def get_embedded_object(self, signature_id): ''' Retrieves a embedded signing object Retrieves an embedded object containing a signature url that can be opened in an iFrame. Args: signature_id (str): The id of the signature to get a signature url for Returns: ...
def function[get_embedded_object, parameter[self, signature_id]]: constant[ Retrieves a embedded signing object Retrieves an embedded object containing a signature url that can be opened in an iFrame. Args: signature_id (str): The id of the signature to get a signature url for ...
keyword[def] identifier[get_embedded_object] ( identifier[self] , identifier[signature_id] ): literal[string] identifier[request] = identifier[self] . identifier[_get_request] () keyword[return] identifier[request] . identifier[get] ( identifier[self] . identifier[EMBEDDED_OBJECT_GET_URL]...
def get_embedded_object(self, signature_id): """ Retrieves a embedded signing object Retrieves an embedded object containing a signature url that can be opened in an iFrame. Args: signature_id (str): The id of the signature to get a signature url for Returns: An E...
def _get_rename_function(mapper): """ Returns a function that will map names/labels, dependent if mapper is a dict, Series or just a function. """ if isinstance(mapper, (abc.Mapping, ABCSeries)): def f(x): if x in mapper: return mapper[x] else: ...
def function[_get_rename_function, parameter[mapper]]: constant[ Returns a function that will map names/labels, dependent if mapper is a dict, Series or just a function. ] if call[name[isinstance], parameter[name[mapper], tuple[[<ast.Attribute object at 0x7da18dc99390>, <ast.Name object at 0...
keyword[def] identifier[_get_rename_function] ( identifier[mapper] ): literal[string] keyword[if] identifier[isinstance] ( identifier[mapper] ,( identifier[abc] . identifier[Mapping] , identifier[ABCSeries] )): keyword[def] identifier[f] ( identifier[x] ): keyword[if] identifier[x...
def _get_rename_function(mapper): """ Returns a function that will map names/labels, dependent if mapper is a dict, Series or just a function. """ if isinstance(mapper, (abc.Mapping, ABCSeries)): def f(x): if x in mapper: return mapper[x] # depends on [control=[...
def _compute_acq_withGradients(self, x): """ Integrated Expected Improvement and its derivative """ means, stds, dmdxs, dsdxs = self.model.predict_withGradients(x) fmins = self.model.get_fmin() f_acqu = None df_acqu = None for m, s, fmin, dmdx, dsdx in zip...
def function[_compute_acq_withGradients, parameter[self, x]]: constant[ Integrated Expected Improvement and its derivative ] <ast.Tuple object at 0x7da1b2346830> assign[=] call[name[self].model.predict_withGradients, parameter[name[x]]] variable[fmins] assign[=] call[name[self].m...
keyword[def] identifier[_compute_acq_withGradients] ( identifier[self] , identifier[x] ): literal[string] identifier[means] , identifier[stds] , identifier[dmdxs] , identifier[dsdxs] = identifier[self] . identifier[model] . identifier[predict_withGradients] ( identifier[x] ) identifier[fmi...
def _compute_acq_withGradients(self, x): """ Integrated Expected Improvement and its derivative """ (means, stds, dmdxs, dsdxs) = self.model.predict_withGradients(x) fmins = self.model.get_fmin() f_acqu = None df_acqu = None for (m, s, fmin, dmdx, dsdx) in zip(means, stds, fmins,...
def make_gdf_graph(filename, stop=True): """Create a graph in simple GDF format, suitable for feeding into Gephi, or some other graph manipulation and display tool. Setting stop to True will stop the current trace. """ if stop: stop_trace() try: f = open(filename, 'w') f...
def function[make_gdf_graph, parameter[filename, stop]]: constant[Create a graph in simple GDF format, suitable for feeding into Gephi, or some other graph manipulation and display tool. Setting stop to True will stop the current trace. ] if name[stop] begin[:] call[name[stop...
keyword[def] identifier[make_gdf_graph] ( identifier[filename] , identifier[stop] = keyword[True] ): literal[string] keyword[if] identifier[stop] : identifier[stop_trace] () keyword[try] : identifier[f] = identifier[open] ( identifier[filename] , literal[string] ) identifi...
def make_gdf_graph(filename, stop=True): """Create a graph in simple GDF format, suitable for feeding into Gephi, or some other graph manipulation and display tool. Setting stop to True will stop the current trace. """ if stop: stop_trace() # depends on [control=['if'], data=[]] try: ...
def update(self, default_activity_sid=values.unset, event_callback_url=values.unset, events_filter=values.unset, friendly_name=values.unset, multi_task_enabled=values.unset, timeout_activity_sid=values.unset, prioritize_queue_order=values.unset): """ ...
def function[update, parameter[self, default_activity_sid, event_callback_url, events_filter, friendly_name, multi_task_enabled, timeout_activity_sid, prioritize_queue_order]]: constant[ Update the WorkspaceInstance :param unicode default_activity_sid: The ID of the Activity that will be used w...
keyword[def] identifier[update] ( identifier[self] , identifier[default_activity_sid] = identifier[values] . identifier[unset] , identifier[event_callback_url] = identifier[values] . identifier[unset] , identifier[events_filter] = identifier[values] . identifier[unset] , identifier[friendly_name] = identifier[value...
def update(self, default_activity_sid=values.unset, event_callback_url=values.unset, events_filter=values.unset, friendly_name=values.unset, multi_task_enabled=values.unset, timeout_activity_sid=values.unset, prioritize_queue_order=values.unset): """ Update the WorkspaceInstance :param unicode defa...
def cover_update(self, album, photo, **kwds): """ Endpoint: /album/<album_id>/cover/<photo_id>/update.json Update the cover photo of an album. Returns the updated album object. """ result = self._client.post("/album/%s/cover/%s/update.json" % ...
def function[cover_update, parameter[self, album, photo]]: constant[ Endpoint: /album/<album_id>/cover/<photo_id>/update.json Update the cover photo of an album. Returns the updated album object. ] variable[result] assign[=] call[call[name[self]._client.post, parameter[b...
keyword[def] identifier[cover_update] ( identifier[self] , identifier[album] , identifier[photo] ,** identifier[kwds] ): literal[string] identifier[result] = identifier[self] . identifier[_client] . identifier[post] ( literal[string] % ( identifier[self] . identifier[_extract_id] ( identifi...
def cover_update(self, album, photo, **kwds): """ Endpoint: /album/<album_id>/cover/<photo_id>/update.json Update the cover photo of an album. Returns the updated album object. """ result = self._client.post('/album/%s/cover/%s/update.json' % (self._extract_id(album), self._extr...
def enable(self, synchronous=True, **kwargs): """Enables the RedHat Repository RedHat Repos needs to be enabled first, so that we can sync it. :param synchronous: What should happen if the server returns an HTTP 202 (accepted) status code? Wait for the task to complete if ...
def function[enable, parameter[self, synchronous]]: constant[Enables the RedHat Repository RedHat Repos needs to be enabled first, so that we can sync it. :param synchronous: What should happen if the server returns an HTTP 202 (accepted) status code? Wait for the task to complete ...
keyword[def] identifier[enable] ( identifier[self] , identifier[synchronous] = keyword[True] ,** identifier[kwargs] ): literal[string] keyword[if] literal[string] keyword[not] keyword[in] identifier[kwargs] : identifier[kwargs] [ literal[string] ]= identifier[dict] () ...
def enable(self, synchronous=True, **kwargs): """Enables the RedHat Repository RedHat Repos needs to be enabled first, so that we can sync it. :param synchronous: What should happen if the server returns an HTTP 202 (accepted) status code? Wait for the task to complete if `...
def to_idf(self, buffer_or_path=None, dump_external_files=True): """ Parameters ---------- buffer_or_path: buffer or path, default None output to write into. If None, will return a json string. dump_external_files: boolean, default True if True, external f...
def function[to_idf, parameter[self, buffer_or_path, dump_external_files]]: constant[ Parameters ---------- buffer_or_path: buffer or path, default None output to write into. If None, will return a json string. dump_external_files: boolean, default True if...
keyword[def] identifier[to_idf] ( identifier[self] , identifier[buffer_or_path] = keyword[None] , identifier[dump_external_files] = keyword[True] ): literal[string] identifier[comment] = identifier[get_multi_line_copyright_message] () keyword[if] identifier[self] . identifier[_co...
def to_idf(self, buffer_or_path=None, dump_external_files=True): """ Parameters ---------- buffer_or_path: buffer or path, default None output to write into. If None, will return a json string. dump_external_files: boolean, default True if True, external files...
def delete_idx_status(self, rdf_class): """ Removes all of the index status triples from the datastore Args: ----- rdf_class: The class of items to remove the status from """ sparql_template = """ DELETE {{ ?s kds:esIn...
def function[delete_idx_status, parameter[self, rdf_class]]: constant[ Removes all of the index status triples from the datastore Args: ----- rdf_class: The class of items to remove the status from ] variable[sparql_template] assign[=] constant[ D...
keyword[def] identifier[delete_idx_status] ( identifier[self] , identifier[rdf_class] ): literal[string] identifier[sparql_template] = literal[string] identifier[rdf_types] =[ identifier[rdf_class] . identifier[uri] ]+[ identifier[item] . identifier[uri] keyword[for] identifie...
def delete_idx_status(self, rdf_class): """ Removes all of the index status triples from the datastore Args: ----- rdf_class: The class of items to remove the status from """ sparql_template = '\n DELETE\n {{\n ?s kds:esIndexTime ...
def reboot(name, provision=False): ''' Reboot a VM. (vagrant reload) CLI Example: .. code-block:: bash salt <host> vagrant.reboot <salt_id> provision=True :param name: The salt_id name you will use to control this VM :param provision: (False) also re-run the Vagrant provisioning scri...
def function[reboot, parameter[name, provision]]: constant[ Reboot a VM. (vagrant reload) CLI Example: .. code-block:: bash salt <host> vagrant.reboot <salt_id> provision=True :param name: The salt_id name you will use to control this VM :param provision: (False) also re-run the ...
keyword[def] identifier[reboot] ( identifier[name] , identifier[provision] = keyword[False] ): literal[string] identifier[vm_] = identifier[get_vm_info] ( identifier[name] ) identifier[machine] = identifier[vm_] [ literal[string] ] identifier[prov] = literal[string] keyword[if] identifier[provi...
def reboot(name, provision=False): """ Reboot a VM. (vagrant reload) CLI Example: .. code-block:: bash salt <host> vagrant.reboot <salt_id> provision=True :param name: The salt_id name you will use to control this VM :param provision: (False) also re-run the Vagrant provisioning scri...
def isoformat(self, sep='T'): """Return the time formatted according to ISO. This is 'YYYY-MM-DD HH:MM:SS.mmmmmm', or 'YYYY-MM-DD HH:MM:SS' if self.microsecond == 0. If self.tzinfo is not None, the UTC offset is also attached, giving 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM' or 'YYYY-...
def function[isoformat, parameter[self, sep]]: constant[Return the time formatted according to ISO. This is 'YYYY-MM-DD HH:MM:SS.mmmmmm', or 'YYYY-MM-DD HH:MM:SS' if self.microsecond == 0. If self.tzinfo is not None, the UTC offset is also attached, giving 'YYYY-MM-DD HH:MM:SS....
keyword[def] identifier[isoformat] ( identifier[self] , identifier[sep] = literal[string] ): literal[string] identifier[s] =( literal[string] %( identifier[self] . identifier[_year] , identifier[self] . identifier[_month] , identifier[self] . identifier[_day] , identifier[sep] )+ ...
def isoformat(self, sep='T'): """Return the time formatted according to ISO. This is 'YYYY-MM-DD HH:MM:SS.mmmmmm', or 'YYYY-MM-DD HH:MM:SS' if self.microsecond == 0. If self.tzinfo is not None, the UTC offset is also attached, giving 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM' or 'YYYY-MM-D...
def array(self): """ return the underlying numpy array """ return np.logspace(self.start, self.stop, self.num, self.endpoint, self.base)
def function[array, parameter[self]]: constant[ return the underlying numpy array ] return[call[name[np].logspace, parameter[name[self].start, name[self].stop, name[self].num, name[self].endpoint, name[self].base]]]
keyword[def] identifier[array] ( identifier[self] ): literal[string] keyword[return] identifier[np] . identifier[logspace] ( identifier[self] . identifier[start] , identifier[self] . identifier[stop] , identifier[self] . identifier[num] , identifier[self] . identifier[endpoint] , identifier[self] ...
def array(self): """ return the underlying numpy array """ return np.logspace(self.start, self.stop, self.num, self.endpoint, self.base)
def configure(self, mount_point, mfa_type='duo', force=False): """Configure MFA for a supported method. This endpoint allows you to turn on multi-factor authentication with a given backend. Currently only Duo is supported. Supported methods: POST: /auth/{mount_point}/mfa_co...
def function[configure, parameter[self, mount_point, mfa_type, force]]: constant[Configure MFA for a supported method. This endpoint allows you to turn on multi-factor authentication with a given backend. Currently only Duo is supported. Supported methods: POST: /auth/{moun...
keyword[def] identifier[configure] ( identifier[self] , identifier[mount_point] , identifier[mfa_type] = literal[string] , identifier[force] = keyword[False] ): literal[string] keyword[if] identifier[mfa_type] != literal[string] keyword[and] keyword[not] identifier[force] : ...
def configure(self, mount_point, mfa_type='duo', force=False): """Configure MFA for a supported method. This endpoint allows you to turn on multi-factor authentication with a given backend. Currently only Duo is supported. Supported methods: POST: /auth/{mount_point}/mfa_config...
def explain_template_loading_attempts(app, template, attempts): """ This should help developers understand what failed. Mostly the same as :func:`flask.debughelpers.explain_template_loading_attempts`, except here we've extended it to support showing what :class:`UnchainedJinjaLoader` is doing. """ ...
def function[explain_template_loading_attempts, parameter[app, template, attempts]]: constant[ This should help developers understand what failed. Mostly the same as :func:`flask.debughelpers.explain_template_loading_attempts`, except here we've extended it to support showing what :class:`UnchainedJ...
keyword[def] identifier[explain_template_loading_attempts] ( identifier[app] , identifier[template] , identifier[attempts] ): literal[string] keyword[from] identifier[flask] keyword[import] identifier[Flask] , identifier[Blueprint] keyword[from] identifier[flask] . identifier[debughelpers] keywo...
def explain_template_loading_attempts(app, template, attempts): """ This should help developers understand what failed. Mostly the same as :func:`flask.debughelpers.explain_template_loading_attempts`, except here we've extended it to support showing what :class:`UnchainedJinjaLoader` is doing. """ ...
def serialize(self, include_class=True, save_dynamic=False, **kwargs): """Serializes a **HasProperties** instance to dictionary This uses the Property serializers to serialize all Property values to a JSON-compatible dictionary. Properties that are undefined are not included. If the **H...
def function[serialize, parameter[self, include_class, save_dynamic]]: constant[Serializes a **HasProperties** instance to dictionary This uses the Property serializers to serialize all Property values to a JSON-compatible dictionary. Properties that are undefined are not included. If t...
keyword[def] identifier[serialize] ( identifier[self] , identifier[include_class] = keyword[True] , identifier[save_dynamic] = keyword[False] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[getattr] ( identifier[self] , literal[string] , keyword[False] ): keyword[rais...
def serialize(self, include_class=True, save_dynamic=False, **kwargs): """Serializes a **HasProperties** instance to dictionary This uses the Property serializers to serialize all Property values to a JSON-compatible dictionary. Properties that are undefined are not included. If the **HasPr...
def plot_trajectory_projection(self, x_axis, y_axis, *args, **kwargs): """ Plots trajectory projection on the specified x and y axes See :meth:`InferenceResult.plot_trajectory_projection()` for information on the arguments and keyword arguments :param ...
def function[plot_trajectory_projection, parameter[self, x_axis, y_axis]]: constant[ Plots trajectory projection on the specified x and y axes See :meth:`InferenceResult.plot_trajectory_projection()` for information on the arguments and keyword arguments :param x_axis: variable to be pl...
keyword[def] identifier[plot_trajectory_projection] ( identifier[self] , identifier[x_axis] , identifier[y_axis] , * identifier[args] ,** identifier[kwargs] ): literal[string] keyword[for] identifier[result] keyword[in] identifier[self] . identifier[results] : identifier[re...
def plot_trajectory_projection(self, x_axis, y_axis, *args, **kwargs): """ Plots trajectory projection on the specified x and y axes See :meth:`InferenceResult.plot_trajectory_projection()` for information on the arguments and keyword arguments :param x_axis: variable to be plotted on the x...
def curvature(self, name, **kwargs): """Test whether a source shows spectral curvature by comparing the likelihood ratio of PowerLaw and LogParabola spectral models. Parameters ---------- name : str Source name. """ name = self.roi.get_sourc...
def function[curvature, parameter[self, name]]: constant[Test whether a source shows spectral curvature by comparing the likelihood ratio of PowerLaw and LogParabola spectral models. Parameters ---------- name : str Source name. ] variable[na...
keyword[def] identifier[curvature] ( identifier[self] , identifier[name] ,** identifier[kwargs] ): literal[string] identifier[name] = identifier[self] . identifier[roi] . identifier[get_source_by_name] ( identifier[name] ). identifier[name] identifier[saved_state] = identifier[Likelihoo...
def curvature(self, name, **kwargs): """Test whether a source shows spectral curvature by comparing the likelihood ratio of PowerLaw and LogParabola spectral models. Parameters ---------- name : str Source name. """ name = self.roi.get_source_by_name...
def _Henry(T, gas, liquid="H2O"): """Equation for the calculation of Henry's constant Parameters ---------- T : float Temperature, [K] gas : string Name of gas to calculate solubility liquid : string Name of liquid solvent, can be H20 (default) or D2O Returns --...
def function[_Henry, parameter[T, gas, liquid]]: constant[Equation for the calculation of Henry's constant Parameters ---------- T : float Temperature, [K] gas : string Name of gas to calculate solubility liquid : string Name of liquid solvent, can be H20 (default) o...
keyword[def] identifier[_Henry] ( identifier[T] , identifier[gas] , identifier[liquid] = literal[string] ): literal[string] keyword[if] identifier[liquid] == literal[string] : identifier[gas] += literal[string] identifier[limit] ={ literal[string] :( literal[int] , literal[int] ), ...
def _Henry(T, gas, liquid='H2O'): """Equation for the calculation of Henry's constant Parameters ---------- T : float Temperature, [K] gas : string Name of gas to calculate solubility liquid : string Name of liquid solvent, can be H20 (default) or D2O Returns --...
def retrieve_client_credentials(self): """Return the client credentials. :returns: tuple(client_id, client_secret) """ client_id = self.params.get('client_id') client_secret = self.params.get('client_secret') return (client_id, client_secret)
def function[retrieve_client_credentials, parameter[self]]: constant[Return the client credentials. :returns: tuple(client_id, client_secret) ] variable[client_id] assign[=] call[name[self].params.get, parameter[constant[client_id]]] variable[client_secret] assign[=] call[name[s...
keyword[def] identifier[retrieve_client_credentials] ( identifier[self] ): literal[string] identifier[client_id] = identifier[self] . identifier[params] . identifier[get] ( literal[string] ) identifier[client_secret] = identifier[self] . identifier[params] . identifier[get] ( literal[strin...
def retrieve_client_credentials(self): """Return the client credentials. :returns: tuple(client_id, client_secret) """ client_id = self.params.get('client_id') client_secret = self.params.get('client_secret') return (client_id, client_secret)
def emails_with_users_and_watches( subject, template_path, vars, users_and_watches, from_email=settings.TIDINGS_FROM_ADDRESS, **extra_kwargs): """Return iterable of EmailMessages with user and watch values substituted. A convenience function for generating emails by repeatedly rendering a D...
def function[emails_with_users_and_watches, parameter[subject, template_path, vars, users_and_watches, from_email]]: constant[Return iterable of EmailMessages with user and watch values substituted. A convenience function for generating emails by repeatedly rendering a Django template with the given ``...
keyword[def] identifier[emails_with_users_and_watches] ( identifier[subject] , identifier[template_path] , identifier[vars] , identifier[users_and_watches] , identifier[from_email] = identifier[settings] . identifier[TIDINGS_FROM_ADDRESS] ,** identifier[extra_kwargs] ): literal[string] identifier[templat...
def emails_with_users_and_watches(subject, template_path, vars, users_and_watches, from_email=settings.TIDINGS_FROM_ADDRESS, **extra_kwargs): """Return iterable of EmailMessages with user and watch values substituted. A convenience function for generating emails by repeatedly rendering a Django template wi...
def ekgd(selidx, row, element): """ Return an element of an entry in a column of double precision type in a specified row. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekgd_c.html :param selidx: Index of parent column in SELECT clause. :type selidx: int :param row: Row to fetch ...
def function[ekgd, parameter[selidx, row, element]]: constant[ Return an element of an entry in a column of double precision type in a specified row. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekgd_c.html :param selidx: Index of parent column in SELECT clause. :type selidx: in...
keyword[def] identifier[ekgd] ( identifier[selidx] , identifier[row] , identifier[element] ): literal[string] identifier[selidx] = identifier[ctypes] . identifier[c_int] ( identifier[selidx] ) identifier[row] = identifier[ctypes] . identifier[c_int] ( identifier[row] ) identifier[element] = ident...
def ekgd(selidx, row, element): """ Return an element of an entry in a column of double precision type in a specified row. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekgd_c.html :param selidx: Index of parent column in SELECT clause. :type selidx: int :param row: Row to fetch ...
def get_blast2(pdb_id, chain_id='A', output_form='HTML'): '''Alternative way to look up BLAST for a given PDB ID. This function is a wrapper for get_raw_blast and parse_blast Parameters ---------- pdb_id : string A 4 character string giving a pdb entry of interest chain_id : string ...
def function[get_blast2, parameter[pdb_id, chain_id, output_form]]: constant[Alternative way to look up BLAST for a given PDB ID. This function is a wrapper for get_raw_blast and parse_blast Parameters ---------- pdb_id : string A 4 character string giving a pdb entry of interest c...
keyword[def] identifier[get_blast2] ( identifier[pdb_id] , identifier[chain_id] = literal[string] , identifier[output_form] = literal[string] ): literal[string] identifier[raw_results] = identifier[get_raw_blast] ( identifier[pdb_id] , identifier[chain_id] = identifier[chain_id] , identifier[output_form] ...
def get_blast2(pdb_id, chain_id='A', output_form='HTML'): """Alternative way to look up BLAST for a given PDB ID. This function is a wrapper for get_raw_blast and parse_blast Parameters ---------- pdb_id : string A 4 character string giving a pdb entry of interest chain_id : string ...
def _get_labels_left(self, validate=None): """Get all labels of the left dataframe.""" labels = [] for compare_func in self.features: labels = labels + listify(compare_func.labels_left) # check requested labels (for better error messages) if not is_label_dataframe...
def function[_get_labels_left, parameter[self, validate]]: constant[Get all labels of the left dataframe.] variable[labels] assign[=] list[[]] for taget[name[compare_func]] in starred[name[self].features] begin[:] variable[labels] assign[=] binary_operation[name[labels] + call[na...
keyword[def] identifier[_get_labels_left] ( identifier[self] , identifier[validate] = keyword[None] ): literal[string] identifier[labels] =[] keyword[for] identifier[compare_func] keyword[in] identifier[self] . identifier[features] : identifier[labels] = identifier[label...
def _get_labels_left(self, validate=None): """Get all labels of the left dataframe.""" labels = [] for compare_func in self.features: labels = labels + listify(compare_func.labels_left) # depends on [control=['for'], data=['compare_func']] # check requested labels (for better error messages) ...
def get(self, key): """ Retrieves a crash from the container. @type key: L{Crash} unique key. @param key: Key of the crash to get. @rtype: L{Crash} object. @return: Crash matching the given key. @see: L{iterkeys} @warning: A B{copy} of each object...
def function[get, parameter[self, key]]: constant[ Retrieves a crash from the container. @type key: L{Crash} unique key. @param key: Key of the crash to get. @rtype: L{Crash} object. @return: Crash matching the given key. @see: L{iterkeys} @warnin...
keyword[def] identifier[get] ( identifier[self] , identifier[key] ): literal[string] identifier[skey] = identifier[self] . identifier[marshall_key] ( identifier[key] ) identifier[data] = identifier[self] . identifier[__db] [ identifier[skey] ] identifier[crash] = identifier[self] ...
def get(self, key): """ Retrieves a crash from the container. @type key: L{Crash} unique key. @param key: Key of the crash to get. @rtype: L{Crash} object. @return: Crash matching the given key. @see: L{iterkeys} @warning: A B{copy} of each object is ...
def find_label(self, label: Label): """ Helper function that iterates over the program and looks for a JumpTarget that has a Label matching the input label. :param label: Label object to search for in program :return: Program index where ``label`` is found """ fo...
def function[find_label, parameter[self, label]]: constant[ Helper function that iterates over the program and looks for a JumpTarget that has a Label matching the input label. :param label: Label object to search for in program :return: Program index where ``label`` is found ...
keyword[def] identifier[find_label] ( identifier[self] , identifier[label] : identifier[Label] ): literal[string] keyword[for] identifier[index] , identifier[action] keyword[in] identifier[enumerate] ( identifier[self] . identifier[program] ): keyword[if] identifier[isinstance] ( i...
def find_label(self, label: Label): """ Helper function that iterates over the program and looks for a JumpTarget that has a Label matching the input label. :param label: Label object to search for in program :return: Program index where ``label`` is found """ for (index...
def check_extras(dist, attr, value): """Verify that extras_require mapping is valid""" try: for k,v in value.items(): list(pkg_resources.parse_requirements(v)) except (TypeError,ValueError,AttributeError): raise DistutilsSetupError( "'extras_require' must be a diction...
def function[check_extras, parameter[dist, attr, value]]: constant[Verify that extras_require mapping is valid] <ast.Try object at 0x7da1b26ac8b0>
keyword[def] identifier[check_extras] ( identifier[dist] , identifier[attr] , identifier[value] ): literal[string] keyword[try] : keyword[for] identifier[k] , identifier[v] keyword[in] identifier[value] . identifier[items] (): identifier[list] ( identifier[pkg_resources] . identifi...
def check_extras(dist, attr, value): """Verify that extras_require mapping is valid""" try: for (k, v) in value.items(): list(pkg_resources.parse_requirements(v)) # depends on [control=['for'], data=[]] # depends on [control=['try'], data=[]] except (TypeError, ValueError, AttributeErr...
def user(self, username=None): """gets the user's content. If None is passed, the current user is used. Input: username - name of the login for a given user on a site. """ if username is None: username = self.__getUsername() url = "%s/%s" % (self.r...
def function[user, parameter[self, username]]: constant[gets the user's content. If None is passed, the current user is used. Input: username - name of the login for a given user on a site. ] if compare[name[username] is constant[None]] begin[:] variabl...
keyword[def] identifier[user] ( identifier[self] , identifier[username] = keyword[None] ): literal[string] keyword[if] identifier[username] keyword[is] keyword[None] : identifier[username] = identifier[self] . identifier[__getUsername] () identifier[url] = literal[string] ...
def user(self, username=None): """gets the user's content. If None is passed, the current user is used. Input: username - name of the login for a given user on a site. """ if username is None: username = self.__getUsername() # depends on [control=['if'], data=['userna...
def get_default(self, node): """ Unless specified otherwise, intr fields are implicitly stickybit """ if node.inst.properties.get("intr", False): # Interrupt is set! # Default is implicitly stickybit, unless the mutually-exclusive # sticky property was...
def function[get_default, parameter[self, node]]: constant[ Unless specified otherwise, intr fields are implicitly stickybit ] if call[name[node].inst.properties.get, parameter[constant[intr], constant[False]]] begin[:] return[<ast.UnaryOp object at 0x7da1b0d61780>]
keyword[def] identifier[get_default] ( identifier[self] , identifier[node] ): literal[string] keyword[if] identifier[node] . identifier[inst] . identifier[properties] . identifier[get] ( literal[string] , keyword[False] ): keyword[return] keyword[not] iden...
def get_default(self, node): """ Unless specified otherwise, intr fields are implicitly stickybit """ if node.inst.properties.get('intr', False): # Interrupt is set! # Default is implicitly stickybit, unless the mutually-exclusive # sticky property was set instead ...
def _download_wrapper(self, url, *args, **kwargs): """ Actual download call. Calls the underlying file downloader, catches all exceptions and returns the result. """ try: return url, self._file_downloader.download(url, *args, **kwargs) except Exception as e: ...
def function[_download_wrapper, parameter[self, url]]: constant[ Actual download call. Calls the underlying file downloader, catches all exceptions and returns the result. ] <ast.Try object at 0x7da18f812800>
keyword[def] identifier[_download_wrapper] ( identifier[self] , identifier[url] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[try] : keyword[return] identifier[url] , identifier[self] . identifier[_file_downloader] . identifier[download] ( identifier[url] ,* id...
def _download_wrapper(self, url, *args, **kwargs): """ Actual download call. Calls the underlying file downloader, catches all exceptions and returns the result. """ try: return (url, self._file_downloader.download(url, *args, **kwargs)) # depends on [control=['try'], data=[]] ...
def remove(self, package, echo=None, options=None, timeout=shutit_global.shutit_global_object.default_timeout, note=None): """Distro-independent remove function. Takes a package name and runs relevant remove function. @param package: Package to remove,...
def function[remove, parameter[self, package, echo, options, timeout, note]]: constant[Distro-independent remove function. Takes a package name and runs relevant remove function. @param package: Package to remove, which is run through package_map. @param options: Dict of options to pass to the remove c...
keyword[def] identifier[remove] ( identifier[self] , identifier[package] , identifier[echo] = keyword[None] , identifier[options] = keyword[None] , identifier[timeout] = identifier[shutit_global] . identifier[shutit_global_object] . identifier[default_timeout] , identifier[note] = keyword[None] ): literal[str...
def remove(self, package, echo=None, options=None, timeout=shutit_global.shutit_global_object.default_timeout, note=None): """Distro-independent remove function. Takes a package name and runs relevant remove function. @param package: Package to remove, which is run through package_map. @param options: Dict...
def parse(cls, fptr, offset, length): """Parse data reference box. Parameters ---------- fptr : file Open file object. offset : int Start position of box in bytes. length : int Length of the box in bytes. Returns -----...
def function[parse, parameter[cls, fptr, offset, length]]: constant[Parse data reference box. Parameters ---------- fptr : file Open file object. offset : int Start position of box in bytes. length : int Length of the box in bytes. ...
keyword[def] identifier[parse] ( identifier[cls] , identifier[fptr] , identifier[offset] , identifier[length] ): literal[string] identifier[num_bytes] = identifier[offset] + identifier[length] - identifier[fptr] . identifier[tell] () identifier[read_buffer] = identifier[fptr] . identifier[...
def parse(cls, fptr, offset, length): """Parse data reference box. Parameters ---------- fptr : file Open file object. offset : int Start position of box in bytes. length : int Length of the box in bytes. Returns ------- ...
def get_base_naive(cls, name, ignore=''): """ Checks a string for a possible base name of an object (no prefix, no suffix). We need to do a full parse to make sure we've ruled out all the possible other parse queries :param name: str, string that represents a possible name of an object ...
def function[get_base_naive, parameter[cls, name, ignore]]: constant[ Checks a string for a possible base name of an object (no prefix, no suffix). We need to do a full parse to make sure we've ruled out all the possible other parse queries :param name: str, string that represents a possibl...
keyword[def] identifier[get_base_naive] ( identifier[cls] , identifier[name] , identifier[ignore] = literal[string] ): literal[string] keyword[return] identifier[cls] . identifier[_get_regex_search] ( identifier[name] , identifier[cls] . identifier[REGEX_BASENAME] , identifier[match_index] = liter...
def get_base_naive(cls, name, ignore=''): """ Checks a string for a possible base name of an object (no prefix, no suffix). We need to do a full parse to make sure we've ruled out all the possible other parse queries :param name: str, string that represents a possible name of an object ...
def getUmis(self, n): ''' return n umis from the random_umis atr.''' if n < (self.random_fill_size - self.random_ix): barcodes = self.random_umis[self.random_ix: self.random_ix+n] else: # could use the end of the random_umis but # let's just make a new random_...
def function[getUmis, parameter[self, n]]: constant[ return n umis from the random_umis atr.] if compare[name[n] less[<] binary_operation[name[self].random_fill_size - name[self].random_ix]] begin[:] variable[barcodes] assign[=] call[name[self].random_umis][<ast.Slice object at 0x7da207f...
keyword[def] identifier[getUmis] ( identifier[self] , identifier[n] ): literal[string] keyword[if] identifier[n] <( identifier[self] . identifier[random_fill_size] - identifier[self] . identifier[random_ix] ): identifier[barcodes] = identifier[self] . identifier[random_umis] [ identif...
def getUmis(self, n): """ return n umis from the random_umis atr.""" if n < self.random_fill_size - self.random_ix: barcodes = self.random_umis[self.random_ix:self.random_ix + n] # depends on [control=['if'], data=['n']] else: # could use the end of the random_umis but # let's just ...
def _analyze_variable_attributes(self, attributes): """ Analyze event variable attributes :param attributes: The event variable attributes to parse. :return: None """ # Check for the indexed attribute if 'indexed' in attributes: self._indexed = attrib...
def function[_analyze_variable_attributes, parameter[self, attributes]]: constant[ Analyze event variable attributes :param attributes: The event variable attributes to parse. :return: None ] if compare[constant[indexed] in name[attributes]] begin[:] name[...
keyword[def] identifier[_analyze_variable_attributes] ( identifier[self] , identifier[attributes] ): literal[string] keyword[if] literal[string] keyword[in] identifier[attributes] : identifier[self] . identifier[_indexed] = identifier[attributes] [ literal[string] ] ...
def _analyze_variable_attributes(self, attributes): """ Analyze event variable attributes :param attributes: The event variable attributes to parse. :return: None """ # Check for the indexed attribute if 'indexed' in attributes: self._indexed = attributes['indexed'] ...
def get_source_models(oqparam, gsim_lt, source_model_lt, monitor, in_memory=True, srcfilter=None): """ Build all the source models generated by the logic tree. :param oqparam: an :class:`openquake.commonlib.oqvalidation.OqParam` instance :param gsim_lt: a :class:`o...
def function[get_source_models, parameter[oqparam, gsim_lt, source_model_lt, monitor, in_memory, srcfilter]]: constant[ Build all the source models generated by the logic tree. :param oqparam: an :class:`openquake.commonlib.oqvalidation.OqParam` instance :param gsim_lt: a :class:`op...
keyword[def] identifier[get_source_models] ( identifier[oqparam] , identifier[gsim_lt] , identifier[source_model_lt] , identifier[monitor] , identifier[in_memory] = keyword[True] , identifier[srcfilter] = keyword[None] ): literal[string] identifier[make_sm] = identifier[SourceModelFactory] () identif...
def get_source_models(oqparam, gsim_lt, source_model_lt, monitor, in_memory=True, srcfilter=None): """ Build all the source models generated by the logic tree. :param oqparam: an :class:`openquake.commonlib.oqvalidation.OqParam` instance :param gsim_lt: a :class:`openquake.commonlib.log...
def show(target, *args, **kwargs): """ An utility function to display the given target object in the proper way. Paramters --------- target : NumberObserver, TrajectoryObserver, World, str When a NumberObserver object is given, show it with viz.plot_number_observer. When a Trajector...
def function[show, parameter[target]]: constant[ An utility function to display the given target object in the proper way. Paramters --------- target : NumberObserver, TrajectoryObserver, World, str When a NumberObserver object is given, show it with viz.plot_number_observer. Wh...
keyword[def] identifier[show] ( identifier[target] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[isinstance] ( identifier[target] ,( identifier[ecell4_base] . identifier[core] . identifier[FixedIntervalNumberObserver] , identifier[ecell4_base] . identifier[core] . id...
def show(target, *args, **kwargs): """ An utility function to display the given target object in the proper way. Paramters --------- target : NumberObserver, TrajectoryObserver, World, str When a NumberObserver object is given, show it with viz.plot_number_observer. When a Trajector...
def read_electrostatic_potential(self): """ Parses the eletrostatic potential for the last ionic step """ pattern = {"ngf": r"\s+dimension x,y,z NGXF=\s+([\.\-\d]+)\sNGYF=\s+([\.\-\d]+)\sNGZF=\s+([\.\-\d]+)"} self.read_pattern(pattern, postprocess=int) self.ngf = self.dat...
def function[read_electrostatic_potential, parameter[self]]: constant[ Parses the eletrostatic potential for the last ionic step ] variable[pattern] assign[=] dictionary[[<ast.Constant object at 0x7da2047eace0>], [<ast.Constant object at 0x7da2047ea920>]] call[name[self].read_pat...
keyword[def] identifier[read_electrostatic_potential] ( identifier[self] ): literal[string] identifier[pattern] ={ literal[string] : literal[string] } identifier[self] . identifier[read_pattern] ( identifier[pattern] , identifier[postprocess] = identifier[int] ) identifier[self] ....
def read_electrostatic_potential(self): """ Parses the eletrostatic potential for the last ionic step """ pattern = {'ngf': '\\s+dimension x,y,z NGXF=\\s+([\\.\\-\\d]+)\\sNGYF=\\s+([\\.\\-\\d]+)\\sNGZF=\\s+([\\.\\-\\d]+)'} self.read_pattern(pattern, postprocess=int) self.ngf = self.data....
def make_measurement(name, channels, lumi=1.0, lumi_rel_error=0.1, output_prefix='./histfactory', POI=None, const_params=None, verbose=False): """ Create a Measurement from a list of Cha...
def function[make_measurement, parameter[name, channels, lumi, lumi_rel_error, output_prefix, POI, const_params, verbose]]: constant[ Create a Measurement from a list of Channels ] if name[verbose] begin[:] variable[llog] assign[=] call[name[log]][constant[make_measurement]] ...
keyword[def] identifier[make_measurement] ( identifier[name] , identifier[channels] , identifier[lumi] = literal[int] , identifier[lumi_rel_error] = literal[int] , identifier[output_prefix] = literal[string] , identifier[POI] = keyword[None] , identifier[const_params] = keyword[None] , identifier[verbose] = key...
def make_measurement(name, channels, lumi=1.0, lumi_rel_error=0.1, output_prefix='./histfactory', POI=None, const_params=None, verbose=False): """ Create a Measurement from a list of Channels """ if verbose: llog = log['make_measurement'] llog.info('creating measurement {0}'.format(name)...
def periodic(self, period_seconds, callback): """This method allows to invoke the callback periodically, with specified time intervals. Note that the scheduler features zero phase drift. :returns: EventHandle object. Call .remove() on it to cancel the event. """ priority = 0 ...
def function[periodic, parameter[self, period_seconds, callback]]: constant[This method allows to invoke the callback periodically, with specified time intervals. Note that the scheduler features zero phase drift. :returns: EventHandle object. Call .remove() on it to cancel the event. ] ...
keyword[def] identifier[periodic] ( identifier[self] , identifier[period_seconds] , identifier[callback] ): literal[string] identifier[priority] = literal[int] keyword[def] identifier[caller] ( identifier[scheduled_deadline] ): identifier[scheduled_deadline] += ide...
def periodic(self, period_seconds, callback): """This method allows to invoke the callback periodically, with specified time intervals. Note that the scheduler features zero phase drift. :returns: EventHandle object. Call .remove() on it to cancel the event. """ priority = 0 def cal...
def EmitSignal(self, interface, name, signature, args): '''Emit a signal from the object. interface: D-Bus interface to send the signal from. For convenience you can specify '' here to add the method to the object's main interface (as specified on construction). ...
def function[EmitSignal, parameter[self, interface, name, signature, args]]: constant[Emit a signal from the object. interface: D-Bus interface to send the signal from. For convenience you can specify '' here to add the method to the object's main interface (as spe...
keyword[def] identifier[EmitSignal] ( identifier[self] , identifier[interface] , identifier[name] , identifier[signature] , identifier[args] ): literal[string] keyword[if] keyword[not] identifier[interface] : identifier[interface] = identifier[self] . identifier[interface] ...
def EmitSignal(self, interface, name, signature, args): """Emit a signal from the object. interface: D-Bus interface to send the signal from. For convenience you can specify '' here to add the method to the object's main interface (as specified on construction). ...
def check(text): """Check the text.""" err = "misc.tense_present" msg = u"'{}'." illogics = [ u"up to \d{1,3}% ?[-\u2014\u2013]{0,3} ?(?:or|and) more\W?", "between you and I", "on accident", "somewhat of a", "all it's own", "reason is because", "a...
def function[check, parameter[text]]: constant[Check the text.] variable[err] assign[=] constant[misc.tense_present] variable[msg] assign[=] constant['{}'.] variable[illogics] assign[=] list[[<ast.Constant object at 0x7da1b08f9900>, <ast.Constant object at 0x7da1b08f9d50>, <ast.Constant ...
keyword[def] identifier[check] ( identifier[text] ): literal[string] identifier[err] = literal[string] identifier[msg] = literal[string] identifier[illogics] =[ literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[strin...
def check(text): """Check the text.""" err = 'misc.tense_present' msg = u"'{}'." # "and so", illogics = [u'up to \\d{1,3}% ?[-—–]{0,3} ?(?:or|and) more\\W?', 'between you and I', 'on accident', 'somewhat of a', "all it's own", 'reason is because', 'audible to the ear', 'in regards to', 'would of', "...
def step( self ): """ Returns the step value for this ruler. If the cached value is None, then a default value will be specified based on the ruler type. :return <variant> """ if ( self._step is not None ): return self._step eli...
def function[step, parameter[self]]: constant[ Returns the step value for this ruler. If the cached value is None, then a default value will be specified based on the ruler type. :return <variant> ] if compare[name[self]._step is_not constant[None]] begin[:]...
keyword[def] identifier[step] ( identifier[self] ): literal[string] keyword[if] ( identifier[self] . identifier[_step] keyword[is] keyword[not] keyword[None] ): keyword[return] identifier[self] . identifier[_step] keyword[elif] ( identifier[self] . identifier[rulerType]...
def step(self): """ Returns the step value for this ruler. If the cached value is None, then a default value will be specified based on the ruler type. :return <variant> """ if self._step is not None: return self._step # depends on [control=['if'], data=[]]...
def ks_unif_durbin_recurrence_rational(samples, statistic): """ Calculates the probability that the statistic is less than the given value, using Durbin's recurrence and employing the standard fractions module. This is a (hopefully) exact reference implementation, likely too slow for practical usag...
def function[ks_unif_durbin_recurrence_rational, parameter[samples, statistic]]: constant[ Calculates the probability that the statistic is less than the given value, using Durbin's recurrence and employing the standard fractions module. This is a (hopefully) exact reference implementation, likely ...
keyword[def] identifier[ks_unif_durbin_recurrence_rational] ( identifier[samples] , identifier[statistic] ): literal[string] identifier[t] = identifier[statistic] * identifier[samples] identifier[ft1] = identifier[int] ( identifier[floor] ( identifier[t] ))+ literal[int] identifier[fmt1] =...
def ks_unif_durbin_recurrence_rational(samples, statistic): """ Calculates the probability that the statistic is less than the given value, using Durbin's recurrence and employing the standard fractions module. This is a (hopefully) exact reference implementation, likely too slow for practical usag...
def create_relationship(self, relationship_form): """Creates a new ``Relationship``. arg: relationship_form (osid.relationship.RelationshipForm): the form for this ``Relationship`` return: (osid.relationship.Relationship) - the new ``Relationship`` rai...
def function[create_relationship, parameter[self, relationship_form]]: constant[Creates a new ``Relationship``. arg: relationship_form (osid.relationship.RelationshipForm): the form for this ``Relationship`` return: (osid.relationship.Relationship) - the new `...
keyword[def] identifier[create_relationship] ( identifier[self] , identifier[relationship_form] ): literal[string] identifier[collection] = identifier[JSONClientValidated] ( literal[string] , identifier[collection] = literal[string] , identifier[runtime] = identi...
def create_relationship(self, relationship_form): """Creates a new ``Relationship``. arg: relationship_form (osid.relationship.RelationshipForm): the form for this ``Relationship`` return: (osid.relationship.Relationship) - the new ``Relationship`` raise: ...
async def get_entry(config, url): """ Given an entry URL, return the entry Arguments: config -- the configuration url -- the URL of the entry Returns: 3-tuple of (current, previous, updated) """ previous = config.cache.get( 'entry', url, schema_version=SCHEMA_VERSION) if conf...
<ast.AsyncFunctionDef object at 0x7da1b2344250>
keyword[async] keyword[def] identifier[get_entry] ( identifier[config] , identifier[url] ): literal[string] identifier[previous] = identifier[config] . identifier[cache] . identifier[get] ( literal[string] , identifier[url] , identifier[schema_version] = identifier[SCHEMA_VERSION] ) keyword[if]...
async def get_entry(config, url): """ Given an entry URL, return the entry Arguments: config -- the configuration url -- the URL of the entry Returns: 3-tuple of (current, previous, updated) """ previous = config.cache.get('entry', url, schema_version=SCHEMA_VERSION) if config.cache else None...
def clear(self): """ Initializes the device memory with an empty (blank) image. """ self.display(Image.new(self.mode, self.size))
def function[clear, parameter[self]]: constant[ Initializes the device memory with an empty (blank) image. ] call[name[self].display, parameter[call[name[Image].new, parameter[name[self].mode, name[self].size]]]]
keyword[def] identifier[clear] ( identifier[self] ): literal[string] identifier[self] . identifier[display] ( identifier[Image] . identifier[new] ( identifier[self] . identifier[mode] , identifier[self] . identifier[size] ))
def clear(self): """ Initializes the device memory with an empty (blank) image. """ self.display(Image.new(self.mode, self.size))
def n_list_comp_pypy27(self, node): """List comprehensions in PYPY.""" p = self.prec self.prec = 27 if node[-1].kind == 'list_iter': n = node[-1] elif self.is_pypy and node[-1] == 'JUMP_BACK': n = node[-2] list_expr = node[1] if len(node) ...
def function[n_list_comp_pypy27, parameter[self, node]]: constant[List comprehensions in PYPY.] variable[p] assign[=] name[self].prec name[self].prec assign[=] constant[27] if compare[call[name[node]][<ast.UnaryOp object at 0x7da2044c12a0>].kind equal[==] constant[list_iter]] begin[:] ...
keyword[def] identifier[n_list_comp_pypy27] ( identifier[self] , identifier[node] ): literal[string] identifier[p] = identifier[self] . identifier[prec] identifier[self] . identifier[prec] = literal[int] keyword[if] identifier[node] [- literal[int] ]. identifier[kind] == litera...
def n_list_comp_pypy27(self, node): """List comprehensions in PYPY.""" p = self.prec self.prec = 27 if node[-1].kind == 'list_iter': n = node[-1] # depends on [control=['if'], data=[]] elif self.is_pypy and node[-1] == 'JUMP_BACK': n = node[-2] # depends on [control=['if'], data=[]...
def load_table_from_file( self, file_obj, destination, rewind=False, size=None, num_retries=_DEFAULT_NUM_RETRIES, job_id=None, job_id_prefix=None, location=None, project=None, job_config=None, ): """Upload the contents o...
def function[load_table_from_file, parameter[self, file_obj, destination, rewind, size, num_retries, job_id, job_id_prefix, location, project, job_config]]: constant[Upload the contents of this table from a file-like object. Similar to :meth:`load_table_from_uri`, this method creates, starts and ...
keyword[def] identifier[load_table_from_file] ( identifier[self] , identifier[file_obj] , identifier[destination] , identifier[rewind] = keyword[False] , identifier[size] = keyword[None] , identifier[num_retries] = identifier[_DEFAULT_NUM_RETRIES] , identifier[job_id] = keyword[None] , identifier[job_id_prefi...
def load_table_from_file(self, file_obj, destination, rewind=False, size=None, num_retries=_DEFAULT_NUM_RETRIES, job_id=None, job_id_prefix=None, location=None, project=None, job_config=None): """Upload the contents of this table from a file-like object. Similar to :meth:`load_table_from_uri`, this method ...
def format_request_email_title(increq, **ctx): """Format the email message title for inclusion request notification. :param increq: Inclusion request object for which the request is made. :type increq: `invenio_communities.models.InclusionRequest` :param ctx: Optional extra context parameters passed to...
def function[format_request_email_title, parameter[increq]]: constant[Format the email message title for inclusion request notification. :param increq: Inclusion request object for which the request is made. :type increq: `invenio_communities.models.InclusionRequest` :param ctx: Optional extra cont...
keyword[def] identifier[format_request_email_title] ( identifier[increq] ,** identifier[ctx] ): literal[string] identifier[template] = identifier[current_app] . identifier[config] [ literal[string] ], keyword[return] identifier[format_request_email_templ] ( identifier[increq] , identifier[template] ,...
def format_request_email_title(increq, **ctx): """Format the email message title for inclusion request notification. :param increq: Inclusion request object for which the request is made. :type increq: `invenio_communities.models.InclusionRequest` :param ctx: Optional extra context parameters passed to...
def reverse_char(self, hints): """Return QuerySet of objects from SQLAlchemy of results. Parameters ---------- hints: list of str strings to lookup Returns ------- :class:`sqlalchemy.orm.query.Query` : reverse matches """ ...
def function[reverse_char, parameter[self, hints]]: constant[Return QuerySet of objects from SQLAlchemy of results. Parameters ---------- hints: list of str strings to lookup Returns ------- :class:`sqlalchemy.orm.query.Query` : reverse m...
keyword[def] identifier[reverse_char] ( identifier[self] , identifier[hints] ): literal[string] keyword[if] identifier[isinstance] ( identifier[hints] , identifier[string_types] ): identifier[hints] =[ identifier[hints] ] identifier[Unihan] = identifier[self] . identifier[sq...
def reverse_char(self, hints): """Return QuerySet of objects from SQLAlchemy of results. Parameters ---------- hints: list of str strings to lookup Returns ------- :class:`sqlalchemy.orm.query.Query` : reverse matches """ if isins...
def request_tokens(self, amount, account): """ Request an amount of tokens for a particular address. This transaction has gas cost :param amount: Amount of tokens, int :param account: Account instance :raise OceanInvalidTransaction: Transaction failed :return: bo...
def function[request_tokens, parameter[self, amount, account]]: constant[ Request an amount of tokens for a particular address. This transaction has gas cost :param amount: Amount of tokens, int :param account: Account instance :raise OceanInvalidTransaction: Transaction...
keyword[def] identifier[request_tokens] ( identifier[self] , identifier[amount] , identifier[account] ): literal[string] identifier[address] = identifier[account] . identifier[address] keyword[try] : identifier[tx_hash] = identifier[self] . identifier[send_transaction] ( ...
def request_tokens(self, amount, account): """ Request an amount of tokens for a particular address. This transaction has gas cost :param amount: Amount of tokens, int :param account: Account instance :raise OceanInvalidTransaction: Transaction failed :return: bool ...
def Match(self, registry_key): """Determines if a Windows Registry key matches the filter. Args: registry_key (dfwinreg.WinRegistryKey): Windows Registry key. Returns: bool: True if the keys match. """ key_path = registry_key.path.upper() if self._key_path_prefix and self._key_path...
def function[Match, parameter[self, registry_key]]: constant[Determines if a Windows Registry key matches the filter. Args: registry_key (dfwinreg.WinRegistryKey): Windows Registry key. Returns: bool: True if the keys match. ] variable[key_path] assign[=] call[name[registry_key...
keyword[def] identifier[Match] ( identifier[self] , identifier[registry_key] ): literal[string] identifier[key_path] = identifier[registry_key] . identifier[path] . identifier[upper] () keyword[if] identifier[self] . identifier[_key_path_prefix] keyword[and] identifier[self] . identifier[_key_path_...
def Match(self, registry_key): """Determines if a Windows Registry key matches the filter. Args: registry_key (dfwinreg.WinRegistryKey): Windows Registry key. Returns: bool: True if the keys match. """ key_path = registry_key.path.upper() if self._key_path_prefix and self._key_path...
def get(cls, **kwargs): """Get cart. Retrieve the shopping cart of the current session. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get(async=True) >>> result = thread.get() ...
def function[get, parameter[cls]]: constant[Get cart. Retrieve the shopping cart of the current session. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get(async=True) >>> result = th...
keyword[def] identifier[get] ( identifier[cls] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[return] identifier[cls] . identifier[_get_with_http_i...
def get(cls, **kwargs): """Get cart. Retrieve the shopping cart of the current session. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get(async=True) >>> result = thread.get() :...
def best_buy_2(self): """量縮價不跌 """ result = self.data.capacity[-1] < self.data.capacity[-2] and \ self.data.price[-1] > self.data.price[-2] return result
def function[best_buy_2, parameter[self]]: constant[量縮價不跌 ] variable[result] assign[=] <ast.BoolOp object at 0x7da1b19cf610> return[name[result]]
keyword[def] identifier[best_buy_2] ( identifier[self] ): literal[string] identifier[result] = identifier[self] . identifier[data] . identifier[capacity] [- literal[int] ]< identifier[self] . identifier[data] . identifier[capacity] [- literal[int] ] keyword[and] identifier[self] . identifier[data]...
def best_buy_2(self): """量縮價不跌 """ result = self.data.capacity[-1] < self.data.capacity[-2] and self.data.price[-1] > self.data.price[-2] return result
def get_config_h_filename(): """Return the path of pyconfig.h.""" if _PYTHON_BUILD: if os.name == "nt": inc_dir = os.path.join(_PROJECT_BASE, "PC") else: inc_dir = _PROJECT_BASE else: inc_dir = get_path('platinclude') return os.path.join(inc_dir, 'pyconfig...
def function[get_config_h_filename, parameter[]]: constant[Return the path of pyconfig.h.] if name[_PYTHON_BUILD] begin[:] if compare[name[os].name equal[==] constant[nt]] begin[:] variable[inc_dir] assign[=] call[name[os].path.join, parameter[name[_PROJECT_BASE],...
keyword[def] identifier[get_config_h_filename] (): literal[string] keyword[if] identifier[_PYTHON_BUILD] : keyword[if] identifier[os] . identifier[name] == literal[string] : identifier[inc_dir] = identifier[os] . identifier[path] . identifier[join] ( identifier[_PROJECT_BASE] , lite...
def get_config_h_filename(): """Return the path of pyconfig.h.""" if _PYTHON_BUILD: if os.name == 'nt': inc_dir = os.path.join(_PROJECT_BASE, 'PC') # depends on [control=['if'], data=[]] else: inc_dir = _PROJECT_BASE # depends on [control=['if'], data=[]] else: ...
def segment(self): """ Associated (full) :class:`stravalib.model.Segment` object. """ if self._segment is None: self.assert_bind_client() if self.id is not None: self._segment = self.bind_client.get_segment(self.id) return self._segment
def function[segment, parameter[self]]: constant[ Associated (full) :class:`stravalib.model.Segment` object. ] if compare[name[self]._segment is constant[None]] begin[:] call[name[self].assert_bind_client, parameter[]] if compare[name[self].id is_not constant[None]] begin...
keyword[def] identifier[segment] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_segment] keyword[is] keyword[None] : identifier[self] . identifier[assert_bind_client] () keyword[if] identifier[self] . identifier[id] keyword[is] keywo...
def segment(self): """ Associated (full) :class:`stravalib.model.Segment` object. """ if self._segment is None: self.assert_bind_client() if self.id is not None: self._segment = self.bind_client.get_segment(self.id) # depends on [control=['if'], data=[]] # depends on [control=['if'...
def insert(self, streamname, value): """Insert the datapoint into the logger for the given stream name. The logger caches the datapoint and eventually synchronizes it with ConnectorDB""" if streamname not in self.streams: raise Exception("The stream '%s' was not found" % (streamname,...
def function[insert, parameter[self, streamname, value]]: constant[Insert the datapoint into the logger for the given stream name. The logger caches the datapoint and eventually synchronizes it with ConnectorDB] if compare[name[streamname] <ast.NotIn object at 0x7da2590d7190> name[self].streams]...
keyword[def] identifier[insert] ( identifier[self] , identifier[streamname] , identifier[value] ): literal[string] keyword[if] identifier[streamname] keyword[not] keyword[in] identifier[self] . identifier[streams] : keyword[raise] identifier[Exception] ( literal[string] %( identif...
def insert(self, streamname, value): """Insert the datapoint into the logger for the given stream name. The logger caches the datapoint and eventually synchronizes it with ConnectorDB""" if streamname not in self.streams: raise Exception("The stream '%s' was not found" % (streamname,)) # depend...
def read_version(): """Read version from curdling/version.py without loading any files""" finder = VersionFinder() finder.visit(ast.parse(local_file('curdling', 'version.py'))) return finder.version
def function[read_version, parameter[]]: constant[Read version from curdling/version.py without loading any files] variable[finder] assign[=] call[name[VersionFinder], parameter[]] call[name[finder].visit, parameter[call[name[ast].parse, parameter[call[name[local_file], parameter[constant[curdli...
keyword[def] identifier[read_version] (): literal[string] identifier[finder] = identifier[VersionFinder] () identifier[finder] . identifier[visit] ( identifier[ast] . identifier[parse] ( identifier[local_file] ( literal[string] , literal[string] ))) keyword[return] identifier[finder] . identifie...
def read_version(): """Read version from curdling/version.py without loading any files""" finder = VersionFinder() finder.visit(ast.parse(local_file('curdling', 'version.py'))) return finder.version
def append_cell_value(self, column_family_id, column, value): """Appends a value to an existing cell. .. note:: This method adds a read-modify rule protobuf to the accumulated read-modify rules on this row, but does not make an API request. To actually send an API r...
def function[append_cell_value, parameter[self, column_family_id, column, value]]: constant[Appends a value to an existing cell. .. note:: This method adds a read-modify rule protobuf to the accumulated read-modify rules on this row, but does not make an API request...
keyword[def] identifier[append_cell_value] ( identifier[self] , identifier[column_family_id] , identifier[column] , identifier[value] ): literal[string] identifier[column] = identifier[_to_bytes] ( identifier[column] ) identifier[value] = identifier[_to_bytes] ( identifier[value] ) ...
def append_cell_value(self, column_family_id, column, value): """Appends a value to an existing cell. .. note:: This method adds a read-modify rule protobuf to the accumulated read-modify rules on this row, but does not make an API request. To actually send an API reque...
def show_fabric_trunk_info_output_show_trunk_list_trunk_list_groups_trunk_list_member_trunk_list_src_port(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") show_fabric_trunk_info = ET.Element("show_fabric_trunk_info") config = show_fabric_trunk_info ...
def function[show_fabric_trunk_info_output_show_trunk_list_trunk_list_groups_trunk_list_member_trunk_list_src_port, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[show_fabric_trunk_info] assign[=] c...
keyword[def] identifier[show_fabric_trunk_info_output_show_trunk_list_trunk_list_groups_trunk_list_member_trunk_list_src_port] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[show_fabric_t...
def show_fabric_trunk_info_output_show_trunk_list_trunk_list_groups_trunk_list_member_trunk_list_src_port(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') show_fabric_trunk_info = ET.Element('show_fabric_trunk_info') config = show_fabric_trunk_info output = ET.SubEle...
def to_pattern_matrix(D): """Returns the Boolean matrix in the same shape as `D` with ones exactly where there are nonzero entries in `D`. `D` must be a NumPy array. """ result = np.zeros_like(D) # This is a cleverer way of doing # # for (u, v) in zip(*(D.nonzero())): # ...
def function[to_pattern_matrix, parameter[D]]: constant[Returns the Boolean matrix in the same shape as `D` with ones exactly where there are nonzero entries in `D`. `D` must be a NumPy array. ] variable[result] assign[=] call[name[np].zeros_like, parameter[name[D]]] call[name[resu...
keyword[def] identifier[to_pattern_matrix] ( identifier[D] ): literal[string] identifier[result] = identifier[np] . identifier[zeros_like] ( identifier[D] ) identifier[result] [ identifier[D] . identifier[nonzero] ()]= literal[int] keyword[return] identifier[result]
def to_pattern_matrix(D): """Returns the Boolean matrix in the same shape as `D` with ones exactly where there are nonzero entries in `D`. `D` must be a NumPy array. """ result = np.zeros_like(D) # This is a cleverer way of doing # # for (u, v) in zip(*(D.nonzero())): # ...
def add_to_team(self, **kw): """ We override this method to add our additional participation policy groups, as detailed in available_groups above """ group = self.context.participant_policy.title() data = kw.copy() if "groups" in data: data["groups"].a...
def function[add_to_team, parameter[self]]: constant[ We override this method to add our additional participation policy groups, as detailed in available_groups above ] variable[group] assign[=] call[name[self].context.participant_policy.title, parameter[]] variable[data]...
keyword[def] identifier[add_to_team] ( identifier[self] ,** identifier[kw] ): literal[string] identifier[group] = identifier[self] . identifier[context] . identifier[participant_policy] . identifier[title] () identifier[data] = identifier[kw] . identifier[copy] () keyword[if] lit...
def add_to_team(self, **kw): """ We override this method to add our additional participation policy groups, as detailed in available_groups above """ group = self.context.participant_policy.title() data = kw.copy() if 'groups' in data: data['groups'].add(group) # depends...
def set_xml(self): """Set document xml just rendered already validated against xsd to be signed. :params boolean debug_mode: Either if you want the rendered template to be saved either it is valid or not with the given schema. :returns boolean: Either was valid or no...
def function[set_xml, parameter[self]]: constant[Set document xml just rendered already validated against xsd to be signed. :params boolean debug_mode: Either if you want the rendered template to be saved either it is valid or not with the given schema. :returns bool...
keyword[def] identifier[set_xml] ( identifier[self] ): literal[string] identifier[cached] = identifier[StringIO] () identifier[document] = literal[string] keyword[try] : identifier[document] = identifier[self] . identifier[template] . identifier[render] ( identifier[...
def set_xml(self): """Set document xml just rendered already validated against xsd to be signed. :params boolean debug_mode: Either if you want the rendered template to be saved either it is valid or not with the given schema. :returns boolean: Either was valid or not th...