code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def spend_key(self): """ Returns private spend key. None if wallet is view-only. :rtype: str or None """ key = self._backend.spend_key() if key == numbers.EMPTY_KEY: return None return key
def function[spend_key, parameter[self]]: constant[ Returns private spend key. None if wallet is view-only. :rtype: str or None ] variable[key] assign[=] call[name[self]._backend.spend_key, parameter[]] if compare[name[key] equal[==] name[numbers].EMPTY_KEY] begin[:] ...
keyword[def] identifier[spend_key] ( identifier[self] ): literal[string] identifier[key] = identifier[self] . identifier[_backend] . identifier[spend_key] () keyword[if] identifier[key] == identifier[numbers] . identifier[EMPTY_KEY] : keyword[return] keyword[None] ...
def spend_key(self): """ Returns private spend key. None if wallet is view-only. :rtype: str or None """ key = self._backend.spend_key() if key == numbers.EMPTY_KEY: return None # depends on [control=['if'], data=[]] return key
def get_polygon_filter_names(): """Get the names of all polygon filters in the order of creation""" names = [] for p in PolygonFilter.instances: names.append(p.name) return names
def function[get_polygon_filter_names, parameter[]]: constant[Get the names of all polygon filters in the order of creation] variable[names] assign[=] list[[]] for taget[name[p]] in starred[name[PolygonFilter].instances] begin[:] call[name[names].append, parameter[name[p].name]] ...
keyword[def] identifier[get_polygon_filter_names] (): literal[string] identifier[names] =[] keyword[for] identifier[p] keyword[in] identifier[PolygonFilter] . identifier[instances] : identifier[names] . identifier[append] ( identifier[p] . identifier[name] ) keyword[return] identifie...
def get_polygon_filter_names(): """Get the names of all polygon filters in the order of creation""" names = [] for p in PolygonFilter.instances: names.append(p.name) # depends on [control=['for'], data=['p']] return names
def get_language_from_request(request): """Return the most obvious language according the request.""" language = request.GET.get('language', None) if language: return language if hasattr(request, 'LANGUAGE_CODE'): lang = settings.PAGE_LANGUAGE_MAPPING(str(request.LANGUAGE_CODE)) ...
def function[get_language_from_request, parameter[request]]: constant[Return the most obvious language according the request.] variable[language] assign[=] call[name[request].GET.get, parameter[constant[language], constant[None]]] if name[language] begin[:] return[name[language]] ...
keyword[def] identifier[get_language_from_request] ( identifier[request] ): literal[string] identifier[language] = identifier[request] . identifier[GET] . identifier[get] ( literal[string] , keyword[None] ) keyword[if] identifier[language] : keyword[return] identifier[language] keywo...
def get_language_from_request(request): """Return the most obvious language according the request.""" language = request.GET.get('language', None) if language: return language # depends on [control=['if'], data=[]] if hasattr(request, 'LANGUAGE_CODE'): lang = settings.PAGE_LANGUAGE_MAPP...
def get_xchange_rate(self, pairs, items=None): """Retrieves currency exchange rate data for given pair(s). Accepts both where pair='eurusd, gbpusd' and where pair in ('eurusd', 'gpbusd, usdaud') """ response = self.select('yahoo.finance.xchange', items).where(['pair', 'in', pairs]) ...
def function[get_xchange_rate, parameter[self, pairs, items]]: constant[Retrieves currency exchange rate data for given pair(s). Accepts both where pair='eurusd, gbpusd' and where pair in ('eurusd', 'gpbusd, usdaud') ] variable[response] assign[=] call[call[name[self].select, parameter[...
keyword[def] identifier[get_xchange_rate] ( identifier[self] , identifier[pairs] , identifier[items] = keyword[None] ): literal[string] identifier[response] = identifier[self] . identifier[select] ( literal[string] , identifier[items] ). identifier[where] ([ literal[string] , literal[string] , iden...
def get_xchange_rate(self, pairs, items=None): """Retrieves currency exchange rate data for given pair(s). Accepts both where pair='eurusd, gbpusd' and where pair in ('eurusd', 'gpbusd, usdaud') """ response = self.select('yahoo.finance.xchange', items).where(['pair', 'in', pairs]) return r...
def Genra(request): """ Generate dict of Dept and its grade. """ school = request.GET['school'] c = Course(school=school) return JsonResponse(c.getGenra(), safe=False)
def function[Genra, parameter[request]]: constant[ Generate dict of Dept and its grade. ] variable[school] assign[=] call[name[request].GET][constant[school]] variable[c] assign[=] call[name[Course], parameter[]] return[call[name[JsonResponse], parameter[call[name[c].getGenra, parameter[]...
keyword[def] identifier[Genra] ( identifier[request] ): literal[string] identifier[school] = identifier[request] . identifier[GET] [ literal[string] ] identifier[c] = identifier[Course] ( identifier[school] = identifier[school] ) keyword[return] identifier[JsonResponse] ( identifier[c] . identifier[getGenra...
def Genra(request): """ Generate dict of Dept and its grade. """ school = request.GET['school'] c = Course(school=school) return JsonResponse(c.getGenra(), safe=False)
def transmute(*args, **kwargs): """ Similar to `select` but allows mutation in column definitions. In : (diamonds >> head(3) >> transmute(new_price=X.price * 2, x_plus_y=X.x + X.y)) Out: new_price x_plus_y 0 652 7.93 1 652 7.73 2 654 8....
def function[transmute, parameter[]]: constant[ Similar to `select` but allows mutation in column definitions. In : (diamonds >> head(3) >> transmute(new_price=X.price * 2, x_plus_y=X.x + X.y)) Out: new_price x_plus_y 0 652 7.93 1 652 7.73 2 ...
keyword[def] identifier[transmute] (* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[mutate_dateframe_fn] = identifier[mutate] (* identifier[args] ,** identifier[dict] ( identifier[kwargs] )) identifier[column_names_args] =[ identifier[str] ( identifier[arg] ) keyword[for] identifier...
def transmute(*args, **kwargs): """ Similar to `select` but allows mutation in column definitions. In : (diamonds >> head(3) >> transmute(new_price=X.price * 2, x_plus_y=X.x + X.y)) Out: new_price x_plus_y 0 652 7.93 1 652 7.73 2 654 ...
def split_string_at_suffix(s, numbers_into_suffix=False): """ Split a string into two parts: a prefix and a suffix. Splitting is done from the end, so the split is done around the position of the last digit in the string (that means the prefix may include any character, mixing digits and chars). The...
def function[split_string_at_suffix, parameter[s, numbers_into_suffix]]: constant[ Split a string into two parts: a prefix and a suffix. Splitting is done from the end, so the split is done around the position of the last digit in the string (that means the prefix may include any character, mixing d...
keyword[def] identifier[split_string_at_suffix] ( identifier[s] , identifier[numbers_into_suffix] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[s] : keyword[return] ( identifier[s] , literal[string] ) identifier[pos] = identifier[len] ( identifier[s] ) keyword...
def split_string_at_suffix(s, numbers_into_suffix=False): """ Split a string into two parts: a prefix and a suffix. Splitting is done from the end, so the split is done around the position of the last digit in the string (that means the prefix may include any character, mixing digits and chars). The...
def data_to_uuid(data): """Convert an array of binary data to the iBeacon uuid format.""" string = data_to_hexstring(data) return string[0:8]+'-'+string[8:12]+'-'+string[12:16]+'-'+string[16:20]+'-'+string[20:32]
def function[data_to_uuid, parameter[data]]: constant[Convert an array of binary data to the iBeacon uuid format.] variable[string] assign[=] call[name[data_to_hexstring], parameter[name[data]]] return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operat...
keyword[def] identifier[data_to_uuid] ( identifier[data] ): literal[string] identifier[string] = identifier[data_to_hexstring] ( identifier[data] ) keyword[return] identifier[string] [ literal[int] : literal[int] ]+ literal[string] + identifier[string] [ literal[int] : literal[int] ]+ literal[string]...
def data_to_uuid(data): """Convert an array of binary data to the iBeacon uuid format.""" string = data_to_hexstring(data) return string[0:8] + '-' + string[8:12] + '-' + string[12:16] + '-' + string[16:20] + '-' + string[20:32]
def override_locale(self, locale: str = locales.EN, ) -> Generator['BaseDataProvider', None, None]: """Context manager which allows overriding current locale. Temporarily overrides current locale for locale-dependent providers. :param locale: Locale. :re...
def function[override_locale, parameter[self, locale]]: constant[Context manager which allows overriding current locale. Temporarily overrides current locale for locale-dependent providers. :param locale: Locale. :return: Provider with overridden locale. ] <ast.Try ...
keyword[def] identifier[override_locale] ( identifier[self] , identifier[locale] : identifier[str] = identifier[locales] . identifier[EN] , )-> identifier[Generator] [ literal[string] , keyword[None] , keyword[None] ]: literal[string] keyword[try] : identifier[origin_locale] = identifi...
def override_locale(self, locale: str=locales.EN) -> Generator['BaseDataProvider', None, None]: """Context manager which allows overriding current locale. Temporarily overrides current locale for locale-dependent providers. :param locale: Locale. :return: Provider with overridden l...
def require_auth(function): """ A decorator that wraps the passed in function and raises exception if access token is missing """ @functools.wraps(function) def wrapper(self, *args, **kwargs): if not self.access_token(): raise MissingAccessTokenError return function(s...
def function[require_auth, parameter[function]]: constant[ A decorator that wraps the passed in function and raises exception if access token is missing ] def function[wrapper, parameter[self]]: if <ast.UnaryOp object at 0x7da18f721b10> begin[:] <ast.Raise object ...
keyword[def] identifier[require_auth] ( identifier[function] ): literal[string] @ identifier[functools] . identifier[wraps] ( identifier[function] ) keyword[def] identifier[wrapper] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): keyword[if] keyword[not] identifier[self] . ...
def require_auth(function): """ A decorator that wraps the passed in function and raises exception if access token is missing """ @functools.wraps(function) def wrapper(self, *args, **kwargs): if not self.access_token(): raise MissingAccessTokenError # depends on [control=[...
def update_font(self): """Update font from Preferences""" color_scheme = self.get_color_scheme() font = self.get_plugin_font() for editor in self.editors: editor.set_font(font, color_scheme)
def function[update_font, parameter[self]]: constant[Update font from Preferences] variable[color_scheme] assign[=] call[name[self].get_color_scheme, parameter[]] variable[font] assign[=] call[name[self].get_plugin_font, parameter[]] for taget[name[editor]] in starred[name[self].editors]...
keyword[def] identifier[update_font] ( identifier[self] ): literal[string] identifier[color_scheme] = identifier[self] . identifier[get_color_scheme] () identifier[font] = identifier[self] . identifier[get_plugin_font] () keyword[for] identifier[editor] keyword[in] identifi...
def update_font(self): """Update font from Preferences""" color_scheme = self.get_color_scheme() font = self.get_plugin_font() for editor in self.editors: editor.set_font(font, color_scheme) # depends on [control=['for'], data=['editor']]
def check_release_number(release): """ Check to make sure a release is in the valid range of Ensembl releases. """ try: release = int(release) except: raise ValueError("Invalid Ensembl release: %s" % release) if release < MIN_ENSEMBL_RELEASE or release > MAX_ENSEMBL_RELEASE:...
def function[check_release_number, parameter[release]]: constant[ Check to make sure a release is in the valid range of Ensembl releases. ] <ast.Try object at 0x7da1b08db5e0> if <ast.BoolOp object at 0x7da1b08dbee0> begin[:] <ast.Raise object at 0x7da1b08dbdc0> return[name[re...
keyword[def] identifier[check_release_number] ( identifier[release] ): literal[string] keyword[try] : identifier[release] = identifier[int] ( identifier[release] ) keyword[except] : keyword[raise] identifier[ValueError] ( literal[string] % identifier[release] ) keyword[if] id...
def check_release_number(release): """ Check to make sure a release is in the valid range of Ensembl releases. """ try: release = int(release) # depends on [control=['try'], data=[]] except: raise ValueError('Invalid Ensembl release: %s' % release) # depends on [control=['excep...
def to_bytes(self): """Convert the entire image to bytes. :rtype: bytes """ # grab the chunks we needs out = [PNG_SIGN] # FIXME: it's tricky to define "other_chunks". HoneyView stop the # animation if it sees chunks other than fctl or idat, so we put other # chunks to the end of the file other_...
def function[to_bytes, parameter[self]]: constant[Convert the entire image to bytes. :rtype: bytes ] variable[out] assign[=] list[[<ast.Name object at 0x7da18f721360>]] variable[other_chunks] assign[=] list[[]] variable[seq] assign[=] constant[0] <ast.Tuple object at 0x7da...
keyword[def] identifier[to_bytes] ( identifier[self] ): literal[string] identifier[out] =[ identifier[PNG_SIGN] ] identifier[other_chunks] =[] identifier[seq] = literal[int] identifier[png] , identifier[control] = identifier[self] . identifier[frames] [ literal[int] ] identifi...
def to_bytes(self): """Convert the entire image to bytes. :rtype: bytes """ # grab the chunks we needs out = [PNG_SIGN] # FIXME: it's tricky to define "other_chunks". HoneyView stop the # animation if it sees chunks other than fctl or idat, so we put other # chunks to the end of the file o...
def hz2cents(freq_hz, base_frequency=10.0): """Convert an array of frequency values in Hz to cents. 0 values are left in place. Parameters ---------- freq_hz : np.ndarray Array of frequencies in Hz. base_frequency : float Base frequency for conversion. (Default value = 1...
def function[hz2cents, parameter[freq_hz, base_frequency]]: constant[Convert an array of frequency values in Hz to cents. 0 values are left in place. Parameters ---------- freq_hz : np.ndarray Array of frequencies in Hz. base_frequency : float Base frequency for conversion. ...
keyword[def] identifier[hz2cents] ( identifier[freq_hz] , identifier[base_frequency] = literal[int] ): literal[string] identifier[freq_cent] = identifier[np] . identifier[zeros] ( identifier[freq_hz] . identifier[shape] [ literal[int] ]) identifier[freq_nonz_ind] = identifier[np] . identifier[flatnonz...
def hz2cents(freq_hz, base_frequency=10.0): """Convert an array of frequency values in Hz to cents. 0 values are left in place. Parameters ---------- freq_hz : np.ndarray Array of frequencies in Hz. base_frequency : float Base frequency for conversion. (Default value = 1...
def parse_transdos(path_dir, efermi, dos_spin=1, trim_dos=False): """ Parses .transdos (total DOS) and .transdos_x_y (partial DOS) files Args: path_dir: (str) dir containing DOS files efermi: (float) Fermi energy dos_spin: (int) -1 for spin down, +1 for spin ...
def function[parse_transdos, parameter[path_dir, efermi, dos_spin, trim_dos]]: constant[ Parses .transdos (total DOS) and .transdos_x_y (partial DOS) files Args: path_dir: (str) dir containing DOS files efermi: (float) Fermi energy dos_spin: (int) -1 for spin ...
keyword[def] identifier[parse_transdos] ( identifier[path_dir] , identifier[efermi] , identifier[dos_spin] = literal[int] , identifier[trim_dos] = keyword[False] ): literal[string] identifier[data_dos] ={ literal[string] :[], literal[string] :{}} keyword[with] identifi...
def parse_transdos(path_dir, efermi, dos_spin=1, trim_dos=False): """ Parses .transdos (total DOS) and .transdos_x_y (partial DOS) files Args: path_dir: (str) dir containing DOS files efermi: (float) Fermi energy dos_spin: (int) -1 for spin down, +1 for spin up ...
def abort_transaction(self): """Abort a multi-statement transaction. .. versionadded:: 3.7 """ self._check_ended() state = self._transaction.state if state is _TxnState.NONE: raise InvalidOperation("No transaction started") elif state is _TxnState.ST...
def function[abort_transaction, parameter[self]]: constant[Abort a multi-statement transaction. .. versionadded:: 3.7 ] call[name[self]._check_ended, parameter[]] variable[state] assign[=] name[self]._transaction.state if compare[name[state] is name[_TxnState].NONE] begi...
keyword[def] identifier[abort_transaction] ( identifier[self] ): literal[string] identifier[self] . identifier[_check_ended] () identifier[state] = identifier[self] . identifier[_transaction] . identifier[state] keyword[if] identifier[state] keyword[is] identifier[_TxnState] ...
def abort_transaction(self): """Abort a multi-statement transaction. .. versionadded:: 3.7 """ self._check_ended() state = self._transaction.state if state is _TxnState.NONE: raise InvalidOperation('No transaction started') # depends on [control=['if'], data=[]] elif state ...
def to_pngs(pdf_path): ''' Converts a multi-page pdfs to a list of pngs via the `sips` command :returns: A list of converted pngs ''' pdf_list = split_pdf(pdf_path) pngs = [] for pdf in pdf_list: pngs.append(to_png(pdf)) os.remove(pdf) # Clean up return pngs
def function[to_pngs, parameter[pdf_path]]: constant[ Converts a multi-page pdfs to a list of pngs via the `sips` command :returns: A list of converted pngs ] variable[pdf_list] assign[=] call[name[split_pdf], parameter[name[pdf_path]]] variable[pngs] assign[=] list[[]] for taget[nam...
keyword[def] identifier[to_pngs] ( identifier[pdf_path] ): literal[string] identifier[pdf_list] = identifier[split_pdf] ( identifier[pdf_path] ) identifier[pngs] =[] keyword[for] identifier[pdf] keyword[in] identifier[pdf_list] : identifier[pngs] . identifier[append] ( identifier[to_png] ( identi...
def to_pngs(pdf_path): """ Converts a multi-page pdfs to a list of pngs via the `sips` command :returns: A list of converted pngs """ pdf_list = split_pdf(pdf_path) pngs = [] for pdf in pdf_list: pngs.append(to_png(pdf)) os.remove(pdf) # Clean up # depends on [control=['for'], data...
def float2json(value): """ CONVERT NUMBER TO JSON STRING, WITH BETTER CONTROL OVER ACCURACY :param value: float, int, long, Decimal :return: unicode """ if value == 0: return u'0' try: sign = "-" if value < 0 else "" value = abs(value) sci = value.__format__("...
def function[float2json, parameter[value]]: constant[ CONVERT NUMBER TO JSON STRING, WITH BETTER CONTROL OVER ACCURACY :param value: float, int, long, Decimal :return: unicode ] if compare[name[value] equal[==] constant[0]] begin[:] return[constant[0]] <ast.Try object at 0x7d...
keyword[def] identifier[float2json] ( identifier[value] ): literal[string] keyword[if] identifier[value] == literal[int] : keyword[return] literal[string] keyword[try] : identifier[sign] = literal[string] keyword[if] identifier[value] < literal[int] keyword[else] literal[strin...
def float2json(value): """ CONVERT NUMBER TO JSON STRING, WITH BETTER CONTROL OVER ACCURACY :param value: float, int, long, Decimal :return: unicode """ if value == 0: return u'0' # depends on [control=['if'], data=[]] try: sign = '-' if value < 0 else '' value = abs...
def pull(image, tag=None): """ pull a docker image """ if tag: image = ":".join([image, tag]) utils.xrun("docker pull", [image])
def function[pull, parameter[image, tag]]: constant[ pull a docker image ] if name[tag] begin[:] variable[image] assign[=] call[constant[:].join, parameter[list[[<ast.Name object at 0x7da1b0c21120>, <ast.Name object at 0x7da1b0c21150>]]]] call[name[utils].xrun, parameter[constant...
keyword[def] identifier[pull] ( identifier[image] , identifier[tag] = keyword[None] ): literal[string] keyword[if] identifier[tag] : identifier[image] = literal[string] . identifier[join] ([ identifier[image] , identifier[tag] ]) identifier[utils] . identifier[xrun] ( literal[string] ,[ ide...
def pull(image, tag=None): """ pull a docker image """ if tag: image = ':'.join([image, tag]) # depends on [control=['if'], data=[]] utils.xrun('docker pull', [image])
def download_all_inputs(exclude=None, parallel=False, max_threads=8): ''' :param exclude: List of input variables that should not be downloaded. :type exclude: Array of strings :param parallel: Should we download multiple files in parallel? (default: False) :type filename: boolean :param max_thr...
def function[download_all_inputs, parameter[exclude, parallel, max_threads]]: constant[ :param exclude: List of input variables that should not be downloaded. :type exclude: Array of strings :param parallel: Should we download multiple files in parallel? (default: False) :type filename: boolean ...
keyword[def] identifier[download_all_inputs] ( identifier[exclude] = keyword[None] , identifier[parallel] = keyword[False] , identifier[max_threads] = literal[int] ): literal[string] identifier[idir] = identifier[file_load_utils] . identifier[get_input_dir] () keyword[try] : identifier[...
def download_all_inputs(exclude=None, parallel=False, max_threads=8): """ :param exclude: List of input variables that should not be downloaded. :type exclude: Array of strings :param parallel: Should we download multiple files in parallel? (default: False) :type filename: boolean :param max_thr...
def PushEventSource(self, event_source): """Pushes an event source onto the heap. Args: event_source (EventSource): event source. """ if event_source.file_entry_type == ( dfvfs_definitions.FILE_ENTRY_TYPE_DIRECTORY): weight = 1 else: weight = 100 heap_values = (weight...
def function[PushEventSource, parameter[self, event_source]]: constant[Pushes an event source onto the heap. Args: event_source (EventSource): event source. ] if compare[name[event_source].file_entry_type equal[==] name[dfvfs_definitions].FILE_ENTRY_TYPE_DIRECTORY] begin[:] ...
keyword[def] identifier[PushEventSource] ( identifier[self] , identifier[event_source] ): literal[string] keyword[if] identifier[event_source] . identifier[file_entry_type] ==( identifier[dfvfs_definitions] . identifier[FILE_ENTRY_TYPE_DIRECTORY] ): identifier[weight] = literal[int] keyw...
def PushEventSource(self, event_source): """Pushes an event source onto the heap. Args: event_source (EventSource): event source. """ if event_source.file_entry_type == dfvfs_definitions.FILE_ENTRY_TYPE_DIRECTORY: weight = 1 # depends on [control=['if'], data=[]] else: weight...
def get_options(argv=None): """ Convert options into commands return commands, message """ parser = argparse.ArgumentParser(usage="spyder [options] files") parser.add_argument('--new-instance', action='store_true', default=False, help="Run a new instance of Spyder, even if ...
def function[get_options, parameter[argv]]: constant[ Convert options into commands return commands, message ] variable[parser] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[parser].add_argument, parameter[constant[--new-instance]]] call[name[parser].ad...
keyword[def] identifier[get_options] ( identifier[argv] = keyword[None] ): literal[string] identifier[parser] = identifier[argparse] . identifier[ArgumentParser] ( identifier[usage] = literal[string] ) identifier[parser] . identifier[add_argument] ( literal[string] , identifier[action] = literal[strin...
def get_options(argv=None): """ Convert options into commands return commands, message """ parser = argparse.ArgumentParser(usage='spyder [options] files') parser.add_argument('--new-instance', action='store_true', default=False, help='Run a new instance of Spyder, even if the single instance mo...
def _internal_verify_cas(ticket, service, suffix): """Verifies CAS 2.0 and 3.0 XML-based authentication ticket. Returns username on success and None on failure. """ params = {'ticket': ticket, 'service': service} if settings.CAS_PROXY_CALLBACK: params['pgtUrl'] = settings.CAS_PROXY_CALLBAC...
def function[_internal_verify_cas, parameter[ticket, service, suffix]]: constant[Verifies CAS 2.0 and 3.0 XML-based authentication ticket. Returns username on success and None on failure. ] variable[params] assign[=] dictionary[[<ast.Constant object at 0x7da1b101a4d0>, <ast.Constant object at 0...
keyword[def] identifier[_internal_verify_cas] ( identifier[ticket] , identifier[service] , identifier[suffix] ): literal[string] identifier[params] ={ literal[string] : identifier[ticket] , literal[string] : identifier[service] } keyword[if] identifier[settings] . identifier[CAS_PROXY_CALLBACK] : ...
def _internal_verify_cas(ticket, service, suffix): """Verifies CAS 2.0 and 3.0 XML-based authentication ticket. Returns username on success and None on failure. """ params = {'ticket': ticket, 'service': service} if settings.CAS_PROXY_CALLBACK: params['pgtUrl'] = settings.CAS_PROXY_CALLBACK...
def vesting_balance_withdraw(self, vesting_id, amount=None, account=None, **kwargs): """ Withdraw vesting balance :param str vesting_id: Id of the vesting object :param bitshares.amount.Amount Amount: to withdraw ("all" if not provided") :param str account: (...
def function[vesting_balance_withdraw, parameter[self, vesting_id, amount, account]]: constant[ Withdraw vesting balance :param str vesting_id: Id of the vesting object :param bitshares.amount.Amount Amount: to withdraw ("all" if not provided") :param str acc...
keyword[def] identifier[vesting_balance_withdraw] ( identifier[self] , identifier[vesting_id] , identifier[amount] = keyword[None] , identifier[account] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[account] : keyword[if] literal[strin...
def vesting_balance_withdraw(self, vesting_id, amount=None, account=None, **kwargs): """ Withdraw vesting balance :param str vesting_id: Id of the vesting object :param bitshares.amount.Amount Amount: to withdraw ("all" if not provided") :param str account: (opti...
def process_default(self, event): """ Writes event string representation to file object provided to my_init(). @param event: Event to be processed. Can be of any type of events but IN_Q_OVERFLOW events (see method process_IN_Q_OVERFLOW). @type event: Event ...
def function[process_default, parameter[self, event]]: constant[ Writes event string representation to file object provided to my_init(). @param event: Event to be processed. Can be of any type of events but IN_Q_OVERFLOW events (see method process_IN_Q_OVERFLOW). ...
keyword[def] identifier[process_default] ( identifier[self] , identifier[event] ): literal[string] identifier[self] . identifier[_out] . identifier[write] ( identifier[str] ( identifier[event] )) identifier[self] . identifier[_out] . identifier[write] ( literal[string] ) identifie...
def process_default(self, event): """ Writes event string representation to file object provided to my_init(). @param event: Event to be processed. Can be of any type of events but IN_Q_OVERFLOW events (see method process_IN_Q_OVERFLOW). @type event: Event inst...
def cli(env, identifier): """Cancel a dedicated host server immediately""" mgr = SoftLayer.DedicatedHostManager(env.client) host_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'dedicated host') if not (env.skip_confirmations or formatting.no_going_back(host_id)): raise exceptions.CLIAbo...
def function[cli, parameter[env, identifier]]: constant[Cancel a dedicated host server immediately] variable[mgr] assign[=] call[name[SoftLayer].DedicatedHostManager, parameter[name[env].client]] variable[host_id] assign[=] call[name[helpers].resolve_id, parameter[name[mgr].resolve_ids, name[ide...
keyword[def] identifier[cli] ( identifier[env] , identifier[identifier] ): literal[string] identifier[mgr] = identifier[SoftLayer] . identifier[DedicatedHostManager] ( identifier[env] . identifier[client] ) identifier[host_id] = identifier[helpers] . identifier[resolve_id] ( identifier[mgr] . identi...
def cli(env, identifier): """Cancel a dedicated host server immediately""" mgr = SoftLayer.DedicatedHostManager(env.client) host_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'dedicated host') if not (env.skip_confirmations or formatting.no_going_back(host_id)): raise exceptions.CLIAbort(...
def get_initial_broks(self, broker_name): """Send a HTTP request to the satellite (GET /_initial_broks) Used to build the initial broks for a broker connecting to a scheduler :param broker_name: the concerned broker name :type broker_name: str :return: Boolean indicating if the...
def function[get_initial_broks, parameter[self, broker_name]]: constant[Send a HTTP request to the satellite (GET /_initial_broks) Used to build the initial broks for a broker connecting to a scheduler :param broker_name: the concerned broker name :type broker_name: str :return...
keyword[def] identifier[get_initial_broks] ( identifier[self] , identifier[broker_name] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] , identifier[self] . identifier[name] , identifier[self] . identifier[alive] , identifier[self] . identifier[reachable] ) keyw...
def get_initial_broks(self, broker_name): """Send a HTTP request to the satellite (GET /_initial_broks) Used to build the initial broks for a broker connecting to a scheduler :param broker_name: the concerned broker name :type broker_name: str :return: Boolean indicating if the run...
def _toolkit_serialize_summary_struct(model, sections, section_titles): """ Serialize model summary into a dict with ordered lists of sections and section titles Parameters ---------- model : Model object sections : Ordered list of lists (sections) of tuples (field,value) [ [(fi...
def function[_toolkit_serialize_summary_struct, parameter[model, sections, section_titles]]: constant[ Serialize model summary into a dict with ordered lists of sections and section titles Parameters ---------- model : Model object sections : Ordered list of lists (sections) of tuples (fi...
keyword[def] identifier[_toolkit_serialize_summary_struct] ( identifier[model] , identifier[sections] , identifier[section_titles] ): literal[string] identifier[output_dict] = identifier[dict] () identifier[output_dict] [ literal[string] ]=[[( identifier[field] [ literal[int] ], identifier[__extract_m...
def _toolkit_serialize_summary_struct(model, sections, section_titles): """ Serialize model summary into a dict with ordered lists of sections and section titles Parameters ---------- model : Model object sections : Ordered list of lists (sections) of tuples (field,value) [ [(fi...
def cp_cmd(argv): """Duplicate the named virtualenv to make a new one.""" parser = argparse.ArgumentParser() parser.add_argument('source') parser.add_argument('target', nargs='?') parser.add_argument('-d', '--dont-activate', action='store_false', default=True, dest='activate'...
def function[cp_cmd, parameter[argv]]: constant[Duplicate the named virtualenv to make a new one.] variable[parser] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[parser].add_argument, parameter[constant[source]]] call[name[parser].add_argument, parameter[constant[t...
keyword[def] identifier[cp_cmd] ( identifier[argv] ): literal[string] identifier[parser] = identifier[argparse] . identifier[ArgumentParser] () identifier[parser] . identifier[add_argument] ( literal[string] ) identifier[parser] . identifier[add_argument] ( literal[string] , identifier[nargs] = l...
def cp_cmd(argv): """Duplicate the named virtualenv to make a new one.""" parser = argparse.ArgumentParser() parser.add_argument('source') parser.add_argument('target', nargs='?') parser.add_argument('-d', '--dont-activate', action='store_false', default=True, dest='activate', help="After ...
def dematerialize(parent_name, parent_node): # FIXME we need to demat more than just leaves! #FIXME still an issue: Fornix, Striatum, Diagonal Band """ Remove nodes higher in the tree that occur further down the SAME branch. If they occur down OTHER branchs leave them alone. NOTE: modifies in ...
def function[dematerialize, parameter[parent_name, parent_node]]: constant[ Remove nodes higher in the tree that occur further down the SAME branch. If they occur down OTHER branchs leave them alone. NOTE: modifies in place! ] variable[lleaves] assign[=] dictionary[[], []] v...
keyword[def] identifier[dematerialize] ( identifier[parent_name] , identifier[parent_node] ): literal[string] identifier[lleaves] ={} identifier[children] = identifier[parent_node] [ identifier[parent_name] ] keyword[if] keyword[not] identifier[children] : identifier[lleaves] [ ...
def dematerialize(parent_name, parent_node): # FIXME we need to demat more than just leaves! #FIXME still an issue: Fornix, Striatum, Diagonal Band ' Remove nodes higher in the tree that occur further down the\n SAME branch. If they occur down OTHER branchs leave them alone.\n\n NOTE: modifies in...
def get_file_size(self, path): """ Returns size of the file at given ``path``. """ id = self._get_id_for_path(path) blob = self.repository._repo[id] return blob.raw_length()
def function[get_file_size, parameter[self, path]]: constant[ Returns size of the file at given ``path``. ] variable[id] assign[=] call[name[self]._get_id_for_path, parameter[name[path]]] variable[blob] assign[=] call[name[self].repository._repo][name[id]] return[call[name[bl...
keyword[def] identifier[get_file_size] ( identifier[self] , identifier[path] ): literal[string] identifier[id] = identifier[self] . identifier[_get_id_for_path] ( identifier[path] ) identifier[blob] = identifier[self] . identifier[repository] . identifier[_repo] [ identifier[id] ] ...
def get_file_size(self, path): """ Returns size of the file at given ``path``. """ id = self._get_id_for_path(path) blob = self.repository._repo[id] return blob.raw_length()
def draw_color(self): """Tuple[int, int, int, int]: The color used for drawing operations in (red, green, blue, alpha) format.""" rgba = ffi.new('Uint8[]', 4) check_int_err(lib.SDL_GetRenderDrawColor(self._ptr, rgba + 0, rgba + 1, rgba + 2, rgba + 3)) return (rgba[0], rgba[1], rgba[2], r...
def function[draw_color, parameter[self]]: constant[Tuple[int, int, int, int]: The color used for drawing operations in (red, green, blue, alpha) format.] variable[rgba] assign[=] call[name[ffi].new, parameter[constant[Uint8[]], constant[4]]] call[name[check_int_err], parameter[call[name[lib].SD...
keyword[def] identifier[draw_color] ( identifier[self] ): literal[string] identifier[rgba] = identifier[ffi] . identifier[new] ( literal[string] , literal[int] ) identifier[check_int_err] ( identifier[lib] . identifier[SDL_GetRenderDrawColor] ( identifier[self] . identifier[_ptr] , identif...
def draw_color(self): """Tuple[int, int, int, int]: The color used for drawing operations in (red, green, blue, alpha) format.""" rgba = ffi.new('Uint8[]', 4) check_int_err(lib.SDL_GetRenderDrawColor(self._ptr, rgba + 0, rgba + 1, rgba + 2, rgba + 3)) return (rgba[0], rgba[1], rgba[2], rgba[3])
def readline(self, size=-1): """Receive message of a size from the socket. Matches the following interface: https://docs.python.org/3/library/io.html#io.IOBase.readline """ return self._safe_call( True, super(SSLFileobjectMixin, self).readline, ...
def function[readline, parameter[self, size]]: constant[Receive message of a size from the socket. Matches the following interface: https://docs.python.org/3/library/io.html#io.IOBase.readline ] return[call[name[self]._safe_call, parameter[constant[True], call[name[super], parameter...
keyword[def] identifier[readline] ( identifier[self] , identifier[size] =- literal[int] ): literal[string] keyword[return] identifier[self] . identifier[_safe_call] ( keyword[True] , identifier[super] ( identifier[SSLFileobjectMixin] , identifier[self] ). identifier[readline] , ...
def readline(self, size=-1): """Receive message of a size from the socket. Matches the following interface: https://docs.python.org/3/library/io.html#io.IOBase.readline """ return self._safe_call(True, super(SSLFileobjectMixin, self).readline, size)
def get_eval_metrics(logits, labels, params): """Return dictionary of model evaluation metrics.""" metrics = { "accuracy": _convert_to_eval_metric(padded_accuracy)(logits, labels), "accuracy_top5": _convert_to_eval_metric(padded_accuracy_top5)( logits, labels), "accuracy_per_sequence": _...
def function[get_eval_metrics, parameter[logits, labels, params]]: constant[Return dictionary of model evaluation metrics.] variable[metrics] assign[=] dictionary[[<ast.Constant object at 0x7da2054a69b0>, <ast.Constant object at 0x7da2054a4760>, <ast.Constant object at 0x7da2054a4970>, <ast.Constant obj...
keyword[def] identifier[get_eval_metrics] ( identifier[logits] , identifier[labels] , identifier[params] ): literal[string] identifier[metrics] ={ literal[string] : identifier[_convert_to_eval_metric] ( identifier[padded_accuracy] )( identifier[logits] , identifier[labels] ), literal[string] : identifier...
def get_eval_metrics(logits, labels, params): """Return dictionary of model evaluation metrics.""" metrics = {'accuracy': _convert_to_eval_metric(padded_accuracy)(logits, labels), 'accuracy_top5': _convert_to_eval_metric(padded_accuracy_top5)(logits, labels), 'accuracy_per_sequence': _convert_to_eval_metric(pad...
def inherit_handlers(self, excluded_handlers): # type: (Iterable[str]) -> None """ Merges the inherited configuration with the current ones :param excluded_handlers: Excluded handlers """ if not excluded_handlers: excluded_handlers = tuple() for hand...
def function[inherit_handlers, parameter[self, excluded_handlers]]: constant[ Merges the inherited configuration with the current ones :param excluded_handlers: Excluded handlers ] if <ast.UnaryOp object at 0x7da1b06c9c60> begin[:] variable[excluded_handlers] ass...
keyword[def] identifier[inherit_handlers] ( identifier[self] , identifier[excluded_handlers] ): literal[string] keyword[if] keyword[not] identifier[excluded_handlers] : identifier[excluded_handlers] = identifier[tuple] () keyword[for] identifier[handler] , identifier[conf...
def inherit_handlers(self, excluded_handlers): # type: (Iterable[str]) -> None '\n Merges the inherited configuration with the current ones\n\n :param excluded_handlers: Excluded handlers\n ' if not excluded_handlers: excluded_handlers = tuple() # depends on [control=['if'], da...
def add_coalescent_model(self, Tc, **kwargs): """Add a coalescent model to the tree and optionally optimze Parameters ---------- Tc : float,str If this is a float, it will be interpreted as the inverse merger rate in molecular clock units, if its is a """...
def function[add_coalescent_model, parameter[self, Tc]]: constant[Add a coalescent model to the tree and optionally optimze Parameters ---------- Tc : float,str If this is a float, it will be interpreted as the inverse merger rate in molecular clock units, if its...
keyword[def] identifier[add_coalescent_model] ( identifier[self] , identifier[Tc] ,** identifier[kwargs] ): literal[string] keyword[from] . identifier[merger_models] keyword[import] identifier[Coalescent] identifier[self] . identifier[logger] ( literal[string] + identifier[str] ( identi...
def add_coalescent_model(self, Tc, **kwargs): """Add a coalescent model to the tree and optionally optimze Parameters ---------- Tc : float,str If this is a float, it will be interpreted as the inverse merger rate in molecular clock units, if its is a """ ...
def reinterptet_harray_to_bits(typeFrom, sigOrVal, bitsT): """ Cast HArray signal or value to signal or value of type Bits """ size = int(typeFrom.size) widthOfElm = typeFrom.elmType.bit_length() w = bitsT.bit_length() if size * widthOfElm != w: raise TypeConversionErr( "...
def function[reinterptet_harray_to_bits, parameter[typeFrom, sigOrVal, bitsT]]: constant[ Cast HArray signal or value to signal or value of type Bits ] variable[size] assign[=] call[name[int], parameter[name[typeFrom].size]] variable[widthOfElm] assign[=] call[name[typeFrom].elmType.bit_...
keyword[def] identifier[reinterptet_harray_to_bits] ( identifier[typeFrom] , identifier[sigOrVal] , identifier[bitsT] ): literal[string] identifier[size] = identifier[int] ( identifier[typeFrom] . identifier[size] ) identifier[widthOfElm] = identifier[typeFrom] . identifier[elmType] . identifier[bit_l...
def reinterptet_harray_to_bits(typeFrom, sigOrVal, bitsT): """ Cast HArray signal or value to signal or value of type Bits """ size = int(typeFrom.size) widthOfElm = typeFrom.elmType.bit_length() w = bitsT.bit_length() if size * widthOfElm != w: raise TypeConversionErr('Size of types...
def get_network_by_full_name(self, si, default_network_full_name): """ Find network by a Full Name :param default_network_full_name: <str> Full Network Name - likes 'Root/Folder/Network' :return: """ path, name = get_path_and_name(default_network_full_name) return...
def function[get_network_by_full_name, parameter[self, si, default_network_full_name]]: constant[ Find network by a Full Name :param default_network_full_name: <str> Full Network Name - likes 'Root/Folder/Network' :return: ] <ast.Tuple object at 0x7da2047ebdf0> assign[=] ...
keyword[def] identifier[get_network_by_full_name] ( identifier[self] , identifier[si] , identifier[default_network_full_name] ): literal[string] identifier[path] , identifier[name] = identifier[get_path_and_name] ( identifier[default_network_full_name] ) keyword[return] identifier[self] ....
def get_network_by_full_name(self, si, default_network_full_name): """ Find network by a Full Name :param default_network_full_name: <str> Full Network Name - likes 'Root/Folder/Network' :return: """ (path, name) = get_path_and_name(default_network_full_name) return self.find...
def parse_fallback(self): """Fallback method when parser doesn't know the statement""" if self.strict: raise PywavefrontException("Unimplemented OBJ format statement '%s' on line '%s'" % (self.values[0], self.line.rstrip())) else: lo...
def function[parse_fallback, parameter[self]]: constant[Fallback method when parser doesn't know the statement] if name[self].strict begin[:] <ast.Raise object at 0x7da2044c3880>
keyword[def] identifier[parse_fallback] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[strict] : keyword[raise] identifier[PywavefrontException] ( literal[string] %( identifier[self] . identifier[values] [ literal[int] ], identifier[self]...
def parse_fallback(self): """Fallback method when parser doesn't know the statement""" if self.strict: raise PywavefrontException("Unimplemented OBJ format statement '%s' on line '%s'" % (self.values[0], self.line.rstrip())) # depends on [control=['if'], data=[]] else: logger.warning("Unimp...
def SequenceOf(klass): """Function to return a class that can encode and decode a list of some other type.""" if _debug: SequenceOf._debug("SequenceOf %r", klass) global _sequence_of_map global _sequence_of_classes, _array_of_classes # if this has already been built, return the cached one ...
def function[SequenceOf, parameter[klass]]: constant[Function to return a class that can encode and decode a list of some other type.] if name[_debug] begin[:] call[name[SequenceOf]._debug, parameter[constant[SequenceOf %r], name[klass]]] <ast.Global object at 0x7da1b0811fc0> ...
keyword[def] identifier[SequenceOf] ( identifier[klass] ): literal[string] keyword[if] identifier[_debug] : identifier[SequenceOf] . identifier[_debug] ( literal[string] , identifier[klass] ) keyword[global] identifier[_sequence_of_map] keyword[global] identifier[_sequence_of_classes] , iden...
def SequenceOf(klass): """Function to return a class that can encode and decode a list of some other type.""" if _debug: SequenceOf._debug('SequenceOf %r', klass) # depends on [control=['if'], data=[]] global _sequence_of_map global _sequence_of_classes, _array_of_classes # if this has ...
def create_wordpress(self, service_id, version_number, name, path, comment=None): """Create a wordpress for the specified service and version.""" body = self._formdata({ "name": name, "path": path, "comment": comment, }, FastlyWordpress.FIELDS) content = self._fetch("/service/%s/version/%d/wo...
def function[create_wordpress, parameter[self, service_id, version_number, name, path, comment]]: constant[Create a wordpress for the specified service and version.] variable[body] assign[=] call[name[self]._formdata, parameter[dictionary[[<ast.Constant object at 0x7da1b0f11600>, <ast.Constant object at...
keyword[def] identifier[create_wordpress] ( identifier[self] , identifier[service_id] , identifier[version_number] , identifier[name] , identifier[path] , identifier[comment] = keyword[None] ): literal[string] identifier[body] = identifier[self] . identifier[_formdata] ({ literal[string] : identifier[n...
def create_wordpress(self, service_id, version_number, name, path, comment=None): """Create a wordpress for the specified service and version.""" body = self._formdata({'name': name, 'path': path, 'comment': comment}, FastlyWordpress.FIELDS) content = self._fetch('/service/%s/version/%d/wordpress' % (servic...
def dedupe(input_file, output_file, returncmd=False, **kwargs): """ Runs dedupe from the bbtools package. :param input_file: Input file. :param returncmd: If set to true, function will return the cmd string passed to subprocess as a third value. :param output_file: Output file. :param kwargs: Ar...
def function[dedupe, parameter[input_file, output_file, returncmd]]: constant[ Runs dedupe from the bbtools package. :param input_file: Input file. :param returncmd: If set to true, function will return the cmd string passed to subprocess as a third value. :param output_file: Output file. :p...
keyword[def] identifier[dedupe] ( identifier[input_file] , identifier[output_file] , identifier[returncmd] = keyword[False] ,** identifier[kwargs] ): literal[string] identifier[options] = identifier[kwargs_to_string] ( identifier[kwargs] ) identifier[cmd] = literal[string] . identifier[format] ( ident...
def dedupe(input_file, output_file, returncmd=False, **kwargs): """ Runs dedupe from the bbtools package. :param input_file: Input file. :param returncmd: If set to true, function will return the cmd string passed to subprocess as a third value. :param output_file: Output file. :param kwargs: Ar...
def address(self, compressed=True, testnet=False): """ Address property that returns the Base58Check encoded version of the HASH160. Args: compressed (bool): Whether or not the compressed key should be used. testnet (bool): Whether or not the key is intend...
def function[address, parameter[self, compressed, testnet]]: constant[ Address property that returns the Base58Check encoded version of the HASH160. Args: compressed (bool): Whether or not the compressed key should be used. testnet (bool): Whether or not t...
keyword[def] identifier[address] ( identifier[self] , identifier[compressed] = keyword[True] , identifier[testnet] = keyword[False] ): literal[string] identifier[version] = literal[string] keyword[return] identifier[version] + identifier[binascii] . identifier[hexlify] ( identifier[self]...
def address(self, compressed=True, testnet=False): """ Address property that returns the Base58Check encoded version of the HASH160. Args: compressed (bool): Whether or not the compressed key should be used. testnet (bool): Whether or not the key is intended f...
def update_notification_list(self, apps=None, schema_editor=None, verbose=False): """Updates the notification model to ensure all registered notifications classes are listed. Typically called from a post_migrate signal. Also, in tests you can register a notification and the Notificatio...
def function[update_notification_list, parameter[self, apps, schema_editor, verbose]]: constant[Updates the notification model to ensure all registered notifications classes are listed. Typically called from a post_migrate signal. Also, in tests you can register a notification and the ...
keyword[def] identifier[update_notification_list] ( identifier[self] , identifier[apps] = keyword[None] , identifier[schema_editor] = keyword[None] , identifier[verbose] = keyword[False] ): literal[string] identifier[Notification] =( identifier[apps] keyword[or] identifier[django_apps] ). identif...
def update_notification_list(self, apps=None, schema_editor=None, verbose=False): """Updates the notification model to ensure all registered notifications classes are listed. Typically called from a post_migrate signal. Also, in tests you can register a notification and the Notification ...
def __chopStringDict(self, data): '''Returns a dictionary of the provided raw service/host check string.''' r = {} d = data.split('\t') for item in d: item_parts = item.split('::') if len(item_parts) == 2: (name, value) = item_parts e...
def function[__chopStringDict, parameter[self, data]]: constant[Returns a dictionary of the provided raw service/host check string.] variable[r] assign[=] dictionary[[], []] variable[d] assign[=] call[name[data].split, parameter[constant[ ]]] for taget[name[item]] in starred[name[d]] beg...
keyword[def] identifier[__chopStringDict] ( identifier[self] , identifier[data] ): literal[string] identifier[r] ={} identifier[d] = identifier[data] . identifier[split] ( literal[string] ) keyword[for] identifier[item] keyword[in] identifier[d] : identifier[item...
def __chopStringDict(self, data): """Returns a dictionary of the provided raw service/host check string.""" r = {} d = data.split('\t') for item in d: item_parts = item.split('::') if len(item_parts) == 2: (name, value) = item_parts # depends on [control=['if'], data=[]] ...
def send(reg_id, message, **kwargs): """ Site: https://developers.google.com API: https://developers.google.com/web/updates/2016/03/web-push-encryption Desc: Web Push notifications for Chrome and FireFox Installation: pip install 'pywebpush>=0.4.0' """ subscription_info = kwargs.pop('s...
def function[send, parameter[reg_id, message]]: constant[ Site: https://developers.google.com API: https://developers.google.com/web/updates/2016/03/web-push-encryption Desc: Web Push notifications for Chrome and FireFox Installation: pip install 'pywebpush>=0.4.0' ] variable[su...
keyword[def] identifier[send] ( identifier[reg_id] , identifier[message] ,** identifier[kwargs] ): literal[string] identifier[subscription_info] = identifier[kwargs] . identifier[pop] ( literal[string] ) identifier[payload] ={ literal[string] : identifier[kwargs] . identifier[pop] ( literal[str...
def send(reg_id, message, **kwargs): """ Site: https://developers.google.com API: https://developers.google.com/web/updates/2016/03/web-push-encryption Desc: Web Push notifications for Chrome and FireFox Installation: pip install 'pywebpush>=0.4.0' """ subscription_info = kwargs.pop('su...
def _process_exclude_dictionary(exclude_dictionary): """ Based on values in the exclude_dictionary generate a list of term queries that will filter out unwanted results. """ # not_properties will hold the generated term queries. not_properties = [] for exclude_property in exclude_dictionary:...
def function[_process_exclude_dictionary, parameter[exclude_dictionary]]: constant[ Based on values in the exclude_dictionary generate a list of term queries that will filter out unwanted results. ] variable[not_properties] assign[=] list[[]] for taget[name[exclude_property]] in star...
keyword[def] identifier[_process_exclude_dictionary] ( identifier[exclude_dictionary] ): literal[string] identifier[not_properties] =[] keyword[for] identifier[exclude_property] keyword[in] identifier[exclude_dictionary] : identifier[exclude_values] = identifier[exclude_dictionary] [ ...
def _process_exclude_dictionary(exclude_dictionary): """ Based on values in the exclude_dictionary generate a list of term queries that will filter out unwanted results. """ # not_properties will hold the generated term queries. not_properties = [] for exclude_property in exclude_dictionary:...
def get_conn(): ''' Return a conn object for the passed VM data ''' driver = get_driver(Provider.CLOUDSTACK) verify_ssl_cert = config.get_cloud_config_value('verify_ssl_cert', get_configured_provider(), __opts__, default=True, search_global=False) ...
def function[get_conn, parameter[]]: constant[ Return a conn object for the passed VM data ] variable[driver] assign[=] call[name[get_driver], parameter[name[Provider].CLOUDSTACK]] variable[verify_ssl_cert] assign[=] call[name[config].get_cloud_config_value, parameter[constant[verify_ssl...
keyword[def] identifier[get_conn] (): literal[string] identifier[driver] = identifier[get_driver] ( identifier[Provider] . identifier[CLOUDSTACK] ) identifier[verify_ssl_cert] = identifier[config] . identifier[get_cloud_config_value] ( literal[string] , identifier[get_configured_provider] (), ...
def get_conn(): """ Return a conn object for the passed VM data """ driver = get_driver(Provider.CLOUDSTACK) verify_ssl_cert = config.get_cloud_config_value('verify_ssl_cert', get_configured_provider(), __opts__, default=True, search_global=False) if verify_ssl_cert is False: try: ...
def close(self): """Stop serving the :attr:`.Server.sockets` and close all concurrent connections. """ transports, self.transports = self.transports, [] for transport in transports: transport.close()
def function[close, parameter[self]]: constant[Stop serving the :attr:`.Server.sockets` and close all concurrent connections. ] <ast.Tuple object at 0x7da20c992b90> assign[=] tuple[[<ast.Attribute object at 0x7da20c992ce0>, <ast.List object at 0x7da20c9923b0>]] for taget[name[tra...
keyword[def] identifier[close] ( identifier[self] ): literal[string] identifier[transports] , identifier[self] . identifier[transports] = identifier[self] . identifier[transports] ,[] keyword[for] identifier[transport] keyword[in] identifier[transports] : identifier[transpo...
def close(self): """Stop serving the :attr:`.Server.sockets` and close all concurrent connections. """ (transports, self.transports) = (self.transports, []) for transport in transports: transport.close() # depends on [control=['for'], data=['transport']]
def download(url, dir, filename=None, expect_size=None): """ Download URL to a directory. Will figure out the filename automatically from URL, if not given. """ mkdir_p(dir) if filename is None: filename = url.split('/')[-1] fpath = os.path.join(dir, filename) if os.path.isfile(...
def function[download, parameter[url, dir, filename, expect_size]]: constant[ Download URL to a directory. Will figure out the filename automatically from URL, if not given. ] call[name[mkdir_p], parameter[name[dir]]] if compare[name[filename] is constant[None]] begin[:] ...
keyword[def] identifier[download] ( identifier[url] , identifier[dir] , identifier[filename] = keyword[None] , identifier[expect_size] = keyword[None] ): literal[string] identifier[mkdir_p] ( identifier[dir] ) keyword[if] identifier[filename] keyword[is] keyword[None] : identifier[filename...
def download(url, dir, filename=None, expect_size=None): """ Download URL to a directory. Will figure out the filename automatically from URL, if not given. """ mkdir_p(dir) if filename is None: filename = url.split('/')[-1] # depends on [control=['if'], data=['filename']] fpath = o...
def _lock(self): """Lock the config DB.""" if not self.locked: self.device.cu.lock() self.locked = True
def function[_lock, parameter[self]]: constant[Lock the config DB.] if <ast.UnaryOp object at 0x7da1b26ac1c0> begin[:] call[name[self].device.cu.lock, parameter[]] name[self].locked assign[=] constant[True]
keyword[def] identifier[_lock] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[locked] : identifier[self] . identifier[device] . identifier[cu] . identifier[lock] () identifier[self] . identifier[locked] = keyword[True]
def _lock(self): """Lock the config DB.""" if not self.locked: self.device.cu.lock() self.locked = True # depends on [control=['if'], data=[]]
def plugitInclude(parser, token): """ Load and render a template, using the same context of a specific action. Example: {% plugitInclude "/menuBar" %} """ bits = token.split_contents() if len(bits) != 2: raise TemplateSyntaxError("'plugitInclude' tag takes one argument: the tem...
def function[plugitInclude, parameter[parser, token]]: constant[ Load and render a template, using the same context of a specific action. Example: {% plugitInclude "/menuBar" %} ] variable[bits] assign[=] call[name[token].split_contents, parameter[]] if compare[call[name[len...
keyword[def] identifier[plugitInclude] ( identifier[parser] , identifier[token] ): literal[string] identifier[bits] = identifier[token] . identifier[split_contents] () keyword[if] identifier[len] ( identifier[bits] )!= literal[int] : keyword[raise] identifier[TemplateSyntaxError] ( literal...
def plugitInclude(parser, token): """ Load and render a template, using the same context of a specific action. Example: {% plugitInclude "/menuBar" %} """ bits = token.split_contents() if len(bits) != 2: raise TemplateSyntaxError("'plugitInclude' tag takes one argument: the temp...
def walkParams(intf, discovered): """ walk parameter instances on this interface """ for si in intf._interfaces: yield from walkParams(si, discovered) for p in intf._params: if p not in discovered: discovered.add(p) yield p
def function[walkParams, parameter[intf, discovered]]: constant[ walk parameter instances on this interface ] for taget[name[si]] in starred[name[intf]._interfaces] begin[:] <ast.YieldFrom object at 0x7da1b0553f40> for taget[name[p]] in starred[name[intf]._params] begin[:...
keyword[def] identifier[walkParams] ( identifier[intf] , identifier[discovered] ): literal[string] keyword[for] identifier[si] keyword[in] identifier[intf] . identifier[_interfaces] : keyword[yield] keyword[from] identifier[walkParams] ( identifier[si] , identifier[discovered] ) keyword...
def walkParams(intf, discovered): """ walk parameter instances on this interface """ for si in intf._interfaces: yield from walkParams(si, discovered) # depends on [control=['for'], data=['si']] for p in intf._params: if p not in discovered: discovered.add(p) ...
def act(self, event, *args, **kwargs): """ Act on the specific life cycle event. The action here is to invoke the hook function on all registered plugins. *args and **kwargs will be passed directly to the plugin's hook functions :param samtranslator.plugins.LifeCycleEvents event: Event ...
def function[act, parameter[self, event]]: constant[ Act on the specific life cycle event. The action here is to invoke the hook function on all registered plugins. *args and **kwargs will be passed directly to the plugin's hook functions :param samtranslator.plugins.LifeCycleEvents eve...
keyword[def] identifier[act] ( identifier[self] , identifier[event] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[event] , identifier[LifeCycleEvents] ): keyword[raise] identifier[ValueError] ( literal[str...
def act(self, event, *args, **kwargs): """ Act on the specific life cycle event. The action here is to invoke the hook function on all registered plugins. *args and **kwargs will be passed directly to the plugin's hook functions :param samtranslator.plugins.LifeCycleEvents event: Event to a...
def image(array, domain=None, width=None, format='png', **kwargs): """Display an image. Args: array: NumPy array representing the image fmt: Image format e.g. png, jpeg domain: Domain of pixel values, inferred from min & max values if None w: width of output image, scaled using nearest neighbor int...
def function[image, parameter[array, domain, width, format]]: constant[Display an image. Args: array: NumPy array representing the image fmt: Image format e.g. png, jpeg domain: Domain of pixel values, inferred from min & max values if None w: width of output image, scaled using nearest neigh...
keyword[def] identifier[image] ( identifier[array] , identifier[domain] = keyword[None] , identifier[width] = keyword[None] , identifier[format] = literal[string] ,** identifier[kwargs] ): literal[string] identifier[image_data] = identifier[serialize_array] ( identifier[array] , identifier[fmt] = identifier[f...
def image(array, domain=None, width=None, format='png', **kwargs): """Display an image. Args: array: NumPy array representing the image fmt: Image format e.g. png, jpeg domain: Domain of pixel values, inferred from min & max values if None w: width of output image, scaled using nearest neighbor i...
def InputSplines(seq_length, n_bases=10, name=None, **kwargs): """Input placeholder for array returned by `encodeSplines` Wrapper for: `keras.layers.Input((seq_length, n_bases), name=name, **kwargs)` """ return Input((seq_length, n_bases), name=name, **kwargs)
def function[InputSplines, parameter[seq_length, n_bases, name]]: constant[Input placeholder for array returned by `encodeSplines` Wrapper for: `keras.layers.Input((seq_length, n_bases), name=name, **kwargs)` ] return[call[name[Input], parameter[tuple[[<ast.Name object at 0x7da207f033a0>, <ast.Name...
keyword[def] identifier[InputSplines] ( identifier[seq_length] , identifier[n_bases] = literal[int] , identifier[name] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[Input] (( identifier[seq_length] , identifier[n_bases] ), identifier[name] = identifier[name] ,** iden...
def InputSplines(seq_length, n_bases=10, name=None, **kwargs): """Input placeholder for array returned by `encodeSplines` Wrapper for: `keras.layers.Input((seq_length, n_bases), name=name, **kwargs)` """ return Input((seq_length, n_bases), name=name, **kwargs)
def results_equal(a, b): """Compares two result instances Checks full name and all data. Does not consider the comment. :return: True or False :raises: ValueError if both inputs are no result instances """ if a.v_is_parameter and b.v_is_parameter: raise ValueError('Both inputs are no...
def function[results_equal, parameter[a, b]]: constant[Compares two result instances Checks full name and all data. Does not consider the comment. :return: True or False :raises: ValueError if both inputs are no result instances ] if <ast.BoolOp object at 0x7da20c6a89d0> begin[:] ...
keyword[def] identifier[results_equal] ( identifier[a] , identifier[b] ): literal[string] keyword[if] identifier[a] . identifier[v_is_parameter] keyword[and] identifier[b] . identifier[v_is_parameter] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[if] identifier[a] ...
def results_equal(a, b): """Compares two result instances Checks full name and all data. Does not consider the comment. :return: True or False :raises: ValueError if both inputs are no result instances """ if a.v_is_parameter and b.v_is_parameter: raise ValueError('Both inputs are no...
def coverage(): "generate coverage report and show in browser" coverage_index = path("build/coverage/index.html") coverage_index.remove() sh("paver test") coverage_index.exists() and webbrowser.open(coverage_index)
def function[coverage, parameter[]]: constant[generate coverage report and show in browser] variable[coverage_index] assign[=] call[name[path], parameter[constant[build/coverage/index.html]]] call[name[coverage_index].remove, parameter[]] call[name[sh], parameter[constant[paver test]]] ...
keyword[def] identifier[coverage] (): literal[string] identifier[coverage_index] = identifier[path] ( literal[string] ) identifier[coverage_index] . identifier[remove] () identifier[sh] ( literal[string] ) identifier[coverage_index] . identifier[exists] () keyword[and] identifier[webbrowser...
def coverage(): """generate coverage report and show in browser""" coverage_index = path('build/coverage/index.html') coverage_index.remove() sh('paver test') coverage_index.exists() and webbrowser.open(coverage_index)
def _set_has_no_columns(self, has_no_column, col_avg, col_last, fields): """ Regenerate has_no_column by adding the amount of columns at the end """ for index, field in has_no_column.items(): if index == len(has_no_column): field_name = "{field}|{col_last}".fo...
def function[_set_has_no_columns, parameter[self, has_no_column, col_avg, col_last, fields]]: constant[ Regenerate has_no_column by adding the amount of columns at the end ] for taget[tuple[[<ast.Name object at 0x7da1b0535cc0>, <ast.Name object at 0x7da1b0535780>]]] in starred[call[name[...
keyword[def] identifier[_set_has_no_columns] ( identifier[self] , identifier[has_no_column] , identifier[col_avg] , identifier[col_last] , identifier[fields] ): literal[string] keyword[for] identifier[index] , identifier[field] keyword[in] identifier[has_no_column] . identifier[items] (): ...
def _set_has_no_columns(self, has_no_column, col_avg, col_last, fields): """ Regenerate has_no_column by adding the amount of columns at the end """ for (index, field) in has_no_column.items(): if index == len(has_no_column): field_name = '{field}|{col_last}'.format(field=fie...
def _sample(self, nmr_samples, thinning=1, return_output=True): """Sample the given number of samples with the given thinning. If ``return_output`` we will return the samples, log likelihoods and log priors. If not, we will advance the state of the sampler without returning storing the samples....
def function[_sample, parameter[self, nmr_samples, thinning, return_output]]: constant[Sample the given number of samples with the given thinning. If ``return_output`` we will return the samples, log likelihoods and log priors. If not, we will advance the state of the sampler without returning ...
keyword[def] identifier[_sample] ( identifier[self] , identifier[nmr_samples] , identifier[thinning] = literal[int] , identifier[return_output] = keyword[True] ): literal[string] identifier[kernel_data] = identifier[self] . identifier[_get_kernel_data] ( identifier[nmr_samples] , identifier[thinnin...
def _sample(self, nmr_samples, thinning=1, return_output=True): """Sample the given number of samples with the given thinning. If ``return_output`` we will return the samples, log likelihoods and log priors. If not, we will advance the state of the sampler without returning storing the samples. ...
def __find_file(name, path, deep=False, partial=False): """ Searches for a file and returns its path upon finding it. Searches for a file with the given `name` in the list of directory mentioned in `path`. It also supports `deep` search (recursive) and `partial` search (searching for files having f...
def function[__find_file, parameter[name, path, deep, partial]]: constant[ Searches for a file and returns its path upon finding it. Searches for a file with the given `name` in the list of directory mentioned in `path`. It also supports `deep` search (recursive) and `partial` search (searching...
keyword[def] identifier[__find_file] ( identifier[name] , identifier[path] , identifier[deep] = keyword[False] , identifier[partial] = keyword[False] ): literal[string] keyword[if] identifier[deep] : keyword[for] identifier[root] , identifier[dirs] , identifier[files] keyword[in] identifier[o...
def __find_file(name, path, deep=False, partial=False): """ Searches for a file and returns its path upon finding it. Searches for a file with the given `name` in the list of directory mentioned in `path`. It also supports `deep` search (recursive) and `partial` search (searching for files having f...
def estimateTdisrupt(self,deltaAngle): """ NAME: estimateTdisrupt PURPOSE: estimate the time of disruption INPUT: deltaAngle- spread in angle since disruption OUTPUT: time in natural units HISTORY: 2013-11-27...
def function[estimateTdisrupt, parameter[self, deltaAngle]]: constant[ NAME: estimateTdisrupt PURPOSE: estimate the time of disruption INPUT: deltaAngle- spread in angle since disruption OUTPUT: time in natural units HIS...
keyword[def] identifier[estimateTdisrupt] ( identifier[self] , identifier[deltaAngle] ): literal[string] keyword[return] identifier[deltaAngle] / identifier[numpy] . identifier[sqrt] ( identifier[numpy] . identifier[sum] ( identifier[self] . identifier[_dsigomeanProg] ** literal[int] ))
def estimateTdisrupt(self, deltaAngle): """ NAME: estimateTdisrupt PURPOSE: estimate the time of disruption INPUT: deltaAngle- spread in angle since disruption OUTPUT: time in natural units HISTORY: 2013-11-27 - ...
def limits(table, field): """ Find minimum and maximum values under the given field. E.g.:: >>> import petl as etl >>> table = [['foo', 'bar'], ['a', 1], ['b', 2], ['b', 3]] >>> minv, maxv = etl.limits(table, 'bar') >>> minv 1 >>> maxv 3 The `field` ...
def function[limits, parameter[table, field]]: constant[ Find minimum and maximum values under the given field. E.g.:: >>> import petl as etl >>> table = [['foo', 'bar'], ['a', 1], ['b', 2], ['b', 3]] >>> minv, maxv = etl.limits(table, 'bar') >>> minv 1 >>> m...
keyword[def] identifier[limits] ( identifier[table] , identifier[field] ): literal[string] identifier[vals] = identifier[iter] ( identifier[values] ( identifier[table] , identifier[field] )) keyword[try] : identifier[minv] = identifier[maxv] = identifier[next] ( identifier[vals] ) keywo...
def limits(table, field): """ Find minimum and maximum values under the given field. E.g.:: >>> import petl as etl >>> table = [['foo', 'bar'], ['a', 1], ['b', 2], ['b', 3]] >>> minv, maxv = etl.limits(table, 'bar') >>> minv 1 >>> maxv 3 The `field` ...
def handleRequestForUser(self, username, url): """ User C{username} wants to reset their password. Create an attempt item, and send them an email if the username is valid """ attempt = self.newAttemptForUser(username) account = self.accountByAddress(username) if ...
def function[handleRequestForUser, parameter[self, username, url]]: constant[ User C{username} wants to reset their password. Create an attempt item, and send them an email if the username is valid ] variable[attempt] assign[=] call[name[self].newAttemptForUser, parameter[name[u...
keyword[def] identifier[handleRequestForUser] ( identifier[self] , identifier[username] , identifier[url] ): literal[string] identifier[attempt] = identifier[self] . identifier[newAttemptForUser] ( identifier[username] ) identifier[account] = identifier[self] . identifier[accountByAddress]...
def handleRequestForUser(self, username, url): """ User C{username} wants to reset their password. Create an attempt item, and send them an email if the username is valid """ attempt = self.newAttemptForUser(username) account = self.accountByAddress(username) if account is None:...
def date(self): """DATE command. Coordinated Universal time from the perspective of the usenet server. It can be used to provide information that might be useful when using the NEWNEWS command. See <http://tools.ietf.org/html/rfc3977#section-7.1> Returns: T...
def function[date, parameter[self]]: constant[DATE command. Coordinated Universal time from the perspective of the usenet server. It can be used to provide information that might be useful when using the NEWNEWS command. See <http://tools.ietf.org/html/rfc3977#section-7.1> ...
keyword[def] identifier[date] ( identifier[self] ): literal[string] identifier[code] , identifier[message] = identifier[self] . identifier[command] ( literal[string] ) keyword[if] identifier[code] != literal[int] : keyword[raise] identifier[NNTPReplyError] ( identifier[code]...
def date(self): """DATE command. Coordinated Universal time from the perspective of the usenet server. It can be used to provide information that might be useful when using the NEWNEWS command. See <http://tools.ietf.org/html/rfc3977#section-7.1> Returns: The U...
def _setup(self): """ Prepare the scenario for Molecule and returns None. :return: None """ if not os.path.isdir(self.inventory_directory): os.makedirs(self.inventory_directory)
def function[_setup, parameter[self]]: constant[ Prepare the scenario for Molecule and returns None. :return: None ] if <ast.UnaryOp object at 0x7da1b2120220> begin[:] call[name[os].makedirs, parameter[name[self].inventory_directory]]
keyword[def] identifier[_setup] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[isdir] ( identifier[self] . identifier[inventory_directory] ): identifier[os] . identifier[makedirs] ( identifier[self] . identifier[inventory...
def _setup(self): """ Prepare the scenario for Molecule and returns None. :return: None """ if not os.path.isdir(self.inventory_directory): os.makedirs(self.inventory_directory) # depends on [control=['if'], data=[]]
def handle_err(*args): """ Handle fatal errors, caught in __main__ scope. If DEBUG is set, print a real traceback. Otherwise, `print_err` any arguments passed. """ if DEBUG: print_err(traceback.format_exc(), color=False) else: print_err(*args, newline=True)
def function[handle_err, parameter[]]: constant[ Handle fatal errors, caught in __main__ scope. If DEBUG is set, print a real traceback. Otherwise, `print_err` any arguments passed. ] if name[DEBUG] begin[:] call[name[print_err], parameter[call[name[traceback].format_...
keyword[def] identifier[handle_err] (* identifier[args] ): literal[string] keyword[if] identifier[DEBUG] : identifier[print_err] ( identifier[traceback] . identifier[format_exc] (), identifier[color] = keyword[False] ) keyword[else] : identifier[print_err] (* identifier[args] , iden...
def handle_err(*args): """ Handle fatal errors, caught in __main__ scope. If DEBUG is set, print a real traceback. Otherwise, `print_err` any arguments passed. """ if DEBUG: print_err(traceback.format_exc(), color=False) # depends on [control=['if'], data=[]] else: print...
def get_all_tags(image_name, branch=None): """ GET /v1/repositories/<namespace>/<repository_name>/tags :param image_name: The docker image name :param branch: The branch to filter by :return: A list of Version instances, latest first """ try: return get_all_tags_no_auth(image_name, ...
def function[get_all_tags, parameter[image_name, branch]]: constant[ GET /v1/repositories/<namespace>/<repository_name>/tags :param image_name: The docker image name :param branch: The branch to filter by :return: A list of Version instances, latest first ] <ast.Try object at 0x7da1b258...
keyword[def] identifier[get_all_tags] ( identifier[image_name] , identifier[branch] = keyword[None] ): literal[string] keyword[try] : keyword[return] identifier[get_all_tags_no_auth] ( identifier[image_name] , identifier[branch] ) keyword[except] identifier[AuthException] : keyword...
def get_all_tags(image_name, branch=None): """ GET /v1/repositories/<namespace>/<repository_name>/tags :param image_name: The docker image name :param branch: The branch to filter by :return: A list of Version instances, latest first """ try: return get_all_tags_no_auth(image_name, ...
def modification_time(self): """dfdatetime.DateTimeValues: modification time or None if not available.""" timestamp = getattr(self._tar_info, 'mtime', None) if timestamp is None: return None return dfdatetime_posix_time.PosixTime(timestamp=timestamp)
def function[modification_time, parameter[self]]: constant[dfdatetime.DateTimeValues: modification time or None if not available.] variable[timestamp] assign[=] call[name[getattr], parameter[name[self]._tar_info, constant[mtime], constant[None]]] if compare[name[timestamp] is constant[None]] beg...
keyword[def] identifier[modification_time] ( identifier[self] ): literal[string] identifier[timestamp] = identifier[getattr] ( identifier[self] . identifier[_tar_info] , literal[string] , keyword[None] ) keyword[if] identifier[timestamp] keyword[is] keyword[None] : keyword[return] keyword[N...
def modification_time(self): """dfdatetime.DateTimeValues: modification time or None if not available.""" timestamp = getattr(self._tar_info, 'mtime', None) if timestamp is None: return None # depends on [control=['if'], data=[]] return dfdatetime_posix_time.PosixTime(timestamp=timestamp)
def radiation_values(self, location, timestep=1): """Lists of driect normal, diffuse horiz, and global horiz rad at each timestep. """ # create sunpath and get altitude at every timestep of the design day sp = Sunpath.from_location(location) altitudes = [] dates = self._g...
def function[radiation_values, parameter[self, location, timestep]]: constant[Lists of driect normal, diffuse horiz, and global horiz rad at each timestep. ] variable[sp] assign[=] call[name[Sunpath].from_location, parameter[name[location]]] variable[altitudes] assign[=] list[[]] ...
keyword[def] identifier[radiation_values] ( identifier[self] , identifier[location] , identifier[timestep] = literal[int] ): literal[string] identifier[sp] = identifier[Sunpath] . identifier[from_location] ( identifier[location] ) identifier[altitudes] =[] identifier[date...
def radiation_values(self, location, timestep=1): """Lists of driect normal, diffuse horiz, and global horiz rad at each timestep. """ # create sunpath and get altitude at every timestep of the design day sp = Sunpath.from_location(location) altitudes = [] dates = self._get_datetimes(timeste...
def proxyval(self, visited): ''' Scrape a value from the inferior process, and try to represent it within the gdb process, whilst (hopefully) avoiding crashes when the remote data is corrupt. Derived classes will override this. For example, a PyIntObject* with ob_ival 4...
def function[proxyval, parameter[self, visited]]: constant[ Scrape a value from the inferior process, and try to represent it within the gdb process, whilst (hopefully) avoiding crashes when the remote data is corrupt. Derived classes will override this. For example, a ...
keyword[def] identifier[proxyval] ( identifier[self] , identifier[visited] ): literal[string] keyword[class] identifier[FakeRepr] ( identifier[object] ): literal[string] keyword[def] identifier[__init__] ( identifier[self] , identifier[tp_name] , identifier[address] )...
def proxyval(self, visited): """ Scrape a value from the inferior process, and try to represent it within the gdb process, whilst (hopefully) avoiding crashes when the remote data is corrupt. Derived classes will override this. For example, a PyIntObject* with ob_ival 42 in...
def execute(self, cmd, fname, codes=[0, None]): ''' Execute a command against the specified file. @cmd - Command to execute. @fname - File to run command against. @codes - List of return codes indicating cmd success. Returns True on success, False on failure, or None ...
def function[execute, parameter[self, cmd, fname, codes]]: constant[ Execute a command against the specified file. @cmd - Command to execute. @fname - File to run command against. @codes - List of return codes indicating cmd success. Returns True on success, False on ...
keyword[def] identifier[execute] ( identifier[self] , identifier[cmd] , identifier[fname] , identifier[codes] =[ literal[int] , keyword[None] ]): literal[string] identifier[tmp] = keyword[None] identifier[rval] = literal[int] identifier[retval] = keyword[True] identifi...
def execute(self, cmd, fname, codes=[0, None]): """ Execute a command against the specified file. @cmd - Command to execute. @fname - File to run command against. @codes - List of return codes indicating cmd success. Returns True on success, False on failure, or None if t...
def trunc_normal_(x:Tensor, mean:float=0., std:float=1.) -> Tensor: "Truncated normal initialization." # From https://discuss.pytorch.org/t/implementing-truncated-normal-initializer/4778/12 return x.normal_().fmod_(2).mul_(std).add_(mean)
def function[trunc_normal_, parameter[x, mean, std]]: constant[Truncated normal initialization.] return[call[call[call[call[name[x].normal_, parameter[]].fmod_, parameter[constant[2]]].mul_, parameter[name[std]]].add_, parameter[name[mean]]]]
keyword[def] identifier[trunc_normal_] ( identifier[x] : identifier[Tensor] , identifier[mean] : identifier[float] = literal[int] , identifier[std] : identifier[float] = literal[int] )-> identifier[Tensor] : literal[string] keyword[return] identifier[x] . identifier[normal_] (). identifier[fmod_] ( l...
def trunc_normal_(x: Tensor, mean: float=0.0, std: float=1.0) -> Tensor: """Truncated normal initialization.""" # From https://discuss.pytorch.org/t/implementing-truncated-normal-initializer/4778/12 return x.normal_().fmod_(2).mul_(std).add_(mean)
def merge_config( config: Mapping[str, Any], override_config: Mapping[str, Any] = None, override_config_fn: str = None, ) -> Mapping[str, Any]: """Override config with additional configuration in override_config or override_config_fn Used in script to merge CLI options with Config Args: ...
def function[merge_config, parameter[config, override_config, override_config_fn]]: constant[Override config with additional configuration in override_config or override_config_fn Used in script to merge CLI options with Config Args: config: original configuration override_config: new ...
keyword[def] identifier[merge_config] ( identifier[config] : identifier[Mapping] [ identifier[str] , identifier[Any] ], identifier[override_config] : identifier[Mapping] [ identifier[str] , identifier[Any] ]= keyword[None] , identifier[override_config_fn] : identifier[str] = keyword[None] , )-> identifier[Mapping]...
def merge_config(config: Mapping[str, Any], override_config: Mapping[str, Any]=None, override_config_fn: str=None) -> Mapping[str, Any]: """Override config with additional configuration in override_config or override_config_fn Used in script to merge CLI options with Config Args: config: original ...
def format_datetime(self, time_input, tz=None, date_format=None): """ Return timestamp from multiple input formats. Formats: #. Human Input (e.g 30 days ago, last friday) #. ISO 8601 (e.g. 2017-11-08T16:52:42Z) #. Loose Date format (e.g. 2017 12 25) ...
def function[format_datetime, parameter[self, time_input, tz, date_format]]: constant[ Return timestamp from multiple input formats. Formats: #. Human Input (e.g 30 days ago, last friday) #. ISO 8601 (e.g. 2017-11-08T16:52:42Z) #. Loose Date format (e.g. 2017 12...
keyword[def] identifier[format_datetime] ( identifier[self] , identifier[time_input] , identifier[tz] = keyword[None] , identifier[date_format] = keyword[None] ): literal[string] identifier[dt_value] = identifier[self] . identifier[any_to_datetime] ( identifier[time_input] , identifier[tz...
def format_datetime(self, time_input, tz=None, date_format=None): """ Return timestamp from multiple input formats. Formats: #. Human Input (e.g 30 days ago, last friday) #. ISO 8601 (e.g. 2017-11-08T16:52:42Z) #. Loose Date format (e.g. 2017 12 25) #. U...
def delete(self, table): """Deletes record in table >>> yql.delete('yql.storage').where(['name','=','store://YEl70PraLLMSMuYAauqNc7']) """ self._table = table self._limit = None self._query = "DELETE FROM {0}".format(self._table) return self
def function[delete, parameter[self, table]]: constant[Deletes record in table >>> yql.delete('yql.storage').where(['name','=','store://YEl70PraLLMSMuYAauqNc7']) ] name[self]._table assign[=] name[table] name[self]._limit assign[=] constant[None] name[self]._query assign[...
keyword[def] identifier[delete] ( identifier[self] , identifier[table] ): literal[string] identifier[self] . identifier[_table] = identifier[table] identifier[self] . identifier[_limit] = keyword[None] identifier[self] . identifier[_query] = literal[string] . identifier[format] ...
def delete(self, table): """Deletes record in table >>> yql.delete('yql.storage').where(['name','=','store://YEl70PraLLMSMuYAauqNc7']) """ self._table = table self._limit = None self._query = 'DELETE FROM {0}'.format(self._table) return self
def for_json(self): """Return date ISO8601 string formats for datetime, date, and time values, milliseconds for intervals""" value = super(DatetimeField, self).for_json() # Order of instance checks matters for proper inheritance checks if isinstance(value, pendulum.Interval): ...
def function[for_json, parameter[self]]: constant[Return date ISO8601 string formats for datetime, date, and time values, milliseconds for intervals] variable[value] assign[=] call[call[name[super], parameter[name[DatetimeField], name[self]]].for_json, parameter[]] if call[name[isinstance], para...
keyword[def] identifier[for_json] ( identifier[self] ): literal[string] identifier[value] = identifier[super] ( identifier[DatetimeField] , identifier[self] ). identifier[for_json] () keyword[if] identifier[isinstance] ( identifier[value] , identifier[pendulum] . identifier[Inte...
def for_json(self): """Return date ISO8601 string formats for datetime, date, and time values, milliseconds for intervals""" value = super(DatetimeField, self).for_json() # Order of instance checks matters for proper inheritance checks if isinstance(value, pendulum.Interval): return value.in_sec...
def error_uns(self): """Check if package supported by arch before proceed to install """ self.FAULT = "" UNST = ["UNSUPPORTED", "UNTESTED"] if "".join(self.source_dwn) in UNST: self.FAULT = "".join(self.source_dwn)
def function[error_uns, parameter[self]]: constant[Check if package supported by arch before proceed to install ] name[self].FAULT assign[=] constant[] variable[UNST] assign[=] list[[<ast.Constant object at 0x7da204961900>, <ast.Constant object at 0x7da2049628f0>]] if com...
keyword[def] identifier[error_uns] ( identifier[self] ): literal[string] identifier[self] . identifier[FAULT] = literal[string] identifier[UNST] =[ literal[string] , literal[string] ] keyword[if] literal[string] . identifier[join] ( identifier[self] . identifier[source_dwn] ) ke...
def error_uns(self): """Check if package supported by arch before proceed to install """ self.FAULT = '' UNST = ['UNSUPPORTED', 'UNTESTED'] if ''.join(self.source_dwn) in UNST: self.FAULT = ''.join(self.source_dwn) # depends on [control=['if'], data=[]]
def get_statistics(prefix=''): """ Get statistics for message codes that start with the prefix. prefix='' matches all errors and warnings prefix='E' matches all errors prefix='W' matches all warnings prefix='E4' matches all errors that have to do with imports """ stats = [] keys = o...
def function[get_statistics, parameter[prefix]]: constant[ Get statistics for message codes that start with the prefix. prefix='' matches all errors and warnings prefix='E' matches all errors prefix='W' matches all warnings prefix='E4' matches all errors that have to do with imports ] ...
keyword[def] identifier[get_statistics] ( identifier[prefix] = literal[string] ): literal[string] identifier[stats] =[] identifier[keys] = identifier[options] . identifier[messages] . identifier[keys] () identifier[keys] . identifier[sort] () keyword[for] identifier[key] keyword[in] ident...
def get_statistics(prefix=''): """ Get statistics for message codes that start with the prefix. prefix='' matches all errors and warnings prefix='E' matches all errors prefix='W' matches all warnings prefix='E4' matches all errors that have to do with imports """ stats = [] keys = o...
def search_texts(args, parser): """Searches texts for presence of n-grams.""" store = utils.get_data_store(args) corpus = utils.get_corpus(args) catalogue = utils.get_catalogue(args) store.validate(corpus, catalogue) ngrams = [] for ngram_file in args.ngrams: ngrams.extend(utils.get_...
def function[search_texts, parameter[args, parser]]: constant[Searches texts for presence of n-grams.] variable[store] assign[=] call[name[utils].get_data_store, parameter[name[args]]] variable[corpus] assign[=] call[name[utils].get_corpus, parameter[name[args]]] variable[catalogue] assi...
keyword[def] identifier[search_texts] ( identifier[args] , identifier[parser] ): literal[string] identifier[store] = identifier[utils] . identifier[get_data_store] ( identifier[args] ) identifier[corpus] = identifier[utils] . identifier[get_corpus] ( identifier[args] ) identifier[catalogue] = ide...
def search_texts(args, parser): """Searches texts for presence of n-grams.""" store = utils.get_data_store(args) corpus = utils.get_corpus(args) catalogue = utils.get_catalogue(args) store.validate(corpus, catalogue) ngrams = [] for ngram_file in args.ngrams: ngrams.extend(utils.get_...
def author_name(author): """ get name of author, or else username. It'll try to find an email in the author string and just cut it off to get the username """ if not '@' in author: return author else: return author.replace(author_email(author), '').replace('<', '')\ ...
def function[author_name, parameter[author]]: constant[ get name of author, or else username. It'll try to find an email in the author string and just cut it off to get the username ] if <ast.UnaryOp object at 0x7da1b264a9e0> begin[:] return[name[author]]
keyword[def] identifier[author_name] ( identifier[author] ): literal[string] keyword[if] keyword[not] literal[string] keyword[in] identifier[author] : keyword[return] identifier[author] keyword[else] : keyword[return] identifier[author] . identifier[replace] ( identifier[auth...
def author_name(author): """ get name of author, or else username. It'll try to find an email in the author string and just cut it off to get the username """ if not '@' in author: return author # depends on [control=['if'], data=[]] else: return author.replace(author_email(...
def _annotate_query(query, generate_dict): """Add annotations to the query to retrieve values required by field value generate functions.""" annotate_key_list = [] for field_name, annotate_dict in generate_dict.items(): for annotate_name, annotate_func in annotate_dict["annotate_dict"].items(): ...
def function[_annotate_query, parameter[query, generate_dict]]: constant[Add annotations to the query to retrieve values required by field value generate functions.] variable[annotate_key_list] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da1b190b3d0>, <ast.Name object at 0x7da...
keyword[def] identifier[_annotate_query] ( identifier[query] , identifier[generate_dict] ): literal[string] identifier[annotate_key_list] =[] keyword[for] identifier[field_name] , identifier[annotate_dict] keyword[in] identifier[generate_dict] . identifier[items] (): keyword[for] identifi...
def _annotate_query(query, generate_dict): """Add annotations to the query to retrieve values required by field value generate functions.""" annotate_key_list = [] for (field_name, annotate_dict) in generate_dict.items(): for (annotate_name, annotate_func) in annotate_dict['annotate_dict'].items...
def findItems( self, cls ): """ Looks up the items in the scene that inherit from the inputed class. :param cls | <type> """ return filter(lambda x: isinstance(x, cls), self.items())
def function[findItems, parameter[self, cls]]: constant[ Looks up the items in the scene that inherit from the inputed class. :param cls | <type> ] return[call[name[filter], parameter[<ast.Lambda object at 0x7da18f58ea10>, call[name[self].items, parameter[]]]]]
keyword[def] identifier[findItems] ( identifier[self] , identifier[cls] ): literal[string] keyword[return] identifier[filter] ( keyword[lambda] identifier[x] : identifier[isinstance] ( identifier[x] , identifier[cls] ), identifier[self] . identifier[items] ())
def findItems(self, cls): """ Looks up the items in the scene that inherit from the inputed class. :param cls | <type> """ return filter(lambda x: isinstance(x, cls), self.items())
def load_app(config, **kwargs): ''' Used to load a ``Pecan`` application and its environment based on passed configuration. :param config: Can be a dictionary containing configuration, a string which represents a (relative) configuration filename returns a pecan.Pecan object ...
def function[load_app, parameter[config]]: constant[ Used to load a ``Pecan`` application and its environment based on passed configuration. :param config: Can be a dictionary containing configuration, a string which represents a (relative) configuration filename returns a ...
keyword[def] identifier[load_app] ( identifier[config] ,** identifier[kwargs] ): literal[string] keyword[from] . identifier[configuration] keyword[import] identifier[_runtime_conf] , identifier[set_config] identifier[set_config] ( identifier[config] , identifier[overwrite] = keyword[True] ) k...
def load_app(config, **kwargs): """ Used to load a ``Pecan`` application and its environment based on passed configuration. :param config: Can be a dictionary containing configuration, a string which represents a (relative) configuration filename returns a pecan.Pecan object ...
def stop(self) -> None: """Stops the timer.""" self._running = False if self._timeout is not None: self.io_loop.remove_timeout(self._timeout) self._timeout = None
def function[stop, parameter[self]]: constant[Stops the timer.] name[self]._running assign[=] constant[False] if compare[name[self]._timeout is_not constant[None]] begin[:] call[name[self].io_loop.remove_timeout, parameter[name[self]._timeout]] name[self]._timeout...
keyword[def] identifier[stop] ( identifier[self] )-> keyword[None] : literal[string] identifier[self] . identifier[_running] = keyword[False] keyword[if] identifier[self] . identifier[_timeout] keyword[is] keyword[not] keyword[None] : identifier[self] . identifier[io_loop...
def stop(self) -> None: """Stops the timer.""" self._running = False if self._timeout is not None: self.io_loop.remove_timeout(self._timeout) self._timeout = None # depends on [control=['if'], data=[]]
def small_abc_image_recognition(): """! @brief Trains network using letters 'A', 'B', 'C', and recognize each of them with and without noise. """ images = []; images += IMAGE_SYMBOL_SAMPLES.LIST_IMAGES_SYMBOL_A; images += IMAGE_SYMBOL_SAMPLES.LIST_IMAGES_SYMBOL_B; images += IMAG...
def function[small_abc_image_recognition, parameter[]]: constant[! @brief Trains network using letters 'A', 'B', 'C', and recognize each of them with and without noise. ] variable[images] assign[=] list[[]] <ast.AugAssign object at 0x7da18dc98370> <ast.AugAssign object at 0x7da18dc9...
keyword[def] identifier[small_abc_image_recognition] (): literal[string] identifier[images] =[]; identifier[images] += identifier[IMAGE_SYMBOL_SAMPLES] . identifier[LIST_IMAGES_SYMBOL_A] ; identifier[images] += identifier[IMAGE_SYMBOL_SAMPLES] . identifier[LIST_IMAGES_SYMBOL_B] ; identi...
def small_abc_image_recognition(): """! @brief Trains network using letters 'A', 'B', 'C', and recognize each of them with and without noise. """ images = [] images += IMAGE_SYMBOL_SAMPLES.LIST_IMAGES_SYMBOL_A images += IMAGE_SYMBOL_SAMPLES.LIST_IMAGES_SYMBOL_B images += IMAGE_SYMBOL_SA...
def get_public_ip_validator(): """ Retrieves a validator for public IP address. Accepting all defaults will perform a check for an existing name or ID with no ARM-required -type parameter. """ from msrestazure.tools import is_valid_resource_id, resource_id def simple_validator(cmd, namespace): ...
def function[get_public_ip_validator, parameter[]]: constant[ Retrieves a validator for public IP address. Accepting all defaults will perform a check for an existing name or ID with no ARM-required -type parameter. ] from relative_module[msrestazure.tools] import module[is_valid_resource_id], module[re...
keyword[def] identifier[get_public_ip_validator] (): literal[string] keyword[from] identifier[msrestazure] . identifier[tools] keyword[import] identifier[is_valid_resource_id] , identifier[resource_id] keyword[def] identifier[simple_validator] ( identifier[cmd] , identifier[namespace] ): ...
def get_public_ip_validator(): """ Retrieves a validator for public IP address. Accepting all defaults will perform a check for an existing name or ID with no ARM-required -type parameter. """ from msrestazure.tools import is_valid_resource_id, resource_id def simple_validator(cmd, namespace): ...
def list_ip(self, instance_id): """Add all IPs""" output = self.client.describe_instances(InstanceIds=[instance_id]) output = output.get("Reservations")[0].get("Instances")[0] ips = {} ips['PrivateIp'] = output.get("PrivateIpAddress") ips['PublicIp'] = output.get("PublicI...
def function[list_ip, parameter[self, instance_id]]: constant[Add all IPs] variable[output] assign[=] call[name[self].client.describe_instances, parameter[]] variable[output] assign[=] call[call[call[call[name[output].get, parameter[constant[Reservations]]]][constant[0]].get, parameter[constant[...
keyword[def] identifier[list_ip] ( identifier[self] , identifier[instance_id] ): literal[string] identifier[output] = identifier[self] . identifier[client] . identifier[describe_instances] ( identifier[InstanceIds] =[ identifier[instance_id] ]) identifier[output] = identifier[output] . ide...
def list_ip(self, instance_id): """Add all IPs""" output = self.client.describe_instances(InstanceIds=[instance_id]) output = output.get('Reservations')[0].get('Instances')[0] ips = {} ips['PrivateIp'] = output.get('PrivateIpAddress') ips['PublicIp'] = output.get('PublicIpAddress') return ip...
def get_account(self, username): """return user by username. """ try: account = self.model.objects.get( **self._filter_user_by(username) ) except self.model.DoesNotExist: return None return account
def function[get_account, parameter[self, username]]: constant[return user by username. ] <ast.Try object at 0x7da2041d9780> return[name[account]]
keyword[def] identifier[get_account] ( identifier[self] , identifier[username] ): literal[string] keyword[try] : identifier[account] = identifier[self] . identifier[model] . identifier[objects] . identifier[get] ( ** identifier[self] . identifier[_filter_user_by] ( identifi...
def get_account(self, username): """return user by username. """ try: account = self.model.objects.get(**self._filter_user_by(username)) # depends on [control=['try'], data=[]] except self.model.DoesNotExist: return None # depends on [control=['except'], data=[]] return account
def isworkday(self, date): """ Check if a given date is a work date, ignoring holidays. Args: date (date, datetime or str): Date to be checked. Returns: bool: True if the date is a work date, False otherwise. """ date = parsefun(date) ...
def function[isworkday, parameter[self, date]]: constant[ Check if a given date is a work date, ignoring holidays. Args: date (date, datetime or str): Date to be checked. Returns: bool: True if the date is a work date, False otherwise. ] variable...
keyword[def] identifier[isworkday] ( identifier[self] , identifier[date] ): literal[string] identifier[date] = identifier[parsefun] ( identifier[date] ) keyword[return] identifier[self] . identifier[weekdaymap] [ identifier[date] . identifier[weekday] ()]. identifier[isworkday]
def isworkday(self, date): """ Check if a given date is a work date, ignoring holidays. Args: date (date, datetime or str): Date to be checked. Returns: bool: True if the date is a work date, False otherwise. """ date = parsefun(date) return self.wee...
def get_qpimage_raw(self, idx): """Return QPImage without background correction""" with self._qpseries() as qps: qpi = qps.get_qpimage(index=idx).copy() # Remove previously performed background correction qpi.set_bg_data(None) # Force meta data for key in self...
def function[get_qpimage_raw, parameter[self, idx]]: constant[Return QPImage without background correction] with call[name[self]._qpseries, parameter[]] begin[:] variable[qpi] assign[=] call[call[name[qps].get_qpimage, parameter[]].copy, parameter[]] call[name[qpi].set_bg_data, p...
keyword[def] identifier[get_qpimage_raw] ( identifier[self] , identifier[idx] ): literal[string] keyword[with] identifier[self] . identifier[_qpseries] () keyword[as] identifier[qps] : identifier[qpi] = identifier[qps] . identifier[get_qpimage] ( identifier[index] = identifier[idx] )...
def get_qpimage_raw(self, idx): """Return QPImage without background correction""" with self._qpseries() as qps: qpi = qps.get_qpimage(index=idx).copy() # depends on [control=['with'], data=['qps']] # Remove previously performed background correction qpi.set_bg_data(None) # Force meta data ...
def _get_available_placements(D, tt): """ Called from: _prompt_placement() Get a list of possible places that we can put the new model data into. If no model exists yet, we'll use something like chron0model0. If other models exist, we'll go for the n+1 entry. ex: chron0model0 already exists, so...
def function[_get_available_placements, parameter[D, tt]]: constant[ Called from: _prompt_placement() Get a list of possible places that we can put the new model data into. If no model exists yet, we'll use something like chron0model0. If other models exist, we'll go for the n+1 entry. ex: ...
keyword[def] identifier[_get_available_placements] ( identifier[D] , identifier[tt] ): literal[string] identifier[_options] =[] keyword[try] : keyword[for] identifier[_pc] keyword[in] [ literal[string] , literal[string] ]: keyword[if] identifier[_pc] keyword[in] identifier[...
def _get_available_placements(D, tt): """ Called from: _prompt_placement() Get a list of possible places that we can put the new model data into. If no model exists yet, we'll use something like chron0model0. If other models exist, we'll go for the n+1 entry. ex: chron0model0 already exists, so...
def get_all_tags(self): """ This method returns a list of all tags. """ data = self.get_data("tags") return [ Tag(token=self.token, **tag) for tag in data['tags'] ]
def function[get_all_tags, parameter[self]]: constant[ This method returns a list of all tags. ] variable[data] assign[=] call[name[self].get_data, parameter[constant[tags]]] return[<ast.ListComp object at 0x7da1b016d030>]
keyword[def] identifier[get_all_tags] ( identifier[self] ): literal[string] identifier[data] = identifier[self] . identifier[get_data] ( literal[string] ) keyword[return] [ identifier[Tag] ( identifier[token] = identifier[self] . identifier[token] ,** identifier[tag] ) keyword[for...
def get_all_tags(self): """ This method returns a list of all tags. """ data = self.get_data('tags') return [Tag(token=self.token, **tag) for tag in data['tags']]
def check_for_insufficient_eth( self, transaction_name: str, transaction_executed: bool, required_gas: int, block_identifier: BlockSpecification, ): """ After estimate gas failure checks if our address has enough balance. If the account di...
def function[check_for_insufficient_eth, parameter[self, transaction_name, transaction_executed, required_gas, block_identifier]]: constant[ After estimate gas failure checks if our address has enough balance. If the account did not have enough ETH balance to execute the, transaction then it ra...
keyword[def] identifier[check_for_insufficient_eth] ( identifier[self] , identifier[transaction_name] : identifier[str] , identifier[transaction_executed] : identifier[bool] , identifier[required_gas] : identifier[int] , identifier[block_identifier] : identifier[BlockSpecification] , ): literal[string] ...
def check_for_insufficient_eth(self, transaction_name: str, transaction_executed: bool, required_gas: int, block_identifier: BlockSpecification): """ After estimate gas failure checks if our address has enough balance. If the account did not have enough ETH balance to execute the, transaction then ...
def from_stmt(stmt, engine, **kwargs): """ Execute a query in form of texture clause, return the result in form of :class:`PrettyTable`. :type stmt: TextClause :param stmt: :type engine: Engine :param engine: :rtype: PrettyTable """ result_proxy = engine.execute(stmt, **kwarg...
def function[from_stmt, parameter[stmt, engine]]: constant[ Execute a query in form of texture clause, return the result in form of :class:`PrettyTable`. :type stmt: TextClause :param stmt: :type engine: Engine :param engine: :rtype: PrettyTable ] variable[result_prox...
keyword[def] identifier[from_stmt] ( identifier[stmt] , identifier[engine] ,** identifier[kwargs] ): literal[string] identifier[result_proxy] = identifier[engine] . identifier[execute] ( identifier[stmt] ,** identifier[kwargs] ) keyword[return] identifier[from_db_cursor] ( identifier[result_proxy] . ...
def from_stmt(stmt, engine, **kwargs): """ Execute a query in form of texture clause, return the result in form of :class:`PrettyTable`. :type stmt: TextClause :param stmt: :type engine: Engine :param engine: :rtype: PrettyTable """ result_proxy = engine.execute(stmt, **kwarg...
def Nads_in_slab(self): """ Returns the TOTAL number of adsorbates in the slab on BOTH sides """ return sum([self.composition.as_dict()[a] for a \ in self.ads_entries_dict.keys()])
def function[Nads_in_slab, parameter[self]]: constant[ Returns the TOTAL number of adsorbates in the slab on BOTH sides ] return[call[name[sum], parameter[<ast.ListComp object at 0x7da20e9573a0>]]]
keyword[def] identifier[Nads_in_slab] ( identifier[self] ): literal[string] keyword[return] identifier[sum] ([ identifier[self] . identifier[composition] . identifier[as_dict] ()[ identifier[a] ] keyword[for] identifier[a] keyword[in] identifier[self] . identifier[ads_entries_dict] . identifier...
def Nads_in_slab(self): """ Returns the TOTAL number of adsorbates in the slab on BOTH sides """ return sum([self.composition.as_dict()[a] for a in self.ads_entries_dict.keys()])
def get_next_triangle(mesh, T, plane, intersection, dist_tol): """ Returns the next triangle to visit given the intersection and the list of unvisited triangles (T) We look for a triangle that is cut by the plane (2 intersections) as opposed to one that only touch the plane (1 vertex intersection) ...
def function[get_next_triangle, parameter[mesh, T, plane, intersection, dist_tol]]: constant[ Returns the next triangle to visit given the intersection and the list of unvisited triangles (T) We look for a triangle that is cut by the plane (2 intersections) as opposed to one that only touch the...
keyword[def] identifier[get_next_triangle] ( identifier[mesh] , identifier[T] , identifier[plane] , identifier[intersection] , identifier[dist_tol] ): literal[string] keyword[if] identifier[intersection] [ literal[int] ]== identifier[INTERSECT_EDGE] : identifier[tris] = identifier[mesh] . identif...
def get_next_triangle(mesh, T, plane, intersection, dist_tol): """ Returns the next triangle to visit given the intersection and the list of unvisited triangles (T) We look for a triangle that is cut by the plane (2 intersections) as opposed to one that only touch the plane (1 vertex intersection) ...
def _warn(message, warn_type='user'): """ message (unicode): The message to display. category (Warning): The Warning to show. """ w_id = message.split('[', 1)[1].split(']', 1)[0] # get ID from string if warn_type in SPACY_WARNING_TYPES and w_id not in SPACY_WARNING_IGNORE: category = WA...
def function[_warn, parameter[message, warn_type]]: constant[ message (unicode): The message to display. category (Warning): The Warning to show. ] variable[w_id] assign[=] call[call[call[call[name[message].split, parameter[constant[[], constant[1]]]][constant[1]].split, parameter[constant[]...
keyword[def] identifier[_warn] ( identifier[message] , identifier[warn_type] = literal[string] ): literal[string] identifier[w_id] = identifier[message] . identifier[split] ( literal[string] , literal[int] )[ literal[int] ]. identifier[split] ( literal[string] , literal[int] )[ literal[int] ] keyword[...
def _warn(message, warn_type='user'): """ message (unicode): The message to display. category (Warning): The Warning to show. """ w_id = message.split('[', 1)[1].split(']', 1)[0] # get ID from string if warn_type in SPACY_WARNING_TYPES and w_id not in SPACY_WARNING_IGNORE: category = WA...
def gen_schedule(user, num_blocks=6, surrounding_blocks=None): """Generate a list of information about a block and a student's current activity signup. Returns: schedule no_signup_today """ no_signup_today = None schedule = [] if surrounding_blocks is None: surrounding...
def function[gen_schedule, parameter[user, num_blocks, surrounding_blocks]]: constant[Generate a list of information about a block and a student's current activity signup. Returns: schedule no_signup_today ] variable[no_signup_today] assign[=] constant[None] variable[sc...
keyword[def] identifier[gen_schedule] ( identifier[user] , identifier[num_blocks] = literal[int] , identifier[surrounding_blocks] = keyword[None] ): literal[string] identifier[no_signup_today] = keyword[None] identifier[schedule] =[] keyword[if] identifier[surrounding_blocks] keyword[is] key...
def gen_schedule(user, num_blocks=6, surrounding_blocks=None): """Generate a list of information about a block and a student's current activity signup. Returns: schedule no_signup_today """ no_signup_today = None schedule = [] if surrounding_blocks is None: surrounding_...
def cull(data,index,min=None,max=None): """Sieve an emcee clouds by excluding walkers with search variable 'index' smaller than 'min' or larger than 'max'.""" ret = data if min is not None: ret = ret[ret[:,index] > min,:] if max is not None: ret = ret[ret[:,index] < max,:] ...
def function[cull, parameter[data, index, min, max]]: constant[Sieve an emcee clouds by excluding walkers with search variable 'index' smaller than 'min' or larger than 'max'.] variable[ret] assign[=] name[data] if compare[name[min] is_not constant[None]] begin[:] variable[re...
keyword[def] identifier[cull] ( identifier[data] , identifier[index] , identifier[min] = keyword[None] , identifier[max] = keyword[None] ): literal[string] identifier[ret] = identifier[data] keyword[if] identifier[min] keyword[is] keyword[not] keyword[None] : identifier[ret] = identifi...
def cull(data, index, min=None, max=None): """Sieve an emcee clouds by excluding walkers with search variable 'index' smaller than 'min' or larger than 'max'.""" ret = data if min is not None: ret = ret[ret[:, index] > min, :] # depends on [control=['if'], data=['min']] if max is not None: ...