code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def index_collection(self, filenames): "Index a whole collection of files." for filename in filenames: self.index_document(open(filename).read(), filename)
def function[index_collection, parameter[self, filenames]]: constant[Index a whole collection of files.] for taget[name[filename]] in starred[name[filenames]] begin[:] call[name[self].index_document, parameter[call[call[name[open], parameter[name[filename]]].read, parameter[]], name[file...
keyword[def] identifier[index_collection] ( identifier[self] , identifier[filenames] ): literal[string] keyword[for] identifier[filename] keyword[in] identifier[filenames] : identifier[self] . identifier[index_document] ( identifier[open] ( identifier[filename] ). identifier[read] (...
def index_collection(self, filenames): """Index a whole collection of files.""" for filename in filenames: self.index_document(open(filename).read(), filename) # depends on [control=['for'], data=['filename']]
def active(self): """ Returns the count of non-skipped actors. :return: the count :rtype: int """ result = 0 for actor in self.actors: if not actor.skip: result += 1 return result
def function[active, parameter[self]]: constant[ Returns the count of non-skipped actors. :return: the count :rtype: int ] variable[result] assign[=] constant[0] for taget[name[actor]] in starred[name[self].actors] begin[:] if <ast.UnaryOp object ...
keyword[def] identifier[active] ( identifier[self] ): literal[string] identifier[result] = literal[int] keyword[for] identifier[actor] keyword[in] identifier[self] . identifier[actors] : keyword[if] keyword[not] identifier[actor] . identifier[skip] : ide...
def active(self): """ Returns the count of non-skipped actors. :return: the count :rtype: int """ result = 0 for actor in self.actors: if not actor.skip: result += 1 # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['actor']] ...
def random_expr(depth, vlist, ops): """Generate a random expression tree. Args: depth: At least one leaf will be this many levels down from the top. vlist: A list of chars. These chars are randomly selected as leaf values. ops: A list of ExprOp instances. Returns: An ExprNode instance which is t...
def function[random_expr, parameter[depth, vlist, ops]]: constant[Generate a random expression tree. Args: depth: At least one leaf will be this many levels down from the top. vlist: A list of chars. These chars are randomly selected as leaf values. ops: A list of ExprOp instances. Returns: ...
keyword[def] identifier[random_expr] ( identifier[depth] , identifier[vlist] , identifier[ops] ): literal[string] keyword[if] keyword[not] identifier[depth] : keyword[return] identifier[str] ( identifier[vlist] [ identifier[random] . identifier[randrange] ( identifier[len] ( identifier[vlist] ))]) ...
def random_expr(depth, vlist, ops): """Generate a random expression tree. Args: depth: At least one leaf will be this many levels down from the top. vlist: A list of chars. These chars are randomly selected as leaf values. ops: A list of ExprOp instances. Returns: An ExprNode instance which is...
def disableTemperature(self): """ Specifies the device should NOT write temperature values to the FIFO, is not applied until enableFIFO is called. :return: """ logger.debug("Disabling temperature sensor") self.fifoSensorMask &= ~self.enableTemperatureMask self._s...
def function[disableTemperature, parameter[self]]: constant[ Specifies the device should NOT write temperature values to the FIFO, is not applied until enableFIFO is called. :return: ] call[name[logger].debug, parameter[constant[Disabling temperature sensor]]] <ast.AugAssign...
keyword[def] identifier[disableTemperature] ( identifier[self] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] ) identifier[self] . identifier[fifoSensorMask] &=~ identifier[self] . identifier[enableTemperatureMask] identifier[self] . identifier[_setSa...
def disableTemperature(self): """ Specifies the device should NOT write temperature values to the FIFO, is not applied until enableFIFO is called. :return: """ logger.debug('Disabling temperature sensor') self.fifoSensorMask &= ~self.enableTemperatureMask self._setSampleSizeByte...
def save_data(X, y, path): """Save data as a CSV, LibSVM or HDF5 file based on the file extension. Args: X (numpy or scipy sparse matrix): Data matrix y (numpy array): Target vector. If None, all zero vector will be saved. path (str): Path to the CSV, LibSVM or HDF5 file to save data. ...
def function[save_data, parameter[X, y, path]]: constant[Save data as a CSV, LibSVM or HDF5 file based on the file extension. Args: X (numpy or scipy sparse matrix): Data matrix y (numpy array): Target vector. If None, all zero vector will be saved. path (str): Path to the CSV, LibS...
keyword[def] identifier[save_data] ( identifier[X] , identifier[y] , identifier[path] ): literal[string] identifier[catalog] ={ literal[string] : identifier[save_csv] , literal[string] : identifier[save_libsvm] , literal[string] : identifier[save_hdf5] } identifier[ext] = identifier[os] . identifier[...
def save_data(X, y, path): """Save data as a CSV, LibSVM or HDF5 file based on the file extension. Args: X (numpy or scipy sparse matrix): Data matrix y (numpy array): Target vector. If None, all zero vector will be saved. path (str): Path to the CSV, LibSVM or HDF5 file to save data. ...
def hashes_match(self, dep_tree): """ Compares the app deptree file hashes with the hashes stored in the cache. """ hashes = self.get_hashes() for module, info in dep_tree.items(): md5 = self.get_hash(info['path']) if md5 != hashes[info['path']]: ...
def function[hashes_match, parameter[self, dep_tree]]: constant[ Compares the app deptree file hashes with the hashes stored in the cache. ] variable[hashes] assign[=] call[name[self].get_hashes, parameter[]] for taget[tuple[[<ast.Name object at 0x7da1b025f070>, <ast.Name...
keyword[def] identifier[hashes_match] ( identifier[self] , identifier[dep_tree] ): literal[string] identifier[hashes] = identifier[self] . identifier[get_hashes] () keyword[for] identifier[module] , identifier[info] keyword[in] identifier[dep_tree] . identifier[items] (): i...
def hashes_match(self, dep_tree): """ Compares the app deptree file hashes with the hashes stored in the cache. """ hashes = self.get_hashes() for (module, info) in dep_tree.items(): md5 = self.get_hash(info['path']) if md5 != hashes[info['path']]: return ...
def regex(pattern, prompt=None, empty=False, flags=0): """Prompt a string that matches a regular expression. Parameters ---------- pattern : str A regular expression that must be matched. prompt : str, optional Use an alternative prompt. empty : bool, optional Allow an e...
def function[regex, parameter[pattern, prompt, empty, flags]]: constant[Prompt a string that matches a regular expression. Parameters ---------- pattern : str A regular expression that must be matched. prompt : str, optional Use an alternative prompt. empty : bool, optional ...
keyword[def] identifier[regex] ( identifier[pattern] , identifier[prompt] = keyword[None] , identifier[empty] = keyword[False] , identifier[flags] = literal[int] ): literal[string] identifier[s] = identifier[_prompt_input] ( identifier[prompt] ) keyword[if] identifier[empty] keyword[and] keyword[no...
def regex(pattern, prompt=None, empty=False, flags=0): """Prompt a string that matches a regular expression. Parameters ---------- pattern : str A regular expression that must be matched. prompt : str, optional Use an alternative prompt. empty : bool, optional Allow an e...
def call(self, request=None, *args, **kwargs): """ Calls multiple time - with retry. :param request: :return: response """ if request is not None: self.request = request retry = self.request.configuration.retry if not isinstance(retry, Simple...
def function[call, parameter[self, request]]: constant[ Calls multiple time - with retry. :param request: :return: response ] if compare[name[request] is_not constant[None]] begin[:] name[self].request assign[=] name[request] variable[retry] assig...
keyword[def] identifier[call] ( identifier[self] , identifier[request] = keyword[None] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[request] keyword[is] keyword[not] keyword[None] : identifier[self] . identifier[request] = identifier[request]...
def call(self, request=None, *args, **kwargs): """ Calls multiple time - with retry. :param request: :return: response """ if request is not None: self.request = request # depends on [control=['if'], data=['request']] retry = self.request.configuration.retry if ...
def unwrap(self): """ Unwrapping the inspector based on the type """ if self.args_type == "MODULE_FUNCTION": setattr(self.obj, self.prop, self.orig_func) elif self.args_type == "MODULE": delattr(self.obj, "__SINONLOCK__") elif self.args_type == "FU...
def function[unwrap, parameter[self]]: constant[ Unwrapping the inspector based on the type ] if compare[name[self].args_type equal[==] constant[MODULE_FUNCTION]] begin[:] call[name[setattr], parameter[name[self].obj, name[self].prop, name[self].orig_func]]
keyword[def] identifier[unwrap] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[args_type] == literal[string] : identifier[setattr] ( identifier[self] . identifier[obj] , identifier[self] . identifier[prop] , identifier[self] . identifier[orig_func] ) ...
def unwrap(self): """ Unwrapping the inspector based on the type """ if self.args_type == 'MODULE_FUNCTION': setattr(self.obj, self.prop, self.orig_func) # depends on [control=['if'], data=[]] elif self.args_type == 'MODULE': delattr(self.obj, '__SINONLOCK__') # depends on ...
def get_roots(self): """ Returns a list of roots of the graph. Examples -------- >>> from pgmpy.base import DAG >>> graph = DAG([('A', 'B'), ('B', 'C'), ('B', 'D'), ('E', 'B')]) >>> graph.get_roots() ['A', 'E'] """ return [node for node, i...
def function[get_roots, parameter[self]]: constant[ Returns a list of roots of the graph. Examples -------- >>> from pgmpy.base import DAG >>> graph = DAG([('A', 'B'), ('B', 'C'), ('B', 'D'), ('E', 'B')]) >>> graph.get_roots() ['A', 'E'] ] ret...
keyword[def] identifier[get_roots] ( identifier[self] ): literal[string] keyword[return] [ identifier[node] keyword[for] identifier[node] , identifier[in_degree] keyword[in] identifier[dict] ( identifier[self] . identifier[in_degree] ()). identifier[items] () keyword[if] identifier[in_degree] ...
def get_roots(self): """ Returns a list of roots of the graph. Examples -------- >>> from pgmpy.base import DAG >>> graph = DAG([('A', 'B'), ('B', 'C'), ('B', 'D'), ('E', 'B')]) >>> graph.get_roots() ['A', 'E'] """ return [node for (node, in_degre...
def from_pb(cls, app_profile_pb, instance): """Creates an instance app_profile from a protobuf. :type app_profile_pb: :class:`instance_pb2.app_profile_pb` :param app_profile_pb: An instance protobuf object. :type instance: :class:`google.cloud.bigtable.instance.Instance` :param...
def function[from_pb, parameter[cls, app_profile_pb, instance]]: constant[Creates an instance app_profile from a protobuf. :type app_profile_pb: :class:`instance_pb2.app_profile_pb` :param app_profile_pb: An instance protobuf object. :type instance: :class:`google.cloud.bigtable.instan...
keyword[def] identifier[from_pb] ( identifier[cls] , identifier[app_profile_pb] , identifier[instance] ): literal[string] identifier[match_app_profile_name] = identifier[_APP_PROFILE_NAME_RE] . identifier[match] ( identifier[app_profile_pb] . identifier[name] ) keyword[if] identifier[matc...
def from_pb(cls, app_profile_pb, instance): """Creates an instance app_profile from a protobuf. :type app_profile_pb: :class:`instance_pb2.app_profile_pb` :param app_profile_pb: An instance protobuf object. :type instance: :class:`google.cloud.bigtable.instance.Instance` :param ins...
def add_to(self, parent, name=None, index=None): """Add element to a parent.""" parent.add_child(self, name=name, index=index) return self
def function[add_to, parameter[self, parent, name, index]]: constant[Add element to a parent.] call[name[parent].add_child, parameter[name[self]]] return[name[self]]
keyword[def] identifier[add_to] ( identifier[self] , identifier[parent] , identifier[name] = keyword[None] , identifier[index] = keyword[None] ): literal[string] identifier[parent] . identifier[add_child] ( identifier[self] , identifier[name] = identifier[name] , identifier[index] = identifier[inde...
def add_to(self, parent, name=None, index=None): """Add element to a parent.""" parent.add_child(self, name=name, index=index) return self
def poll(self, verbose_model_scoring_history = False): """ Wait until the job finishes. This method will continuously query the server about the status of the job, until the job reaches a completion. During this time we will display (in stdout) a progress bar with % completion status. ...
def function[poll, parameter[self, verbose_model_scoring_history]]: constant[ Wait until the job finishes. This method will continuously query the server about the status of the job, until the job reaches a completion. During this time we will display (in stdout) a progress bar with % c...
keyword[def] identifier[poll] ( identifier[self] , identifier[verbose_model_scoring_history] = keyword[False] ): literal[string] keyword[try] : identifier[hidden] = keyword[not] identifier[H2OJob] . identifier[__PROGRESS_BAR__] identifier[pb] = identifier[ProgressBar] ( ...
def poll(self, verbose_model_scoring_history=False): """ Wait until the job finishes. This method will continuously query the server about the status of the job, until the job reaches a completion. During this time we will display (in stdout) a progress bar with % completion status. ...
def _calculate_credit_charge(self, message): """ Calculates the credit charge for a request based on the command. If connection.supports_multi_credit is not True then the credit charge isn't valid so it returns 0. The credit charge is the number of credits that are required for ...
def function[_calculate_credit_charge, parameter[self, message]]: constant[ Calculates the credit charge for a request based on the command. If connection.supports_multi_credit is not True then the credit charge isn't valid so it returns 0. The credit charge is the number of cre...
keyword[def] identifier[_calculate_credit_charge] ( identifier[self] , identifier[message] ): literal[string] identifier[credit_size] = literal[int] keyword[if] keyword[not] identifier[self] . identifier[supports_multi_credit] : identifier[credit_charge] = literal[int] ...
def _calculate_credit_charge(self, message): """ Calculates the credit charge for a request based on the command. If connection.supports_multi_credit is not True then the credit charge isn't valid so it returns 0. The credit charge is the number of credits that are required for ...
def last(self, n=1): """ Get the last element of an array. Passing **n** will return the last N values in the array. The **guard** check allows it to work with `_.map`. """ res = self.obj[-n:] if len(res) is 1: res = res[0] return self._wrap(re...
def function[last, parameter[self, n]]: constant[ Get the last element of an array. Passing **n** will return the last N values in the array. The **guard** check allows it to work with `_.map`. ] variable[res] assign[=] call[name[self].obj][<ast.Slice object at 0x7da18f58...
keyword[def] identifier[last] ( identifier[self] , identifier[n] = literal[int] ): literal[string] identifier[res] = identifier[self] . identifier[obj] [- identifier[n] :] keyword[if] identifier[len] ( identifier[res] ) keyword[is] literal[int] : identifier[res] = identifier...
def last(self, n=1): """ Get the last element of an array. Passing **n** will return the last N values in the array. The **guard** check allows it to work with `_.map`. """ res = self.obj[-n:] if len(res) is 1: res = res[0] # depends on [control=['if'], data=[]] ...
def exists(config): """ Check whether the .wily/ directory exists. :param config: The configuration :type config: :class:`wily.config.WilyConfig` :return: Whether the .wily directory exists :rtype: ``boolean`` """ exists = ( pathlib.Path(config.cache_path).exists() and...
def function[exists, parameter[config]]: constant[ Check whether the .wily/ directory exists. :param config: The configuration :type config: :class:`wily.config.WilyConfig` :return: Whether the .wily directory exists :rtype: ``boolean`` ] variable[exists] assign[=] <ast.BoolOp...
keyword[def] identifier[exists] ( identifier[config] ): literal[string] identifier[exists] =( identifier[pathlib] . identifier[Path] ( identifier[config] . identifier[cache_path] ). identifier[exists] () keyword[and] identifier[pathlib] . identifier[Path] ( identifier[config] . identifier[cache_...
def exists(config): """ Check whether the .wily/ directory exists. :param config: The configuration :type config: :class:`wily.config.WilyConfig` :return: Whether the .wily directory exists :rtype: ``boolean`` """ exists = pathlib.Path(config.cache_path).exists() and pathlib.Path(conf...
def replace(self, pattern, replacement): """ Replace all instances of a pattern with a replacement. Args: pattern (str): Pattern to replace replacement (str): Text to insert """ for i, line in enumerate(self): if pattern in line: ...
def function[replace, parameter[self, pattern, replacement]]: constant[ Replace all instances of a pattern with a replacement. Args: pattern (str): Pattern to replace replacement (str): Text to insert ] for taget[tuple[[<ast.Name object at 0x7da2041db5b0>...
keyword[def] identifier[replace] ( identifier[self] , identifier[pattern] , identifier[replacement] ): literal[string] keyword[for] identifier[i] , identifier[line] keyword[in] identifier[enumerate] ( identifier[self] ): keyword[if] identifier[pattern] keyword[in] identifier[line...
def replace(self, pattern, replacement): """ Replace all instances of a pattern with a replacement. Args: pattern (str): Pattern to replace replacement (str): Text to insert """ for (i, line) in enumerate(self): if pattern in line: self[i] = l...
def to_sdp(self): """ Return a string representation suitable for SDP. """ sdp = '%s %d %s %d %s %d typ %s' % ( self.foundation, self.component, self.transport, self.priority, self.host, self.port, self.t...
def function[to_sdp, parameter[self]]: constant[ Return a string representation suitable for SDP. ] variable[sdp] assign[=] binary_operation[constant[%s %d %s %d %s %d typ %s] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Attribute object at 0x7da204346710>, <ast.Attribute object at 0x7...
keyword[def] identifier[to_sdp] ( identifier[self] ): literal[string] identifier[sdp] = literal[string] %( identifier[self] . identifier[foundation] , identifier[self] . identifier[component] , identifier[self] . identifier[transport] , identifier[self] . identif...
def to_sdp(self): """ Return a string representation suitable for SDP. """ sdp = '%s %d %s %d %s %d typ %s' % (self.foundation, self.component, self.transport, self.priority, self.host, self.port, self.type) if self.related_address is not None: sdp += ' raddr %s' % self.related_addre...
def calc_z0_and_conv_factor_from_ratio_of_harmonics(z, z2, NA=0.999): """ Calculates the Conversion Factor and physical amplitude of motion in nms by comparison of the ratio of the heights of the z signal and second harmonic of z. Parameters ---------- z : ndarray array containing...
def function[calc_z0_and_conv_factor_from_ratio_of_harmonics, parameter[z, z2, NA]]: constant[ Calculates the Conversion Factor and physical amplitude of motion in nms by comparison of the ratio of the heights of the z signal and second harmonic of z. Parameters ---------- z : ndarray...
keyword[def] identifier[calc_z0_and_conv_factor_from_ratio_of_harmonics] ( identifier[z] , identifier[z2] , identifier[NA] = literal[int] ): literal[string] identifier[V1] = identifier[calc_mean_amp] ( identifier[z] ) identifier[V2] = identifier[calc_mean_amp] ( identifier[z2] ) identifier[ratio]...
def calc_z0_and_conv_factor_from_ratio_of_harmonics(z, z2, NA=0.999): """ Calculates the Conversion Factor and physical amplitude of motion in nms by comparison of the ratio of the heights of the z signal and second harmonic of z. Parameters ---------- z : ndarray array containing...
def add_dependency(self,my_dep): """ Adds a dependency to the dependency layer @type my_dep: L{Cdependency} @param my_dep: dependency object """ if self.dependency_layer is None: self.dependency_layer = Cdependencies() self.root.append(self.depende...
def function[add_dependency, parameter[self, my_dep]]: constant[ Adds a dependency to the dependency layer @type my_dep: L{Cdependency} @param my_dep: dependency object ] if compare[name[self].dependency_layer is constant[None]] begin[:] name[self].depende...
keyword[def] identifier[add_dependency] ( identifier[self] , identifier[my_dep] ): literal[string] keyword[if] identifier[self] . identifier[dependency_layer] keyword[is] keyword[None] : identifier[self] . identifier[dependency_layer] = identifier[Cdependencies] () iden...
def add_dependency(self, my_dep): """ Adds a dependency to the dependency layer @type my_dep: L{Cdependency} @param my_dep: dependency object """ if self.dependency_layer is None: self.dependency_layer = Cdependencies() self.root.append(self.dependency_layer.get_n...
def from_file(filename, **kwargs): """ Create a GeoRaster object from a file """ ndv, xsize, ysize, geot, projection, datatype = get_geo_info(filename, **kwargs) data = gdalnumeric.LoadFile(filename, **kwargs) data = np.ma.masked_array(data, mask=data == ndv, fill_value=ndv) return GeoRaster...
def function[from_file, parameter[filename]]: constant[ Create a GeoRaster object from a file ] <ast.Tuple object at 0x7da2041d9ba0> assign[=] call[name[get_geo_info], parameter[name[filename]]] variable[data] assign[=] call[name[gdalnumeric].LoadFile, parameter[name[filename]]] ...
keyword[def] identifier[from_file] ( identifier[filename] ,** identifier[kwargs] ): literal[string] identifier[ndv] , identifier[xsize] , identifier[ysize] , identifier[geot] , identifier[projection] , identifier[datatype] = identifier[get_geo_info] ( identifier[filename] ,** identifier[kwargs] ) iden...
def from_file(filename, **kwargs): """ Create a GeoRaster object from a file """ (ndv, xsize, ysize, geot, projection, datatype) = get_geo_info(filename, **kwargs) data = gdalnumeric.LoadFile(filename, **kwargs) data = np.ma.masked_array(data, mask=data == ndv, fill_value=ndv) return GeoRast...
def cli(obj, show_userinfo): """Display logged in user or full userinfo.""" client = obj['client'] userinfo = client.userinfo() if show_userinfo: for k, v in userinfo.items(): if isinstance(v, list): v = ', '.join(v) click.echo('{:20}: {}'.format(k, v)) ...
def function[cli, parameter[obj, show_userinfo]]: constant[Display logged in user or full userinfo.] variable[client] assign[=] call[name[obj]][constant[client]] variable[userinfo] assign[=] call[name[client].userinfo, parameter[]] if name[show_userinfo] begin[:] for tage...
keyword[def] identifier[cli] ( identifier[obj] , identifier[show_userinfo] ): literal[string] identifier[client] = identifier[obj] [ literal[string] ] identifier[userinfo] = identifier[client] . identifier[userinfo] () keyword[if] identifier[show_userinfo] : keyword[for] identifier[k] ...
def cli(obj, show_userinfo): """Display logged in user or full userinfo.""" client = obj['client'] userinfo = client.userinfo() if show_userinfo: for (k, v) in userinfo.items(): if isinstance(v, list): v = ', '.join(v) # depends on [control=['if'], data=[]] ...
def _load_profile(self, profile_name): """Load a profile by name Called by load_user_options """ # find the profile default_profile = self._profile_list[0] for profile in self._profile_list: if profile.get('default', False): # explicit defaul...
def function[_load_profile, parameter[self, profile_name]]: constant[Load a profile by name Called by load_user_options ] variable[default_profile] assign[=] call[name[self]._profile_list][constant[0]] for taget[name[profile]] in starred[name[self]._profile_list] begin[:] ...
keyword[def] identifier[_load_profile] ( identifier[self] , identifier[profile_name] ): literal[string] identifier[default_profile] = identifier[self] . identifier[_profile_list] [ literal[int] ] keyword[for] identifier[profile] keyword[in] identifier[self] . identifier[_profi...
def _load_profile(self, profile_name): """Load a profile by name Called by load_user_options """ # find the profile default_profile = self._profile_list[0] for profile in self._profile_list: if profile.get('default', False): # explicit default, not the first ...
def create(cls, counter_user_alias, share_detail, status, monetary_account_id=None, draft_share_invite_bank_id=None, share_type=None, start_date=None, end_date=None, custom_headers=None): """ Create a new share inquiry for a monetary account, specifying the ...
def function[create, parameter[cls, counter_user_alias, share_detail, status, monetary_account_id, draft_share_invite_bank_id, share_type, start_date, end_date, custom_headers]]: constant[ Create a new share inquiry for a monetary account, specifying the permission the other bunq user will have ...
keyword[def] identifier[create] ( identifier[cls] , identifier[counter_user_alias] , identifier[share_detail] , identifier[status] , identifier[monetary_account_id] = keyword[None] , identifier[draft_share_invite_bank_id] = keyword[None] , identifier[share_type] = keyword[None] , identifier[start_date] = keyword[No...
def create(cls, counter_user_alias, share_detail, status, monetary_account_id=None, draft_share_invite_bank_id=None, share_type=None, start_date=None, end_date=None, custom_headers=None): """ Create a new share inquiry for a monetary account, specifying the permission the other bunq user will have o...
def to_dict(self): """ Serializes a definition to a dictionary, ready for json. Children are serialised recursively. """ ddict = {'name': self.name, 'icon': self.icon, 'line': self.line, 'column': self.column, 'children': [], 'description': self...
def function[to_dict, parameter[self]]: constant[ Serializes a definition to a dictionary, ready for json. Children are serialised recursively. ] variable[ddict] assign[=] dictionary[[<ast.Constant object at 0x7da18f810280>, <ast.Constant object at 0x7da18f811750>, <ast.Constant...
keyword[def] identifier[to_dict] ( identifier[self] ): literal[string] identifier[ddict] ={ literal[string] : identifier[self] . identifier[name] , literal[string] : identifier[self] . identifier[icon] , literal[string] : identifier[self] . identifier[line] , literal[string] : identifier[s...
def to_dict(self): """ Serializes a definition to a dictionary, ready for json. Children are serialised recursively. """ ddict = {'name': self.name, 'icon': self.icon, 'line': self.line, 'column': self.column, 'children': [], 'description': self.description, 'user_data': self.user_data,...
def ptconcat(output_file, input_files, overwrite=False): """Concatenate HDF5 Files""" filt = tb.Filters( complevel=5, shuffle=True, fletcher32=True, complib='zlib' ) out_tabs = {} dt_file = input_files[0] log.info("Reading data struct '%s'..." % dt_file) h5struc = tb.open_file(dt_fil...
def function[ptconcat, parameter[output_file, input_files, overwrite]]: constant[Concatenate HDF5 Files] variable[filt] assign[=] call[name[tb].Filters, parameter[]] variable[out_tabs] assign[=] dictionary[[], []] variable[dt_file] assign[=] call[name[input_files]][constant[0]] c...
keyword[def] identifier[ptconcat] ( identifier[output_file] , identifier[input_files] , identifier[overwrite] = keyword[False] ): literal[string] identifier[filt] = identifier[tb] . identifier[Filters] ( identifier[complevel] = literal[int] , identifier[shuffle] = keyword[True] , identifier[fletcher32...
def ptconcat(output_file, input_files, overwrite=False): """Concatenate HDF5 Files""" filt = tb.Filters(complevel=5, shuffle=True, fletcher32=True, complib='zlib') out_tabs = {} dt_file = input_files[0] log.info("Reading data struct '%s'..." % dt_file) h5struc = tb.open_file(dt_file, 'r') lo...
def mangle(self, name, x): """ Mangle the name by hashing the I{name} and appending I{x}. @return: the mangled name. """ h = abs(hash(name)) return '%s-%s' % (h, x)
def function[mangle, parameter[self, name, x]]: constant[ Mangle the name by hashing the I{name} and appending I{x}. @return: the mangled name. ] variable[h] assign[=] call[name[abs], parameter[call[name[hash], parameter[name[name]]]]] return[binary_operation[constant[%s-%s] ...
keyword[def] identifier[mangle] ( identifier[self] , identifier[name] , identifier[x] ): literal[string] identifier[h] = identifier[abs] ( identifier[hash] ( identifier[name] )) keyword[return] literal[string] %( identifier[h] , identifier[x] )
def mangle(self, name, x): """ Mangle the name by hashing the I{name} and appending I{x}. @return: the mangled name. """ h = abs(hash(name)) return '%s-%s' % (h, x)
def _GetStatus(self): """Retrieves status information. Returns: dict[str, object]: status attributes, indexed by name. """ if self._analysis_mediator: number_of_produced_event_tags = ( self._analysis_mediator.number_of_produced_event_tags) number_of_produced_reports = ( ...
def function[_GetStatus, parameter[self]]: constant[Retrieves status information. Returns: dict[str, object]: status attributes, indexed by name. ] if name[self]._analysis_mediator begin[:] variable[number_of_produced_event_tags] assign[=] name[self]._analysis_mediator.num...
keyword[def] identifier[_GetStatus] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_analysis_mediator] : identifier[number_of_produced_event_tags] =( identifier[self] . identifier[_analysis_mediator] . identifier[number_of_produced_event_tags] ) identi...
def _GetStatus(self): """Retrieves status information. Returns: dict[str, object]: status attributes, indexed by name. """ if self._analysis_mediator: number_of_produced_event_tags = self._analysis_mediator.number_of_produced_event_tags number_of_produced_reports = self._analysis_...
def _resolve_user_group_names(opts): ''' Resolve user and group names in related opts ''' name_id_opts = {'uid': 'user.info', 'gid': 'group.info'} for ind, opt in enumerate(opts): if opt.split('=')[0] in name_id_opts: _givenid = opt.split('=')[1] _...
def function[_resolve_user_group_names, parameter[opts]]: constant[ Resolve user and group names in related opts ] variable[name_id_opts] assign[=] dictionary[[<ast.Constant object at 0x7da1b2022740>, <ast.Constant object at 0x7da1b2023400>], [<ast.Constant object at 0x7da1b2023370>, <ast.Consta...
keyword[def] identifier[_resolve_user_group_names] ( identifier[opts] ): literal[string] identifier[name_id_opts] ={ literal[string] : literal[string] , literal[string] : literal[string] } keyword[for] identifier[ind] , identifier[opt] keyword[in] identifier[enumerate] ( identifier[opts] ): ...
def _resolve_user_group_names(opts): """ Resolve user and group names in related opts """ name_id_opts = {'uid': 'user.info', 'gid': 'group.info'} for (ind, opt) in enumerate(opts): if opt.split('=')[0] in name_id_opts: _givenid = opt.split('=')[1] _param = opt.split(...
def vanderwaals(target, pressure='pore.pressure', temperature='pore.temperature', critical_pressure='pore.critical_pressure', critical_temperature='pore.critical_temperature'): r""" Uses Van der Waals equation of state to calculate the density of a real gas P...
def function[vanderwaals, parameter[target, pressure, temperature, critical_pressure, critical_temperature]]: constant[ Uses Van der Waals equation of state to calculate the density of a real gas Parameters ---------- target : OpenPNM Object The object for which these values are being c...
keyword[def] identifier[vanderwaals] ( identifier[target] , identifier[pressure] = literal[string] , identifier[temperature] = literal[string] , identifier[critical_pressure] = literal[string] , identifier[critical_temperature] = literal[string] ): literal[string] identifier[P] = identifier[target] [ i...
def vanderwaals(target, pressure='pore.pressure', temperature='pore.temperature', critical_pressure='pore.critical_pressure', critical_temperature='pore.critical_temperature'): """ Uses Van der Waals equation of state to calculate the density of a real gas Parameters ---------- target : OpenPNM Obj...
def apply(self, name, foci): """ Apply a named transformation to a set of foci. If the named transformation doesn't exist, return foci untransformed. """ if name in self.transformations: return transform(foci, self.transformations[name]) else: logger.info...
def function[apply, parameter[self, name, foci]]: constant[ Apply a named transformation to a set of foci. If the named transformation doesn't exist, return foci untransformed. ] if compare[name[name] in name[self].transformations] begin[:] return[call[name[transform], parameter...
keyword[def] identifier[apply] ( identifier[self] , identifier[name] , identifier[foci] ): literal[string] keyword[if] identifier[name] keyword[in] identifier[self] . identifier[transformations] : keyword[return] identifier[transform] ( identifier[foci] , identifier[self] . identif...
def apply(self, name, foci): """ Apply a named transformation to a set of foci. If the named transformation doesn't exist, return foci untransformed. """ if name in self.transformations: return transform(foci, self.transformations[name]) # depends on [control=['if'], data=['name']] ...
def keypress_callback(self, obj, ev): """ VTK callback for keypress events. Keypress events: * ``e``: exit the application * ``p``: pick object (hover the mouse and then press to pick) * ``f``: fly to point (click somewhere in the window and press to fly) ...
def function[keypress_callback, parameter[self, obj, ev]]: constant[ VTK callback for keypress events. Keypress events: * ``e``: exit the application * ``p``: pick object (hover the mouse and then press to pick) * ``f``: fly to point (click somewhere in the window an...
keyword[def] identifier[keypress_callback] ( identifier[self] , identifier[obj] , identifier[ev] ): literal[string] identifier[key] = identifier[obj] . identifier[GetKeySym] () identifier[render_window] = identifier[obj] . identifier[GetRenderWindow] () identifier[renderer] = iden...
def keypress_callback(self, obj, ev): """ VTK callback for keypress events. Keypress events: * ``e``: exit the application * ``p``: pick object (hover the mouse and then press to pick) * ``f``: fly to point (click somewhere in the window and press to fly) * `...
def save(self, data, xparent=None): """ Parses the element from XML to Python. :param data | <variant> xparent | <xml.etree.ElementTree.Element> || None :return <xml.etree.ElementTree.Element> """ if xparent is not None: ...
def function[save, parameter[self, data, xparent]]: constant[ Parses the element from XML to Python. :param data | <variant> xparent | <xml.etree.ElementTree.Element> || None :return <xml.etree.ElementTree.Element> ] if co...
keyword[def] identifier[save] ( identifier[self] , identifier[data] , identifier[xparent] = keyword[None] ): literal[string] keyword[if] identifier[xparent] keyword[is] keyword[not] keyword[None] : identifier[elem] = identifier[ElementTree] . identifier[SubElement] ( identifier[xpa...
def save(self, data, xparent=None): """ Parses the element from XML to Python. :param data | <variant> xparent | <xml.etree.ElementTree.Element> || None :return <xml.etree.ElementTree.Element> """ if xparent is not None: e...
def AddComment(self, comment): """Adds a comment to the event tag. Args: comment (str): comment. """ if not comment: return if not self.comment: self.comment = comment else: self.comment = ''.join([self.comment, comment])
def function[AddComment, parameter[self, comment]]: constant[Adds a comment to the event tag. Args: comment (str): comment. ] if <ast.UnaryOp object at 0x7da2046233d0> begin[:] return[None] if <ast.UnaryOp object at 0x7da204621690> begin[:] name[self].comme...
keyword[def] identifier[AddComment] ( identifier[self] , identifier[comment] ): literal[string] keyword[if] keyword[not] identifier[comment] : keyword[return] keyword[if] keyword[not] identifier[self] . identifier[comment] : identifier[self] . identifier[comment] = identifier[comme...
def AddComment(self, comment): """Adds a comment to the event tag. Args: comment (str): comment. """ if not comment: return # depends on [control=['if'], data=[]] if not self.comment: self.comment = comment # depends on [control=['if'], data=[]] else: self.commen...
def allow_role(role): """Allow a role identified by an email address.""" def processor(action, argument): db.session.add( ActionRoles.allow(action, argument=argument, role_id=role.id) ) return processor
def function[allow_role, parameter[role]]: constant[Allow a role identified by an email address.] def function[processor, parameter[action, argument]]: call[name[db].session.add, parameter[call[name[ActionRoles].allow, parameter[name[action]]]]] return[name[processor]]
keyword[def] identifier[allow_role] ( identifier[role] ): literal[string] keyword[def] identifier[processor] ( identifier[action] , identifier[argument] ): identifier[db] . identifier[session] . identifier[add] ( identifier[ActionRoles] . identifier[allow] ( identifier[action] , identifi...
def allow_role(role): """Allow a role identified by an email address.""" def processor(action, argument): db.session.add(ActionRoles.allow(action, argument=argument, role_id=role.id)) return processor
def parse_option(self, option, block_name, *values): """ Parse app path values for option. """ # treat arguments as part of the program name (support spaces in name) values = [x.replace(' ', '\\ ') if not x.startswith(os.sep) else x for x in [str(v) for v in values...
def function[parse_option, parameter[self, option, block_name]]: constant[ Parse app path values for option. ] variable[values] assign[=] <ast.ListComp object at 0x7da18f723dc0> if compare[name[option] equal[==] constant[close]] begin[:] variable[option] assign[=] bin...
keyword[def] identifier[parse_option] ( identifier[self] , identifier[option] , identifier[block_name] ,* identifier[values] ): literal[string] identifier[values] =[ identifier[x] . identifier[replace] ( literal[string] , literal[string] ) keyword[if] keyword[not] identifier[x] . identi...
def parse_option(self, option, block_name, *values): """ Parse app path values for option. """ # treat arguments as part of the program name (support spaces in name) values = [x.replace(' ', '\\ ') if not x.startswith(os.sep) else x for x in [str(v) for v in values]] if option == 'close': ...
def os_details(): """ Returns a dictionary containing details about the operating system """ # Compute architecture and linkage bits, linkage = platform.architecture() results = { # Machine details "platform.arch.bits": bits, "platform....
def function[os_details, parameter[]]: constant[ Returns a dictionary containing details about the operating system ] <ast.Tuple object at 0x7da1b04f7040> assign[=] call[name[platform].architecture, parameter[]] variable[results] assign[=] dictionary[[<ast.Constant object at 0x7d...
keyword[def] identifier[os_details] (): literal[string] identifier[bits] , identifier[linkage] = identifier[platform] . identifier[architecture] () identifier[results] ={ literal[string] : identifier[bits] , literal[string] : identifier[linkage] , ...
def os_details(): """ Returns a dictionary containing details about the operating system """ # Compute architecture and linkage (bits, linkage) = platform.architecture() # Machine details # OS details results = {'platform.arch.bits': bits, 'platform.arch.linkage': linkage, 'platf...
def get_median_mag(self, area, rake): """ Return magnitude (Mw) given the area and rake. Setting the rake to ``None`` causes their "All" rupture-types to be applied. :param area: Area in square km. :param rake: Rake angle (the rupture propagation...
def function[get_median_mag, parameter[self, area, rake]]: constant[ Return magnitude (Mw) given the area and rake. Setting the rake to ``None`` causes their "All" rupture-types to be applied. :param area: Area in square km. :param rake: Rake ang...
keyword[def] identifier[get_median_mag] ( identifier[self] , identifier[area] , identifier[rake] ): literal[string] keyword[assert] identifier[rake] keyword[is] keyword[None] keyword[or] - literal[int] <= identifier[rake] <= literal[int] keyword[if] identifier[rake] keyword[is] key...
def get_median_mag(self, area, rake): """ Return magnitude (Mw) given the area and rake. Setting the rake to ``None`` causes their "All" rupture-types to be applied. :param area: Area in square km. :param rake: Rake angle (the rupture propagation dir...
def _create_pax_generic_header(cls, pax_headers, type=tarfile.XHDTYPE): """Return a POSIX.1-2001 extended or global header sequence that contains a list of keyword, value pairs. The values must be unicode objects. """ records = [] for keyword, value in pax_headers.iteritems(): try...
def function[_create_pax_generic_header, parameter[cls, pax_headers, type]]: constant[Return a POSIX.1-2001 extended or global header sequence that contains a list of keyword, value pairs. The values must be unicode objects. ] variable[records] assign[=] list[[]] for taget[tupl...
keyword[def] identifier[_create_pax_generic_header] ( identifier[cls] , identifier[pax_headers] , identifier[type] = identifier[tarfile] . identifier[XHDTYPE] ): literal[string] identifier[records] =[] keyword[for] identifier[keyword] , identifier[value] keyword[in] identifier[pax_headers] . identi...
def _create_pax_generic_header(cls, pax_headers, type=tarfile.XHDTYPE): """Return a POSIX.1-2001 extended or global header sequence that contains a list of keyword, value pairs. The values must be unicode objects. """ records = [] for (keyword, value) in pax_headers.iteritems(): tr...
def run_repair_pdb(self, silent=False, force_rerun=False): """Run FoldX RepairPDB on this PDB file. Original command:: foldx --command=RepairPDB --pdb=4bxi.pdb Args: silent (bool): If FoldX output should be silenced from printing to the shell. force_rerun (...
def function[run_repair_pdb, parameter[self, silent, force_rerun]]: constant[Run FoldX RepairPDB on this PDB file. Original command:: foldx --command=RepairPDB --pdb=4bxi.pdb Args: silent (bool): If FoldX output should be silenced from printing to the shell. ...
keyword[def] identifier[run_repair_pdb] ( identifier[self] , identifier[silent] = keyword[False] , identifier[force_rerun] = keyword[False] ): literal[string] identifier[foldx_repair_pdb] = literal[string] . identifier[format] ( identifier[self] . identifier[pdb_file] ) ...
def run_repair_pdb(self, silent=False, force_rerun=False): """Run FoldX RepairPDB on this PDB file. Original command:: foldx --command=RepairPDB --pdb=4bxi.pdb Args: silent (bool): If FoldX output should be silenced from printing to the shell. force_rerun (bool...
def _check_item_type(item, field_name, allowed_types, expect_list=False, required_channels='all'): """ Check the item's type against a set of allowed types. Vary the print message regarding whether the item can be None. Helper to `BaseRecord.check_field`. Parameters --------...
def function[_check_item_type, parameter[item, field_name, allowed_types, expect_list, required_channels]]: constant[ Check the item's type against a set of allowed types. Vary the print message regarding whether the item can be None. Helper to `BaseRecord.check_field`. Parameters ---------...
keyword[def] identifier[_check_item_type] ( identifier[item] , identifier[field_name] , identifier[allowed_types] , identifier[expect_list] = keyword[False] , identifier[required_channels] = literal[string] ): literal[string] keyword[if] identifier[expect_list] : keyword[if] keyword[not] ident...
def _check_item_type(item, field_name, allowed_types, expect_list=False, required_channels='all'): """ Check the item's type against a set of allowed types. Vary the print message regarding whether the item can be None. Helper to `BaseRecord.check_field`. Parameters ---------- item : any ...
def zinger(rest): "ZING!" name = 'you' if rest: name = rest.strip() karma.Karma.store.change(name, -1) return "OH MAN!!! %s TOTALLY GOT ZING'D!" % (name.upper())
def function[zinger, parameter[rest]]: constant[ZING!] variable[name] assign[=] constant[you] if name[rest] begin[:] variable[name] assign[=] call[name[rest].strip, parameter[]] call[name[karma].Karma.store.change, parameter[name[name], <ast.UnaryOp object at 0x7d...
keyword[def] identifier[zinger] ( identifier[rest] ): literal[string] identifier[name] = literal[string] keyword[if] identifier[rest] : identifier[name] = identifier[rest] . identifier[strip] () identifier[karma] . identifier[Karma] . identifier[store] . identifier[change] ( identifier[name] ,- literal...
def zinger(rest): """ZING!""" name = 'you' if rest: name = rest.strip() karma.Karma.store.change(name, -1) # depends on [control=['if'], data=[]] return "OH MAN!!! %s TOTALLY GOT ZING'D!" % name.upper()
def dump(self, C_out, scale_out=None, stream=None, fmt='lha', skip_redundant=True): """Return a string representation of the parameters and Wilson coefficients `C_out` in DSixTools output format. If `stream` is specified, export it to a file. `fmt` defaults to `lha` (the SLHA-like DSixTo...
def function[dump, parameter[self, C_out, scale_out, stream, fmt, skip_redundant]]: constant[Return a string representation of the parameters and Wilson coefficients `C_out` in DSixTools output format. If `stream` is specified, export it to a file. `fmt` defaults to `lha` (the SLHA-like ...
keyword[def] identifier[dump] ( identifier[self] , identifier[C_out] , identifier[scale_out] = keyword[None] , identifier[stream] = keyword[None] , identifier[fmt] = literal[string] , identifier[skip_redundant] = keyword[True] ): literal[string] identifier[C] = identifier[OrderedDict] () k...
def dump(self, C_out, scale_out=None, stream=None, fmt='lha', skip_redundant=True): """Return a string representation of the parameters and Wilson coefficients `C_out` in DSixTools output format. If `stream` is specified, export it to a file. `fmt` defaults to `lha` (the SLHA-like DSixTools ...
def to_array(self): """ Serializes this InlineQueryResultPhoto to a dictionary. :return: dictionary representation of this object. :rtype: dict """ array = super(InlineQueryResultPhoto, self).to_array() array['type'] = u(self.type) # py2: type unicode, py3: type...
def function[to_array, parameter[self]]: constant[ Serializes this InlineQueryResultPhoto to a dictionary. :return: dictionary representation of this object. :rtype: dict ] variable[array] assign[=] call[call[name[super], parameter[name[InlineQueryResultPhoto], name[self...
keyword[def] identifier[to_array] ( identifier[self] ): literal[string] identifier[array] = identifier[super] ( identifier[InlineQueryResultPhoto] , identifier[self] ). identifier[to_array] () identifier[array] [ literal[string] ]= identifier[u] ( identifier[self] . identifier[type] ) ...
def to_array(self): """ Serializes this InlineQueryResultPhoto to a dictionary. :return: dictionary representation of this object. :rtype: dict """ array = super(InlineQueryResultPhoto, self).to_array() array['type'] = u(self.type) # py2: type unicode, py3: type str arr...
def _reshape_irregular_array(self, array, section_height, image_width): '''Reshapes arrays of ranks not in {1, 2, 4} ''' section_area = section_height * image_width flattened_array = np.ravel(array) if not self.config['show_all']: flattened_array = flattened_array[:int(section_area/MIN_SQUARE...
def function[_reshape_irregular_array, parameter[self, array, section_height, image_width]]: constant[Reshapes arrays of ranks not in {1, 2, 4} ] variable[section_area] assign[=] binary_operation[name[section_height] * name[image_width]] variable[flattened_array] assign[=] call[name[np].rave...
keyword[def] identifier[_reshape_irregular_array] ( identifier[self] , identifier[array] , identifier[section_height] , identifier[image_width] ): literal[string] identifier[section_area] = identifier[section_height] * identifier[image_width] identifier[flattened_array] = identifier[np] . identifier[...
def _reshape_irregular_array(self, array, section_height, image_width): """Reshapes arrays of ranks not in {1, 2, 4} """ section_area = section_height * image_width flattened_array = np.ravel(array) if not self.config['show_all']: flattened_array = flattened_array[:int(section_area / MIN_SQU...
def nla_get_u64(nla): """Return value of 64 bit integer attribute as an int(). https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L649 Positional arguments: nla -- 64 bit integer attribute (nlattr class instance). Returns: Payload as an int(). """ tmp = c_uint64(0) if nl...
def function[nla_get_u64, parameter[nla]]: constant[Return value of 64 bit integer attribute as an int(). https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L649 Positional arguments: nla -- 64 bit integer attribute (nlattr class instance). Returns: Payload as an int(). ] ...
keyword[def] identifier[nla_get_u64] ( identifier[nla] ): literal[string] identifier[tmp] = identifier[c_uint64] ( literal[int] ) keyword[if] identifier[nla] keyword[and] identifier[nla_len] ( identifier[nla] )>= identifier[sizeof] ( identifier[tmp] ): identifier[tmp] = identifier[c_uint64...
def nla_get_u64(nla): """Return value of 64 bit integer attribute as an int(). https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L649 Positional arguments: nla -- 64 bit integer attribute (nlattr class instance). Returns: Payload as an int(). """ tmp = c_uint64(0) if nl...
def zadd(self, *args, **kwargs): """ For each score/value given as paramter, do a "zadd" call with score/self.instance as parameter call for each value. Values must be primary keys of the related model. """ if 'values_callback' not in kwargs: kwargs['values_ca...
def function[zadd, parameter[self]]: constant[ For each score/value given as paramter, do a "zadd" call with score/self.instance as parameter call for each value. Values must be primary keys of the related model. ] if compare[constant[values_callback] <ast.NotIn object at...
keyword[def] identifier[zadd] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] literal[string] keyword[not] keyword[in] identifier[kwargs] : identifier[kwargs] [ literal[string] ]= identifier[self] . identifier[_to_fields] ident...
def zadd(self, *args, **kwargs): """ For each score/value given as paramter, do a "zadd" call with score/self.instance as parameter call for each value. Values must be primary keys of the related model. """ if 'values_callback' not in kwargs: kwargs['values_callback'] = s...
def mask(array, predicates, new_value, ty): """ Returns a new array, with each element in the original array satisfying the passed-in predicate set to `new_value` Args: array (WeldObject / Numpy.ndarray): Input array predicates (WeldObject / Numpy.ndarray<bool>): Predicate set n...
def function[mask, parameter[array, predicates, new_value, ty]]: constant[ Returns a new array, with each element in the original array satisfying the passed-in predicate set to `new_value` Args: array (WeldObject / Numpy.ndarray): Input array predicates (WeldObject / Numpy.ndarray<...
keyword[def] identifier[mask] ( identifier[array] , identifier[predicates] , identifier[new_value] , identifier[ty] ): literal[string] identifier[weld_obj] = identifier[WeldObject] ( identifier[encoder_] , identifier[decoder_] ) identifier[array_var] = identifier[weld_obj] . identifier[update] ( iden...
def mask(array, predicates, new_value, ty): """ Returns a new array, with each element in the original array satisfying the passed-in predicate set to `new_value` Args: array (WeldObject / Numpy.ndarray): Input array predicates (WeldObject / Numpy.ndarray<bool>): Predicate set n...
def get_project(self, project_name): """Return the project with a given name. :param project_name: The name to search for. :type project_name: str :return: The project that has the name ``project_name`` or ``None`` if no project is found. :rtype: :class:`pytodoist.to...
def function[get_project, parameter[self, project_name]]: constant[Return the project with a given name. :param project_name: The name to search for. :type project_name: str :return: The project that has the name ``project_name`` or ``None`` if no project is found. :...
keyword[def] identifier[get_project] ( identifier[self] , identifier[project_name] ): literal[string] keyword[for] identifier[project] keyword[in] identifier[self] . identifier[get_projects] (): keyword[if] identifier[project] . identifier[name] == identifier[project_name] : ...
def get_project(self, project_name): """Return the project with a given name. :param project_name: The name to search for. :type project_name: str :return: The project that has the name ``project_name`` or ``None`` if no project is found. :rtype: :class:`pytodoist.todois...
def Install(self, apk_path, destination_dir='', replace_existing=True, grant_permissions=False, timeout_ms=None, transfer_progress_callback=None): """Install an apk to the device. Doesn't support verifier file, instead allows destination directory to be overridden. Args...
def function[Install, parameter[self, apk_path, destination_dir, replace_existing, grant_permissions, timeout_ms, transfer_progress_callback]]: constant[Install an apk to the device. Doesn't support verifier file, instead allows destination directory to be overridden. Args: a...
keyword[def] identifier[Install] ( identifier[self] , identifier[apk_path] , identifier[destination_dir] = literal[string] , identifier[replace_existing] = keyword[True] , identifier[grant_permissions] = keyword[False] , identifier[timeout_ms] = keyword[None] , identifier[transfer_progress_callback] = keyword[None] ...
def Install(self, apk_path, destination_dir='', replace_existing=True, grant_permissions=False, timeout_ms=None, transfer_progress_callback=None): """Install an apk to the device. Doesn't support verifier file, instead allows destination directory to be overridden. Args: apk_path...
def item_huisnummer_adapter(obj, request): """ Adapter for rendering an object of :class:`crabpy.gateway.crab.Huisnummer` to json. """ return { 'id': obj.id, 'huisnummer': obj.huisnummer, 'postadres': obj.postadres, 'status': { 'id': obj.status.id, ...
def function[item_huisnummer_adapter, parameter[obj, request]]: constant[ Adapter for rendering an object of :class:`crabpy.gateway.crab.Huisnummer` to json. ] return[dictionary[[<ast.Constant object at 0x7da18ede7f70>, <ast.Constant object at 0x7da18ede5870>, <ast.Constant object at 0x7da18ede5...
keyword[def] identifier[item_huisnummer_adapter] ( identifier[obj] , identifier[request] ): literal[string] keyword[return] { literal[string] : identifier[obj] . identifier[id] , literal[string] : identifier[obj] . identifier[huisnummer] , literal[string] : identifier[obj] . identifier[posta...
def item_huisnummer_adapter(obj, request): """ Adapter for rendering an object of :class:`crabpy.gateway.crab.Huisnummer` to json. """ return {'id': obj.id, 'huisnummer': obj.huisnummer, 'postadres': obj.postadres, 'status': {'id': obj.status.id, 'naam': obj.status.naam, 'definitie': obj.status.defi...
def _Rzderiv(self,R,z,phi=0.,t=0.): """ NAME: _Rzderiv PURPOSE: evaluate the mixed R,z derivative for this potential INPUT: R - Galactocentric cylindrical radius z - vertical height phi - azimuth t - time OUTPUT: ...
def function[_Rzderiv, parameter[self, R, z, phi, t]]: constant[ NAME: _Rzderiv PURPOSE: evaluate the mixed R,z derivative for this potential INPUT: R - Galactocentric cylindrical radius z - vertical height phi - azimuth t...
keyword[def] identifier[_Rzderiv] ( identifier[self] , identifier[R] , identifier[z] , identifier[phi] = literal[int] , identifier[t] = literal[int] ): literal[string] keyword[return] identifier[self] . identifier[_mn3] [ literal[int] ]. identifier[Rzderiv] ( identifier[R] , identifier[z] , identi...
def _Rzderiv(self, R, z, phi=0.0, t=0.0): """ NAME: _Rzderiv PURPOSE: evaluate the mixed R,z derivative for this potential INPUT: R - Galactocentric cylindrical radius z - vertical height phi - azimuth t - time OUTPUT:...
def create(self, properties): """ Create a new (user-defined) User Role in this HMC. Authorization requirements: * Task permission to the "Manage User Roles" task. Parameters: properties (dict): Initial property values. Allowable properties are defined i...
def function[create, parameter[self, properties]]: constant[ Create a new (user-defined) User Role in this HMC. Authorization requirements: * Task permission to the "Manage User Roles" task. Parameters: properties (dict): Initial property values. Allowab...
keyword[def] identifier[create] ( identifier[self] , identifier[properties] ): literal[string] identifier[result] = identifier[self] . identifier[session] . identifier[post] ( identifier[self] . identifier[console] . identifier[uri] + literal[string] , identifier[body] = identifier[propert...
def create(self, properties): """ Create a new (user-defined) User Role in this HMC. Authorization requirements: * Task permission to the "Manage User Roles" task. Parameters: properties (dict): Initial property values. Allowable properties are defined in se...
def to_cmd_args(mapping): # type: (dict) -> list """Transform a dictionary in a list of cmd arguments. Example: >>>args = mapping.to_cmd_args({'model_dir': '/opt/ml/model', 'batch_size': 25}) >>> >>>print(args) ['--model_dir', '/opt/ml/model', '--batch_size', 25] Args: ...
def function[to_cmd_args, parameter[mapping]]: constant[Transform a dictionary in a list of cmd arguments. Example: >>>args = mapping.to_cmd_args({'model_dir': '/opt/ml/model', 'batch_size': 25}) >>> >>>print(args) ['--model_dir', '/opt/ml/model', '--batch_size', 25] Args...
keyword[def] identifier[to_cmd_args] ( identifier[mapping] ): literal[string] identifier[sorted_keys] = identifier[sorted] ( identifier[mapping] . identifier[keys] ()) keyword[def] identifier[arg_name] ( identifier[obj] ): identifier[string] = identifier[_decode] ( identifier[obj] ) ...
def to_cmd_args(mapping): # type: (dict) -> list "Transform a dictionary in a list of cmd arguments.\n Example:\n >>>args = mapping.to_cmd_args({'model_dir': '/opt/ml/model', 'batch_size': 25})\n >>>\n >>>print(args)\n ['--model_dir', '/opt/ml/model', '--batch_size', 25]\n Args:\n...
def handle_m2m(self, sender, instance, **kwargs): """ Handle many to many relationships """ self.handle_save(instance.__class__, instance)
def function[handle_m2m, parameter[self, sender, instance]]: constant[ Handle many to many relationships ] call[name[self].handle_save, parameter[name[instance].__class__, name[instance]]]
keyword[def] identifier[handle_m2m] ( identifier[self] , identifier[sender] , identifier[instance] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[handle_save] ( identifier[instance] . identifier[__class__] , identifier[instance] )
def handle_m2m(self, sender, instance, **kwargs): """ Handle many to many relationships """ self.handle_save(instance.__class__, instance)
def _iso_num_weeks(iso_year): "Get the number of ISO-weeks in this year" year_start = _iso_year_start(iso_year) next_year_start = _iso_year_start(iso_year+1) year_num_weeks = ((next_year_start - year_start).days) // 7 return year_num_weeks
def function[_iso_num_weeks, parameter[iso_year]]: constant[Get the number of ISO-weeks in this year] variable[year_start] assign[=] call[name[_iso_year_start], parameter[name[iso_year]]] variable[next_year_start] assign[=] call[name[_iso_year_start], parameter[binary_operation[name[iso_year] + ...
keyword[def] identifier[_iso_num_weeks] ( identifier[iso_year] ): literal[string] identifier[year_start] = identifier[_iso_year_start] ( identifier[iso_year] ) identifier[next_year_start] = identifier[_iso_year_start] ( identifier[iso_year] + literal[int] ) identifier[year_num_weeks] =(( identifi...
def _iso_num_weeks(iso_year): """Get the number of ISO-weeks in this year""" year_start = _iso_year_start(iso_year) next_year_start = _iso_year_start(iso_year + 1) year_num_weeks = (next_year_start - year_start).days // 7 return year_num_weeks
def union(self, *dstreams): """ Create a unified DStream from multiple DStreams of the same type and same slide duration. """ if not dstreams: raise ValueError("should have at least one DStream to union") if len(dstreams) == 1: return dstreams[0] ...
def function[union, parameter[self]]: constant[ Create a unified DStream from multiple DStreams of the same type and same slide duration. ] if <ast.UnaryOp object at 0x7da1b20b4f10> begin[:] <ast.Raise object at 0x7da1b20b5180> if compare[call[name[len], parameter...
keyword[def] identifier[union] ( identifier[self] ,* identifier[dstreams] ): literal[string] keyword[if] keyword[not] identifier[dstreams] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[if] identifier[len] ( identifier[dstreams] )== literal[int] : ...
def union(self, *dstreams): """ Create a unified DStream from multiple DStreams of the same type and same slide duration. """ if not dstreams: raise ValueError('should have at least one DStream to union') # depends on [control=['if'], data=[]] if len(dstreams) == 1: ...
def fit_overlays(self, text, start=None, end=None, **kw): """ Get an overlay thet fits the range [start, end). """ for ovl in text.overlays: if ovl.match(props=self.props_match, rng=(start, end)): yield ovl
def function[fit_overlays, parameter[self, text, start, end]]: constant[ Get an overlay thet fits the range [start, end). ] for taget[name[ovl]] in starred[name[text].overlays] begin[:] if call[name[ovl].match, parameter[]] begin[:] <ast.Yield obje...
keyword[def] identifier[fit_overlays] ( identifier[self] , identifier[text] , identifier[start] = keyword[None] , identifier[end] = keyword[None] ,** identifier[kw] ): literal[string] keyword[for] identifier[ovl] keyword[in] identifier[text] . identifier[overlays] : keyword[if] id...
def fit_overlays(self, text, start=None, end=None, **kw): """ Get an overlay thet fits the range [start, end). """ for ovl in text.overlays: if ovl.match(props=self.props_match, rng=(start, end)): yield ovl # depends on [control=['if'], data=[]] # depends on [control=['for'...
def project(original_image, perturbed_images, alphas, shape, constraint): """ Projection onto given l2 / linf balls in a batch. """ alphas_shape = [len(alphas)] + [1] * len(shape) alphas = alphas.reshape(alphas_shape) if constraint == 'l2': projected = (1-alphas) * original_image + alphas * perturbed_images...
def function[project, parameter[original_image, perturbed_images, alphas, shape, constraint]]: constant[ Projection onto given l2 / linf balls in a batch. ] variable[alphas_shape] assign[=] binary_operation[list[[<ast.Call object at 0x7da1b1ef00a0>]] + binary_operation[list[[<ast.Constant object at 0x7d...
keyword[def] identifier[project] ( identifier[original_image] , identifier[perturbed_images] , identifier[alphas] , identifier[shape] , identifier[constraint] ): literal[string] identifier[alphas_shape] =[ identifier[len] ( identifier[alphas] )]+[ literal[int] ]* identifier[len] ( identifier[shape] ) identi...
def project(original_image, perturbed_images, alphas, shape, constraint): """ Projection onto given l2 / linf balls in a batch. """ alphas_shape = [len(alphas)] + [1] * len(shape) alphas = alphas.reshape(alphas_shape) if constraint == 'l2': projected = (1 - alphas) * original_image + alphas * pe...
def resolve_to_callable(callable_name): """ Resolve string :callable_name: to a callable. :param callable_name: String representing callable name as registered in ramses registry or dotted import path of callable. Can be wrapped in double curly brackets, e.g. '{{my_callable}}'. """ from...
def function[resolve_to_callable, parameter[callable_name]]: constant[ Resolve string :callable_name: to a callable. :param callable_name: String representing callable name as registered in ramses registry or dotted import path of callable. Can be wrapped in double curly brackets, e.g. '{{m...
keyword[def] identifier[resolve_to_callable] ( identifier[callable_name] ): literal[string] keyword[from] . keyword[import] identifier[registry] identifier[clean_callable_name] = identifier[callable_name] . identifier[replace] ( literal[string] , literal[string] ). identifier[replace] ( literal...
def resolve_to_callable(callable_name): """ Resolve string :callable_name: to a callable. :param callable_name: String representing callable name as registered in ramses registry or dotted import path of callable. Can be wrapped in double curly brackets, e.g. '{{my_callable}}'. """ from...
def get_allowed_methods(self): """Returns a coma-separated list of method names that are allowed on this instance. Useful to set the ``Allowed`` response header. """ return ", ".join([method for method in dir(self) if method.upper() == method and callable(getattr(...
def function[get_allowed_methods, parameter[self]]: constant[Returns a coma-separated list of method names that are allowed on this instance. Useful to set the ``Allowed`` response header. ] return[call[constant[, ].join, parameter[<ast.ListComp object at 0x7da1b2298820>]]]
keyword[def] identifier[get_allowed_methods] ( identifier[self] ): literal[string] keyword[return] literal[string] . identifier[join] ([ identifier[method] keyword[for] identifier[method] keyword[in] identifier[dir] ( identifier[self] ) keyword[if] identifier[method] . identifier[upp...
def get_allowed_methods(self): """Returns a coma-separated list of method names that are allowed on this instance. Useful to set the ``Allowed`` response header. """ return ', '.join([method for method in dir(self) if method.upper() == method and callable(getattr(self, method))])
def pressAndHold(*args): ''' press and hold. Do NOT release. accepts as many arguments as you want. e.g. pressAndHold('left_arrow', 'a','b'). ''' for i in args: win32api.keybd_event(VK_CODE[i], 0,0,0) time.sleep(.05)
def function[pressAndHold, parameter[]]: constant[ press and hold. Do NOT release. accepts as many arguments as you want. e.g. pressAndHold('left_arrow', 'a','b'). ] for taget[name[i]] in starred[name[args]] begin[:] call[name[win32api].keybd_event, parameter[call[name[VK...
keyword[def] identifier[pressAndHold] (* identifier[args] ): literal[string] keyword[for] identifier[i] keyword[in] identifier[args] : identifier[win32api] . identifier[keybd_event] ( identifier[VK_CODE] [ identifier[i] ], literal[int] , literal[int] , literal[int] ) identifier[time] ....
def pressAndHold(*args): """ press and hold. Do NOT release. accepts as many arguments as you want. e.g. pressAndHold('left_arrow', 'a','b'). """ for i in args: win32api.keybd_event(VK_CODE[i], 0, 0, 0) time.sleep(0.05) # depends on [control=['for'], data=['i']]
def addParts(parentPart, childPath, count, index): """ BUILD A hierarchy BY REPEATEDLY CALLING self METHOD WITH VARIOUS childPaths count IS THE NUMBER FOUND FOR self PATH """ if index == None: index = 0 if index == len(childPath): return c = childPath[index] parentPart.co...
def function[addParts, parameter[parentPart, childPath, count, index]]: constant[ BUILD A hierarchy BY REPEATEDLY CALLING self METHOD WITH VARIOUS childPaths count IS THE NUMBER FOUND FOR self PATH ] if compare[name[index] equal[==] constant[None]] begin[:] variable[index] as...
keyword[def] identifier[addParts] ( identifier[parentPart] , identifier[childPath] , identifier[count] , identifier[index] ): literal[string] keyword[if] identifier[index] == keyword[None] : identifier[index] = literal[int] keyword[if] identifier[index] == identifier[len] ( identifier[chil...
def addParts(parentPart, childPath, count, index): """ BUILD A hierarchy BY REPEATEDLY CALLING self METHOD WITH VARIOUS childPaths count IS THE NUMBER FOUND FOR self PATH """ if index == None: index = 0 # depends on [control=['if'], data=['index']] if index == len(childPath): re...
def getvalue(x): """Return the single value of x or raise TypError if more than one value.""" if isrepeating(x): raise TypeError( "Ambiguous call to getvalue for %r which has more than one value." % x) for value in getvalues(x): return value
def function[getvalue, parameter[x]]: constant[Return the single value of x or raise TypError if more than one value.] if call[name[isrepeating], parameter[name[x]]] begin[:] <ast.Raise object at 0x7da1b0ffb9d0> for taget[name[value]] in starred[call[name[getvalues], parameter[name[x]]]]...
keyword[def] identifier[getvalue] ( identifier[x] ): literal[string] keyword[if] identifier[isrepeating] ( identifier[x] ): keyword[raise] identifier[TypeError] ( literal[string] % identifier[x] ) keyword[for] identifier[value] keyword[in] identifier[getvalues] ( ident...
def getvalue(x): """Return the single value of x or raise TypError if more than one value.""" if isrepeating(x): raise TypeError('Ambiguous call to getvalue for %r which has more than one value.' % x) # depends on [control=['if'], data=[]] for value in getvalues(x): return value # depends ...
def getInstanceMetrics( self, forAllExcept: int) -> Tuple[Optional[int], Optional[float]]: """ Calculate and return the average throughput of all the instances except the one specified as `forAllExcept`. """ m = [(reqs, tm) for i, (reqs, tm) in self.numOr...
def function[getInstanceMetrics, parameter[self, forAllExcept]]: constant[ Calculate and return the average throughput of all the instances except the one specified as `forAllExcept`. ] variable[m] assign[=] <ast.ListComp object at 0x7da2054a5f30> if name[m] begin[:] ...
keyword[def] identifier[getInstanceMetrics] ( identifier[self] , identifier[forAllExcept] : identifier[int] )-> identifier[Tuple] [ identifier[Optional] [ identifier[int] ], identifier[Optional] [ identifier[float] ]]: literal[string] identifier[m] =[( identifier[reqs] , identifier[tm] ) keyword[f...
def getInstanceMetrics(self, forAllExcept: int) -> Tuple[Optional[int], Optional[float]]: """ Calculate and return the average throughput of all the instances except the one specified as `forAllExcept`. """ m = [(reqs, tm) for (i, (reqs, tm)) in self.numOrderedRequests.items() if i != fo...
def export_schema_to_dict(back_references): """Exports the supported import/export schema to a dictionary""" databases = [Database.export_schema(recursive=True, include_parent_ref=back_references)] clusters = [DruidCluster.export_schema(recursive=True, include_parent_ref=bac...
def function[export_schema_to_dict, parameter[back_references]]: constant[Exports the supported import/export schema to a dictionary] variable[databases] assign[=] list[[<ast.Call object at 0x7da1b2078280>]] variable[clusters] assign[=] list[[<ast.Call object at 0x7da1b2078490>]] variabl...
keyword[def] identifier[export_schema_to_dict] ( identifier[back_references] ): literal[string] identifier[databases] =[ identifier[Database] . identifier[export_schema] ( identifier[recursive] = keyword[True] , identifier[include_parent_ref] = identifier[back_references] )] identifier[clusters] ...
def export_schema_to_dict(back_references): """Exports the supported import/export schema to a dictionary""" databases = [Database.export_schema(recursive=True, include_parent_ref=back_references)] clusters = [DruidCluster.export_schema(recursive=True, include_parent_ref=back_references)] data = dict() ...
def show(ctx): """ Show migrations list """ for app_name, app in ctx.obj['config']['apps'].items(): click.echo(click.style(app_name, fg='green', bold=True)) for migration in app['migrations']: applied = ctx.obj['db'].is_migration_applied(app_name, migration) clic...
def function[show, parameter[ctx]]: constant[ Show migrations list ] for taget[tuple[[<ast.Name object at 0x7da1b092c7c0>, <ast.Name object at 0x7da1b092f010>]]] in starred[call[call[call[name[ctx].obj][constant[config]]][constant[apps]].items, parameter[]]] begin[:] call[name[cl...
keyword[def] identifier[show] ( identifier[ctx] ): literal[string] keyword[for] identifier[app_name] , identifier[app] keyword[in] identifier[ctx] . identifier[obj] [ literal[string] ][ literal[string] ]. identifier[items] (): identifier[click] . identifier[echo] ( identifier[click] . identifi...
def show(ctx): """ Show migrations list """ for (app_name, app) in ctx.obj['config']['apps'].items(): click.echo(click.style(app_name, fg='green', bold=True)) for migration in app['migrations']: applied = ctx.obj['db'].is_migration_applied(app_name, migration) cli...
def _load_int(self): """Load internal data from file and return it.""" values = numpy.fromfile(self.filepath_int) if self.NDIM > 0: values = values.reshape(self.seriesshape) return values
def function[_load_int, parameter[self]]: constant[Load internal data from file and return it.] variable[values] assign[=] call[name[numpy].fromfile, parameter[name[self].filepath_int]] if compare[name[self].NDIM greater[>] constant[0]] begin[:] variable[values] assign[=] call[na...
keyword[def] identifier[_load_int] ( identifier[self] ): literal[string] identifier[values] = identifier[numpy] . identifier[fromfile] ( identifier[self] . identifier[filepath_int] ) keyword[if] identifier[self] . identifier[NDIM] > literal[int] : identifier[values] = identif...
def _load_int(self): """Load internal data from file and return it.""" values = numpy.fromfile(self.filepath_int) if self.NDIM > 0: values = values.reshape(self.seriesshape) # depends on [control=['if'], data=[]] return values
def checkout(self, ref, cb=None): """Checkout a bundle from the remote. Returns a file-like object""" if self.is_api: return self._checkout_api(ref, cb=cb) else: return self._checkout_fs(ref, cb=cb)
def function[checkout, parameter[self, ref, cb]]: constant[Checkout a bundle from the remote. Returns a file-like object] if name[self].is_api begin[:] return[call[name[self]._checkout_api, parameter[name[ref]]]]
keyword[def] identifier[checkout] ( identifier[self] , identifier[ref] , identifier[cb] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[is_api] : keyword[return] identifier[self] . identifier[_checkout_api] ( identifier[ref] , identifier[cb] = identifier[...
def checkout(self, ref, cb=None): """Checkout a bundle from the remote. Returns a file-like object""" if self.is_api: return self._checkout_api(ref, cb=cb) # depends on [control=['if'], data=[]] else: return self._checkout_fs(ref, cb=cb)
def cols_to_dt(df, col_list,set_format = None,infer_format = True,dest = False): """ Coerces a list of columns to datetime Parameters: df - DataFrame DataFrame to operate on col_list - list of strings names of columns to coerce dest - bool, default False Whether to apply the ...
def function[cols_to_dt, parameter[df, col_list, set_format, infer_format, dest]]: constant[ Coerces a list of columns to datetime Parameters: df - DataFrame DataFrame to operate on col_list - list of strings names of columns to coerce dest - bool, default False Whether t...
keyword[def] identifier[cols_to_dt] ( identifier[df] , identifier[col_list] , identifier[set_format] = keyword[None] , identifier[infer_format] = keyword[True] , identifier[dest] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[dest] : keyword[return] identifier[_pd] . id...
def cols_to_dt(df, col_list, set_format=None, infer_format=True, dest=False): """ Coerces a list of columns to datetime Parameters: df - DataFrame DataFrame to operate on col_list - list of strings names of columns to coerce dest - bool, default False Whether to apply the res...
def complete(self): """ When *local_workflow_require_branches* of the task was set to *True*, returns whether the :py:meth:`run` method has been called before. Otherwise, the call is forwarded to the super class. """ if self.task.local_workflow_require_branches: ...
def function[complete, parameter[self]]: constant[ When *local_workflow_require_branches* of the task was set to *True*, returns whether the :py:meth:`run` method has been called before. Otherwise, the call is forwarded to the super class. ] if name[self].task.local_workf...
keyword[def] identifier[complete] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[task] . identifier[local_workflow_require_branches] : keyword[return] identifier[self] . identifier[_has_run] keyword[else] : keyword[return] iden...
def complete(self): """ When *local_workflow_require_branches* of the task was set to *True*, returns whether the :py:meth:`run` method has been called before. Otherwise, the call is forwarded to the super class. """ if self.task.local_workflow_require_branches: return se...
def add_padding(self, name, left = 0, right = 0, top = 0, bottom = 0, value = 0, input_name = 'data', output_name = 'out', padding_type = 'constant'): """ Add a padding layer to the model. Kindly refer to NeuralNetwork.proto for details. Parameter...
def function[add_padding, parameter[self, name, left, right, top, bottom, value, input_name, output_name, padding_type]]: constant[ Add a padding layer to the model. Kindly refer to NeuralNetwork.proto for details. Parameters ---------- name: str The name of this lay...
keyword[def] identifier[add_padding] ( identifier[self] , identifier[name] , identifier[left] = literal[int] , identifier[right] = literal[int] , identifier[top] = literal[int] , identifier[bottom] = literal[int] , identifier[value] = literal[int] , identifier[input_name] = literal[string] , identifier[output_name...
def add_padding(self, name, left=0, right=0, top=0, bottom=0, value=0, input_name='data', output_name='out', padding_type='constant'): """ Add a padding layer to the model. Kindly refer to NeuralNetwork.proto for details. Parameters ---------- name: str The name of this ...
def get_conv_params(mass1, mass2, spin1z, spin2z, metricParams, fUpper, lambda1=None, lambda2=None, quadparam1=None, quadparam2=None): """ Function to convert between masses and spins and locations in the mu parameter space. Mu = Cartesian metric, but not principal co...
def function[get_conv_params, parameter[mass1, mass2, spin1z, spin2z, metricParams, fUpper, lambda1, lambda2, quadparam1, quadparam2]]: constant[ Function to convert between masses and spins and locations in the mu parameter space. Mu = Cartesian metric, but not principal components. Parameters ...
keyword[def] identifier[get_conv_params] ( identifier[mass1] , identifier[mass2] , identifier[spin1z] , identifier[spin2z] , identifier[metricParams] , identifier[fUpper] , identifier[lambda1] = keyword[None] , identifier[lambda2] = keyword[None] , identifier[quadparam1] = keyword[None] , identifier[quadparam2] = k...
def get_conv_params(mass1, mass2, spin1z, spin2z, metricParams, fUpper, lambda1=None, lambda2=None, quadparam1=None, quadparam2=None): """ Function to convert between masses and spins and locations in the mu parameter space. Mu = Cartesian metric, but not principal components. Parameters ----------...
def _cutout(x, n_holes:uniform_int=1, length:uniform_int=40): "Cut out `n_holes` number of square holes of size `length` in image at random locations." h,w = x.shape[1:] for n in range(n_holes): h_y = np.random.randint(0, h) h_x = np.random.randint(0, w) y1 = int(np.clip(h_y - length...
def function[_cutout, parameter[x, n_holes, length]]: constant[Cut out `n_holes` number of square holes of size `length` in image at random locations.] <ast.Tuple object at 0x7da1b1e11e70> assign[=] call[name[x].shape][<ast.Slice object at 0x7da1b1e11d50>] for taget[name[n]] in starred[call[name...
keyword[def] identifier[_cutout] ( identifier[x] , identifier[n_holes] : identifier[uniform_int] = literal[int] , identifier[length] : identifier[uniform_int] = literal[int] ): literal[string] identifier[h] , identifier[w] = identifier[x] . identifier[shape] [ literal[int] :] keyword[for] identifier[...
def _cutout(x, n_holes: uniform_int=1, length: uniform_int=40): """Cut out `n_holes` number of square holes of size `length` in image at random locations.""" (h, w) = x.shape[1:] for n in range(n_holes): h_y = np.random.randint(0, h) h_x = np.random.randint(0, w) y1 = int(np.clip(h_y...
def _get_xml_value(value): """Convert an individual value to an XML string. Calls itself recursively for dictionaries and lists. Uses some heuristics to convert the data to XML: - In dictionaries, the keys become the tag name. - In lists the tag name is 'child' with an order-attribute givin...
def function[_get_xml_value, parameter[value]]: constant[Convert an individual value to an XML string. Calls itself recursively for dictionaries and lists. Uses some heuristics to convert the data to XML: - In dictionaries, the keys become the tag name. - In lists the tag name is 'child...
keyword[def] identifier[_get_xml_value] ( identifier[value] ): literal[string] identifier[retval] =[] keyword[if] identifier[isinstance] ( identifier[value] , identifier[dict] ): keyword[for] identifier[key] , identifier[value] keyword[in] identifier[value] . identifier[iteritems] (): ...
def _get_xml_value(value): """Convert an individual value to an XML string. Calls itself recursively for dictionaries and lists. Uses some heuristics to convert the data to XML: - In dictionaries, the keys become the tag name. - In lists the tag name is 'child' with an order-attribute givin...
def entry_from_raw(self, rval: RawEntry, jptr: JSONPointer = "") -> EntryValue: """Transform a raw (leaf-)list entry into the cooked form. Args: rval: raw entry (scalar or object) jptr: JSON pointer of the entry Raises: NonexistentSchemaNode: If a member ins...
def function[entry_from_raw, parameter[self, rval, jptr]]: constant[Transform a raw (leaf-)list entry into the cooked form. Args: rval: raw entry (scalar or object) jptr: JSON pointer of the entry Raises: NonexistentSchemaNode: If a member inside `rval` is n...
keyword[def] identifier[entry_from_raw] ( identifier[self] , identifier[rval] : identifier[RawEntry] , identifier[jptr] : identifier[JSONPointer] = literal[string] )-> identifier[EntryValue] : literal[string] keyword[return] identifier[super] (). identifier[from_raw] ( identifier[rval] , identifie...
def entry_from_raw(self, rval: RawEntry, jptr: JSONPointer='') -> EntryValue: """Transform a raw (leaf-)list entry into the cooked form. Args: rval: raw entry (scalar or object) jptr: JSON pointer of the entry Raises: NonexistentSchemaNode: If a member inside `r...
def is_valid(self, qstr=None): """Return True if string is valid""" if qstr is None: qstr = self.currentText() return QUrl(qstr).isValid()
def function[is_valid, parameter[self, qstr]]: constant[Return True if string is valid] if compare[name[qstr] is constant[None]] begin[:] variable[qstr] assign[=] call[name[self].currentText, parameter[]] return[call[call[name[QUrl], parameter[name[qstr]]].isValid, parameter[]]]
keyword[def] identifier[is_valid] ( identifier[self] , identifier[qstr] = keyword[None] ): literal[string] keyword[if] identifier[qstr] keyword[is] keyword[None] : identifier[qstr] = identifier[self] . identifier[currentText] () keyword[return] identifier[QUrl] ( ident...
def is_valid(self, qstr=None): """Return True if string is valid""" if qstr is None: qstr = self.currentText() # depends on [control=['if'], data=['qstr']] return QUrl(qstr).isValid()
def load_external_class(python_file, base_class): """ Returns a tuple: (subclass of base_class, module) """ loaded_module = load_external_module(python_file) # Find a class that extends base_class loaded_class = extract_class(loaded_module, base_class) return loaded_class, loaded_module
def function[load_external_class, parameter[python_file, base_class]]: constant[ Returns a tuple: (subclass of base_class, module) ] variable[loaded_module] assign[=] call[name[load_external_module], parameter[name[python_file]]] variable[loaded_class] assign[=] call[name[extract_class],...
keyword[def] identifier[load_external_class] ( identifier[python_file] , identifier[base_class] ): literal[string] identifier[loaded_module] = identifier[load_external_module] ( identifier[python_file] ) identifier[loaded_class] = identifier[extract_class] ( identifier[loaded_module] , identifie...
def load_external_class(python_file, base_class): """ Returns a tuple: (subclass of base_class, module) """ loaded_module = load_external_module(python_file) # Find a class that extends base_class loaded_class = extract_class(loaded_module, base_class) return (loaded_class, loaded_module)
def plot(self, wavelengths=None, flux_unit=None, area=None, vegaspec=None, **kwargs): # pragma: no cover """Plot the spectrum. .. note:: Uses :mod:`matplotlib`. Parameters ---------- wavelengths : array-like, `~astropy.units.quantity.Quantity`, or `None` ...
def function[plot, parameter[self, wavelengths, flux_unit, area, vegaspec]]: constant[Plot the spectrum. .. note:: Uses :mod:`matplotlib`. Parameters ---------- wavelengths : array-like, `~astropy.units.quantity.Quantity`, or `None` Wavelength values for integration...
keyword[def] identifier[plot] ( identifier[self] , identifier[wavelengths] = keyword[None] , identifier[flux_unit] = keyword[None] , identifier[area] = keyword[None] , identifier[vegaspec] = keyword[None] , ** identifier[kwargs] ): literal[string] identifier[w] , identifier[y] = identifier[self] . ...
def plot(self, wavelengths=None, flux_unit=None, area=None, vegaspec=None, **kwargs): # pragma: no cover 'Plot the spectrum.\n\n .. note:: Uses :mod:`matplotlib`.\n\n Parameters\n ----------\n wavelengths : array-like, `~astropy.units.quantity.Quantity`, or `None`\n Wavelengt...
def Runtime_setCustomObjectFormatterEnabled(self, enabled): """ Function path: Runtime.setCustomObjectFormatterEnabled Domain: Runtime Method name: setCustomObjectFormatterEnabled WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'enabled' (type: boolean) ->...
def function[Runtime_setCustomObjectFormatterEnabled, parameter[self, enabled]]: constant[ Function path: Runtime.setCustomObjectFormatterEnabled Domain: Runtime Method name: setCustomObjectFormatterEnabled WARNING: This function is marked 'Experimental'! Parameters: Required arguments: ...
keyword[def] identifier[Runtime_setCustomObjectFormatterEnabled] ( identifier[self] , identifier[enabled] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[enabled] ,( identifier[bool] ,) ), literal[string] % identifier[type] ( identifier[enabled] ) identifier[subdom_funcs] = iden...
def Runtime_setCustomObjectFormatterEnabled(self, enabled): """ Function path: Runtime.setCustomObjectFormatterEnabled Domain: Runtime Method name: setCustomObjectFormatterEnabled WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'enabled' (type: boolean) ...
def expand_indicators(indicator): """Process indicators expanding file hashes/custom indicators into multiple entries. Args: indicator (string): " : " delimited string Returns: (list): a list of indicators split on " : ". """ if indicator.count(' : ') > 0...
def function[expand_indicators, parameter[indicator]]: constant[Process indicators expanding file hashes/custom indicators into multiple entries. Args: indicator (string): " : " delimited string Returns: (list): a list of indicators split on " : ". ] if c...
keyword[def] identifier[expand_indicators] ( identifier[indicator] ): literal[string] keyword[if] identifier[indicator] . identifier[count] ( literal[string] )> literal[int] : identifier[indicator_list] =[] identifier[iregx_pattern] = literal[string...
def expand_indicators(indicator): """Process indicators expanding file hashes/custom indicators into multiple entries. Args: indicator (string): " : " delimited string Returns: (list): a list of indicators split on " : ". """ if indicator.count(' : ') > 0: ...
def zero_crossing_before(self, n): """Find nearest zero crossing in waveform before frame ``n``""" n_in_samples = int(n * self.samplerate) search_start = n_in_samples - self.samplerate if search_start < 0: search_start = 0 frame = zero_crossing_last( sel...
def function[zero_crossing_before, parameter[self, n]]: constant[Find nearest zero crossing in waveform before frame ``n``] variable[n_in_samples] assign[=] call[name[int], parameter[binary_operation[name[n] * name[self].samplerate]]] variable[search_start] assign[=] binary_operation[name[n_in_s...
keyword[def] identifier[zero_crossing_before] ( identifier[self] , identifier[n] ): literal[string] identifier[n_in_samples] = identifier[int] ( identifier[n] * identifier[self] . identifier[samplerate] ) identifier[search_start] = identifier[n_in_samples] - identifier[self] . identifier[...
def zero_crossing_before(self, n): """Find nearest zero crossing in waveform before frame ``n``""" n_in_samples = int(n * self.samplerate) search_start = n_in_samples - self.samplerate if search_start < 0: search_start = 0 # depends on [control=['if'], data=['search_start']] frame = zero_cr...
def decode(cls, root_element): """ Decode the object to the object :param root_element: the parsed xml Element :type root_element: xml.etree.ElementTree.Element :return: the decoded Element as object :rtype: object """ new_object = cls() field_nam...
def function[decode, parameter[cls, root_element]]: constant[ Decode the object to the object :param root_element: the parsed xml Element :type root_element: xml.etree.ElementTree.Element :return: the decoded Element as object :rtype: object ] variable[ne...
keyword[def] identifier[decode] ( identifier[cls] , identifier[root_element] ): literal[string] identifier[new_object] = identifier[cls] () identifier[field_names_to_attributes] = identifier[new_object] . identifier[_get_field_names_to_attributes] () keyword[for] identifier[child...
def decode(cls, root_element): """ Decode the object to the object :param root_element: the parsed xml Element :type root_element: xml.etree.ElementTree.Element :return: the decoded Element as object :rtype: object """ new_object = cls() field_names_to_attrib...
def intersectionlist_to_matrix(ilist, xterms, yterms): """ WILL BE DEPRECATED Replace with method to return pandas dataframe """ z = [ [0] * len(xterms) for i1 in range(len(yterms)) ] xmap = {} xi = 0 for x in xterms: xmap[x] = xi ...
def function[intersectionlist_to_matrix, parameter[ilist, xterms, yterms]]: constant[ WILL BE DEPRECATED Replace with method to return pandas dataframe ] variable[z] assign[=] <ast.ListComp object at 0x7da20e954670> variable[xmap] assign[=] dictionary[[], []] var...
keyword[def] identifier[intersectionlist_to_matrix] ( identifier[ilist] , identifier[xterms] , identifier[yterms] ): literal[string] identifier[z] =[[ literal[int] ]* identifier[len] ( identifier[xterms] ) keyword[for] identifier[i1] keyword[in] identifier[range] ( identifier[len] ( identifier[y...
def intersectionlist_to_matrix(ilist, xterms, yterms): """ WILL BE DEPRECATED Replace with method to return pandas dataframe """ z = [[0] * len(xterms) for i1 in range(len(yterms))] xmap = {} xi = 0 for x in xterms: xmap[x] = xi xi = xi + 1 # depends on [con...
def _get_queue_lock(self, queue, log): """Get queue lock for max worker queues. For max worker queues it returns a Lock if acquired and whether it failed to acquire the lock. """ max_workers = self.max_workers_per_queue # Check if this is single worker queue for...
def function[_get_queue_lock, parameter[self, queue, log]]: constant[Get queue lock for max worker queues. For max worker queues it returns a Lock if acquired and whether it failed to acquire the lock. ] variable[max_workers] assign[=] name[self].max_workers_per_queue fo...
keyword[def] identifier[_get_queue_lock] ( identifier[self] , identifier[queue] , identifier[log] ): literal[string] identifier[max_workers] = identifier[self] . identifier[max_workers_per_queue] keyword[for] identifier[part] keyword[in] identifier[dotted_parts] ( identifier[...
def _get_queue_lock(self, queue, log): """Get queue lock for max worker queues. For max worker queues it returns a Lock if acquired and whether it failed to acquire the lock. """ max_workers = self.max_workers_per_queue # Check if this is single worker queue for part in dotted_p...
def EXPGauss(w_F, compute_uncertainty=True, is_timeseries=False): """Estimate free energy difference using gaussian approximation to one-sided (unidirectional) exponential averaging. Parameters ---------- w_F : np.ndarray, float w_F[t] is the forward work value from snapshot t. t = 0...(T-1) ...
def function[EXPGauss, parameter[w_F, compute_uncertainty, is_timeseries]]: constant[Estimate free energy difference using gaussian approximation to one-sided (unidirectional) exponential averaging. Parameters ---------- w_F : np.ndarray, float w_F[t] is the forward work value from snapshot...
keyword[def] identifier[EXPGauss] ( identifier[w_F] , identifier[compute_uncertainty] = keyword[True] , identifier[is_timeseries] = keyword[False] ): literal[string] identifier[T] = identifier[float] ( identifier[np] . identifier[size] ( identifier[w_F] )) identifier[var] = identifier[np] . ide...
def EXPGauss(w_F, compute_uncertainty=True, is_timeseries=False): """Estimate free energy difference using gaussian approximation to one-sided (unidirectional) exponential averaging. Parameters ---------- w_F : np.ndarray, float w_F[t] is the forward work value from snapshot t. t = 0...(T-1) ...
def listcoins(self): ''' Use this function to list all coins with their data which are available on cryptocoincharts. Usage: http://api.cryptocoincharts.info/listCoins ''' url = self.API_PATH + 'listCoins' json_data = json.loads(self._getdata(url)) ...
def function[listcoins, parameter[self]]: constant[ Use this function to list all coins with their data which are available on cryptocoincharts. Usage: http://api.cryptocoincharts.info/listCoins ] variable[url] assign[=] binary_operation[name[self].API_PATH + constant[listCoins]]...
keyword[def] identifier[listcoins] ( identifier[self] ): literal[string] identifier[url] = identifier[self] . identifier[API_PATH] + literal[string] identifier[json_data] = identifier[json] . identifier[loads] ( identifier[self] . identifier[_getdata] ( identifier[url] )) ident...
def listcoins(self): """ Use this function to list all coins with their data which are available on cryptocoincharts. Usage: http://api.cryptocoincharts.info/listCoins """ url = self.API_PATH + 'listCoins' json_data = json.loads(self._getdata(url)) coins = [] for entry in jso...
def compute_allocated_size(size, is_encrypted): # type: (int, bool) -> int """Compute allocated size on disk :param int size: size (content length) :param bool is_ecrypted: if entity is encrypted :rtype: int :return: required size on disk """ # compute siz...
def function[compute_allocated_size, parameter[size, is_encrypted]]: constant[Compute allocated size on disk :param int size: size (content length) :param bool is_ecrypted: if entity is encrypted :rtype: int :return: required size on disk ] if compare[name[size] g...
keyword[def] identifier[compute_allocated_size] ( identifier[size] , identifier[is_encrypted] ): literal[string] keyword[if] identifier[size] > literal[int] : keyword[if] identifier[is_encrypted] : identifier[allocatesize] =( i...
def compute_allocated_size(size, is_encrypted): # type: (int, bool) -> int 'Compute allocated size on disk\n :param int size: size (content length)\n :param bool is_ecrypted: if entity is encrypted\n :rtype: int\n :return: required size on disk\n ' # compute size if si...
def IsPayable(self): """ Flag indicating if the contract accepts payments. Returns: bool: True if supported. False otherwise. """ from neo.Core.State.ContractState import ContractPropertyState return self.ContractProperties & ContractPropertyState.Payable > 0
def function[IsPayable, parameter[self]]: constant[ Flag indicating if the contract accepts payments. Returns: bool: True if supported. False otherwise. ] from relative_module[neo.Core.State.ContractState] import module[ContractPropertyState] return[compare[binary_op...
keyword[def] identifier[IsPayable] ( identifier[self] ): literal[string] keyword[from] identifier[neo] . identifier[Core] . identifier[State] . identifier[ContractState] keyword[import] identifier[ContractPropertyState] keyword[return] identifier[self] . identifier[ContractProperties]...
def IsPayable(self): """ Flag indicating if the contract accepts payments. Returns: bool: True if supported. False otherwise. """ from neo.Core.State.ContractState import ContractPropertyState return self.ContractProperties & ContractPropertyState.Payable > 0
def getPlatformsByName(platformNames=['all'], mode=None, tags=[], excludePlatformNames=[]): """Method that recovers the names of the <Platforms> in a given list. :param platformNames: List of strings containing the possible platforms. :param mode: The mode of the search. The following can be ...
def function[getPlatformsByName, parameter[platformNames, mode, tags, excludePlatformNames]]: constant[Method that recovers the names of the <Platforms> in a given list. :param platformNames: List of strings containing the possible platforms. :param mode: The mode of the search. The follo...
keyword[def] identifier[getPlatformsByName] ( identifier[platformNames] =[ literal[string] ], identifier[mode] = keyword[None] , identifier[tags] =[], identifier[excludePlatformNames] =[]): literal[string] identifier[allPlatformsList] = identifier[getAllPlatformObjects] ( identifier[mode] ) identifi...
def getPlatformsByName(platformNames=['all'], mode=None, tags=[], excludePlatformNames=[]): """Method that recovers the names of the <Platforms> in a given list. :param platformNames: List of strings containing the possible platforms. :param mode: The mode of the search. The following can be ...
def mito(args): """ %prog mito chrM.fa input.bam Identify mitochondrial deletions. """ p = OptionParser(mito.__doc__) p.set_aws_opts(store="hli-mv-data-science/htang/mito-deletions") p.add_option("--realignonly", default=False, action="store_true", help="Realign only") ...
def function[mito, parameter[args]]: constant[ %prog mito chrM.fa input.bam Identify mitochondrial deletions. ] variable[p] assign[=] call[name[OptionParser], parameter[name[mito].__doc__]] call[name[p].set_aws_opts, parameter[]] call[name[p].add_option, parameter[constant[-...
keyword[def] identifier[mito] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[mito] . identifier[__doc__] ) identifier[p] . identifier[set_aws_opts] ( identifier[store] = literal[string] ) identifier[p] . identifier[add_option] ( literal[string] , ident...
def mito(args): """ %prog mito chrM.fa input.bam Identify mitochondrial deletions. """ p = OptionParser(mito.__doc__) p.set_aws_opts(store='hli-mv-data-science/htang/mito-deletions') p.add_option('--realignonly', default=False, action='store_true', help='Realign only') p.add_option('--s...
def switch_db(name): """ Hack to switch Flask-Pymongo db :param name: db name """ with app.app_context(): app.extensions['pymongo'][mongo.config_prefix] = mongo.cx, mongo.cx[name]
def function[switch_db, parameter[name]]: constant[ Hack to switch Flask-Pymongo db :param name: db name ] with call[name[app].app_context, parameter[]] begin[:] call[call[name[app].extensions][constant[pymongo]]][name[mongo].config_prefix] assign[=] tuple[[<ast.Attribute object ...
keyword[def] identifier[switch_db] ( identifier[name] ): literal[string] keyword[with] identifier[app] . identifier[app_context] (): identifier[app] . identifier[extensions] [ literal[string] ][ identifier[mongo] . identifier[config_prefix] ]= identifier[mongo] . identifier[cx] , identifier[mongo...
def switch_db(name): """ Hack to switch Flask-Pymongo db :param name: db name """ with app.app_context(): app.extensions['pymongo'][mongo.config_prefix] = (mongo.cx, mongo.cx[name]) # depends on [control=['with'], data=[]]
def _load(self): """Load values for all ConfigProperty attributes""" for attr_name, config_prop in self._iter_config_props(): found = False for loader in self._loaders: if loader.exists(config_prop.property_key): raw_value = loader.get(config_p...
def function[_load, parameter[self]]: constant[Load values for all ConfigProperty attributes] for taget[tuple[[<ast.Name object at 0x7da1b257dff0>, <ast.Name object at 0x7da1b257d390>]]] in starred[call[name[self]._iter_config_props, parameter[]]] begin[:] variable[found] assign[=] const...
keyword[def] identifier[_load] ( identifier[self] ): literal[string] keyword[for] identifier[attr_name] , identifier[config_prop] keyword[in] identifier[self] . identifier[_iter_config_props] (): identifier[found] = keyword[False] keyword[for] identifier[loader] keyw...
def _load(self): """Load values for all ConfigProperty attributes""" for (attr_name, config_prop) in self._iter_config_props(): found = False for loader in self._loaders: if loader.exists(config_prop.property_key): raw_value = loader.get(config_prop.property_key) ...
def from_query(query, engine=None, limit=None): """ Execute an ORM style query, and return the result in :class:`prettytable.PrettyTable`. :param query: an ``sqlalchemy.orm.Query`` object. :param engine: an ``sqlalchemy.engine.base.Engine`` object. :param limit: int, limit rows to return. ...
def function[from_query, parameter[query, engine, limit]]: constant[ Execute an ORM style query, and return the result in :class:`prettytable.PrettyTable`. :param query: an ``sqlalchemy.orm.Query`` object. :param engine: an ``sqlalchemy.engine.base.Engine`` object. :param limit: int, limit ...
keyword[def] identifier[from_query] ( identifier[query] , identifier[engine] = keyword[None] , identifier[limit] = keyword[None] ): literal[string] keyword[if] identifier[limit] keyword[is] keyword[not] keyword[None] : identifier[query] = identifier[query] . identifier[limit] ( identifier[limi...
def from_query(query, engine=None, limit=None): """ Execute an ORM style query, and return the result in :class:`prettytable.PrettyTable`. :param query: an ``sqlalchemy.orm.Query`` object. :param engine: an ``sqlalchemy.engine.base.Engine`` object. :param limit: int, limit rows to return. ...
def _autozoom(self): """Calculate zoom and location.""" bounds = self._autobounds() attrs = {} midpoint = lambda a, b: (a + b)/2 attrs['location'] = ( midpoint(bounds['min_lat'], bounds['max_lat']), midpoint(bounds['min_lon'], bounds['max_lon']) )...
def function[_autozoom, parameter[self]]: constant[Calculate zoom and location.] variable[bounds] assign[=] call[name[self]._autobounds, parameter[]] variable[attrs] assign[=] dictionary[[], []] variable[midpoint] assign[=] <ast.Lambda object at 0x7da1b0791300> call[name[attrs]][...
keyword[def] identifier[_autozoom] ( identifier[self] ): literal[string] identifier[bounds] = identifier[self] . identifier[_autobounds] () identifier[attrs] ={} identifier[midpoint] = keyword[lambda] identifier[a] , identifier[b] :( identifier[a] + identifier[b] )/ literal[int]...
def _autozoom(self): """Calculate zoom and location.""" bounds = self._autobounds() attrs = {} midpoint = lambda a, b: (a + b) / 2 attrs['location'] = (midpoint(bounds['min_lat'], bounds['max_lat']), midpoint(bounds['min_lon'], bounds['max_lon'])) # self._folium_map.fit_bounds( # [bounds...
def add_object(cls, attr, title='', display=''): """Adds a ``list_display`` attribute showing an object. Supports double underscore attribute name dereferencing. :param attr: Name of the attribute to dereference from the corresponding object, i.e. what will be lined to....
def function[add_object, parameter[cls, attr, title, display]]: constant[Adds a ``list_display`` attribute showing an object. Supports double underscore attribute name dereferencing. :param attr: Name of the attribute to dereference from the corresponding object, i.e. w...
keyword[def] identifier[add_object] ( identifier[cls] , identifier[attr] , identifier[title] = literal[string] , identifier[display] = literal[string] ): literal[string] keyword[global] identifier[klass_count] identifier[klass_count] += literal[int] identifier[fn_name] = litera...
def add_object(cls, attr, title='', display=''): """Adds a ``list_display`` attribute showing an object. Supports double underscore attribute name dereferencing. :param attr: Name of the attribute to dereference from the corresponding object, i.e. what will be lined to. Th...
def autobuild_trub_script(file_name, slot_assignments=None, os_info=None, sensor_graph=None, app_info=None, use_safeupdate=False): """Build a trub script that loads given firmware into the given slots. slot_assignments should be a list of tuples in the following form: ("slot X" or...
def function[autobuild_trub_script, parameter[file_name, slot_assignments, os_info, sensor_graph, app_info, use_safeupdate]]: constant[Build a trub script that loads given firmware into the given slots. slot_assignments should be a list of tuples in the following form: ("slot X" or "controller", firmwa...
keyword[def] identifier[autobuild_trub_script] ( identifier[file_name] , identifier[slot_assignments] = keyword[None] , identifier[os_info] = keyword[None] , identifier[sensor_graph] = keyword[None] , identifier[app_info] = keyword[None] , identifier[use_safeupdate] = keyword[False] ): literal[string] id...
def autobuild_trub_script(file_name, slot_assignments=None, os_info=None, sensor_graph=None, app_info=None, use_safeupdate=False): """Build a trub script that loads given firmware into the given slots. slot_assignments should be a list of tuples in the following form: ("slot X" or "controller", firmware_im...
def unblock_pin(ctx, puk, new_pin): """ Unblock the PIN. Reset the PIN using the PUK code. """ controller = ctx.obj['controller'] if not puk: puk = click.prompt( 'Enter PUK', default='', show_default=False, hide_input=True, err=True) if not new_pin: n...
def function[unblock_pin, parameter[ctx, puk, new_pin]]: constant[ Unblock the PIN. Reset the PIN using the PUK code. ] variable[controller] assign[=] call[name[ctx].obj][constant[controller]] if <ast.UnaryOp object at 0x7da207f9bcd0> begin[:] variable[puk] assign[=]...
keyword[def] identifier[unblock_pin] ( identifier[ctx] , identifier[puk] , identifier[new_pin] ): literal[string] identifier[controller] = identifier[ctx] . identifier[obj] [ literal[string] ] keyword[if] keyword[not] identifier[puk] : identifier[puk] = identifier[click] . identifier[prompt...
def unblock_pin(ctx, puk, new_pin): """ Unblock the PIN. Reset the PIN using the PUK code. """ controller = ctx.obj['controller'] if not puk: puk = click.prompt('Enter PUK', default='', show_default=False, hide_input=True, err=True) # depends on [control=['if'], data=[]] if not new...
def quadraticEval(a, b, c, x): """given all params return the result of quadratic equation a*x^2 + b*x + c""" return a*(x**2) + b*x + c
def function[quadraticEval, parameter[a, b, c, x]]: constant[given all params return the result of quadratic equation a*x^2 + b*x + c] return[binary_operation[binary_operation[binary_operation[name[a] * binary_operation[name[x] ** constant[2]]] + binary_operation[name[b] * name[x]]] + name[c]]]
keyword[def] identifier[quadraticEval] ( identifier[a] , identifier[b] , identifier[c] , identifier[x] ): literal[string] keyword[return] identifier[a] *( identifier[x] ** literal[int] )+ identifier[b] * identifier[x] + identifier[c]
def quadraticEval(a, b, c, x): """given all params return the result of quadratic equation a*x^2 + b*x + c""" return a * x ** 2 + b * x + c
def close_umanager(self, force=False): """Used to close an uManager session. :param force: try to close a session regardless of a connection object internal state """ if not (force or self.umanager_opened): return # make sure we've got a fresh prompt ...
def function[close_umanager, parameter[self, force]]: constant[Used to close an uManager session. :param force: try to close a session regardless of a connection object internal state ] if <ast.UnaryOp object at 0x7da1b0cfffa0> begin[:] return[None] call[name[sel...
keyword[def] identifier[close_umanager] ( identifier[self] , identifier[force] = keyword[False] ): literal[string] keyword[if] keyword[not] ( identifier[force] keyword[or] identifier[self] . identifier[umanager_opened] ): keyword[return] identifier[self] . id...
def close_umanager(self, force=False): """Used to close an uManager session. :param force: try to close a session regardless of a connection object internal state """ if not (force or self.umanager_opened): return # depends on [control=['if'], data=[]] # make sure we've got...