code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def get_data_home(path=None): """ Return the path of the Yellowbrick data directory. This folder is used by dataset loaders to avoid downloading data several times. By default, this folder is colocated with the code in the install directory so that data shipped with the package can be easily locate...
def function[get_data_home, parameter[path]]: constant[ Return the path of the Yellowbrick data directory. This folder is used by dataset loaders to avoid downloading data several times. By default, this folder is colocated with the code in the install directory so that data shipped with the pa...
keyword[def] identifier[get_data_home] ( identifier[path] = keyword[None] ): literal[string] keyword[if] identifier[path] keyword[is] keyword[None] : identifier[path] = identifier[os] . identifier[environ] . identifier[get] ( literal[string] , identifier[FIXTURES] ) identifier[path] = ide...
def get_data_home(path=None): """ Return the path of the Yellowbrick data directory. This folder is used by dataset loaders to avoid downloading data several times. By default, this folder is colocated with the code in the install directory so that data shipped with the package can be easily locate...
def addSkip(self, test, reason): """Catch skipped tests in Python 2.7 and above. Though ``addSkip()`` is deprecated in the nose plugin API, it is very much not deprecated as a Python 2.7 ``TestResult`` method. In Python 2.7, this will get called instead of ``addError()`` for skips. ...
def function[addSkip, parameter[self, test, reason]]: constant[Catch skipped tests in Python 2.7 and above. Though ``addSkip()`` is deprecated in the nose plugin API, it is very much not deprecated as a Python 2.7 ``TestResult`` method. In Python 2.7, this will get called instead of ``a...
keyword[def] identifier[addSkip] ( identifier[self] , identifier[test] , identifier[reason] ): literal[string] identifier[self] . identifier[_recordAndPrintHeadline] ( identifier[test] , identifier[SkipTest] , identifier[reason] ) keyword[if] identifier[isinstance] ( identifier[r...
def addSkip(self, test, reason): """Catch skipped tests in Python 2.7 and above. Though ``addSkip()`` is deprecated in the nose plugin API, it is very much not deprecated as a Python 2.7 ``TestResult`` method. In Python 2.7, this will get called instead of ``addError()`` for skips. ...
def load(self, dump_fn='', prep_only=0, force_upload=0, from_local=0, name=None, site=None, dest_dir=None, force_host=None): """ Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finall...
def function[load, parameter[self, dump_fn, prep_only, force_upload, from_local, name, site, dest_dir, force_host]]: constant[ Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finally ...
keyword[def] identifier[load] ( identifier[self] , identifier[dump_fn] = literal[string] , identifier[prep_only] = literal[int] , identifier[force_upload] = literal[int] , identifier[from_local] = literal[int] , identifier[name] = keyword[None] , identifier[site] = keyword[None] , identifier[dest_dir] = keyword[None]...
def load(self, dump_fn='', prep_only=0, force_upload=0, from_local=0, name=None, site=None, dest_dir=None, force_host=None): """ Restores a database snapshot onto the target database server. If prep_only=1, commands for preparing the load will be generated, but not the command to finally lo...
def DICOMfile_read(self, *args, **kwargs): """ Read a DICOM file and perform some initial parsing of tags. NB! For thread safety, class member variables should not be assigned since other threads might override/change these variables in mid- flight! ...
def function[DICOMfile_read, parameter[self]]: constant[ Read a DICOM file and perform some initial parsing of tags. NB! For thread safety, class member variables should not be assigned since other threads might override/change these variables in mid- fli...
keyword[def] identifier[DICOMfile_read] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[b_status] = keyword[False] identifier[l_tags] =[] identifier[l_tagsToUse] =[] identifier[d_tagsInString] ={} identifier[str_file] ...
def DICOMfile_read(self, *args, **kwargs): """ Read a DICOM file and perform some initial parsing of tags. NB! For thread safety, class member variables should not be assigned since other threads might override/change these variables in mid- flight! ...
def _update(self, data): '''Update the step using the blob of json-parsed data directly from the API. ''' self.orderby = data['orderby'] self.revision = data['revisionid'] self.title = data['title'] self.lines = [Line(self.guideid, self.stepid, line['lineid'], data=line) ...
def function[_update, parameter[self, data]]: constant[Update the step using the blob of json-parsed data directly from the API. ] name[self].orderby assign[=] call[name[data]][constant[orderby]] name[self].revision assign[=] call[name[data]][constant[revisionid]] name[self]....
keyword[def] identifier[_update] ( identifier[self] , identifier[data] ): literal[string] identifier[self] . identifier[orderby] = identifier[data] [ literal[string] ] identifier[self] . identifier[revision] = identifier[data] [ literal[string] ] identifier[self] . identifier[title] = ide...
def _update(self, data): """Update the step using the blob of json-parsed data directly from the API. """ self.orderby = data['orderby'] self.revision = data['revisionid'] self.title = data['title'] self.lines = [Line(self.guideid, self.stepid, line['lineid'], data=line) for line in data...
def get_default(name, value): """return value from environment variables with name EXAMPLE_<name> or value""" return os.environ.get('EXAMPLE_{}'.format(name.upper()), value)
def function[get_default, parameter[name, value]]: constant[return value from environment variables with name EXAMPLE_<name> or value] return[call[name[os].environ.get, parameter[call[constant[EXAMPLE_{}].format, parameter[call[name[name].upper, parameter[]]]], name[value]]]]
keyword[def] identifier[get_default] ( identifier[name] , identifier[value] ): literal[string] keyword[return] identifier[os] . identifier[environ] . identifier[get] ( literal[string] . identifier[format] ( identifier[name] . identifier[upper] ()), identifier[value] )
def get_default(name, value): """return value from environment variables with name EXAMPLE_<name> or value""" return os.environ.get('EXAMPLE_{}'.format(name.upper()), value)
def allocate_seg_vlan(self, net_id, is_fw_virt, direc, tenant_id): """allocate segmentation ID and VLAN ID. Allocate vlan, seg thereby storing NetID atomically. This saves an extra step to update DB with NetID after allocation. Also may save an extra step after restart, if process crash...
def function[allocate_seg_vlan, parameter[self, net_id, is_fw_virt, direc, tenant_id]]: constant[allocate segmentation ID and VLAN ID. Allocate vlan, seg thereby storing NetID atomically. This saves an extra step to update DB with NetID after allocation. Also may save an extra step afte...
keyword[def] identifier[allocate_seg_vlan] ( identifier[self] , identifier[net_id] , identifier[is_fw_virt] , identifier[direc] , identifier[tenant_id] ): literal[string] identifier[seg] = identifier[self] . identifier[alloc_seg] ( identifier[net_id] ) identifier[vlan] = literal[int] ...
def allocate_seg_vlan(self, net_id, is_fw_virt, direc, tenant_id): """allocate segmentation ID and VLAN ID. Allocate vlan, seg thereby storing NetID atomically. This saves an extra step to update DB with NetID after allocation. Also may save an extra step after restart, if process crashed ...
def train(self): ''' Train Linear Regression Algorithm From f(x) = WX Find best h(x) = WX similar to f(x) Output W ''' if (self.status != 'init'): print("Please load train data and init W first.") return self.W self.status = 'tra...
def function[train, parameter[self]]: constant[ Train Linear Regression Algorithm From f(x) = WX Find best h(x) = WX similar to f(x) Output W ] if compare[name[self].status not_equal[!=] constant[init]] begin[:] call[name[print], parameter[constant...
keyword[def] identifier[train] ( identifier[self] ): literal[string] keyword[if] ( identifier[self] . identifier[status] != literal[string] ): identifier[print] ( literal[string] ) keyword[return] identifier[self] . identifier[W] identifier[self] . identifier...
def train(self): """ Train Linear Regression Algorithm From f(x) = WX Find best h(x) = WX similar to f(x) Output W """ if self.status != 'init': print('Please load train data and init W first.') return self.W # depends on [control=['if'], data=[]] sel...
def calculate_gradient(self, batch_info, device, model, rollout): """ Calculate loss of the supplied rollout """ rollout = rollout.to_transitions() dones = rollout.batch_tensor('dones') rewards = rollout.batch_tensor('rewards') observations_next = rollout.batch_tensor('observati...
def function[calculate_gradient, parameter[self, batch_info, device, model, rollout]]: constant[ Calculate loss of the supplied rollout ] variable[rollout] assign[=] call[name[rollout].to_transitions, parameter[]] variable[dones] assign[=] call[name[rollout].batch_tensor, parameter[constant[done...
keyword[def] identifier[calculate_gradient] ( identifier[self] , identifier[batch_info] , identifier[device] , identifier[model] , identifier[rollout] ): literal[string] identifier[rollout] = identifier[rollout] . identifier[to_transitions] () identifier[dones] = identifier[rollout] . ide...
def calculate_gradient(self, batch_info, device, model, rollout): """ Calculate loss of the supplied rollout """ rollout = rollout.to_transitions() dones = rollout.batch_tensor('dones') rewards = rollout.batch_tensor('rewards') observations_next = rollout.batch_tensor('observations_next') action...
def sharey(axes): """ Shared axes limits without shared locators, ticks, etc. By Joe Kington """ linker = Linker(axes) for ax in axes: ax._linker = linker
def function[sharey, parameter[axes]]: constant[ Shared axes limits without shared locators, ticks, etc. By Joe Kington ] variable[linker] assign[=] call[name[Linker], parameter[name[axes]]] for taget[name[ax]] in starred[name[axes]] begin[:] name[ax]._linker assign[...
keyword[def] identifier[sharey] ( identifier[axes] ): literal[string] identifier[linker] = identifier[Linker] ( identifier[axes] ) keyword[for] identifier[ax] keyword[in] identifier[axes] : identifier[ax] . identifier[_linker] = identifier[linker]
def sharey(axes): """ Shared axes limits without shared locators, ticks, etc. By Joe Kington """ linker = Linker(axes) for ax in axes: ax._linker = linker # depends on [control=['for'], data=['ax']]
def vectorize(self, docs): """ Vectorizes a list of documents using their DCS representations. """ doc_core_sems, all_concepts = self._extract_core_semantics(docs) shape = (len(docs), len(all_concepts)) vecs = np.zeros(shape) for i, core_sems in enumerate(doc_cor...
def function[vectorize, parameter[self, docs]]: constant[ Vectorizes a list of documents using their DCS representations. ] <ast.Tuple object at 0x7da207f03fa0> assign[=] call[name[self]._extract_core_semantics, parameter[name[docs]]] variable[shape] assign[=] tuple[[<ast.Call ob...
keyword[def] identifier[vectorize] ( identifier[self] , identifier[docs] ): literal[string] identifier[doc_core_sems] , identifier[all_concepts] = identifier[self] . identifier[_extract_core_semantics] ( identifier[docs] ) identifier[shape] =( identifier[len] ( identifier[docs] ), identif...
def vectorize(self, docs): """ Vectorizes a list of documents using their DCS representations. """ (doc_core_sems, all_concepts) = self._extract_core_semantics(docs) shape = (len(docs), len(all_concepts)) vecs = np.zeros(shape) for (i, core_sems) in enumerate(doc_core_sems): ...
def atlasdb_renew_peer( peer_hostport, now, con=None, path=None ): """ Renew a peer's discovery time """ with AtlasDBOpen(con=con, path=path) as dbcon: if now is None: now = time.time() sql = "UPDATE peers SET discovery_time = ? WHERE peer_hostport = ?;" args = (now,...
def function[atlasdb_renew_peer, parameter[peer_hostport, now, con, path]]: constant[ Renew a peer's discovery time ] with call[name[AtlasDBOpen], parameter[]] begin[:] if compare[name[now] is constant[None]] begin[:] variable[now] assign[=] call[name[time...
keyword[def] identifier[atlasdb_renew_peer] ( identifier[peer_hostport] , identifier[now] , identifier[con] = keyword[None] , identifier[path] = keyword[None] ): literal[string] keyword[with] identifier[AtlasDBOpen] ( identifier[con] = identifier[con] , identifier[path] = identifier[path] ) keyword[as] i...
def atlasdb_renew_peer(peer_hostport, now, con=None, path=None): """ Renew a peer's discovery time """ with AtlasDBOpen(con=con, path=path) as dbcon: if now is None: now = time.time() # depends on [control=['if'], data=['now']] sql = 'UPDATE peers SET discovery_time = ? WHER...
def EWFGlobPathSpec(file_system, path_spec): """Globs for path specifications according to the EWF naming schema. Args: file_system (FileSystem): file system. path_spec (PathSpec): path specification. Returns: list[PathSpec]: path specifications that match the glob. Raises: PathSpecError: if ...
def function[EWFGlobPathSpec, parameter[file_system, path_spec]]: constant[Globs for path specifications according to the EWF naming schema. Args: file_system (FileSystem): file system. path_spec (PathSpec): path specification. Returns: list[PathSpec]: path specifications that match the glob. ...
keyword[def] identifier[EWFGlobPathSpec] ( identifier[file_system] , identifier[path_spec] ): literal[string] keyword[if] keyword[not] identifier[path_spec] . identifier[HasParent] (): keyword[raise] identifier[errors] . identifier[PathSpecError] ( literal[string] ) identifier[parent_path_spec...
def EWFGlobPathSpec(file_system, path_spec): """Globs for path specifications according to the EWF naming schema. Args: file_system (FileSystem): file system. path_spec (PathSpec): path specification. Returns: list[PathSpec]: path specifications that match the glob. Raises: PathSpecError: i...
def getChargeURL(self, CorpNum, UserID): """ 팝빌 연동회원 포인트 충전 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException """ result = self._httpget('/?TG=CHRG', ...
def function[getChargeURL, parameter[self, CorpNum, UserID]]: constant[ 팝빌 연동회원 포인트 충전 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException ] variable[re...
keyword[def] identifier[getChargeURL] ( identifier[self] , identifier[CorpNum] , identifier[UserID] ): literal[string] identifier[result] = identifier[self] . identifier[_httpget] ( literal[string] , identifier[CorpNum] , identifier[UserID] ) keyword[return] identifier[result] . identifie...
def getChargeURL(self, CorpNum, UserID): """ 팝빌 연동회원 포인트 충전 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException """ result = self._httpget('/?TG=CHRG', CorpNum,...
def _alloc(self): """ Allocate empty memory for dae variable indices. Called in device setup phase. :return: None """ nzeros = [0] * self.n for var in self._states: self.__dict__[var] = nzeros[:] for var in self._algebs: self.__dic...
def function[_alloc, parameter[self]]: constant[ Allocate empty memory for dae variable indices. Called in device setup phase. :return: None ] variable[nzeros] assign[=] binary_operation[list[[<ast.Constant object at 0x7da18f09de40>]] * name[self].n] for taget[na...
keyword[def] identifier[_alloc] ( identifier[self] ): literal[string] identifier[nzeros] =[ literal[int] ]* identifier[self] . identifier[n] keyword[for] identifier[var] keyword[in] identifier[self] . identifier[_states] : identifier[self] . identifier[__dict__] [ identifi...
def _alloc(self): """ Allocate empty memory for dae variable indices. Called in device setup phase. :return: None """ nzeros = [0] * self.n for var in self._states: self.__dict__[var] = nzeros[:] # depends on [control=['for'], data=['var']] for var in self._alge...
def add_unique_postfix(fn): """__source__ = 'http://code.activestate.com/recipes/577200-make-unique-file-name/'""" if not os.path.exists(fn): return fn path, name = os.path.split(fn) name, ext = os.path.splitext(name) make_fn = lambda i: os.path.join(path, '%s(%d)%s' % (name, i, ext)) ...
def function[add_unique_postfix, parameter[fn]]: constant[__source__ = 'http://code.activestate.com/recipes/577200-make-unique-file-name/'] if <ast.UnaryOp object at 0x7da18f720550> begin[:] return[name[fn]] <ast.Tuple object at 0x7da18f723670> assign[=] call[name[os].path.split, paramet...
keyword[def] identifier[add_unique_postfix] ( identifier[fn] ): literal[string] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[fn] ): keyword[return] identifier[fn] identifier[path] , identifier[name] = identifier[os] . identifier[path] . ide...
def add_unique_postfix(fn): """__source__ = 'http://code.activestate.com/recipes/577200-make-unique-file-name/'""" if not os.path.exists(fn): return fn # depends on [control=['if'], data=[]] (path, name) = os.path.split(fn) (name, ext) = os.path.splitext(name) make_fn = lambda i: os.path.jo...
def get_suggestion(self, random_search=False): """get suggestion from hyperopt Parameters ---------- random_search : bool flag to indicate random search or not (default: {False}) Returns ---------- total_params : dict parameter suggestion...
def function[get_suggestion, parameter[self, random_search]]: constant[get suggestion from hyperopt Parameters ---------- random_search : bool flag to indicate random search or not (default: {False}) Returns ---------- total_params : dict ...
keyword[def] identifier[get_suggestion] ( identifier[self] , identifier[random_search] = keyword[False] ): literal[string] identifier[rval] = identifier[self] . identifier[rval] identifier[trials] = identifier[rval] . identifier[trials] identifier[algorithm] = identifier[rval] ...
def get_suggestion(self, random_search=False): """get suggestion from hyperopt Parameters ---------- random_search : bool flag to indicate random search or not (default: {False}) Returns ---------- total_params : dict parameter suggestion ...
def idle_task(self): '''handle missing waypoints''' if self.wp_period.trigger(): # cope with packet loss fetching mission if self.master is not None and self.master.time_since('MISSION_ITEM') >= 2 and self.wploader.count() < getattr(self.wploader,'expected_count',0): ...
def function[idle_task, parameter[self]]: constant[handle missing waypoints] if call[name[self].wp_period.trigger, parameter[]] begin[:] if <ast.BoolOp object at 0x7da18f722e90> begin[:] variable[wps] assign[=] call[name[self].missing_wps_to_request, parameter[]] ...
keyword[def] identifier[idle_task] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[wp_period] . identifier[trigger] (): keyword[if] identifier[self] . identifier[master] keyword[is] keyword[not] keyword[None] keyword[and] identifier[self]...
def idle_task(self): """handle missing waypoints""" if self.wp_period.trigger(): # cope with packet loss fetching mission if self.master is not None and self.master.time_since('MISSION_ITEM') >= 2 and (self.wploader.count() < getattr(self.wploader, 'expected_count', 0)): wps = self.m...
def _get_conda_version(stdout, stderr): """Callback for get_conda_version.""" # argparse outputs version to stderr in Python < 3.4. # http://bugs.python.org/issue18920 pat = re.compile(r'conda:?\s+(\d+\.\d\S+|unknown)') m = pat.match(stderr.decode().strip()) if m is None:...
def function[_get_conda_version, parameter[stdout, stderr]]: constant[Callback for get_conda_version.] variable[pat] assign[=] call[name[re].compile, parameter[constant[conda:?\s+(\d+\.\d\S+|unknown)]]] variable[m] assign[=] call[name[pat].match, parameter[call[call[name[stderr].decode, paramete...
keyword[def] identifier[_get_conda_version] ( identifier[stdout] , identifier[stderr] ): literal[string] identifier[pat] = identifier[re] . identifier[compile] ( literal[string] ) identifier[m] = identifier[pat] . identifier[match] ( identifier[stderr] . identifier[decode...
def _get_conda_version(stdout, stderr): """Callback for get_conda_version.""" # argparse outputs version to stderr in Python < 3.4. # http://bugs.python.org/issue18920 pat = re.compile('conda:?\\s+(\\d+\\.\\d\\S+|unknown)') m = pat.match(stderr.decode().strip()) if m is None: m = pat.mat...
def verifypartialtablecell(self, window_name, object_name, row_index, column_index, row_text): """ Verify partial table cell value @param window_name: Window name to type in, either full name, LDTP's name convention, or a Unix glob. @type window_na...
def function[verifypartialtablecell, parameter[self, window_name, object_name, row_index, column_index, row_text]]: constant[ Verify partial table cell value @param window_name: Window name to type in, either full name, LDTP's name convention, or a Unix glob. @type window_name: ...
keyword[def] identifier[verifypartialtablecell] ( identifier[self] , identifier[window_name] , identifier[object_name] , identifier[row_index] , identifier[column_index] , identifier[row_text] ): literal[string] keyword[try] : identifier[value] = identifier[getcellvalue] ( identifier[...
def verifypartialtablecell(self, window_name, object_name, row_index, column_index, row_text): """ Verify partial table cell value @param window_name: Window name to type in, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_na...
def get_registered_models(self, abstract=True): """ Returns a list of all registered models, or just concrete registered models. """ return [model for (model, opts) in self._registry.items() if opts.registered and (not model._meta.abstract or abstract)]
def function[get_registered_models, parameter[self, abstract]]: constant[ Returns a list of all registered models, or just concrete registered models. ] return[<ast.ListComp object at 0x7da18f58ce80>]
keyword[def] identifier[get_registered_models] ( identifier[self] , identifier[abstract] = keyword[True] ): literal[string] keyword[return] [ identifier[model] keyword[for] ( identifier[model] , identifier[opts] ) keyword[in] identifier[self] . identifier[_registry] . identifier[items] () ...
def get_registered_models(self, abstract=True): """ Returns a list of all registered models, or just concrete registered models. """ return [model for (model, opts) in self._registry.items() if opts.registered and (not model._meta.abstract or abstract)]
def patch_connection_file_paths(connection: str) -> str: """ Patch any paths in a connection to remove the balena host paths Undoes the changes applied by :py:meth:`opentrons.system.nmcli._rewrite_key_path_to_host_path` :param connection: The contents of a NetworkManager connection file :retur...
def function[patch_connection_file_paths, parameter[connection]]: constant[ Patch any paths in a connection to remove the balena host paths Undoes the changes applied by :py:meth:`opentrons.system.nmcli._rewrite_key_path_to_host_path` :param connection: The contents of a NetworkManager connect...
keyword[def] identifier[patch_connection_file_paths] ( identifier[connection] : identifier[str] )-> identifier[str] : literal[string] identifier[new_conn_lines] =[] keyword[for] identifier[line] keyword[in] identifier[connection] . identifier[split] ( literal[string] ): keyword[if] litera...
def patch_connection_file_paths(connection: str) -> str: """ Patch any paths in a connection to remove the balena host paths Undoes the changes applied by :py:meth:`opentrons.system.nmcli._rewrite_key_path_to_host_path` :param connection: The contents of a NetworkManager connection file :retur...
def triangle_normal(tri): """ Computes the (approximate) normal vector of the input triangle. :param tri: triangle object :type tri: elements.Triangle :return: normal vector of the triangle :rtype: tuple """ vec1 = vector_generate(tri.vertices[0].data, tri.vertices[1].data) vec2 = vecto...
def function[triangle_normal, parameter[tri]]: constant[ Computes the (approximate) normal vector of the input triangle. :param tri: triangle object :type tri: elements.Triangle :return: normal vector of the triangle :rtype: tuple ] variable[vec1] assign[=] call[name[vector_generate...
keyword[def] identifier[triangle_normal] ( identifier[tri] ): literal[string] identifier[vec1] = identifier[vector_generate] ( identifier[tri] . identifier[vertices] [ literal[int] ]. identifier[data] , identifier[tri] . identifier[vertices] [ literal[int] ]. identifier[data] ) identifier[vec2] = iden...
def triangle_normal(tri): """ Computes the (approximate) normal vector of the input triangle. :param tri: triangle object :type tri: elements.Triangle :return: normal vector of the triangle :rtype: tuple """ vec1 = vector_generate(tri.vertices[0].data, tri.vertices[1].data) vec2 = vecto...
def has(self, name): """ Returns True if there is atleast one annotation by a given name, otherwise False. """ for a in self.all_annotations: if a.name == name: return True return False
def function[has, parameter[self, name]]: constant[ Returns True if there is atleast one annotation by a given name, otherwise False. ] for taget[name[a]] in starred[name[self].all_annotations] begin[:] if compare[name[a].name equal[==] name[name]] begin[:] re...
keyword[def] identifier[has] ( identifier[self] , identifier[name] ): literal[string] keyword[for] identifier[a] keyword[in] identifier[self] . identifier[all_annotations] : keyword[if] identifier[a] . identifier[name] == identifier[name] : keyword[return] keyword...
def has(self, name): """ Returns True if there is atleast one annotation by a given name, otherwise False. """ for a in self.all_annotations: if a.name == name: return True # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['a']] return False
def recurse(self): """Recurse into the tree. :returns: :class:`Tree <Tree>` """ json = self._json(self._get(self._api, params={'recursive': '1'}), 200) return Tree(json, self._session) if json else None
def function[recurse, parameter[self]]: constant[Recurse into the tree. :returns: :class:`Tree <Tree>` ] variable[json] assign[=] call[name[self]._json, parameter[call[name[self]._get, parameter[name[self]._api]], constant[200]]] return[<ast.IfExp object at 0x7da1b0fbb5b0>]
keyword[def] identifier[recurse] ( identifier[self] ): literal[string] identifier[json] = identifier[self] . identifier[_json] ( identifier[self] . identifier[_get] ( identifier[self] . identifier[_api] , identifier[params] ={ literal[string] : literal[string] }), literal[int] ) k...
def recurse(self): """Recurse into the tree. :returns: :class:`Tree <Tree>` """ json = self._json(self._get(self._api, params={'recursive': '1'}), 200) return Tree(json, self._session) if json else None
def copy_with_additional_key(self, key: Any) -> 'RandomnessStream': """Creates a copy of this stream that combines this streams key with a new one. Parameters ---------- key : The additional key to describe the new stream with. Returns ------- Random...
def function[copy_with_additional_key, parameter[self, key]]: constant[Creates a copy of this stream that combines this streams key with a new one. Parameters ---------- key : The additional key to describe the new stream with. Returns ------- Random...
keyword[def] identifier[copy_with_additional_key] ( identifier[self] , identifier[key] : identifier[Any] )-> literal[string] : literal[string] keyword[if] identifier[self] . identifier[_for_initialization] : keyword[raise] identifier[RandomnessError] ( literal[string] ) keyw...
def copy_with_additional_key(self, key: Any) -> 'RandomnessStream': """Creates a copy of this stream that combines this streams key with a new one. Parameters ---------- key : The additional key to describe the new stream with. Returns ------- Randomness...
def get_device_state(self, device, id_override=None, type_override=None): """ Get device state via online API. Args: device (WinkDevice): The device the change is being requested for. id_override (String, optional): A device ID used to override the passed...
def function[get_device_state, parameter[self, device, id_override, type_override]]: constant[ Get device state via online API. Args: device (WinkDevice): The device the change is being requested for. id_override (String, optional): A device ID used to override the ...
keyword[def] identifier[get_device_state] ( identifier[self] , identifier[device] , identifier[id_override] = keyword[None] , identifier[type_override] = keyword[None] ): literal[string] identifier[_LOGGER] . identifier[info] ( literal[string] ) identifier[object_id] = identifier[id_overri...
def get_device_state(self, device, id_override=None, type_override=None): """ Get device state via online API. Args: device (WinkDevice): The device the change is being requested for. id_override (String, optional): A device ID used to override the passed in ...
def get_context_data(self, **kwargs): """ Returns the context data to provide to the template. """ context = super().get_context_data(**kwargs) context['poster'] = self.poster return context
def function[get_context_data, parameter[self]]: constant[ Returns the context data to provide to the template. ] variable[context] assign[=] call[call[name[super], parameter[]].get_context_data, parameter[]] call[name[context]][constant[poster]] assign[=] name[self].poster return[name[conte...
keyword[def] identifier[get_context_data] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[context] = identifier[super] (). identifier[get_context_data] (** identifier[kwargs] ) identifier[context] [ literal[string] ]= identifier[self] . identifier[poster] ...
def get_context_data(self, **kwargs): """ Returns the context data to provide to the template. """ context = super().get_context_data(**kwargs) context['poster'] = self.poster return context
def start(self, activity, action): ''' Mark an action as started :param activity: The virtualenv activity name :type activity: ``str`` :param action: The virtualenv action :type action: :class:`tox.session.Action` ''' try: self._start_actio...
def function[start, parameter[self, activity, action]]: constant[ Mark an action as started :param activity: The virtualenv activity name :type activity: ``str`` :param action: The virtualenv action :type action: :class:`tox.session.Action` ] <ast.Try obje...
keyword[def] identifier[start] ( identifier[self] , identifier[activity] , identifier[action] ): literal[string] keyword[try] : identifier[self] . identifier[_start_action] ( identifier[activity] , identifier[action] ) keyword[except] identifier[ValueError] : ide...
def start(self, activity, action): """ Mark an action as started :param activity: The virtualenv activity name :type activity: ``str`` :param action: The virtualenv action :type action: :class:`tox.session.Action` """ try: self._start_action(activity, ...
def get_group_id(self, user_id): """ 获取用户所在分组 ID 详情请参考 http://mp.weixin.qq.com/wiki/0/56d992c605a97245eb7e617854b169fc.html :param user_id: 用户 ID :return: 用户所在分组 ID 使用示例:: from wechatpy import WeChatClient client = WeChatClient('appid'...
def function[get_group_id, parameter[self, user_id]]: constant[ 获取用户所在分组 ID 详情请参考 http://mp.weixin.qq.com/wiki/0/56d992c605a97245eb7e617854b169fc.html :param user_id: 用户 ID :return: 用户所在分组 ID 使用示例:: from wechatpy import WeChatClient cl...
keyword[def] identifier[get_group_id] ( identifier[self] , identifier[user_id] ): literal[string] identifier[res] = identifier[self] . identifier[_post] ( literal[string] , identifier[data] ={ literal[string] : identifier[user_id] }, identifier[result_processor] = keyword...
def get_group_id(self, user_id): """ 获取用户所在分组 ID 详情请参考 http://mp.weixin.qq.com/wiki/0/56d992c605a97245eb7e617854b169fc.html :param user_id: 用户 ID :return: 用户所在分组 ID 使用示例:: from wechatpy import WeChatClient client = WeChatClient('appid', 's...
def to_normal_cloud(self): """Convert the image to a NormalCloud object. Returns ------- :obj:`autolab_core.NormalCloud` The corresponding NormalCloud. """ return NormalCloud( data=self._data.reshape( self.height * ...
def function[to_normal_cloud, parameter[self]]: constant[Convert the image to a NormalCloud object. Returns ------- :obj:`autolab_core.NormalCloud` The corresponding NormalCloud. ] return[call[name[NormalCloud], parameter[]]]
keyword[def] identifier[to_normal_cloud] ( identifier[self] ): literal[string] keyword[return] identifier[NormalCloud] ( identifier[data] = identifier[self] . identifier[_data] . identifier[reshape] ( identifier[self] . identifier[height] * identifier[self] . identifier[...
def to_normal_cloud(self): """Convert the image to a NormalCloud object. Returns ------- :obj:`autolab_core.NormalCloud` The corresponding NormalCloud. """ return NormalCloud(data=self._data.reshape(self.height * self.width, 3).T, frame=self._frame)
def descending(self, name): ''' Add a descending index for ``name`` to this index. :param name: Name to be used in the index ''' self.components.append((name, Index.DESCENDING)) return self
def function[descending, parameter[self, name]]: constant[ Add a descending index for ``name`` to this index. :param name: Name to be used in the index ] call[name[self].components.append, parameter[tuple[[<ast.Name object at 0x7da207f9b3d0>, <ast.Attribute object at 0x7da207f99e10>...
keyword[def] identifier[descending] ( identifier[self] , identifier[name] ): literal[string] identifier[self] . identifier[components] . identifier[append] (( identifier[name] , identifier[Index] . identifier[DESCENDING] )) keyword[return] identifier[self]
def descending(self, name): """ Add a descending index for ``name`` to this index. :param name: Name to be used in the index """ self.components.append((name, Index.DESCENDING)) return self
def get_barcode_stats(self, barcode): """ Loads the JSON in a ${barcode}_stats.json file in the DNAnexus project (usually in the qc folder). """ filename = barcode + "_stats.json" # In the call to dxpy.find_one_data_object() below, I'd normally set the # more_ok...
def function[get_barcode_stats, parameter[self, barcode]]: constant[ Loads the JSON in a ${barcode}_stats.json file in the DNAnexus project (usually in the qc folder). ] variable[filename] assign[=] binary_operation[name[barcode] + constant[_stats.json]] variable[file_id...
keyword[def] identifier[get_barcode_stats] ( identifier[self] , identifier[barcode] ): literal[string] identifier[filename] = identifier[barcode] + literal[string] identifier[file_id] = identifier[dxpy] . identifier[find_one_data_object] ( iden...
def get_barcode_stats(self, barcode): """ Loads the JSON in a ${barcode}_stats.json file in the DNAnexus project (usually in the qc folder). """ filename = barcode + '_stats.json' # In the call to dxpy.find_one_data_object() below, I'd normally set the # more_ok parameter to False...
def momentum_core(params, gradients, momentum=0.9, learning_rate=0.01): """ Momentum SGD optimization core. """ free_parameters = [] updates = [] for param, grad in zip(params, gradients): delta = learning_rate * grad velocity = theano.shared(np.zeros_like(param.get_value...
def function[momentum_core, parameter[params, gradients, momentum, learning_rate]]: constant[ Momentum SGD optimization core. ] variable[free_parameters] assign[=] list[[]] variable[updates] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da1b05c7910>, <ast.Name object...
keyword[def] identifier[momentum_core] ( identifier[params] , identifier[gradients] , identifier[momentum] = literal[int] , identifier[learning_rate] = literal[int] ): literal[string] identifier[free_parameters] =[] identifier[updates] =[] keyword[for] identifier[param] , identifier[grad] keywo...
def momentum_core(params, gradients, momentum=0.9, learning_rate=0.01): """ Momentum SGD optimization core. """ free_parameters = [] updates = [] for (param, grad) in zip(params, gradients): delta = learning_rate * grad velocity = theano.shared(np.zeros_like(param.get_value()), n...
def write_obs_summary_table(self,filename=None,group_names=None): """write a stand alone observation summary latex table Parameters ---------- filename : str latex filename. If None, use <case>.par.tex. Default is None group_n...
def function[write_obs_summary_table, parameter[self, filename, group_names]]: constant[write a stand alone observation summary latex table Parameters ---------- filename : str latex filename. If None, use <case>.par.tex. Default is None ...
keyword[def] identifier[write_obs_summary_table] ( identifier[self] , identifier[filename] = keyword[None] , identifier[group_names] = keyword[None] ): literal[string] identifier[ffmt] = keyword[lambda] identifier[x] : literal[string] . identifier[format] ( identifier[x] ) identifier[obs...
def write_obs_summary_table(self, filename=None, group_names=None): """write a stand alone observation summary latex table Parameters ---------- filename : str latex filename. If None, use <case>.par.tex. Default is None group_nam...
def max_event_offset(event_list): """Find the offset (end-time) of last event Parameters ---------- event_list : list or dcase_util.containers.MetaDataContainer A list containing event dicts Returns ------- float > 0 maximum offset """ if isinstance(event_list, dc...
def function[max_event_offset, parameter[event_list]]: constant[Find the offset (end-time) of last event Parameters ---------- event_list : list or dcase_util.containers.MetaDataContainer A list containing event dicts Returns ------- float > 0 maximum offset ] ...
keyword[def] identifier[max_event_offset] ( identifier[event_list] ): literal[string] keyword[if] identifier[isinstance] ( identifier[event_list] , identifier[dcase_util] . identifier[containers] . identifier[MetaDataContainer] ): keyword[return] identifier[event_list] . identifier[max_offset] ...
def max_event_offset(event_list): """Find the offset (end-time) of last event Parameters ---------- event_list : list or dcase_util.containers.MetaDataContainer A list containing event dicts Returns ------- float > 0 maximum offset """ if isinstance(event_list, dca...
def track_statistic(self, name, description='', max_rows=None): """ Create a Statistic object in the Tracker. """ if name in self._tables: raise TableConflictError(name) if max_rows is None: max_rows = AnonymousUsageTracker.MAX_ROWS_PER_TABLE self....
def function[track_statistic, parameter[self, name, description, max_rows]]: constant[ Create a Statistic object in the Tracker. ] if compare[name[name] in name[self]._tables] begin[:] <ast.Raise object at 0x7da1b09e9ae0> if compare[name[max_rows] is constant[None]] begin...
keyword[def] identifier[track_statistic] ( identifier[self] , identifier[name] , identifier[description] = literal[string] , identifier[max_rows] = keyword[None] ): literal[string] keyword[if] identifier[name] keyword[in] identifier[self] . identifier[_tables] : keyword[raise] iden...
def track_statistic(self, name, description='', max_rows=None): """ Create a Statistic object in the Tracker. """ if name in self._tables: raise TableConflictError(name) # depends on [control=['if'], data=['name']] if max_rows is None: max_rows = AnonymousUsageTracker.MAX_RO...
def masked_rec_array_to_mgr(data, index, columns, dtype, copy): """ Extract from a masked rec array and create the manager. """ # essentially process a record array then fill it fill_value = data.fill_value fdata = ma.getdata(data) if index is None: index = get_names_from_index(fdat...
def function[masked_rec_array_to_mgr, parameter[data, index, columns, dtype, copy]]: constant[ Extract from a masked rec array and create the manager. ] variable[fill_value] assign[=] name[data].fill_value variable[fdata] assign[=] call[name[ma].getdata, parameter[name[data]]] if...
keyword[def] identifier[masked_rec_array_to_mgr] ( identifier[data] , identifier[index] , identifier[columns] , identifier[dtype] , identifier[copy] ): literal[string] identifier[fill_value] = identifier[data] . identifier[fill_value] identifier[fdata] = identifier[ma] . identifier[getdata] ( i...
def masked_rec_array_to_mgr(data, index, columns, dtype, copy): """ Extract from a masked rec array and create the manager. """ # essentially process a record array then fill it fill_value = data.fill_value fdata = ma.getdata(data) if index is None: index = get_names_from_index(fdata...
def get_exe_prefixes(exe_filename): """Get exe->egg path translations for a given .exe file""" prefixes = [ ('PURELIB/', ''), ('PLATLIB/pywin32_system32', ''), ('PLATLIB/', ''), ('SCRIPTS/', 'EGG-INFO/scripts/'), ('DATA/lib/site-packages', ''), ] z = zipfile.ZipF...
def function[get_exe_prefixes, parameter[exe_filename]]: constant[Get exe->egg path translations for a given .exe file] variable[prefixes] assign[=] list[[<ast.Tuple object at 0x7da1b1a07d90>, <ast.Tuple object at 0x7da1b1a07d00>, <ast.Tuple object at 0x7da1b1a07c70>, <ast.Tuple object at 0x7da1b1a07be0...
keyword[def] identifier[get_exe_prefixes] ( identifier[exe_filename] ): literal[string] identifier[prefixes] =[ ( literal[string] , literal[string] ), ( literal[string] , literal[string] ), ( literal[string] , literal[string] ), ( literal[string] , literal[string] ), ( literal[string] ...
def get_exe_prefixes(exe_filename): """Get exe->egg path translations for a given .exe file""" prefixes = [('PURELIB/', ''), ('PLATLIB/pywin32_system32', ''), ('PLATLIB/', ''), ('SCRIPTS/', 'EGG-INFO/scripts/'), ('DATA/lib/site-packages', '')] z = zipfile.ZipFile(exe_filename) try: for info in z...
def list(self, svc_rec=None, hostfilter=None, compromised=False): """ List user accounts :param svc_rec: db.t_services.id :param hostfilter: :param compromised: Show only compromised accounts :return: [acct.t_accounts.f_services_id, acct.t_hosts.f_ipaddr, ...
def function[list, parameter[self, svc_rec, hostfilter, compromised]]: constant[ List user accounts :param svc_rec: db.t_services.id :param hostfilter: :param compromised: Show only compromised accounts :return: [acct.t_accounts.f_services_id, acct.t_hosts.f_ipaddr, ...
keyword[def] identifier[list] ( identifier[self] , identifier[svc_rec] = keyword[None] , identifier[hostfilter] = keyword[None] , identifier[compromised] = keyword[False] ): literal[string] keyword[return] identifier[self] . identifier[send] . identifier[accounts_list] ( identifier[svc_rec] , iden...
def list(self, svc_rec=None, hostfilter=None, compromised=False): """ List user accounts :param svc_rec: db.t_services.id :param hostfilter: :param compromised: Show only compromised accounts :return: [acct.t_accounts.f_services_id, acct.t_hosts.f_ipaddr, ...
def handle_input(self, code): """Compile Coconut interpreter input.""" if not self.prompt.multiline: if not should_indent(code): try: return self.comp.parse_block(code) except CoconutException: pass while Tru...
def function[handle_input, parameter[self, code]]: constant[Compile Coconut interpreter input.] if <ast.UnaryOp object at 0x7da20c7cae00> begin[:] if <ast.UnaryOp object at 0x7da20c7cbaf0> begin[:] <ast.Try object at 0x7da20c7ca590> while constant[True] begin[...
keyword[def] identifier[handle_input] ( identifier[self] , identifier[code] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[prompt] . identifier[multiline] : keyword[if] keyword[not] identifier[should_indent] ( identifier[code] ): keyword[...
def handle_input(self, code): """Compile Coconut interpreter input.""" if not self.prompt.multiline: if not should_indent(code): try: return self.comp.parse_block(code) # depends on [control=['try'], data=[]] except CoconutException: pass # depen...
def copy_opts_for_single_ifo(opt, ifo): """ Takes the namespace object (opt) from the multi-detector interface and returns a namespace object for a single ifo that can be used with functions expecting output from the single-detector interface. """ opt = copy.deepcopy(opt) for arg, val in var...
def function[copy_opts_for_single_ifo, parameter[opt, ifo]]: constant[ Takes the namespace object (opt) from the multi-detector interface and returns a namespace object for a single ifo that can be used with functions expecting output from the single-detector interface. ] variable[opt] a...
keyword[def] identifier[copy_opts_for_single_ifo] ( identifier[opt] , identifier[ifo] ): literal[string] identifier[opt] = identifier[copy] . identifier[deepcopy] ( identifier[opt] ) keyword[for] identifier[arg] , identifier[val] keyword[in] identifier[vars] ( identifier[opt] ). identifier[items] (...
def copy_opts_for_single_ifo(opt, ifo): """ Takes the namespace object (opt) from the multi-detector interface and returns a namespace object for a single ifo that can be used with functions expecting output from the single-detector interface. """ opt = copy.deepcopy(opt) for (arg, val) in v...
def leave_scope(self): """ Ends a function body and pops current scope out of the symbol table. """ def entry_size(entry): """ For local variables and params, returns the real variable or local array size in bytes """ if entry.scope == SCOPE.global...
def function[leave_scope, parameter[self]]: constant[ Ends a function body and pops current scope out of the symbol table. ] def function[entry_size, parameter[entry]]: constant[ For local variables and params, returns the real variable or local array size in bytes ...
keyword[def] identifier[leave_scope] ( identifier[self] ): literal[string] keyword[def] identifier[entry_size] ( identifier[entry] ): literal[string] keyword[if] identifier[entry] . identifier[scope] == identifier[SCOPE] . identifier[global_] keyword[or] identifier[en...
def leave_scope(self): """ Ends a function body and pops current scope out of the symbol table. """ def entry_size(entry): """ For local variables and params, returns the real variable or local array size in bytes """ if entry.scope == SCOPE.global_ or entry.is_a...
def load_data(self, key=None, **kwargs): """ Lee de disco la información y la devuelve :param key: """ self.store.open() if key: return pd.read_hdf(self.PATH_DATABASE, key, **kwargs) else: data_load = dict() for k in self.store.keys(): ...
def function[load_data, parameter[self, key]]: constant[ Lee de disco la información y la devuelve :param key: ] call[name[self].store.open, parameter[]] if name[key] begin[:] return[call[name[pd].read_hdf, parameter[name[self].PATH_DATABASE, name[key]]]] call[nam...
keyword[def] identifier[load_data] ( identifier[self] , identifier[key] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[store] . identifier[open] () keyword[if] identifier[key] : keyword[return] identifier[pd] . identifier[read_hdf] ( ...
def load_data(self, key=None, **kwargs): """ Lee de disco la información y la devuelve :param key: """ self.store.open() if key: return pd.read_hdf(self.PATH_DATABASE, key, **kwargs) # depends on [control=['if'], data=[]] else: data_load = dict() for k in self.st...
def _get_data_raw(self, time, site_id, pressure=None): r"""Download data from the Iowa State's upper air archive. Parameters ---------- time : datetime Date and time for which data should be downloaded site_id : str Site id for which data should be downlo...
def function[_get_data_raw, parameter[self, time, site_id, pressure]]: constant[Download data from the Iowa State's upper air archive. Parameters ---------- time : datetime Date and time for which data should be downloaded site_id : str Site id for which ...
keyword[def] identifier[_get_data_raw] ( identifier[self] , identifier[time] , identifier[site_id] , identifier[pressure] = keyword[None] ): literal[string] identifier[query] ={ literal[string] : identifier[time] . identifier[strftime] ( literal[string] )} keyword[if] identifier[site_id] ...
def _get_data_raw(self, time, site_id, pressure=None): """Download data from the Iowa State's upper air archive. Parameters ---------- time : datetime Date and time for which data should be downloaded site_id : str Site id for which data should be downloaded ...
def curve_fit(self): """ Fits `scipy_data_fitting.Fit.function` to the data and returns the output from the specified curve fit function. See `scipy_data_fitting.Fit.options` for details on how to control or override the the curve fitting algorithm. """ if not ha...
def function[curve_fit, parameter[self]]: constant[ Fits `scipy_data_fitting.Fit.function` to the data and returns the output from the specified curve fit function. See `scipy_data_fitting.Fit.options` for details on how to control or override the the curve fitting algorithm. ...
keyword[def] identifier[curve_fit] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[self] , literal[string] ): identifier[options] = identifier[self] . identifier[options] . identifier[copy] () identifier[fit_function] = ide...
def curve_fit(self): """ Fits `scipy_data_fitting.Fit.function` to the data and returns the output from the specified curve fit function. See `scipy_data_fitting.Fit.options` for details on how to control or override the the curve fitting algorithm. """ if not hasattr(se...
def get_niggli_reduced_lattice(self, tol: float = 1e-5) -> "Lattice": """ Get the Niggli reduced lattice using the numerically stable algo proposed by R. W. Grosse-Kunstleve, N. K. Sauter, & P. D. Adams, Acta Crystallographica Section A Foundations of Crystallography, 2003, 60(1)...
def function[get_niggli_reduced_lattice, parameter[self, tol]]: constant[ Get the Niggli reduced lattice using the numerically stable algo proposed by R. W. Grosse-Kunstleve, N. K. Sauter, & P. D. Adams, Acta Crystallographica Section A Foundations of Crystallography, 2003, 60(1)...
keyword[def] identifier[get_niggli_reduced_lattice] ( identifier[self] , identifier[tol] : identifier[float] = literal[int] )-> literal[string] : literal[string] identifier[matrix] = identifier[self] . identifier[lll_matrix] identifier[a] = identifier[matrix] [ literal[int] ] ...
def get_niggli_reduced_lattice(self, tol: float=1e-05) -> 'Lattice': """ Get the Niggli reduced lattice using the numerically stable algo proposed by R. W. Grosse-Kunstleve, N. K. Sauter, & P. D. Adams, Acta Crystallographica Section A Foundations of Crystallography, 2003, 60(1), 1-6...
def print_dict(d, show_missing=True): """Prints a shallow dict to console. Args: d: Dict to print. show_missing: Whether to show keys with empty values. """ for k, v in sorted(d.items()): if (not v) and show_missing: # No instances of the key, so print missing symbol. print('{} -'.forma...
def function[print_dict, parameter[d, show_missing]]: constant[Prints a shallow dict to console. Args: d: Dict to print. show_missing: Whether to show keys with empty values. ] for taget[tuple[[<ast.Name object at 0x7da2041dbc40>, <ast.Name object at 0x7da2041db2e0>]]] in starred[call[name[...
keyword[def] identifier[print_dict] ( identifier[d] , identifier[show_missing] = keyword[True] ): literal[string] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[sorted] ( identifier[d] . identifier[items] ()): keyword[if] ( keyword[not] identifier[v] ) keyword[and] identifier[show_...
def print_dict(d, show_missing=True): """Prints a shallow dict to console. Args: d: Dict to print. show_missing: Whether to show keys with empty values. """ for (k, v) in sorted(d.items()): if not v and show_missing: # No instances of the key, so print missing symbol. ...
def to_bool(value): # type: (Any) -> bool """ Convert a value into a bool but handle "truthy" strings eg, yes, true, ok, y """ if isinstance(value, _compat.string_types): return value.upper() in ('Y', 'YES', 'T', 'TRUE', '1', 'OK') return bool(value)
def function[to_bool, parameter[value]]: constant[ Convert a value into a bool but handle "truthy" strings eg, yes, true, ok, y ] if call[name[isinstance], parameter[name[value], name[_compat].string_types]] begin[:] return[compare[call[name[value].upper, parameter[]] in tuple[[<ast.Cons...
keyword[def] identifier[to_bool] ( identifier[value] ): literal[string] keyword[if] identifier[isinstance] ( identifier[value] , identifier[_compat] . identifier[string_types] ): keyword[return] identifier[value] . identifier[upper] () keyword[in] ( literal[string] , literal[string] , literal[s...
def to_bool(value): # type: (Any) -> bool '\n Convert a value into a bool but handle "truthy" strings eg, yes, true, ok, y\n ' if isinstance(value, _compat.string_types): return value.upper() in ('Y', 'YES', 'T', 'TRUE', '1', 'OK') # depends on [control=['if'], data=[]] return bool(value)
def mysql_aes_encrypt(val, key): """Mysql AES encrypt value with secret key. :param val: Plain text value. :param key: The AES key. :returns: The encrypted AES value. """ assert isinstance(val, binary_type) or isinstance(val, text_type) assert isinstance(key, binary_type) or isinstance(key,...
def function[mysql_aes_encrypt, parameter[val, key]]: constant[Mysql AES encrypt value with secret key. :param val: Plain text value. :param key: The AES key. :returns: The encrypted AES value. ] assert[<ast.BoolOp object at 0x7da2044c29b0>] assert[<ast.BoolOp object at 0x7da2044c3790>]...
keyword[def] identifier[mysql_aes_encrypt] ( identifier[val] , identifier[key] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[val] , identifier[binary_type] ) keyword[or] identifier[isinstance] ( identifier[val] , identifier[text_type] ) keyword[assert] identifier[isinstance...
def mysql_aes_encrypt(val, key): """Mysql AES encrypt value with secret key. :param val: Plain text value. :param key: The AES key. :returns: The encrypted AES value. """ assert isinstance(val, binary_type) or isinstance(val, text_type) assert isinstance(key, binary_type) or isinstance(key,...
def verify_any(df, check, *args, **kwargs): """ Verify that any of the entries in ``check(df, *args, **kwargs)`` is true """ result = check(df, *args, **kwargs) try: assert np.any(result) except AssertionError as e: msg = '{} not true for any'.format(check.__name__) e...
def function[verify_any, parameter[df, check]]: constant[ Verify that any of the entries in ``check(df, *args, **kwargs)`` is true ] variable[result] assign[=] call[name[check], parameter[name[df], <ast.Starred object at 0x7da1b077a140>]] <ast.Try object at 0x7da1b077b100> return[nam...
keyword[def] identifier[verify_any] ( identifier[df] , identifier[check] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[result] = identifier[check] ( identifier[df] ,* identifier[args] ,** identifier[kwargs] ) keyword[try] : keyword[assert] identifier[np] . identifi...
def verify_any(df, check, *args, **kwargs): """ Verify that any of the entries in ``check(df, *args, **kwargs)`` is true """ result = check(df, *args, **kwargs) try: assert np.any(result) # depends on [control=['try'], data=[]] except AssertionError as e: msg = '{} not true ...
def ToJson(self): """ Convert object members to a dictionary that can be parsed as JSON. Returns: dict: """ jsn = super(MinerTransaction, self).ToJson() jsn['nonce'] = self.Nonce return jsn
def function[ToJson, parameter[self]]: constant[ Convert object members to a dictionary that can be parsed as JSON. Returns: dict: ] variable[jsn] assign[=] call[call[name[super], parameter[name[MinerTransaction], name[self]]].ToJson, parameter[]] call[name[...
keyword[def] identifier[ToJson] ( identifier[self] ): literal[string] identifier[jsn] = identifier[super] ( identifier[MinerTransaction] , identifier[self] ). identifier[ToJson] () identifier[jsn] [ literal[string] ]= identifier[self] . identifier[Nonce] keyword[return] identifi...
def ToJson(self): """ Convert object members to a dictionary that can be parsed as JSON. Returns: dict: """ jsn = super(MinerTransaction, self).ToJson() jsn['nonce'] = self.Nonce return jsn
def create_processors_from_settings(self): """ Expects the Django setting "EVENT_TRACKING_PROCESSORS" to be defined and point to a list of backend engine configurations. Example:: EVENT_TRACKING_PROCESSORS = [ { 'ENGINE': 'some.arbitrary....
def function[create_processors_from_settings, parameter[self]]: constant[ Expects the Django setting "EVENT_TRACKING_PROCESSORS" to be defined and point to a list of backend engine configurations. Example:: EVENT_TRACKING_PROCESSORS = [ { ...
keyword[def] identifier[create_processors_from_settings] ( identifier[self] ): literal[string] identifier[config] = identifier[getattr] ( identifier[settings] , identifier[DJANGO_PROCESSOR_SETTING_NAME] ,[]) identifier[processors] = identifier[self] . identifier[instantiate_objects] ( ide...
def create_processors_from_settings(self): """ Expects the Django setting "EVENT_TRACKING_PROCESSORS" to be defined and point to a list of backend engine configurations. Example:: EVENT_TRACKING_PROCESSORS = [ { 'ENGINE': 'some.arbitrary.Proc...
def execute_async_script(self, script, *args): """Execute JavaScript Asynchronously in current context. Support: Web(WebView) Args: script: The JavaScript to execute. *args: Arguments for your JavaScript. Returns: Returns the return valu...
def function[execute_async_script, parameter[self, script]]: constant[Execute JavaScript Asynchronously in current context. Support: Web(WebView) Args: script: The JavaScript to execute. *args: Arguments for your JavaScript. Returns: Ret...
keyword[def] identifier[execute_async_script] ( identifier[self] , identifier[script] ,* identifier[args] ): literal[string] keyword[return] identifier[self] . identifier[_execute] ( identifier[Command] . identifier[EXECUTE_ASYNC_SCRIPT] ,{ literal[string] : identifier[script] , ...
def execute_async_script(self, script, *args): """Execute JavaScript Asynchronously in current context. Support: Web(WebView) Args: script: The JavaScript to execute. *args: Arguments for your JavaScript. Returns: Returns the return value of...
def readImages(path, sc=None, minParitions = 1, bigdl_type="float"): """ Read the directory of images into DataFrame from the local or remote source. :param path Directory to the input data files, the path can be comma separated paths as the list of inputs. Wildcards path are sup...
def function[readImages, parameter[path, sc, minParitions, bigdl_type]]: constant[ Read the directory of images into DataFrame from the local or remote source. :param path Directory to the input data files, the path can be comma separated paths as the list of inputs. Wildcards pa...
keyword[def] identifier[readImages] ( identifier[path] , identifier[sc] = keyword[None] , identifier[minParitions] = literal[int] , identifier[bigdl_type] = literal[string] ): literal[string] identifier[df] = identifier[callBigDlFunc] ( identifier[bigdl_type] , literal[string] , identifier[path] , ...
def readImages(path, sc=None, minParitions=1, bigdl_type='float'): """ Read the directory of images into DataFrame from the local or remote source. :param path Directory to the input data files, the path can be comma separated paths as the list of inputs. Wildcards path are supported...
def available(self): """ True if any of the supported modules from ``packages`` is available for use. :return: True if any modules from ``packages`` exist :rtype: bool """ for module_name in self.packages: if importlib.util.find_spec(module_name): re...
def function[available, parameter[self]]: constant[ True if any of the supported modules from ``packages`` is available for use. :return: True if any modules from ``packages`` exist :rtype: bool ] for taget[name[module_name]] in starred[name[self].packages] begin[:] ...
keyword[def] identifier[available] ( identifier[self] ): literal[string] keyword[for] identifier[module_name] keyword[in] identifier[self] . identifier[packages] : keyword[if] identifier[importlib] . identifier[util] . identifier[find_spec] ( identifier[module_name] ): ...
def available(self): """ True if any of the supported modules from ``packages`` is available for use. :return: True if any modules from ``packages`` exist :rtype: bool """ for module_name in self.packages: if importlib.util.find_spec(module_name): return True # depe...
def update_jsonb(uid, extinfo): ''' Update the json. ''' cur_extinfo = MPost.get_by_uid(uid).extinfo for key in extinfo: cur_extinfo[key] = extinfo[key] entry = TabPost.update( extinfo=cur_extinfo, ).where(TabPost.uid == uid) entry....
def function[update_jsonb, parameter[uid, extinfo]]: constant[ Update the json. ] variable[cur_extinfo] assign[=] call[name[MPost].get_by_uid, parameter[name[uid]]].extinfo for taget[name[key]] in starred[name[extinfo]] begin[:] call[name[cur_extinfo]][name[key]] ...
keyword[def] identifier[update_jsonb] ( identifier[uid] , identifier[extinfo] ): literal[string] identifier[cur_extinfo] = identifier[MPost] . identifier[get_by_uid] ( identifier[uid] ). identifier[extinfo] keyword[for] identifier[key] keyword[in] identifier[extinfo] : ide...
def update_jsonb(uid, extinfo): """ Update the json. """ cur_extinfo = MPost.get_by_uid(uid).extinfo for key in extinfo: cur_extinfo[key] = extinfo[key] # depends on [control=['for'], data=['key']] entry = TabPost.update(extinfo=cur_extinfo).where(TabPost.uid == uid) entry.e...
def setValue( self, value ): """ Moves the line to the given value and rebuilds it :param value | <variant> """ scene = self.scene() point = scene.mapFromChart(value, None) self.setPos(point.x(), self.pos().y()) self.rebuil...
def function[setValue, parameter[self, value]]: constant[ Moves the line to the given value and rebuilds it :param value | <variant> ] variable[scene] assign[=] call[name[self].scene, parameter[]] variable[point] assign[=] call[name[scene].mapFromChart, para...
keyword[def] identifier[setValue] ( identifier[self] , identifier[value] ): literal[string] identifier[scene] = identifier[self] . identifier[scene] () identifier[point] = identifier[scene] . identifier[mapFromChart] ( identifier[value] , keyword[None] ) identifier[self] . i...
def setValue(self, value): """ Moves the line to the given value and rebuilds it :param value | <variant> """ scene = self.scene() point = scene.mapFromChart(value, None) self.setPos(point.x(), self.pos().y()) self.rebuild(scene.gridRect())
def meta_request(func): """ Handles parsing response structure and translating API Exceptions """ def inner(self, resource, *args, **kwargs): serialize_response = kwargs.pop('serialize', True) try: resp = func(self, resource, *args, **kwargs) except ApiException as e: ...
def function[meta_request, parameter[func]]: constant[ Handles parsing response structure and translating API Exceptions ] def function[inner, parameter[self, resource]]: variable[serialize_response] assign[=] call[name[kwargs].pop, parameter[constant[serialize], constant[True]]] ...
keyword[def] identifier[meta_request] ( identifier[func] ): literal[string] keyword[def] identifier[inner] ( identifier[self] , identifier[resource] ,* identifier[args] ,** identifier[kwargs] ): identifier[serialize_response] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[True...
def meta_request(func): """ Handles parsing response structure and translating API Exceptions """ def inner(self, resource, *args, **kwargs): serialize_response = kwargs.pop('serialize', True) try: resp = func(self, resource, *args, **kwargs) # depends on [control=['try'], data=[]]...
def password(self, password): """ Sets the password of this WebCredentials. The secret password. This field is write-only. It is omitted by read operations. If authorization is required, the `password` value must be provided whenever a File Source is created or modified. An update to a dataset...
def function[password, parameter[self, password]]: constant[ Sets the password of this WebCredentials. The secret password. This field is write-only. It is omitted by read operations. If authorization is required, the `password` value must be provided whenever a File Source is created or modif...
keyword[def] identifier[password] ( identifier[self] , identifier[password] ): literal[string] keyword[if] identifier[password] keyword[is] keyword[not] keyword[None] keyword[and] identifier[len] ( identifier[password] )> literal[int] : keyword[raise] identifier[ValueError] ( li...
def password(self, password): """ Sets the password of this WebCredentials. The secret password. This field is write-only. It is omitted by read operations. If authorization is required, the `password` value must be provided whenever a File Source is created or modified. An update to a dataset tha...
def allows(self, user, permission, obj=_nothing): """Checks that a user has permission. Returns True or False. :param user: a user. :param permission: permission to check. :param obj: (optional) an object to check permission for. """ rule = self._get_rule(obj) i...
def function[allows, parameter[self, user, permission, obj]]: constant[Checks that a user has permission. Returns True or False. :param user: a user. :param permission: permission to check. :param obj: (optional) an object to check permission for. ] variable[rule] assign...
keyword[def] identifier[allows] ( identifier[self] , identifier[user] , identifier[permission] , identifier[obj] = identifier[_nothing] ): literal[string] identifier[rule] = identifier[self] . identifier[_get_rule] ( identifier[obj] ) keyword[if] keyword[not] identifier[isinstance] ( id...
def allows(self, user, permission, obj=_nothing): """Checks that a user has permission. Returns True or False. :param user: a user. :param permission: permission to check. :param obj: (optional) an object to check permission for. """ rule = self._get_rule(obj) if not isinsta...
def _container_candidates(self): """Generate container candidate list Returns: tuple list: [(width1, height1), (width2, height2), ...] """ if not self._rectangles: return [] if self._rotation: sides = sorted(side for rect in self._r...
def function[_container_candidates, parameter[self]]: constant[Generate container candidate list Returns: tuple list: [(width1, height1), (width2, height2), ...] ] if <ast.UnaryOp object at 0x7da18ede7a90> begin[:] return[list[[]]] if name[self]._ro...
keyword[def] identifier[_container_candidates] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_rectangles] : keyword[return] [] keyword[if] identifier[self] . identifier[_rotation] : identifier[sides] = identifier[...
def _container_candidates(self): """Generate container candidate list Returns: tuple list: [(width1, height1), (width2, height2), ...] """ if not self._rectangles: return [] # depends on [control=['if'], data=[]] if self._rotation: sides = sorted((side...
def abort(err): """Abort everything, everywhere.""" if _debug: abort._debug("abort %r", err) global local_controllers # tell all the local controllers to abort for controller in local_controllers.values(): controller.abort(err)
def function[abort, parameter[err]]: constant[Abort everything, everywhere.] if name[_debug] begin[:] call[name[abort]._debug, parameter[constant[abort %r], name[err]]] <ast.Global object at 0x7da20e9b27d0> for taget[name[controller]] in starred[call[name[local_controllers].v...
keyword[def] identifier[abort] ( identifier[err] ): literal[string] keyword[if] identifier[_debug] : identifier[abort] . identifier[_debug] ( literal[string] , identifier[err] ) keyword[global] identifier[local_controllers] keyword[for] identifier[controller] keyword[in] identifier[lo...
def abort(err): """Abort everything, everywhere.""" if _debug: abort._debug('abort %r', err) # depends on [control=['if'], data=[]] global local_controllers # tell all the local controllers to abort for controller in local_controllers.values(): controller.abort(err) # depends on [c...
def change_password(self, user, password): """ Changes user password """ if not self.__contains__(user): raise UserNotExists self.new_users[user] = self._encrypt_password(password) + "\n"
def function[change_password, parameter[self, user, password]]: constant[ Changes user password ] if <ast.UnaryOp object at 0x7da20c6ab850> begin[:] <ast.Raise object at 0x7da20c6a9960> call[name[self].new_users][name[user]] assign[=] binary_operation[call[name[self]._encrypt_password, p...
keyword[def] identifier[change_password] ( identifier[self] , identifier[user] , identifier[password] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[__contains__] ( identifier[user] ): keyword[raise] identifier[UserNotExists] identifier[self] . i...
def change_password(self, user, password): """ Changes user password """ if not self.__contains__(user): raise UserNotExists # depends on [control=['if'], data=[]] self.new_users[user] = self._encrypt_password(password) + '\n'
def vert_dpi(self): """ Integer dots per inch for the height of this image. Defaults to 72 when not present in the file, as is often the case. """ pHYs = self._chunks.pHYs if pHYs is None: return 72 return self._dpi(pHYs.units_specifier, pHYs.vert_px_p...
def function[vert_dpi, parameter[self]]: constant[ Integer dots per inch for the height of this image. Defaults to 72 when not present in the file, as is often the case. ] variable[pHYs] assign[=] name[self]._chunks.pHYs if compare[name[pHYs] is constant[None]] begin[:] ...
keyword[def] identifier[vert_dpi] ( identifier[self] ): literal[string] identifier[pHYs] = identifier[self] . identifier[_chunks] . identifier[pHYs] keyword[if] identifier[pHYs] keyword[is] keyword[None] : keyword[return] literal[int] keyword[return] identifier...
def vert_dpi(self): """ Integer dots per inch for the height of this image. Defaults to 72 when not present in the file, as is often the case. """ pHYs = self._chunks.pHYs if pHYs is None: return 72 # depends on [control=['if'], data=[]] return self._dpi(pHYs.units_speci...
def short(cls, path): """ Example: short("examined /Users/joe/foo") => "examined ~/foo" Args: path: Path to represent in its short form Returns: (str): Short form, using '~' if applicable """ if not path: return path ...
def function[short, parameter[cls, path]]: constant[ Example: short("examined /Users/joe/foo") => "examined ~/foo" Args: path: Path to represent in its short form Returns: (str): Short form, using '~' if applicable ] if <ast.UnaryOp o...
keyword[def] identifier[short] ( identifier[cls] , identifier[path] ): literal[string] keyword[if] keyword[not] identifier[path] : keyword[return] identifier[path] identifier[path] = identifier[str] ( identifier[path] ) keyword[if] identifier[cls] . identifier[p...
def short(cls, path): """ Example: short("examined /Users/joe/foo") => "examined ~/foo" Args: path: Path to represent in its short form Returns: (str): Short form, using '~' if applicable """ if not path: return path # depends on [co...
def sort_snps(snps): """ Sort SNPs based on ordered chromosome list and position. """ sorted_list = sorted(snps["chrom"].unique(), key=_natural_sort_key) # move PAR and MT to the end of the dataframe if "PAR" in sorted_list: sorted_list.remove("PAR") sorted_list.append("PAR") if "...
def function[sort_snps, parameter[snps]]: constant[ Sort SNPs based on ordered chromosome list and position. ] variable[sorted_list] assign[=] call[name[sorted], parameter[call[call[name[snps]][constant[chrom]].unique, parameter[]]]] if compare[constant[PAR] in name[sorted_list]] begin[:] ...
keyword[def] identifier[sort_snps] ( identifier[snps] ): literal[string] identifier[sorted_list] = identifier[sorted] ( identifier[snps] [ literal[string] ]. identifier[unique] (), identifier[key] = identifier[_natural_sort_key] ) keyword[if] literal[string] keyword[in] identifier[sorted_lis...
def sort_snps(snps): """ Sort SNPs based on ordered chromosome list and position. """ sorted_list = sorted(snps['chrom'].unique(), key=_natural_sort_key) # move PAR and MT to the end of the dataframe if 'PAR' in sorted_list: sorted_list.remove('PAR') sorted_list.append('PAR') # depends ...
def __gridconnections(self): """Level-2 parser for gridconnections. pattern: object 2 class gridconnections counts 97 93 99 """ try: tok = self.__consume() except DXParserNoTokens: return if tok.equals('counts'): shape = [] ...
def function[__gridconnections, parameter[self]]: constant[Level-2 parser for gridconnections. pattern: object 2 class gridconnections counts 97 93 99 ] <ast.Try object at 0x7da1aff01660> if call[name[tok].equals, parameter[constant[counts]]] begin[:] variabl...
keyword[def] identifier[__gridconnections] ( identifier[self] ): literal[string] keyword[try] : identifier[tok] = identifier[self] . identifier[__consume] () keyword[except] identifier[DXParserNoTokens] : keyword[return] keyword[if] identifier[tok] . ...
def __gridconnections(self): """Level-2 parser for gridconnections. pattern: object 2 class gridconnections counts 97 93 99 """ try: tok = self.__consume() # depends on [control=['try'], data=[]] except DXParserNoTokens: return # depends on [control=['except'], dat...
def stable_u_range_dict(self, chempot_range, ref_delu, no_doped=True, no_clean=False, delu_dict={}, miller_index=(), dmu_at_0=False, return_se_dict=False): """ Creates a dictionary where each entry is a key pointing to a chemical potential ...
def function[stable_u_range_dict, parameter[self, chempot_range, ref_delu, no_doped, no_clean, delu_dict, miller_index, dmu_at_0, return_se_dict]]: constant[ Creates a dictionary where each entry is a key pointing to a chemical potential range where the surface of that entry is stable. D...
keyword[def] identifier[stable_u_range_dict] ( identifier[self] , identifier[chempot_range] , identifier[ref_delu] , identifier[no_doped] = keyword[True] , identifier[no_clean] = keyword[False] , identifier[delu_dict] ={}, identifier[miller_index] =(), identifier[dmu_at_0] = keyword[False] , identifier[return_se_di...
def stable_u_range_dict(self, chempot_range, ref_delu, no_doped=True, no_clean=False, delu_dict={}, miller_index=(), dmu_at_0=False, return_se_dict=False): """ Creates a dictionary where each entry is a key pointing to a chemical potential range where the surface of that entry is stable. Doe...
def main(): '''Main in a function in case you place a build.py for pydocs inside the root directory.''' options = ''' pydocs Usage: pydocs SOURCE OUTPUT_DIR pydocs SOURCE OUTPUT_DIR [--json] [--index NAME] [--ignore FILE,NAMES] pydocs --help Options...
def function[main, parameter[]]: constant[Main in a function in case you place a build.py for pydocs inside the root directory.] variable[options] assign[=] constant[ pydocs Usage: pydocs SOURCE OUTPUT_DIR pydocs SOURCE OUTPUT_DIR [--json] [--index NAME] [--ignor...
keyword[def] identifier[main] (): literal[string] identifier[options] = literal[string] identifier[args] = identifier[docopt] ( identifier[options] ) identifier[build] ( identifier[getcwd] (), identifier[args] [ literal[string] ], identifier[args] [ literal[string] ], identifier[json_...
def main(): """Main in a function in case you place a build.py for pydocs inside the root directory.""" options = '\n pydocs\n\n Usage:\n pydocs SOURCE OUTPUT_DIR\n pydocs SOURCE OUTPUT_DIR [--json] [--index NAME] [--ignore FILE,NAMES]\n pydocs --help\n\n Op...
async def stdout(self) -> AsyncGenerator[str, None]: """Asynchronous generator for lines from subprocess stdout.""" await self.wait_running() async for line in self._subprocess.stdout: # type: ignore yield line
<ast.AsyncFunctionDef object at 0x7da1b0a07070>
keyword[async] keyword[def] identifier[stdout] ( identifier[self] )-> identifier[AsyncGenerator] [ identifier[str] , keyword[None] ]: literal[string] keyword[await] identifier[self] . identifier[wait_running] () keyword[async] keyword[for] identifier[line] keyword[in] identifier[self...
async def stdout(self) -> AsyncGenerator[str, None]: """Asynchronous generator for lines from subprocess stdout.""" await self.wait_running() async for line in self._subprocess.stdout: # type: ignore yield line
def normalize_shape(shape): """ Normalize a shape tuple or array to a shape tuple. Parameters ---------- shape : tuple of int or ndarray The input to normalize. May optionally be an array. Returns ------- tuple of int Shape tuple. """ if isinstance(shape, tuple...
def function[normalize_shape, parameter[shape]]: constant[ Normalize a shape tuple or array to a shape tuple. Parameters ---------- shape : tuple of int or ndarray The input to normalize. May optionally be an array. Returns ------- tuple of int Shape tuple. ] ...
keyword[def] identifier[normalize_shape] ( identifier[shape] ): literal[string] keyword[if] identifier[isinstance] ( identifier[shape] , identifier[tuple] ): keyword[return] identifier[shape] keyword[assert] identifier[ia] . identifier[is_np_array] ( identifier[shape] ),( literal[str...
def normalize_shape(shape): """ Normalize a shape tuple or array to a shape tuple. Parameters ---------- shape : tuple of int or ndarray The input to normalize. May optionally be an array. Returns ------- tuple of int Shape tuple. """ if isinstance(shape, tuple...
def to_ufo_font_attributes(self, family_name): """Generate a list of UFOs with metadata loaded from .glyphs data. Modifies the list of UFOs in the UFOBuilder (self) in-place. """ font = self.font # "date" can be missing; Glyphs.app removes it on saving if it's empty: # https://github.com/goog...
def function[to_ufo_font_attributes, parameter[self, family_name]]: constant[Generate a list of UFOs with metadata loaded from .glyphs data. Modifies the list of UFOs in the UFOBuilder (self) in-place. ] variable[font] assign[=] name[self].font variable[date_created] assign[=] call[name...
keyword[def] identifier[to_ufo_font_attributes] ( identifier[self] , identifier[family_name] ): literal[string] identifier[font] = identifier[self] . identifier[font] identifier[date_created] = identifier[getattr] ( identifier[font] , literal[string] , keyword[None] ) keyword[if] id...
def to_ufo_font_attributes(self, family_name): """Generate a list of UFOs with metadata loaded from .glyphs data. Modifies the list of UFOs in the UFOBuilder (self) in-place. """ font = self.font # "date" can be missing; Glyphs.app removes it on saving if it's empty: # https://github.com/google...
def send_keysequence_window(self, window, keysequence, delay=12000): """ Send a keysequence to the specified window. This allows you to send keysequences by symbol name. Any combination of X11 KeySym names separated by '+' are valid. Single KeySym names are valid, too. ...
def function[send_keysequence_window, parameter[self, window, keysequence, delay]]: constant[ Send a keysequence to the specified window. This allows you to send keysequences by symbol name. Any combination of X11 KeySym names separated by '+' are valid. Single KeySym names are ...
keyword[def] identifier[send_keysequence_window] ( identifier[self] , identifier[window] , identifier[keysequence] , identifier[delay] = literal[int] ): literal[string] identifier[_libxdo] . identifier[xdo_send_keysequence_window] ( identifier[self] . identifier[_xdo] , identifier[window] ...
def send_keysequence_window(self, window, keysequence, delay=12000): """ Send a keysequence to the specified window. This allows you to send keysequences by symbol name. Any combination of X11 KeySym names separated by '+' are valid. Single KeySym names are valid, too. Exam...
def run(self): """ Initializes the stream. """ if not hasattr(self, 'queue'): raise RuntimeError("Audio queue is not intialized.") self.keep_listening = True self.stream.start() while self.keep_listening: try: chunk = self.queue.get(timeout=queue_timeout) underflowed = self.stream.write(chunk...
def function[run, parameter[self]]: constant[ Initializes the stream. ] if <ast.UnaryOp object at 0x7da1b2617c10> begin[:] <ast.Raise object at 0x7da1b2593a30> name[self].keep_listening assign[=] constant[True] call[name[self].stream.start, parameter[]] while name[self].k...
keyword[def] identifier[run] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[self] , literal[string] ): keyword[raise] identifier[RuntimeError] ( literal[string] ) identifier[self] . identifier[keep_listening] = keyword[True] identifier[self] . iden...
def run(self): """ Initializes the stream. """ if not hasattr(self, 'queue'): raise RuntimeError('Audio queue is not intialized.') # depends on [control=['if'], data=[]] self.keep_listening = True self.stream.start() while self.keep_listening: try: chunk = self.queue.get...
def _remove_wire_nets(block): """ Remove all wire nodes from the block. """ wire_src_dict = _ProducerList() wire_removal_set = set() # set of all wirevectors to be removed # one pass to build the map of value producers and # all of the nets and wires to be removed for net in block.logic: ...
def function[_remove_wire_nets, parameter[block]]: constant[ Remove all wire nodes from the block. ] variable[wire_src_dict] assign[=] call[name[_ProducerList], parameter[]] variable[wire_removal_set] assign[=] call[name[set], parameter[]] for taget[name[net]] in starred[name[block].logi...
keyword[def] identifier[_remove_wire_nets] ( identifier[block] ): literal[string] identifier[wire_src_dict] = identifier[_ProducerList] () identifier[wire_removal_set] = identifier[set] () keyword[for] identifier[net] keyword[in] identifier[block] . identifier[logic] : key...
def _remove_wire_nets(block): """ Remove all wire nodes from the block. """ wire_src_dict = _ProducerList() wire_removal_set = set() # set of all wirevectors to be removed # one pass to build the map of value producers and # all of the nets and wires to be removed for net in block.logic: ...
def get_available_FIELD_transitions(instance, field): """ List of transitions available in current model state with all conditions met """ curr_state = field.get_state(instance) transitions = field.transitions[instance.__class__] for name, transition in transitions.items(): meta = t...
def function[get_available_FIELD_transitions, parameter[instance, field]]: constant[ List of transitions available in current model state with all conditions met ] variable[curr_state] assign[=] call[name[field].get_state, parameter[name[instance]]] variable[transitions] assign[=] ca...
keyword[def] identifier[get_available_FIELD_transitions] ( identifier[instance] , identifier[field] ): literal[string] identifier[curr_state] = identifier[field] . identifier[get_state] ( identifier[instance] ) identifier[transitions] = identifier[field] . identifier[transitions] [ identifier[instance...
def get_available_FIELD_transitions(instance, field): """ List of transitions available in current model state with all conditions met """ curr_state = field.get_state(instance) transitions = field.transitions[instance.__class__] for (name, transition) in transitions.items(): meta = ...
def get_release_date(pdb_id): """Quick way to get the release date of a PDB ID using the table of results from the REST service Returns None if the release date is not available. Returns: str: Organism of a PDB ID """ pdb_id = pdb_id.upper() if pdb_id not in _property_table().index: ...
def function[get_release_date, parameter[pdb_id]]: constant[Quick way to get the release date of a PDB ID using the table of results from the REST service Returns None if the release date is not available. Returns: str: Organism of a PDB ID ] variable[pdb_id] assign[=] call[name[p...
keyword[def] identifier[get_release_date] ( identifier[pdb_id] ): literal[string] identifier[pdb_id] = identifier[pdb_id] . identifier[upper] () keyword[if] identifier[pdb_id] keyword[not] keyword[in] identifier[_property_table] (). identifier[index] : keyword[raise] identifier[ValueErr...
def get_release_date(pdb_id): """Quick way to get the release date of a PDB ID using the table of results from the REST service Returns None if the release date is not available. Returns: str: Organism of a PDB ID """ pdb_id = pdb_id.upper() if pdb_id not in _property_table().index: ...
def search_shell(self): """ Looks for a shell service """ with self._lock: if self._shell is not None: # A shell is already there return reference = self._context.get_service_reference(SERVICE_SHELL) if reference is not...
def function[search_shell, parameter[self]]: constant[ Looks for a shell service ] with name[self]._lock begin[:] if compare[name[self]._shell is_not constant[None]] begin[:] return[None] variable[reference] assign[=] call[name[self]._context.g...
keyword[def] identifier[search_shell] ( identifier[self] ): literal[string] keyword[with] identifier[self] . identifier[_lock] : keyword[if] identifier[self] . identifier[_shell] keyword[is] keyword[not] keyword[None] : keyword[return] ...
def search_shell(self): """ Looks for a shell service """ with self._lock: if self._shell is not None: # A shell is already there return # depends on [control=['if'], data=[]] reference = self._context.get_service_reference(SERVICE_SHELL) if refer...
def PrintMessage(self, message): """Convert protobuf message to text format. Args: message: The protocol buffers message. """ if (message.DESCRIPTOR.full_name == _ANY_FULL_TYPE_NAME and self.descriptor_pool and self._TryPrintAsAnyMessage(message)): return fields = message.ListFi...
def function[PrintMessage, parameter[self, message]]: constant[Convert protobuf message to text format. Args: message: The protocol buffers message. ] if <ast.BoolOp object at 0x7da1b20352d0> begin[:] return[None] variable[fields] assign[=] call[name[message].ListFields, p...
keyword[def] identifier[PrintMessage] ( identifier[self] , identifier[message] ): literal[string] keyword[if] ( identifier[message] . identifier[DESCRIPTOR] . identifier[full_name] == identifier[_ANY_FULL_TYPE_NAME] keyword[and] identifier[self] . identifier[descriptor_pool] keyword[and] identifie...
def PrintMessage(self, message): """Convert protobuf message to text format. Args: message: The protocol buffers message. """ if message.DESCRIPTOR.full_name == _ANY_FULL_TYPE_NAME and self.descriptor_pool and self._TryPrintAsAnyMessage(message): return # depends on [control=['if'], data...
def _abbreviate(self, rid): ''' Abbreviate a relationship or resource ID target for efficient storage in the DB. Works only with a prefix/suffix split of hierarchical HTTP-like IRIs, e.g. 'http://example.org/spam/eggs' becomes something like '{a23}eggs' and afterward there will b...
def function[_abbreviate, parameter[self, rid]]: constant[ Abbreviate a relationship or resource ID target for efficient storage in the DB. Works only with a prefix/suffix split of hierarchical HTTP-like IRIs, e.g. 'http://example.org/spam/eggs' becomes something like '{a23}eggs' ...
keyword[def] identifier[_abbreviate] ( identifier[self] , identifier[rid] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[rid] , identifier[str] ) keyword[or] keyword[not] identifier[iri] . identifier[matches_uri_syntax] ( identifier[rid] ): keyword[return] iden...
def _abbreviate(self, rid): """ Abbreviate a relationship or resource ID target for efficient storage in the DB. Works only with a prefix/suffix split of hierarchical HTTP-like IRIs, e.g. 'http://example.org/spam/eggs' becomes something like '{a23}eggs' and afterward there will be an...
def load_metagraph(model_path_prefix: Union[str, Path]) -> tf.train.Saver: """ Given the path to a model on disk (these will typically be found in directories such as exp/<exp_num>/model/model_best.*) creates a Saver object that can then be used to restore the graph inside a tf.Session. """ model_p...
def function[load_metagraph, parameter[model_path_prefix]]: constant[ Given the path to a model on disk (these will typically be found in directories such as exp/<exp_num>/model/model_best.*) creates a Saver object that can then be used to restore the graph inside a tf.Session. ] variable[mo...
keyword[def] identifier[load_metagraph] ( identifier[model_path_prefix] : identifier[Union] [ identifier[str] , identifier[Path] ])-> identifier[tf] . identifier[train] . identifier[Saver] : literal[string] identifier[model_path_prefix] = identifier[str] ( identifier[model_path_prefix] ) identifier[m...
def load_metagraph(model_path_prefix: Union[str, Path]) -> tf.train.Saver: """ Given the path to a model on disk (these will typically be found in directories such as exp/<exp_num>/model/model_best.*) creates a Saver object that can then be used to restore the graph inside a tf.Session. """ model_pa...
def GetArtifactCollectorArgs(flow_args, knowledge_base): """Prepare bundle of artifacts and their dependencies for the client. Args: flow_args: An `ArtifactCollectorFlowArgs` instance. knowledge_base: contains information about the client Returns: rdf value object containing a list of extended artif...
def function[GetArtifactCollectorArgs, parameter[flow_args, knowledge_base]]: constant[Prepare bundle of artifacts and their dependencies for the client. Args: flow_args: An `ArtifactCollectorFlowArgs` instance. knowledge_base: contains information about the client Returns: rdf value object co...
keyword[def] identifier[GetArtifactCollectorArgs] ( identifier[flow_args] , identifier[knowledge_base] ): literal[string] identifier[args] = identifier[rdf_artifacts] . identifier[ClientArtifactCollectorArgs] () identifier[args] . identifier[knowledge_base] = identifier[knowledge_base] identifier[args]...
def GetArtifactCollectorArgs(flow_args, knowledge_base): """Prepare bundle of artifacts and their dependencies for the client. Args: flow_args: An `ArtifactCollectorFlowArgs` instance. knowledge_base: contains information about the client Returns: rdf value object containing a list of extended art...
def sync(self, browser): """ Enables cookie synchronization with specified browser, returns result Returns bool - True if successful, false otherwise """ BrowserCookies.loadBrowsers() if not browser in BrowserCookies.browsers: return False ...
def function[sync, parameter[self, browser]]: constant[ Enables cookie synchronization with specified browser, returns result Returns bool - True if successful, false otherwise ] call[name[BrowserCookies].loadBrowsers, parameter[]] if <ast.UnaryOp object at...
keyword[def] identifier[sync] ( identifier[self] , identifier[browser] ): literal[string] identifier[BrowserCookies] . identifier[loadBrowsers] () keyword[if] keyword[not] identifier[browser] keyword[in] identifier[BrowserCookies] . identifier[browsers] : keyword[retur...
def sync(self, browser): """ Enables cookie synchronization with specified browser, returns result Returns bool - True if successful, false otherwise """ BrowserCookies.loadBrowsers() if not browser in BrowserCookies.browsers: return False # depends on [contro...
def _cond_bb(self, word, suffix_len): """Return Lovins' condition BB. Parameters ---------- word : str Word to check suffix_len : int Suffix length Returns ------- bool True if condition is met """ ret...
def function[_cond_bb, parameter[self, word, suffix_len]]: constant[Return Lovins' condition BB. Parameters ---------- word : str Word to check suffix_len : int Suffix length Returns ------- bool True if condition is m...
keyword[def] identifier[_cond_bb] ( identifier[self] , identifier[word] , identifier[suffix_len] ): literal[string] keyword[return] ( identifier[len] ( identifier[word] )- identifier[suffix_len] >= literal[int] keyword[and] identifier[word] [- identifier[suffix_len] - literal[in...
def _cond_bb(self, word, suffix_len): """Return Lovins' condition BB. Parameters ---------- word : str Word to check suffix_len : int Suffix length Returns ------- bool True if condition is met """ return len(...
def _pastore32(ins): ''' Stores 2º operand content into address of 1st operand. store16 a, x => *(&a) = x ''' output = _paddr(ins.quad[1]) value = ins.quad[2] if value[0] == '*': value = value[1:] indirect = True else: indirect = False try: value = int(...
def function[_pastore32, parameter[ins]]: constant[ Stores 2º operand content into address of 1st operand. store16 a, x => *(&a) = x ] variable[output] assign[=] call[name[_paddr], parameter[call[name[ins].quad][constant[1]]]] variable[value] assign[=] call[name[ins].quad][constant[2]] ...
keyword[def] identifier[_pastore32] ( identifier[ins] ): literal[string] identifier[output] = identifier[_paddr] ( identifier[ins] . identifier[quad] [ literal[int] ]) identifier[value] = identifier[ins] . identifier[quad] [ literal[int] ] keyword[if] identifier[value] [ literal[int] ]== litera...
def _pastore32(ins): """ Stores 2º operand content into address of 1st operand. store16 a, x => *(&a) = x """ output = _paddr(ins.quad[1]) value = ins.quad[2] if value[0] == '*': value = value[1:] indirect = True # depends on [control=['if'], data=[]] else: indirect...
def after_init_app(self, app: FlaskUnchained): """ Configure the JSON encoder for Flask to be able to serialize Enums, LocalProxy objects, and SQLAlchemy models. """ self.set_json_encoder(app) app.before_first_request(self.register_model_resources)
def function[after_init_app, parameter[self, app]]: constant[ Configure the JSON encoder for Flask to be able to serialize Enums, LocalProxy objects, and SQLAlchemy models. ] call[name[self].set_json_encoder, parameter[name[app]]] call[name[app].before_first_request, para...
keyword[def] identifier[after_init_app] ( identifier[self] , identifier[app] : identifier[FlaskUnchained] ): literal[string] identifier[self] . identifier[set_json_encoder] ( identifier[app] ) identifier[app] . identifier[before_first_request] ( identifier[self] . identifier[register_model...
def after_init_app(self, app: FlaskUnchained): """ Configure the JSON encoder for Flask to be able to serialize Enums, LocalProxy objects, and SQLAlchemy models. """ self.set_json_encoder(app) app.before_first_request(self.register_model_resources)
def can_convert(strict: bool, from_type: Type[S], to_type: Type[T]): """ None should be treated as a Joker here (but we know that never from_type and to_type will be None at the same time) :param strict: :param from_type: :param to_type: :return: """ if (to_type is not None) and (to_typ...
def function[can_convert, parameter[strict, from_type, to_type]]: constant[ None should be treated as a Joker here (but we know that never from_type and to_type will be None at the same time) :param strict: :param from_type: :param to_type: :return: ] if <ast.BoolOp object at 0x...
keyword[def] identifier[can_convert] ( identifier[strict] : identifier[bool] , identifier[from_type] : identifier[Type] [ identifier[S] ], identifier[to_type] : identifier[Type] [ identifier[T] ]): literal[string] keyword[if] ( identifier[to_type] keyword[is] keyword[not] keyword[None] ) keyword[and] ( ...
def can_convert(strict: bool, from_type: Type[S], to_type: Type[T]): """ None should be treated as a Joker here (but we know that never from_type and to_type will be None at the same time) :param strict: :param from_type: :param to_type: :return: """ if to_type is not None and to_type n...
def _setup(self, name=None): """ Load the settings module referenced by env_var. This environment- defined configuration process is called during the settings configuration process. """ envvar = self.__dict__['env_var'] if envvar: settings_file = os.en...
def function[_setup, parameter[self, name]]: constant[ Load the settings module referenced by env_var. This environment- defined configuration process is called during the settings configuration process. ] variable[envvar] assign[=] call[name[self].__dict__][constant[env_...
keyword[def] identifier[_setup] ( identifier[self] , identifier[name] = keyword[None] ): literal[string] identifier[envvar] = identifier[self] . identifier[__dict__] [ literal[string] ] keyword[if] identifier[envvar] : identifier[settings_file] = identifier[os] . identifier[e...
def _setup(self, name=None): """ Load the settings module referenced by env_var. This environment- defined configuration process is called during the settings configuration process. """ envvar = self.__dict__['env_var'] if envvar: settings_file = os.environ.get(envvar...
def get_crystal_field_spin(self, coordination: str = "oct", spin_config: str = "high"): """ Calculate the crystal field spin based on coordination and spin configuration. Only works for transition metal species. Args: coordination (str): Only o...
def function[get_crystal_field_spin, parameter[self, coordination, spin_config]]: constant[ Calculate the crystal field spin based on coordination and spin configuration. Only works for transition metal species. Args: coordination (str): Only oct and tet are supported at the...
keyword[def] identifier[get_crystal_field_spin] ( identifier[self] , identifier[coordination] : identifier[str] = literal[string] , identifier[spin_config] : identifier[str] = literal[string] ): literal[string] keyword[if] identifier[coordination] keyword[not] keyword[in] ( literal[string] , li...
def get_crystal_field_spin(self, coordination: str='oct', spin_config: str='high'): """ Calculate the crystal field spin based on coordination and spin configuration. Only works for transition metal species. Args: coordination (str): Only oct and tet are supported at the moment....
def publish_properties(self): """publish device and node properties""" publish = self.publish # device properties publish(b"$homie", b"3.0.1") publish(b"$name", self.settings.DEVICE_NAME) publish(b"$state", b"init") publish(b"$fw/name", b"Microhomie") pub...
def function[publish_properties, parameter[self]]: constant[publish device and node properties] variable[publish] assign[=] name[self].publish call[name[publish], parameter[constant[b'$homie'], constant[b'3.0.1']]] call[name[publish], parameter[constant[b'$name'], name[self].settings.DEV...
keyword[def] identifier[publish_properties] ( identifier[self] ): literal[string] identifier[publish] = identifier[self] . identifier[publish] identifier[publish] ( literal[string] , literal[string] ) identifier[publish] ( literal[string] , identifier[self] . identifier...
def publish_properties(self): """publish device and node properties""" publish = self.publish # device properties publish(b'$homie', b'3.0.1') publish(b'$name', self.settings.DEVICE_NAME) publish(b'$state', b'init') publish(b'$fw/name', b'Microhomie') publish(b'$fw/version', __version__)...
def __ComputeEndByte(self, start, end=None, use_chunks=True): """Compute the last byte to fetch for this request. This is all based on the HTTP spec for Range and Content-Range. Note that this is potentially confusing in several ways: * the value for the last byte is 0-based,...
def function[__ComputeEndByte, parameter[self, start, end, use_chunks]]: constant[Compute the last byte to fetch for this request. This is all based on the HTTP spec for Range and Content-Range. Note that this is potentially confusing in several ways: * the value for the last...
keyword[def] identifier[__ComputeEndByte] ( identifier[self] , identifier[start] , identifier[end] = keyword[None] , identifier[use_chunks] = keyword[True] ): literal[string] identifier[end_byte] = identifier[end] keyword[if] identifier[start] < literal[int] keyword[and] keyword[not] ...
def __ComputeEndByte(self, start, end=None, use_chunks=True): """Compute the last byte to fetch for this request. This is all based on the HTTP spec for Range and Content-Range. Note that this is potentially confusing in several ways: * the value for the last byte is 0-based, eg ...
def update_team_days_off(self, days_off_patch, team_context, iteration_id): """UpdateTeamDaysOff. Set a team's days off for an iteration :param :class:`<TeamSettingsDaysOffPatch> <azure.devops.v5_0.work.models.TeamSettingsDaysOffPatch>` days_off_patch: Team's days off patch containting a list of...
def function[update_team_days_off, parameter[self, days_off_patch, team_context, iteration_id]]: constant[UpdateTeamDaysOff. Set a team's days off for an iteration :param :class:`<TeamSettingsDaysOffPatch> <azure.devops.v5_0.work.models.TeamSettingsDaysOffPatch>` days_off_patch: Team's days off ...
keyword[def] identifier[update_team_days_off] ( identifier[self] , identifier[days_off_patch] , identifier[team_context] , identifier[iteration_id] ): literal[string] identifier[project] = keyword[None] identifier[team] = keyword[None] keyword[if] identifier[team_context] keyw...
def update_team_days_off(self, days_off_patch, team_context, iteration_id): """UpdateTeamDaysOff. Set a team's days off for an iteration :param :class:`<TeamSettingsDaysOffPatch> <azure.devops.v5_0.work.models.TeamSettingsDaysOffPatch>` days_off_patch: Team's days off patch containting a list of sta...
def main(): """Run chartpress""" argparser = argparse.ArgumentParser(description=__doc__) argparser.add_argument('--commit-range', help='Range of commits to consider when building images') argparser.add_argument('--push', action='store_true', help='push built images to docker hub') ...
def function[main, parameter[]]: constant[Run chartpress] variable[argparser] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[argparser].add_argument, parameter[constant[--commit-range]]] call[name[argparser].add_argument, parameter[constant[--push]]] call[na...
keyword[def] identifier[main] (): literal[string] identifier[argparser] = identifier[argparse] . identifier[ArgumentParser] ( identifier[description] = identifier[__doc__] ) identifier[argparser] . identifier[add_argument] ( literal[string] , identifier[help] = literal[string] ) identifier[...
def main(): """Run chartpress""" argparser = argparse.ArgumentParser(description=__doc__) argparser.add_argument('--commit-range', help='Range of commits to consider when building images') argparser.add_argument('--push', action='store_true', help='push built images to docker hub') argparser.add_arg...
def is_micropython_usb_device(port): """Checks a USB device to see if it looks like a MicroPython device. """ if type(port).__name__ == 'Device': # Assume its a pyudev.device.Device if ('ID_BUS' not in port or port['ID_BUS'] != 'usb' or 'SUBSYSTEM' not in port or port['SUBSYSTEM'...
def function[is_micropython_usb_device, parameter[port]]: constant[Checks a USB device to see if it looks like a MicroPython device. ] if compare[call[name[type], parameter[name[port]]].__name__ equal[==] constant[Device]] begin[:] if <ast.BoolOp object at 0x7da1b170e860> begin[:] ...
keyword[def] identifier[is_micropython_usb_device] ( identifier[port] ): literal[string] keyword[if] identifier[type] ( identifier[port] ). identifier[__name__] == literal[string] : keyword[if] ( literal[string] keyword[not] keyword[in] identifier[port] keyword[or] identifier[port] [ li...
def is_micropython_usb_device(port): """Checks a USB device to see if it looks like a MicroPython device. """ if type(port).__name__ == 'Device': # Assume its a pyudev.device.Device if 'ID_BUS' not in port or port['ID_BUS'] != 'usb' or 'SUBSYSTEM' not in port or (port['SUBSYSTEM'] != 'tty'):...
def routingAreaUpdateComplete(ReceiveNpduNumbersList_presence=0): """ROUTING AREA UPDATE COMPLETE Section 9.4.16""" a = TpPd(pd=0x3) b = MessageType(mesType=0xa) # 00001010 packet = a / b if ReceiveNpduNumbersList_presence is 1: c = ReceiveNpduNumbersList(ieiRNNL=0x26) packet = pack...
def function[routingAreaUpdateComplete, parameter[ReceiveNpduNumbersList_presence]]: constant[ROUTING AREA UPDATE COMPLETE Section 9.4.16] variable[a] assign[=] call[name[TpPd], parameter[]] variable[b] assign[=] call[name[MessageType], parameter[]] variable[packet] assign[=] binary_oper...
keyword[def] identifier[routingAreaUpdateComplete] ( identifier[ReceiveNpduNumbersList_presence] = literal[int] ): literal[string] identifier[a] = identifier[TpPd] ( identifier[pd] = literal[int] ) identifier[b] = identifier[MessageType] ( identifier[mesType] = literal[int] ) identifier[packet] =...
def routingAreaUpdateComplete(ReceiveNpduNumbersList_presence=0): """ROUTING AREA UPDATE COMPLETE Section 9.4.16""" a = TpPd(pd=3) b = MessageType(mesType=10) # 00001010 packet = a / b if ReceiveNpduNumbersList_presence is 1: c = ReceiveNpduNumbersList(ieiRNNL=38) packet = packet / ...
def wait_for_visible(self, locator): """ Synchronization to deal with elements that are present, but are disabled until some action triggers their visibility. :raises: ElementVisiblityTimeout """ for i in range(timeout_seconds): try: if self.d...
def function[wait_for_visible, parameter[self, locator]]: constant[ Synchronization to deal with elements that are present, but are disabled until some action triggers their visibility. :raises: ElementVisiblityTimeout ] for taget[name[i]] in starred[call[name[range], pa...
keyword[def] identifier[wait_for_visible] ( identifier[self] , identifier[locator] ): literal[string] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[timeout_seconds] ): keyword[try] : keyword[if] identifier[self] . identifier[driver] . identi...
def wait_for_visible(self, locator): """ Synchronization to deal with elements that are present, but are disabled until some action triggers their visibility. :raises: ElementVisiblityTimeout """ for i in range(timeout_seconds): try: if self.driver.is_visible...
def read_route_line(route): """ read route line in gaussian input/output and return functional basis_set and a dictionary of other route parameters Args: route (str) : the route line return functional (str) : the method (HF, PBE ...) basis_set (str) : the basis set ...
def function[read_route_line, parameter[route]]: constant[ read route line in gaussian input/output and return functional basis_set and a dictionary of other route parameters Args: route (str) : the route line return functional (str) : the method (HF, PBE ...) basis_set...
keyword[def] identifier[read_route_line] ( identifier[route] ): literal[string] identifier[scrf_patt] = identifier[re] . identifier[compile] ( literal[string] ) identifier[multi_params_patt] = identifier[re] . identifier[compile] ( literal[string] ) identifier[functional] = keyword[None] id...
def read_route_line(route): """ read route line in gaussian input/output and return functional basis_set and a dictionary of other route parameters Args: route (str) : the route line return functional (str) : the method (HF, PBE ...) basis_set (str) : the basis set ...
def gru_cell(input_layer, state, num_units, bias=tf.zeros_initializer(), weights=None, phase=prettytensor.Phase.train, parameter_modifier=parameters.identity): """Gated recurrent unit memory cell (GRU). Args: input_layer: The input l...
def function[gru_cell, parameter[input_layer, state, num_units, bias, weights, phase, parameter_modifier]]: constant[Gated recurrent unit memory cell (GRU). Args: input_layer: The input layer. state: The current state of the network. For GRUs, this is a list with one element (tensor) of shape [...
keyword[def] identifier[gru_cell] ( identifier[input_layer] , identifier[state] , identifier[num_units] , identifier[bias] = identifier[tf] . identifier[zeros_initializer] (), identifier[weights] = keyword[None] , identifier[phase] = identifier[prettytensor] . identifier[Phase] . identifier[train] , identifier[...
def gru_cell(input_layer, state, num_units, bias=tf.zeros_initializer(), weights=None, phase=prettytensor.Phase.train, parameter_modifier=parameters.identity): """Gated recurrent unit memory cell (GRU). Args: input_layer: The input layer. state: The current state of the network. For GRUs, this is a list ...
def info(self, params=None): """Get the basic info from the current cluster. :rtype: dict """ _, data = yield self.transport.perform_request('GET', '/', params=params) raise gen.Return(data)
def function[info, parameter[self, params]]: constant[Get the basic info from the current cluster. :rtype: dict ] <ast.Tuple object at 0x7da1b033df90> assign[=] <ast.Yield object at 0x7da1b033dcf0> <ast.Raise object at 0x7da1b033c730>
keyword[def] identifier[info] ( identifier[self] , identifier[params] = keyword[None] ): literal[string] identifier[_] , identifier[data] = keyword[yield] identifier[self] . identifier[transport] . identifier[perform_request] ( literal[string] , literal[string] , identifier[params] = iden...
def info(self, params=None): """Get the basic info from the current cluster. :rtype: dict """ (_, data) = (yield self.transport.perform_request('GET', '/', params=params)) raise gen.Return(data)