code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def meth_wdl(args): ''' Retrieve WDL for given version of a repository method''' r = fapi.get_repository_method(args.namespace, args.method, args.snapshot_id, True) fapi._check_response_code(r, 200) return r.text
def function[meth_wdl, parameter[args]]: constant[ Retrieve WDL for given version of a repository method] variable[r] assign[=] call[name[fapi].get_repository_method, parameter[name[args].namespace, name[args].method, name[args].snapshot_id, constant[True]]] call[name[fapi]._check_response_code,...
keyword[def] identifier[meth_wdl] ( identifier[args] ): literal[string] identifier[r] = identifier[fapi] . identifier[get_repository_method] ( identifier[args] . identifier[namespace] , identifier[args] . identifier[method] , identifier[args] . identifier[snapshot_id] , keyword[True] ) identifier...
def meth_wdl(args): """ Retrieve WDL for given version of a repository method""" r = fapi.get_repository_method(args.namespace, args.method, args.snapshot_id, True) fapi._check_response_code(r, 200) return r.text
def p_annotation_date_1(self, p): """annotation_date : ANNOTATION_DATE DATE""" try: if six.PY2: value = p[2].decode(encoding='utf-8') else: value = p[2] self.builder.add_annotation_date(self.document, value) except CardinalityEr...
def function[p_annotation_date_1, parameter[self, p]]: constant[annotation_date : ANNOTATION_DATE DATE] <ast.Try object at 0x7da1b014d4e0>
keyword[def] identifier[p_annotation_date_1] ( identifier[self] , identifier[p] ): literal[string] keyword[try] : keyword[if] identifier[six] . identifier[PY2] : identifier[value] = identifier[p] [ literal[int] ]. identifier[decode] ( identifier[encoding] = literal[st...
def p_annotation_date_1(self, p): """annotation_date : ANNOTATION_DATE DATE""" try: if six.PY2: value = p[2].decode(encoding='utf-8') # depends on [control=['if'], data=[]] else: value = p[2] self.builder.add_annotation_date(self.document, value) # depends on [c...
def recvRtspReply(self): """Receive RTSP reply from the server.""" while True: reply = self.rtspSocket.recv(1024) if reply: self.parseRtspReply(reply) # Close the RTSP socket upon requesting Teardown if self.requestSent == self.TEARDOWN: self.rtspSocket.shutdown(socket....
def function[recvRtspReply, parameter[self]]: constant[Receive RTSP reply from the server.] while constant[True] begin[:] variable[reply] assign[=] call[name[self].rtspSocket.recv, parameter[constant[1024]]] if name[reply] begin[:] call[name[self]....
keyword[def] identifier[recvRtspReply] ( identifier[self] ): literal[string] keyword[while] keyword[True] : identifier[reply] = identifier[self] . identifier[rtspSocket] . identifier[recv] ( literal[int] ) keyword[if] identifier[reply] : identifier[self] . identifier[parseRtspRepl...
def recvRtspReply(self): """Receive RTSP reply from the server.""" while True: reply = self.rtspSocket.recv(1024) if reply: self.parseRtspReply(reply) # depends on [control=['if'], data=[]] # Close the RTSP socket upon requesting Teardown if self.requestSent == self....
def load_django(self, query: "django query"): """Load the main dataframe from a django orm query :param query: django query from a model :type query: django query :example: ``ds.load_django(Mymodel.objects.all())`` """ try: self.df = self._load_django(query)...
def function[load_django, parameter[self, query]]: constant[Load the main dataframe from a django orm query :param query: django query from a model :type query: django query :example: ``ds.load_django(Mymodel.objects.all())`` ] <ast.Try object at 0x7da20c6c5ba0>
keyword[def] identifier[load_django] ( identifier[self] , identifier[query] : literal[string] ): literal[string] keyword[try] : identifier[self] . identifier[df] = identifier[self] . identifier[_load_django] ( identifier[query] ) keyword[except] identifier[Exception] keyword...
def load_django(self, query: 'django query'): """Load the main dataframe from a django orm query :param query: django query from a model :type query: django query :example: ``ds.load_django(Mymodel.objects.all())`` """ try: self.df = self._load_django(query) # depends ...
def verifiable(self): """ Returns True if this link can be verified after download, False if it cannot, and None if we cannot determine. """ trusted = self.trusted or getattr(self.comes_from, "trusted", None) if trusted is not None and trusted: # This link cam...
def function[verifiable, parameter[self]]: constant[ Returns True if this link can be verified after download, False if it cannot, and None if we cannot determine. ] variable[trusted] assign[=] <ast.BoolOp object at 0x7da204622fe0> if <ast.BoolOp object at 0x7da204621ae0>...
keyword[def] identifier[verifiable] ( identifier[self] ): literal[string] identifier[trusted] = identifier[self] . identifier[trusted] keyword[or] identifier[getattr] ( identifier[self] . identifier[comes_from] , literal[string] , keyword[None] ) keyword[if] identifier[trusted] keyword...
def verifiable(self): """ Returns True if this link can be verified after download, False if it cannot, and None if we cannot determine. """ trusted = self.trusted or getattr(self.comes_from, 'trusted', None) if trusted is not None and trusted: # This link came from a trusted...
def merge_text_nodes_on(self, node): """Merges all consecutive non-translatable text nodes into one""" if not isinstance(node, ContainerNode) or not node.children: return new_children = [] text_run = [] for i in node.children: if isinstance(i, Text) and ...
def function[merge_text_nodes_on, parameter[self, node]]: constant[Merges all consecutive non-translatable text nodes into one] if <ast.BoolOp object at 0x7da20c795cc0> begin[:] return[None] variable[new_children] assign[=] list[[]] variable[text_run] assign[=] list[[]] f...
keyword[def] identifier[merge_text_nodes_on] ( identifier[self] , identifier[node] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[node] , identifier[ContainerNode] ) keyword[or] keyword[not] identifier[node] . identifier[children] : keyword[return]...
def merge_text_nodes_on(self, node): """Merges all consecutive non-translatable text nodes into one""" if not isinstance(node, ContainerNode) or not node.children: return # depends on [control=['if'], data=[]] new_children = [] text_run = [] for i in node.children: if isinstance(i, ...
def calc_euler_tour(g, start, end): '''Calculates an Euler tour over the graph g from vertex start to vertex end. Assumes start and end are odd-degree vertices and that there are no other odd-degree vertices.''' even_g = nx.subgraph(g, g.nodes()).copy() if end in even_g.neighbors(start): # I...
def function[calc_euler_tour, parameter[g, start, end]]: constant[Calculates an Euler tour over the graph g from vertex start to vertex end. Assumes start and end are odd-degree vertices and that there are no other odd-degree vertices.] variable[even_g] assign[=] call[call[name[nx].subgraph, par...
keyword[def] identifier[calc_euler_tour] ( identifier[g] , identifier[start] , identifier[end] ): literal[string] identifier[even_g] = identifier[nx] . identifier[subgraph] ( identifier[g] , identifier[g] . identifier[nodes] ()). identifier[copy] () keyword[if] identifier[end] keyword[in] identifie...
def calc_euler_tour(g, start, end): """Calculates an Euler tour over the graph g from vertex start to vertex end. Assumes start and end are odd-degree vertices and that there are no other odd-degree vertices.""" even_g = nx.subgraph(g, g.nodes()).copy() if end in even_g.neighbors(start): # I...
def fix_spelling(self, words, join=True, joinstring=' '): """Simple function for quickly correcting misspelled words. Parameters ---------- words: list of str or str Either a list of pretokenized words or a string. In case of a string, it will be splitted using d...
def function[fix_spelling, parameter[self, words, join, joinstring]]: constant[Simple function for quickly correcting misspelled words. Parameters ---------- words: list of str or str Either a list of pretokenized words or a string. In case of a string, it will be splitted u...
keyword[def] identifier[fix_spelling] ( identifier[self] , identifier[words] , identifier[join] = keyword[True] , identifier[joinstring] = literal[string] ): literal[string] identifier[fixed_words] =[] keyword[for] identifier[word] keyword[in] identifier[self] . identifier[spellcheck] ...
def fix_spelling(self, words, join=True, joinstring=' '): """Simple function for quickly correcting misspelled words. Parameters ---------- words: list of str or str Either a list of pretokenized words or a string. In case of a string, it will be splitted using defau...
def __search(self): """ Performs the search. """ self.__search_results = [] editorsFiles = self.__container.default_target in self.__location.targets and \ [editor.file for editor in self.__container.script_editor.list_editors()] or [] self.__sear...
def function[__search, parameter[self]]: constant[ Performs the search. ] name[self].__search_results assign[=] list[[]] variable[editorsFiles] assign[=] <ast.BoolOp object at 0x7da1b0912680> call[name[self].__search_editors_files, parameter[name[editorsFiles]]] c...
keyword[def] identifier[__search] ( identifier[self] ): literal[string] identifier[self] . identifier[__search_results] =[] identifier[editorsFiles] = identifier[self] . identifier[__container] . identifier[default_target] keyword[in] identifier[self] . identifier[__location] . identif...
def __search(self): """ Performs the search. """ self.__search_results = [] editorsFiles = self.__container.default_target in self.__location.targets and [editor.file for editor in self.__container.script_editor.list_editors()] or [] self.__search_editors_files(editorsFiles) self.__s...
def get_package_version(path): '''Extracts the version''' with open(VERSION_FILE, "rt") as f: verstrline = f.read() VERSION = r"^version = ['\"]([^'\"]*)['\"]" results = re.search(VERSION, verstrline, re.M) if results: version = results.group(1) else: raise RuntimeError...
def function[get_package_version, parameter[path]]: constant[Extracts the version] with call[name[open], parameter[name[VERSION_FILE], constant[rt]]] begin[:] variable[verstrline] assign[=] call[name[f].read, parameter[]] variable[VERSION] assign[=] constant[^version = ['\"]([^'\...
keyword[def] identifier[get_package_version] ( identifier[path] ): literal[string] keyword[with] identifier[open] ( identifier[VERSION_FILE] , literal[string] ) keyword[as] identifier[f] : identifier[verstrline] = identifier[f] . identifier[read] () identifier[VERSION] = literal[string] ...
def get_package_version(path): """Extracts the version""" with open(VERSION_FILE, 'rt') as f: verstrline = f.read() # depends on [control=['with'], data=['f']] VERSION = '^version = [\'\\"]([^\'\\"]*)[\'\\"]' results = re.search(VERSION, verstrline, re.M) if results: version = resul...
def python_mime(fn): """ Decorator, which adds correct MIME type for python source to the decorated bottle API function. """ @wraps(fn) def python_mime_decorator(*args, **kwargs): response.content_type = "text/x-python" return fn(*args, **kwargs) return python_mime_decorato...
def function[python_mime, parameter[fn]]: constant[ Decorator, which adds correct MIME type for python source to the decorated bottle API function. ] def function[python_mime_decorator, parameter[]]: name[response].content_type assign[=] constant[text/x-python] return...
keyword[def] identifier[python_mime] ( identifier[fn] ): literal[string] @ identifier[wraps] ( identifier[fn] ) keyword[def] identifier[python_mime_decorator] (* identifier[args] ,** identifier[kwargs] ): identifier[response] . identifier[content_type] = literal[string] keyword[ret...
def python_mime(fn): """ Decorator, which adds correct MIME type for python source to the decorated bottle API function. """ @wraps(fn) def python_mime_decorator(*args, **kwargs): response.content_type = 'text/x-python' return fn(*args, **kwargs) return python_mime_decorator
def p_else_part_endif(p): """ else_part_inline : ELSE NEWLINE program_co endif | ELSE NEWLINE statements_co endif | ELSE NEWLINE co_statements_co endif | ELSE NEWLINE endif | ELSE NEWLINE LABEL statements_co endif ...
def function[p_else_part_endif, parameter[p]]: constant[ else_part_inline : ELSE NEWLINE program_co endif | ELSE NEWLINE statements_co endif | ELSE NEWLINE co_statements_co endif | ELSE NEWLINE endif | ELSE NEWLI...
keyword[def] identifier[p_else_part_endif] ( identifier[p] ): literal[string] keyword[if] identifier[p] [ literal[int] ]== literal[string] : keyword[if] identifier[len] ( identifier[p] )== literal[int] : identifier[p] [ literal[int] ]=[ identifier[make_nop] (), identifier[p] [ liter...
def p_else_part_endif(p): """ else_part_inline : ELSE NEWLINE program_co endif | ELSE NEWLINE statements_co endif | ELSE NEWLINE co_statements_co endif | ELSE NEWLINE endif | ELSE NEWLINE LABEL statements_co endif ...
def _download_vswhere(): """ Download vswhere to DOWNLOAD_PATH. """ print('downloading from', _get_latest_release_url()) try: from urllib.request import urlopen with urlopen(_get_latest_release_url()) as response, open(DOWNLOAD_PATH, 'wb') as outfile: shutil.copyfileobj(r...
def function[_download_vswhere, parameter[]]: constant[ Download vswhere to DOWNLOAD_PATH. ] call[name[print], parameter[constant[downloading from], call[name[_get_latest_release_url], parameter[]]]] <ast.Try object at 0x7da1b0aa6440>
keyword[def] identifier[_download_vswhere] (): literal[string] identifier[print] ( literal[string] , identifier[_get_latest_release_url] ()) keyword[try] : keyword[from] identifier[urllib] . identifier[request] keyword[import] identifier[urlopen] keyword[with] identifier[urlopen...
def _download_vswhere(): """ Download vswhere to DOWNLOAD_PATH. """ print('downloading from', _get_latest_release_url()) try: from urllib.request import urlopen with urlopen(_get_latest_release_url()) as response, open(DOWNLOAD_PATH, 'wb') as outfile: shutil.copyfileobj(r...
def get_season(self, season_key, card_type="micro_card"): """ Calling Season API. Arg: season_key: key of the season card_type: optional, default to micro_card. Accepted values are micro_card & summary_card Return: json data """ ...
def function[get_season, parameter[self, season_key, card_type]]: constant[ Calling Season API. Arg: season_key: key of the season card_type: optional, default to micro_card. Accepted values are micro_card & summary_card Return: json data ...
keyword[def] identifier[get_season] ( identifier[self] , identifier[season_key] , identifier[card_type] = literal[string] ): literal[string] identifier[season_url] = identifier[self] . identifier[api_path] + literal[string] + identifier[season_key] + literal[string] identifier[params] ={...
def get_season(self, season_key, card_type='micro_card'): """ Calling Season API. Arg: season_key: key of the season card_type: optional, default to micro_card. Accepted values are micro_card & summary_card Return: json data """ seas...
def ellipse(n=1000, adaptive=False): """ Get a parameterized set of vectors defining ellipse for a major and minor axis length. Resulting vector bundle has major axes along axes given. """ u = N.linspace(0,2*N.pi,n) # Get a bundle of vectors defining # a full rotation around the unit...
def function[ellipse, parameter[n, adaptive]]: constant[ Get a parameterized set of vectors defining ellipse for a major and minor axis length. Resulting vector bundle has major axes along axes given. ] variable[u] assign[=] call[name[N].linspace, parameter[constant[0], binary_operat...
keyword[def] identifier[ellipse] ( identifier[n] = literal[int] , identifier[adaptive] = keyword[False] ): literal[string] identifier[u] = identifier[N] . identifier[linspace] ( literal[int] , literal[int] * identifier[N] . identifier[pi] , identifier[n] ) keyword[return] identifier[N] . id...
def ellipse(n=1000, adaptive=False): """ Get a parameterized set of vectors defining ellipse for a major and minor axis length. Resulting vector bundle has major axes along axes given. """ u = N.linspace(0, 2 * N.pi, n) # Get a bundle of vectors defining # a full rotation around the ...
def get_dimension(self): """Get the dimension of the returned feature. This equals the number of elements in the returned list of numbers.""" return int(round(float(self.strokes**2)/2 + float(self.strokes)/2))
def function[get_dimension, parameter[self]]: constant[Get the dimension of the returned feature. This equals the number of elements in the returned list of numbers.] return[call[name[int], parameter[call[name[round], parameter[binary_operation[binary_operation[call[name[float], parameter[binary_...
keyword[def] identifier[get_dimension] ( identifier[self] ): literal[string] keyword[return] identifier[int] ( identifier[round] ( identifier[float] ( identifier[self] . identifier[strokes] ** literal[int] )/ literal[int] + identifier[float] ( identifier[self] . identifier[strokes] )/ literal[int]...
def get_dimension(self): """Get the dimension of the returned feature. This equals the number of elements in the returned list of numbers.""" return int(round(float(self.strokes ** 2) / 2 + float(self.strokes) / 2))
def nested_insert(self, item_list): """ Create a series of nested LIVVDicts given a list """ if len(item_list) == 1: self[item_list[0]] = LIVVDict() elif len(item_list) > 1: if item_list[0] not in self: self[item_list[0]] = LIVVDict() self[item...
def function[nested_insert, parameter[self, item_list]]: constant[ Create a series of nested LIVVDicts given a list ] if compare[call[name[len], parameter[name[item_list]]] equal[==] constant[1]] begin[:] call[name[self]][call[name[item_list]][constant[0]]] assign[=] call[name[LIVVDict],...
keyword[def] identifier[nested_insert] ( identifier[self] , identifier[item_list] ): literal[string] keyword[if] identifier[len] ( identifier[item_list] )== literal[int] : identifier[self] [ identifier[item_list] [ literal[int] ]]= identifier[LIVVDict] () keyword[elif] ident...
def nested_insert(self, item_list): """ Create a series of nested LIVVDicts given a list """ if len(item_list) == 1: self[item_list[0]] = LIVVDict() # depends on [control=['if'], data=[]] elif len(item_list) > 1: if item_list[0] not in self: self[item_list[0]] = LIVVDict() # de...
def rotate(self): '''Move the first address to the last position.''' item = self._address_infos.pop(0) self._address_infos.append(item)
def function[rotate, parameter[self]]: constant[Move the first address to the last position.] variable[item] assign[=] call[name[self]._address_infos.pop, parameter[constant[0]]] call[name[self]._address_infos.append, parameter[name[item]]]
keyword[def] identifier[rotate] ( identifier[self] ): literal[string] identifier[item] = identifier[self] . identifier[_address_infos] . identifier[pop] ( literal[int] ) identifier[self] . identifier[_address_infos] . identifier[append] ( identifier[item] )
def rotate(self): """Move the first address to the last position.""" item = self._address_infos.pop(0) self._address_infos.append(item)
def shortcut_app_id(shortcut): """ Generates the app id for a given shortcut. Steam uses app ids as a unique identifier for games, but since shortcuts dont have a canonical serverside representation they need to be generated on the fly. The important part about this function is that it will generate the same ...
def function[shortcut_app_id, parameter[shortcut]]: constant[ Generates the app id for a given shortcut. Steam uses app ids as a unique identifier for games, but since shortcuts dont have a canonical serverside representation they need to be generated on the fly. The important part about this function i...
keyword[def] identifier[shortcut_app_id] ( identifier[shortcut] ): literal[string] identifier[algorithm] = identifier[Crc] ( identifier[width] = literal[int] , identifier[poly] = literal[int] , identifier[reflect_in] = keyword[True] , identifier[xor_in] = literal[int] , identifier[reflect_out] = keyword[True] ...
def shortcut_app_id(shortcut): """ Generates the app id for a given shortcut. Steam uses app ids as a unique identifier for games, but since shortcuts dont have a canonical serverside representation they need to be generated on the fly. The important part about this function is that it will generate the sam...
def keypair_setup(): """Creates keypair if necessary, saves private key locally, returns contents of private key file.""" os.system('mkdir -p ' + u.PRIVATE_KEY_LOCATION) keypair_name = u.get_keypair_name() keypair = u.get_keypair_dict().get(keypair_name, None) keypair_fn = u.get_keypair_fn() if keypair:...
def function[keypair_setup, parameter[]]: constant[Creates keypair if necessary, saves private key locally, returns contents of private key file.] call[name[os].system, parameter[binary_operation[constant[mkdir -p ] + name[u].PRIVATE_KEY_LOCATION]]] variable[keypair_name] assign[=] call[name[u...
keyword[def] identifier[keypair_setup] (): literal[string] identifier[os] . identifier[system] ( literal[string] + identifier[u] . identifier[PRIVATE_KEY_LOCATION] ) identifier[keypair_name] = identifier[u] . identifier[get_keypair_name] () identifier[keypair] = identifier[u] . identifier[get_keypair_d...
def keypair_setup(): """Creates keypair if necessary, saves private key locally, returns contents of private key file.""" os.system('mkdir -p ' + u.PRIVATE_KEY_LOCATION) keypair_name = u.get_keypair_name() keypair = u.get_keypair_dict().get(keypair_name, None) keypair_fn = u.get_keypair_fn() i...
def get_localized_property(context, field=None, language=None): ''' When accessing to the name of the field itself, the value in the current language will be returned. Unless it's set, the value in the default language will be returned. ''' if language: return getattr(context, get_real_f...
def function[get_localized_property, parameter[context, field, language]]: constant[ When accessing to the name of the field itself, the value in the current language will be returned. Unless it's set, the value in the default language will be returned. ] if name[language] begin[:] ...
keyword[def] identifier[get_localized_property] ( identifier[context] , identifier[field] = keyword[None] , identifier[language] = keyword[None] ): literal[string] keyword[if] identifier[language] : keyword[return] identifier[getattr] ( identifier[context] , identifier[get_real_fieldname] ( iden...
def get_localized_property(context, field=None, language=None): """ When accessing to the name of the field itself, the value in the current language will be returned. Unless it's set, the value in the default language will be returned. """ if language: return getattr(context, get_real_f...
def render_source(output_dir, package_spec, jenv=JENV): """ Render and output """ path, module_name = package_spec.filepath java_template = jenv.get_template(TEMPLATE_NAME) module_path = "com." + package_spec.identifier yaml_filepath = "/".join(package_spec.filepath) + ".yaml" includes = [".".join(i.spl...
def function[render_source, parameter[output_dir, package_spec, jenv]]: constant[ Render and output ] <ast.Tuple object at 0x7da1b26ad750> assign[=] name[package_spec].filepath variable[java_template] assign[=] call[name[jenv].get_template, parameter[name[TEMPLATE_NAME]]] variable[mo...
keyword[def] identifier[render_source] ( identifier[output_dir] , identifier[package_spec] , identifier[jenv] = identifier[JENV] ): literal[string] identifier[path] , identifier[module_name] = identifier[package_spec] . identifier[filepath] identifier[java_template] = identifier[jenv] . identifier[get_temp...
def render_source(output_dir, package_spec, jenv=JENV): """ Render and output """ (path, module_name) = package_spec.filepath java_template = jenv.get_template(TEMPLATE_NAME) module_path = 'com.' + package_spec.identifier yaml_filepath = '/'.join(package_spec.filepath) + '.yaml' includes = [...
def write(self, word): """ .. _SOwrite: Write the ``chr`` representation of ``word`` to the ``open_stream``. If ``chr(word)`` fails due ``OverflowError``, a ``"?"`` will be written. """ self.repr_.setvalue(word) try: self.open_stream.write(chr(self.repr_.getvalue())) except OverflowError: sel...
def function[write, parameter[self, word]]: constant[ .. _SOwrite: Write the ``chr`` representation of ``word`` to the ``open_stream``. If ``chr(word)`` fails due ``OverflowError``, a ``"?"`` will be written. ] call[name[self].repr_.setvalue, parameter[name[word]]] <ast.Try object at 0x...
keyword[def] identifier[write] ( identifier[self] , identifier[word] ): literal[string] identifier[self] . identifier[repr_] . identifier[setvalue] ( identifier[word] ) keyword[try] : identifier[self] . identifier[open_stream] . identifier[write] ( identifier[chr] ( identifier[self] . identifier[repr_] ...
def write(self, word): """ .. _SOwrite: Write the ``chr`` representation of ``word`` to the ``open_stream``. If ``chr(word)`` fails due ``OverflowError``, a ``"?"`` will be written. """ self.repr_.setvalue(word) try: self.open_stream.write(chr(self.repr_.getvalue())) # depends on [cont...
def _updateNumbers(self, linenumers): """ add/remove line numbers """ b = self.blockCount() c = b - linenumers if c > 0: # remove lines numbers for _ in range(c): # remove last line: self.setFocus() s...
def function[_updateNumbers, parameter[self, linenumers]]: constant[ add/remove line numbers ] variable[b] assign[=] call[name[self].blockCount, parameter[]] variable[c] assign[=] binary_operation[name[b] - name[linenumers]] if compare[name[c] greater[>] constant[0]] begi...
keyword[def] identifier[_updateNumbers] ( identifier[self] , identifier[linenumers] ): literal[string] identifier[b] = identifier[self] . identifier[blockCount] () identifier[c] = identifier[b] - identifier[linenumers] keyword[if] identifier[c] > literal[int] : ...
def _updateNumbers(self, linenumers): """ add/remove line numbers """ b = self.blockCount() c = b - linenumers if c > 0: # remove lines numbers for _ in range(c): # remove last line: self.setFocus() storeCursorPos = self.textCursor() ...
def emit_only(self, event: str, func_names: Union[str, List[str]], *args, **kwargs) -> None: """ Specifically only emits certain subscribed events. :param event: Name of the event. :type event: str :param func_names: Function(s) to emit. :type func_names: Unio...
def function[emit_only, parameter[self, event, func_names]]: constant[ Specifically only emits certain subscribed events. :param event: Name of the event. :type event: str :param func_names: Function(s) to emit. :type func_names: Union[ str | List[str] ] ] if ca...
keyword[def] identifier[emit_only] ( identifier[self] , identifier[event] : identifier[str] , identifier[func_names] : identifier[Union] [ identifier[str] , identifier[List] [ identifier[str] ]],* identifier[args] , ** identifier[kwargs] )-> keyword[None] : literal[string] keyword[if] identifier[i...
def emit_only(self, event: str, func_names: Union[str, List[str]], *args, **kwargs) -> None: """ Specifically only emits certain subscribed events. :param event: Name of the event. :type event: str :param func_names: Function(s) to emit. :type func_names: Union[ str | List[str] ] ...
def set_meta(self, instance): """ Set django-meta stuff from LandingPageModel instance. """ self.use_title_tag = True self.title = instance.title
def function[set_meta, parameter[self, instance]]: constant[ Set django-meta stuff from LandingPageModel instance. ] name[self].use_title_tag assign[=] constant[True] name[self].title assign[=] name[instance].title
keyword[def] identifier[set_meta] ( identifier[self] , identifier[instance] ): literal[string] identifier[self] . identifier[use_title_tag] = keyword[True] identifier[self] . identifier[title] = identifier[instance] . identifier[title]
def set_meta(self, instance): """ Set django-meta stuff from LandingPageModel instance. """ self.use_title_tag = True self.title = instance.title
def get_image(self, float_key="floats", to_chw=True): """ get image list from ImageFrame """ tensors = callBigDlFunc(self.bigdl_type, "localImageFrameToImageTensor", self.value, float_key, to_chw) return map(lambda tensor: tensor.to_ndarray(), t...
def function[get_image, parameter[self, float_key, to_chw]]: constant[ get image list from ImageFrame ] variable[tensors] assign[=] call[name[callBigDlFunc], parameter[name[self].bigdl_type, constant[localImageFrameToImageTensor], name[self].value, name[float_key], name[to_chw]]] ret...
keyword[def] identifier[get_image] ( identifier[self] , identifier[float_key] = literal[string] , identifier[to_chw] = keyword[True] ): literal[string] identifier[tensors] = identifier[callBigDlFunc] ( identifier[self] . identifier[bigdl_type] , literal[string] , identifier[self] . identif...
def get_image(self, float_key='floats', to_chw=True): """ get image list from ImageFrame """ tensors = callBigDlFunc(self.bigdl_type, 'localImageFrameToImageTensor', self.value, float_key, to_chw) return map(lambda tensor: tensor.to_ndarray(), tensors)
def discover(cls, device, timeout_sec=TIMEOUT_SEC): """Wait until the specified device has discovered the expected services and characteristics for this service. Should be called once before other calls are made on the service. Returns true if the service has been discovered in the spe...
def function[discover, parameter[cls, device, timeout_sec]]: constant[Wait until the specified device has discovered the expected services and characteristics for this service. Should be called once before other calls are made on the service. Returns true if the service has been discov...
keyword[def] identifier[discover] ( identifier[cls] , identifier[device] , identifier[timeout_sec] = identifier[TIMEOUT_SEC] ): literal[string] identifier[device] . identifier[discover] ( identifier[cls] . identifier[SERVICES] , identifier[cls] . identifier[CHARACTERISTICS] , identifier[timeout_sec...
def discover(cls, device, timeout_sec=TIMEOUT_SEC): """Wait until the specified device has discovered the expected services and characteristics for this service. Should be called once before other calls are made on the service. Returns true if the service has been discovered in the specifi...
def ParseSudoersEntry(self, entry, sudoers_config): """Parse an entry and add it to the given SudoersConfig rdfvalue.""" key = entry[0] if key in SudoersFieldParser.ALIAS_TYPES: # Alias. alias_entry = rdf_config_file.SudoersAlias( type=SudoersFieldParser.ALIAS_TYPES.get(key), name=ent...
def function[ParseSudoersEntry, parameter[self, entry, sudoers_config]]: constant[Parse an entry and add it to the given SudoersConfig rdfvalue.] variable[key] assign[=] call[name[entry]][constant[0]] if compare[name[key] in name[SudoersFieldParser].ALIAS_TYPES] begin[:] variable...
keyword[def] identifier[ParseSudoersEntry] ( identifier[self] , identifier[entry] , identifier[sudoers_config] ): literal[string] identifier[key] = identifier[entry] [ literal[int] ] keyword[if] identifier[key] keyword[in] identifier[SudoersFieldParser] . identifier[ALIAS_TYPES] : iden...
def ParseSudoersEntry(self, entry, sudoers_config): """Parse an entry and add it to the given SudoersConfig rdfvalue.""" key = entry[0] if key in SudoersFieldParser.ALIAS_TYPES: # Alias. alias_entry = rdf_config_file.SudoersAlias(type=SudoersFieldParser.ALIAS_TYPES.get(key), name=entry[1]) ...
def flatten(items,enter=lambda x:isinstance(x, list)): # http://stackoverflow.com/a/40857703 # https://github.com/ctmakro/canton/blob/master/canton/misc.py """Yield items from any nested iterable; see REF.""" for x in items: if enter(x): yield from flatten(x) else: ...
def function[flatten, parameter[items, enter]]: constant[Yield items from any nested iterable; see REF.] for taget[name[x]] in starred[name[items]] begin[:] if call[name[enter], parameter[name[x]]] begin[:] <ast.YieldFrom object at 0x7da1b2033430>
keyword[def] identifier[flatten] ( identifier[items] , identifier[enter] = keyword[lambda] identifier[x] : identifier[isinstance] ( identifier[x] , identifier[list] )): literal[string] keyword[for] identifier[x] keyword[in] identifier[items] : keyword[if] identifier[enter] ( identifier[x] )...
def flatten(items, enter=lambda x: isinstance(x, list)): # http://stackoverflow.com/a/40857703 # https://github.com/ctmakro/canton/blob/master/canton/misc.py 'Yield items from any nested iterable; see REF.' for x in items: if enter(x): yield from flatten(x) # depends on [control=['i...
def release(): "Cut a new release" version = run('python setup.py --version').stdout.strip() assert version, 'No version found in setup.py?' print('### Releasing new version: {0}'.format(version)) run('git tag {0}'.format(version)) run('git push --tags') run('python setup.py sdist bdist_wh...
def function[release, parameter[]]: constant[Cut a new release] variable[version] assign[=] call[call[name[run], parameter[constant[python setup.py --version]]].stdout.strip, parameter[]] assert[name[version]] call[name[print], parameter[call[constant[### Releasing new version: {0}].format, ...
keyword[def] identifier[release] (): literal[string] identifier[version] = identifier[run] ( literal[string] ). identifier[stdout] . identifier[strip] () keyword[assert] identifier[version] , literal[string] identifier[print] ( literal[string] . identifier[format] ( identifier[version] )) ...
def release(): """Cut a new release""" version = run('python setup.py --version').stdout.strip() assert version, 'No version found in setup.py?' print('### Releasing new version: {0}'.format(version)) run('git tag {0}'.format(version)) run('git push --tags') run('python setup.py sdist bdist_...
def _print_foreign_playlist_message(self): """ reset previous message """ self.operation_mode = self.window_mode = NORMAL_MODE self.refreshBody() """ display new message """ txt='''A playlist by this name: __"|{0}|" already exists in the config directory. ...
def function[_print_foreign_playlist_message, parameter[self]]: constant[ reset previous message ] name[self].operation_mode assign[=] name[NORMAL_MODE] call[name[self].refreshBody, parameter[]] constant[ display new message ] variable[txt] assign[=] call[constant[A playlist by t...
keyword[def] identifier[_print_foreign_playlist_message] ( identifier[self] ): literal[string] identifier[self] . identifier[operation_mode] = identifier[self] . identifier[window_mode] = identifier[NORMAL_MODE] identifier[self] . identifier[refreshBody] () literal[string] ...
def _print_foreign_playlist_message(self): """ reset previous message """ self.operation_mode = self.window_mode = NORMAL_MODE self.refreshBody() ' display new message ' txt = 'A playlist by this name:\n __"|{0}|"\n already exists in the config directory.\n\n This pl...
def actions(self, state): '''Returns a list of the pieces we can move to the empty space.''' rows = string_to_list(state) row_e, col_e = find_location(rows, 'e') actions = [] if row_e > 0: actions.append(rows[row_e - 1][col_e]) if row_e < 2: actio...
def function[actions, parameter[self, state]]: constant[Returns a list of the pieces we can move to the empty space.] variable[rows] assign[=] call[name[string_to_list], parameter[name[state]]] <ast.Tuple object at 0x7da1b1504160> assign[=] call[name[find_location], parameter[name[rows], constan...
keyword[def] identifier[actions] ( identifier[self] , identifier[state] ): literal[string] identifier[rows] = identifier[string_to_list] ( identifier[state] ) identifier[row_e] , identifier[col_e] = identifier[find_location] ( identifier[rows] , literal[string] ) identifier[actio...
def actions(self, state): """Returns a list of the pieces we can move to the empty space.""" rows = string_to_list(state) (row_e, col_e) = find_location(rows, 'e') actions = [] if row_e > 0: actions.append(rows[row_e - 1][col_e]) # depends on [control=['if'], data=['row_e']] if row_e < ...
def get_log_entry(self, log_entry_id): """Gets the ``LogEntry`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``LogEntry`` may have a different ``Id`` than requested, such as the case where a duplicate ``Id...
def function[get_log_entry, parameter[self, log_entry_id]]: constant[Gets the ``LogEntry`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``LogEntry`` may have a different ``Id`` than requested, such as the case whe...
keyword[def] identifier[get_log_entry] ( identifier[self] , identifier[log_entry_id] ): literal[string] identifier[collection] = identifier[JSONClientValidated] ( literal[string] , identifier[collection] = literal[string] , identifier[runtime] = identifi...
def get_log_entry(self, log_entry_id): """Gets the ``LogEntry`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``LogEntry`` may have a different ``Id`` than requested, such as the case where a duplicate ``Id`` w...
def wait_for_parent_image_build(self, nvr): """ Given image NVR, wait for the build that produced it to show up in koji. If it doesn't within the timeout, raise an error. :return build info dict with 'nvr' and 'id' keys """ self.log.info('Waiting for Koji build for pare...
def function[wait_for_parent_image_build, parameter[self, nvr]]: constant[ Given image NVR, wait for the build that produced it to show up in koji. If it doesn't within the timeout, raise an error. :return build info dict with 'nvr' and 'id' keys ] call[name[self].log.in...
keyword[def] identifier[wait_for_parent_image_build] ( identifier[self] , identifier[nvr] ): literal[string] identifier[self] . identifier[log] . identifier[info] ( literal[string] , identifier[nvr] ) identifier[poll_start] = identifier[time] . identifier[time] () keyword[while] ...
def wait_for_parent_image_build(self, nvr): """ Given image NVR, wait for the build that produced it to show up in koji. If it doesn't within the timeout, raise an error. :return build info dict with 'nvr' and 'id' keys """ self.log.info('Waiting for Koji build for parent image ...
def plot_polygon(polygon, show=True, **kwargs): """ Plot a shapely polygon using matplotlib. Parameters ------------ polygon : shapely.geometry.Polygon Polygon to be plotted show : bool If True will display immediately **kwargs Passed to plt.plot """ import matplot...
def function[plot_polygon, parameter[polygon, show]]: constant[ Plot a shapely polygon using matplotlib. Parameters ------------ polygon : shapely.geometry.Polygon Polygon to be plotted show : bool If True will display immediately **kwargs Passed to plt.plot ] ...
keyword[def] identifier[plot_polygon] ( identifier[polygon] , identifier[show] = keyword[True] ,** identifier[kwargs] ): literal[string] keyword[import] identifier[matplotlib] . identifier[pyplot] keyword[as] identifier[plt] keyword[def] identifier[plot_single] ( identifier[single] ): i...
def plot_polygon(polygon, show=True, **kwargs): """ Plot a shapely polygon using matplotlib. Parameters ------------ polygon : shapely.geometry.Polygon Polygon to be plotted show : bool If True will display immediately **kwargs Passed to plt.plot """ import matplot...
def get_parent_gradebooks(self, gradebook_id): """Gets the parents of the given gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook return: (osid.grading.GradebookList) - the parents of the gradebook raise: NotFound - ``gradebook_id`` is not found ...
def function[get_parent_gradebooks, parameter[self, gradebook_id]]: constant[Gets the parents of the given gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook return: (osid.grading.GradebookList) - the parents of the gradebook raise: NotFound - ``gra...
keyword[def] identifier[get_parent_gradebooks] ( identifier[self] , identifier[gradebook_id] ): literal[string] keyword[if] identifier[self] . identifier[_catalog_session] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[self] . identifier[_cat...
def get_parent_gradebooks(self, gradebook_id): """Gets the parents of the given gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook return: (osid.grading.GradebookList) - the parents of the gradebook raise: NotFound - ``gradebook_id`` is not found ...
def cublasSgemm(handle, transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc): """ Matrix-matrix product for real general matrix. """ status = _libcublas.cublasSgemm_v2(handle, _CUBLAS_OP[transa], _CUBLAS_OP[transb],...
def function[cublasSgemm, parameter[handle, transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc]]: constant[ Matrix-matrix product for real general matrix. ] variable[status] assign[=] call[name[_libcublas].cublasSgemm_v2, parameter[name[handle], call[name[_CUBLAS_OP]][name[transa]], c...
keyword[def] identifier[cublasSgemm] ( identifier[handle] , identifier[transa] , identifier[transb] , identifier[m] , identifier[n] , identifier[k] , identifier[alpha] , identifier[A] , identifier[lda] , identifier[B] , identifier[ldb] , identifier[beta] , identifier[C] , identifier[ldc] ): literal[string] ...
def cublasSgemm(handle, transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc): """ Matrix-matrix product for real general matrix. """ status = _libcublas.cublasSgemm_v2(handle, _CUBLAS_OP[transa], _CUBLAS_OP[transb], m, n, k, ctypes.byref(ctypes.c_float(alpha)), int(A), lda, int(B), ldb, ctypes...
def getVolumes(self, obj=None, renderer=None): """ Return the list of the rendered Volumes. """ if renderer is None: renderer = self.renderer elif isinstance(renderer, int): renderer = self.renderers.index(renderer) else: return [] ...
def function[getVolumes, parameter[self, obj, renderer]]: constant[ Return the list of the rendered Volumes. ] if compare[name[renderer] is constant[None]] begin[:] variable[renderer] assign[=] name[self].renderer if <ast.BoolOp object at 0x7da1b06086d0> begin[:] ...
keyword[def] identifier[getVolumes] ( identifier[self] , identifier[obj] = keyword[None] , identifier[renderer] = keyword[None] ): literal[string] keyword[if] identifier[renderer] keyword[is] keyword[None] : identifier[renderer] = identifier[self] . identifier[renderer] ke...
def getVolumes(self, obj=None, renderer=None): """ Return the list of the rendered Volumes. """ if renderer is None: renderer = self.renderer # depends on [control=['if'], data=['renderer']] elif isinstance(renderer, int): renderer = self.renderers.index(renderer) # depends...
def square(self, n_coeffs, do_overlap_add=False): """ Compute a "square" view of the frequency adaptive transform, by resampling each frequency band such that they all contain the same number of samples, and performing an overlap-add procedure in the case where the sample frequen...
def function[square, parameter[self, n_coeffs, do_overlap_add]]: constant[ Compute a "square" view of the frequency adaptive transform, by resampling each frequency band such that they all contain the same number of samples, and performing an overlap-add procedure in the case whe...
keyword[def] identifier[square] ( identifier[self] , identifier[n_coeffs] , identifier[do_overlap_add] = keyword[False] ): literal[string] identifier[resampled_bands] =[ identifier[self] . identifier[_resample] ( identifier[band] , identifier[n_coeffs] ) keyword[for] identifier[b...
def square(self, n_coeffs, do_overlap_add=False): """ Compute a "square" view of the frequency adaptive transform, by resampling each frequency band such that they all contain the same number of samples, and performing an overlap-add procedure in the case where the sample frequency a...
def do_timer(self, args, arguments): """ :: Usage: timer on timer off timer list timer start NAME timer stop NAME timer resume NAME timer reset [NAME] ...
def function[do_timer, parameter[self, args, arguments]]: constant[ :: Usage: timer on timer off timer list timer start NAME timer stop NAME timer resume NAME ...
keyword[def] identifier[do_timer] ( identifier[self] , identifier[args] , identifier[arguments] ): literal[string] identifier[args] = identifier[args] . identifier[lower] () keyword[if] identifier[args] keyword[in] ( literal[string] , literal[string] ): id...
def do_timer(self, args, arguments): """ :: Usage: timer on timer off timer list timer start NAME timer stop NAME timer resume NAME timer reset [NAME] ...
def _adjust_cwd(self, path): """ Return an adjusted path if we're emulating a "current working directory" for the server. """ if type(path) is unicode: path = path.encode('utf-8') if self._cwd is None: return path if (len(path) > 0) and (pa...
def function[_adjust_cwd, parameter[self, path]]: constant[ Return an adjusted path if we're emulating a "current working directory" for the server. ] if compare[call[name[type], parameter[name[path]]] is name[unicode]] begin[:] variable[path] assign[=] call[name[...
keyword[def] identifier[_adjust_cwd] ( identifier[self] , identifier[path] ): literal[string] keyword[if] identifier[type] ( identifier[path] ) keyword[is] identifier[unicode] : identifier[path] = identifier[path] . identifier[encode] ( literal[string] ) keyword[if] identif...
def _adjust_cwd(self, path): """ Return an adjusted path if we're emulating a "current working directory" for the server. """ if type(path) is unicode: path = path.encode('utf-8') # depends on [control=['if'], data=[]] if self._cwd is None: return path # depends on ...
def simpleAttrs(self): """provide a copy of this player's attributes as a dictionary, but with objects flattened into a string representation of the object""" simpleAttrs = {} for k,v in iteritems(self.attrs): if k in ["_matches"]: continue # attributes to specifically ignore ...
def function[simpleAttrs, parameter[self]]: constant[provide a copy of this player's attributes as a dictionary, but with objects flattened into a string representation of the object] variable[simpleAttrs] assign[=] dictionary[[], []] for taget[tuple[[<ast.Name object at 0x7da1b0911930>, <ast.Na...
keyword[def] identifier[simpleAttrs] ( identifier[self] ): literal[string] identifier[simpleAttrs] ={} keyword[for] identifier[k] , identifier[v] keyword[in] identifier[iteritems] ( identifier[self] . identifier[attrs] ): keyword[if] identifier[k] keyword[in] [ literal[st...
def simpleAttrs(self): """provide a copy of this player's attributes as a dictionary, but with objects flattened into a string representation of the object""" simpleAttrs = {} for (k, v) in iteritems(self.attrs): if k in ['_matches']: continue # attributes to specifically ignore # depe...
async def getChatMember(self, chat_id, user_id): """ See: https://core.telegram.org/bots/api#getchatmember """ p = _strip(locals()) return await self._api_request('getChatMember', _rectify(p))
<ast.AsyncFunctionDef object at 0x7da1b1bad900>
keyword[async] keyword[def] identifier[getChatMember] ( identifier[self] , identifier[chat_id] , identifier[user_id] ): literal[string] identifier[p] = identifier[_strip] ( identifier[locals] ()) keyword[return] keyword[await] identifier[self] . identifier[_api_request] ( literal[string...
async def getChatMember(self, chat_id, user_id): """ See: https://core.telegram.org/bots/api#getchatmember """ p = _strip(locals()) return await self._api_request('getChatMember', _rectify(p))
def validate_VALUERANGE(in_value, restriction): """ Test to ensure that a value sits between a lower and upper bound. Parameters: A Decimal value and a tuple, containing a lower and upper bound, both as Decimal values. """ if len(restriction) != 2: raise ValidationError("Temp...
def function[validate_VALUERANGE, parameter[in_value, restriction]]: constant[ Test to ensure that a value sits between a lower and upper bound. Parameters: A Decimal value and a tuple, containing a lower and upper bound, both as Decimal values. ] if compare[call[name[len], p...
keyword[def] identifier[validate_VALUERANGE] ( identifier[in_value] , identifier[restriction] ): literal[string] keyword[if] identifier[len] ( identifier[restriction] )!= literal[int] : keyword[raise] identifier[ValidationError] ( literal[string] ) identifier[value] = identifier[_get_val] (...
def validate_VALUERANGE(in_value, restriction): """ Test to ensure that a value sits between a lower and upper bound. Parameters: A Decimal value and a tuple, containing a lower and upper bound, both as Decimal values. """ if len(restriction) != 2: raise ValidationError('Temp...
def maintained_selection(): """Maintain selection during context Example: >>> with maintained_selection(): ... # Modify selection ... node.setSelected(on=False, clear_all_selected=True) >>> # Selection restored """ previous_selection = hou.selectedNodes() t...
def function[maintained_selection, parameter[]]: constant[Maintain selection during context Example: >>> with maintained_selection(): ... # Modify selection ... node.setSelected(on=False, clear_all_selected=True) >>> # Selection restored ] variable[previ...
keyword[def] identifier[maintained_selection] (): literal[string] identifier[previous_selection] = identifier[hou] . identifier[selectedNodes] () keyword[try] : keyword[yield] keyword[finally] : keyword[if] identifier[previous_selection] : keyword[for] identifie...
def maintained_selection(): """Maintain selection during context Example: >>> with maintained_selection(): ... # Modify selection ... node.setSelected(on=False, clear_all_selected=True) >>> # Selection restored """ previous_selection = hou.selectedNodes() tr...
def _get_tz(tz): """ for a tz-aware type, return an encoded zone """ zone = timezones.get_timezone(tz) if zone is None: zone = tz.utcoffset().total_seconds() return zone
def function[_get_tz, parameter[tz]]: constant[ for a tz-aware type, return an encoded zone ] variable[zone] assign[=] call[name[timezones].get_timezone, parameter[name[tz]]] if compare[name[zone] is constant[None]] begin[:] variable[zone] assign[=] call[call[name[tz].utcoffset, ...
keyword[def] identifier[_get_tz] ( identifier[tz] ): literal[string] identifier[zone] = identifier[timezones] . identifier[get_timezone] ( identifier[tz] ) keyword[if] identifier[zone] keyword[is] keyword[None] : identifier[zone] = identifier[tz] . identifier[utcoffset] (). identifier[tota...
def _get_tz(tz): """ for a tz-aware type, return an encoded zone """ zone = timezones.get_timezone(tz) if zone is None: zone = tz.utcoffset().total_seconds() # depends on [control=['if'], data=['zone']] return zone
def send(self, out, addr=_MDNS_ADDR, port=_MDNS_PORT): """Sends an outgoing packet.""" # This is a quick test to see if we can parse the packets we generate #temp = DNSIncoming(out.packet()) for i in self.intf.values(): try: return i.sendto(out.packet(), 0, (a...
def function[send, parameter[self, out, addr, port]]: constant[Sends an outgoing packet.] for taget[name[i]] in starred[call[name[self].intf.values, parameter[]]] begin[:] <ast.Try object at 0x7da1b0fea4a0>
keyword[def] identifier[send] ( identifier[self] , identifier[out] , identifier[addr] = identifier[_MDNS_ADDR] , identifier[port] = identifier[_MDNS_PORT] ): literal[string] keyword[for] identifier[i] keyword[in] identifier[self] . identifier[intf] . identifier[values] (): ...
def send(self, out, addr=_MDNS_ADDR, port=_MDNS_PORT): """Sends an outgoing packet.""" # This is a quick test to see if we can parse the packets we generate #temp = DNSIncoming(out.packet()) for i in self.intf.values(): try: return i.sendto(out.packet(), 0, (addr, port)) # depends o...
def concatenate(cls, overlay): """ Concatenates an NdOverlay of Image types into a single 3D xarray Dataset. """ if not isinstance(overlay, NdOverlay): raise ValueError('Only NdOverlays can be concatenated') xarr = xr.concat([v.data.transpose() for v in overla...
def function[concatenate, parameter[cls, overlay]]: constant[ Concatenates an NdOverlay of Image types into a single 3D xarray Dataset. ] if <ast.UnaryOp object at 0x7da20c7cab90> begin[:] <ast.Raise object at 0x7da20c7ca980> variable[xarr] assign[=] call[name[xr]...
keyword[def] identifier[concatenate] ( identifier[cls] , identifier[overlay] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[overlay] , identifier[NdOverlay] ): keyword[raise] identifier[ValueError] ( literal[string] ) identifier[xarr] = iden...
def concatenate(cls, overlay): """ Concatenates an NdOverlay of Image types into a single 3D xarray Dataset. """ if not isinstance(overlay, NdOverlay): raise ValueError('Only NdOverlays can be concatenated') # depends on [control=['if'], data=[]] xarr = xr.concat([v.data.tra...
def _proxy(self): """ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context :returns: TaskQueueContext for this TaskQueueInstance :rtype: twilio.rest.taskrouter.v1.workspace.task_queu...
def function[_proxy, parameter[self]]: constant[ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context :returns: TaskQueueContext for this TaskQueueInstance :rtype: twilio.rest.taskro...
keyword[def] identifier[_proxy] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_context] keyword[is] keyword[None] : identifier[self] . identifier[_context] = identifier[TaskQueueContext] ( identifier[self] . identifier[_version] , ...
def _proxy(self): """ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context :returns: TaskQueueContext for this TaskQueueInstance :rtype: twilio.rest.taskrouter.v1.workspace.task_queue.Ta...
def table_dump(self, table): """dump all the rows of the given table name""" if not table: raise ValueError("no table") print('------- dumping table {}'.format(table)) pipes = ["gzip"] outfile_path = self._get_outfile_path(table) cmd = self._get_args( "pg_dum...
def function[table_dump, parameter[self, table]]: constant[dump all the rows of the given table name] if <ast.UnaryOp object at 0x7da20c76ff70> begin[:] <ast.Raise object at 0x7da20c76fee0> call[name[print], parameter[call[constant[------- dumping table {}].format, parameter[name[table]]...
keyword[def] identifier[table_dump] ( identifier[self] , identifier[table] ): literal[string] keyword[if] keyword[not] identifier[table] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[print] ( literal[string] . identifier[format] ( identifier[table] )) ...
def table_dump(self, table): """dump all the rows of the given table name""" if not table: raise ValueError('no table') # depends on [control=['if'], data=[]] print('------- dumping table {}'.format(table)) pipes = ['gzip'] outfile_path = self._get_outfile_path(table) #"--data-only", ...
def IDENTITY(val): ''' This is a basic "equality" index keygen, primarily meant to be used for things like:: Model.query.filter(col='value') Where ``FULL_TEXT`` would transform a sentence like "A Simple Sentence" into an inverted index searchable by the words "a", "simple", and/or "sentenc...
def function[IDENTITY, parameter[val]]: constant[ This is a basic "equality" index keygen, primarily meant to be used for things like:: Model.query.filter(col='value') Where ``FULL_TEXT`` would transform a sentence like "A Simple Sentence" into an inverted index searchable by the words...
keyword[def] identifier[IDENTITY] ( identifier[val] ): literal[string] keyword[if] keyword[not] identifier[val] : keyword[return] keyword[None] keyword[if] keyword[not] identifier[isinstance] ( identifier[val] , identifier[six] . identifier[string_types_ex] ): identifier[val] =...
def IDENTITY(val): """ This is a basic "equality" index keygen, primarily meant to be used for things like:: Model.query.filter(col='value') Where ``FULL_TEXT`` would transform a sentence like "A Simple Sentence" into an inverted index searchable by the words "a", "simple", and/or "sentenc...
def current_git_dir(): """Locate the .git directory.""" path = os.path.abspath(os.curdir) while path != '/': if os.path.isdir(os.path.join(path, '.git')): return os.path.join(path, '.git') path = os.path.dirname(path) return None
def function[current_git_dir, parameter[]]: constant[Locate the .git directory.] variable[path] assign[=] call[name[os].path.abspath, parameter[name[os].curdir]] while compare[name[path] not_equal[!=] constant[/]] begin[:] if call[name[os].path.isdir, parameter[call[name[os].path...
keyword[def] identifier[current_git_dir] (): literal[string] identifier[path] = identifier[os] . identifier[path] . identifier[abspath] ( identifier[os] . identifier[curdir] ) keyword[while] identifier[path] != literal[string] : keyword[if] identifier[os] . identifier[path] . identifier[isd...
def current_git_dir(): """Locate the .git directory.""" path = os.path.abspath(os.curdir) while path != '/': if os.path.isdir(os.path.join(path, '.git')): return os.path.join(path, '.git') # depends on [control=['if'], data=[]] path = os.path.dirname(path) # depends on [control...
def on_epoch_end(self) -> None: 'Updates indexes after each epoch for shuffling' self.indexes = np.arange(self.nrows) if self.shuffle: np.random.shuffle(self.indexes)
def function[on_epoch_end, parameter[self]]: constant[Updates indexes after each epoch for shuffling] name[self].indexes assign[=] call[name[np].arange, parameter[name[self].nrows]] if name[self].shuffle begin[:] call[name[np].random.shuffle, parameter[name[self].indexes]]
keyword[def] identifier[on_epoch_end] ( identifier[self] )-> keyword[None] : literal[string] identifier[self] . identifier[indexes] = identifier[np] . identifier[arange] ( identifier[self] . identifier[nrows] ) keyword[if] identifier[self] . identifier[shuffle] : identifier[n...
def on_epoch_end(self) -> None: """Updates indexes after each epoch for shuffling""" self.indexes = np.arange(self.nrows) if self.shuffle: np.random.shuffle(self.indexes) # depends on [control=['if'], data=[]]
def works(self, type_id): """ This method retrieve a iterable of Works of the given type. args: Crossref allowed document Types (String) return: Works() """ context = '%s/%s' % (self.ENDPOINT, str(type_id)) return Works(context=context)
def function[works, parameter[self, type_id]]: constant[ This method retrieve a iterable of Works of the given type. args: Crossref allowed document Types (String) return: Works() ] variable[context] assign[=] binary_operation[constant[%s/%s] <ast.Mod object at 0x7da259...
keyword[def] identifier[works] ( identifier[self] , identifier[type_id] ): literal[string] identifier[context] = literal[string] %( identifier[self] . identifier[ENDPOINT] , identifier[str] ( identifier[type_id] )) keyword[return] identifier[Works] ( identifier[context] = identifier[conte...
def works(self, type_id): """ This method retrieve a iterable of Works of the given type. args: Crossref allowed document Types (String) return: Works() """ context = '%s/%s' % (self.ENDPOINT, str(type_id)) return Works(context=context)
def archive_observer(population, num_generations, num_evaluations, args): """Print the current archive to the screen. This function displays the current archive of the evolutionary computation to the screen. .. Arguments: population -- the population of Individuals num_generati...
def function[archive_observer, parameter[population, num_generations, num_evaluations, args]]: constant[Print the current archive to the screen. This function displays the current archive of the evolutionary computation to the screen. .. Arguments: population -- the population of ...
keyword[def] identifier[archive_observer] ( identifier[population] , identifier[num_generations] , identifier[num_evaluations] , identifier[args] ): literal[string] identifier[archive] = identifier[args] [ literal[string] ]. identifier[archive] identifier[print] ( literal[string] ) identifier[pr...
def archive_observer(population, num_generations, num_evaluations, args): """Print the current archive to the screen. This function displays the current archive of the evolutionary computation to the screen. .. Arguments: population -- the population of Individuals num_generati...
def register_new_node(suffix_node_id=None): """Factory method, registers new node. """ node_id = uuid4() event = Node.Created(originator_id=node_id, suffix_node_id=suffix_node_id) entity = Node.mutate(event=event) publish(event) return entity
def function[register_new_node, parameter[suffix_node_id]]: constant[Factory method, registers new node. ] variable[node_id] assign[=] call[name[uuid4], parameter[]] variable[event] assign[=] call[name[Node].Created, parameter[]] variable[entity] assign[=] call[name[Node].mutate, par...
keyword[def] identifier[register_new_node] ( identifier[suffix_node_id] = keyword[None] ): literal[string] identifier[node_id] = identifier[uuid4] () identifier[event] = identifier[Node] . identifier[Created] ( identifier[originator_id] = identifier[node_id] , identifier[suffix_node_id] = identifier[s...
def register_new_node(suffix_node_id=None): """Factory method, registers new node. """ node_id = uuid4() event = Node.Created(originator_id=node_id, suffix_node_id=suffix_node_id) entity = Node.mutate(event=event) publish(event) return entity
def _colorbar_format(minval, maxval): """Return the format string for the colorbar.""" if not (np.isfinite(minval) and np.isfinite(maxval)): return str(maxval) else: return '%.{}f'.format(_digits(minval, maxval))
def function[_colorbar_format, parameter[minval, maxval]]: constant[Return the format string for the colorbar.] if <ast.UnaryOp object at 0x7da1b1e90760> begin[:] return[call[name[str], parameter[name[maxval]]]]
keyword[def] identifier[_colorbar_format] ( identifier[minval] , identifier[maxval] ): literal[string] keyword[if] keyword[not] ( identifier[np] . identifier[isfinite] ( identifier[minval] ) keyword[and] identifier[np] . identifier[isfinite] ( identifier[maxval] )): keyword[return] identifier[s...
def _colorbar_format(minval, maxval): """Return the format string for the colorbar.""" if not (np.isfinite(minval) and np.isfinite(maxval)): return str(maxval) # depends on [control=['if'], data=[]] else: return '%.{}f'.format(_digits(minval, maxval))
def _vasprun_float(f): """ Large numbers are often represented as ********* in the vasprun. This function parses these values as np.nan """ try: return float(f) except ValueError as e: f = f.strip() if f == '*' * len(f): warnings.warn('Float overflow (*******)...
def function[_vasprun_float, parameter[f]]: constant[ Large numbers are often represented as ********* in the vasprun. This function parses these values as np.nan ] <ast.Try object at 0x7da204347010>
keyword[def] identifier[_vasprun_float] ( identifier[f] ): literal[string] keyword[try] : keyword[return] identifier[float] ( identifier[f] ) keyword[except] identifier[ValueError] keyword[as] identifier[e] : identifier[f] = identifier[f] . identifier[strip] () keyword[i...
def _vasprun_float(f): """ Large numbers are often represented as ********* in the vasprun. This function parses these values as np.nan """ try: return float(f) # depends on [control=['try'], data=[]] except ValueError as e: f = f.strip() if f == '*' * len(f): ...
def _plot_figure(self, idx, fig_format='json'): """ Returns the figure in html format on the first call and """ self.plot.update(idx) if self.embed: return self.renderer.diff(self.plot)
def function[_plot_figure, parameter[self, idx, fig_format]]: constant[ Returns the figure in html format on the first call and ] call[name[self].plot.update, parameter[name[idx]]] if name[self].embed begin[:] return[call[name[self].renderer.diff, parameter[name[s...
keyword[def] identifier[_plot_figure] ( identifier[self] , identifier[idx] , identifier[fig_format] = literal[string] ): literal[string] identifier[self] . identifier[plot] . identifier[update] ( identifier[idx] ) keyword[if] identifier[self] . identifier[embed] : keyword[ret...
def _plot_figure(self, idx, fig_format='json'): """ Returns the figure in html format on the first call and """ self.plot.update(idx) if self.embed: return self.renderer.diff(self.plot) # depends on [control=['if'], data=[]]
def exclude(self, func=None): """ Return a new Collection excluding some items Parameters: func : function(Node) -> Scalar A function that, when called on each item in the collection, returns a boolean-like value. If no function is p...
def function[exclude, parameter[self, func]]: constant[ Return a new Collection excluding some items Parameters: func : function(Node) -> Scalar A function that, when called on each item in the collection, returns a boolean-like valu...
keyword[def] identifier[exclude] ( identifier[self] , identifier[func] = keyword[None] ): literal[string] identifier[func] = identifier[_make_callable] ( identifier[func] ) identifier[inverse] = keyword[lambda] identifier[x] : keyword[not] identifier[func] ( identifier[x] ) keyw...
def exclude(self, func=None): """ Return a new Collection excluding some items Parameters: func : function(Node) -> Scalar A function that, when called on each item in the collection, returns a boolean-like value. If no function is provi...
def create_anchor_from_header(header, existing_anchors=None): """ Creates GitHub style auto-generated anchor tags from header line strings :param header: The portion of the line that should be converted :param existing_anchors: A dictionary of AnchorHub tags to auto-generated anchors :retur...
def function[create_anchor_from_header, parameter[header, existing_anchors]]: constant[ Creates GitHub style auto-generated anchor tags from header line strings :param header: The portion of the line that should be converted :param existing_anchors: A dictionary of AnchorHub tags to auto-generated ...
keyword[def] identifier[create_anchor_from_header] ( identifier[header] , identifier[existing_anchors] = keyword[None] ): literal[string] identifier[out] = identifier[header] . identifier[strip] (). identifier[lower] () identifier[out] = identifier[re] . identifier[sub] ( literal[string] , ...
def create_anchor_from_header(header, existing_anchors=None): """ Creates GitHub style auto-generated anchor tags from header line strings :param header: The portion of the line that should be converted :param existing_anchors: A dictionary of AnchorHub tags to auto-generated anchors :retur...
def natsorted(seq, key=None, reverse=False, alg=ns.DEFAULT): """ Sorts an iterable naturally. Parameters ---------- seq : iterable The input to sort. key : callable, optional A key used to determine how to sort each element of the iterable. It is **not** applied recursi...
def function[natsorted, parameter[seq, key, reverse, alg]]: constant[ Sorts an iterable naturally. Parameters ---------- seq : iterable The input to sort. key : callable, optional A key used to determine how to sort each element of the iterable. It is **not** applie...
keyword[def] identifier[natsorted] ( identifier[seq] , identifier[key] = keyword[None] , identifier[reverse] = keyword[False] , identifier[alg] = identifier[ns] . identifier[DEFAULT] ): literal[string] identifier[key] = identifier[natsort_keygen] ( identifier[key] , identifier[alg] ) keyword[return] ...
def natsorted(seq, key=None, reverse=False, alg=ns.DEFAULT): """ Sorts an iterable naturally. Parameters ---------- seq : iterable The input to sort. key : callable, optional A key used to determine how to sort each element of the iterable. It is **not** applied recursi...
def validate_keys(dict_, expected, funcname): """Validate that a dictionary has an expected set of keys. """ expected = set(expected) received = set(dict_) missing = expected - received if missing: raise ValueError( "Missing keys in {}:\n" "Expected Keys: {}\n" ...
def function[validate_keys, parameter[dict_, expected, funcname]]: constant[Validate that a dictionary has an expected set of keys. ] variable[expected] assign[=] call[name[set], parameter[name[expected]]] variable[received] assign[=] call[name[set], parameter[name[dict_]]] variable[...
keyword[def] identifier[validate_keys] ( identifier[dict_] , identifier[expected] , identifier[funcname] ): literal[string] identifier[expected] = identifier[set] ( identifier[expected] ) identifier[received] = identifier[set] ( identifier[dict_] ) identifier[missing] = identifier[expected] - id...
def validate_keys(dict_, expected, funcname): """Validate that a dictionary has an expected set of keys. """ expected = set(expected) received = set(dict_) missing = expected - received if missing: raise ValueError('Missing keys in {}:\nExpected Keys: {}\nReceived Keys: {}'.format(funcna...
def relation_for_unit(unit=None, rid=None): """Get the json represenation of a unit's relation""" unit = unit or remote_unit() relation = relation_get(unit=unit, rid=rid) for key in relation: if key.endswith('-list'): relation[key] = relation[key].split() relation['__unit__'] = u...
def function[relation_for_unit, parameter[unit, rid]]: constant[Get the json represenation of a unit's relation] variable[unit] assign[=] <ast.BoolOp object at 0x7da18bc720b0> variable[relation] assign[=] call[name[relation_get], parameter[]] for taget[name[key]] in starred[name[relation...
keyword[def] identifier[relation_for_unit] ( identifier[unit] = keyword[None] , identifier[rid] = keyword[None] ): literal[string] identifier[unit] = identifier[unit] keyword[or] identifier[remote_unit] () identifier[relation] = identifier[relation_get] ( identifier[unit] = identifier[unit] , identi...
def relation_for_unit(unit=None, rid=None): """Get the json represenation of a unit's relation""" unit = unit or remote_unit() relation = relation_get(unit=unit, rid=rid) for key in relation: if key.endswith('-list'): relation[key] = relation[key].split() # depends on [control=['if'...
def locality_preserving_projections(self, coordinates, num_dims=None): '''Locality Preserving Projections (LPP, linearized Laplacian Eigenmaps).''' X = np.atleast_2d(coordinates) # n x d L = self.laplacian(normed=True) # n x n u,s,_ = np.linalg.svd(X.T.dot(X)) Fplus = np.linalg.pinv(u * np.sqrt(s)...
def function[locality_preserving_projections, parameter[self, coordinates, num_dims]]: constant[Locality Preserving Projections (LPP, linearized Laplacian Eigenmaps).] variable[X] assign[=] call[name[np].atleast_2d, parameter[name[coordinates]]] variable[L] assign[=] call[name[self].laplacian, p...
keyword[def] identifier[locality_preserving_projections] ( identifier[self] , identifier[coordinates] , identifier[num_dims] = keyword[None] ): literal[string] identifier[X] = identifier[np] . identifier[atleast_2d] ( identifier[coordinates] ) identifier[L] = identifier[self] . identifier[laplacian] (...
def locality_preserving_projections(self, coordinates, num_dims=None): """Locality Preserving Projections (LPP, linearized Laplacian Eigenmaps).""" X = np.atleast_2d(coordinates) # n x d L = self.laplacian(normed=True) # n x n (u, s, _) = np.linalg.svd(X.T.dot(X)) Fplus = np.linalg.pinv(u * np.sqr...
def writeFasta(sequence, sequence_name, output_file): """ Writes a fasta sequence into a file. :param sequence: a string with the sequence to be written :param sequence_name: name of the the fasta sequence :param output_file: /path/to/file.fa to be written :returns: nothing """ i=0 ...
def function[writeFasta, parameter[sequence, sequence_name, output_file]]: constant[ Writes a fasta sequence into a file. :param sequence: a string with the sequence to be written :param sequence_name: name of the the fasta sequence :param output_file: /path/to/file.fa to be written :retur...
keyword[def] identifier[writeFasta] ( identifier[sequence] , identifier[sequence_name] , identifier[output_file] ): literal[string] identifier[i] = literal[int] identifier[f] = identifier[open] ( identifier[output_file] , literal[string] ) identifier[f] . identifier[write] ( literal[string] + id...
def writeFasta(sequence, sequence_name, output_file): """ Writes a fasta sequence into a file. :param sequence: a string with the sequence to be written :param sequence_name: name of the the fasta sequence :param output_file: /path/to/file.fa to be written :returns: nothing """ i = 0 ...
def parse_prices_from_file_stream(self, file_stream) -> List[PriceModel]: """ Reads a file stream (i.e. from web form) containing a csv prices into a list of Price models. """ content = file_stream.read().decode("utf-8") file_stream.close() if not content: ...
def function[parse_prices_from_file_stream, parameter[self, file_stream]]: constant[ Reads a file stream (i.e. from web form) containing a csv prices into a list of Price models. ] variable[content] assign[=] call[call[name[file_stream].read, parameter[]].decode, parameter[consta...
keyword[def] identifier[parse_prices_from_file_stream] ( identifier[self] , identifier[file_stream] )-> identifier[List] [ identifier[PriceModel] ]: literal[string] identifier[content] = identifier[file_stream] . identifier[read] (). identifier[decode] ( literal[string] ) identifier[file_s...
def parse_prices_from_file_stream(self, file_stream) -> List[PriceModel]: """ Reads a file stream (i.e. from web form) containing a csv prices into a list of Price models. """ content = file_stream.read().decode('utf-8') file_stream.close() if not content: raise ValueErro...
def maha_dist(df): """Compute the squared Mahalanobis Distance for each row in the dataframe Given a list of rows `x`, each with `p` elements, a vector :math:\mu of the row means of length `p`, and the :math:pxp covarence matrix of the columns :math:\Sigma, The returned value for each row is: ...
def function[maha_dist, parameter[df]]: constant[Compute the squared Mahalanobis Distance for each row in the dataframe Given a list of rows `x`, each with `p` elements, a vector :math:\mu of the row means of length `p`, and the :math:pxp covarence matrix of the columns :math:\Sigma, The retur...
keyword[def] identifier[maha_dist] ( identifier[df] ): literal[string] identifier[mean] = identifier[df] . identifier[mean] () identifier[S_1] = identifier[np] . identifier[linalg] . identifier[inv] ( identifier[df] . identifier[cov] ()) keyword[def] identifier[fun] ( identifier[row] ): ...
def maha_dist(df): """Compute the squared Mahalanobis Distance for each row in the dataframe Given a list of rows `x`, each with `p` elements, a vector :math:\\mu of the row means of length `p`, and the :math:pxp covarence matrix of the columns :math:\\Sigma, The returned value for each row is: ...
def get_observatory_status(self, observatory_id, status_time=None): """ Get details of the specified camera's status :param string observatory_id: a observatory ID, as returned by list_observatories() :param float status_time: optional, if specified attempts to g...
def function[get_observatory_status, parameter[self, observatory_id, status_time]]: constant[ Get details of the specified camera's status :param string observatory_id: a observatory ID, as returned by list_observatories() :param float status_time: optional, if s...
keyword[def] identifier[get_observatory_status] ( identifier[self] , identifier[observatory_id] , identifier[status_time] = keyword[None] ): literal[string] keyword[if] identifier[status_time] keyword[is] keyword[None] : identifier[response] = identifier[requests] . identifier[get] ...
def get_observatory_status(self, observatory_id, status_time=None): """ Get details of the specified camera's status :param string observatory_id: a observatory ID, as returned by list_observatories() :param float status_time: optional, if specified attempts to get t...
def wkt_to_rectangle(extent): """Compute the rectangle from a WKT string. It returns None if the extent is not valid WKT rectangle. :param extent: The extent. :type extent: basestring :return: The rectangle or None if it is not a valid WKT rectangle. :rtype: QgsRectangle """ geometry ...
def function[wkt_to_rectangle, parameter[extent]]: constant[Compute the rectangle from a WKT string. It returns None if the extent is not valid WKT rectangle. :param extent: The extent. :type extent: basestring :return: The rectangle or None if it is not a valid WKT rectangle. :rtype: Qgs...
keyword[def] identifier[wkt_to_rectangle] ( identifier[extent] ): literal[string] identifier[geometry] = identifier[QgsGeometry] . identifier[fromWkt] ( identifier[extent] ) keyword[if] keyword[not] identifier[geometry] . identifier[isGeosValid] (): keyword[return] keyword[None] ide...
def wkt_to_rectangle(extent): """Compute the rectangle from a WKT string. It returns None if the extent is not valid WKT rectangle. :param extent: The extent. :type extent: basestring :return: The rectangle or None if it is not a valid WKT rectangle. :rtype: QgsRectangle """ geometry ...
def find_parent_outputs(provider: Provider, utxo: TxIn) -> TxOut: '''due to design of the btcpy library, TxIn object must be converted to TxOut object before signing''' network_params = net_query(provider.network) index = utxo.txout # utxo index return TxOut.from_json(provider.getrawtransaction(utxo.t...
def function[find_parent_outputs, parameter[provider, utxo]]: constant[due to design of the btcpy library, TxIn object must be converted to TxOut object before signing] variable[network_params] assign[=] call[name[net_query], parameter[name[provider].network]] variable[index] assign[=] name[utxo...
keyword[def] identifier[find_parent_outputs] ( identifier[provider] : identifier[Provider] , identifier[utxo] : identifier[TxIn] )-> identifier[TxOut] : literal[string] identifier[network_params] = identifier[net_query] ( identifier[provider] . identifier[network] ) identifier[index] = identifier[utx...
def find_parent_outputs(provider: Provider, utxo: TxIn) -> TxOut: """due to design of the btcpy library, TxIn object must be converted to TxOut object before signing""" network_params = net_query(provider.network) index = utxo.txout # utxo index return TxOut.from_json(provider.getrawtransaction(utxo.tx...
def round_sig_error2(x, ex1, ex2, n): '''Find min(ex1,ex2) rounded to n sig-figs and make the floating point x and max(ex,ex2) match the number of decimals.''' minerr = min(ex1,ex2) minstex = round_sig(minerr,n) if minstex.find('.') < 0: extra_zeros = len(minstex) - n sigfigs = len(s...
def function[round_sig_error2, parameter[x, ex1, ex2, n]]: constant[Find min(ex1,ex2) rounded to n sig-figs and make the floating point x and max(ex,ex2) match the number of decimals.] variable[minerr] assign[=] call[name[min], parameter[name[ex1], name[ex2]]] variable[minstex] assign[=] cal...
keyword[def] identifier[round_sig_error2] ( identifier[x] , identifier[ex1] , identifier[ex2] , identifier[n] ): literal[string] identifier[minerr] = identifier[min] ( identifier[ex1] , identifier[ex2] ) identifier[minstex] = identifier[round_sig] ( identifier[minerr] , identifier[n] ) keyword[if...
def round_sig_error2(x, ex1, ex2, n): """Find min(ex1,ex2) rounded to n sig-figs and make the floating point x and max(ex,ex2) match the number of decimals.""" minerr = min(ex1, ex2) minstex = round_sig(minerr, n) if minstex.find('.') < 0: extra_zeros = len(minstex) - n sigfigs = len...
def consume(self, callback, *, no_local=False, no_ack=False, exclusive=False, arguments=None): """ Start a consumer on the queue. Messages will be delivered asynchronously to the consumer. The callback function will be called whenever a new message arrives on the queue. Advanced usage: ...
def function[consume, parameter[self, callback]]: constant[ Start a consumer on the queue. Messages will be delivered asynchronously to the consumer. The callback function will be called whenever a new message arrives on the queue. Advanced usage: the callback object must be callable ...
keyword[def] identifier[consume] ( identifier[self] , identifier[callback] ,*, identifier[no_local] = keyword[False] , identifier[no_ack] = keyword[False] , identifier[exclusive] = keyword[False] , identifier[arguments] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[d...
def consume(self, callback, *, no_local=False, no_ack=False, exclusive=False, arguments=None): """ Start a consumer on the queue. Messages will be delivered asynchronously to the consumer. The callback function will be called whenever a new message arrives on the queue. Advanced usage: the ...
def timer(self, key, **dims): """Adds timer with dimensions to the registry""" return super(RegexRegistry, self).timer(self._get_key(key), **dims)
def function[timer, parameter[self, key]]: constant[Adds timer with dimensions to the registry] return[call[call[name[super], parameter[name[RegexRegistry], name[self]]].timer, parameter[call[name[self]._get_key, parameter[name[key]]]]]]
keyword[def] identifier[timer] ( identifier[self] , identifier[key] ,** identifier[dims] ): literal[string] keyword[return] identifier[super] ( identifier[RegexRegistry] , identifier[self] ). identifier[timer] ( identifier[self] . identifier[_get_key] ( identifier[key] ),** identifier[dims] )
def timer(self, key, **dims): """Adds timer with dimensions to the registry""" return super(RegexRegistry, self).timer(self._get_key(key), **dims)
def cosine(vec1, vec2): """Compare vectors. Borrowed from A. Parish.""" if norm(vec1) > 0 and norm(vec2) > 0: return dot(vec1, vec2) / (norm(vec1) * norm(vec2)) else: return 0.0
def function[cosine, parameter[vec1, vec2]]: constant[Compare vectors. Borrowed from A. Parish.] if <ast.BoolOp object at 0x7da20c6aaf50> begin[:] return[binary_operation[call[name[dot], parameter[name[vec1], name[vec2]]] / binary_operation[call[name[norm], parameter[name[vec1]]] * call[name[nor...
keyword[def] identifier[cosine] ( identifier[vec1] , identifier[vec2] ): literal[string] keyword[if] identifier[norm] ( identifier[vec1] )> literal[int] keyword[and] identifier[norm] ( identifier[vec2] )> literal[int] : keyword[return] identifier[dot] ( identifier[vec1] , identifier[vec2] )/( ...
def cosine(vec1, vec2): """Compare vectors. Borrowed from A. Parish.""" if norm(vec1) > 0 and norm(vec2) > 0: return dot(vec1, vec2) / (norm(vec1) * norm(vec2)) # depends on [control=['if'], data=[]] else: return 0.0
def _find_script(script_name): """ Find the script. If the input is not a file, then $PATH will be searched. """ if os.path.isfile(script_name): return script_name path = os.getenv('PATH', os.defpath).split(os.pathsep) for folder in path: if not folder: continue ...
def function[_find_script, parameter[script_name]]: constant[ Find the script. If the input is not a file, then $PATH will be searched. ] if call[name[os].path.isfile, parameter[name[script_name]]] begin[:] return[name[script_name]] variable[path] assign[=] call[call[name[os].ge...
keyword[def] identifier[_find_script] ( identifier[script_name] ): literal[string] keyword[if] identifier[os] . identifier[path] . identifier[isfile] ( identifier[script_name] ): keyword[return] identifier[script_name] identifier[path] = identifier[os] . identifier[getenv] ( literal[string...
def _find_script(script_name): """ Find the script. If the input is not a file, then $PATH will be searched. """ if os.path.isfile(script_name): return script_name # depends on [control=['if'], data=[]] path = os.getenv('PATH', os.defpath).split(os.pathsep) for folder in path: ...
def dispatch(self, event): """Given an event, send it to all the subscribers. Args event (:class:`~bigchaindb.events.EventTypes`): the event to dispatch to all the subscribers. """ for event_types, queues in self.queues.items(): if event.type & e...
def function[dispatch, parameter[self, event]]: constant[Given an event, send it to all the subscribers. Args event (:class:`~bigchaindb.events.EventTypes`): the event to dispatch to all the subscribers. ] for taget[tuple[[<ast.Name object at 0x7da1b1b60bb0>,...
keyword[def] identifier[dispatch] ( identifier[self] , identifier[event] ): literal[string] keyword[for] identifier[event_types] , identifier[queues] keyword[in] identifier[self] . identifier[queues] . identifier[items] (): keyword[if] identifier[event] . identifier[type] & identi...
def dispatch(self, event): """Given an event, send it to all the subscribers. Args event (:class:`~bigchaindb.events.EventTypes`): the event to dispatch to all the subscribers. """ for (event_types, queues) in self.queues.items(): if event.type & event_types:...
def _next_sample_index(self): """ShuffledMux chooses its next sample stream randomly, conditioned on the stream weights. """ return self.rng.choice(self.n_streams, p=(self.stream_weights_ / self.weight_norm_))
def function[_next_sample_index, parameter[self]]: constant[ShuffledMux chooses its next sample stream randomly, conditioned on the stream weights. ] return[call[name[self].rng.choice, parameter[name[self].n_streams]]]
keyword[def] identifier[_next_sample_index] ( identifier[self] ): literal[string] keyword[return] identifier[self] . identifier[rng] . identifier[choice] ( identifier[self] . identifier[n_streams] , identifier[p] =( identifier[self] . identifier[stream_weights_] / identifier[self...
def _next_sample_index(self): """ShuffledMux chooses its next sample stream randomly, conditioned on the stream weights. """ return self.rng.choice(self.n_streams, p=self.stream_weights_ / self.weight_norm_)
def sendmail(self, to, message): """Send mail to one or more recipients. The required arguments are a list of RFC 822 to-address strings (a bare string will be treated as a list with 1 address), and a message string. """ # If we were passed a bare string as the To: address, con...
def function[sendmail, parameter[self, to, message]]: constant[Send mail to one or more recipients. The required arguments are a list of RFC 822 to-address strings (a bare string will be treated as a list with 1 address), and a message string. ] if call[name[isinstance], paramet...
keyword[def] identifier[sendmail] ( identifier[self] , identifier[to] , identifier[message] ): literal[string] keyword[if] identifier[isinstance] ( identifier[to] , identifier[str] ): identifier[to] =[ identifier[to] ,] identifier[server] = id...
def sendmail(self, to, message): """Send mail to one or more recipients. The required arguments are a list of RFC 822 to-address strings (a bare string will be treated as a list with 1 address), and a message string. """ # If we were passed a bare string as the To: address, convert it t...
def image_create(comptparms, clrspc): """Creates a new image structure. Wraps the openjp2 library function opj_image_create. Parameters ---------- cmptparms : comptparms_t The component parameters. clrspc : int Specifies the color space. Returns ------- image : Ima...
def function[image_create, parameter[comptparms, clrspc]]: constant[Creates a new image structure. Wraps the openjp2 library function opj_image_create. Parameters ---------- cmptparms : comptparms_t The component parameters. clrspc : int Specifies the color space. Retu...
keyword[def] identifier[image_create] ( identifier[comptparms] , identifier[clrspc] ): literal[string] identifier[OPENJP2] . identifier[opj_image_create] . identifier[argtypes] =[ identifier[ctypes] . identifier[c_uint32] , identifier[ctypes] . identifier[POINTER] ( identifier[ImageComptParmType] ), ...
def image_create(comptparms, clrspc): """Creates a new image structure. Wraps the openjp2 library function opj_image_create. Parameters ---------- cmptparms : comptparms_t The component parameters. clrspc : int Specifies the color space. Returns ------- image : Ima...
def hosts2map (hosts): """ Return a set of named hosts, and a list of subnets (host/netmask adresses). Only IPv4 host/netmasks are supported. """ hostset = set() nets = [] for host in hosts: if _host_cidrmask_re.match(host): host, mask = host.split("/") ma...
def function[hosts2map, parameter[hosts]]: constant[ Return a set of named hosts, and a list of subnets (host/netmask adresses). Only IPv4 host/netmasks are supported. ] variable[hostset] assign[=] call[name[set], parameter[]] variable[nets] assign[=] list[[]] for taget[n...
keyword[def] identifier[hosts2map] ( identifier[hosts] ): literal[string] identifier[hostset] = identifier[set] () identifier[nets] =[] keyword[for] identifier[host] keyword[in] identifier[hosts] : keyword[if] identifier[_host_cidrmask_re] . identifier[match] ( identifier[host] ): ...
def hosts2map(hosts): """ Return a set of named hosts, and a list of subnets (host/netmask adresses). Only IPv4 host/netmasks are supported. """ hostset = set() nets = [] for host in hosts: if _host_cidrmask_re.match(host): (host, mask) = host.split('/') m...
def bc02(data): """ get APWP from Besse and Courtillot 2002 paper Parameters ---------- Takes input as [plate, site_lat, site_lon, age] plate : string (options: AF, ANT, AU, EU, GL, IN, NA, SA) site_lat : float site_lon : float age : float in Myr Returns ---------- """...
def function[bc02, parameter[data]]: constant[ get APWP from Besse and Courtillot 2002 paper Parameters ---------- Takes input as [plate, site_lat, site_lon, age] plate : string (options: AF, ANT, AU, EU, GL, IN, NA, SA) site_lat : float site_lon : float age : float in Myr ...
keyword[def] identifier[bc02] ( identifier[data] ): literal[string] identifier[plate] , identifier[site_lat] , identifier[site_lon] , identifier[age] = identifier[data] [ literal[int] ], identifier[data] [ literal[int] ], identifier[data] [ literal[int] ], identifier[data] [ literal[int] ] identifier...
def bc02(data): """ get APWP from Besse and Courtillot 2002 paper Parameters ---------- Takes input as [plate, site_lat, site_lon, age] plate : string (options: AF, ANT, AU, EU, GL, IN, NA, SA) site_lat : float site_lon : float age : float in Myr Returns ---------- """...
def send_deferred(self, auth): """Send all deferred requests for a particular CIK/auth.""" if self.deferred.has_requests(auth): method_arg_pairs = self.deferred.get_method_args_pairs(auth) calls = self._composeCalls(method_arg_pairs) # should this call be made with no...
def function[send_deferred, parameter[self, auth]]: constant[Send all deferred requests for a particular CIK/auth.] if call[name[self].deferred.has_requests, parameter[name[auth]]] begin[:] variable[method_arg_pairs] assign[=] call[name[self].deferred.get_method_args_pairs, parameter[nam...
keyword[def] identifier[send_deferred] ( identifier[self] , identifier[auth] ): literal[string] keyword[if] identifier[self] . identifier[deferred] . identifier[has_requests] ( identifier[auth] ): identifier[method_arg_pairs] = identifier[self] . identifier[deferred] . identifier[get_...
def send_deferred(self, auth): """Send all deferred requests for a particular CIK/auth.""" if self.deferred.has_requests(auth): method_arg_pairs = self.deferred.get_method_args_pairs(auth) calls = self._composeCalls(method_arg_pairs) # should this call be made with no timeout? (e.g. is t...
def getRejectionReasons(self,dd): """ 'd' is a dictionary with the stored data in the widget like: {u'selected': [u'a', u'b'], u'checkbox': True, u'other': 'dsadas', u'checkbox_other': True} Returns a string with the options both from selected and input items """ keys = d...
def function[getRejectionReasons, parameter[self, dd]]: constant[ 'd' is a dictionary with the stored data in the widget like: {u'selected': [u'a', u'b'], u'checkbox': True, u'other': 'dsadas', u'checkbox_other': True} Returns a string with the options both from selected and input items ...
keyword[def] identifier[getRejectionReasons] ( identifier[self] , identifier[dd] ): literal[string] identifier[keys] = identifier[dd] . identifier[keys] () identifier[reasons] =[] keyword[if] keyword[not] ( literal[string] keyword[in] identifier[keys] ) keyword[or] keyword[not...
def getRejectionReasons(self, dd): """ 'd' is a dictionary with the stored data in the widget like: {u'selected': [u'a', u'b'], u'checkbox': True, u'other': 'dsadas', u'checkbox_other': True} Returns a string with the options both from selected and input items """ keys = dd.keys(...
def wrapModel(self, model): """ Converts application-provided model objects to L{IResource} providers. """ res = IResource(model, None) if res is None: frag = INavigableFragment(model) fragmentName = getattr(frag, 'fragmentName', None) if fragm...
def function[wrapModel, parameter[self, model]]: constant[ Converts application-provided model objects to L{IResource} providers. ] variable[res] assign[=] call[name[IResource], parameter[name[model], constant[None]]] if compare[name[res] is constant[None]] begin[:] ...
keyword[def] identifier[wrapModel] ( identifier[self] , identifier[model] ): literal[string] identifier[res] = identifier[IResource] ( identifier[model] , keyword[None] ) keyword[if] identifier[res] keyword[is] keyword[None] : identifier[frag] = identifier[INavigableFragmen...
def wrapModel(self, model): """ Converts application-provided model objects to L{IResource} providers. """ res = IResource(model, None) if res is None: frag = INavigableFragment(model) fragmentName = getattr(frag, 'fragmentName', None) if fragmentName is not None: ...
def compute(self, sensorToBodyByColumn, sensorToSpecificObjectByColumn): """ Compute the "body's location relative to a specific object" from an array of "sensor's location relative to a specific object" and an array of "sensor's location relative to body" These arrays consist of ...
def function[compute, parameter[self, sensorToBodyByColumn, sensorToSpecificObjectByColumn]]: constant[ Compute the "body's location relative to a specific object" from an array of "sensor's location relative to a specific object" and an array of "sensor's location relative to body...
keyword[def] identifier[compute] ( identifier[self] , identifier[sensorToBodyByColumn] , identifier[sensorToSpecificObjectByColumn] ): literal[string] identifier[votesByCell] = identifier[np] . identifier[zeros] ( identifier[self] . identifier[cellCount] , identifier[dtype] = literal[string] ) identi...
def compute(self, sensorToBodyByColumn, sensorToSpecificObjectByColumn): """ Compute the "body's location relative to a specific object" from an array of "sensor's location relative to a specific object" and an array of "sensor's location relative to body" These arrays consist of ...
def knot_removal_alpha_j(u, degree, knotvector, num, idx): """ Computes :math:`\\alpha_{j}` coefficient for knot removal algorithm. Please refer to Eq. 5.29 of The NURBS Book by Piegl & Tiller, 2nd Edition, p.184 for details. :param u: knot :type u: float :param degree: degree :type degree: in...
def function[knot_removal_alpha_j, parameter[u, degree, knotvector, num, idx]]: constant[ Computes :math:`\alpha_{j}` coefficient for knot removal algorithm. Please refer to Eq. 5.29 of The NURBS Book by Piegl & Tiller, 2nd Edition, p.184 for details. :param u: knot :type u: float :param degre...
keyword[def] identifier[knot_removal_alpha_j] ( identifier[u] , identifier[degree] , identifier[knotvector] , identifier[num] , identifier[idx] ): literal[string] keyword[return] ( identifier[u] - identifier[knotvector] [ identifier[idx] - identifier[num] ])/( identifier[knotvector] [ identifier[idx] + ide...
def knot_removal_alpha_j(u, degree, knotvector, num, idx): """ Computes :math:`\\alpha_{j}` coefficient for knot removal algorithm. Please refer to Eq. 5.29 of The NURBS Book by Piegl & Tiller, 2nd Edition, p.184 for details. :param u: knot :type u: float :param degree: degree :type degree: in...
def connectExec(connection, protocol, commandLine): """Connect a Protocol to a ssh exec session """ deferred = connectSession(connection, protocol) @deferred.addCallback def requestSubsystem(session): return session.requestExec(commandLine) return deferred
def function[connectExec, parameter[connection, protocol, commandLine]]: constant[Connect a Protocol to a ssh exec session ] variable[deferred] assign[=] call[name[connectSession], parameter[name[connection], name[protocol]]] def function[requestSubsystem, parameter[session]]: return...
keyword[def] identifier[connectExec] ( identifier[connection] , identifier[protocol] , identifier[commandLine] ): literal[string] identifier[deferred] = identifier[connectSession] ( identifier[connection] , identifier[protocol] ) @ identifier[deferred] . identifier[addCallback] keyword[def] iden...
def connectExec(connection, protocol, commandLine): """Connect a Protocol to a ssh exec session """ deferred = connectSession(connection, protocol) @deferred.addCallback def requestSubsystem(session): return session.requestExec(commandLine) return deferred
def interrupt(self): """ Invoked by the renderering.Renderer, if the image has changed. """ self.image = io.BytesIO() self.renderer.screen.save(self.image, "png")
def function[interrupt, parameter[self]]: constant[ Invoked by the renderering.Renderer, if the image has changed. ] name[self].image assign[=] call[name[io].BytesIO, parameter[]] call[name[self].renderer.screen.save, parameter[name[self].image, constant[png]]]
keyword[def] identifier[interrupt] ( identifier[self] ): literal[string] identifier[self] . identifier[image] = identifier[io] . identifier[BytesIO] () identifier[self] . identifier[renderer] . identifier[screen] . identifier[save] ( identifier[self] . identifier[image] , literal[string] )
def interrupt(self): """ Invoked by the renderering.Renderer, if the image has changed. """ self.image = io.BytesIO() self.renderer.screen.save(self.image, 'png')
def section_areas(neurites, neurite_type=NeuriteType.all): '''section areas in a collection of neurites''' return map_sections(sectionfunc.section_area, neurites, neurite_type=neurite_type)
def function[section_areas, parameter[neurites, neurite_type]]: constant[section areas in a collection of neurites] return[call[name[map_sections], parameter[name[sectionfunc].section_area, name[neurites]]]]
keyword[def] identifier[section_areas] ( identifier[neurites] , identifier[neurite_type] = identifier[NeuriteType] . identifier[all] ): literal[string] keyword[return] identifier[map_sections] ( identifier[sectionfunc] . identifier[section_area] , identifier[neurites] , identifier[neurite_type] = identifi...
def section_areas(neurites, neurite_type=NeuriteType.all): """section areas in a collection of neurites""" return map_sections(sectionfunc.section_area, neurites, neurite_type=neurite_type)
def save_four_ds9(rectwv_coeff, debugplot=0): """Save the 4 possible ds9 region files. Parameters ---------- rectwv_coeff : RectWaveCoeff instance Rectification and wavelength calibration coefficients for the particular CSU configuration. debugplot : int Debugging level ...
def function[save_four_ds9, parameter[rectwv_coeff, debugplot]]: constant[Save the 4 possible ds9 region files. Parameters ---------- rectwv_coeff : RectWaveCoeff instance Rectification and wavelength calibration coefficients for the particular CSU configuration. debugplot : int...
keyword[def] identifier[save_four_ds9] ( identifier[rectwv_coeff] , identifier[debugplot] = literal[int] ): literal[string] keyword[for] identifier[limits] , identifier[rectified] , identifier[suffix] keyword[in] identifier[zip] ( [ literal[string] , literal[string] , literal[string] , literal[stri...
def save_four_ds9(rectwv_coeff, debugplot=0): """Save the 4 possible ds9 region files. Parameters ---------- rectwv_coeff : RectWaveCoeff instance Rectification and wavelength calibration coefficients for the particular CSU configuration. debugplot : int Debugging level ...
def phantompeakqualtools_general_stats(self): """ Add columns to General Statistics table """ headers = OrderedDict() headers['Estimated_Fragment_Length_bp'] = { 'title': 'Frag Length', 'description': 'Estimated fragment length (bp)', 'min': 0, 'fo...
def function[phantompeakqualtools_general_stats, parameter[self]]: constant[ Add columns to General Statistics table ] variable[headers] assign[=] call[name[OrderedDict], parameter[]] call[name[headers]][constant[Estimated_Fragment_Length_bp]] assign[=] dictionary[[<ast.Constant object at 0x7da2...
keyword[def] identifier[phantompeakqualtools_general_stats] ( identifier[self] ): literal[string] identifier[headers] = identifier[OrderedDict] () identifier[headers] [ literal[string] ]={ literal[string] : literal[string] , literal[string] : literal[string] , li...
def phantompeakqualtools_general_stats(self): """ Add columns to General Statistics table """ headers = OrderedDict() headers['Estimated_Fragment_Length_bp'] = {'title': 'Frag Length', 'description': 'Estimated fragment length (bp)', 'min': 0, 'format': '{:,.0f}'} headers['NSC'] = {'title': 'NSC', 'desc...
def get_data(self, name): r""" Get the data associated with a node. :param name: Node name :type name: :ref:`NodeName` :rtype: any type or list of objects of any type :raises: * RuntimeError (Argument \`name\` is not valid) * RuntimeError (Node *[na...
def function[get_data, parameter[self, name]]: constant[ Get the data associated with a node. :param name: Node name :type name: :ref:`NodeName` :rtype: any type or list of objects of any type :raises: * RuntimeError (Argument \`name\` is not valid) ...
keyword[def] identifier[get_data] ( identifier[self] , identifier[name] ): literal[string] keyword[if] identifier[self] . identifier[_validate_node_name] ( identifier[name] ): keyword[raise] identifier[RuntimeError] ( literal[string] ) identifier[self] . identifier[_node_in_...
def get_data(self, name): """ Get the data associated with a node. :param name: Node name :type name: :ref:`NodeName` :rtype: any type or list of objects of any type :raises: * RuntimeError (Argument \\`name\\` is not valid) * RuntimeError (Node *[name]...
def date(self): """:return: datetime object""" if self.commit_time: return datetime.utcfromtimestamp(self.commit_time) else: return datetime.now()
def function[date, parameter[self]]: constant[:return: datetime object] if name[self].commit_time begin[:] return[call[name[datetime].utcfromtimestamp, parameter[name[self].commit_time]]]
keyword[def] identifier[date] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[commit_time] : keyword[return] identifier[datetime] . identifier[utcfromtimestamp] ( identifier[self] . identifier[commit_time] ) keyword[else] : keywor...
def date(self): """:return: datetime object""" if self.commit_time: return datetime.utcfromtimestamp(self.commit_time) # depends on [control=['if'], data=[]] else: return datetime.now()
def get_comparable_values(self): """Return a tupple of values representing the unicity of the object """ return (not self.generic, int(self.code), str(self.message), str(self.description))
def function[get_comparable_values, parameter[self]]: constant[Return a tupple of values representing the unicity of the object ] return[tuple[[<ast.UnaryOp object at 0x7da207f00b20>, <ast.Call object at 0x7da207f00df0>, <ast.Call object at 0x7da207f03a90>, <ast.Call object at 0x7da207f03310>]]]
keyword[def] identifier[get_comparable_values] ( identifier[self] ): literal[string] keyword[return] ( keyword[not] identifier[self] . identifier[generic] , identifier[int] ( identifier[self] . identifier[code] ), identifier[str] ( identifier[self] . identifier[message] ), identifier[str] ( identi...
def get_comparable_values(self): """Return a tupple of values representing the unicity of the object """ return (not self.generic, int(self.code), str(self.message), str(self.description))
def _get_zeropoint(expnum, ccd, prefix=None, version='p'): """ Retrieve the zeropoint stored in the tags associated with this image. @param expnum: Exposure number @param ccd: ccd of the exposure @param prefix: possible prefix (such as 'fk') @param version: which version: p, s, or o ? @retur...
def function[_get_zeropoint, parameter[expnum, ccd, prefix, version]]: constant[ Retrieve the zeropoint stored in the tags associated with this image. @param expnum: Exposure number @param ccd: ccd of the exposure @param prefix: possible prefix (such as 'fk') @param version: which version: p...
keyword[def] identifier[_get_zeropoint] ( identifier[expnum] , identifier[ccd] , identifier[prefix] = keyword[None] , identifier[version] = literal[string] ): literal[string] keyword[if] identifier[prefix] keyword[is] keyword[not] keyword[None] : identifier[DeprecationWarning] ( literal[string...
def _get_zeropoint(expnum, ccd, prefix=None, version='p'): """ Retrieve the zeropoint stored in the tags associated with this image. @param expnum: Exposure number @param ccd: ccd of the exposure @param prefix: possible prefix (such as 'fk') @param version: which version: p, s, or o ? @retur...
def collapse_if_tuple(abi): """Converts a tuple from a dict to a parenthesized list of its types. >>> from eth_utils.abi import collapse_if_tuple >>> collapse_if_tuple( ... { ... 'components': [ ... {'name': 'anAddress', 'type': 'address'}, ... {'name': '...
def function[collapse_if_tuple, parameter[abi]]: constant[Converts a tuple from a dict to a parenthesized list of its types. >>> from eth_utils.abi import collapse_if_tuple >>> collapse_if_tuple( ... { ... 'components': [ ... {'name': 'anAddress', 'type': 'address'},...
keyword[def] identifier[collapse_if_tuple] ( identifier[abi] ): literal[string] identifier[typ] = identifier[abi] [ literal[string] ] keyword[if] keyword[not] identifier[typ] . identifier[startswith] ( literal[string] ): keyword[return] identifier[typ] identifier[delimited] = litera...
def collapse_if_tuple(abi): """Converts a tuple from a dict to a parenthesized list of its types. >>> from eth_utils.abi import collapse_if_tuple >>> collapse_if_tuple( ... { ... 'components': [ ... {'name': 'anAddress', 'type': 'address'}, ... {'name': '...
def set_exit_handler(self): """Set the signal handler to manage_signal (defined in this class) Only set handlers for signal.SIGTERM, signal.SIGINT, signal.SIGUSR1, signal.SIGUSR2 :return: None """ signal.signal(signal.SIGINT, self.manage_signal) signal.signal(signal.SIGT...
def function[set_exit_handler, parameter[self]]: constant[Set the signal handler to manage_signal (defined in this class) Only set handlers for signal.SIGTERM, signal.SIGINT, signal.SIGUSR1, signal.SIGUSR2 :return: None ] call[name[signal].signal, parameter[name[signal].SIGINT, ...
keyword[def] identifier[set_exit_handler] ( identifier[self] ): literal[string] identifier[signal] . identifier[signal] ( identifier[signal] . identifier[SIGINT] , identifier[self] . identifier[manage_signal] ) identifier[signal] . identifier[signal] ( identifier[signal] . identifier[SIGTE...
def set_exit_handler(self): """Set the signal handler to manage_signal (defined in this class) Only set handlers for signal.SIGTERM, signal.SIGINT, signal.SIGUSR1, signal.SIGUSR2 :return: None """ signal.signal(signal.SIGINT, self.manage_signal) signal.signal(signal.SIGTERM, self.ma...
def decrease_writes_in_percent( current_provisioning, percent, min_provisioned_writes, log_tag): """ Decrease the current_provisioning with percent % :type current_provisioning: int :param current_provisioning: The current provisioning :type percent: int :param percent: How many percent sho...
def function[decrease_writes_in_percent, parameter[current_provisioning, percent, min_provisioned_writes, log_tag]]: constant[ Decrease the current_provisioning with percent % :type current_provisioning: int :param current_provisioning: The current provisioning :type percent: int :param percent...
keyword[def] identifier[decrease_writes_in_percent] ( identifier[current_provisioning] , identifier[percent] , identifier[min_provisioned_writes] , identifier[log_tag] ): literal[string] identifier[percent] = identifier[float] ( identifier[percent] ) identifier[decrease] = identifier[int] ( identifie...
def decrease_writes_in_percent(current_provisioning, percent, min_provisioned_writes, log_tag): """ Decrease the current_provisioning with percent % :type current_provisioning: int :param current_provisioning: The current provisioning :type percent: int :param percent: How many percent should we de...