code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def sccs_bit_sync(y,Ns): """ rx_symb_d,clk,track = sccs_bit_sync(y,Ns) ////////////////////////////////////////////////////// Symbol synchronization algorithm using SCCS ////////////////////////////////////////////////////// y = baseband NRZ data waveform Ns = nominal numb...
def function[sccs_bit_sync, parameter[y, Ns]]: constant[ rx_symb_d,clk,track = sccs_bit_sync(y,Ns) ////////////////////////////////////////////////////// Symbol synchronization algorithm using SCCS ////////////////////////////////////////////////////// y = baseband NRZ data waveform ...
keyword[def] identifier[sccs_bit_sync] ( identifier[y] , identifier[Ns] ): literal[string] identifier[rx_symb_d] = identifier[np] . identifier[zeros] ( identifier[int] ( identifier[np] . identifier[fix] ( identifier[len] ( identifier[y] )/ identifier[Ns] ))) identifier[track] = identifier[np]...
def sccs_bit_sync(y, Ns): """ rx_symb_d,clk,track = sccs_bit_sync(y,Ns) ////////////////////////////////////////////////////// Symbol synchronization algorithm using SCCS ////////////////////////////////////////////////////// y = baseband NRZ data waveform Ns = nominal number of s...
def _index_audio_ibm(self, basename=None, replace_already_indexed=False, continuous=True, model="en-US_BroadbandModel", word_confidence=True, word_alternatives_threshold=0.9, profanity_filter_for_US_results=False): """ Implements...
def function[_index_audio_ibm, parameter[self, basename, replace_already_indexed, continuous, model, word_confidence, word_alternatives_threshold, profanity_filter_for_US_results]]: constant[ Implements a search-suitable interface for Watson speech API. Some explaination of the parameters here ...
keyword[def] identifier[_index_audio_ibm] ( identifier[self] , identifier[basename] = keyword[None] , identifier[replace_already_indexed] = keyword[False] , identifier[continuous] = keyword[True] , identifier[model] = literal[string] , identifier[word_confidence] = keyword[True] , identifier[word_alternatives_thres...
def _index_audio_ibm(self, basename=None, replace_already_indexed=False, continuous=True, model='en-US_BroadbandModel', word_confidence=True, word_alternatives_threshold=0.9, profanity_filter_for_US_results=False): """ Implements a search-suitable interface for Watson speech API. Some explaination ...
def addFixedEffect(self,F=None,A=None,index=None): """ set sample and trait designs F: NxK sample design A: LxP sample design fast_computations: False deactivates the fast computations for any and common effects (for debugging) """ if F is None: ...
def function[addFixedEffect, parameter[self, F, A, index]]: constant[ set sample and trait designs F: NxK sample design A: LxP sample design fast_computations: False deactivates the fast computations for any and common effects (for debugging) ] if comp...
keyword[def] identifier[addFixedEffect] ( identifier[self] , identifier[F] = keyword[None] , identifier[A] = keyword[None] , identifier[index] = keyword[None] ): literal[string] keyword[if] identifier[F] keyword[is] keyword[None] : identifier[F] = identifier[np] . identifier[ones] (...
def addFixedEffect(self, F=None, A=None, index=None): """ set sample and trait designs F: NxK sample design A: LxP sample design fast_computations: False deactivates the fast computations for any and common effects (for debugging) """ if F is None: F =...
def neighbors_from_pixelization(self, pixels, ridge_points): """Compute the neighbors of every Voronoi pixel as an ndarray of the pixel index's each pixel shares a \ vertex with. The ridge points of the Voronoi grid are used to derive this. Parameters ---------- ridge_p...
def function[neighbors_from_pixelization, parameter[self, pixels, ridge_points]]: constant[Compute the neighbors of every Voronoi pixel as an ndarray of the pixel index's each pixel shares a vertex with. The ridge points of the Voronoi grid are used to derive this. Parameters -...
keyword[def] identifier[neighbors_from_pixelization] ( identifier[self] , identifier[pixels] , identifier[ridge_points] ): literal[string] keyword[return] identifier[pixelization_util] . identifier[voronoi_neighbors_from_pixels_and_ridge_points] ( identifier[pixels] = identifier[pixels] , ...
def neighbors_from_pixelization(self, pixels, ridge_points): """Compute the neighbors of every Voronoi pixel as an ndarray of the pixel index's each pixel shares a vertex with. The ridge points of the Voronoi grid are used to derive this. Parameters ---------- ridge_points ...
def __constructMetricsModules(self, metricSpecs): """ Creates the required metrics modules Parameters: ----------------------------------------------------------------------- metricSpecs: A sequence of MetricSpec objects that specify which metric modules to instantiate """ if no...
def function[__constructMetricsModules, parameter[self, metricSpecs]]: constant[ Creates the required metrics modules Parameters: ----------------------------------------------------------------------- metricSpecs: A sequence of MetricSpec objects that specify which metric modules to ...
keyword[def] identifier[__constructMetricsModules] ( identifier[self] , identifier[metricSpecs] ): literal[string] keyword[if] keyword[not] identifier[metricSpecs] : keyword[return] identifier[self] . identifier[__metricSpecs] = identifier[metricSpecs] keyword[for] identifier[spec] ...
def __constructMetricsModules(self, metricSpecs): """ Creates the required metrics modules Parameters: ----------------------------------------------------------------------- metricSpecs: A sequence of MetricSpec objects that specify which metric modules to instantiate """ if no...
def run_via_api(self, container_params=None): """ create a container using this image and run it in background via Docker-py API. https://docker-py.readthedocs.io/en/stable/api.html Note: If you are using Healthchecks, be aware that support of some options were introduced just wi...
def function[run_via_api, parameter[self, container_params]]: constant[ create a container using this image and run it in background via Docker-py API. https://docker-py.readthedocs.io/en/stable/api.html Note: If you are using Healthchecks, be aware that support of some options were intr...
keyword[def] identifier[run_via_api] ( identifier[self] , identifier[container_params] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[container_params] : identifier[container_params] = identifier[DockerContainerParameters] () identifier...
def run_via_api(self, container_params=None): """ create a container using this image and run it in background via Docker-py API. https://docker-py.readthedocs.io/en/stable/api.html Note: If you are using Healthchecks, be aware that support of some options were introduced just with v...
def p_assignment(self, p): 'assignment : ASSIGN lvalue EQUALS rvalue SEMICOLON' p[0] = Assign(p[2], p[4], lineno=p.lineno(1)) p.set_lineno(0, p.lineno(1))
def function[p_assignment, parameter[self, p]]: constant[assignment : ASSIGN lvalue EQUALS rvalue SEMICOLON] call[name[p]][constant[0]] assign[=] call[name[Assign], parameter[call[name[p]][constant[2]], call[name[p]][constant[4]]]] call[name[p].set_lineno, parameter[constant[0], call[name[p].lin...
keyword[def] identifier[p_assignment] ( identifier[self] , identifier[p] ): literal[string] identifier[p] [ literal[int] ]= identifier[Assign] ( identifier[p] [ literal[int] ], identifier[p] [ literal[int] ], identifier[lineno] = identifier[p] . identifier[lineno] ( literal[int] )) identif...
def p_assignment(self, p): """assignment : ASSIGN lvalue EQUALS rvalue SEMICOLON""" p[0] = Assign(p[2], p[4], lineno=p.lineno(1)) p.set_lineno(0, p.lineno(1))
def init(self, force_deploy=False): """Reserve and deploys the vagrant boxes. Args: force_deploy (bool): True iff new machines should be started """ machines = self.provider_conf.machines networks = self.provider_conf.networks _networks = [] for netwo...
def function[init, parameter[self, force_deploy]]: constant[Reserve and deploys the vagrant boxes. Args: force_deploy (bool): True iff new machines should be started ] variable[machines] assign[=] name[self].provider_conf.machines variable[networks] assign[=] name[se...
keyword[def] identifier[init] ( identifier[self] , identifier[force_deploy] = keyword[False] ): literal[string] identifier[machines] = identifier[self] . identifier[provider_conf] . identifier[machines] identifier[networks] = identifier[self] . identifier[provider_conf] . identifier[netwo...
def init(self, force_deploy=False): """Reserve and deploys the vagrant boxes. Args: force_deploy (bool): True iff new machines should be started """ machines = self.provider_conf.machines networks = self.provider_conf.networks _networks = [] for network in networks: ...
def from_api_repr(cls, resource): """Factory: construct a table reference given its API representation Args: resource (Dict[str, object]): Table reference representation returned from the API Returns: google.cloud.bigquery.table.TableReference: ...
def function[from_api_repr, parameter[cls, resource]]: constant[Factory: construct a table reference given its API representation Args: resource (Dict[str, object]): Table reference representation returned from the API Returns: google.cloud.bigquery.tab...
keyword[def] identifier[from_api_repr] ( identifier[cls] , identifier[resource] ): literal[string] keyword[from] identifier[google] . identifier[cloud] . identifier[bigquery] . identifier[dataset] keyword[import] identifier[DatasetReference] identifier[project] = identifier[resource] ...
def from_api_repr(cls, resource): """Factory: construct a table reference given its API representation Args: resource (Dict[str, object]): Table reference representation returned from the API Returns: google.cloud.bigquery.table.TableReference: ...
def set_window_size_and_position(window, window_key): """Adjust GTK Window's size, position and maximized state according to the corresponding values in the runtime_config file. The maximize method is triggered last to restore also the last stored size and position of the window. If the runtime_config does ...
def function[set_window_size_and_position, parameter[window, window_key]]: constant[Adjust GTK Window's size, position and maximized state according to the corresponding values in the runtime_config file. The maximize method is triggered last to restore also the last stored size and position of the wind...
keyword[def] identifier[set_window_size_and_position] ( identifier[window] , identifier[window_key] ): literal[string] identifier[size] = identifier[global_runtime_config] . identifier[get_config_value] ( identifier[window_key] + literal[string] ) identifier[position] = identifier[global_runtime_confi...
def set_window_size_and_position(window, window_key): """Adjust GTK Window's size, position and maximized state according to the corresponding values in the runtime_config file. The maximize method is triggered last to restore also the last stored size and position of the window. If the runtime_config does ...
def no_missing_terms(formula_name, term_set): """ Returns true if the set is not missing terms corresponding to the entries in Appendix D, False otherwise. The set of terms should be exactly equal, and not contain more or less terms than expected. """ reqd_terms = dimless_vertical_coordinates[f...
def function[no_missing_terms, parameter[formula_name, term_set]]: constant[ Returns true if the set is not missing terms corresponding to the entries in Appendix D, False otherwise. The set of terms should be exactly equal, and not contain more or less terms than expected. ] variable[r...
keyword[def] identifier[no_missing_terms] ( identifier[formula_name] , identifier[term_set] ): literal[string] identifier[reqd_terms] = identifier[dimless_vertical_coordinates] [ identifier[formula_name] ] keyword[def] identifier[has_all_terms] ( identifier[reqd_termset] ): keyword[return] ...
def no_missing_terms(formula_name, term_set): """ Returns true if the set is not missing terms corresponding to the entries in Appendix D, False otherwise. The set of terms should be exactly equal, and not contain more or less terms than expected. """ reqd_terms = dimless_vertical_coordinates[f...
def sed(match, replacement, path, modifiers=""): """ Perform sed text substitution. """ cmd = "sed -r -i 's/%s/%s/%s' %s" % (match, replacement, modifiers, path) process = Subprocess(cmd, shell=True) ret, out, err = process.run(timeout=60) if ret: raise SubprocessError("Sed command ...
def function[sed, parameter[match, replacement, path, modifiers]]: constant[ Perform sed text substitution. ] variable[cmd] assign[=] binary_operation[constant[sed -r -i 's/%s/%s/%s' %s] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Name object at 0x7da1b09b97b0>, <ast.Name object at 0x7da1b09b...
keyword[def] identifier[sed] ( identifier[match] , identifier[replacement] , identifier[path] , identifier[modifiers] = literal[string] ): literal[string] identifier[cmd] = literal[string] %( identifier[match] , identifier[replacement] , identifier[modifiers] , identifier[path] ) identifier[process] ...
def sed(match, replacement, path, modifiers=''): """ Perform sed text substitution. """ cmd = "sed -r -i 's/%s/%s/%s' %s" % (match, replacement, modifiers, path) process = Subprocess(cmd, shell=True) (ret, out, err) = process.run(timeout=60) if ret: raise SubprocessError('Sed command...
def build_route_timetable( feed: "Feed", route_id: str, dates: List[str] ) -> DataFrame: """ Return a timetable for the given route and dates. Parameters ---------- feed : Feed route_id : string ID of a route in ``feed.routes`` dates : string or list A YYYYMMDD date stri...
def function[build_route_timetable, parameter[feed, route_id, dates]]: constant[ Return a timetable for the given route and dates. Parameters ---------- feed : Feed route_id : string ID of a route in ``feed.routes`` dates : string or list A YYYYMMDD date string or list t...
keyword[def] identifier[build_route_timetable] ( identifier[feed] : literal[string] , identifier[route_id] : identifier[str] , identifier[dates] : identifier[List] [ identifier[str] ] )-> identifier[DataFrame] : literal[string] identifier[dates] = identifier[feed] . identifier[restrict_dates] ( identifier...
def build_route_timetable(feed: 'Feed', route_id: str, dates: List[str]) -> DataFrame: """ Return a timetable for the given route and dates. Parameters ---------- feed : Feed route_id : string ID of a route in ``feed.routes`` dates : string or list A YYYYMMDD date string or ...
def handle_versions(repo, **kwargs): """:return: repo.versions()""" log.info('versions: %s %s' %(repo, kwargs)) if not hasattr(repo, 'versions'): return [] return [v.serialize() for v in repo.versions(**kwargs)]
def function[handle_versions, parameter[repo]]: constant[:return: repo.versions()] call[name[log].info, parameter[binary_operation[constant[versions: %s %s] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Name object at 0x7da207f98df0>, <ast.Name object at 0x7da207f98580>]]]]] if <ast.UnaryOp obj...
keyword[def] identifier[handle_versions] ( identifier[repo] ,** identifier[kwargs] ): literal[string] identifier[log] . identifier[info] ( literal[string] %( identifier[repo] , identifier[kwargs] )) keyword[if] keyword[not] identifier[hasattr] ( identifier[repo] , literal[string] ): keyword...
def handle_versions(repo, **kwargs): """:return: repo.versions()""" log.info('versions: %s %s' % (repo, kwargs)) if not hasattr(repo, 'versions'): return [] # depends on [control=['if'], data=[]] return [v.serialize() for v in repo.versions(**kwargs)]
def sheets(self): """return the sheets of data.""" data = Dict() for src in [src for src in self.zipfile.namelist() if 'xl/worksheets/' in src]: name = os.path.splitext(os.path.basename(src))[0] xml = self.xml(src) data[name] = xml return data
def function[sheets, parameter[self]]: constant[return the sheets of data.] variable[data] assign[=] call[name[Dict], parameter[]] for taget[name[src]] in starred[<ast.ListComp object at 0x7da20c6c47c0>] begin[:] variable[name] assign[=] call[call[name[os].path.splitext, paramete...
keyword[def] identifier[sheets] ( identifier[self] ): literal[string] identifier[data] = identifier[Dict] () keyword[for] identifier[src] keyword[in] [ identifier[src] keyword[for] identifier[src] keyword[in] identifier[self] . identifier[zipfile] . identifier[namelist] () keyword[if...
def sheets(self): """return the sheets of data.""" data = Dict() for src in [src for src in self.zipfile.namelist() if 'xl/worksheets/' in src]: name = os.path.splitext(os.path.basename(src))[0] xml = self.xml(src) data[name] = xml # depends on [control=['for'], data=['src']] re...
def delete_collection_persistent_volume(self, **kwargs): # noqa: E501 """delete_collection_persistent_volume # noqa: E501 delete collection of PersistentVolume # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass asyn...
def function[delete_collection_persistent_volume, parameter[self]]: constant[delete_collection_persistent_volume # noqa: E501 delete collection of PersistentVolume # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass a...
keyword[def] identifier[delete_collection_persistent_volume] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[return] identifier[s...
def delete_collection_persistent_volume(self, **kwargs): # noqa: E501 'delete_collection_persistent_volume # noqa: E501\n\n delete collection of PersistentVolume # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_...
def _matrix_integration(q, h, t): ''' Returns the dp metric for a single horsetail curve at a given value of the epistemic uncertainties''' N = len(q) # correction if CDF has gone out of trapezium range if h[-1] < 0.9: h[-1] = 1.0 W = np.zeros([N, N]) for i in range(N): W[i, i] = ...
def function[_matrix_integration, parameter[q, h, t]]: constant[ Returns the dp metric for a single horsetail curve at a given value of the epistemic uncertainties] variable[N] assign[=] call[name[len], parameter[name[q]]] if compare[call[name[h]][<ast.UnaryOp object at 0x7da1b1594310>] less...
keyword[def] identifier[_matrix_integration] ( identifier[q] , identifier[h] , identifier[t] ): literal[string] identifier[N] = identifier[len] ( identifier[q] ) keyword[if] identifier[h] [- literal[int] ]< literal[int] : identifier[h] [- literal[int] ]= literal[int] identifier[W] = ide...
def _matrix_integration(q, h, t): """ Returns the dp metric for a single horsetail curve at a given value of the epistemic uncertainties""" N = len(q) # correction if CDF has gone out of trapezium range if h[-1] < 0.9: h[-1] = 1.0 # depends on [control=['if'], data=[]] W = np.zeros([N, ...
def create_explicit(bounds): """Creates a new instance of distribution with explicit buckets. bounds is an iterable of ordered floats that define the explicit buckets Args: bounds (iterable[float]): initializes the bounds Return: :class:`endpoints_management.gen.servicecontrol_v1_messag...
def function[create_explicit, parameter[bounds]]: constant[Creates a new instance of distribution with explicit buckets. bounds is an iterable of ordered floats that define the explicit buckets Args: bounds (iterable[float]): initializes the bounds Return: :class:`endpoints_manageme...
keyword[def] identifier[create_explicit] ( identifier[bounds] ): literal[string] identifier[safe_bounds] = identifier[sorted] ( identifier[float] ( identifier[x] ) keyword[for] identifier[x] keyword[in] identifier[bounds] ) keyword[if] identifier[len] ( identifier[safe_bounds] )!= identifier[len] ...
def create_explicit(bounds): """Creates a new instance of distribution with explicit buckets. bounds is an iterable of ordered floats that define the explicit buckets Args: bounds (iterable[float]): initializes the bounds Return: :class:`endpoints_management.gen.servicecontrol_v1_messag...
def _handle_fundamental_types(self, typ): """ Handles POD types nodes. see init_fundamental_types for the registration. """ ctypesname = self.get_ctypes_name(typ.kind) if typ.kind == TypeKind.VOID: size = align = 1 else: size = typ.get_size...
def function[_handle_fundamental_types, parameter[self, typ]]: constant[ Handles POD types nodes. see init_fundamental_types for the registration. ] variable[ctypesname] assign[=] call[name[self].get_ctypes_name, parameter[name[typ].kind]] if compare[name[typ].kind equal[...
keyword[def] identifier[_handle_fundamental_types] ( identifier[self] , identifier[typ] ): literal[string] identifier[ctypesname] = identifier[self] . identifier[get_ctypes_name] ( identifier[typ] . identifier[kind] ) keyword[if] identifier[typ] . identifier[kind] == identifier[TypeKind] ...
def _handle_fundamental_types(self, typ): """ Handles POD types nodes. see init_fundamental_types for the registration. """ ctypesname = self.get_ctypes_name(typ.kind) if typ.kind == TypeKind.VOID: size = align = 1 # depends on [control=['if'], data=[]] else: siz...
def inc(self, key, key_length=0): """Add value to key-value Params: <str> key <int> value <int> key_length Return: <int> key_value """ if key_length < 1: key_length = len(key) val = self.add_method(self, key, key...
def function[inc, parameter[self, key, key_length]]: constant[Add value to key-value Params: <str> key <int> value <int> key_length Return: <int> key_value ] if compare[name[key_length] less[<] constant[1]] begin[:] ...
keyword[def] identifier[inc] ( identifier[self] , identifier[key] , identifier[key_length] = literal[int] ): literal[string] keyword[if] identifier[key_length] < literal[int] : identifier[key_length] = identifier[len] ( identifier[key] ) identifier[val] = identifier[self] . i...
def inc(self, key, key_length=0): """Add value to key-value Params: <str> key <int> value <int> key_length Return: <int> key_value """ if key_length < 1: key_length = len(key) # depends on [control=['if'], data=['key_length']] ...
def get_includes(self, path): """ Get all includes from a config in a given path """ config = self.file_index.unfold_yaml(path) return self.get_includes_from_dict(config, extract=True)
def function[get_includes, parameter[self, path]]: constant[ Get all includes from a config in a given path ] variable[config] assign[=] call[name[self].file_index.unfold_yaml, parameter[name[path]]] return[call[name[self].get_includes_from_dict, parameter[name[config]]]]
keyword[def] identifier[get_includes] ( identifier[self] , identifier[path] ): literal[string] identifier[config] = identifier[self] . identifier[file_index] . identifier[unfold_yaml] ( identifier[path] ) keyword[return] identifier[self] . identifier[get_includes_from_dict] ( identifier[...
def get_includes(self, path): """ Get all includes from a config in a given path """ config = self.file_index.unfold_yaml(path) return self.get_includes_from_dict(config, extract=True)
def find_mismatch(self, other, indent=''): """ Highlights where two nodes differ in a human-readable form Parameters ---------- other : TreeNode The node to compare indent : str The white-space with which to indent output string Returns ...
def function[find_mismatch, parameter[self, other, indent]]: constant[ Highlights where two nodes differ in a human-readable form Parameters ---------- other : TreeNode The node to compare indent : str The white-space with which to indent output s...
keyword[def] identifier[find_mismatch] ( identifier[self] , identifier[other] , identifier[indent] = literal[string] ): literal[string] keyword[if] identifier[self] != identifier[other] : identifier[mismatch] = literal[string] . identifier[format] ( identifier[indent] , identifier[typ...
def find_mismatch(self, other, indent=''): """ Highlights where two nodes differ in a human-readable form Parameters ---------- other : TreeNode The node to compare indent : str The white-space with which to indent output string Returns ...
def before_render(self): """Before template render hook """ # Render the Add button if the user has the AddClient permission if check_permission(AddMethod, self.context): self.context_actions[_("Add")] = { "url": "createObject?type_name=Method", ...
def function[before_render, parameter[self]]: constant[Before template render hook ] if call[name[check_permission], parameter[name[AddMethod], name[self].context]] begin[:] call[name[self].context_actions][call[name[_], parameter[constant[Add]]]] assign[=] dictionary[[<ast.Const...
keyword[def] identifier[before_render] ( identifier[self] ): literal[string] keyword[if] identifier[check_permission] ( identifier[AddMethod] , identifier[self] . identifier[context] ): identifier[self] . identifier[context_actions] [ identifier[_] ( literal[string] )]={ ...
def before_render(self): """Before template render hook """ # Render the Add button if the user has the AddClient permission if check_permission(AddMethod, self.context): self.context_actions[_('Add')] = {'url': 'createObject?type_name=Method', 'icon': '++resource++bika.lims.images/add.png'}...
def read_pid_constants(self): """Reads back the PID constants stored on the Grizzly.""" p = self._read_as_int(Addr.PConstant, 4) i = self._read_as_int(Addr.IConstant, 4) d = self._read_as_int(Addr.DConstant, 4) return map(lambda x: x / (2 ** 16), (p, i, d))
def function[read_pid_constants, parameter[self]]: constant[Reads back the PID constants stored on the Grizzly.] variable[p] assign[=] call[name[self]._read_as_int, parameter[name[Addr].PConstant, constant[4]]] variable[i] assign[=] call[name[self]._read_as_int, parameter[name[Addr].IConstant, c...
keyword[def] identifier[read_pid_constants] ( identifier[self] ): literal[string] identifier[p] = identifier[self] . identifier[_read_as_int] ( identifier[Addr] . identifier[PConstant] , literal[int] ) identifier[i] = identifier[self] . identifier[_read_as_int] ( identifier[Addr] . identif...
def read_pid_constants(self): """Reads back the PID constants stored on the Grizzly.""" p = self._read_as_int(Addr.PConstant, 4) i = self._read_as_int(Addr.IConstant, 4) d = self._read_as_int(Addr.DConstant, 4) return map(lambda x: x / 2 ** 16, (p, i, d))
def constructFMIndex(self, logger): ''' This function iterates through the BWT and counts the letters as it goes to create the FM index. For example, the string 'ACC$' would have BWT 'C$CA'. The FM index would iterate over this and count the occurence of the letter it found so you'd end up wit...
def function[constructFMIndex, parameter[self, logger]]: constant[ This function iterates through the BWT and counts the letters as it goes to create the FM index. For example, the string 'ACC$' would have BWT 'C$CA'. The FM index would iterate over this and count the occurence of the letter i...
keyword[def] identifier[constructFMIndex] ( identifier[self] , identifier[logger] ): literal[string] identifier[self] . identifier[searchCache] ={} identifier[self] . identifier[bitPower] = literal[int] identifier[self] . identifier[binSize] = literal[int] ** identifier[...
def constructFMIndex(self, logger): """ This function iterates through the BWT and counts the letters as it goes to create the FM index. For example, the string 'ACC$' would have BWT 'C$CA'. The FM index would iterate over this and count the occurence of the letter it found so you'd end up with th...
def update_build_configuration_set(id, **kwargs): """ Update a BuildConfigurationSet """ data = update_build_configuration_set_raw(id, **kwargs) if data: return utils.format_json(data)
def function[update_build_configuration_set, parameter[id]]: constant[ Update a BuildConfigurationSet ] variable[data] assign[=] call[name[update_build_configuration_set_raw], parameter[name[id]]] if name[data] begin[:] return[call[name[utils].format_json, parameter[name[data]]]]
keyword[def] identifier[update_build_configuration_set] ( identifier[id] ,** identifier[kwargs] ): literal[string] identifier[data] = identifier[update_build_configuration_set_raw] ( identifier[id] ,** identifier[kwargs] ) keyword[if] identifier[data] : keyword[return] identifier[utils] . i...
def update_build_configuration_set(id, **kwargs): """ Update a BuildConfigurationSet """ data = update_build_configuration_set_raw(id, **kwargs) if data: return utils.format_json(data) # depends on [control=['if'], data=[]]
def get_token(): """ Get the encrypted GitHub token in Travis. Make sure the contents this variable do not leak. The ``run()`` function will remove this from the output, so always use it. """ token = os.environ.get("GH_TOKEN", None) if not token: token = "GH_TOKEN environment variab...
def function[get_token, parameter[]]: constant[ Get the encrypted GitHub token in Travis. Make sure the contents this variable do not leak. The ``run()`` function will remove this from the output, so always use it. ] variable[token] assign[=] call[name[os].environ.get, parameter[constan...
keyword[def] identifier[get_token] (): literal[string] identifier[token] = identifier[os] . identifier[environ] . identifier[get] ( literal[string] , keyword[None] ) keyword[if] keyword[not] identifier[token] : identifier[token] = literal[string] identifier[token] = identifier[token] ...
def get_token(): """ Get the encrypted GitHub token in Travis. Make sure the contents this variable do not leak. The ``run()`` function will remove this from the output, so always use it. """ token = os.environ.get('GH_TOKEN', None) if not token: token = 'GH_TOKEN environment variab...
def add_properties(self, names, methods): """Returns a view of self with the given methods added as properties. From: <http://stackoverflow.com/a/2954373/1366472>. """ cls = type(self) cls = type(cls.__name__, (cls,), dict(cls.__dict__)) if isinstance(names, string_types...
def function[add_properties, parameter[self, names, methods]]: constant[Returns a view of self with the given methods added as properties. From: <http://stackoverflow.com/a/2954373/1366472>. ] variable[cls] assign[=] call[name[type], parameter[name[self]]] variable[cls] assign[=...
keyword[def] identifier[add_properties] ( identifier[self] , identifier[names] , identifier[methods] ): literal[string] identifier[cls] = identifier[type] ( identifier[self] ) identifier[cls] = identifier[type] ( identifier[cls] . identifier[__name__] ,( identifier[cls] ,), identifier[dict...
def add_properties(self, names, methods): """Returns a view of self with the given methods added as properties. From: <http://stackoverflow.com/a/2954373/1366472>. """ cls = type(self) cls = type(cls.__name__, (cls,), dict(cls.__dict__)) if isinstance(names, string_types): names...
def print_stats(self, header=True, file=sys.stdout): """Pretty print stats table.""" if header: print("CACHE {:*^18} {:*^18} {:*^18} {:*^18} {:*^18}".format( "HIT", "MISS", "LOAD", "STORE", "EVICT"), file=file) for s in self.stats(): print("{name:>5} {HIT_...
def function[print_stats, parameter[self, header, file]]: constant[Pretty print stats table.] if name[header] begin[:] call[name[print], parameter[call[constant[CACHE {:*^18} {:*^18} {:*^18} {:*^18} {:*^18}].format, parameter[constant[HIT], constant[MISS], constant[LOAD], constant[STORE]...
keyword[def] identifier[print_stats] ( identifier[self] , identifier[header] = keyword[True] , identifier[file] = identifier[sys] . identifier[stdout] ): literal[string] keyword[if] identifier[header] : identifier[print] ( literal[string] . identifier[format] ( literal[st...
def print_stats(self, header=True, file=sys.stdout): """Pretty print stats table.""" if header: print('CACHE {:*^18} {:*^18} {:*^18} {:*^18} {:*^18}'.format('HIT', 'MISS', 'LOAD', 'STORE', 'EVICT'), file=file) # depends on [control=['if'], data=[]] for s in self.stats(): print('{name:>5} {H...
def parameterized_expectations(model, verbose=False, initial_dr=None, pert_order=1, with_complementarities=True, grid={}, distribution={}, maxit=100, tol=1e-8, inner_maxit=10, direct=False): ...
def function[parameterized_expectations, parameter[model, verbose, initial_dr, pert_order, with_complementarities, grid, distribution, maxit, tol, inner_maxit, direct]]: constant[ Find global solution for ``model`` via parameterized expectations. Controls must be expressed as a direct function of equili...
keyword[def] identifier[parameterized_expectations] ( identifier[model] , identifier[verbose] = keyword[False] , identifier[initial_dr] = keyword[None] , identifier[pert_order] = literal[int] , identifier[with_complementarities] = keyword[True] , identifier[grid] ={}, identifier[distribution] ={}, identifier[maxit...
def parameterized_expectations(model, verbose=False, initial_dr=None, pert_order=1, with_complementarities=True, grid={}, distribution={}, maxit=100, tol=1e-08, inner_maxit=10, direct=False): """ Find global solution for ``model`` via parameterized expectations. Controls must be expressed as a direct functi...
def findzc(x, thresh, t_max=None): ''' Find cues to each zero-crossing in vector x. To be accepted as a zero-crossing, the signal must pass from below -thresh to above thresh, or vice versa, in no more than t_max samples. Args ---- thresh: (float) magnitude threshold for detecting ...
def function[findzc, parameter[x, thresh, t_max]]: constant[ Find cues to each zero-crossing in vector x. To be accepted as a zero-crossing, the signal must pass from below -thresh to above thresh, or vice versa, in no more than t_max samples. Args ---- thresh: (float) magnitud...
keyword[def] identifier[findzc] ( identifier[x] , identifier[thresh] , identifier[t_max] = keyword[None] ): literal[string] keyword[import] identifier[numpy] identifier[pt_p] = identifier[x] > identifier[thresh] identifier[pt_n] =~ identifier[pt_p] identifier[nt_n] = identifi...
def findzc(x, thresh, t_max=None): """ Find cues to each zero-crossing in vector x. To be accepted as a zero-crossing, the signal must pass from below -thresh to above thresh, or vice versa, in no more than t_max samples. Args ---- thresh: (float) magnitude threshold for detecting ...
def make_export_strategy( args, keep_target, assets_extra, features, schema, stats): """Makes prediction graph that takes json input. Args: args: command line args keep_target: If ture, target column is returned in prediction graph. Target column must...
def function[make_export_strategy, parameter[args, keep_target, assets_extra, features, schema, stats]]: constant[Makes prediction graph that takes json input. Args: args: command line args keep_target: If ture, target column is returned in prediction graph. Target column must also exist in i...
keyword[def] identifier[make_export_strategy] ( identifier[args] , identifier[keep_target] , identifier[assets_extra] , identifier[features] , identifier[schema] , identifier[stats] ): literal[string] identifier[target_name] = identifier[feature_transforms] . identifier[get_target_name] ( identifier[feat...
def make_export_strategy(args, keep_target, assets_extra, features, schema, stats): """Makes prediction graph that takes json input. Args: args: command line args keep_target: If ture, target column is returned in prediction graph. Target column must also exist in input data assets_extra: oth...
def fit(self, X): """Compute the Robust Shared Response Model Parameters ---------- X : list of 2D arrays, element i has shape=[voxels_i, timepoints] Each element in the list contains the fMRI data of one subject. """ logger.info('Starting RSRM') # ...
def function[fit, parameter[self, X]]: constant[Compute the Robust Shared Response Model Parameters ---------- X : list of 2D arrays, element i has shape=[voxels_i, timepoints] Each element in the list contains the fMRI data of one subject. ] call[name[logge...
keyword[def] identifier[fit] ( identifier[self] , identifier[X] ): literal[string] identifier[logger] . identifier[info] ( literal[string] ) keyword[if] literal[int] >= identifier[self] . identifier[lam] : keyword[raise] identifier[ValueError] ( literal[string] ) ...
def fit(self, X): """Compute the Robust Shared Response Model Parameters ---------- X : list of 2D arrays, element i has shape=[voxels_i, timepoints] Each element in the list contains the fMRI data of one subject. """ logger.info('Starting RSRM') # Check that th...
def aggregate(self, dimensions=None, function=None, spreadfn=None, **kwargs): """Applies a aggregate function to all ViewableElements. See :py:meth:`Dimensioned.opts` and :py:meth:`Apply.__call__` for more information. """ kwargs['_method_args'] = (dimensions, function, spreadfn...
def function[aggregate, parameter[self, dimensions, function, spreadfn]]: constant[Applies a aggregate function to all ViewableElements. See :py:meth:`Dimensioned.opts` and :py:meth:`Apply.__call__` for more information. ] call[name[kwargs]][constant[_method_args]] assign[=] tup...
keyword[def] identifier[aggregate] ( identifier[self] , identifier[dimensions] = keyword[None] , identifier[function] = keyword[None] , identifier[spreadfn] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]=( identifier[dimensions] , identifier[functio...
def aggregate(self, dimensions=None, function=None, spreadfn=None, **kwargs): """Applies a aggregate function to all ViewableElements. See :py:meth:`Dimensioned.opts` and :py:meth:`Apply.__call__` for more information. """ kwargs['_method_args'] = (dimensions, function, spreadfn) re...
def __modify(self, withdrawal_id, **kwargs): """Call documentation: `/withdrawal/modify <https://www.wepay.com/developer/reference/withdrawal#modify>`_, plus extra keyword parameters: :keyword str access_token: will be used instead of instance's ``access_token``, with...
def function[__modify, parameter[self, withdrawal_id]]: constant[Call documentation: `/withdrawal/modify <https://www.wepay.com/developer/reference/withdrawal#modify>`_, plus extra keyword parameters: :keyword str access_token: will be used instead of instance's ``acc...
keyword[def] identifier[__modify] ( identifier[self] , identifier[withdrawal_id] ,** identifier[kwargs] ): literal[string] identifier[params] ={ literal[string] : identifier[withdrawal_id] } keyword[return] identifier[self] . identifier[make_call] ( identifier[self] . id...
def __modify(self, withdrawal_id, **kwargs): """Call documentation: `/withdrawal/modify <https://www.wepay.com/developer/reference/withdrawal#modify>`_, plus extra keyword parameters: :keyword str access_token: will be used instead of instance's ``access_token``, with ``b...
def _put_table(D, name, table): """ Use the dataset and name to place the new table data into the dataset. :param dict D: Dataset :param str name: Table name / path to store new table :param dict table: Newly created table data :return dict D: Dataset """ try: # print("Placing ...
def function[_put_table, parameter[D, name, table]]: constant[ Use the dataset and name to place the new table data into the dataset. :param dict D: Dataset :param str name: Table name / path to store new table :param dict table: Newly created table data :return dict D: Dataset ] <a...
keyword[def] identifier[_put_table] ( identifier[D] , identifier[name] , identifier[table] ): literal[string] keyword[try] : identifier[table] [ literal[string] ]= identifier[name] identifier[m] = identifier[re] . identifier[match] ( identifier[re_table_name] , identifier[name] ) ...
def _put_table(D, name, table): """ Use the dataset and name to place the new table data into the dataset. :param dict D: Dataset :param str name: Table name / path to store new table :param dict table: Newly created table data :return dict D: Dataset """ try: # print("Placing t...
def _to_java_object_rdd(rdd): """ Return a JavaRDD of Object by unpickling It will convert each Python object into Java object by Pyrolite, whenever the RDD is serialized in batch or not. """ rdd = rdd._reserialize(AutoBatchedSerializer(PickleSerializer())) return rdd.ctx._jvm.org.apache.spark....
def function[_to_java_object_rdd, parameter[rdd]]: constant[ Return a JavaRDD of Object by unpickling It will convert each Python object into Java object by Pyrolite, whenever the RDD is serialized in batch or not. ] variable[rdd] assign[=] call[name[rdd]._reserialize, parameter[call[name[A...
keyword[def] identifier[_to_java_object_rdd] ( identifier[rdd] ): literal[string] identifier[rdd] = identifier[rdd] . identifier[_reserialize] ( identifier[AutoBatchedSerializer] ( identifier[PickleSerializer] ())) keyword[return] identifier[rdd] . identifier[ctx] . identifier[_jvm] . identifier[org]...
def _to_java_object_rdd(rdd): """ Return a JavaRDD of Object by unpickling It will convert each Python object into Java object by Pyrolite, whenever the RDD is serialized in batch or not. """ rdd = rdd._reserialize(AutoBatchedSerializer(PickleSerializer())) return rdd.ctx._jvm.org.apache.spark....
def pip(self, cmd): """Execute some pip function using the virtual environment pip.""" pip_bin = self.cmd_path('pip') cmd = '{0} {1}'.format(pip_bin, cmd) return self._execute(cmd)
def function[pip, parameter[self, cmd]]: constant[Execute some pip function using the virtual environment pip.] variable[pip_bin] assign[=] call[name[self].cmd_path, parameter[constant[pip]]] variable[cmd] assign[=] call[constant[{0} {1}].format, parameter[name[pip_bin], name[cmd]]] return[c...
keyword[def] identifier[pip] ( identifier[self] , identifier[cmd] ): literal[string] identifier[pip_bin] = identifier[self] . identifier[cmd_path] ( literal[string] ) identifier[cmd] = literal[string] . identifier[format] ( identifier[pip_bin] , identifier[cmd] ) keyword[return] ...
def pip(self, cmd): """Execute some pip function using the virtual environment pip.""" pip_bin = self.cmd_path('pip') cmd = '{0} {1}'.format(pip_bin, cmd) return self._execute(cmd)
def get_attribute_type(o_attr): ''' Get the base data type (S_DT) associated with a BridgePoint attribute. ''' ref_o_attr = one(o_attr).O_RATTR[106].O_BATTR[113].O_ATTR[106]() if ref_o_attr: return get_attribute_type(ref_o_attr) else: return one(o_attr).S_DT[114]()
def function[get_attribute_type, parameter[o_attr]]: constant[ Get the base data type (S_DT) associated with a BridgePoint attribute. ] variable[ref_o_attr] assign[=] call[call[call[call[call[name[one], parameter[name[o_attr]]].O_RATTR][constant[106]].O_BATTR][constant[113]].O_ATTR][constant[106...
keyword[def] identifier[get_attribute_type] ( identifier[o_attr] ): literal[string] identifier[ref_o_attr] = identifier[one] ( identifier[o_attr] ). identifier[O_RATTR] [ literal[int] ]. identifier[O_BATTR] [ literal[int] ]. identifier[O_ATTR] [ literal[int] ]() keyword[if] identifier[ref_o_attr] : ...
def get_attribute_type(o_attr): """ Get the base data type (S_DT) associated with a BridgePoint attribute. """ ref_o_attr = one(o_attr).O_RATTR[106].O_BATTR[113].O_ATTR[106]() if ref_o_attr: return get_attribute_type(ref_o_attr) # depends on [control=['if'], data=[]] else: retur...
def get_assessment_part(self, assessment_part_id): """Gets the ``AssessmentPart`` specified by its ``Id``. arg: assessment_part_id (osid.id.Id): the ``Id`` of the ``AssessmentPart`` to retrieve return: (osid.assessment.authoring.AssessmentPart) - the returned ...
def function[get_assessment_part, parameter[self, assessment_part_id]]: constant[Gets the ``AssessmentPart`` specified by its ``Id``. arg: assessment_part_id (osid.id.Id): the ``Id`` of the ``AssessmentPart`` to retrieve return: (osid.assessment.authoring.AssessmentPart) - th...
keyword[def] identifier[get_assessment_part] ( identifier[self] , identifier[assessment_part_id] ): literal[string] identifier[collection] = identifier[JSONClientValidated] ( literal[string] , identifier[collection] = literal[string] , identifier[runtime...
def get_assessment_part(self, assessment_part_id): """Gets the ``AssessmentPart`` specified by its ``Id``. arg: assessment_part_id (osid.id.Id): the ``Id`` of the ``AssessmentPart`` to retrieve return: (osid.assessment.authoring.AssessmentPart) - the returned ``As...
def Filter(self, function=None): """Construct Textable from the rows of which the function returns true. Args: function: A function applied to each row which returns a bool. If function is None, all rows with empty column values are removed. Returns: A new TextT...
def function[Filter, parameter[self, function]]: constant[Construct Textable from the rows of which the function returns true. Args: function: A function applied to each row which returns a bool. If function is None, all rows with empty column values are removed. ...
keyword[def] identifier[Filter] ( identifier[self] , identifier[function] = keyword[None] ): literal[string] identifier[flat] = keyword[lambda] identifier[x] : identifier[x] keyword[if] identifier[isinstance] ( identifier[x] , identifier[str] ) keyword[else] literal[string] . identifier[join] ([ identi...
def Filter(self, function=None): """Construct Textable from the rows of which the function returns true. Args: function: A function applied to each row which returns a bool. If function is None, all rows with empty column values are removed. Returns: A new TextT...
def find_inspectable_lines(lines, pos): """Find lines in home that are inspectable. Walk back from the err line up to 3 lines, but don't walk back over changes in indent level. Walk forward up to 3 lines, counting \ separated lines as 1. Don't walk over changes in indent level (unless part of ...
def function[find_inspectable_lines, parameter[lines, pos]]: constant[Find lines in home that are inspectable. Walk back from the err line up to 3 lines, but don't walk back over changes in indent level. Walk forward up to 3 lines, counting \ separated lines as 1. Don't walk over changes i...
keyword[def] identifier[find_inspectable_lines] ( identifier[lines] , identifier[pos] ): literal[string] identifier[cnt] = identifier[re] . identifier[compile] ( literal[string] ) identifier[df] = identifier[re] . identifier[compile] ( literal[string] ) identifier[ind] = identifier[re] . identifi...
def find_inspectable_lines(lines, pos): """Find lines in home that are inspectable. Walk back from the err line up to 3 lines, but don't walk back over changes in indent level. Walk forward up to 3 lines, counting \\ separated lines as 1. Don't walk over changes in indent level (unless part of...
def put(func: Callable, allowed_exceptions: List = None, title: str = None, req_obj_type: Callable = None) -> HTTPMethod: """Returns a HTTPMethod instance to create a PUT route. :see: :class:`~doctor.routing.HTTPMethod` """ return HTTPMethod('put', func, allowed_exceptions=allowed_exceptions, ...
def function[put, parameter[func, allowed_exceptions, title, req_obj_type]]: constant[Returns a HTTPMethod instance to create a PUT route. :see: :class:`~doctor.routing.HTTPMethod` ] return[call[name[HTTPMethod], parameter[constant[put], name[func]]]]
keyword[def] identifier[put] ( identifier[func] : identifier[Callable] , identifier[allowed_exceptions] : identifier[List] = keyword[None] , identifier[title] : identifier[str] = keyword[None] , identifier[req_obj_type] : identifier[Callable] = keyword[None] )-> identifier[HTTPMethod] : literal[string] ke...
def put(func: Callable, allowed_exceptions: List=None, title: str=None, req_obj_type: Callable=None) -> HTTPMethod: """Returns a HTTPMethod instance to create a PUT route. :see: :class:`~doctor.routing.HTTPMethod` """ return HTTPMethod('put', func, allowed_exceptions=allowed_exceptions, title=title, re...
def plot(self, figsize=(12, 6), xscale='auto-gps', **kwargs): """Plot the data for this `Spectrogram` Parameters ---------- **kwargs all keyword arguments are passed along to underlying functions, see below for references Returns ------- ...
def function[plot, parameter[self, figsize, xscale]]: constant[Plot the data for this `Spectrogram` Parameters ---------- **kwargs all keyword arguments are passed along to underlying functions, see below for references Returns ------- pl...
keyword[def] identifier[plot] ( identifier[self] , identifier[figsize] =( literal[int] , literal[int] ), identifier[xscale] = literal[string] ,** identifier[kwargs] ): literal[string] keyword[if] literal[string] keyword[in] identifier[kwargs] : identifier[warnings] . identifier[warn...
def plot(self, figsize=(12, 6), xscale='auto-gps', **kwargs): """Plot the data for this `Spectrogram` Parameters ---------- **kwargs all keyword arguments are passed along to underlying functions, see below for references Returns ------- plot...
def get_revisions(page): """Extract the revisions of a page. Args: page: a string Returns: a list of strings """ start_string = " <revision>\n" end_string = " </revision>\n" ret = [] current_pos = 0 while True: start_pos = page.find(start_string, current_pos) if start_pos == -1:...
def function[get_revisions, parameter[page]]: constant[Extract the revisions of a page. Args: page: a string Returns: a list of strings ] variable[start_string] assign[=] constant[ <revision> ] variable[end_string] assign[=] constant[ </revision> ] variable[ret] assi...
keyword[def] identifier[get_revisions] ( identifier[page] ): literal[string] identifier[start_string] = literal[string] identifier[end_string] = literal[string] identifier[ret] =[] identifier[current_pos] = literal[int] keyword[while] keyword[True] : identifier[start_pos] = identifier[page...
def get_revisions(page): """Extract the revisions of a page. Args: page: a string Returns: a list of strings """ start_string = ' <revision>\n' end_string = ' </revision>\n' ret = [] current_pos = 0 while True: start_pos = page.find(start_string, current_pos) ...
def enable_plugin(name, runas=None): ''' Enable a RabbitMQ plugin via the rabbitmq-plugins command. CLI Example: .. code-block:: bash salt '*' rabbitmq.enable_plugin foo ''' if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() cmd =...
def function[enable_plugin, parameter[name, runas]]: constant[ Enable a RabbitMQ plugin via the rabbitmq-plugins command. CLI Example: .. code-block:: bash salt '*' rabbitmq.enable_plugin foo ] if <ast.BoolOp object at 0x7da18f813af0> begin[:] variable[runas] a...
keyword[def] identifier[enable_plugin] ( identifier[name] , identifier[runas] = keyword[None] ): literal[string] keyword[if] identifier[runas] keyword[is] keyword[None] keyword[and] keyword[not] identifier[salt] . identifier[utils] . identifier[platform] . identifier[is_windows] (): identifi...
def enable_plugin(name, runas=None): """ Enable a RabbitMQ plugin via the rabbitmq-plugins command. CLI Example: .. code-block:: bash salt '*' rabbitmq.enable_plugin foo """ if runas is None and (not salt.utils.platform.is_windows()): runas = salt.utils.user.get_user() # depe...
def predict(self, p, x): """ Parameters ---------- p: ndarray (Ns, d) array of predictor variables (Ns samples, d dimensions) for regression x: ndarray ndarray of (x, y) points. Needs to be a (Ns, 2) array corresponding to the lon/l...
def function[predict, parameter[self, p, x]]: constant[ Parameters ---------- p: ndarray (Ns, d) array of predictor variables (Ns samples, d dimensions) for regression x: ndarray ndarray of (x, y) points. Needs to be a (Ns, 2) array ...
keyword[def] identifier[predict] ( identifier[self] , identifier[p] , identifier[x] ): literal[string] keyword[return] identifier[self] . identifier[krige_residual] ( identifier[x] )+ identifier[self] . identifier[regression_model] . identifier[predict] ( identifier[p] )
def predict(self, p, x): """ Parameters ---------- p: ndarray (Ns, d) array of predictor variables (Ns samples, d dimensions) for regression x: ndarray ndarray of (x, y) points. Needs to be a (Ns, 2) array corresponding to the lon/lat, ...
def _pi_id(self): """Try to detect id of a Raspberry Pi.""" # Check for Pi boards: pi_rev_code = self._pi_rev_code() if pi_rev_code: for model, codes in _PI_REV_CODES.items(): if pi_rev_code in codes: return model return None
def function[_pi_id, parameter[self]]: constant[Try to detect id of a Raspberry Pi.] variable[pi_rev_code] assign[=] call[name[self]._pi_rev_code, parameter[]] if name[pi_rev_code] begin[:] for taget[tuple[[<ast.Name object at 0x7da18bccaec0>, <ast.Name object at 0x7da18bccb8e0>]...
keyword[def] identifier[_pi_id] ( identifier[self] ): literal[string] identifier[pi_rev_code] = identifier[self] . identifier[_pi_rev_code] () keyword[if] identifier[pi_rev_code] : keyword[for] identifier[model] , identifier[codes] keyword[in] identifier[_PI_REV_C...
def _pi_id(self): """Try to detect id of a Raspberry Pi.""" # Check for Pi boards: pi_rev_code = self._pi_rev_code() if pi_rev_code: for (model, codes) in _PI_REV_CODES.items(): if pi_rev_code in codes: return model # depends on [control=['if'], data=[]] # depends o...
def connect_cloudwatch(aws_access_key_id=None, aws_secret_access_key=None, **kwargs): """ :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rtype: :class:`boto.ec2.cloud...
def function[connect_cloudwatch, parameter[aws_access_key_id, aws_secret_access_key]]: constant[ :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rtype: :class:`bot...
keyword[def] identifier[connect_cloudwatch] ( identifier[aws_access_key_id] = keyword[None] , identifier[aws_secret_access_key] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[from] identifier[boto] . identifier[ec2] . identifier[cloudwatch] keyword[import] identifier[CloudWatchConnect...
def connect_cloudwatch(aws_access_key_id=None, aws_secret_access_key=None, **kwargs): """ :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rtype: :class:`boto.ec2.cloud...
def fullversion(): ''' Return all server information from catalina.sh version CLI Example: .. code-block:: bash salt '*' tomcat.fullversion ''' cmd = __catalina_home() + '/bin/catalina.sh version' ret = {} out = __salt__['cmd.run'](cmd).splitlines() for line in out: ...
def function[fullversion, parameter[]]: constant[ Return all server information from catalina.sh version CLI Example: .. code-block:: bash salt '*' tomcat.fullversion ] variable[cmd] assign[=] binary_operation[call[name[__catalina_home], parameter[]] + constant[/bin/catalina.s...
keyword[def] identifier[fullversion] (): literal[string] identifier[cmd] = identifier[__catalina_home] ()+ literal[string] identifier[ret] ={} identifier[out] = identifier[__salt__] [ literal[string] ]( identifier[cmd] ). identifier[splitlines] () keyword[for] identifier[line] keyword[in]...
def fullversion(): """ Return all server information from catalina.sh version CLI Example: .. code-block:: bash salt '*' tomcat.fullversion """ cmd = __catalina_home() + '/bin/catalina.sh version' ret = {} out = __salt__['cmd.run'](cmd).splitlines() for line in out: ...
def _fake_deleteclass(self, namespace, **params): """ Implements a mock server responder for :meth:`~pywbem.WBEMConnection.DeleteClass` Delete a class in the class repository if it exists. Emulates WBEMConnection.DeleteClass(...)) This is simplistic in that it ignores i...
def function[_fake_deleteclass, parameter[self, namespace]]: constant[ Implements a mock server responder for :meth:`~pywbem.WBEMConnection.DeleteClass` Delete a class in the class repository if it exists. Emulates WBEMConnection.DeleteClass(...)) This is simplistic in ...
keyword[def] identifier[_fake_deleteclass] ( identifier[self] , identifier[namespace] ,** identifier[params] ): literal[string] identifier[class_repo] = identifier[self] . identifier[_get_class_repo] ( identifier[namespace] ) identifier[cname] = identifier[params] [ literal[stri...
def _fake_deleteclass(self, namespace, **params): """ Implements a mock server responder for :meth:`~pywbem.WBEMConnection.DeleteClass` Delete a class in the class repository if it exists. Emulates WBEMConnection.DeleteClass(...)) This is simplistic in that it ignores issue...
def tplot_options(option, value): """ This function allows the user to set several global options for the generated plots. Parameters: option : str The name of the option. See section below value : str/int/float/list The value of the option. See section bel...
def function[tplot_options, parameter[option, value]]: constant[ This function allows the user to set several global options for the generated plots. Parameters: option : str The name of the option. See section below value : str/int/float/list The value ...
keyword[def] identifier[tplot_options] ( identifier[option] , identifier[value] ): literal[string] identifier[option] = identifier[option] . identifier[lower] () identifier[temp] = identifier[tplot_utilities] . identifier[set_tplot_options] ( identifier[option] , identifier[value] , identifier[pyt...
def tplot_options(option, value): """ This function allows the user to set several global options for the generated plots. Parameters: option : str The name of the option. See section below value : str/int/float/list The value of the option. See section bel...
def config_program_reqs(cls, programs): """Run the program tester and determine if we can do anything.""" cls._set_program_defaults(programs) do_png = cls.optipng or cls.pngout or cls.advpng do_jpeg = cls.mozjpeg or cls.jpegrescan or cls.jpegtran do_comics = cls.comics ...
def function[config_program_reqs, parameter[cls, programs]]: constant[Run the program tester and determine if we can do anything.] call[name[cls]._set_program_defaults, parameter[name[programs]]] variable[do_png] assign[=] <ast.BoolOp object at 0x7da207f01720> variable[do_jpeg] assign[=]...
keyword[def] identifier[config_program_reqs] ( identifier[cls] , identifier[programs] ): literal[string] identifier[cls] . identifier[_set_program_defaults] ( identifier[programs] ) identifier[do_png] = identifier[cls] . identifier[optipng] keyword[or] identifier[cls] . identifier[pngou...
def config_program_reqs(cls, programs): """Run the program tester and determine if we can do anything.""" cls._set_program_defaults(programs) do_png = cls.optipng or cls.pngout or cls.advpng do_jpeg = cls.mozjpeg or cls.jpegrescan or cls.jpegtran do_comics = cls.comics if not do_png and (not do_...
def unbind(self, binding): """ Unbind the instance Args: binding (AtlasServiceBinding.Binding): Existing or New binding """ username = self.backend.config.generate_binding_username(binding) try: self.backend.atlas.DatabaseUsers.d...
def function[unbind, parameter[self, binding]]: constant[ Unbind the instance Args: binding (AtlasServiceBinding.Binding): Existing or New binding ] variable[username] assign[=] call[name[self].backend.config.generate_binding_username, parameter[name[binding]]] <...
keyword[def] identifier[unbind] ( identifier[self] , identifier[binding] ): literal[string] identifier[username] = identifier[self] . identifier[backend] . identifier[config] . identifier[generate_binding_username] ( identifier[binding] ) keyword[try] : identifier[self] . id...
def unbind(self, binding): """ Unbind the instance Args: binding (AtlasServiceBinding.Binding): Existing or New binding """ username = self.backend.config.generate_binding_username(binding) try: self.backend.atlas.DatabaseUsers.delete_a_database_user(username) #...
def create_file_in_fs(file_data, file_name, file_system, static_dir): """ Writes file in specific file system. Arguments: file_data (str): Data to store into the file. file_name (str): File name of the file to be created. file_system (OSFS): Import file system. static_dir (s...
def function[create_file_in_fs, parameter[file_data, file_name, file_system, static_dir]]: constant[ Writes file in specific file system. Arguments: file_data (str): Data to store into the file. file_name (str): File name of the file to be created. file_system (OSFS): Import fil...
keyword[def] identifier[create_file_in_fs] ( identifier[file_data] , identifier[file_name] , identifier[file_system] , identifier[static_dir] ): literal[string] keyword[with] identifier[file_system] . identifier[open] ( identifier[combine] ( identifier[static_dir] , identifier[file_name] ), literal[string...
def create_file_in_fs(file_data, file_name, file_system, static_dir): """ Writes file in specific file system. Arguments: file_data (str): Data to store into the file. file_name (str): File name of the file to be created. file_system (OSFS): Import file system. static_dir (s...
def set_group_anonymous(self, *, group_id, enable=True): """ 群组匿名 ------------ :param int group_id: 群号 :param bool enable: 是否允许匿名聊天 :return: None :rtype: None """ return super().__getattr__('set_group_anonymous') \ (group_id=group_id,...
def function[set_group_anonymous, parameter[self]]: constant[ 群组匿名 ------------ :param int group_id: 群号 :param bool enable: 是否允许匿名聊天 :return: None :rtype: None ] return[call[call[call[name[super], parameter[]].__getattr__, parameter[constant[set_grou...
keyword[def] identifier[set_group_anonymous] ( identifier[self] ,*, identifier[group_id] , identifier[enable] = keyword[True] ): literal[string] keyword[return] identifier[super] (). identifier[__getattr__] ( literal[string] )( identifier[group_id] = identifier[group_id] , identifier[enable] = ide...
def set_group_anonymous(self, *, group_id, enable=True): """ 群组匿名 ------------ :param int group_id: 群号 :param bool enable: 是否允许匿名聊天 :return: None :rtype: None """ return super().__getattr__('set_group_anonymous')(group_id=group_id, enable=enable)
def urn(self, value: Union[URN, str]): """ Set the urn :param value: URN to be saved :raises: *TypeError* when the value is not URN compatible """ if isinstance(value, str): value = URN(value) elif not isinstance(value, URN): raise TypeError("New...
def function[urn, parameter[self, value]]: constant[ Set the urn :param value: URN to be saved :raises: *TypeError* when the value is not URN compatible ] if call[name[isinstance], parameter[name[value], name[str]]] begin[:] variable[value] assign[=] call[name[U...
keyword[def] identifier[urn] ( identifier[self] , identifier[value] : identifier[Union] [ identifier[URN] , identifier[str] ]): literal[string] keyword[if] identifier[isinstance] ( identifier[value] , identifier[str] ): identifier[value] = identifier[URN] ( identifier[value] ) ...
def urn(self, value: Union[URN, str]): """ Set the urn :param value: URN to be saved :raises: *TypeError* when the value is not URN compatible """ if isinstance(value, str): value = URN(value) # depends on [control=['if'], data=[]] elif not isinstance(value, URN): ...
def request(self, method: str, url: StrOrURL, **kwargs: Any) -> '_RequestContextManager': """Perform HTTP request.""" return _RequestContextManager(self._request(method, url, **kwargs))
def function[request, parameter[self, method, url]]: constant[Perform HTTP request.] return[call[name[_RequestContextManager], parameter[call[name[self]._request, parameter[name[method], name[url]]]]]]
keyword[def] identifier[request] ( identifier[self] , identifier[method] : identifier[str] , identifier[url] : identifier[StrOrURL] , ** identifier[kwargs] : identifier[Any] )-> literal[string] : literal[string] keyword[return] identifier[_RequestContextManager] ( identifier[self] . identifier[_...
def request(self, method: str, url: StrOrURL, **kwargs: Any) -> '_RequestContextManager': """Perform HTTP request.""" return _RequestContextManager(self._request(method, url, **kwargs))
def _run_markdownlint(matched_filenames, show_lint_files): """Run markdownlint on matched_filenames.""" from prospector.message import Message, Location for filename in matched_filenames: _debug_linter_status("mdl", filename, show_lint_files) try: proc = subprocess.Popen(["mdl"] + matc...
def function[_run_markdownlint, parameter[matched_filenames, show_lint_files]]: constant[Run markdownlint on matched_filenames.] from relative_module[prospector.message] import module[Message], module[Location] for taget[name[filename]] in starred[name[matched_filenames]] begin[:] ca...
keyword[def] identifier[_run_markdownlint] ( identifier[matched_filenames] , identifier[show_lint_files] ): literal[string] keyword[from] identifier[prospector] . identifier[message] keyword[import] identifier[Message] , identifier[Location] keyword[for] identifier[filename] keyword[in] identi...
def _run_markdownlint(matched_filenames, show_lint_files): """Run markdownlint on matched_filenames.""" from prospector.message import Message, Location for filename in matched_filenames: _debug_linter_status('mdl', filename, show_lint_files) # depends on [control=['for'], data=['filename']] tr...
def bisect_right(a, x, lo=0, hi=None): """Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e <= x, and all e in a[i:] have e > x. So if x already appears in the list, a.insert(x) will insert just after the rightmost x already ...
def function[bisect_right, parameter[a, x, lo, hi]]: constant[Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e <= x, and all e in a[i:] have e > x. So if x already appears in the list, a.insert(x) will insert just after ...
keyword[def] identifier[bisect_right] ( identifier[a] , identifier[x] , identifier[lo] = literal[int] , identifier[hi] = keyword[None] ): literal[string] keyword[if] identifier[lo] < literal[int] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[if] identifier[hi] keywo...
def bisect_right(a, x, lo=0, hi=None): """Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e <= x, and all e in a[i:] have e > x. So if x already appears in the list, a.insert(x) will insert just after the rightmost x already ...
def data_from_query(self, cmd): """ Callback for .execute_command() for DELETE/GET/HEAD requests """ res = None ckey = "%s /%s" % (self.command, cmd) if not isinstance(self._query_params, dict): self._query_params = {} if ckey in _NCMD: ...
def function[data_from_query, parameter[self, cmd]]: constant[ Callback for .execute_command() for DELETE/GET/HEAD requests ] variable[res] assign[=] constant[None] variable[ckey] assign[=] binary_operation[constant[%s /%s] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Attribute...
keyword[def] identifier[data_from_query] ( identifier[self] , identifier[cmd] ): literal[string] identifier[res] = keyword[None] identifier[ckey] = literal[string] %( identifier[self] . identifier[command] , identifier[cmd] ) keyword[if] keyword[not] identifier[isinstance] ( i...
def data_from_query(self, cmd): """ Callback for .execute_command() for DELETE/GET/HEAD requests """ res = None ckey = '%s /%s' % (self.command, cmd) if not isinstance(self._query_params, dict): self._query_params = {} # depends on [control=['if'], data=[]] if ckey in _NCMD:...
def add(self, leaf): """ Add the leaf (transaction) to the log and the merkle tree. Note: Currently data is serialised same way for inserting it in the log as well as the merkle tree, only difference is the tree needs binary data to the textual (utf-8) representation is converte...
def function[add, parameter[self, leaf]]: constant[ Add the leaf (transaction) to the log and the merkle tree. Note: Currently data is serialised same way for inserting it in the log as well as the merkle tree, only difference is the tree needs binary data to the textual (utf-8)...
keyword[def] identifier[add] ( identifier[self] , identifier[leaf] ): literal[string] identifier[serz_leaf] = identifier[self] . identifier[serialize_for_txn_log] ( identifier[leaf] ) identifier[self] . identifier[_addToStore] ( identifier[serz_leaf] , identifier[serializ...
def add(self, leaf): """ Add the leaf (transaction) to the log and the merkle tree. Note: Currently data is serialised same way for inserting it in the log as well as the merkle tree, only difference is the tree needs binary data to the textual (utf-8) representation is converted ...
def update(self, iterable={}, **kwargs): """ Updates recursively a self with a given iterable. TODO: rewrite this ugly stuff """ def _merge(a, *args): for key, value in itertools.chain(*args): if key in a and isinstance(value, (dict, Conf)): ...
def function[update, parameter[self, iterable]]: constant[ Updates recursively a self with a given iterable. TODO: rewrite this ugly stuff ] def function[_merge, parameter[a]]: for taget[tuple[[<ast.Name object at 0x7da1b1320160>, <ast.Name object at 0x7da1b13205...
keyword[def] identifier[update] ( identifier[self] , identifier[iterable] ={},** identifier[kwargs] ): literal[string] keyword[def] identifier[_merge] ( identifier[a] ,* identifier[args] ): keyword[for] identifier[key] , identifier[value] keyword[in] identifier[itertools] . identif...
def update(self, iterable={}, **kwargs): """ Updates recursively a self with a given iterable. TODO: rewrite this ugly stuff """ def _merge(a, *args): for (key, value) in itertools.chain(*args): if key in a and isinstance(value, (dict, Conf)): value ...
def _apply_dvportgroup_out_shaping(pg_name, out_shaping, out_shaping_conf): ''' Applies the values in out_shaping_conf to an out_shaping object pg_name The name of the portgroup out_shaping The vim.DVSTrafficShapingPolicy to apply the config to out_shaping_conf The out sha...
def function[_apply_dvportgroup_out_shaping, parameter[pg_name, out_shaping, out_shaping_conf]]: constant[ Applies the values in out_shaping_conf to an out_shaping object pg_name The name of the portgroup out_shaping The vim.DVSTrafficShapingPolicy to apply the config to out_s...
keyword[def] identifier[_apply_dvportgroup_out_shaping] ( identifier[pg_name] , identifier[out_shaping] , identifier[out_shaping_conf] ): literal[string] identifier[log] . identifier[trace] ( literal[string] , identifier[pg_name] ) keyword[if] identifier[out_shaping_conf] . identifier[get] ( literal[...
def _apply_dvportgroup_out_shaping(pg_name, out_shaping, out_shaping_conf): """ Applies the values in out_shaping_conf to an out_shaping object pg_name The name of the portgroup out_shaping The vim.DVSTrafficShapingPolicy to apply the config to out_shaping_conf The out sha...
def in_hours(self, when): """ Find if the given :class:`~datetime.datetime` is in business hours for this office. :param datetime.datetime when: The time to check :returns: True if the given time is in business hours for the office, False otherwise. :rtype: bool """ # convert to local timezone whe...
def function[in_hours, parameter[self, when]]: constant[ Find if the given :class:`~datetime.datetime` is in business hours for this office. :param datetime.datetime when: The time to check :returns: True if the given time is in business hours for the office, False otherwise. :rtype: bool ] ...
keyword[def] identifier[in_hours] ( identifier[self] , identifier[when] ): literal[string] identifier[when] = identifier[when] . identifier[astimezone] ( identifier[self] . identifier[tz] ) keyword[if] identifier[when] . identifier[weekday] () keyword[not] keyword[in] identifier[self] . identifie...
def in_hours(self, when): """ Find if the given :class:`~datetime.datetime` is in business hours for this office. :param datetime.datetime when: The time to check :returns: True if the given time is in business hours for the office, False otherwise. :rtype: bool """ # convert to local timezone w...
def before_app_websocket(self, func: Callable) -> Callable: """Add a before request websocket to the App. This is designed to be used as a decorator, and has the same arguments as :meth:`~quart.Quart.before_websocket`. It applies to all requests to the app this blueprint is registered o...
def function[before_app_websocket, parameter[self, func]]: constant[Add a before request websocket to the App. This is designed to be used as a decorator, and has the same arguments as :meth:`~quart.Quart.before_websocket`. It applies to all requests to the app this blueprint is registe...
keyword[def] identifier[before_app_websocket] ( identifier[self] , identifier[func] : identifier[Callable] )-> identifier[Callable] : literal[string] identifier[self] . identifier[record_once] ( keyword[lambda] identifier[state] : identifier[state] . identifier[app] . identifier[before_websocket] ...
def before_app_websocket(self, func: Callable) -> Callable: """Add a before request websocket to the App. This is designed to be used as a decorator, and has the same arguments as :meth:`~quart.Quart.before_websocket`. It applies to all requests to the app this blueprint is registered on. A...
def get_elasticsearch_info(): """Check Elasticsearch connection.""" from elasticsearch import ( Elasticsearch, ConnectionError as ESConnectionError ) if hasattr(settings, 'ELASTICSEARCH_URL'): url = settings.ELASTICSEARCH_URL else: return {"status": NO_CONFIG} sta...
def function[get_elasticsearch_info, parameter[]]: constant[Check Elasticsearch connection.] from relative_module[elasticsearch] import module[Elasticsearch], module[ConnectionError] if call[name[hasattr], parameter[name[settings], constant[ELASTICSEARCH_URL]]] begin[:] variable[url]...
keyword[def] identifier[get_elasticsearch_info] (): literal[string] keyword[from] identifier[elasticsearch] keyword[import] ( identifier[Elasticsearch] , identifier[ConnectionError] keyword[as] identifier[ESConnectionError] ) keyword[if] identifier[hasattr] ( identifier[settings] ,...
def get_elasticsearch_info(): """Check Elasticsearch connection.""" from elasticsearch import Elasticsearch, ConnectionError as ESConnectionError if hasattr(settings, 'ELASTICSEARCH_URL'): url = settings.ELASTICSEARCH_URL # depends on [control=['if'], data=[]] else: return {'status': NO...
def find_particles_in_tile(positions, tile): """ Finds the particles in a tile, as numpy.ndarray of ints. Parameters ---------- positions : `numpy.ndarray` [N,3] array of the particle positions to check in the tile tile : :class:`peri.util.Tile` instance Tile of ...
def function[find_particles_in_tile, parameter[positions, tile]]: constant[ Finds the particles in a tile, as numpy.ndarray of ints. Parameters ---------- positions : `numpy.ndarray` [N,3] array of the particle positions to check in the tile tile : :class:`peri.util.Tile...
keyword[def] identifier[find_particles_in_tile] ( identifier[positions] , identifier[tile] ): literal[string] identifier[bools] = identifier[tile] . identifier[contains] ( identifier[positions] ) keyword[return] identifier[np] . identifier[arange] ( identifier[bools] . identifier[size] )[ identifier[...
def find_particles_in_tile(positions, tile): """ Finds the particles in a tile, as numpy.ndarray of ints. Parameters ---------- positions : `numpy.ndarray` [N,3] array of the particle positions to check in the tile tile : :class:`peri.util.Tile` instance Tile of ...
def expand_brackets(s): """Remove whitespace and expand all brackets.""" s = ''.join(s.split()) while True: start = s.find('(') if start == -1: break count = 1 # Number of hanging open brackets p = start + 1 while p < len(s): if s[p] == '(': ...
def function[expand_brackets, parameter[s]]: constant[Remove whitespace and expand all brackets.] variable[s] assign[=] call[constant[].join, parameter[call[name[s].split, parameter[]]]] while constant[True] begin[:] variable[start] assign[=] call[name[s].find, parameter[constant...
keyword[def] identifier[expand_brackets] ( identifier[s] ): literal[string] identifier[s] = literal[string] . identifier[join] ( identifier[s] . identifier[split] ()) keyword[while] keyword[True] : identifier[start] = identifier[s] . identifier[find] ( literal[string] ) keyword[if] ...
def expand_brackets(s): """Remove whitespace and expand all brackets.""" s = ''.join(s.split()) while True: start = s.find('(') if start == -1: break # depends on [control=['if'], data=[]] count = 1 # Number of hanging open brackets p = start + 1 while p...
def numdiff2(f, x0, dv=1e-8): '''Returns the derivative of f w.r.t. to multidimensional vector x0 If x0 is of dimension R1 x ... x Rd dimension of f is assumed to be in the form S1 x ... x Sf x Rn. The last dimension corresponds to various observations. The value returned is of dimension : S1 x ... x Sf x R1 x ... ...
def function[numdiff2, parameter[f, x0, dv]]: constant[Returns the derivative of f w.r.t. to multidimensional vector x0 If x0 is of dimension R1 x ... x Rd dimension of f is assumed to be in the form S1 x ... x Sf x Rn. The last dimension corresponds to various observations. The value returned is of dimension :...
keyword[def] identifier[numdiff2] ( identifier[f] , identifier[x0] , identifier[dv] = literal[int] ): literal[string] identifier[dd] = identifier[x0] . identifier[shape] identifier[f0] = identifier[f] ( identifier[x0] ) identifier[nobs] = identifier[f0] . identifier[shape] [- literal[int] ] ...
def numdiff2(f, x0, dv=1e-08): """Returns the derivative of f w.r.t. to multidimensional vector x0 If x0 is of dimension R1 x ... x Rd dimension of f is assumed to be in the form S1 x ... x Sf x Rn. The last dimension corresponds to various observations. The value returned is of dimension : S1 x ... x Sf x R1 x ......
def _run_program(self, bin, fastafile, params=None): """ Run MotifSampler and predict motifs from a FASTA file. Parameters ---------- bin : str Command used to run the tool. fastafile : str Name of the FASTA input file. params : ...
def function[_run_program, parameter[self, bin, fastafile, params]]: constant[ Run MotifSampler and predict motifs from a FASTA file. Parameters ---------- bin : str Command used to run the tool. fastafile : str Name of the FASTA input fi...
keyword[def] identifier[_run_program] ( identifier[self] , identifier[bin] , identifier[fastafile] , identifier[params] = keyword[None] ): literal[string] identifier[params] = identifier[self] . identifier[_parse_params] ( identifier[params] ) identifier[cmd] = literal[st...
def _run_program(self, bin, fastafile, params=None): """ Run MotifSampler and predict motifs from a FASTA file. Parameters ---------- bin : str Command used to run the tool. fastafile : str Name of the FASTA input file. params : dict...
def uclus(a, b, distance_function): """ Given two collections ``a`` and ``b``, this will return the *median* of all distances. ``distance_function`` is used to determine the distance between two elements. Example:: >>> single([1, 2], [3, 100], lambda x, y: abs(x-y)) 2.5 """ ...
def function[uclus, parameter[a, b, distance_function]]: constant[ Given two collections ``a`` and ``b``, this will return the *median* of all distances. ``distance_function`` is used to determine the distance between two elements. Example:: >>> single([1, 2], [3, 100], lambda x, y: ab...
keyword[def] identifier[uclus] ( identifier[a] , identifier[b] , identifier[distance_function] ): literal[string] identifier[distances] = identifier[sorted] ([ identifier[distance_function] ( identifier[x] , identifier[y] ) keyword[for] identifier[x] keyword[in] identifier[a] keyword[for] identif...
def uclus(a, b, distance_function): """ Given two collections ``a`` and ``b``, this will return the *median* of all distances. ``distance_function`` is used to determine the distance between two elements. Example:: >>> single([1, 2], [3, 100], lambda x, y: abs(x-y)) 2.5 """ ...
def optimal_distribution(data, distr_to_check=('norm', 'expon', 'uniform')): '''Calculate the parameters of a fit of different distributions to a data set and returns the distribution of the minimal ks-distance. Parameters: data: array of data points to be fitted Options: distr_to_c...
def function[optimal_distribution, parameter[data, distr_to_check]]: constant[Calculate the parameters of a fit of different distributions to a data set and returns the distribution of the minimal ks-distance. Parameters: data: array of data points to be fitted Options: distr_to...
keyword[def] identifier[optimal_distribution] ( identifier[data] , identifier[distr_to_check] =( literal[string] , literal[string] , literal[string] )): literal[string] identifier[fit_results] =[ identifier[fit] ( identifier[data] , identifier[d] ) keyword[for] identifier[d] keyword[in] identifier[distr...
def optimal_distribution(data, distr_to_check=('norm', 'expon', 'uniform')): """Calculate the parameters of a fit of different distributions to a data set and returns the distribution of the minimal ks-distance. Parameters: data: array of data points to be fitted Options: distr_to_c...
def memory_read32(self, addr, num_words, zone=None): """Reads memory from the target system in units of 32-bits. Args: self (JLink): the ``JLink`` instance addr (int): start address to read from num_words (int): number of words to read zone (str): memory zone to ...
def function[memory_read32, parameter[self, addr, num_words, zone]]: constant[Reads memory from the target system in units of 32-bits. Args: self (JLink): the ``JLink`` instance addr (int): start address to read from num_words (int): number of words to read zone ...
keyword[def] identifier[memory_read32] ( identifier[self] , identifier[addr] , identifier[num_words] , identifier[zone] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[memory_read] ( identifier[addr] , identifier[num_words] , identifier[zone] = identifier[zone] , i...
def memory_read32(self, addr, num_words, zone=None): """Reads memory from the target system in units of 32-bits. Args: self (JLink): the ``JLink`` instance addr (int): start address to read from num_words (int): number of words to read zone (str): memory zone to read...
def make_timestamp(el_time): """ Generate an hour-minutes-seconds timestamp from an interval in seconds. Assumes numeric input of a time interval in seconds. Converts this interval to a string of the format "#h #m #s", indicating the number of hours, minutes, and seconds in the interval. Intervals gr...
def function[make_timestamp, parameter[el_time]]: constant[ Generate an hour-minutes-seconds timestamp from an interval in seconds. Assumes numeric input of a time interval in seconds. Converts this interval to a string of the format "#h #m #s", indicating the number of hours, minutes, and seconds...
keyword[def] identifier[make_timestamp] ( identifier[el_time] ): literal[string] identifier[hrs] = identifier[el_time] // literal[int] identifier[mins] =( identifier[el_time] % literal[int] )// literal[int] identifier[secs] = identifier[el_time] % literal[int] iden...
def make_timestamp(el_time): """ Generate an hour-minutes-seconds timestamp from an interval in seconds. Assumes numeric input of a time interval in seconds. Converts this interval to a string of the format "#h #m #s", indicating the number of hours, minutes, and seconds in the interval. Intervals gr...
def auto_memoize(func): """ Based on django.util.functional.memoize. Automatically memoizes instace methods for the lifespan of an object. Only works with methods taking non-keword arguments. Note that the args to the function must be usable as dictionary keys. Also, the first argument MUST be self. Thi...
def function[auto_memoize, parameter[func]]: constant[ Based on django.util.functional.memoize. Automatically memoizes instace methods for the lifespan of an object. Only works with methods taking non-keword arguments. Note that the args to the function must be usable as dictionary keys. Also, the f...
keyword[def] identifier[auto_memoize] ( identifier[func] ): literal[string] @ identifier[wraps] ( identifier[func] ) keyword[def] identifier[wrapper] (* identifier[args] ): identifier[inst] = identifier[args] [ literal[int] ] identifier[inst] . identifier[_memoized_values] = identif...
def auto_memoize(func): """ Based on django.util.functional.memoize. Automatically memoizes instace methods for the lifespan of an object. Only works with methods taking non-keword arguments. Note that the args to the function must be usable as dictionary keys. Also, the first argument MUST be self. Thi...
def list(gandi, id, altnames, csr, cert, all_status, status, dates, limit): """ List certificates. """ options = {'items_per_page': limit} if not all_status: options['status'] = ['valid', 'pending'] output_keys = ['cn', 'plan'] if id: output_keys.append('id') if status: ...
def function[list, parameter[gandi, id, altnames, csr, cert, all_status, status, dates, limit]]: constant[ List certificates. ] variable[options] assign[=] dictionary[[<ast.Constant object at 0x7da18eb54f10>], [<ast.Name object at 0x7da18eb54220>]] if <ast.UnaryOp object at 0x7da18eb57010> begin...
keyword[def] identifier[list] ( identifier[gandi] , identifier[id] , identifier[altnames] , identifier[csr] , identifier[cert] , identifier[all_status] , identifier[status] , identifier[dates] , identifier[limit] ): literal[string] identifier[options] ={ literal[string] : identifier[limit] } keyword[...
def list(gandi, id, altnames, csr, cert, all_status, status, dates, limit): """ List certificates. """ options = {'items_per_page': limit} if not all_status: options['status'] = ['valid', 'pending'] # depends on [control=['if'], data=[]] output_keys = ['cn', 'plan'] if id: output_ke...
def _int(int_or_str: Any) -> int: "return an integer where a single character string may be expected" if isinstance(int_or_str, str): return ord(int_or_str) if isinstance(int_or_str, bytes): return int_or_str[0] return int(int_or_str)
def function[_int, parameter[int_or_str]]: constant[return an integer where a single character string may be expected] if call[name[isinstance], parameter[name[int_or_str], name[str]]] begin[:] return[call[name[ord], parameter[name[int_or_str]]]] if call[name[isinstance], parameter[name[...
keyword[def] identifier[_int] ( identifier[int_or_str] : identifier[Any] )-> identifier[int] : literal[string] keyword[if] identifier[isinstance] ( identifier[int_or_str] , identifier[str] ): keyword[return] identifier[ord] ( identifier[int_or_str] ) keyword[if] identifier[isinstance] ( id...
def _int(int_or_str: Any) -> int: """return an integer where a single character string may be expected""" if isinstance(int_or_str, str): return ord(int_or_str) # depends on [control=['if'], data=[]] if isinstance(int_or_str, bytes): return int_or_str[0] # depends on [control=['if'], data=...
def unindex_objects(mapping_type, ids, es=None, index=None): """Remove documents of a specified mapping_type from the index. This allows for asynchronous deleting. If a mapping_type extends Indexable, you can add a ``pre_delete`` hook for the model that it's based on like this:: @receiver(dbs...
def function[unindex_objects, parameter[mapping_type, ids, es, index]]: constant[Remove documents of a specified mapping_type from the index. This allows for asynchronous deleting. If a mapping_type extends Indexable, you can add a ``pre_delete`` hook for the model that it's based on like this:: ...
keyword[def] identifier[unindex_objects] ( identifier[mapping_type] , identifier[ids] , identifier[es] = keyword[None] , identifier[index] = keyword[None] ): literal[string] keyword[if] identifier[settings] . identifier[ES_DISABLED] : keyword[return] keyword[for] identifier[id_] keyword[...
def unindex_objects(mapping_type, ids, es=None, index=None): """Remove documents of a specified mapping_type from the index. This allows for asynchronous deleting. If a mapping_type extends Indexable, you can add a ``pre_delete`` hook for the model that it's based on like this:: @receiver(dbs...
def _selu(attrs, inputs, proto_obj): """Selu function""" new_attrs = translation_utils._add_extra_attributes(attrs, {'act_type': 'selu'}) return 'LeakyReLU', new_attrs, inputs
def function[_selu, parameter[attrs, inputs, proto_obj]]: constant[Selu function] variable[new_attrs] assign[=] call[name[translation_utils]._add_extra_attributes, parameter[name[attrs], dictionary[[<ast.Constant object at 0x7da1b2029ba0>], [<ast.Constant object at 0x7da1b202a740>]]]] return[tuple[[...
keyword[def] identifier[_selu] ( identifier[attrs] , identifier[inputs] , identifier[proto_obj] ): literal[string] identifier[new_attrs] = identifier[translation_utils] . identifier[_add_extra_attributes] ( identifier[attrs] ,{ literal[string] : literal[string] }) keyword[return] literal[string] , id...
def _selu(attrs, inputs, proto_obj): """Selu function""" new_attrs = translation_utils._add_extra_attributes(attrs, {'act_type': 'selu'}) return ('LeakyReLU', new_attrs, inputs)
def insert_cylinder(im, xyz0, xyz1, r): r""" Inserts a cylinder of given radius onto a given image Parameters ---------- im : array_like Original voxelated image xyz0, xyz1 : 3-by-1 array_like Voxel coordinates of the two end points of the cylinder r : int Radius of ...
def function[insert_cylinder, parameter[im, xyz0, xyz1, r]]: constant[ Inserts a cylinder of given radius onto a given image Parameters ---------- im : array_like Original voxelated image xyz0, xyz1 : 3-by-1 array_like Voxel coordinates of the two end points of the cylinder ...
keyword[def] identifier[insert_cylinder] ( identifier[im] , identifier[xyz0] , identifier[xyz1] , identifier[r] ): literal[string] keyword[if] identifier[im] . identifier[ndim] != literal[int] : keyword[raise] identifier[Exception] ( literal[string] ) identifier[xyz0] , identifier[...
def insert_cylinder(im, xyz0, xyz1, r): """ Inserts a cylinder of given radius onto a given image Parameters ---------- im : array_like Original voxelated image xyz0, xyz1 : 3-by-1 array_like Voxel coordinates of the two end points of the cylinder r : int Radius of t...
def _get_filters(nodes, context): """Get filters to apply to a list of SqlNodes. Args: nodes: List[SqlNode], the SqlNodes to get filters for. context: CompilationContext, global compilation state and metadata. Returns: List[Expression], list of SQLAlchemy expressions. """ f...
def function[_get_filters, parameter[nodes, context]]: constant[Get filters to apply to a list of SqlNodes. Args: nodes: List[SqlNode], the SqlNodes to get filters for. context: CompilationContext, global compilation state and metadata. Returns: List[Expression], list of SQLAlc...
keyword[def] identifier[_get_filters] ( identifier[nodes] , identifier[context] ): literal[string] identifier[filters] =[] keyword[for] identifier[node] keyword[in] identifier[nodes] : keyword[for] identifier[filter_block] keyword[in] identifier[sql_context_helpers] . identifier[get_fil...
def _get_filters(nodes, context): """Get filters to apply to a list of SqlNodes. Args: nodes: List[SqlNode], the SqlNodes to get filters for. context: CompilationContext, global compilation state and metadata. Returns: List[Expression], list of SQLAlchemy expressions. """ f...
def set_item(key,value): """Write JSON content from value argument to cached file and return""" CACHED_KEY_FILE = os.path.join(CURRENT_DIR, key) open(CACHED_KEY_FILE, "wb").write(json.dumps({"_": value}).encode('UTF-8')) return value
def function[set_item, parameter[key, value]]: constant[Write JSON content from value argument to cached file and return] variable[CACHED_KEY_FILE] assign[=] call[name[os].path.join, parameter[name[CURRENT_DIR], name[key]]] call[call[name[open], parameter[name[CACHED_KEY_FILE], constant[wb]]].wr...
keyword[def] identifier[set_item] ( identifier[key] , identifier[value] ): literal[string] identifier[CACHED_KEY_FILE] = identifier[os] . identifier[path] . identifier[join] ( identifier[CURRENT_DIR] , identifier[key] ) identifier[open] ( identifier[CACHED_KEY_FILE] , literal[string] ). identifie...
def set_item(key, value): """Write JSON content from value argument to cached file and return""" CACHED_KEY_FILE = os.path.join(CURRENT_DIR, key) open(CACHED_KEY_FILE, 'wb').write(json.dumps({'_': value}).encode('UTF-8')) return value
def add_extra_chain_cert(self, certobj): """ Add certificate to chain :param certobj: The X509 certificate object to add to the chain :return: None """ if not isinstance(certobj, X509): raise TypeError("certobj must be an X509 instance") copy = _lib....
def function[add_extra_chain_cert, parameter[self, certobj]]: constant[ Add certificate to chain :param certobj: The X509 certificate object to add to the chain :return: None ] if <ast.UnaryOp object at 0x7da1b025a650> begin[:] <ast.Raise object at 0x7da1b0259870...
keyword[def] identifier[add_extra_chain_cert] ( identifier[self] , identifier[certobj] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[certobj] , identifier[X509] ): keyword[raise] identifier[TypeError] ( literal[string] ) identifier[copy] =...
def add_extra_chain_cert(self, certobj): """ Add certificate to chain :param certobj: The X509 certificate object to add to the chain :return: None """ if not isinstance(certobj, X509): raise TypeError('certobj must be an X509 instance') # depends on [control=['if'], da...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'response_type') and self.response_type is not None: _dict['response_type'] = self.response_type if hasattr(self, 'text') and self.text is not None: _dict['text...
def function[_to_dict, parameter[self]]: constant[Return a json dictionary representing this model.] variable[_dict] assign[=] dictionary[[], []] if <ast.BoolOp object at 0x7da1b2347af0> begin[:] call[name[_dict]][constant[response_type]] assign[=] name[self].response_type ...
keyword[def] identifier[_to_dict] ( identifier[self] ): literal[string] identifier[_dict] ={} keyword[if] identifier[hasattr] ( identifier[self] , literal[string] ) keyword[and] identifier[self] . identifier[response_type] keyword[is] keyword[not] keyword[None] : identifi...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'response_type') and self.response_type is not None: _dict['response_type'] = self.response_type # depends on [control=['if'], data=[]] if hasattr(self, 'text') and self.text is not None: ...
def update_H(self, mean_field, l): """Updates the spin hamiltonian and recalculates its eigenbasis""" self.H_s = self.spin_hamiltonian(mean_field, l) try: self.eig_energies, self.eig_states = diagonalize(self.H_s) except np.linalg.linalg.LinAlgError: np.savez('er...
def function[update_H, parameter[self, mean_field, l]]: constant[Updates the spin hamiltonian and recalculates its eigenbasis] name[self].H_s assign[=] call[name[self].spin_hamiltonian, parameter[name[mean_field], name[l]]] <ast.Try object at 0x7da18fe91bd0>
keyword[def] identifier[update_H] ( identifier[self] , identifier[mean_field] , identifier[l] ): literal[string] identifier[self] . identifier[H_s] = identifier[self] . identifier[spin_hamiltonian] ( identifier[mean_field] , identifier[l] ) keyword[try] : identifier[self] . i...
def update_H(self, mean_field, l): """Updates the spin hamiltonian and recalculates its eigenbasis""" self.H_s = self.spin_hamiltonian(mean_field, l) try: (self.eig_energies, self.eig_states) = diagonalize(self.H_s) # depends on [control=['try'], data=[]] except np.linalg.linalg.LinAlgError: ...
def convert_environment(datadir, version, always_yes): """ Converts an environment TO the version specified by `version`. :param datadir: The datadir to convert. :param version: The version to convert TO. :param always_yes: True if the user shouldn't be prompted about the migration. """ # Si...
def function[convert_environment, parameter[datadir, version, always_yes]]: constant[ Converts an environment TO the version specified by `version`. :param datadir: The datadir to convert. :param version: The version to convert TO. :param always_yes: True if the user shouldn't be prompted about ...
keyword[def] identifier[convert_environment] ( identifier[datadir] , identifier[version] , identifier[always_yes] ): literal[string] identifier[require_images] () identifier[inp] = keyword[None] identifier[old_version] = identifier[_get_current_format] ( identifier[datadir] ) identifi...
def convert_environment(datadir, version, always_yes): """ Converts an environment TO the version specified by `version`. :param datadir: The datadir to convert. :param version: The version to convert TO. :param always_yes: True if the user shouldn't be prompted about the migration. """ # Si...
def obj(self): """ Returns passed object but if chain method is used returns the last processed result """ if self._wrapped is not self.Null: return self._wrapped else: return self.object
def function[obj, parameter[self]]: constant[ Returns passed object but if chain method is used returns the last processed result ] if compare[name[self]._wrapped is_not name[self].Null] begin[:] return[name[self]._wrapped]
keyword[def] identifier[obj] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_wrapped] keyword[is] keyword[not] identifier[self] . identifier[Null] : keyword[return] identifier[self] . identifier[_wrapped] keyword[else] : keyw...
def obj(self): """ Returns passed object but if chain method is used returns the last processed result """ if self._wrapped is not self.Null: return self._wrapped # depends on [control=['if'], data=[]] else: return self.object
def libvlc_audio_set_format_callbacks(mp, setup, cleanup): '''Set decoded audio format. This only works in combination with L{libvlc_audio_set_callbacks}(). @param mp: the media player. @param setup: callback to select the audio format (cannot be NULL). @param cleanup: callback to release any alloca...
def function[libvlc_audio_set_format_callbacks, parameter[mp, setup, cleanup]]: constant[Set decoded audio format. This only works in combination with L{libvlc_audio_set_callbacks}(). @param mp: the media player. @param setup: callback to select the audio format (cannot be NULL). @param cleanup:...
keyword[def] identifier[libvlc_audio_set_format_callbacks] ( identifier[mp] , identifier[setup] , identifier[cleanup] ): literal[string] identifier[f] = identifier[_Cfunctions] . identifier[get] ( literal[string] , keyword[None] ) keyword[or] identifier[_Cfunction] ( literal[string] ,(( literal[int] ,),( ...
def libvlc_audio_set_format_callbacks(mp, setup, cleanup): """Set decoded audio format. This only works in combination with L{libvlc_audio_set_callbacks}(). @param mp: the media player. @param setup: callback to select the audio format (cannot be NULL). @param cleanup: callback to release any alloca...
def path_exists(path): """ Check if file exists either remote or local. Parameters: ----------- path : path to file Returns: -------- exists : bool """ if path.startswith(("http://", "https://")): try: urlopen(path).info() return True exc...
def function[path_exists, parameter[path]]: constant[ Check if file exists either remote or local. Parameters: ----------- path : path to file Returns: -------- exists : bool ] if call[name[path].startswith, parameter[tuple[[<ast.Constant object at 0x7da1b0016c50>, <ast...
keyword[def] identifier[path_exists] ( identifier[path] ): literal[string] keyword[if] identifier[path] . identifier[startswith] (( literal[string] , literal[string] )): keyword[try] : identifier[urlopen] ( identifier[path] ). identifier[info] () keyword[return] keyword...
def path_exists(path): """ Check if file exists either remote or local. Parameters: ----------- path : path to file Returns: -------- exists : bool """ if path.startswith(('http://', 'https://')): try: urlopen(path).info() return True # depends ...
def bulk_update(manager, model_objs, fields_to_update): """ Bulk updates a list of model objects that are already saved. :type model_objs: list of :class:`Models<django:django.db.models.Model>` :param model_objs: A list of model objects that have been updated. fields_to_update: A list of fields...
def function[bulk_update, parameter[manager, model_objs, fields_to_update]]: constant[ Bulk updates a list of model objects that are already saved. :type model_objs: list of :class:`Models<django:django.db.models.Model>` :param model_objs: A list of model objects that have been updated. fie...
keyword[def] identifier[bulk_update] ( identifier[manager] , identifier[model_objs] , identifier[fields_to_update] ): literal[string] identifier[value_fields] =[ identifier[manager] . identifier[model] . identifier[_meta] . identifier[pk] . identifier[attname] ]+ identifier[fields_to_update] ...
def bulk_update(manager, model_objs, fields_to_update): """ Bulk updates a list of model objects that are already saved. :type model_objs: list of :class:`Models<django:django.db.models.Model>` :param model_objs: A list of model objects that have been updated. fields_to_update: A list of fields...
def delete_all(self, criteria: Q = None): """Delete the dictionary object by its criteria""" if criteria: # Delete the object from the dictionary and return the deletion count items = self._filter(criteria, self.conn['data'][self.schema_name]) # Delete all the matchi...
def function[delete_all, parameter[self, criteria]]: constant[Delete the dictionary object by its criteria] if name[criteria] begin[:] variable[items] assign[=] call[name[self]._filter, parameter[name[criteria], call[call[name[self].conn][constant[data]]][name[self].schema_name]]] ...
keyword[def] identifier[delete_all] ( identifier[self] , identifier[criteria] : identifier[Q] = keyword[None] ): literal[string] keyword[if] identifier[criteria] : identifier[items] = identifier[self] . identifier[_filter] ( identifier[criteria] , identifier[self] . identifie...
def delete_all(self, criteria: Q=None): """Delete the dictionary object by its criteria""" if criteria: # Delete the object from the dictionary and return the deletion count items = self._filter(criteria, self.conn['data'][self.schema_name]) # Delete all the matching identifiers ...
def convert_to_duckling_language_id(cls, lang): """Ensure a language identifier has the correct duckling format and is supported.""" if lang is not None and cls.is_supported(lang): return lang elif lang is not None and cls.is_supported(lang + "$core"): # Support ISO 639-1 Language...
def function[convert_to_duckling_language_id, parameter[cls, lang]]: constant[Ensure a language identifier has the correct duckling format and is supported.] if <ast.BoolOp object at 0x7da2043450c0> begin[:] return[name[lang]]
keyword[def] identifier[convert_to_duckling_language_id] ( identifier[cls] , identifier[lang] ): literal[string] keyword[if] identifier[lang] keyword[is] keyword[not] keyword[None] keyword[and] identifier[cls] . identifier[is_supported] ( identifier[lang] ): keyword[return] ide...
def convert_to_duckling_language_id(cls, lang): """Ensure a language identifier has the correct duckling format and is supported.""" if lang is not None and cls.is_supported(lang): return lang # depends on [control=['if'], data=[]] elif lang is not None and cls.is_supported(lang + '$core'): # Supp...
def MultifactorSchedule(history=None, factors="constant * linear_warmup * rsqrt_decay", constant=0.1, warmup_steps=100, decay_factor=0.5, steps_per_decay=20000): """Factor-based learning rate schedu...
def function[MultifactorSchedule, parameter[history, factors, constant, warmup_steps, decay_factor, steps_per_decay]]: constant[Factor-based learning rate schedule. Interprets factors in the factors string which can consist of: * constant: interpreted as the constant value, * linear_warmup: interpreted a...
keyword[def] identifier[MultifactorSchedule] ( identifier[history] = keyword[None] , identifier[factors] = literal[string] , identifier[constant] = literal[int] , identifier[warmup_steps] = literal[int] , identifier[decay_factor] = literal[int] , identifier[steps_per_decay] = literal[int] ): literal[string] ...
def MultifactorSchedule(history=None, factors='constant * linear_warmup * rsqrt_decay', constant=0.1, warmup_steps=100, decay_factor=0.5, steps_per_decay=20000): """Factor-based learning rate schedule. Interprets factors in the factors string which can consist of: * constant: interpreted as the constant value,...
def _create(archive, compression, cmd, format, verbosity, filenames): """Create an LZMA or XZ archive with the lzma Python module.""" if len(filenames) > 1: raise util.PatoolError('multi-file compression not supported in Python lzma') try: with lzma.LZMAFile(archive, mode='wb', **_get_lzma_o...
def function[_create, parameter[archive, compression, cmd, format, verbosity, filenames]]: constant[Create an LZMA or XZ archive with the lzma Python module.] if compare[call[name[len], parameter[name[filenames]]] greater[>] constant[1]] begin[:] <ast.Raise object at 0x7da1b07ac3d0> <ast.Try...
keyword[def] identifier[_create] ( identifier[archive] , identifier[compression] , identifier[cmd] , identifier[format] , identifier[verbosity] , identifier[filenames] ): literal[string] keyword[if] identifier[len] ( identifier[filenames] )> literal[int] : keyword[raise] identifier[util] . ident...
def _create(archive, compression, cmd, format, verbosity, filenames): """Create an LZMA or XZ archive with the lzma Python module.""" if len(filenames) > 1: raise util.PatoolError('multi-file compression not supported in Python lzma') # depends on [control=['if'], data=[]] try: with lzma.LZ...
def wait(self, timeout=None): """Wait for process to terminate and, if process is a children of the current one also return its exit code, else None. """ if timeout is not None and not timeout >= 0: raise ValueError("timeout must be a positive integer") return self._p...
def function[wait, parameter[self, timeout]]: constant[Wait for process to terminate and, if process is a children of the current one also return its exit code, else None. ] if <ast.BoolOp object at 0x7da1b26aea40> begin[:] <ast.Raise object at 0x7da1b26ae9b0> return[call[nam...
keyword[def] identifier[wait] ( identifier[self] , identifier[timeout] = keyword[None] ): literal[string] keyword[if] identifier[timeout] keyword[is] keyword[not] keyword[None] keyword[and] keyword[not] identifier[timeout] >= literal[int] : keyword[raise] identifier[ValueError]...
def wait(self, timeout=None): """Wait for process to terminate and, if process is a children of the current one also return its exit code, else None. """ if timeout is not None and (not timeout >= 0): raise ValueError('timeout must be a positive integer') # depends on [control=['if'], d...
def get_end_cursor(self, project_name, logstore_name, shard_id): """ Get end cursor from log service for batch pull logs Unsuccessful opertaion will cause an LogException. :type project_name: string :param project_name: the Project name :type logstore_name: string ...
def function[get_end_cursor, parameter[self, project_name, logstore_name, shard_id]]: constant[ Get end cursor from log service for batch pull logs Unsuccessful opertaion will cause an LogException. :type project_name: string :param project_name: the Project name :type logstor...
keyword[def] identifier[get_end_cursor] ( identifier[self] , identifier[project_name] , identifier[logstore_name] , identifier[shard_id] ): literal[string] keyword[return] identifier[self] . identifier[get_cursor] ( identifier[project_name] , identifier[logstore_name] , identifier[shard_id] , li...
def get_end_cursor(self, project_name, logstore_name, shard_id): """ Get end cursor from log service for batch pull logs Unsuccessful opertaion will cause an LogException. :type project_name: string :param project_name: the Project name :type logstore_name: string :param l...
def uninitialize_ui(self): """ Uninitializes the Component ui. :return: Method success. :rtype: bool """ LOGGER.debug("> Uninitializing '{0}' Component ui.".format(self.__class__.__name__)) # Signals / Slots. self.Port_spinBox.valueChanged.disconnect(se...
def function[uninitialize_ui, parameter[self]]: constant[ Uninitializes the Component ui. :return: Method success. :rtype: bool ] call[name[LOGGER].debug, parameter[call[constant[> Uninitializing '{0}' Component ui.].format, parameter[name[self].__class__.__name__]]]] ...
keyword[def] identifier[uninitialize_ui] ( identifier[self] ): literal[string] identifier[LOGGER] . identifier[debug] ( literal[string] . identifier[format] ( identifier[self] . identifier[__class__] . identifier[__name__] )) identifier[self] . identifier[Port_spinBox] . identif...
def uninitialize_ui(self): """ Uninitializes the Component ui. :return: Method success. :rtype: bool """ LOGGER.debug("> Uninitializing '{0}' Component ui.".format(self.__class__.__name__)) # Signals / Slots. self.Port_spinBox.valueChanged.disconnect(self.__Port_spinBox_...
def shutdown(exiting_interpreter=False): """Disconnect the worker, and terminate processes started by ray.init(). This will automatically run at the end when a Python process that uses Ray exits. It is ok to run this twice in a row. The primary use case for this function is to cleanup state between tes...
def function[shutdown, parameter[exiting_interpreter]]: constant[Disconnect the worker, and terminate processes started by ray.init(). This will automatically run at the end when a Python process that uses Ray exits. It is ok to run this twice in a row. The primary use case for this function is to ...
keyword[def] identifier[shutdown] ( identifier[exiting_interpreter] = keyword[False] ): literal[string] keyword[if] identifier[exiting_interpreter] keyword[and] identifier[global_worker] . identifier[mode] == identifier[SCRIPT_MODE] : identifier[time] . identifier[sleep] ( literal[int...
def shutdown(exiting_interpreter=False): """Disconnect the worker, and terminate processes started by ray.init(). This will automatically run at the end when a Python process that uses Ray exits. It is ok to run this twice in a row. The primary use case for this function is to cleanup state between tes...
def get_default_redirect_uri(self, client_id, request, *args, **kwargs): """Default redirect_uri for the given client.""" request.client = request.client or self._clientgetter(client_id) redirect_uri = request.client.default_redirect_uri log.debug('Found default redirect uri %r', redirec...
def function[get_default_redirect_uri, parameter[self, client_id, request]]: constant[Default redirect_uri for the given client.] name[request].client assign[=] <ast.BoolOp object at 0x7da1b0247640> variable[redirect_uri] assign[=] name[request].client.default_redirect_uri call[name[log]...
keyword[def] identifier[get_default_redirect_uri] ( identifier[self] , identifier[client_id] , identifier[request] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[request] . identifier[client] = identifier[request] . identifier[client] keyword[or] identifier[self] . ident...
def get_default_redirect_uri(self, client_id, request, *args, **kwargs): """Default redirect_uri for the given client.""" request.client = request.client or self._clientgetter(client_id) redirect_uri = request.client.default_redirect_uri log.debug('Found default redirect uri %r', redirect_uri) retur...