code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def _do_sse_request(self, path, params=None): """Query Marathon server for events.""" urls = [''.join([server.rstrip('/'), path]) for server in self.servers] while urls: url = urls.pop() try: # Requests does not set the original Authorization header on cro...
def function[_do_sse_request, parameter[self, path, params]]: constant[Query Marathon server for events.] variable[urls] assign[=] <ast.ListComp object at 0x7da1b0f580a0> while name[urls] begin[:] variable[url] assign[=] call[name[urls].pop, parameter[]] <ast.Try object a...
keyword[def] identifier[_do_sse_request] ( identifier[self] , identifier[path] , identifier[params] = keyword[None] ): literal[string] identifier[urls] =[ literal[string] . identifier[join] ([ identifier[server] . identifier[rstrip] ( literal[string] ), identifier[path] ]) keyword[for] identifier[...
def _do_sse_request(self, path, params=None): """Query Marathon server for events.""" urls = [''.join([server.rstrip('/'), path]) for server in self.servers] while urls: url = urls.pop() try: # Requests does not set the original Authorization header on cross origin # ...
def get_filename_extensions(url='https://www.webopedia.com/quick_ref/fileextensionsfull.asp'): """ Load a DataFrame of filename extensions from the indicated url >>> df = get_filename_extensions('https://www.openoffice.org/dev_docs/source/file_extensions.html') >>> df.head(2) ext ...
def function[get_filename_extensions, parameter[url]]: constant[ Load a DataFrame of filename extensions from the indicated url >>> df = get_filename_extensions('https://www.openoffice.org/dev_docs/source/file_extensions.html') >>> df.head(2) ext description 0 .a ...
keyword[def] identifier[get_filename_extensions] ( identifier[url] = literal[string] ): literal[string] identifier[df] = identifier[get_longest_table] ( identifier[url] ) identifier[columns] = identifier[list] ( identifier[df] . identifier[columns] ) identifier[columns] [ literal[int] ]= literal[...
def get_filename_extensions(url='https://www.webopedia.com/quick_ref/fileextensionsfull.asp'): """ Load a DataFrame of filename extensions from the indicated url >>> df = get_filename_extensions('https://www.openoffice.org/dev_docs/source/file_extensions.html') >>> df.head(2) ext ...
def compose_ants_transforms(transform_list): """ Compose multiple ANTsTransform's together ANTsR function: `composeAntsrTransforms` Arguments --------- transform_list : list/tuple of ANTsTransform object list of transforms to compose together Returns ------- ANTsTransform ...
def function[compose_ants_transforms, parameter[transform_list]]: constant[ Compose multiple ANTsTransform's together ANTsR function: `composeAntsrTransforms` Arguments --------- transform_list : list/tuple of ANTsTransform object list of transforms to compose together Returns...
keyword[def] identifier[compose_ants_transforms] ( identifier[transform_list] ): literal[string] identifier[precision] = identifier[transform_list] [ literal[int] ]. identifier[precision] identifier[dimension] = identifier[transform_list] [ literal[int] ]. identifier[dimension] keyword[for] i...
def compose_ants_transforms(transform_list): """ Compose multiple ANTsTransform's together ANTsR function: `composeAntsrTransforms` Arguments --------- transform_list : list/tuple of ANTsTransform object list of transforms to compose together Returns ------- ANTsTransform ...
def biopython_to_partials(alignment, datatype): """ Generate a partials dictionary from a treeCl.Alignment """ partials_dict = {} for seq in alignment: partials_dict[seq.name] = seq_to_partials(seq, datatype) return partials_dict
def function[biopython_to_partials, parameter[alignment, datatype]]: constant[ Generate a partials dictionary from a treeCl.Alignment ] variable[partials_dict] assign[=] dictionary[[], []] for taget[name[seq]] in starred[name[alignment]] begin[:] call[name[partials_dict]][name[se...
keyword[def] identifier[biopython_to_partials] ( identifier[alignment] , identifier[datatype] ): literal[string] identifier[partials_dict] ={} keyword[for] identifier[seq] keyword[in] identifier[alignment] : identifier[partials_dict] [ identifier[seq] . identifier[name] ]= identifier[seq_t...
def biopython_to_partials(alignment, datatype): """ Generate a partials dictionary from a treeCl.Alignment """ partials_dict = {} for seq in alignment: partials_dict[seq.name] = seq_to_partials(seq, datatype) # depends on [control=['for'], data=['seq']] return partials_dict
async def debug_text(self, texts: Union[str, list], positions: Union[list, set], color=(0, 255, 0), size_px=16): """ Deprecated, may be removed soon """ if isinstance(positions, (set, list)): if not positions: return if isinstance(texts, str): tex...
<ast.AsyncFunctionDef object at 0x7da18bc71120>
keyword[async] keyword[def] identifier[debug_text] ( identifier[self] , identifier[texts] : identifier[Union] [ identifier[str] , identifier[list] ], identifier[positions] : identifier[Union] [ identifier[list] , identifier[set] ], identifier[color] =( literal[int] , literal[int] , literal[int] ), identifier[size_px...
async def debug_text(self, texts: Union[str, list], positions: Union[list, set], color=(0, 255, 0), size_px=16): """ Deprecated, may be removed soon """ if isinstance(positions, (set, list)): if not positions: return # depends on [control=['if'], data=[]] if isinstance(texts, str): ...
def is_binary(self, component): """ especially useful for constraints tells whether any component (star, envelope) is part of a binary by checking its parent """ if component not in self._is_binary.keys(): self._update_cache() return self._is_binary....
def function[is_binary, parameter[self, component]]: constant[ especially useful for constraints tells whether any component (star, envelope) is part of a binary by checking its parent ] if compare[name[component] <ast.NotIn object at 0x7da2590d7190> call[name[self]._is_...
keyword[def] identifier[is_binary] ( identifier[self] , identifier[component] ): literal[string] keyword[if] identifier[component] keyword[not] keyword[in] identifier[self] . identifier[_is_binary] . identifier[keys] (): identifier[self] . identifier[_update_cache] () key...
def is_binary(self, component): """ especially useful for constraints tells whether any component (star, envelope) is part of a binary by checking its parent """ if component not in self._is_binary.keys(): self._update_cache() # depends on [control=['if'], data=[]] ...
def decipher(self,string,keep_punct=False): """Decipher string using Simple Substitution cipher according to initialised key. Example:: plaintext = SimpleSubstitution('AJPCZWRLFBDKOTYUQGENHXMIVS').decipher(ciphertext) :param string: The string to decipher. :param keep...
def function[decipher, parameter[self, string, keep_punct]]: constant[Decipher string using Simple Substitution cipher according to initialised key. Example:: plaintext = SimpleSubstitution('AJPCZWRLFBDKOTYUQGENHXMIVS').decipher(ciphertext) :param string: The string to deciph...
keyword[def] identifier[decipher] ( identifier[self] , identifier[string] , identifier[keep_punct] = keyword[False] ): literal[string] keyword[if] identifier[self] . identifier[invkey] == literal[string] : keyword[for] identifier[i] keyword[in] literal[string] : ...
def decipher(self, string, keep_punct=False): """Decipher string using Simple Substitution cipher according to initialised key. Example:: plaintext = SimpleSubstitution('AJPCZWRLFBDKOTYUQGENHXMIVS').decipher(ciphertext) :param string: The string to decipher. :param keep_p...
def signature(obj): '''Get a signature object for the passed callable.''' if not callable(obj): raise TypeError('{0!r} is not a callable object'.format(obj)) if isinstance(obj, types.MethodType): sig = signature(obj.__func__) if obj.__self__ is None: # Unbound method: t...
def function[signature, parameter[obj]]: constant[Get a signature object for the passed callable.] if <ast.UnaryOp object at 0x7da1b1817e50> begin[:] <ast.Raise object at 0x7da1b1817d90> if call[name[isinstance], parameter[name[obj], name[types].MethodType]] begin[:] vari...
keyword[def] identifier[signature] ( identifier[obj] ): literal[string] keyword[if] keyword[not] identifier[callable] ( identifier[obj] ): keyword[raise] identifier[TypeError] ( literal[string] . identifier[format] ( identifier[obj] )) keyword[if] identifier[isinstance] ( identifier[obj...
def signature(obj): """Get a signature object for the passed callable.""" if not callable(obj): raise TypeError('{0!r} is not a callable object'.format(obj)) # depends on [control=['if'], data=[]] if isinstance(obj, types.MethodType): sig = signature(obj.__func__) if obj.__self__ is...
def h(values): """ Function calculates entropy. values: list of integers """ ent = np.true_divide(values, np.sum(values)) return -np.sum(np.multiply(ent, np.log2(ent)))
def function[h, parameter[values]]: constant[ Function calculates entropy. values: list of integers ] variable[ent] assign[=] call[name[np].true_divide, parameter[name[values], call[name[np].sum, parameter[name[values]]]]] return[<ast.UnaryOp object at 0x7da1b2368e20>]
keyword[def] identifier[h] ( identifier[values] ): literal[string] identifier[ent] = identifier[np] . identifier[true_divide] ( identifier[values] , identifier[np] . identifier[sum] ( identifier[values] )) keyword[return] - identifier[np] . identifier[sum] ( identifier[np] . identifier[multiply] ( ide...
def h(values): """ Function calculates entropy. values: list of integers """ ent = np.true_divide(values, np.sum(values)) return -np.sum(np.multiply(ent, np.log2(ent)))
def index(method=None, delete=False): """Decorator to update index. :param method: Function wrapped. (Default: ``None``) :param delete: If `True` delete the indexed record. (Default: ``None``) """ if method is None: return partial(index, delete=delete) @wraps(method) def wrapper(se...
def function[index, parameter[method, delete]]: constant[Decorator to update index. :param method: Function wrapped. (Default: ``None``) :param delete: If `True` delete the indexed record. (Default: ``None``) ] if compare[name[method] is constant[None]] begin[:] return[call[name[par...
keyword[def] identifier[index] ( identifier[method] = keyword[None] , identifier[delete] = keyword[False] ): literal[string] keyword[if] identifier[method] keyword[is] keyword[None] : keyword[return] identifier[partial] ( identifier[index] , identifier[delete] = identifier[delete] ) @ ide...
def index(method=None, delete=False): """Decorator to update index. :param method: Function wrapped. (Default: ``None``) :param delete: If `True` delete the indexed record. (Default: ``None``) """ if method is None: return partial(index, delete=delete) # depends on [control=['if'], data=[]...
def elfhash(s): """ :param string: bytes >>> import base64 >>> s = base64.b64encode(b'hello world') >>> elfhash(s) 224648685 """ hash = 0 x = 0 for c in s: hash = (hash << 4) + c x = hash & 0xF0000000 if x: hash ^= (x >> 24) hash &...
def function[elfhash, parameter[s]]: constant[ :param string: bytes >>> import base64 >>> s = base64.b64encode(b'hello world') >>> elfhash(s) 224648685 ] variable[hash] assign[=] constant[0] variable[x] assign[=] constant[0] for taget[name[c]] in starred[name[s]]...
keyword[def] identifier[elfhash] ( identifier[s] ): literal[string] identifier[hash] = literal[int] identifier[x] = literal[int] keyword[for] identifier[c] keyword[in] identifier[s] : identifier[hash] =( identifier[hash] << literal[int] )+ identifier[c] identifier[x] = ide...
def elfhash(s): """ :param string: bytes >>> import base64 >>> s = base64.b64encode(b'hello world') >>> elfhash(s) 224648685 """ hash = 0 x = 0 for c in s: hash = (hash << 4) + c x = hash & 4026531840 if x: hash ^= x >> 24 hash &= ...
def divideSeries(requestContext, dividendSeriesList, divisorSeriesList): """ Takes a dividend metric and a divisor metric and draws the division result. A constant may *not* be passed. To divide by a constant, use the scale() function (which is essentially a multiplication operation) and use the inv...
def function[divideSeries, parameter[requestContext, dividendSeriesList, divisorSeriesList]]: constant[ Takes a dividend metric and a divisor metric and draws the division result. A constant may *not* be passed. To divide by a constant, use the scale() function (which is essentially a multiplication...
keyword[def] identifier[divideSeries] ( identifier[requestContext] , identifier[dividendSeriesList] , identifier[divisorSeriesList] ): literal[string] keyword[if] identifier[len] ( identifier[divisorSeriesList] )== literal[int] : keyword[for] identifier[series] keyword[in] identifier[dividendS...
def divideSeries(requestContext, dividendSeriesList, divisorSeriesList): """ Takes a dividend metric and a divisor metric and draws the division result. A constant may *not* be passed. To divide by a constant, use the scale() function (which is essentially a multiplication operation) and use the inv...
def runSearchContinuousSets(self, request): """ Returns a SearchContinuousSetsResponse for the specified SearchContinuousSetsRequest object. """ return self.runSearchRequest( request, protocol.SearchContinuousSetsRequest, protocol.SearchContinuousSetsRespo...
def function[runSearchContinuousSets, parameter[self, request]]: constant[ Returns a SearchContinuousSetsResponse for the specified SearchContinuousSetsRequest object. ] return[call[name[self].runSearchRequest, parameter[name[request], name[protocol].SearchContinuousSetsRequest, name...
keyword[def] identifier[runSearchContinuousSets] ( identifier[self] , identifier[request] ): literal[string] keyword[return] identifier[self] . identifier[runSearchRequest] ( identifier[request] , identifier[protocol] . identifier[SearchContinuousSetsRequest] , identifier[protoco...
def runSearchContinuousSets(self, request): """ Returns a SearchContinuousSetsResponse for the specified SearchContinuousSetsRequest object. """ return self.runSearchRequest(request, protocol.SearchContinuousSetsRequest, protocol.SearchContinuousSetsResponse, self.continuousSetsGenerator...
def set_orders(self, object_pks): """ Perform a mass update of sort_orders across the full queryset. Accepts a list, object_pks, of the intended order for the objects. Works as follows: - Compile a list of all sort orders in the queryset. Leave out anything that isn't ...
def function[set_orders, parameter[self, object_pks]]: constant[ Perform a mass update of sort_orders across the full queryset. Accepts a list, object_pks, of the intended order for the objects. Works as follows: - Compile a list of all sort orders in the queryset. Leave out any...
keyword[def] identifier[set_orders] ( identifier[self] , identifier[object_pks] ): literal[string] identifier[objects_to_sort] = identifier[self] . identifier[filter] ( identifier[pk__in] = identifier[object_pks] ) identifier[max_value] = identifier[self] . identifier[model] . identifier[o...
def set_orders(self, object_pks): """ Perform a mass update of sort_orders across the full queryset. Accepts a list, object_pks, of the intended order for the objects. Works as follows: - Compile a list of all sort orders in the queryset. Leave out anything that isn't in t...
def check_spam(self, ip=None, email=None, name=None, login=None, realname=None, subject=None, body=None, subject_type='plain', body_type='plain'): """ http://api.yandex.ru/cleanweb/doc/dg/concepts/check-spam.xml subject_type = plain|html|bbcode body_type = plain|html|b...
def function[check_spam, parameter[self, ip, email, name, login, realname, subject, body, subject_type, body_type]]: constant[ http://api.yandex.ru/cleanweb/doc/dg/concepts/check-spam.xml subject_type = plain|html|bbcode body_type = plain|html|bbcode ] variable[data] assi...
keyword[def] identifier[check_spam] ( identifier[self] , identifier[ip] = keyword[None] , identifier[email] = keyword[None] , identifier[name] = keyword[None] , identifier[login] = keyword[None] , identifier[realname] = keyword[None] , identifier[subject] = keyword[None] , identifier[body] = keyword[None] , identifi...
def check_spam(self, ip=None, email=None, name=None, login=None, realname=None, subject=None, body=None, subject_type='plain', body_type='plain'): """ http://api.yandex.ru/cleanweb/doc/dg/concepts/check-spam.xml subject_type = plain|html|bbcode body_type = plain|html|bbcode """ d...
def update_attribute(self, attr, value): """Set the value of a workspace attribute.""" update = [fapi._attr_up(attr, value)] r = fapi.update_workspace_attributes(self.namespace, self.name, update, self.api_url) fapi._check_response_code(r, 200...
def function[update_attribute, parameter[self, attr, value]]: constant[Set the value of a workspace attribute.] variable[update] assign[=] list[[<ast.Call object at 0x7da1b1ba8070>]] variable[r] assign[=] call[name[fapi].update_workspace_attributes, parameter[name[self].namespace, name[self].nam...
keyword[def] identifier[update_attribute] ( identifier[self] , identifier[attr] , identifier[value] ): literal[string] identifier[update] =[ identifier[fapi] . identifier[_attr_up] ( identifier[attr] , identifier[value] )] identifier[r] = identifier[fapi] . identifier[update_workspace_attr...
def update_attribute(self, attr, value): """Set the value of a workspace attribute.""" update = [fapi._attr_up(attr, value)] r = fapi.update_workspace_attributes(self.namespace, self.name, update, self.api_url) fapi._check_response_code(r, 200)
def cursor_pagedown(self, stats): """Set next page.""" if self._current_page + 1 < self._page_max: self._current_page += 1 else: self._current_page = 0 self.cursor_position = 0
def function[cursor_pagedown, parameter[self, stats]]: constant[Set next page.] if compare[binary_operation[name[self]._current_page + constant[1]] less[<] name[self]._page_max] begin[:] <ast.AugAssign object at 0x7da18eb547c0> name[self].cursor_position assign[=] constant[0]
keyword[def] identifier[cursor_pagedown] ( identifier[self] , identifier[stats] ): literal[string] keyword[if] identifier[self] . identifier[_current_page] + literal[int] < identifier[self] . identifier[_page_max] : identifier[self] . identifier[_current_page] += literal[int] ...
def cursor_pagedown(self, stats): """Set next page.""" if self._current_page + 1 < self._page_max: self._current_page += 1 # depends on [control=['if'], data=[]] else: self._current_page = 0 self.cursor_position = 0
def create_parser(arg_parser: ArgumentParser = None) -> ArgumentParser: """ Creates an argument parser populated with the arg formats for the server command. """ parser = arg_parser or ArgumentParser() parser.description = 'Cauldron kernel server' parser.add_argument( '-p', '--port...
def function[create_parser, parameter[arg_parser]]: constant[ Creates an argument parser populated with the arg formats for the server command. ] variable[parser] assign[=] <ast.BoolOp object at 0x7da18c4ce7a0> name[parser].description assign[=] constant[Cauldron kernel server] ...
keyword[def] identifier[create_parser] ( identifier[arg_parser] : identifier[ArgumentParser] = keyword[None] )-> identifier[ArgumentParser] : literal[string] identifier[parser] = identifier[arg_parser] keyword[or] identifier[ArgumentParser] () identifier[parser] . identifier[description] = literal[...
def create_parser(arg_parser: ArgumentParser=None) -> ArgumentParser: """ Creates an argument parser populated with the arg formats for the server command. """ parser = arg_parser or ArgumentParser() parser.description = 'Cauldron kernel server' parser.add_argument('-p', '--port', dest='port...
def select_eps(xmrs, nodeid=None, iv=None, label=None, pred=None): """ Return the list of matching elementary predications in *xmrs*. :class:`~delphin.mrs.components.ElementaryPredication` objects for *xmrs* match if their `nodeid` matches *nodeid*, `intrinsic_variable` matches *iv*, `label` matche...
def function[select_eps, parameter[xmrs, nodeid, iv, label, pred]]: constant[ Return the list of matching elementary predications in *xmrs*. :class:`~delphin.mrs.components.ElementaryPredication` objects for *xmrs* match if their `nodeid` matches *nodeid*, `intrinsic_variable` matches *iv*, `la...
keyword[def] identifier[select_eps] ( identifier[xmrs] , identifier[nodeid] = keyword[None] , identifier[iv] = keyword[None] , identifier[label] = keyword[None] , identifier[pred] = keyword[None] ): literal[string] identifier[epmatch] = keyword[lambda] identifier[n] :(( identifier[nodeid] keyword[is] ke...
def select_eps(xmrs, nodeid=None, iv=None, label=None, pred=None): """ Return the list of matching elementary predications in *xmrs*. :class:`~delphin.mrs.components.ElementaryPredication` objects for *xmrs* match if their `nodeid` matches *nodeid*, `intrinsic_variable` matches *iv*, `label` matche...
def hil_controls_encode(self, time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode): ''' Sent from autopilot to simulation. Hardware in the loop control outputs time_usec : Timestamp (micro...
def function[hil_controls_encode, parameter[self, time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode]]: constant[ Sent from autopilot to simulation. Hardware in the loop control outputs time_usec ...
keyword[def] identifier[hil_controls_encode] ( identifier[self] , identifier[time_usec] , identifier[roll_ailerons] , identifier[pitch_elevator] , identifier[yaw_rudder] , identifier[throttle] , identifier[aux1] , identifier[aux2] , identifier[aux3] , identifier[aux4] , identifier[mode] , identifier[nav_mode] ): ...
def hil_controls_encode(self, time_usec, roll_ailerons, pitch_elevator, yaw_rudder, throttle, aux1, aux2, aux3, aux4, mode, nav_mode): """ Sent from autopilot to simulation. Hardware in the loop control outputs time_usec : Timestamp (microseconds sinc...
def time_label(intvl, return_val=True): """Create time interval label for aospy data I/O.""" # Monthly labels are 2 digit integers: '01' for jan, '02' for feb, etc. if type(intvl) in [list, tuple, np.ndarray] and len(intvl) == 1: label = '{:02}'.format(intvl[0]) value = np.array(intvl) e...
def function[time_label, parameter[intvl, return_val]]: constant[Create time interval label for aospy data I/O.] if <ast.BoolOp object at 0x7da207f9a5c0> begin[:] variable[label] assign[=] call[constant[{:02}].format, parameter[call[name[intvl]][constant[0]]]] variable[va...
keyword[def] identifier[time_label] ( identifier[intvl] , identifier[return_val] = keyword[True] ): literal[string] keyword[if] identifier[type] ( identifier[intvl] ) keyword[in] [ identifier[list] , identifier[tuple] , identifier[np] . identifier[ndarray] ] keyword[and] identifier[len] ( identifier...
def time_label(intvl, return_val=True): """Create time interval label for aospy data I/O.""" # Monthly labels are 2 digit integers: '01' for jan, '02' for feb, etc. if type(intvl) in [list, tuple, np.ndarray] and len(intvl) == 1: label = '{:02}'.format(intvl[0]) value = np.array(intvl) # de...
def quat2Pitch(qw, qx, qy, qz): ''' Translates from Quaternion to Pitch. @param qw,qx,qy,qz: Quaternion values @type qw,qx,qy,qz: float @return Pitch value translated from Quaternion ''' rotateYa0=-2.0*(qx*qz - qw*qy) rotateY=0.0 if(rotateYa0 >= 1.0): rotateY = pi/2.0 ...
def function[quat2Pitch, parameter[qw, qx, qy, qz]]: constant[ Translates from Quaternion to Pitch. @param qw,qx,qy,qz: Quaternion values @type qw,qx,qy,qz: float @return Pitch value translated from Quaternion ] variable[rotateYa0] assign[=] binary_operation[<ast.UnaryOp object ...
keyword[def] identifier[quat2Pitch] ( identifier[qw] , identifier[qx] , identifier[qy] , identifier[qz] ): literal[string] identifier[rotateYa0] =- literal[int] *( identifier[qx] * identifier[qz] - identifier[qw] * identifier[qy] ) identifier[rotateY] = literal[int] keyword[if] ( identifier[rot...
def quat2Pitch(qw, qx, qy, qz): """ Translates from Quaternion to Pitch. @param qw,qx,qy,qz: Quaternion values @type qw,qx,qy,qz: float @return Pitch value translated from Quaternion """ rotateYa0 = -2.0 * (qx * qz - qw * qy) rotateY = 0.0 if rotateYa0 >= 1.0: rotateY = ...
def remove_blacklisted_filepaths(self, filepaths): """ Removes `filepaths` from blacklisted filepaths Recommend passing in absolute filepaths but method will attempt to convert to absolute filepaths based on current working directory. """ filepaths = util.to_absolute_pat...
def function[remove_blacklisted_filepaths, parameter[self, filepaths]]: constant[ Removes `filepaths` from blacklisted filepaths Recommend passing in absolute filepaths but method will attempt to convert to absolute filepaths based on current working directory. ] variabl...
keyword[def] identifier[remove_blacklisted_filepaths] ( identifier[self] , identifier[filepaths] ): literal[string] identifier[filepaths] = identifier[util] . identifier[to_absolute_paths] ( identifier[filepaths] ) identifier[black_paths] = identifier[self] . identifier[blacklisted_filepat...
def remove_blacklisted_filepaths(self, filepaths): """ Removes `filepaths` from blacklisted filepaths Recommend passing in absolute filepaths but method will attempt to convert to absolute filepaths based on current working directory. """ filepaths = util.to_absolute_paths(filep...
def children(self, as_resources=False): ''' method to return hierarchical children of this resource Args: as_resources (bool): if True, opens each as appropriate resource type instead of return URI only Returns: (list): list of resources ''' children = [o for s,p,o in self.rdf.graph.triples((None...
def function[children, parameter[self, as_resources]]: constant[ method to return hierarchical children of this resource Args: as_resources (bool): if True, opens each as appropriate resource type instead of return URI only Returns: (list): list of resources ] variable[children] assign[...
keyword[def] identifier[children] ( identifier[self] , identifier[as_resources] = keyword[False] ): literal[string] identifier[children] =[ identifier[o] keyword[for] identifier[s] , identifier[p] , identifier[o] keyword[in] identifier[self] . identifier[rdf] . identifier[graph] . identifier[triples] (( ...
def children(self, as_resources=False): """ method to return hierarchical children of this resource Args: as_resources (bool): if True, opens each as appropriate resource type instead of return URI only Returns: (list): list of resources """ children = [o for (s, p, o) in self.rdf.graph.triples...
def is_mdgel(self): """File has MD Gel format.""" # TODO: this likely reads the second page from file try: ismdgel = self.pages[0].is_mdgel or self.pages[1].is_mdgel if ismdgel: self.is_uniform = False return ismdgel except IndexError: ...
def function[is_mdgel, parameter[self]]: constant[File has MD Gel format.] <ast.Try object at 0x7da1b18aa9b0>
keyword[def] identifier[is_mdgel] ( identifier[self] ): literal[string] keyword[try] : identifier[ismdgel] = identifier[self] . identifier[pages] [ literal[int] ]. identifier[is_mdgel] keyword[or] identifier[self] . identifier[pages] [ literal[int] ]. identifier[is_mdgel] ...
def is_mdgel(self): """File has MD Gel format.""" # TODO: this likely reads the second page from file try: ismdgel = self.pages[0].is_mdgel or self.pages[1].is_mdgel if ismdgel: self.is_uniform = False # depends on [control=['if'], data=[]] return ismdgel # depends on [...
def set_r_value(self, r_var: str, *, notify_changed=True) -> None: """Used to signal changes to the ref var, which are kept in document controller. ugh.""" self.r_var = r_var self._description_changed() if notify_changed: # set to False to set the r-value at startup; avoid marking it as...
def function[set_r_value, parameter[self, r_var]]: constant[Used to signal changes to the ref var, which are kept in document controller. ugh.] name[self].r_var assign[=] name[r_var] call[name[self]._description_changed, parameter[]] if name[notify_changed] begin[:] call[...
keyword[def] identifier[set_r_value] ( identifier[self] , identifier[r_var] : identifier[str] ,*, identifier[notify_changed] = keyword[True] )-> keyword[None] : literal[string] identifier[self] . identifier[r_var] = identifier[r_var] identifier[self] . identifier[_description_changed] () ...
def set_r_value(self, r_var: str, *, notify_changed=True) -> None: """Used to signal changes to the ref var, which are kept in document controller. ugh.""" self.r_var = r_var self._description_changed() if notify_changed: # set to False to set the r-value at startup; avoid marking it as a change ...
async def build_verify_payment_req(wallet_handle: int, submitter_did: str, receipt: str) -> (str, str): """ Builds Indy request for information to verify the payment receipt :param wallet_handle: wallet handle (created by open_wallet). ...
<ast.AsyncFunctionDef object at 0x7da18eb55090>
keyword[async] keyword[def] identifier[build_verify_payment_req] ( identifier[wallet_handle] : identifier[int] , identifier[submitter_did] : identifier[str] , identifier[receipt] : identifier[str] )->( identifier[str] , identifier[str] ): literal[string] identifier[logger] = identifier[logging] . ident...
async def build_verify_payment_req(wallet_handle: int, submitter_did: str, receipt: str) -> (str, str): """ Builds Indy request for information to verify the payment receipt :param wallet_handle: wallet handle (created by open_wallet). :param submitter_did : (Option) DID of request sender :param re...
def get_network_settings(): ''' Return the contents of the global network script. CLI Example: .. code-block:: bash salt '*' ip.get_network_settings ''' skip_etc_default_networking = ( __grains__['osfullname'] == 'Ubuntu' and int(__grains__['osrelease'].split('.')[0]) ...
def function[get_network_settings, parameter[]]: constant[ Return the contents of the global network script. CLI Example: .. code-block:: bash salt '*' ip.get_network_settings ] variable[skip_etc_default_networking] assign[=] <ast.BoolOp object at 0x7da1b2036500> if na...
keyword[def] identifier[get_network_settings] (): literal[string] identifier[skip_etc_default_networking] =( identifier[__grains__] [ literal[string] ]== literal[string] keyword[and] identifier[int] ( identifier[__grains__] [ literal[string] ]. identifier[split] ( literal[string] )[ literal[int...
def get_network_settings(): """ Return the contents of the global network script. CLI Example: .. code-block:: bash salt '*' ip.get_network_settings """ skip_etc_default_networking = __grains__['osfullname'] == 'Ubuntu' and int(__grains__['osrelease'].split('.')[0]) >= 12 if skip_...
def _ts_value(position, counts, bkg, model, C_0_map): """ Compute TS value at a given pixel position using the approach described in Stewart (2009). Parameters ---------- position : tuple Pixel position. counts : `~numpy.ndarray` Count map. bkg : `~numpy.ndarray` ...
def function[_ts_value, parameter[position, counts, bkg, model, C_0_map]]: constant[ Compute TS value at a given pixel position using the approach described in Stewart (2009). Parameters ---------- position : tuple Pixel position. counts : `~numpy.ndarray` Count map. ...
keyword[def] identifier[_ts_value] ( identifier[position] , identifier[counts] , identifier[bkg] , identifier[model] , identifier[C_0_map] ): literal[string] identifier[extract_fn] = identifier[_collect_wrapper] ( identifier[extract_large_array] ) identifier[truncate_fn] = identifier[_collect_wrapper]...
def _ts_value(position, counts, bkg, model, C_0_map): """ Compute TS value at a given pixel position using the approach described in Stewart (2009). Parameters ---------- position : tuple Pixel position. counts : `~numpy.ndarray` Count map. bkg : `~numpy.ndarray` ...
def show(self): """Shows the new colors on the pixels themselves if they haven't already been autowritten. The colors may or may not be showing after this function returns because it may be done asynchronously.""" if self.brightness > 0.99: neopixel_write(self.pin, s...
def function[show, parameter[self]]: constant[Shows the new colors on the pixels themselves if they haven't already been autowritten. The colors may or may not be showing after this function returns because it may be done asynchronously.] if compare[name[self].brightness greater...
keyword[def] identifier[show] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[brightness] > literal[int] : identifier[neopixel_write] ( identifier[self] . identifier[pin] , identifier[self] . identifier[buf] ) keyword[else] : ident...
def show(self): """Shows the new colors on the pixels themselves if they haven't already been autowritten. The colors may or may not be showing after this function returns because it may be done asynchronously.""" if self.brightness > 0.99: neopixel_write(self.pin, self.buf) # ...
def runCLI(): """ The starting point for the execution of the Scrapple command line tool. runCLI uses the docstring as the usage description for the scrapple command. \ The class for the required command is selected by a dynamic dispatch, and the \ command is executed through the execute_command() ...
def function[runCLI, parameter[]]: constant[ The starting point for the execution of the Scrapple command line tool. runCLI uses the docstring as the usage description for the scrapple command. The class for the required command is selected by a dynamic dispatch, and the command is executed thr...
keyword[def] identifier[runCLI] (): literal[string] identifier[args] = identifier[docopt] ( identifier[__doc__] , identifier[version] = literal[string] ) keyword[try] : identifier[check_arguments] ( identifier[args] ) identifier[command_list] =[ literal[string] , literal[string] , li...
def runCLI(): """ The starting point for the execution of the Scrapple command line tool. runCLI uses the docstring as the usage description for the scrapple command. The class for the required command is selected by a dynamic dispatch, and the command is executed through the execute_command() meth...
def delete(self): """ Destructor. """ if self.maplesat: pysolvers.maplecm_del(self.maplesat) self.maplesat = None if self.prfile: self.prfile.close()
def function[delete, parameter[self]]: constant[ Destructor. ] if name[self].maplesat begin[:] call[name[pysolvers].maplecm_del, parameter[name[self].maplesat]] name[self].maplesat assign[=] constant[None] if name[self].prfile begin[:] ...
keyword[def] identifier[delete] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[maplesat] : identifier[pysolvers] . identifier[maplecm_del] ( identifier[self] . identifier[maplesat] ) identifier[self] . identifier[maplesat] = keyword[None]...
def delete(self): """ Destructor. """ if self.maplesat: pysolvers.maplecm_del(self.maplesat) self.maplesat = None if self.prfile: self.prfile.close() # depends on [control=['if'], data=[]] # depends on [control=['if'], data=[]]
def _error(self, exc_info): """ Retrieves the error info """ if self.exc_info: if self.traceback: return exc_info return exc_info[:2] return exc_info[1]
def function[_error, parameter[self, exc_info]]: constant[ Retrieves the error info ] if name[self].exc_info begin[:] if name[self].traceback begin[:] return[name[exc_info]] return[call[name[exc_info]][<ast.Slice object at 0x7da2041db4f0>]] return[call[name[exc_in...
keyword[def] identifier[_error] ( identifier[self] , identifier[exc_info] ): literal[string] keyword[if] identifier[self] . identifier[exc_info] : keyword[if] identifier[self] . identifier[traceback] : keyword[return] identifier[exc_info] keyword[...
def _error(self, exc_info): """ Retrieves the error info """ if self.exc_info: if self.traceback: return exc_info # depends on [control=['if'], data=[]] return exc_info[:2] # depends on [control=['if'], data=[]] return exc_info[1]
def add_predicate(self, name: str, function: Callable, side_arguments: List[str] = None): """ Adds a predicate to this domain language. Typically you do this with the ``@predicate`` decorator on the methods in your class. But, if you need to for whatever reason, you can also call this ...
def function[add_predicate, parameter[self, name, function, side_arguments]]: constant[ Adds a predicate to this domain language. Typically you do this with the ``@predicate`` decorator on the methods in your class. But, if you need to for whatever reason, you can also call this functi...
keyword[def] identifier[add_predicate] ( identifier[self] , identifier[name] : identifier[str] , identifier[function] : identifier[Callable] , identifier[side_arguments] : identifier[List] [ identifier[str] ]= keyword[None] ): literal[string] identifier[side_arguments] = identifier[side_arguments] ...
def add_predicate(self, name: str, function: Callable, side_arguments: List[str]=None): """ Adds a predicate to this domain language. Typically you do this with the ``@predicate`` decorator on the methods in your class. But, if you need to for whatever reason, you can also call this functi...
def encodeThetas(self, theta1, theta2): """Return the SDR for theta1 and theta2""" # print >> sys.stderr, "encoded theta1 value = ", theta1 # print >> sys.stderr, "encoded theta2 value = ", theta2 t1e = self.theta1Encoder.encode(theta1) t2e = self.theta2Encoder.encode(theta2) # print >> sys.stde...
def function[encodeThetas, parameter[self, theta1, theta2]]: constant[Return the SDR for theta1 and theta2] variable[t1e] assign[=] call[name[self].theta1Encoder.encode, parameter[name[theta1]]] variable[t2e] assign[=] call[name[self].theta2Encoder.encode, parameter[name[theta2]]] variab...
keyword[def] identifier[encodeThetas] ( identifier[self] , identifier[theta1] , identifier[theta2] ): literal[string] identifier[t1e] = identifier[self] . identifier[theta1Encoder] . identifier[encode] ( identifier[theta1] ) identifier[t2e] = identifier[self] . identifier[theta2Encoder] . id...
def encodeThetas(self, theta1, theta2): """Return the SDR for theta1 and theta2""" # print >> sys.stderr, "encoded theta1 value = ", theta1 # print >> sys.stderr, "encoded theta2 value = ", theta2 t1e = self.theta1Encoder.encode(theta1) t2e = self.theta2Encoder.encode(theta2) # print >> sys.stde...
def parse_seeds_xml(root): """ Parse <seeds> element in the UBCPI XBlock's content XML. Args: root (lxml.etree.Element): The root of the <seeds> node in the tree. Returns: a list of deserialized representation of seeds. E.g. [{ 'answer': 1, # option index starting ...
def function[parse_seeds_xml, parameter[root]]: constant[ Parse <seeds> element in the UBCPI XBlock's content XML. Args: root (lxml.etree.Element): The root of the <seeds> node in the tree. Returns: a list of deserialized representation of seeds. E.g. [{ 'answer...
keyword[def] identifier[parse_seeds_xml] ( identifier[root] ): literal[string] identifier[seeds] =[] keyword[for] identifier[seed_el] keyword[in] identifier[root] . identifier[findall] ( literal[string] ): identifier[seed_dict] = identifier[dict] () identifier[seed_dict] [ litera...
def parse_seeds_xml(root): """ Parse <seeds> element in the UBCPI XBlock's content XML. Args: root (lxml.etree.Element): The root of the <seeds> node in the tree. Returns: a list of deserialized representation of seeds. E.g. [{ 'answer': 1, # option index starting ...
def walk_and_clean(data): """ Recursively walks list of dicts (which may themselves embed lists and dicts), transforming namedtuples to OrderedDicts and using ``clean_key_name(k)`` to make keys into SQL-safe column names >>> data = [{'a': 1}, [{'B': 2}, {'B': 3}], {'F': {'G': 4}}] >>> pprint(wa...
def function[walk_and_clean, parameter[data]]: constant[ Recursively walks list of dicts (which may themselves embed lists and dicts), transforming namedtuples to OrderedDicts and using ``clean_key_name(k)`` to make keys into SQL-safe column names >>> data = [{'a': 1}, [{'B': 2}, {'B': 3}], {'F...
keyword[def] identifier[walk_and_clean] ( identifier[data] ): literal[string] keyword[if] identifier[hasattr] ( identifier[data] , literal[string] ): identifier[data] = identifier[OrderedDict] (( identifier[k] , identifier[v] ) keyword[for] ( identifier[k] , identifier[v] ) keyword[in] iden...
def walk_and_clean(data): """ Recursively walks list of dicts (which may themselves embed lists and dicts), transforming namedtuples to OrderedDicts and using ``clean_key_name(k)`` to make keys into SQL-safe column names >>> data = [{'a': 1}, [{'B': 2}, {'B': 3}], {'F': {'G': 4}}] >>> pprint(wa...
def _format_line(headers, fields): """Format a line of a table. Arguments: headers: A list of strings that are used as the table headers. fields: A list of the same length as `headers` where `fields[i]` is the entry for `headers[i]` in this row. Elements can be of arbitrary types. Pass `headers...
def function[_format_line, parameter[headers, fields]]: constant[Format a line of a table. Arguments: headers: A list of strings that are used as the table headers. fields: A list of the same length as `headers` where `fields[i]` is the entry for `headers[i]` in this row. Elements can be of ...
keyword[def] identifier[_format_line] ( identifier[headers] , identifier[fields] ): literal[string] keyword[assert] identifier[len] ( identifier[fields] )== identifier[len] ( identifier[headers] ),( identifier[fields] , identifier[headers] ) identifier[fields] =[ literal[string] % identifier[field] keywor...
def _format_line(headers, fields): """Format a line of a table. Arguments: headers: A list of strings that are used as the table headers. fields: A list of the same length as `headers` where `fields[i]` is the entry for `headers[i]` in this row. Elements can be of arbitrary types. Pass `heade...
def update(self, stats, duration=3, cs_status=None, return_to_browser=False): """Update the screen. INPUT stats: Stats database to display duration: duration of the loop cs_status: "None": standalone or serv...
def function[update, parameter[self, stats, duration, cs_status, return_to_browser]]: constant[Update the screen. INPUT stats: Stats database to display duration: duration of the loop cs_status: "None": standalone or server mode "Connected": Client is con...
keyword[def] identifier[update] ( identifier[self] , identifier[stats] , identifier[duration] = literal[int] , identifier[cs_status] = keyword[None] , identifier[return_to_browser] = keyword[False] ): literal[string] identifier[self] . identifier[flush] ( identifier[stats] , identifier...
def update(self, stats, duration=3, cs_status=None, return_to_browser=False): """Update the screen. INPUT stats: Stats database to display duration: duration of the loop cs_status: "None": standalone or server mode "Connected": Client is connected to the serv...
def unnest_collection(collection, df_list): """Unnest collection structure extracting all its datasets and converting \ them to Pandas Dataframes. Args: collection (OrderedDict): data in JSON-stat format, previously \ deserialized to a python objec...
def function[unnest_collection, parameter[collection, df_list]]: constant[Unnest collection structure extracting all its datasets and converting them to Pandas Dataframes. Args: collection (OrderedDict): data in JSON-stat format, previously des...
keyword[def] identifier[unnest_collection] ( identifier[collection] , identifier[df_list] ): literal[string] keyword[for] identifier[item] keyword[in] identifier[collection] [ literal[string] ][ literal[string] ]: keyword[if] identifier[item] [ literal[string] ]== literal[string] : ...
def unnest_collection(collection, df_list): """Unnest collection structure extracting all its datasets and converting them to Pandas Dataframes. Args: collection (OrderedDict): data in JSON-stat format, previously deserialized to a python object by...
def errors(): """Error view in case of invalid oauth requests.""" from oauthlib.oauth2.rfc6749.errors import raise_from_error try: error = None raise_from_error(request.values.get('error'), params=dict()) except OAuth2Error as raised: error = raised return render_template('in...
def function[errors, parameter[]]: constant[Error view in case of invalid oauth requests.] from relative_module[oauthlib.oauth2.rfc6749.errors] import module[raise_from_error] <ast.Try object at 0x7da1b2500dc0> return[call[name[render_template], parameter[constant[invenio_oauth2server/errors.html]]]...
keyword[def] identifier[errors] (): literal[string] keyword[from] identifier[oauthlib] . identifier[oauth2] . identifier[rfc6749] . identifier[errors] keyword[import] identifier[raise_from_error] keyword[try] : identifier[error] = keyword[None] identifier[raise_from_error] ( ide...
def errors(): """Error view in case of invalid oauth requests.""" from oauthlib.oauth2.rfc6749.errors import raise_from_error try: error = None raise_from_error(request.values.get('error'), params=dict()) # depends on [control=['try'], data=[]] except OAuth2Error as raised: erro...
def snmp_server_host_community(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") snmp_server = ET.SubElement(config, "snmp-server", xmlns="urn:brocade.com:mgmt:brocade-snmp") host = ET.SubElement(snmp_server, "host") ip_key = ET.SubElement(host, "i...
def function[snmp_server_host_community, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[snmp_server] assign[=] call[name[ET].SubElement, parameter[name[config], constant[snmp-server]]] varia...
keyword[def] identifier[snmp_server_host_community] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[snmp_server] = identifier[ET] . identifier[SubElement] ( identifier[config] , literal[st...
def snmp_server_host_community(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') snmp_server = ET.SubElement(config, 'snmp-server', xmlns='urn:brocade.com:mgmt:brocade-snmp') host = ET.SubElement(snmp_server, 'host') ip_key = ET.SubElement(host, 'ip') ip_key.text ...
def mapToAbsPosition(self, line, column): """Convert line and column number to absolute position """ block = self.document().findBlockByNumber(line) if not block.isValid(): raise IndexError("Invalid line index %d" % line) if column >= block.length(): raise...
def function[mapToAbsPosition, parameter[self, line, column]]: constant[Convert line and column number to absolute position ] variable[block] assign[=] call[call[name[self].document, parameter[]].findBlockByNumber, parameter[name[line]]] if <ast.UnaryOp object at 0x7da18f58c700> begin[:]...
keyword[def] identifier[mapToAbsPosition] ( identifier[self] , identifier[line] , identifier[column] ): literal[string] identifier[block] = identifier[self] . identifier[document] (). identifier[findBlockByNumber] ( identifier[line] ) keyword[if] keyword[not] identifier[block] . identifi...
def mapToAbsPosition(self, line, column): """Convert line and column number to absolute position """ block = self.document().findBlockByNumber(line) if not block.isValid(): raise IndexError('Invalid line index %d' % line) # depends on [control=['if'], data=[]] if column >= block.length(...
def add_child(self, child=None, name=None, dist=None, support=None): """ Adds a new child to this node. If child node is not suplied as an argument, a new node instance will be created. Parameters ---------- child: the node instance to be added as a...
def function[add_child, parameter[self, child, name, dist, support]]: constant[ Adds a new child to this node. If child node is not suplied as an argument, a new node instance will be created. Parameters ---------- child: the node instance to be add...
keyword[def] identifier[add_child] ( identifier[self] , identifier[child] = keyword[None] , identifier[name] = keyword[None] , identifier[dist] = keyword[None] , identifier[support] = keyword[None] ): literal[string] keyword[if] identifier[child] keyword[is] keyword[None] : identif...
def add_child(self, child=None, name=None, dist=None, support=None): """ Adds a new child to this node. If child node is not suplied as an argument, a new node instance will be created. Parameters ---------- child: the node instance to be added as a chi...
def _cache_file(self, src_path): """ Load the data from `self._xml_roots` for `src_path`, if it hasn't been already. """ # If we have not yet loaded this source file if src_path not in self._info_cache: # We only want to keep violations that show up in each xm...
def function[_cache_file, parameter[self, src_path]]: constant[ Load the data from `self._xml_roots` for `src_path`, if it hasn't been already. ] if compare[name[src_path] <ast.NotIn object at 0x7da2590d7190> name[self]._info_cache] begin[:] variable[violations] a...
keyword[def] identifier[_cache_file] ( identifier[self] , identifier[src_path] ): literal[string] keyword[if] identifier[src_path] keyword[not] keyword[in] identifier[self] . identifier[_info_cache] : identifier[violations] = keyword[Non...
def _cache_file(self, src_path): """ Load the data from `self._xml_roots` for `src_path`, if it hasn't been already. """ # If we have not yet loaded this source file if src_path not in self._info_cache: # We only want to keep violations that show up in each xml source. ...
def wait_for_logs_matching(container, matcher, timeout=10, encoding='utf-8', **logs_kwargs): """ Wait for matching log line(s) from the given container by streaming the container's stdout and/or stderr outputs. Each log line is decoded and any trailing whitespace is stripped ...
def function[wait_for_logs_matching, parameter[container, matcher, timeout, encoding]]: constant[ Wait for matching log line(s) from the given container by streaming the container's stdout and/or stderr outputs. Each log line is decoded and any trailing whitespace is stripped before the line is...
keyword[def] identifier[wait_for_logs_matching] ( identifier[container] , identifier[matcher] , identifier[timeout] = literal[int] , identifier[encoding] = literal[string] , ** identifier[logs_kwargs] ): literal[string] keyword[try] : keyword[for] identifier[line] keyword[in] identifier[stream_...
def wait_for_logs_matching(container, matcher, timeout=10, encoding='utf-8', **logs_kwargs): """ Wait for matching log line(s) from the given container by streaming the container's stdout and/or stderr outputs. Each log line is decoded and any trailing whitespace is stripped before the line is matc...
def send_duplicate_notification(self): """ Send a notification about a duplicate signup. """ email_utils.send_email( from_email=settings.DEFAULT_FROM_EMAIL, recipient_list=[self.email], subject=_("Registration Attempt"), template_name="rest...
def function[send_duplicate_notification, parameter[self]]: constant[ Send a notification about a duplicate signup. ] call[name[email_utils].send_email, parameter[]] call[name[logger].info, parameter[constant[Sent duplicate email notification to: %s], name[self].email]]
keyword[def] identifier[send_duplicate_notification] ( identifier[self] ): literal[string] identifier[email_utils] . identifier[send_email] ( identifier[from_email] = identifier[settings] . identifier[DEFAULT_FROM_EMAIL] , identifier[recipient_list] =[ identifier[self] . identifie...
def send_duplicate_notification(self): """ Send a notification about a duplicate signup. """ email_utils.send_email(from_email=settings.DEFAULT_FROM_EMAIL, recipient_list=[self.email], subject=_('Registration Attempt'), template_name='rest_email_auth/emails/duplicate-email') logger.info('Sen...
def TransferFrom(self, wallet, from_addr, to_addr, amount): """ Transfer a specified amount of a token from the wallet specified in the `from_addr` to the `to_addr` if the originator `wallet` has been approved to do so. Args: wallet (neo.Wallets.Wallet): a wallet instance. ...
def function[TransferFrom, parameter[self, wallet, from_addr, to_addr, amount]]: constant[ Transfer a specified amount of a token from the wallet specified in the `from_addr` to the `to_addr` if the originator `wallet` has been approved to do so. Args: wallet (neo.Wallets.Wa...
keyword[def] identifier[TransferFrom] ( identifier[self] , identifier[wallet] , identifier[from_addr] , identifier[to_addr] , identifier[amount] ): literal[string] identifier[invoke_args] =[ identifier[self] . identifier[ScriptHash] . identifier[ToString] (), literal[string] , [ identifier[...
def TransferFrom(self, wallet, from_addr, to_addr, amount): """ Transfer a specified amount of a token from the wallet specified in the `from_addr` to the `to_addr` if the originator `wallet` has been approved to do so. Args: wallet (neo.Wallets.Wallet): a wallet instance. ...
def parse_iso_utc(s): """ Parses an ISO time with a hard-coded Z for zulu-time (UTC) at the end. Other timezones are not supported. :param str s: the ISO-formatted time :rtype: datetime.datetime :return: an timezone-naive datetime object >>> parse_iso_utc('2016-04-27T00:28:04.000Z') ...
def function[parse_iso_utc, parameter[s]]: constant[ Parses an ISO time with a hard-coded Z for zulu-time (UTC) at the end. Other timezones are not supported. :param str s: the ISO-formatted time :rtype: datetime.datetime :return: an timezone-naive datetime object >>> parse_iso_utc('...
keyword[def] identifier[parse_iso_utc] ( identifier[s] ): literal[string] identifier[m] = identifier[rfc3339_datetime_re] (). identifier[match] ( identifier[s] ) keyword[if] keyword[not] identifier[m] : keyword[raise] identifier[ValueError] ( literal[string] + identifier[s] ) keyword[...
def parse_iso_utc(s): """ Parses an ISO time with a hard-coded Z for zulu-time (UTC) at the end. Other timezones are not supported. :param str s: the ISO-formatted time :rtype: datetime.datetime :return: an timezone-naive datetime object >>> parse_iso_utc('2016-04-27T00:28:04.000Z') ...
def list_buckets(self): '''List all buckets''' result = [] for bucket in self.s3.list_buckets().get('Buckets') or []: result.append({ 'name': S3URL.combine('s3', bucket['Name'], ''), 'is_dir': True, 'size': 0, 'last_modified': bucket['CreationDate'] }) ...
def function[list_buckets, parameter[self]]: constant[List all buckets] variable[result] assign[=] list[[]] for taget[name[bucket]] in starred[<ast.BoolOp object at 0x7da1b0284c70>] begin[:] call[name[result].append, parameter[dictionary[[<ast.Constant object at 0x7da1b0317b20>, ...
keyword[def] identifier[list_buckets] ( identifier[self] ): literal[string] identifier[result] =[] keyword[for] identifier[bucket] keyword[in] identifier[self] . identifier[s3] . identifier[list_buckets] (). identifier[get] ( literal[string] ) keyword[or] []: identifier[result] . identifier[...
def list_buckets(self): """List all buckets""" result = [] for bucket in self.s3.list_buckets().get('Buckets') or []: result.append({'name': S3URL.combine('s3', bucket['Name'], ''), 'is_dir': True, 'size': 0, 'last_modified': bucket['CreationDate']}) # depends on [control=['for'], data=['bucket']] ...
def readstream(self, stream): """ Reads the specified stream and parses the token elements generated from tokenizing the input data. `stream` ``File``-like object. Returns boolean. """ self._reset() try: # tokenize i...
def function[readstream, parameter[self, stream]]: constant[ Reads the specified stream and parses the token elements generated from tokenizing the input data. `stream` ``File``-like object. Returns boolean. ] call[name[self]._reset, para...
keyword[def] identifier[readstream] ( identifier[self] , identifier[stream] ): literal[string] identifier[self] . identifier[_reset] () keyword[try] : identifier[self] . identifier[_lexer] = identifier[SettingLexer] () identifier[self] . identifier[_lex...
def readstream(self, stream): """ Reads the specified stream and parses the token elements generated from tokenizing the input data. `stream` ``File``-like object. Returns boolean. """ self._reset() try: # tokenize input stream ...
def _get_normal_name(orig_enc): """Imitates get_normal_name in tokenizer.c.""" # Only care about the first 12 characters. enc = orig_enc[:12].lower().replace("_", "-") if enc == "utf-8" or enc.startswith("utf-8-"): return "utf-8" if enc in ("latin-1", "iso-8859-1", "iso-latin-1") or \ ...
def function[_get_normal_name, parameter[orig_enc]]: constant[Imitates get_normal_name in tokenizer.c.] variable[enc] assign[=] call[call[call[name[orig_enc]][<ast.Slice object at 0x7da204621840>].lower, parameter[]].replace, parameter[constant[_], constant[-]]] if <ast.BoolOp object at 0x7da204...
keyword[def] identifier[_get_normal_name] ( identifier[orig_enc] ): literal[string] identifier[enc] = identifier[orig_enc] [: literal[int] ]. identifier[lower] (). identifier[replace] ( literal[string] , literal[string] ) keyword[if] identifier[enc] == literal[string] keyword[or] identifier[en...
def _get_normal_name(orig_enc): """Imitates get_normal_name in tokenizer.c.""" # Only care about the first 12 characters. enc = orig_enc[:12].lower().replace('_', '-') if enc == 'utf-8' or enc.startswith('utf-8-'): return 'utf-8' # depends on [control=['if'], data=[]] if enc in ('latin-1', ...
def styblinski_tang(theta): """Styblinski-Tang function""" x, y = theta obj = 0.5 * (x ** 4 - 16 * x ** 2 + 5 * x + y ** 4 - 16 * y ** 2 + 5 * y) grad = np.array([ 2 * x ** 3 - 16 * x + 2.5, 2 * y ** 3 - 16 * y + 2.5, ]) return obj, grad
def function[styblinski_tang, parameter[theta]]: constant[Styblinski-Tang function] <ast.Tuple object at 0x7da1b0089b70> assign[=] name[theta] variable[obj] assign[=] binary_operation[constant[0.5] * binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_oper...
keyword[def] identifier[styblinski_tang] ( identifier[theta] ): literal[string] identifier[x] , identifier[y] = identifier[theta] identifier[obj] = literal[int] *( identifier[x] ** literal[int] - literal[int] * identifier[x] ** literal[int] + literal[int] * identifier[x] + identifier[y] ** literal[in...
def styblinski_tang(theta): """Styblinski-Tang function""" (x, y) = theta obj = 0.5 * (x ** 4 - 16 * x ** 2 + 5 * x + y ** 4 - 16 * y ** 2 + 5 * y) grad = np.array([2 * x ** 3 - 16 * x + 2.5, 2 * y ** 3 - 16 * y + 2.5]) return (obj, grad)
def match_field(self, field, value, required=True, new_group=False): """Add a ``field:value`` term to the query. Matches will have the ``value`` in the ``field``. Arguments: field (str): The field to check for the value. The field must be namespaced according to ...
def function[match_field, parameter[self, field, value, required, new_group]]: constant[Add a ``field:value`` term to the query. Matches will have the ``value`` in the ``field``. Arguments: field (str): The field to check for the value. The field must be namespac...
keyword[def] identifier[match_field] ( identifier[self] , identifier[field] , identifier[value] , identifier[required] = keyword[True] , identifier[new_group] = keyword[False] ): literal[string] keyword[if] identifier[self] . identifier[initialized] : keyword[if] identifier[...
def match_field(self, field, value, required=True, new_group=False): """Add a ``field:value`` term to the query. Matches will have the ``value`` in the ``field``. Arguments: field (str): The field to check for the value. The field must be namespaced according to Elas...
def report_version(self, data): """ This method processes the report version message, sent asynchronously by Firmata when it starts up or after refresh_report_version() is called Use the api method api_get_version to retrieve this information :param data: Message data ...
def function[report_version, parameter[self, data]]: constant[ This method processes the report version message, sent asynchronously by Firmata when it starts up or after refresh_report_version() is called Use the api method api_get_version to retrieve this information ...
keyword[def] identifier[report_version] ( identifier[self] , identifier[data] ): literal[string] identifier[self] . identifier[firmata_version] . identifier[append] ( identifier[data] [ literal[int] ]) identifier[self] . identifier[firmata_version] . identifier[append] ( identifier[data] [...
def report_version(self, data): """ This method processes the report version message, sent asynchronously by Firmata when it starts up or after refresh_report_version() is called Use the api method api_get_version to retrieve this information :param data: Message data from...
def foldr(f, seq, default=_no_default): """Fold a function over a sequence with right associativity. Parameters ---------- f : callable[any, any] The function to reduce the sequence with. The first argument will be the element of the sequence; the second argument will be the acc...
def function[foldr, parameter[f, seq, default]]: constant[Fold a function over a sequence with right associativity. Parameters ---------- f : callable[any, any] The function to reduce the sequence with. The first argument will be the element of the sequence; the second argum...
keyword[def] identifier[foldr] ( identifier[f] , identifier[seq] , identifier[default] = identifier[_no_default] ): literal[string] keyword[return] identifier[reduce] ( identifier[flip] ( identifier[f] ), identifier[reversed] ( identifier[seq] ), *( identifier[default] ,) keyword[if] identi...
def foldr(f, seq, default=_no_default): """Fold a function over a sequence with right associativity. Parameters ---------- f : callable[any, any] The function to reduce the sequence with. The first argument will be the element of the sequence; the second argument will be the acc...
def findTargets(self): ''' Finds the target Views (i.e. for touches). ''' if DEBUG: print >> sys.stderr, "findTargets()" LISTVIEW_CLASS = 'android.widget.ListView' ''' The ListView class name ''' self.targets = [] ''' The list of target coordi...
def function[findTargets, parameter[self]]: constant[ Finds the target Views (i.e. for touches). ] if name[DEBUG] begin[:] tuple[[<ast.BinOp object at 0x7da1b1da2440>, <ast.Constant object at 0x7da1b1da3400>]] variable[LISTVIEW_CLASS] assign[=] constant[android.wi...
keyword[def] identifier[findTargets] ( identifier[self] ): literal[string] keyword[if] identifier[DEBUG] : identifier[print] >> identifier[sys] . identifier[stderr] , literal[string] identifier[LISTVIEW_CLASS] = literal[string] literal[string] identifier...
def findTargets(self): """ Finds the target Views (i.e. for touches). """ if DEBUG: (print >> sys.stderr, 'findTargets()') # depends on [control=['if'], data=[]] LISTVIEW_CLASS = 'android.widget.ListView' ' The ListView class name ' self.targets = [] ' The list of target...
def step(self, data): """ Run convolution over a single position. The data must be exactly as wide as the convolution filters. :param data: Shape: (batch_size, kernel_width, num_hidden). :return: Single result of a convolution. Shape: (batch_size, 1, num_hidden). """ # ...
def function[step, parameter[self, data]]: constant[ Run convolution over a single position. The data must be exactly as wide as the convolution filters. :param data: Shape: (batch_size, kernel_width, num_hidden). :return: Single result of a convolution. Shape: (batch_size, 1, num_hidde...
keyword[def] identifier[step] ( identifier[self] , identifier[data] ): literal[string] identifier[num_hidden] = identifier[self] . identifier[_pre_activation_num_hidden] () identifier[data] = identifier[mx] . identifier[sym] . identifier[swapaxes] ( i...
def step(self, data): """ Run convolution over a single position. The data must be exactly as wide as the convolution filters. :param data: Shape: (batch_size, kernel_width, num_hidden). :return: Single result of a convolution. Shape: (batch_size, 1, num_hidden). """ # As we onl...
def change_contact_host_notification_timeperiod(self, contact, notification_timeperiod): """Change contact host notification timeperiod value Format of the line that triggers function call:: CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD;<contact_name>;<notification_timeperiod> :param con...
def function[change_contact_host_notification_timeperiod, parameter[self, contact, notification_timeperiod]]: constant[Change contact host notification timeperiod value Format of the line that triggers function call:: CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD;<contact_name>;<notification_time...
keyword[def] identifier[change_contact_host_notification_timeperiod] ( identifier[self] , identifier[contact] , identifier[notification_timeperiod] ): literal[string] identifier[contact] . identifier[modified_host_attributes] |= identifier[DICT_MODATTR] [ literal[string] ]. identifier[valu...
def change_contact_host_notification_timeperiod(self, contact, notification_timeperiod): """Change contact host notification timeperiod value Format of the line that triggers function call:: CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD;<contact_name>;<notification_timeperiod> :param contact...
def in_dir( config_dir=os.path.expanduser('~/.tmuxp'), extensions=['.yml', '.yaml', '.json'] ): """ Return a list of configs in ``config_dir``. Parameters ---------- config_dir : str directory to search extensions : list filetypes to check (e.g. ``['.yaml', '.json']``). ...
def function[in_dir, parameter[config_dir, extensions]]: constant[ Return a list of configs in ``config_dir``. Parameters ---------- config_dir : str directory to search extensions : list filetypes to check (e.g. ``['.yaml', '.json']``). Returns ------- list ...
keyword[def] identifier[in_dir] ( identifier[config_dir] = identifier[os] . identifier[path] . identifier[expanduser] ( literal[string] ), identifier[extensions] =[ literal[string] , literal[string] , literal[string] ] ): literal[string] identifier[configs] =[] keyword[for] identifier[filename] ke...
def in_dir(config_dir=os.path.expanduser('~/.tmuxp'), extensions=['.yml', '.yaml', '.json']): """ Return a list of configs in ``config_dir``. Parameters ---------- config_dir : str directory to search extensions : list filetypes to check (e.g. ``['.yaml', '.json']``). Retur...
def default_matrix(self): """The default calibration matrix for this device. On most devices, this is the identity matrix. If the udev property ``LIBINPUT_CALIBRATION_MATRIX`` is set on the respective udev device, that property's value becomes the default matrix, see `Static device configuration via udev`_. ...
def function[default_matrix, parameter[self]]: constant[The default calibration matrix for this device. On most devices, this is the identity matrix. If the udev property ``LIBINPUT_CALIBRATION_MATRIX`` is set on the respective udev device, that property's value becomes the default matrix, see `Static ...
keyword[def] identifier[default_matrix] ( identifier[self] ): literal[string] identifier[matrix] =( identifier[c_float] * literal[int] )() identifier[rc] = identifier[self] . identifier[_libinput] . identifier[libinput_device_config_calibration_get_default_matrix] ( identifier[self] . identifier[_handle...
def default_matrix(self): """The default calibration matrix for this device. On most devices, this is the identity matrix. If the udev property ``LIBINPUT_CALIBRATION_MATRIX`` is set on the respective udev device, that property's value becomes the default matrix, see `Static device configuration via udev`_...
async def fetch_signatures(endpoint, protocol, idgen): """Request available methods for the service.""" async with aiohttp.ClientSession() as session: req = { "method": "getMethodTypes", "params": [''], "version": "1.0", "id": n...
<ast.AsyncFunctionDef object at 0x7da18f00e710>
keyword[async] keyword[def] identifier[fetch_signatures] ( identifier[endpoint] , identifier[protocol] , identifier[idgen] ): literal[string] keyword[async] keyword[with] identifier[aiohttp] . identifier[ClientSession] () keyword[as] identifier[session] : identifier[req] ={ ...
async def fetch_signatures(endpoint, protocol, idgen): """Request available methods for the service.""" async with aiohttp.ClientSession() as session: req = {'method': 'getMethodTypes', 'params': [''], 'version': '1.0', 'id': next(idgen)} if protocol == ProtocolType.WebSocket: async ...
def alpha(self, a=None): """Set/get actor's transparency.""" if a is not None: self.GetProperty().SetOpacity(a) return self else: return self.GetProperty().GetOpacity()
def function[alpha, parameter[self, a]]: constant[Set/get actor's transparency.] if compare[name[a] is_not constant[None]] begin[:] call[call[name[self].GetProperty, parameter[]].SetOpacity, parameter[name[a]]] return[name[self]]
keyword[def] identifier[alpha] ( identifier[self] , identifier[a] = keyword[None] ): literal[string] keyword[if] identifier[a] keyword[is] keyword[not] keyword[None] : identifier[self] . identifier[GetProperty] (). identifier[SetOpacity] ( identifier[a] ) keyword[retur...
def alpha(self, a=None): """Set/get actor's transparency.""" if a is not None: self.GetProperty().SetOpacity(a) return self # depends on [control=['if'], data=['a']] else: return self.GetProperty().GetOpacity()
def set_equation_from_string(self, equation_str, fail_silently=False, check_equation=True): """Set equation attribute from a string. Checks to see that the string is well-formed, and then uses sympy.sympify to evaluate. Args: e...
def function[set_equation_from_string, parameter[self, equation_str, fail_silently, check_equation]]: constant[Set equation attribute from a string. Checks to see that the string is well-formed, and then uses sympy.sympify to evaluate. Args: equation_str (str)...
keyword[def] identifier[set_equation_from_string] ( identifier[self] , identifier[equation_str] , identifier[fail_silently] = keyword[False] , identifier[check_equation] = keyword[True] ): literal[string] keyword[if] identifier[check_equation] : identifier[regex_check] ( identifier[e...
def set_equation_from_string(self, equation_str, fail_silently=False, check_equation=True): """Set equation attribute from a string. Checks to see that the string is well-formed, and then uses sympy.sympify to evaluate. Args: equation_str (str): A string represent...
def _get_cpu_virtualization(self): """get cpu virtualization status.""" try: cpu_vt = self._get_bios_setting('ProcVirtualization') except exception.IloCommandNotSupportedError: return False if cpu_vt == 'Enabled': vt_status = True else: ...
def function[_get_cpu_virtualization, parameter[self]]: constant[get cpu virtualization status.] <ast.Try object at 0x7da20c9901f0> if compare[name[cpu_vt] equal[==] constant[Enabled]] begin[:] variable[vt_status] assign[=] constant[True] return[name[vt_status]]
keyword[def] identifier[_get_cpu_virtualization] ( identifier[self] ): literal[string] keyword[try] : identifier[cpu_vt] = identifier[self] . identifier[_get_bios_setting] ( literal[string] ) keyword[except] identifier[exception] . identifier[IloCommandNotSupportedError] : ...
def _get_cpu_virtualization(self): """get cpu virtualization status.""" try: cpu_vt = self._get_bios_setting('ProcVirtualization') # depends on [control=['try'], data=[]] except exception.IloCommandNotSupportedError: return False # depends on [control=['except'], data=[]] if cpu_vt == ...
def get_asset_query_session(self, proxy=None): """Gets the ``OsidSession`` associated with the asset query service. arg: proxy (osid.proxy.Proxy): a proxy return: (osid.repository.AssetQuerySession) - an ``AssetQuerySession`` raise: NullArgument - ``proxy`` is ``null...
def function[get_asset_query_session, parameter[self, proxy]]: constant[Gets the ``OsidSession`` associated with the asset query service. arg: proxy (osid.proxy.Proxy): a proxy return: (osid.repository.AssetQuerySession) - an ``AssetQuerySession`` raise: NullArgument...
keyword[def] identifier[get_asset_query_session] ( identifier[self] , identifier[proxy] = keyword[None] ): literal[string] keyword[return] identifier[AssetQuerySession] ( identifier[self] . identifier[_provider_manager] . identifier[get_asset_query_session] ( identifier[proxy] ), ...
def get_asset_query_session(self, proxy=None): """Gets the ``OsidSession`` associated with the asset query service. arg: proxy (osid.proxy.Proxy): a proxy return: (osid.repository.AssetQuerySession) - an ``AssetQuerySession`` raise: NullArgument - ``proxy`` is ``null`` ...
def render(self, **kwargs): """Renders the HTML representation of the element.""" for name, child in self._children.items(): child.render(**kwargs) return self._template.render(this=self, kwargs=kwargs)
def function[render, parameter[self]]: constant[Renders the HTML representation of the element.] for taget[tuple[[<ast.Name object at 0x7da1b121a3b0>, <ast.Name object at 0x7da1b1219210>]]] in starred[call[name[self]._children.items, parameter[]]] begin[:] call[name[child].render, parame...
keyword[def] identifier[render] ( identifier[self] ,** identifier[kwargs] ): literal[string] keyword[for] identifier[name] , identifier[child] keyword[in] identifier[self] . identifier[_children] . identifier[items] (): identifier[child] . identifier[render] (** identifier[kwargs] )...
def render(self, **kwargs): """Renders the HTML representation of the element.""" for (name, child) in self._children.items(): child.render(**kwargs) # depends on [control=['for'], data=[]] return self._template.render(this=self, kwargs=kwargs)
def as_csv(self): """Return a CSV representation as a string""" from io import StringIO s = StringIO() w = csv.writer(s) for row in self.rows: w.writerow(row) return s.getvalue()
def function[as_csv, parameter[self]]: constant[Return a CSV representation as a string] from relative_module[io] import module[StringIO] variable[s] assign[=] call[name[StringIO], parameter[]] variable[w] assign[=] call[name[csv].writer, parameter[name[s]]] for taget[name[row]] in s...
keyword[def] identifier[as_csv] ( identifier[self] ): literal[string] keyword[from] identifier[io] keyword[import] identifier[StringIO] identifier[s] = identifier[StringIO] () identifier[w] = identifier[csv] . identifier[writer] ( identifier[s] ) keyword[for] ident...
def as_csv(self): """Return a CSV representation as a string""" from io import StringIO s = StringIO() w = csv.writer(s) for row in self.rows: w.writerow(row) # depends on [control=['for'], data=['row']] return s.getvalue()
def addSuppression(self, suppressionList): """ This method can be used to add patters of warnings that should not be counted. It takes a single argument, a list of patterns. Each pattern is a 4-tuple (FILE-RE, WARN-RE, START, END). FILE-RE is a regular expression (stri...
def function[addSuppression, parameter[self, suppressionList]]: constant[ This method can be used to add patters of warnings that should not be counted. It takes a single argument, a list of patterns. Each pattern is a 4-tuple (FILE-RE, WARN-RE, START, END). FILE-RE is...
keyword[def] identifier[addSuppression] ( identifier[self] , identifier[suppressionList] ): literal[string] keyword[for] identifier[fileRe] , identifier[warnRe] , identifier[start] , identifier[end] keyword[in] identifier[suppressionList] : keyword[if] identifier[fileRe] keyword[...
def addSuppression(self, suppressionList): """ This method can be used to add patters of warnings that should not be counted. It takes a single argument, a list of patterns. Each pattern is a 4-tuple (FILE-RE, WARN-RE, START, END). FILE-RE is a regular expression (string o...
def get(self, orig_key): """Get cache entry for key, or return None.""" resp = requests.Response() key = self._clean_key(orig_key) path = os.path.join(self.cache_dir, key) try: with open(path, 'rb') as f: # read lines one at a time wh...
def function[get, parameter[self, orig_key]]: constant[Get cache entry for key, or return None.] variable[resp] assign[=] call[name[requests].Response, parameter[]] variable[key] assign[=] call[name[self]._clean_key, parameter[name[orig_key]]] variable[path] assign[=] call[name[os].path....
keyword[def] identifier[get] ( identifier[self] , identifier[orig_key] ): literal[string] identifier[resp] = identifier[requests] . identifier[Response] () identifier[key] = identifier[self] . identifier[_clean_key] ( identifier[orig_key] ) identifier[path] = identifier[os] . ide...
def get(self, orig_key): """Get cache entry for key, or return None.""" resp = requests.Response() key = self._clean_key(orig_key) path = os.path.join(self.cache_dir, key) try: with open(path, 'rb') as f: # read lines one at a time while True: line = f...
def log_histograms(self, model: Model, histogram_parameters: Set[str]) -> None: """ Send histograms of parameters to tensorboard. """ for name, param in model.named_parameters(): if name in histogram_parameters: self.add_train_histogram("parameter_histogram/" ...
def function[log_histograms, parameter[self, model, histogram_parameters]]: constant[ Send histograms of parameters to tensorboard. ] for taget[tuple[[<ast.Name object at 0x7da1b1f94c10>, <ast.Name object at 0x7da1b1f952a0>]]] in starred[call[name[model].named_parameters, parameter[]]] b...
keyword[def] identifier[log_histograms] ( identifier[self] , identifier[model] : identifier[Model] , identifier[histogram_parameters] : identifier[Set] [ identifier[str] ])-> keyword[None] : literal[string] keyword[for] identifier[name] , identifier[param] keyword[in] identifier[model] . identif...
def log_histograms(self, model: Model, histogram_parameters: Set[str]) -> None: """ Send histograms of parameters to tensorboard. """ for (name, param) in model.named_parameters(): if name in histogram_parameters: self.add_train_histogram('parameter_histogram/' + name, param)...
def ordinal_encode(self, column, values=None, inplace=False): """Encode column as ordinal values and mark it as categorical. The existing column is renamed to a hidden column and replaced by a numerical columns with values between [0, len(values)-1]. """ column = _ensure_string_...
def function[ordinal_encode, parameter[self, column, values, inplace]]: constant[Encode column as ordinal values and mark it as categorical. The existing column is renamed to a hidden column and replaced by a numerical columns with values between [0, len(values)-1]. ] variable[c...
keyword[def] identifier[ordinal_encode] ( identifier[self] , identifier[column] , identifier[values] = keyword[None] , identifier[inplace] = keyword[False] ): literal[string] identifier[column] = identifier[_ensure_string_from_expression] ( identifier[column] ) identifier[df] = identifier[...
def ordinal_encode(self, column, values=None, inplace=False): """Encode column as ordinal values and mark it as categorical. The existing column is renamed to a hidden column and replaced by a numerical columns with values between [0, len(values)-1]. """ column = _ensure_string_from_exp...
def precheck(): """ Pre-run dependency check """ binaries = ['make'] for bin in binaries: if not which(bin): msg = 'Dependency fail -- Unable to locate rquired binary: ' stdout_message('%s: %s' % (msg, ACCENT + bin + RESET)) return False elif not r...
def function[precheck, parameter[]]: constant[ Pre-run dependency check ] variable[binaries] assign[=] list[[<ast.Constant object at 0x7da20c7cb880>]] for taget[name[bin]] in starred[name[binaries]] begin[:] if <ast.UnaryOp object at 0x7da20c7c99c0> begin[:] ...
keyword[def] identifier[precheck] (): literal[string] identifier[binaries] =[ literal[string] ] keyword[for] identifier[bin] keyword[in] identifier[binaries] : keyword[if] keyword[not] identifier[which] ( identifier[bin] ): identifier[msg] = literal[string] ide...
def precheck(): """ Pre-run dependency check """ binaries = ['make'] for bin in binaries: if not which(bin): msg = 'Dependency fail -- Unable to locate rquired binary: ' stdout_message('%s: %s' % (msg, ACCENT + bin + RESET)) return False # depends on [con...
def _download_metadata_archive(self): """Makes a remote call to the Project Gutenberg servers and downloads the entire Project Gutenberg meta-data catalog. The catalog describes the texts on Project Gutenberg in RDF. The function returns a file-pointer to the catalog. """ ...
def function[_download_metadata_archive, parameter[self]]: constant[Makes a remote call to the Project Gutenberg servers and downloads the entire Project Gutenberg meta-data catalog. The catalog describes the texts on Project Gutenberg in RDF. The function returns a file-pointer to the c...
keyword[def] identifier[_download_metadata_archive] ( identifier[self] ): literal[string] keyword[with] identifier[tempfile] . identifier[NamedTemporaryFile] ( identifier[delete] = keyword[False] ) keyword[as] identifier[metadata_archive] : identifier[shutil] . identifier[copyfileobj...
def _download_metadata_archive(self): """Makes a remote call to the Project Gutenberg servers and downloads the entire Project Gutenberg meta-data catalog. The catalog describes the texts on Project Gutenberg in RDF. The function returns a file-pointer to the catalog. """ with t...
def p_ranges(self, p): """ranges : ranges '|' range | range""" n = len(p) if n == 4: p[0] = p[1] + [p[3]] elif n == 2: p[0] = [p[1]]
def function[p_ranges, parameter[self, p]]: constant[ranges : ranges '|' range | range] variable[n] assign[=] call[name[len], parameter[name[p]]] if compare[name[n] equal[==] constant[4]] begin[:] call[name[p]][constant[0]] assign[=] binary_operation[call[name[p...
keyword[def] identifier[p_ranges] ( identifier[self] , identifier[p] ): literal[string] identifier[n] = identifier[len] ( identifier[p] ) keyword[if] identifier[n] == literal[int] : identifier[p] [ literal[int] ]= identifier[p] [ literal[int] ]+[ identifier[p] [ literal[int] ...
def p_ranges(self, p): """ranges : ranges '|' range | range""" n = len(p) if n == 4: p[0] = p[1] + [p[3]] # depends on [control=['if'], data=[]] elif n == 2: p[0] = [p[1]] # depends on [control=['if'], data=[]]
def plot_target_trajectory(targets_x, targets_y, targets_z, ax): """Ajoute la trajectoire (liste des targets) au plot""" ax.scatter(targets_x, targets_y, targets_z)
def function[plot_target_trajectory, parameter[targets_x, targets_y, targets_z, ax]]: constant[Ajoute la trajectoire (liste des targets) au plot] call[name[ax].scatter, parameter[name[targets_x], name[targets_y], name[targets_z]]]
keyword[def] identifier[plot_target_trajectory] ( identifier[targets_x] , identifier[targets_y] , identifier[targets_z] , identifier[ax] ): literal[string] identifier[ax] . identifier[scatter] ( identifier[targets_x] , identifier[targets_y] , identifier[targets_z] )
def plot_target_trajectory(targets_x, targets_y, targets_z, ax): """Ajoute la trajectoire (liste des targets) au plot""" ax.scatter(targets_x, targets_y, targets_z)
def _param_callback(self, name, value): """Generic callback registered for all the groups""" print('{0}: {1}'.format(name, value)) # Remove each parameter from the list and close the link when # all are fetched self._param_check_list.remove(name) if len(self._param_check...
def function[_param_callback, parameter[self, name, value]]: constant[Generic callback registered for all the groups] call[name[print], parameter[call[constant[{0}: {1}].format, parameter[name[name], name[value]]]]] call[name[self]._param_check_list.remove, parameter[name[name]]] if comp...
keyword[def] identifier[_param_callback] ( identifier[self] , identifier[name] , identifier[value] ): literal[string] identifier[print] ( literal[string] . identifier[format] ( identifier[name] , identifier[value] )) identifier[self] . identifier[_param_check_list] . ide...
def _param_callback(self, name, value): """Generic callback registered for all the groups""" print('{0}: {1}'.format(name, value)) # Remove each parameter from the list and close the link when # all are fetched self._param_check_list.remove(name) if len(self._param_check_list) == 0: prin...
def _load_metadata(self, handle): """Load archive members metadata.""" rarinfo = self._read_header(handle) while rarinfo: self.filelist.append(rarinfo) self.NameToInfo[rarinfo.filename] = rarinfo self._process_current(handle, constants.RAR_SKIP) ra...
def function[_load_metadata, parameter[self, handle]]: constant[Load archive members metadata.] variable[rarinfo] assign[=] call[name[self]._read_header, parameter[name[handle]]] while name[rarinfo] begin[:] call[name[self].filelist.append, parameter[name[rarinfo]]] ...
keyword[def] identifier[_load_metadata] ( identifier[self] , identifier[handle] ): literal[string] identifier[rarinfo] = identifier[self] . identifier[_read_header] ( identifier[handle] ) keyword[while] identifier[rarinfo] : identifier[self] . identifier[filelist] . identifie...
def _load_metadata(self, handle): """Load archive members metadata.""" rarinfo = self._read_header(handle) while rarinfo: self.filelist.append(rarinfo) self.NameToInfo[rarinfo.filename] = rarinfo self._process_current(handle, constants.RAR_SKIP) rarinfo = self._read_header(ha...
def interleave(*args): '''Interleaves the elements of the provided arrays. >>> a = [(0, 0), (1, 0), (2, 0), (3, 0)] >>> b = [(0, 0), (0, 1), (0, 2), (0, 3)] >>> interleave(a, b) [(0, 0, 0, 0), (1, 0, 0, 1), (2, 0, 0, 2), (3, 0, 0, 3)] This is useful for combining multiple verte...
def function[interleave, parameter[]]: constant[Interleaves the elements of the provided arrays. >>> a = [(0, 0), (1, 0), (2, 0), (3, 0)] >>> b = [(0, 0), (0, 1), (0, 2), (0, 3)] >>> interleave(a, b) [(0, 0, 0, 0), (1, 0, 0, 1), (2, 0, 0, 2), (3, 0, 0, 3)] This is useful fo...
keyword[def] identifier[interleave] (* identifier[args] ): literal[string] identifier[result] =[] keyword[for] identifier[array] keyword[in] identifier[zip] (* identifier[args] ): identifier[result] . identifier[append] ( identifier[tuple] ( identifier[flatten] ( identifier[array] ))) ...
def interleave(*args): """Interleaves the elements of the provided arrays. >>> a = [(0, 0), (1, 0), (2, 0), (3, 0)] >>> b = [(0, 0), (0, 1), (0, 2), (0, 3)] >>> interleave(a, b) [(0, 0, 0, 0), (1, 0, 0, 1), (2, 0, 0, 2), (3, 0, 0, 3)] This is useful for combining multiple verte...
def ParseMessage(descriptor, byte_str): """Generate a new Message instance from this Descriptor and a byte string. Args: descriptor: Protobuf Descriptor object byte_str: Serialized protocol buffer byte string Returns: Newly created protobuf Message object. """ result_class = MakeClass(descriptor...
def function[ParseMessage, parameter[descriptor, byte_str]]: constant[Generate a new Message instance from this Descriptor and a byte string. Args: descriptor: Protobuf Descriptor object byte_str: Serialized protocol buffer byte string Returns: Newly created protobuf Message object. ] ...
keyword[def] identifier[ParseMessage] ( identifier[descriptor] , identifier[byte_str] ): literal[string] identifier[result_class] = identifier[MakeClass] ( identifier[descriptor] ) identifier[new_msg] = identifier[result_class] () identifier[new_msg] . identifier[ParseFromString] ( identifier[byte_str] )...
def ParseMessage(descriptor, byte_str): """Generate a new Message instance from this Descriptor and a byte string. Args: descriptor: Protobuf Descriptor object byte_str: Serialized protocol buffer byte string Returns: Newly created protobuf Message object. """ result_class = MakeClass(descri...
def reboot(self, target_mode=None, timeout_ms=None): """Reboots the device. Args: target_mode: Normal reboot when unspecified (or None). Can specify other target modes, such as 'recovery' or 'bootloader'. timeout_ms: Optional timeout in milliseconds to wait for a response. Retur...
def function[reboot, parameter[self, target_mode, timeout_ms]]: constant[Reboots the device. Args: target_mode: Normal reboot when unspecified (or None). Can specify other target modes, such as 'recovery' or 'bootloader'. timeout_ms: Optional timeout in milliseconds to wait for ...
keyword[def] identifier[reboot] ( identifier[self] , identifier[target_mode] = keyword[None] , identifier[timeout_ms] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[_simple_command] ( literal[string] , identifier[arg] = identifier[target_mode] , identifier[timeout_ms...
def reboot(self, target_mode=None, timeout_ms=None): """Reboots the device. Args: target_mode: Normal reboot when unspecified (or None). Can specify other target modes, such as 'recovery' or 'bootloader'. timeout_ms: Optional timeout in milliseconds to wait for a response. Retur...
def stage_name(self): """ Get stage name of current job instance. Because instantiating job instance could be performed in different ways and those return different results, we have to check where from to get name of the stage. :return: stage name. """ if 'stage...
def function[stage_name, parameter[self]]: constant[ Get stage name of current job instance. Because instantiating job instance could be performed in different ways and those return different results, we have to check where from to get name of the stage. :return: stage name. ...
keyword[def] identifier[stage_name] ( identifier[self] ): literal[string] keyword[if] literal[string] keyword[in] identifier[self] . identifier[data] keyword[and] identifier[self] . identifier[data] . identifier[stage_name] : keyword[return] identifier[self] . identifier[data] . ...
def stage_name(self): """ Get stage name of current job instance. Because instantiating job instance could be performed in different ways and those return different results, we have to check where from to get name of the stage. :return: stage name. """ if 'stage_name' i...
def detectors(regex=None, sep='\t', temporary=False): """Print the detectors table""" db = DBManager(temporary=temporary) dt = db.detectors if regex is not None: try: re.compile(regex) except re.error: log.error("Invalid regex!") return dt = dt...
def function[detectors, parameter[regex, sep, temporary]]: constant[Print the detectors table] variable[db] assign[=] call[name[DBManager], parameter[]] variable[dt] assign[=] name[db].detectors if compare[name[regex] is_not constant[None]] begin[:] <ast.Try object at 0x7da1b253b...
keyword[def] identifier[detectors] ( identifier[regex] = keyword[None] , identifier[sep] = literal[string] , identifier[temporary] = keyword[False] ): literal[string] identifier[db] = identifier[DBManager] ( identifier[temporary] = identifier[temporary] ) identifier[dt] = identifier[db] . identifier[d...
def detectors(regex=None, sep='\t', temporary=False): """Print the detectors table""" db = DBManager(temporary=temporary) dt = db.detectors if regex is not None: try: re.compile(regex) # depends on [control=['try'], data=[]] except re.error: log.error('Invalid re...
def destroy_balancer(balancer_id, profile, **libcloud_kwargs): ''' Destroy a load balancer :param balancer_id: LoadBalancer ID which should be used :type balancer_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's ...
def function[destroy_balancer, parameter[balancer_id, profile]]: constant[ Destroy a load balancer :param balancer_id: LoadBalancer ID which should be used :type balancer_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for t...
keyword[def] identifier[destroy_balancer] ( identifier[balancer_id] , identifier[profile] ,** identifier[libcloud_kwargs] ): literal[string] identifier[conn] = identifier[_get_driver] ( identifier[profile] = identifier[profile] ) identifier[libcloud_kwargs] = identifier[salt] . identifier[utils] . ide...
def destroy_balancer(balancer_id, profile, **libcloud_kwargs): """ Destroy a load balancer :param balancer_id: LoadBalancer ID which should be used :type balancer_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's ...
def process_text(text, save_xml='cwms_output.xml'): """Processes text using the CWMS web service. Parameters ---------- text : str Text to process Returns ------- cp : indra.sources.cwms.CWMSProcessor A CWMSProcessor, which contains a list of INDRA statements in its ...
def function[process_text, parameter[text, save_xml]]: constant[Processes text using the CWMS web service. Parameters ---------- text : str Text to process Returns ------- cp : indra.sources.cwms.CWMSProcessor A CWMSProcessor, which contains a list of INDRA statements i...
keyword[def] identifier[process_text] ( identifier[text] , identifier[save_xml] = literal[string] ): literal[string] identifier[xml] = identifier[client] . identifier[send_query] ( identifier[text] , literal[string] ) identifier[first_end] = identifier[xml] . identifier[find] ( literal[string] )...
def process_text(text, save_xml='cwms_output.xml'): """Processes text using the CWMS web service. Parameters ---------- text : str Text to process Returns ------- cp : indra.sources.cwms.CWMSProcessor A CWMSProcessor, which contains a list of INDRA statements in its ...
def new_child(self, term, value, **kwargs): """Create a new term and add it to this term as a child. Creates grandchildren from the kwargs. :param term: term name. Just the record term :param term: Value to assign to the term :param term: Term properties, which create children of the ch...
def function[new_child, parameter[self, term, value]]: constant[Create a new term and add it to this term as a child. Creates grandchildren from the kwargs. :param term: term name. Just the record term :param term: Value to assign to the term :param term: Term properties, which create c...
keyword[def] identifier[new_child] ( identifier[self] , identifier[term] , identifier[value] ,** identifier[kwargs] ): literal[string] identifier[tc] = identifier[self] . identifier[doc] . identifier[get_term_class] ( identifier[term] . identifier[lower] ()) identifier[c] = identifier[tc...
def new_child(self, term, value, **kwargs): """Create a new term and add it to this term as a child. Creates grandchildren from the kwargs. :param term: term name. Just the record term :param term: Value to assign to the term :param term: Term properties, which create children of the child ...
def _schedule_next_run(self): """ Compute the instant when this job should run next. """ if self.unit not in ('seconds', 'minutes', 'hours', 'days', 'weeks'): raise ScheduleValueError('Invalid unit') if self.latest is not None: if not (self.latest >= self...
def function[_schedule_next_run, parameter[self]]: constant[ Compute the instant when this job should run next. ] if compare[name[self].unit <ast.NotIn object at 0x7da2590d7190> tuple[[<ast.Constant object at 0x7da1b1f95d20>, <ast.Constant object at 0x7da1b1f97190>, <ast.Constant object ...
keyword[def] identifier[_schedule_next_run] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[unit] keyword[not] keyword[in] ( literal[string] , literal[string] , literal[string] , literal[string] , literal[string] ): keyword[raise] identifier[Schedule...
def _schedule_next_run(self): """ Compute the instant when this job should run next. """ if self.unit not in ('seconds', 'minutes', 'hours', 'days', 'weeks'): raise ScheduleValueError('Invalid unit') # depends on [control=['if'], data=[]] if self.latest is not None: if not s...
def toc(self): """ Returns table of contents as a block_token.List instance. """ from mistletoe.block_token import List def get_indent(level): if self.omit_title: level -= 1 return ' ' * 4 * (level - 1) def build_list_item(heading)...
def function[toc, parameter[self]]: constant[ Returns table of contents as a block_token.List instance. ] from relative_module[mistletoe.block_token] import module[List] def function[get_indent, parameter[level]]: if name[self].omit_title begin[:] <ast.Aug...
keyword[def] identifier[toc] ( identifier[self] ): literal[string] keyword[from] identifier[mistletoe] . identifier[block_token] keyword[import] identifier[List] keyword[def] identifier[get_indent] ( identifier[level] ): keyword[if] identifier[self] . identifier[omit_tit...
def toc(self): """ Returns table of contents as a block_token.List instance. """ from mistletoe.block_token import List def get_indent(level): if self.omit_title: level -= 1 # depends on [control=['if'], data=[]] return ' ' * 4 * (level - 1) def build_list_...
def login(session, username, password, class_name=None): """ Login on coursera.org with the given credentials. This adds the following cookies to the session: sessionid, maestro_login, maestro_login_flag """ logging.debug('Initiating login.') try: session.cookies.clear('.course...
def function[login, parameter[session, username, password, class_name]]: constant[ Login on coursera.org with the given credentials. This adds the following cookies to the session: sessionid, maestro_login, maestro_login_flag ] call[name[logging].debug, parameter[constant[Initiating...
keyword[def] identifier[login] ( identifier[session] , identifier[username] , identifier[password] , identifier[class_name] = keyword[None] ): literal[string] identifier[logging] . identifier[debug] ( literal[string] ) keyword[try] : identifier[session] . identifier[cookies] . identifier[cle...
def login(session, username, password, class_name=None): """ Login on coursera.org with the given credentials. This adds the following cookies to the session: sessionid, maestro_login, maestro_login_flag """ logging.debug('Initiating login.') try: session.cookies.clear('.courser...
async def send_chat_message(self, send_chat_message_request): """Send a chat message to a conversation.""" response = hangouts_pb2.SendChatMessageResponse() await self._pb_request('conversations/sendchatmessage', send_chat_message_request, response) return ...
<ast.AsyncFunctionDef object at 0x7da18f00c130>
keyword[async] keyword[def] identifier[send_chat_message] ( identifier[self] , identifier[send_chat_message_request] ): literal[string] identifier[response] = identifier[hangouts_pb2] . identifier[SendChatMessageResponse] () keyword[await] identifier[self] . identifier[_pb_request] ( lit...
async def send_chat_message(self, send_chat_message_request): """Send a chat message to a conversation.""" response = hangouts_pb2.SendChatMessageResponse() await self._pb_request('conversations/sendchatmessage', send_chat_message_request, response) return response
def run(self): """Run checker.""" def split(module): """Split module into submodules.""" return tuple(module.split(".")) def modcmp(lib=(), test=()): """Compare import modules.""" if len(lib) > len(test): return False ...
def function[run, parameter[self]]: constant[Run checker.] def function[split, parameter[module]]: constant[Split module into submodules.] return[call[name[tuple], parameter[call[name[module].split, parameter[constant[.]]]]]] def function[modcmp, parameter[lib, test]]: ...
keyword[def] identifier[run] ( identifier[self] ): literal[string] keyword[def] identifier[split] ( identifier[module] ): literal[string] keyword[return] identifier[tuple] ( identifier[module] . identifier[split] ( literal[string] )) keyword[def] identifier[...
def run(self): """Run checker.""" def split(module): """Split module into submodules.""" return tuple(module.split('.')) def modcmp(lib=(), test=()): """Compare import modules.""" if len(lib) > len(test): return False # depends on [control=['if'], data=[]] ...
def get_relation_routes(self, viewset): """ Generate routes to serve relational objects. This method will add a sub-URL for each relational field. e.g. A viewset for the following serializer: class UserSerializer(..): events = DynamicRelationField(EventS...
def function[get_relation_routes, parameter[self, viewset]]: constant[ Generate routes to serve relational objects. This method will add a sub-URL for each relational field. e.g. A viewset for the following serializer: class UserSerializer(..): events = ...
keyword[def] identifier[get_relation_routes] ( identifier[self] , identifier[viewset] ): literal[string] identifier[routes] =[] keyword[if] keyword[not] identifier[hasattr] ( identifier[viewset] , literal[string] ): keyword[return] identifier[routes] keyword[if]...
def get_relation_routes(self, viewset): """ Generate routes to serve relational objects. This method will add a sub-URL for each relational field. e.g. A viewset for the following serializer: class UserSerializer(..): events = DynamicRelationField(EventSeria...
def main() -> None: """ Command-line handler for the ``find_recovered_openxml`` tool. Use the ``--help`` option for help. """ parser = ArgumentParser( formatter_class=RawDescriptionHelpFormatter, description=""" Tool to recognize and rescue Microsoft Office OpenXML files, even if the...
def function[main, parameter[]]: constant[ Command-line handler for the ``find_recovered_openxml`` tool. Use the ``--help`` option for help. ] variable[parser] assign[=] call[name[ArgumentParser], parameter[]] call[name[parser].add_argument, parameter[constant[filename]]] cal...
keyword[def] identifier[main] ()-> keyword[None] : literal[string] identifier[parser] = identifier[ArgumentParser] ( identifier[formatter_class] = identifier[RawDescriptionHelpFormatter] , identifier[description] = literal[string] . identifier[format] ( identifier[DOCX_CONTENTS_REGEX_STR] = ...
def main() -> None: """ Command-line handler for the ``find_recovered_openxml`` tool. Use the ``--help`` option for help. """ parser = ArgumentParser(formatter_class=RawDescriptionHelpFormatter, description='\nTool to recognize and rescue Microsoft Office OpenXML files, even if they have\ngarbage ap...
def hbas(self): """ :class:`~zhmcclient.HbaManager`: Access to the :term:`HBAs <HBA>` in this Partition. If the "dpm-storage-management" feature is enabled, this property is `None`. """ # We do here some lazy loading. if not self._hbas: try: ...
def function[hbas, parameter[self]]: constant[ :class:`~zhmcclient.HbaManager`: Access to the :term:`HBAs <HBA>` in this Partition. If the "dpm-storage-management" feature is enabled, this property is `None`. ] if <ast.UnaryOp object at 0x7da20c991960> begin[:] ...
keyword[def] identifier[hbas] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_hbas] : keyword[try] : identifier[dpm_sm] = identifier[self] . identifier[feature_enabled] ( literal[string] ) keyword[ex...
def hbas(self): """ :class:`~zhmcclient.HbaManager`: Access to the :term:`HBAs <HBA>` in this Partition. If the "dpm-storage-management" feature is enabled, this property is `None`. """ # We do here some lazy loading. if not self._hbas: try: dpm_s...
def adapt_files(solver): """ Rename and remove files whenever necessary. """ print("adapting {0}'s files".format(solver)) root = os.path.join('solvers', solver) for arch in to_extract[solver]: arch = os.path.join(root, arch) extract_archive(arch, solver, put_inside=True) ...
def function[adapt_files, parameter[solver]]: constant[ Rename and remove files whenever necessary. ] call[name[print], parameter[call[constant[adapting {0}'s files].format, parameter[name[solver]]]]] variable[root] assign[=] call[name[os].path.join, parameter[constant[solvers], name...
keyword[def] identifier[adapt_files] ( identifier[solver] ): literal[string] identifier[print] ( literal[string] . identifier[format] ( identifier[solver] )) identifier[root] = identifier[os] . identifier[path] . identifier[join] ( literal[string] , identifier[solver] ) keyword[for] identifier...
def adapt_files(solver): """ Rename and remove files whenever necessary. """ print("adapting {0}'s files".format(solver)) root = os.path.join('solvers', solver) for arch in to_extract[solver]: arch = os.path.join(root, arch) extract_archive(arch, solver, put_inside=True) # d...
def eager_send(chainlet, chunks): """ Eager version of `lazy_send` evaluating the return value immediately :note: The return value by an ``n`` to ``m`` link is considered fully evaluated. :param chainlet: the chainlet to receive and return data :type chainlet: chainlink.ChainLink :param chunks...
def function[eager_send, parameter[chainlet, chunks]]: constant[ Eager version of `lazy_send` evaluating the return value immediately :note: The return value by an ``n`` to ``m`` link is considered fully evaluated. :param chainlet: the chainlet to receive and return data :type chainlet: chainl...
keyword[def] identifier[eager_send] ( identifier[chainlet] , identifier[chunks] ): literal[string] identifier[fork] , identifier[join] = identifier[chainlet] . identifier[chain_fork] , identifier[chainlet] . identifier[chain_join] keyword[if] identifier[fork] keyword[and] identifier[join] : ...
def eager_send(chainlet, chunks): """ Eager version of `lazy_send` evaluating the return value immediately :note: The return value by an ``n`` to ``m`` link is considered fully evaluated. :param chainlet: the chainlet to receive and return data :type chainlet: chainlink.ChainLink :param chunks...
def add_edges_from(self, ebunch, **kwargs): """ Add all the edges in ebunch. If nodes referred in the ebunch are not already present, they will be automatically added. Node names can be any hashable python object. Parameters ---------- ebunch : list, array-like ...
def function[add_edges_from, parameter[self, ebunch]]: constant[ Add all the edges in ebunch. If nodes referred in the ebunch are not already present, they will be automatically added. Node names can be any hashable python object. Parameters ---------- ebunch : ...
keyword[def] identifier[add_edges_from] ( identifier[self] , identifier[ebunch] ,** identifier[kwargs] ): literal[string] keyword[for] identifier[edge] keyword[in] identifier[ebunch] : identifier[self] . identifier[add_edge] ( identifier[edge] [ literal[int] ], identifier[edge] [ li...
def add_edges_from(self, ebunch, **kwargs): """ Add all the edges in ebunch. If nodes referred in the ebunch are not already present, they will be automatically added. Node names can be any hashable python object. Parameters ---------- ebunch : list, array-like ...
def write_psd(self, psds, group=None): """Writes PSD for each IFO to file. Parameters ----------- psds : {dict, FrequencySeries} A dict of FrequencySeries where the key is the IFO. group : {None, str} The group to write the psd to. Default is ``data_group...
def function[write_psd, parameter[self, psds, group]]: constant[Writes PSD for each IFO to file. Parameters ----------- psds : {dict, FrequencySeries} A dict of FrequencySeries where the key is the IFO. group : {None, str} The group to write the psd to. D...
keyword[def] identifier[write_psd] ( identifier[self] , identifier[psds] , identifier[group] = keyword[None] ): literal[string] identifier[subgroup] = identifier[self] . identifier[data_group] + literal[string] keyword[if] identifier[group] keyword[is] keyword[None] : iden...
def write_psd(self, psds, group=None): """Writes PSD for each IFO to file. Parameters ----------- psds : {dict, FrequencySeries} A dict of FrequencySeries where the key is the IFO. group : {None, str} The group to write the psd to. Default is ``data_group``. ...
def major_complex(network, state): """Return the major complex of the network. Args: network (Network): The |Network| of interest. state (tuple[int]): The state of the network (a binary tuple). Returns: SystemIrreducibilityAnalysis: The |SIA| for the |Subsystem| with maxima...
def function[major_complex, parameter[network, state]]: constant[Return the major complex of the network. Args: network (Network): The |Network| of interest. state (tuple[int]): The state of the network (a binary tuple). Returns: SystemIrreducibilityAnalysis: The |SIA| for the ...
keyword[def] identifier[major_complex] ( identifier[network] , identifier[state] ): literal[string] identifier[log] . identifier[info] ( literal[string] ) identifier[result] = identifier[complexes] ( identifier[network] , identifier[state] ) keyword[if] identifier[result] : identifier[...
def major_complex(network, state): """Return the major complex of the network. Args: network (Network): The |Network| of interest. state (tuple[int]): The state of the network (a binary tuple). Returns: SystemIrreducibilityAnalysis: The |SIA| for the |Subsystem| with maxima...
def parse(self, generator): """Parse an iterable source of strings into a generator""" gen = iter(generator) for line in gen: block = {} for rule in self.rules: if rule[0](line): block = rule[1](line, gen) break ...
def function[parse, parameter[self, generator]]: constant[Parse an iterable source of strings into a generator] variable[gen] assign[=] call[name[iter], parameter[name[generator]]] for taget[name[line]] in starred[name[gen]] begin[:] variable[block] assign[=] dictionary[[], []] ...
keyword[def] identifier[parse] ( identifier[self] , identifier[generator] ): literal[string] identifier[gen] = identifier[iter] ( identifier[generator] ) keyword[for] identifier[line] keyword[in] identifier[gen] : identifier[block] ={} keyword[for] identifier[...
def parse(self, generator): """Parse an iterable source of strings into a generator""" gen = iter(generator) for line in gen: block = {} for rule in self.rules: if rule[0](line): block = rule[1](line, gen) break # depends on [control=['if'], data=...