code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def region_est_ellipsoid(self, level=0.95, tol=0.0001, modelparam_slice=None): r""" Estimates a credible region over models by finding the minimum volume enclosing ellipse (MVEE) of a credible subset of particles. :param float level: The desired crediblity level (see :meth:`...
def function[region_est_ellipsoid, parameter[self, level, tol, modelparam_slice]]: constant[ Estimates a credible region over models by finding the minimum volume enclosing ellipse (MVEE) of a credible subset of particles. :param float level: The desired crediblity level (see ...
keyword[def] identifier[region_est_ellipsoid] ( identifier[self] , identifier[level] = literal[int] , identifier[tol] = literal[int] , identifier[modelparam_slice] = keyword[None] ): literal[string] identifier[_] , identifier[vertices] = identifier[self] . identifier[region_est_hull] ( identifier[l...
def region_est_ellipsoid(self, level=0.95, tol=0.0001, modelparam_slice=None): """ Estimates a credible region over models by finding the minimum volume enclosing ellipse (MVEE) of a credible subset of particles. :param float level: The desired crediblity level (see :meth:`SMCUp...
def add_wf(self,wf_obj): """ Adds a token object to the text layer @type wf_obj: L{Cwf} @param wf_obj: token object """ if wf_obj.get_id() in self.idx: raise ValueError("Text node (wf) with id {} already exists!" .format(wf_obj.get...
def function[add_wf, parameter[self, wf_obj]]: constant[ Adds a token object to the text layer @type wf_obj: L{Cwf} @param wf_obj: token object ] if compare[call[name[wf_obj].get_id, parameter[]] in name[self].idx] begin[:] <ast.Raise object at 0x7da1b2585bd0> ...
keyword[def] identifier[add_wf] ( identifier[self] , identifier[wf_obj] ): literal[string] keyword[if] identifier[wf_obj] . identifier[get_id] () keyword[in] identifier[self] . identifier[idx] : keyword[raise] identifier[ValueError] ( literal[string] . identifier[format...
def add_wf(self, wf_obj): """ Adds a token object to the text layer @type wf_obj: L{Cwf} @param wf_obj: token object """ if wf_obj.get_id() in self.idx: raise ValueError('Text node (wf) with id {} already exists!'.format(wf_obj.get_id())) # depends on [control=['if'], da...
def get_version_text(self): """Return the version information from Unix host.""" version_text = None try: version_text = self.device.send('uname -sr', timeout=10) except CommandError as exc: exc.command = 'show version' raise exc return versi...
def function[get_version_text, parameter[self]]: constant[Return the version information from Unix host.] variable[version_text] assign[=] constant[None] <ast.Try object at 0x7da1b25ef220> return[name[version_text]]
keyword[def] identifier[get_version_text] ( identifier[self] ): literal[string] identifier[version_text] = keyword[None] keyword[try] : identifier[version_text] = identifier[self] . identifier[device] . identifier[send] ( literal[string] , identifier[timeout] = literal[int] ...
def get_version_text(self): """Return the version information from Unix host.""" version_text = None try: version_text = self.device.send('uname -sr', timeout=10) # depends on [control=['try'], data=[]] except CommandError as exc: exc.command = 'show version' raise exc # depend...
def get_last_modified_date(filename): """ Get the last modified date of a given file :param filename: string: pathname of a file :return: Date """ if os.path.isfile(filename): t = os.path.getmtime(filename) return datetime.date.fromtimestamp(t).strftime('%d/%m/%Y') return No...
def function[get_last_modified_date, parameter[filename]]: constant[ Get the last modified date of a given file :param filename: string: pathname of a file :return: Date ] if call[name[os].path.isfile, parameter[name[filename]]] begin[:] variable[t] assign[=] call[name[o...
keyword[def] identifier[get_last_modified_date] ( identifier[filename] ): literal[string] keyword[if] identifier[os] . identifier[path] . identifier[isfile] ( identifier[filename] ): identifier[t] = identifier[os] . identifier[path] . identifier[getmtime] ( identifier[filename] ) keyword...
def get_last_modified_date(filename): """ Get the last modified date of a given file :param filename: string: pathname of a file :return: Date """ if os.path.isfile(filename): t = os.path.getmtime(filename) return datetime.date.fromtimestamp(t).strftime('%d/%m/%Y') # depends on...
def plot_samples(self, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=True, apply_link=False, visible_dims=None, which_data_ycols='all', samples=3, projection='2d', label='gp_samples', predict_kw=None, **kwargs): """...
def function[plot_samples, parameter[self, plot_limits, fixed_inputs, resolution, plot_raw, apply_link, visible_dims, which_data_ycols, samples, projection, label, predict_kw]]: constant[ Plot the mean of the GP. You can deactivate the legend for this one plot by supplying None to label. Give the ...
keyword[def] identifier[plot_samples] ( identifier[self] , identifier[plot_limits] = keyword[None] , identifier[fixed_inputs] = keyword[None] , identifier[resolution] = keyword[None] , identifier[plot_raw] = keyword[True] , identifier[apply_link] = keyword[False] , identifier[visible_dims] = keyword[None] , identi...
def plot_samples(self, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=True, apply_link=False, visible_dims=None, which_data_ycols='all', samples=3, projection='2d', label='gp_samples', predict_kw=None, **kwargs): """ Plot the mean of the GP. You can deactivate the legend for this one plot b...
def search_function(cls, encoding): """Search function to find 'rotunicode' codec.""" if encoding == cls._codec_name: return codecs.CodecInfo( name=cls._codec_name, encode=cls.encode, decode=cls.decode, ) return None
def function[search_function, parameter[cls, encoding]]: constant[Search function to find 'rotunicode' codec.] if compare[name[encoding] equal[==] name[cls]._codec_name] begin[:] return[call[name[codecs].CodecInfo, parameter[]]] return[constant[None]]
keyword[def] identifier[search_function] ( identifier[cls] , identifier[encoding] ): literal[string] keyword[if] identifier[encoding] == identifier[cls] . identifier[_codec_name] : keyword[return] identifier[codecs] . identifier[CodecInfo] ( identifier[name] = identifier...
def search_function(cls, encoding): """Search function to find 'rotunicode' codec.""" if encoding == cls._codec_name: return codecs.CodecInfo(name=cls._codec_name, encode=cls.encode, decode=cls.decode) # depends on [control=['if'], data=[]] return None
def download_url(url, root, filename=None, md5=None): """Download a file from a url and place it in root. Args: url (str): URL to download file from root (str): Directory to place downloaded file in filename (str, optional): Name to save the file under. If None, use the basename of the ...
def function[download_url, parameter[url, root, filename, md5]]: constant[Download a file from a url and place it in root. Args: url (str): URL to download file from root (str): Directory to place downloaded file in filename (str, optional): Name to save the file under. If None, use...
keyword[def] identifier[download_url] ( identifier[url] , identifier[root] , identifier[filename] = keyword[None] , identifier[md5] = keyword[None] ): literal[string] keyword[from] identifier[six] . identifier[moves] keyword[import] identifier[urllib] identifier[root] = identifier[os] . identifie...
def download_url(url, root, filename=None, md5=None): """Download a file from a url and place it in root. Args: url (str): URL to download file from root (str): Directory to place downloaded file in filename (str, optional): Name to save the file under. If None, use the basename of the ...
def textForSaving(self): """Get text with correct EOL symbols. Use this method for saving a file to storage """ lines = self.text.splitlines() if self.text.endswith('\n'): # splitlines ignores last \n lines.append('') return self.eol.join(lines) + self.eol
def function[textForSaving, parameter[self]]: constant[Get text with correct EOL symbols. Use this method for saving a file to storage ] variable[lines] assign[=] call[name[self].text.splitlines, parameter[]] if call[name[self].text.endswith, parameter[constant[ ]]] begin[:] ...
keyword[def] identifier[textForSaving] ( identifier[self] ): literal[string] identifier[lines] = identifier[self] . identifier[text] . identifier[splitlines] () keyword[if] identifier[self] . identifier[text] . identifier[endswith] ( literal[string] ): identifier[lines] . ide...
def textForSaving(self): """Get text with correct EOL symbols. Use this method for saving a file to storage """ lines = self.text.splitlines() if self.text.endswith('\n'): # splitlines ignores last \n lines.append('') # depends on [control=['if'], data=[]] return self.eol.join(lines) +...
def exec_command( client, container, command, interactive=True, stdout=None, stderr=None, stdin=None): """ Run provided command via exec API in provided container. This is just a wrapper for PseudoTerminal(client, container).exec_command() """ exec_id = exec_create(client, container, comman...
def function[exec_command, parameter[client, container, command, interactive, stdout, stderr, stdin]]: constant[ Run provided command via exec API in provided container. This is just a wrapper for PseudoTerminal(client, container).exec_command() ] variable[exec_id] assign[=] call[name[exec_...
keyword[def] identifier[exec_command] ( identifier[client] , identifier[container] , identifier[command] , identifier[interactive] = keyword[True] , identifier[stdout] = keyword[None] , identifier[stderr] = keyword[None] , identifier[stdin] = keyword[None] ): literal[string] identifier[exec_id] = identifi...
def exec_command(client, container, command, interactive=True, stdout=None, stderr=None, stdin=None): """ Run provided command via exec API in provided container. This is just a wrapper for PseudoTerminal(client, container).exec_command() """ exec_id = exec_create(client, container, command, intera...
def get_long_description(): """Convert the README file into the long description. """ with open(path.join(root_path, 'README.md'), encoding='utf-8') as f: long_description = f.read() return long_description
def function[get_long_description, parameter[]]: constant[Convert the README file into the long description. ] with call[name[open], parameter[call[name[path].join, parameter[name[root_path], constant[README.md]]]]] begin[:] variable[long_description] assign[=] call[name[f].read, par...
keyword[def] identifier[get_long_description] (): literal[string] keyword[with] identifier[open] ( identifier[path] . identifier[join] ( identifier[root_path] , literal[string] ), identifier[encoding] = literal[string] ) keyword[as] identifier[f] : identifier[long_description] = identifier[f] . ...
def get_long_description(): """Convert the README file into the long description. """ with open(path.join(root_path, 'README.md'), encoding='utf-8') as f: long_description = f.read() # depends on [control=['with'], data=['f']] return long_description
def page(self, status=values.unset, phone_number=values.unset, incoming_phone_number_sid=values.unset, friendly_name=values.unset, unique_name=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of Ho...
def function[page, parameter[self, status, phone_number, incoming_phone_number_sid, friendly_name, unique_name, page_token, page_number, page_size]]: constant[ Retrieve a single page of HostedNumberOrderInstance records from the API. Request is executed immediately :param HostedNumberOr...
keyword[def] identifier[page] ( identifier[self] , identifier[status] = identifier[values] . identifier[unset] , identifier[phone_number] = identifier[values] . identifier[unset] , identifier[incoming_phone_number_sid] = identifier[values] . identifier[unset] , identifier[friendly_name] = identifier[values] . identi...
def page(self, status=values.unset, phone_number=values.unset, incoming_phone_number_sid=values.unset, friendly_name=values.unset, unique_name=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of HostedNumberOrderInstance records from the AP...
def random_tracing(): """ Create new Tracing() tuple with random IDs. """ new_id = _uniq_id() return Tracing( span_id=new_id, parent_id=0, trace_id=new_id, traceflags=0)
def function[random_tracing, parameter[]]: constant[ Create new Tracing() tuple with random IDs. ] variable[new_id] assign[=] call[name[_uniq_id], parameter[]] return[call[name[Tracing], parameter[]]]
keyword[def] identifier[random_tracing] (): literal[string] identifier[new_id] = identifier[_uniq_id] () keyword[return] identifier[Tracing] ( identifier[span_id] = identifier[new_id] , identifier[parent_id] = literal[int] , identifier[trace_id] = identifier[new_id] , identifier[t...
def random_tracing(): """ Create new Tracing() tuple with random IDs. """ new_id = _uniq_id() return Tracing(span_id=new_id, parent_id=0, trace_id=new_id, traceflags=0)
def run_subprocess(command): """ command is the command to run, as a string. runs a subprocess, returns stdout and stderr from the subprocess as strings. """ x = Popen(command, shell=True, stdout=PIPE, stderr=PIPE) out, err = x.communicate() out = out.decode('utf-8') err = err.decode('ut...
def function[run_subprocess, parameter[command]]: constant[ command is the command to run, as a string. runs a subprocess, returns stdout and stderr from the subprocess as strings. ] variable[x] assign[=] call[name[Popen], parameter[name[command]]] <ast.Tuple object at 0x7da1b1908c10...
keyword[def] identifier[run_subprocess] ( identifier[command] ): literal[string] identifier[x] = identifier[Popen] ( identifier[command] , identifier[shell] = keyword[True] , identifier[stdout] = identifier[PIPE] , identifier[stderr] = identifier[PIPE] ) identifier[out] , identifier[err] = identifier[...
def run_subprocess(command): """ command is the command to run, as a string. runs a subprocess, returns stdout and stderr from the subprocess as strings. """ x = Popen(command, shell=True, stdout=PIPE, stderr=PIPE) (out, err) = x.communicate() out = out.decode('utf-8') err = err.decode('...
def _compute_weight_std(self, C, mag): """ Common part of equations 8 and 9, page 971. """ if mag < 6.0: return C['a1'] elif mag >= 6.0 and mag < 6.5: return C['a1'] + (C['a2'] - C['a1']) * ((mag - 6.0) / 0.5) else: return C['a...
def function[_compute_weight_std, parameter[self, C, mag]]: constant[ Common part of equations 8 and 9, page 971. ] if compare[name[mag] less[<] constant[6.0]] begin[:] return[call[name[C]][constant[a1]]]
keyword[def] identifier[_compute_weight_std] ( identifier[self] , identifier[C] , identifier[mag] ): literal[string] keyword[if] identifier[mag] < literal[int] : keyword[return] identifier[C] [ literal[string] ] keyword[elif] identifier[mag] >= literal[int] keyword[and...
def _compute_weight_std(self, C, mag): """ Common part of equations 8 and 9, page 971. """ if mag < 6.0: return C['a1'] # depends on [control=['if'], data=[]] elif mag >= 6.0 and mag < 6.5: return C['a1'] + (C['a2'] - C['a1']) * ((mag - 6.0) / 0.5) # depends on [control=['i...
def answer_callback_query(self, callback_query_id, text=None, show_alert=None, url=None, cache_time=None): """ Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. ...
def function[answer_callback_query, parameter[self, callback_query_id, text, show_alert, url, cache_time]]: constant[ Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an ...
keyword[def] identifier[answer_callback_query] ( identifier[self] , identifier[callback_query_id] , identifier[text] = keyword[None] , identifier[show_alert] = keyword[None] , identifier[url] = keyword[None] , identifier[cache_time] = keyword[None] ): literal[string] keyword[return] identifier[api...
def answer_callback_query(self, callback_query_id, text=None, show_alert=None, url=None, cache_time=None): """ Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. ...
def concatenate(self, other): """Return a new name which is the concatenation of self and other. @rtype: dns.name.Name object @raises AbsoluteConcatenation: self is absolute and other is not the empty name """ if self.is_absolute() and len(other) > 0: raise A...
def function[concatenate, parameter[self, other]]: constant[Return a new name which is the concatenation of self and other. @rtype: dns.name.Name object @raises AbsoluteConcatenation: self is absolute and other is not the empty name ] if <ast.BoolOp object at 0x7da18fe921...
keyword[def] identifier[concatenate] ( identifier[self] , identifier[other] ): literal[string] keyword[if] identifier[self] . identifier[is_absolute] () keyword[and] identifier[len] ( identifier[other] )> literal[int] : keyword[raise] identifier[AbsoluteConcatenation] ide...
def concatenate(self, other): """Return a new name which is the concatenation of self and other. @rtype: dns.name.Name object @raises AbsoluteConcatenation: self is absolute and other is not the empty name """ if self.is_absolute() and len(other) > 0: raise AbsoluteConcat...
def run(self): """ Queues all services to be polled for metrics. Should be run via beat. """ services = Service.objects.all() for service in services: service_metric_sync.apply_async( kwargs={"service_id": str(service.id)}) key = "service...
def function[run, parameter[self]]: constant[ Queues all services to be polled for metrics. Should be run via beat. ] variable[services] assign[=] call[name[Service].objects.all, parameter[]] for taget[name[service]] in starred[name[services]] begin[:] call[name[s...
keyword[def] identifier[run] ( identifier[self] ): literal[string] identifier[services] = identifier[Service] . identifier[objects] . identifier[all] () keyword[for] identifier[service] keyword[in] identifier[services] : identifier[service_metric_sync] . identifier[apply_a...
def run(self): """ Queues all services to be polled for metrics. Should be run via beat. """ services = Service.objects.all() for service in services: service_metric_sync.apply_async(kwargs={'service_id': str(service.id)}) key = 'services.downtime.%s.sum' % utils.normalise_st...
def allocate_ids(self, incomplete_key, num_ids): """Allocate a list of IDs from a partial key. :type incomplete_key: :class:`google.cloud.datastore.key.Key` :param incomplete_key: Partial key to use as base for allocated IDs. :type num_ids: int :param num_ids: The number of IDs...
def function[allocate_ids, parameter[self, incomplete_key, num_ids]]: constant[Allocate a list of IDs from a partial key. :type incomplete_key: :class:`google.cloud.datastore.key.Key` :param incomplete_key: Partial key to use as base for allocated IDs. :type num_ids: int :param...
keyword[def] identifier[allocate_ids] ( identifier[self] , identifier[incomplete_key] , identifier[num_ids] ): literal[string] keyword[if] keyword[not] identifier[incomplete_key] . identifier[is_partial] : keyword[raise] identifier[ValueError] (( literal[string] , identifier[incompl...
def allocate_ids(self, incomplete_key, num_ids): """Allocate a list of IDs from a partial key. :type incomplete_key: :class:`google.cloud.datastore.key.Key` :param incomplete_key: Partial key to use as base for allocated IDs. :type num_ids: int :param num_ids: The number of IDs to ...
def _write_var_attrs(self, f, varNum, var_attrs, zVar): ''' Writes ADRs and AEDRs for variables Parameters: f : file The open CDF file varNum : int The variable number for adding attributes var_attrs : dict A di...
def function[_write_var_attrs, parameter[self, f, varNum, var_attrs, zVar]]: constant[ Writes ADRs and AEDRs for variables Parameters: f : file The open CDF file varNum : int The variable number for adding attributes var_attrs ...
keyword[def] identifier[_write_var_attrs] ( identifier[self] , identifier[f] , identifier[varNum] , identifier[var_attrs] , identifier[zVar] ): literal[string] keyword[if] ( keyword[not] identifier[isinstance] ( identifier[var_attrs] , identifier[dict] )): keyword[raise] identifier[...
def _write_var_attrs(self, f, varNum, var_attrs, zVar): """ Writes ADRs and AEDRs for variables Parameters: f : file The open CDF file varNum : int The variable number for adding attributes var_attrs : dict A dictio...
def response(self): """ Dictionary of public and private, hostnames and ips. :rtype: dict """ describe_request_params = {} if self.filter is not None: if type(self.filter) is not dict: try: filters = json.loads(self.filter) ...
def function[response, parameter[self]]: constant[ Dictionary of public and private, hostnames and ips. :rtype: dict ] variable[describe_request_params] assign[=] dictionary[[], []] if compare[name[self].filter is_not constant[None]] begin[:] if compare[ca...
keyword[def] identifier[response] ( identifier[self] ): literal[string] identifier[describe_request_params] ={} keyword[if] identifier[self] . identifier[filter] keyword[is] keyword[not] keyword[None] : keyword[if] identifier[type] ( identifier[self] . identifier[filter] ...
def response(self): """ Dictionary of public and private, hostnames and ips. :rtype: dict """ describe_request_params = {} if self.filter is not None: if type(self.filter) is not dict: try: filters = json.loads(self.filter) # depends on [control=[...
def thread_exception(self, raised_exception): """ :meth:`.WThreadTask.thread_exception` implementation. Register (if required) unhandled exception event by a tracker storage :param raised_exception: unhandled exception :return: None """ tracker = self.tracker_storage() if tracker is not None: try: ...
def function[thread_exception, parameter[self, raised_exception]]: constant[ :meth:`.WThreadTask.thread_exception` implementation. Register (if required) unhandled exception event by a tracker storage :param raised_exception: unhandled exception :return: None ] variable[tracker] assign[=] call...
keyword[def] identifier[thread_exception] ( identifier[self] , identifier[raised_exception] ): literal[string] identifier[tracker] = identifier[self] . identifier[tracker_storage] () keyword[if] identifier[tracker] keyword[is] keyword[not] keyword[None] : keyword[try] : keyword[if] identifier[...
def thread_exception(self, raised_exception): """ :meth:`.WThreadTask.thread_exception` implementation. Register (if required) unhandled exception event by a tracker storage :param raised_exception: unhandled exception :return: None """ tracker = self.tracker_storage() if tracker is not None: ...
def find_values_added_to_enums( old_schema: GraphQLSchema, new_schema: GraphQLSchema ) -> List[DangerousChange]: """Find values added to enums. Given two schemas, returns a list containing descriptions of any dangerous changes in the new_schema related to adding values to an enum type. """ old_...
def function[find_values_added_to_enums, parameter[old_schema, new_schema]]: constant[Find values added to enums. Given two schemas, returns a list containing descriptions of any dangerous changes in the new_schema related to adding values to an enum type. ] variable[old_type_map] assign[=]...
keyword[def] identifier[find_values_added_to_enums] ( identifier[old_schema] : identifier[GraphQLSchema] , identifier[new_schema] : identifier[GraphQLSchema] )-> identifier[List] [ identifier[DangerousChange] ]: literal[string] identifier[old_type_map] = identifier[old_schema] . identifier[type_map] ...
def find_values_added_to_enums(old_schema: GraphQLSchema, new_schema: GraphQLSchema) -> List[DangerousChange]: """Find values added to enums. Given two schemas, returns a list containing descriptions of any dangerous changes in the new_schema related to adding values to an enum type. """ old_type_m...
def variants(self, case_id, skip=0, count=1000, filters=None): """Return count variants for a case. This function needs to have different behaviours based on what is asked for. It should allways try to give minimal information back to improve on speed. For example, if consequences are n...
def function[variants, parameter[self, case_id, skip, count, filters]]: constant[Return count variants for a case. This function needs to have different behaviours based on what is asked for. It should allways try to give minimal information back to improve on speed. For example, if con...
keyword[def] identifier[variants] ( identifier[self] , identifier[case_id] , identifier[skip] = literal[int] , identifier[count] = literal[int] , identifier[filters] = keyword[None] ): literal[string] identifier[filters] = identifier[filters] keyword[or] {} identifier[logger] . identifier...
def variants(self, case_id, skip=0, count=1000, filters=None): """Return count variants for a case. This function needs to have different behaviours based on what is asked for. It should allways try to give minimal information back to improve on speed. For example, if consequences are not a...
def images_grouped_by_type(self): """ :return: A generator yielding 2-tuples of (type, [creators]) where adjacent creators who share the same role are grouped together. """ type = -1 images = [] for wc in self: if wc.type != type: if im...
def function[images_grouped_by_type, parameter[self]]: constant[ :return: A generator yielding 2-tuples of (type, [creators]) where adjacent creators who share the same role are grouped together. ] variable[type] assign[=] <ast.UnaryOp object at 0x7da1b0ebce80> variable[i...
keyword[def] identifier[images_grouped_by_type] ( identifier[self] ): literal[string] identifier[type] =- literal[int] identifier[images] =[] keyword[for] identifier[wc] keyword[in] identifier[self] : keyword[if] identifier[wc] . identifier[type] != identifier[ty...
def images_grouped_by_type(self): """ :return: A generator yielding 2-tuples of (type, [creators]) where adjacent creators who share the same role are grouped together. """ type = -1 images = [] for wc in self: if wc.type != type: if images: yi...
def DVSFile(ID, season, cadence='lc'): ''' Returns the name of the DVS PDF for a given target. :param ID: The target ID :param int season: The target season number :param str cadence: The cadence type. Default `lc` ''' if cadence == 'sc': strcadence = '_sc' else: strca...
def function[DVSFile, parameter[ID, season, cadence]]: constant[ Returns the name of the DVS PDF for a given target. :param ID: The target ID :param int season: The target season number :param str cadence: The cadence type. Default `lc` ] if compare[name[cadence] equal[==] constant...
keyword[def] identifier[DVSFile] ( identifier[ID] , identifier[season] , identifier[cadence] = literal[string] ): literal[string] keyword[if] identifier[cadence] == literal[string] : identifier[strcadence] = literal[string] keyword[else] : identifier[strcadence] = literal[string] ...
def DVSFile(ID, season, cadence='lc'): """ Returns the name of the DVS PDF for a given target. :param ID: The target ID :param int season: The target season number :param str cadence: The cadence type. Default `lc` """ if cadence == 'sc': strcadence = '_sc' # depends on [control=[...
def gain_chart(df, col_true=None, col_pred=None, col_scores=None, pos_label=1): r""" Compute positive proportion, true positive rate (TPR) and threshold from predicted DataFrame. The trace can be plotted as a cumulative gain chart Note that this method will trigger the defined flow to execute. :param ...
def function[gain_chart, parameter[df, col_true, col_pred, col_scores, pos_label]]: constant[ Compute positive proportion, true positive rate (TPR) and threshold from predicted DataFrame. The trace can be plotted as a cumulative gain chart Note that this method will trigger the defined flow to execute....
keyword[def] identifier[gain_chart] ( identifier[df] , identifier[col_true] = keyword[None] , identifier[col_pred] = keyword[None] , identifier[col_scores] = keyword[None] , identifier[pos_label] = literal[int] ): literal[string] keyword[if] keyword[not] identifier[col_pred] : identifier[col_pre...
def gain_chart(df, col_true=None, col_pred=None, col_scores=None, pos_label=1): """ Compute positive proportion, true positive rate (TPR) and threshold from predicted DataFrame. The trace can be plotted as a cumulative gain chart Note that this method will trigger the defined flow to execute. :param d...
def noise2d(self, x, y): """ Generate 2D OpenSimplex noise from X,Y coordinates. """ # Place input coordinates onto grid. stretch_offset = (x + y) * STRETCH_CONSTANT_2D xs = x + stretch_offset ys = y + stretch_offset # Floor to get grid coordinates of rho...
def function[noise2d, parameter[self, x, y]]: constant[ Generate 2D OpenSimplex noise from X,Y coordinates. ] variable[stretch_offset] assign[=] binary_operation[binary_operation[name[x] + name[y]] * name[STRETCH_CONSTANT_2D]] variable[xs] assign[=] binary_operation[name[x] + nam...
keyword[def] identifier[noise2d] ( identifier[self] , identifier[x] , identifier[y] ): literal[string] identifier[stretch_offset] =( identifier[x] + identifier[y] )* identifier[STRETCH_CONSTANT_2D] identifier[xs] = identifier[x] + identifier[stretch_offset] identifier[y...
def noise2d(self, x, y): """ Generate 2D OpenSimplex noise from X,Y coordinates. """ # Place input coordinates onto grid. stretch_offset = (x + y) * STRETCH_CONSTANT_2D xs = x + stretch_offset ys = y + stretch_offset # Floor to get grid coordinates of rhombus (stretched square) s...
def flatten_fft(scale=1.0): """ Produces a nicer graph, I'm not sure if this is correct """ _len = len(audio.spectrogram) for i, v in enumerate(audio.spectrogram): yield scale * (i * v) / _len
def function[flatten_fft, parameter[scale]]: constant[ Produces a nicer graph, I'm not sure if this is correct ] variable[_len] assign[=] call[name[len], parameter[name[audio].spectrogram]] for taget[tuple[[<ast.Name object at 0x7da18dc049d0>, <ast.Name object at 0x7da18dc07ca0>]]] in st...
keyword[def] identifier[flatten_fft] ( identifier[scale] = literal[int] ): literal[string] identifier[_len] = identifier[len] ( identifier[audio] . identifier[spectrogram] ) keyword[for] identifier[i] , identifier[v] keyword[in] identifier[enumerate] ( identifier[audio] . identifier[spectrogram] ):...
def flatten_fft(scale=1.0): """ Produces a nicer graph, I'm not sure if this is correct """ _len = len(audio.spectrogram) for (i, v) in enumerate(audio.spectrogram): yield (scale * (i * v) / _len) # depends on [control=['for'], data=[]]
def proxy_for(self, obj): """Returns the ``Proxy`` for the target object, creating it if necessary. :param object obj: The object that will be doubled. :return: The mapped ``Proxy``. :rtype: Proxy """ obj_id = id(obj) if obj_id not in self._proxies: ...
def function[proxy_for, parameter[self, obj]]: constant[Returns the ``Proxy`` for the target object, creating it if necessary. :param object obj: The object that will be doubled. :return: The mapped ``Proxy``. :rtype: Proxy ] variable[obj_id] assign[=] call[name[id], par...
keyword[def] identifier[proxy_for] ( identifier[self] , identifier[obj] ): literal[string] identifier[obj_id] = identifier[id] ( identifier[obj] ) keyword[if] identifier[obj_id] keyword[not] keyword[in] identifier[self] . identifier[_proxies] : identifier[self] . identif...
def proxy_for(self, obj): """Returns the ``Proxy`` for the target object, creating it if necessary. :param object obj: The object that will be doubled. :return: The mapped ``Proxy``. :rtype: Proxy """ obj_id = id(obj) if obj_id not in self._proxies: self._proxies[obj...
def get_roles(server_context, container_path=None): """ Gets the set of permissions and roles available from the server :param server_context: A LabKey server context. See utils.create_server_context. :param container_path: :return: """ url = server_context.build_url(security_controller, 'ge...
def function[get_roles, parameter[server_context, container_path]]: constant[ Gets the set of permissions and roles available from the server :param server_context: A LabKey server context. See utils.create_server_context. :param container_path: :return: ] variable[url] assign[=] cal...
keyword[def] identifier[get_roles] ( identifier[server_context] , identifier[container_path] = keyword[None] ): literal[string] identifier[url] = identifier[server_context] . identifier[build_url] ( identifier[security_controller] , literal[string] , identifier[container_path] = identifier[container_path] ...
def get_roles(server_context, container_path=None): """ Gets the set of permissions and roles available from the server :param server_context: A LabKey server context. See utils.create_server_context. :param container_path: :return: """ url = server_context.build_url(security_controller, 'ge...
def stopAll(self, timeout=10, stop=False): """ Stop all registered Workers. This is method assumes that the Worker has already received a stop message somehow, and simply joins the Process until it dies, as follows: 1. The Worker is retrieved. 2. The Worker is joined, and will wait until the Worker exits....
def function[stopAll, parameter[self, timeout, stop]]: constant[ Stop all registered Workers. This is method assumes that the Worker has already received a stop message somehow, and simply joins the Process until it dies, as follows: 1. The Worker is retrieved. 2. The Worker is joined, and will wait...
keyword[def] identifier[stopAll] ( identifier[self] , identifier[timeout] = literal[int] , identifier[stop] = keyword[False] ): literal[string] identifier[self] . identifier[logger] . identifier[info] ( literal[string] ) keyword[for] identifier[worker] keyword[in] identifier[self] . identifier[getWorker...
def stopAll(self, timeout=10, stop=False): """ Stop all registered Workers. This is method assumes that the Worker has already received a stop message somehow, and simply joins the Process until it dies, as follows: 1. The Worker is retrieved. 2. The Worker is joined, and will wait until the Worker exit...
def cancel_queue(self): """ Cancel all requests in the queue so we can exit. """ q = list(self.queue) self.queue = [] log.debug("Canceling requests: {}".format(q)) for req in q: req.response = APIServerNotRunningErrorResponse() for req in q: ...
def function[cancel_queue, parameter[self]]: constant[ Cancel all requests in the queue so we can exit. ] variable[q] assign[=] call[name[list], parameter[name[self].queue]] name[self].queue assign[=] list[[]] call[name[log].debug, parameter[call[constant[Canceling reques...
keyword[def] identifier[cancel_queue] ( identifier[self] ): literal[string] identifier[q] = identifier[list] ( identifier[self] . identifier[queue] ) identifier[self] . identifier[queue] =[] identifier[log] . identifier[debug] ( literal[string] . identifier[format] ( identifier[q]...
def cancel_queue(self): """ Cancel all requests in the queue so we can exit. """ q = list(self.queue) self.queue = [] log.debug('Canceling requests: {}'.format(q)) for req in q: req.response = APIServerNotRunningErrorResponse() # depends on [control=['for'], data=['req']] ...
def connection_from_url(self, url): """ Similar to :func:`urllib3.connectionpool.connection_from_url` but doesn't pass any additional parameters to the :class:`urllib3.connectionpool.ConnectionPool` constructor. Additional parameters are taken from the :class:`.PoolManager` ...
def function[connection_from_url, parameter[self, url]]: constant[ Similar to :func:`urllib3.connectionpool.connection_from_url` but doesn't pass any additional parameters to the :class:`urllib3.connectionpool.ConnectionPool` constructor. Additional parameters are taken from the...
keyword[def] identifier[connection_from_url] ( identifier[self] , identifier[url] ): literal[string] identifier[scheme] , identifier[host] , identifier[port] = identifier[get_host] ( identifier[url] ) identifier[port] = identifier[port] keyword[or] identifier[port_by_scheme] . identifie...
def connection_from_url(self, url): """ Similar to :func:`urllib3.connectionpool.connection_from_url` but doesn't pass any additional parameters to the :class:`urllib3.connectionpool.ConnectionPool` constructor. Additional parameters are taken from the :class:`.PoolManager` ...
def _create_examples(self, lines, set_type): """Creates examples for the training and dev sets.""" examples = [] for (i, line) in enumerate(lines): if i == 0: continue guid = "%s-%s" % (set_type, i) text_a = line[3] text_b = line[4]...
def function[_create_examples, parameter[self, lines, set_type]]: constant[Creates examples for the training and dev sets.] variable[examples] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da18fe934f0>, <ast.Name object at 0x7da18fe92c50>]]] in starred[call[name[enumerate], paramete...
keyword[def] identifier[_create_examples] ( identifier[self] , identifier[lines] , identifier[set_type] ): literal[string] identifier[examples] =[] keyword[for] ( identifier[i] , identifier[line] ) keyword[in] identifier[enumerate] ( identifier[lines] ): keyword[if] identifi...
def _create_examples(self, lines, set_type): """Creates examples for the training and dev sets.""" examples = [] for (i, line) in enumerate(lines): if i == 0: continue # depends on [control=['if'], data=[]] guid = '%s-%s' % (set_type, i) text_a = line[3] text_b =...
def save_as_png(self, filename, width=300, height=250, render_time=1): """Open saved html file in an virtual browser and save a screen shot to PNG format.""" self.driver.set_window_size(width, height) self.driver.get('file://{path}/{filename}'.format( path=os.getcwd(), filename=filen...
def function[save_as_png, parameter[self, filename, width, height, render_time]]: constant[Open saved html file in an virtual browser and save a screen shot to PNG format.] call[name[self].driver.set_window_size, parameter[name[width], name[height]]] call[name[self].driver.get, parameter[call[co...
keyword[def] identifier[save_as_png] ( identifier[self] , identifier[filename] , identifier[width] = literal[int] , identifier[height] = literal[int] , identifier[render_time] = literal[int] ): literal[string] identifier[self] . identifier[driver] . identifier[set_window_size] ( identifier[width] ,...
def save_as_png(self, filename, width=300, height=250, render_time=1): """Open saved html file in an virtual browser and save a screen shot to PNG format.""" self.driver.set_window_size(width, height) self.driver.get('file://{path}/{filename}'.format(path=os.getcwd(), filename=filename + '.html')) time....
def invalidate(self, key): """Remove the given data item along with all items that depend on it in the graph.""" if key not in self.data: return del self.data[key] # Find all components that used it and invalidate their results for cname in self.components: ...
def function[invalidate, parameter[self, key]]: constant[Remove the given data item along with all items that depend on it in the graph.] if compare[name[key] <ast.NotIn object at 0x7da2590d7190> name[self].data] begin[:] return[None] <ast.Delete object at 0x7da2054a7400> for taget[n...
keyword[def] identifier[invalidate] ( identifier[self] , identifier[key] ): literal[string] keyword[if] identifier[key] keyword[not] keyword[in] identifier[self] . identifier[data] : keyword[return] keyword[del] identifier[self] . identifier[data] [ identifier[key] ] ...
def invalidate(self, key): """Remove the given data item along with all items that depend on it in the graph.""" if key not in self.data: return # depends on [control=['if'], data=[]] del self.data[key] # Find all components that used it and invalidate their results for cname in self.compon...
def parse_range_pairs(s, range_separator = '-', convert_to_tuple = True): ''' Based on parse_range but instead returns a list of lists with the ranges. A single index n is returned as a range (n, n) whereas a range m-n is returned as (m, n) if m <= n, else (n, m). ''' result = map(sorted, map...
def function[parse_range_pairs, parameter[s, range_separator, convert_to_tuple]]: constant[ Based on parse_range but instead returns a list of lists with the ranges. A single index n is returned as a range (n, n) whereas a range m-n is returned as (m, n) if m <= n, else (n, m). ] variable[re...
keyword[def] identifier[parse_range_pairs] ( identifier[s] , identifier[range_separator] = literal[string] , identifier[convert_to_tuple] = keyword[True] ): literal[string] identifier[result] = identifier[map] ( identifier[sorted] , identifier[map] ( keyword[lambda] identifier[r] : ( identifier[i...
def parse_range_pairs(s, range_separator='-', convert_to_tuple=True): """ Based on parse_range but instead returns a list of lists with the ranges. A single index n is returned as a range (n, n) whereas a range m-n is returned as (m, n) if m <= n, else (n, m). """ result = map(sorted, map(lambda r: ...
def from_timestamp(ts): """ Convert a numeric timestamp to a timezone-aware datetime. A client may override this function to change the default behavior, such as to use local time or timezone-naïve times. """ return datetime.datetime.utcfromtimestamp(ts).replace(tzinfo=pytz.utc)
def function[from_timestamp, parameter[ts]]: constant[ Convert a numeric timestamp to a timezone-aware datetime. A client may override this function to change the default behavior, such as to use local time or timezone-naïve times. ] return[call[call[name[datetime].datetime.utcfromtimestamp...
keyword[def] identifier[from_timestamp] ( identifier[ts] ): literal[string] keyword[return] identifier[datetime] . identifier[datetime] . identifier[utcfromtimestamp] ( identifier[ts] ). identifier[replace] ( identifier[tzinfo] = identifier[pytz] . identifier[utc] )
def from_timestamp(ts): """ Convert a numeric timestamp to a timezone-aware datetime. A client may override this function to change the default behavior, such as to use local time or timezone-naïve times. """ return datetime.datetime.utcfromtimestamp(ts).replace(tzinfo=pytz.utc)
def download_parallel_gui(root, urls, directory, min_file_size, max_file_size, no_redirects): """ called when paralled downloading is true """ global parallel # create directory to save files if not os.path.exists(directory): os.makedirs(directory) parallel = True app = progress_class(root, urls, directory, ...
def function[download_parallel_gui, parameter[root, urls, directory, min_file_size, max_file_size, no_redirects]]: constant[ called when paralled downloading is true ] <ast.Global object at 0x7da1b0fd6050> if <ast.UnaryOp object at 0x7da1b0fd6b90> begin[:] call[name[os].makedirs, p...
keyword[def] identifier[download_parallel_gui] ( identifier[root] , identifier[urls] , identifier[directory] , identifier[min_file_size] , identifier[max_file_size] , identifier[no_redirects] ): literal[string] keyword[global] identifier[parallel] keyword[if] keyword[not] identifier[os] . identifier[pat...
def download_parallel_gui(root, urls, directory, min_file_size, max_file_size, no_redirects): """ called when paralled downloading is true """ global parallel # create directory to save files if not os.path.exists(directory): os.makedirs(directory) # depends on [control=['if'], data=[]] para...
def _set_member_entry(self, v, load=False): """ Setter method for member_entry, mapped from YANG variable /rbridge_id/secpolicy/defined_policy/policies/member_entry (list) If this variable is read-only (config: false) in the source YANG file, then _set_member_entry is considered as a private method....
def function[_set_member_entry, parameter[self, v, load]]: constant[ Setter method for member_entry, mapped from YANG variable /rbridge_id/secpolicy/defined_policy/policies/member_entry (list) If this variable is read-only (config: false) in the source YANG file, then _set_member_entry is considered...
keyword[def] identifier[_set_member_entry] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : i...
def _set_member_entry(self, v, load=False): """ Setter method for member_entry, mapped from YANG variable /rbridge_id/secpolicy/defined_policy/policies/member_entry (list) If this variable is read-only (config: false) in the source YANG file, then _set_member_entry is considered as a private method....
async def send_file( filename: FilePath, mimetype: Optional[str]=None, as_attachment: bool=False, attachment_filename: Optional[str]=None, add_etags: bool=True, cache_timeout: Optional[int]=None, conditional: bool=False, last_modified: Optional[datetime]=N...
<ast.AsyncFunctionDef object at 0x7da204963bb0>
keyword[async] keyword[def] identifier[send_file] ( identifier[filename] : identifier[FilePath] , identifier[mimetype] : identifier[Optional] [ identifier[str] ]= keyword[None] , identifier[as_attachment] : identifier[bool] = keyword[False] , identifier[attachment_filename] : identifier[Optional] [ identifier[st...
async def send_file(filename: FilePath, mimetype: Optional[str]=None, as_attachment: bool=False, attachment_filename: Optional[str]=None, add_etags: bool=True, cache_timeout: Optional[int]=None, conditional: bool=False, last_modified: Optional[datetime]=None) -> Response: """Return a Reponse to send the filename gi...
def copy_constant_memory_args(self, cmem_args): """adds constant memory arguments to the most recently compiled module :param cmem_args: A dictionary containing the data to be passed to the device constant memory. The format to be used is as follows: A string key is used to name...
def function[copy_constant_memory_args, parameter[self, cmem_args]]: constant[adds constant memory arguments to the most recently compiled module :param cmem_args: A dictionary containing the data to be passed to the device constant memory. The format to be used is as follows: A ...
keyword[def] identifier[copy_constant_memory_args] ( identifier[self] , identifier[cmem_args] ): literal[string] identifier[logging] . identifier[debug] ( literal[string] ) identifier[logging] . identifier[debug] ( literal[string] + identifier[str] ( identifier[self] . identifier[current_m...
def copy_constant_memory_args(self, cmem_args): """adds constant memory arguments to the most recently compiled module :param cmem_args: A dictionary containing the data to be passed to the device constant memory. The format to be used is as follows: A string key is used to name the...
def apply_iter(cls, rows, mapping, resolver, scope=None): """ Given an iterable ``rows`` that yield data records, and a ``mapping`` which is to be applied to them, return a tuple of ``data`` (the generated object graph) and ``err``, a validation exception if the resulting data did not ma...
def function[apply_iter, parameter[cls, rows, mapping, resolver, scope]]: constant[ Given an iterable ``rows`` that yield data records, and a ``mapping`` which is to be applied to them, return a tuple of ``data`` (the generated object graph) and ``err``, a validation exception if the res...
keyword[def] identifier[apply_iter] ( identifier[cls] , identifier[rows] , identifier[mapping] , identifier[resolver] , identifier[scope] = keyword[None] ): literal[string] identifier[mapper] = identifier[cls] ( identifier[mapping] , identifier[resolver] , identifier[scope] = identifier[scope] ) ...
def apply_iter(cls, rows, mapping, resolver, scope=None): """ Given an iterable ``rows`` that yield data records, and a ``mapping`` which is to be applied to them, return a tuple of ``data`` (the generated object graph) and ``err``, a validation exception if the resulting data did not match ...
def disconnect(self, code): """Called when WebSocket connection is closed.""" Subscriber.objects.filter(session_id=self.session_id).delete()
def function[disconnect, parameter[self, code]]: constant[Called when WebSocket connection is closed.] call[call[name[Subscriber].objects.filter, parameter[]].delete, parameter[]]
keyword[def] identifier[disconnect] ( identifier[self] , identifier[code] ): literal[string] identifier[Subscriber] . identifier[objects] . identifier[filter] ( identifier[session_id] = identifier[self] . identifier[session_id] ). identifier[delete] ()
def disconnect(self, code): """Called when WebSocket connection is closed.""" Subscriber.objects.filter(session_id=self.session_id).delete()
def _handle_func_def(self, node, scope, ctxt, stream): """Handle FuncDef nodes :node: TODO :scope: TODO :ctxt: TODO :stream: TODO :returns: TODO """ self._dlog("handling function definition") func = self._handle_node(node.decl, scope, ctxt, strea...
def function[_handle_func_def, parameter[self, node, scope, ctxt, stream]]: constant[Handle FuncDef nodes :node: TODO :scope: TODO :ctxt: TODO :stream: TODO :returns: TODO ] call[name[self]._dlog, parameter[constant[handling function definition]]] ...
keyword[def] identifier[_handle_func_def] ( identifier[self] , identifier[node] , identifier[scope] , identifier[ctxt] , identifier[stream] ): literal[string] identifier[self] . identifier[_dlog] ( literal[string] ) identifier[func] = identifier[self] . identifier[_handle_node] ( identifie...
def _handle_func_def(self, node, scope, ctxt, stream): """Handle FuncDef nodes :node: TODO :scope: TODO :ctxt: TODO :stream: TODO :returns: TODO """ self._dlog('handling function definition') func = self._handle_node(node.decl, scope, ctxt, stream) func....
def get_key_from_request(self): '''Return a key for the current request url. :return: The storage key for the current url :rettype: string ''' path = "result:%s" % self.context.request.url if self.is_auto_webp(): path += '/webp' return path
def function[get_key_from_request, parameter[self]]: constant[Return a key for the current request url. :return: The storage key for the current url :rettype: string ] variable[path] assign[=] binary_operation[constant[result:%s] <ast.Mod object at 0x7da2590d6920> name[self].con...
keyword[def] identifier[get_key_from_request] ( identifier[self] ): literal[string] identifier[path] = literal[string] % identifier[self] . identifier[context] . identifier[request] . identifier[url] keyword[if] identifier[self] . identifier[is_auto_webp] (): identifier[pa...
def get_key_from_request(self): """Return a key for the current request url. :return: The storage key for the current url :rettype: string """ path = 'result:%s' % self.context.request.url if self.is_auto_webp(): path += '/webp' # depends on [control=['if'], data=[]] re...
def latitude_from_cross_section(cross): """Calculate the latitude of points in a cross-section. Parameters ---------- cross : `xarray.DataArray` The input DataArray of a cross-section from which to obtain latitudes. Returns ------- latitude : `xarray.DataArray` Latitude of ...
def function[latitude_from_cross_section, parameter[cross]]: constant[Calculate the latitude of points in a cross-section. Parameters ---------- cross : `xarray.DataArray` The input DataArray of a cross-section from which to obtain latitudes. Returns ------- latitude : `xarray....
keyword[def] identifier[latitude_from_cross_section] ( identifier[cross] ): literal[string] identifier[y] = identifier[cross] . identifier[metpy] . identifier[y] keyword[if] identifier[CFConventionHandler] . identifier[check_axis] ( identifier[y] , literal[string] ): keyword[return] identi...
def latitude_from_cross_section(cross): """Calculate the latitude of points in a cross-section. Parameters ---------- cross : `xarray.DataArray` The input DataArray of a cross-section from which to obtain latitudes. Returns ------- latitude : `xarray.DataArray` Latitude of ...
def validate(self, api_key=None): """ The original contents of the Event message must be confirmed by refetching it and comparing the fetched data with the original data. This function makes an API call to Stripe to redownload the Event data and returns whether or not it matches the WebhookEventTrigger data....
def function[validate, parameter[self, api_key]]: constant[ The original contents of the Event message must be confirmed by refetching it and comparing the fetched data with the original data. This function makes an API call to Stripe to redownload the Event data and returns whether or not it matches t...
keyword[def] identifier[validate] ( identifier[self] , identifier[api_key] = keyword[None] ): literal[string] identifier[local_data] = identifier[self] . identifier[json_body] keyword[if] literal[string] keyword[not] keyword[in] identifier[local_data] keyword[or] literal[string] keyword[not] keywo...
def validate(self, api_key=None): """ The original contents of the Event message must be confirmed by refetching it and comparing the fetched data with the original data. This function makes an API call to Stripe to redownload the Event data and returns whether or not it matches the WebhookEventTrigger dat...
def _points(self, x_pos): """ Convert given data values into drawable points (x, y) and interpolated points if interpolate option is specified """ for series_group in (self.series, self.secondary_series): accumulation = [0] * self._len for serie in series_...
def function[_points, parameter[self, x_pos]]: constant[ Convert given data values into drawable points (x, y) and interpolated points if interpolate option is specified ] for taget[name[series_group]] in starred[tuple[[<ast.Attribute object at 0x7da18f811330>, <ast.Attribute obj...
keyword[def] identifier[_points] ( identifier[self] , identifier[x_pos] ): literal[string] keyword[for] identifier[series_group] keyword[in] ( identifier[self] . identifier[series] , identifier[self] . identifier[secondary_series] ): identifier[accumulation] =[ literal[int] ]* identi...
def _points(self, x_pos): """ Convert given data values into drawable points (x, y) and interpolated points if interpolate option is specified """ for series_group in (self.series, self.secondary_series): accumulation = [0] * self._len for serie in series_group[::-1 if se...
def bytes_to_long(s): """bytes_to_long(string) : long Convert a byte string to a long integer. This is (essentially) the inverse of long_to_bytes(). """ if isinstance(s, int): # On Python 2, indexing into a bytearray returns a byte string; on Python 3, an int. return s acc = 0 ...
def function[bytes_to_long, parameter[s]]: constant[bytes_to_long(string) : long Convert a byte string to a long integer. This is (essentially) the inverse of long_to_bytes(). ] if call[name[isinstance], parameter[name[s], name[int]]] begin[:] return[name[s]] variable[acc] a...
keyword[def] identifier[bytes_to_long] ( identifier[s] ): literal[string] keyword[if] identifier[isinstance] ( identifier[s] , identifier[int] ): keyword[return] identifier[s] identifier[acc] = literal[int] keyword[if] identifier[USING_PYTHON2] : identifier[acc] = iden...
def bytes_to_long(s): """bytes_to_long(string) : long Convert a byte string to a long integer. This is (essentially) the inverse of long_to_bytes(). """ if isinstance(s, int): # On Python 2, indexing into a bytearray returns a byte string; on Python 3, an int. return s # depends on...
def close(self): """Close the socket without sending quit message.""" stream = self._stream if stream is None: return self._stream = None stream.close()
def function[close, parameter[self]]: constant[Close the socket without sending quit message.] variable[stream] assign[=] name[self]._stream if compare[name[stream] is constant[None]] begin[:] return[None] name[self]._stream assign[=] constant[None] call[name[stream].clos...
keyword[def] identifier[close] ( identifier[self] ): literal[string] identifier[stream] = identifier[self] . identifier[_stream] keyword[if] identifier[stream] keyword[is] keyword[None] : keyword[return] identifier[self] . identifier[_stream] = keyword[None] ...
def close(self): """Close the socket without sending quit message.""" stream = self._stream if stream is None: return # depends on [control=['if'], data=[]] self._stream = None stream.close()
def _check_min_max_range(self, var, test_ctx): """ Checks that either both valid_min and valid_max exist, or valid_range exists. """ if 'valid_range' in var.ncattrs(): test_ctx.assert_true(var.valid_range.dtype == var.dtype and len(var...
def function[_check_min_max_range, parameter[self, var, test_ctx]]: constant[ Checks that either both valid_min and valid_max exist, or valid_range exists. ] if compare[constant[valid_range] in call[name[var].ncattrs, parameter[]]] begin[:] call[name[test_ctx].ass...
keyword[def] identifier[_check_min_max_range] ( identifier[self] , identifier[var] , identifier[test_ctx] ): literal[string] keyword[if] literal[string] keyword[in] identifier[var] . identifier[ncattrs] (): identifier[test_ctx] . identifier[assert_true] ( identifier[var] . identifie...
def _check_min_max_range(self, var, test_ctx): """ Checks that either both valid_min and valid_max exist, or valid_range exists. """ if 'valid_range' in var.ncattrs(): test_ctx.assert_true(var.valid_range.dtype == var.dtype and len(var.valid_range) == 2 and (var.valid_range[0] <=...
def wash_html_id(dirty): """Strip non-alphabetic or newline characters from a given string. It can be used as a HTML element ID (also with jQuery and in all browsers). :param dirty: the string to wash :returns: the HTML ID ready string """ import re if not dirty[0].isalpha(): # we ...
def function[wash_html_id, parameter[dirty]]: constant[Strip non-alphabetic or newline characters from a given string. It can be used as a HTML element ID (also with jQuery and in all browsers). :param dirty: the string to wash :returns: the HTML ID ready string ] import module[re] ...
keyword[def] identifier[wash_html_id] ( identifier[dirty] ): literal[string] keyword[import] identifier[re] keyword[if] keyword[not] identifier[dirty] [ literal[int] ]. identifier[isalpha] (): identifier[dirty] = literal[string] + identifier[dirty] identifier[non_word] = identi...
def wash_html_id(dirty): """Strip non-alphabetic or newline characters from a given string. It can be used as a HTML element ID (also with jQuery and in all browsers). :param dirty: the string to wash :returns: the HTML ID ready string """ import re if not dirty[0].isalpha(): # we ...
def from_array(array): """ Deserialize a new Location from a given dictionary. :return: new Location instance. :rtype: Location """ if array is None or not array: return None # end if assert_type_or_raise(array, dict, parameter_name="array") ...
def function[from_array, parameter[array]]: constant[ Deserialize a new Location from a given dictionary. :return: new Location instance. :rtype: Location ] if <ast.BoolOp object at 0x7da1b0349120> begin[:] return[constant[None]] call[name[assert_type_or_...
keyword[def] identifier[from_array] ( identifier[array] ): literal[string] keyword[if] identifier[array] keyword[is] keyword[None] keyword[or] keyword[not] identifier[array] : keyword[return] keyword[None] identifier[assert_type_or_raise] ( identifier[arra...
def from_array(array): """ Deserialize a new Location from a given dictionary. :return: new Location instance. :rtype: Location """ if array is None or not array: return None # depends on [control=['if'], data=[]] # end if assert_type_or_raise(array, dict, param...
def get_png_data_url(blob: Optional[bytes]) -> str: """ Converts a PNG blob into a local URL encapsulating the PNG. """ return BASE64_PNG_URL_PREFIX + base64.b64encode(blob).decode('ascii')
def function[get_png_data_url, parameter[blob]]: constant[ Converts a PNG blob into a local URL encapsulating the PNG. ] return[binary_operation[name[BASE64_PNG_URL_PREFIX] + call[call[name[base64].b64encode, parameter[name[blob]]].decode, parameter[constant[ascii]]]]]
keyword[def] identifier[get_png_data_url] ( identifier[blob] : identifier[Optional] [ identifier[bytes] ])-> identifier[str] : literal[string] keyword[return] identifier[BASE64_PNG_URL_PREFIX] + identifier[base64] . identifier[b64encode] ( identifier[blob] ). identifier[decode] ( literal[string] )
def get_png_data_url(blob: Optional[bytes]) -> str: """ Converts a PNG blob into a local URL encapsulating the PNG. """ return BASE64_PNG_URL_PREFIX + base64.b64encode(blob).decode('ascii')
def check_url(url): """Check whether the given URL is dead or alive. Returns a dict with four keys: "url": The URL that was checked (string) "alive": Whether the URL was working, True or False "status": The HTTP status code of the response from the URL, e.g. 200, 401, 500 (...
def function[check_url, parameter[url]]: constant[Check whether the given URL is dead or alive. Returns a dict with four keys: "url": The URL that was checked (string) "alive": Whether the URL was working, True or False "status": The HTTP status code of the response from the URL, ...
keyword[def] identifier[check_url] ( identifier[url] ): literal[string] identifier[result] ={ literal[string] : identifier[url] } keyword[try] : identifier[response] = identifier[requests] . identifier[get] ( identifier[url] ) identifier[result] [ literal[string] ]= identifier[respon...
def check_url(url): """Check whether the given URL is dead or alive. Returns a dict with four keys: "url": The URL that was checked (string) "alive": Whether the URL was working, True or False "status": The HTTP status code of the response from the URL, e.g. 200, 401, 500 (...
def sample_without_replacement(n, k, num_trials=None, random_state=None): """ Randomly choose k integers without replacement from 0, ..., n-1. Parameters ---------- n : scalar(int) Number of integers, 0, ..., n-1, to sample from. k : scalar(int) Number of integers to sample. ...
def function[sample_without_replacement, parameter[n, k, num_trials, random_state]]: constant[ Randomly choose k integers without replacement from 0, ..., n-1. Parameters ---------- n : scalar(int) Number of integers, 0, ..., n-1, to sample from. k : scalar(int) Number of i...
keyword[def] identifier[sample_without_replacement] ( identifier[n] , identifier[k] , identifier[num_trials] = keyword[None] , identifier[random_state] = keyword[None] ): literal[string] keyword[if] identifier[n] <= literal[int] : keyword[raise] identifier[ValueError] ( literal[string] ) ke...
def sample_without_replacement(n, k, num_trials=None, random_state=None): """ Randomly choose k integers without replacement from 0, ..., n-1. Parameters ---------- n : scalar(int) Number of integers, 0, ..., n-1, to sample from. k : scalar(int) Number of integers to sample. ...
def minkowski_distance(x, y, p=2): """ Calculates the minkowski distance between two points. :param x: the first point :param y: the second point :param p: the order of the minkowski algorithm. If *p=1* it is equal to the manhatten distance, if *p=2* it is equal to the euclidian dis...
def function[minkowski_distance, parameter[x, y, p]]: constant[ Calculates the minkowski distance between two points. :param x: the first point :param y: the second point :param p: the order of the minkowski algorithm. If *p=1* it is equal to the manhatten distance, if *p=2* it is equal...
keyword[def] identifier[minkowski_distance] ( identifier[x] , identifier[y] , identifier[p] = literal[int] ): literal[string] keyword[from] identifier[math] keyword[import] identifier[pow] keyword[assert] identifier[len] ( identifier[y] )== identifier[len] ( identifier[x] ) keyword[assert] ...
def minkowski_distance(x, y, p=2): """ Calculates the minkowski distance between two points. :param x: the first point :param y: the second point :param p: the order of the minkowski algorithm. If *p=1* it is equal to the manhatten distance, if *p=2* it is equal to the euclidian dis...
async def start(self): """Start the websocket server. When this method returns, the websocket server will be running and the port property of this class will have its assigned port number. This method should be called only once in the lifetime of the server and must be paired w...
<ast.AsyncFunctionDef object at 0x7da18f00cdc0>
keyword[async] keyword[def] identifier[start] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_server_task] keyword[is] keyword[not] keyword[None] : identifier[self] . identifier[_logger] . identifier[debug] ( literal[string] ) keyword...
async def start(self): """Start the websocket server. When this method returns, the websocket server will be running and the port property of this class will have its assigned port number. This method should be called only once in the lifetime of the server and must be paired with ...
def getCheck(self, checkid): """Returns a detailed description of a specified check.""" check = PingdomCheck(self, {'id': checkid}) check.getDetails() return check
def function[getCheck, parameter[self, checkid]]: constant[Returns a detailed description of a specified check.] variable[check] assign[=] call[name[PingdomCheck], parameter[name[self], dictionary[[<ast.Constant object at 0x7da1b0d1d330>], [<ast.Name object at 0x7da1b0d1dff0>]]]] call[name[check...
keyword[def] identifier[getCheck] ( identifier[self] , identifier[checkid] ): literal[string] identifier[check] = identifier[PingdomCheck] ( identifier[self] ,{ literal[string] : identifier[checkid] }) identifier[check] . identifier[getDetails] () keyword[return] identifier[chec...
def getCheck(self, checkid): """Returns a detailed description of a specified check.""" check = PingdomCheck(self, {'id': checkid}) check.getDetails() return check
def invalidate(self): """Mark the data invalidated. Clients will refetch the volume.""" with self._mesh_generator_lock: self._mesh_generator_pending = None self._mesh_generator = None self._dispatch_changed_callbacks()
def function[invalidate, parameter[self]]: constant[Mark the data invalidated. Clients will refetch the volume.] with name[self]._mesh_generator_lock begin[:] name[self]._mesh_generator_pending assign[=] constant[None] name[self]._mesh_generator assign[=] constant[None] ...
keyword[def] identifier[invalidate] ( identifier[self] ): literal[string] keyword[with] identifier[self] . identifier[_mesh_generator_lock] : identifier[self] . identifier[_mesh_generator_pending] = keyword[None] identifier[self] . identifier[_mesh_generator] = keyword[N...
def invalidate(self): """Mark the data invalidated. Clients will refetch the volume.""" with self._mesh_generator_lock: self._mesh_generator_pending = None self._mesh_generator = None # depends on [control=['with'], data=[]] self._dispatch_changed_callbacks()
def references(self): """ Return (tail, head) pairs for each edge in the graph. """ return [ (tail, head) for tail in self.vertices for head in self.children(tail) ]
def function[references, parameter[self]]: constant[ Return (tail, head) pairs for each edge in the graph. ] return[<ast.ListComp object at 0x7da18ede4c10>]
keyword[def] identifier[references] ( identifier[self] ): literal[string] keyword[return] [ ( identifier[tail] , identifier[head] ) keyword[for] identifier[tail] keyword[in] identifier[self] . identifier[vertices] keyword[for] identifier[head] keyword[in] identifier...
def references(self): """ Return (tail, head) pairs for each edge in the graph. """ return [(tail, head) for tail in self.vertices for head in self.children(tail)]
def add_domain(session, organization, domain_name, is_top_domain=False): """Add a domain to the session. This function adds a new domain to the session using `domain_name` as its identifier. The new domain will also be linked to the organization object of `organization`. Values assigned to `domain...
def function[add_domain, parameter[session, organization, domain_name, is_top_domain]]: constant[Add a domain to the session. This function adds a new domain to the session using `domain_name` as its identifier. The new domain will also be linked to the organization object of `organization`. V...
keyword[def] identifier[add_domain] ( identifier[session] , identifier[organization] , identifier[domain_name] , identifier[is_top_domain] = keyword[False] ): literal[string] keyword[if] identifier[domain_name] keyword[is] keyword[None] : keyword[raise] identifier[ValueError] ( literal[string]...
def add_domain(session, organization, domain_name, is_top_domain=False): """Add a domain to the session. This function adds a new domain to the session using `domain_name` as its identifier. The new domain will also be linked to the organization object of `organization`. Values assigned to `domain...
def grid_angle_to_profile(self, grid_thetas): """The angle between each angle theta on the grid and the profile, in radians. Parameters ----------- grid_thetas : ndarray The angle theta counter-clockwise from the positive x-axis to each coordinate in radians. """ ...
def function[grid_angle_to_profile, parameter[self, grid_thetas]]: constant[The angle between each angle theta on the grid and the profile, in radians. Parameters ----------- grid_thetas : ndarray The angle theta counter-clockwise from the positive x-axis to each coordinate ...
keyword[def] identifier[grid_angle_to_profile] ( identifier[self] , identifier[grid_thetas] ): literal[string] identifier[theta_coordinate_to_profile] = identifier[np] . identifier[add] ( identifier[grid_thetas] ,- identifier[self] . identifier[phi_radians] ) keyword[return] identifier[np...
def grid_angle_to_profile(self, grid_thetas): """The angle between each angle theta on the grid and the profile, in radians. Parameters ----------- grid_thetas : ndarray The angle theta counter-clockwise from the positive x-axis to each coordinate in radians. """ the...
def _fiss_agent_header(headers=None): """ Return request headers for fiss. Inserts FISS as the User-Agent. Initializes __SESSION if it hasn't been set. Args: headers (dict): Include additional headers as key-value pairs """ _set_session() fiss_headers = {"User-Agent" : FIS...
def function[_fiss_agent_header, parameter[headers]]: constant[ Return request headers for fiss. Inserts FISS as the User-Agent. Initializes __SESSION if it hasn't been set. Args: headers (dict): Include additional headers as key-value pairs ] call[name[_set_session], p...
keyword[def] identifier[_fiss_agent_header] ( identifier[headers] = keyword[None] ): literal[string] identifier[_set_session] () identifier[fiss_headers] ={ literal[string] : identifier[FISS_USER_AGENT] } keyword[if] identifier[headers] keyword[is] keyword[not] keyword[None] : ident...
def _fiss_agent_header(headers=None): """ Return request headers for fiss. Inserts FISS as the User-Agent. Initializes __SESSION if it hasn't been set. Args: headers (dict): Include additional headers as key-value pairs """ _set_session() fiss_headers = {'User-Agent': FISS_...
def visibility(vis: Number, unit: str = 'm') -> str: """ Format visibility details into a spoken word string """ if not vis: return 'Visibility unknown' if vis.value is None or '/' in vis.repr: ret_vis = vis.spoken else: ret_vis = translate.visibility(vis, unit=unit) ...
def function[visibility, parameter[vis, unit]]: constant[ Format visibility details into a spoken word string ] if <ast.UnaryOp object at 0x7da20c76e920> begin[:] return[constant[Visibility unknown]] if <ast.BoolOp object at 0x7da20c76d6c0> begin[:] variable[ret_v...
keyword[def] identifier[visibility] ( identifier[vis] : identifier[Number] , identifier[unit] : identifier[str] = literal[string] )-> identifier[str] : literal[string] keyword[if] keyword[not] identifier[vis] : keyword[return] literal[string] keyword[if] identifier[vis] . identifier[valu...
def visibility(vis: Number, unit: str='m') -> str: """ Format visibility details into a spoken word string """ if not vis: return 'Visibility unknown' # depends on [control=['if'], data=[]] if vis.value is None or '/' in vis.repr: ret_vis = vis.spoken # depends on [control=['if'], ...
def rotate_ryb(self, angle=180): """ Returns a color rotated on the artistic RYB color wheel. An artistic color wheel has slightly different opposites (e.g. purple-yellow instead of purple-lime). It is mathematically incorrect but generally assumed to provide better complementa...
def function[rotate_ryb, parameter[self, angle]]: constant[ Returns a color rotated on the artistic RYB color wheel. An artistic color wheel has slightly different opposites (e.g. purple-yellow instead of purple-lime). It is mathematically incorrect but generally assumed to prov...
keyword[def] identifier[rotate_ryb] ( identifier[self] , identifier[angle] = literal[int] ): literal[string] identifier[h] = identifier[self] . identifier[h] * literal[int] identifier[angle] = identifier[angle] % literal[int] identifier[whe...
def rotate_ryb(self, angle=180): """ Returns a color rotated on the artistic RYB color wheel. An artistic color wheel has slightly different opposites (e.g. purple-yellow instead of purple-lime). It is mathematically incorrect but generally assumed to provide better complementary co...
def FlashFromFile(self, partition, source_file, source_len=0, info_cb=DEFAULT_MESSAGE_CALLBACK, progress_callback=None): """Flashes a partition from the file on disk. Args: partition: Partition name to flash to. source_file: Filename to download to the device. ...
def function[FlashFromFile, parameter[self, partition, source_file, source_len, info_cb, progress_callback]]: constant[Flashes a partition from the file on disk. Args: partition: Partition name to flash to. source_file: Filename to download to the device. source_len: Optio...
keyword[def] identifier[FlashFromFile] ( identifier[self] , identifier[partition] , identifier[source_file] , identifier[source_len] = literal[int] , identifier[info_cb] = identifier[DEFAULT_MESSAGE_CALLBACK] , identifier[progress_callback] = keyword[None] ): literal[string] keyword[if] identifie...
def FlashFromFile(self, partition, source_file, source_len=0, info_cb=DEFAULT_MESSAGE_CALLBACK, progress_callback=None): """Flashes a partition from the file on disk. Args: partition: Partition name to flash to. source_file: Filename to download to the device. source_len: Opti...
def ttotdev(data, rate=1.0, data_type="phase", taus=None): """ Time Total Deviation modified total variance scaled by tau^2 / 3 NIST SP 1065 eqn (28) page 26 <--- formula should have tau squared !?! """ (taus, mtotdevs, mde, ns) = mtotdev(data, data_type=data_type, ...
def function[ttotdev, parameter[data, rate, data_type, taus]]: constant[ Time Total Deviation modified total variance scaled by tau^2 / 3 NIST SP 1065 eqn (28) page 26 <--- formula should have tau squared !?! ] <ast.Tuple object at 0x7da1b155eec0> assign[=] call[name[mtotdev], param...
keyword[def] identifier[ttotdev] ( identifier[data] , identifier[rate] = literal[int] , identifier[data_type] = literal[string] , identifier[taus] = keyword[None] ): literal[string] ( identifier[taus] , identifier[mtotdevs] , identifier[mde] , identifier[ns] )= identifier[mtotdev] ( identifier[data] , iden...
def ttotdev(data, rate=1.0, data_type='phase', taus=None): """ Time Total Deviation modified total variance scaled by tau^2 / 3 NIST SP 1065 eqn (28) page 26 <--- formula should have tau squared !?! """ (taus, mtotdevs, mde, ns) = mtotdev(data, data_type=data_type, rate=rate, taus=taus) ...
def write(self, data): ''' This could be a bit less clumsy. ''' if data == '\n': # print does this return self.stream.write(data) else: bytes_ = 0 for line in data.splitlines(True): nl = '' if line.endswith('\n'): # mv nl to e...
def function[write, parameter[self, data]]: constant[ This could be a bit less clumsy. ] if compare[name[data] equal[==] constant[ ]] begin[:] return[call[name[self].stream.write, parameter[name[data]]]]
keyword[def] identifier[write] ( identifier[self] , identifier[data] ): literal[string] keyword[if] identifier[data] == literal[string] : keyword[return] identifier[self] . identifier[stream] . identifier[write] ( identifier[data] ) keyword[else] : identifier[by...
def write(self, data): """ This could be a bit less clumsy. """ if data == '\n': # print does this return self.stream.write(data) # depends on [control=['if'], data=['data']] else: bytes_ = 0 for line in data.splitlines(True): nl = '' if line.endswith('\n'):...
def DefaultAdapter(self): '''Retrieve the default adapter ''' default_adapter = None for obj in mockobject.objects.keys(): if obj.startswith('/org/bluez/') and 'dev_' not in obj: default_adapter = obj if default_adapter: return dbus.ObjectPath(default_adapter, variant_l...
def function[DefaultAdapter, parameter[self]]: constant[Retrieve the default adapter ] variable[default_adapter] assign[=] constant[None] for taget[name[obj]] in starred[call[name[mockobject].objects.keys, parameter[]]] begin[:] if <ast.BoolOp object at 0x7da20c992200> begin[...
keyword[def] identifier[DefaultAdapter] ( identifier[self] ): literal[string] identifier[default_adapter] = keyword[None] keyword[for] identifier[obj] keyword[in] identifier[mockobject] . identifier[objects] . identifier[keys] (): keyword[if] identifier[obj] . identifier[startswith] ( l...
def DefaultAdapter(self): """Retrieve the default adapter """ default_adapter = None for obj in mockobject.objects.keys(): if obj.startswith('/org/bluez/') and 'dev_' not in obj: default_adapter = obj # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['obj'...
def fetch_uri(self, directory, uri): """ Use ``urllib.urlretrieve`` to download package to file in sandbox dir. @param directory: directory to download to @type directory: string @param uri: uri to download @type uri: string @returns: 0 = success or 1 for faile...
def function[fetch_uri, parameter[self, directory, uri]]: constant[ Use ``urllib.urlretrieve`` to download package to file in sandbox dir. @param directory: directory to download to @type directory: string @param uri: uri to download @type uri: string @returns:...
keyword[def] identifier[fetch_uri] ( identifier[self] , identifier[directory] , identifier[uri] ): literal[string] identifier[filename] = identifier[os] . identifier[path] . identifier[basename] ( identifier[urlparse] ( identifier[uri] )[ literal[int] ]) keyword[if] identifier[os] . ident...
def fetch_uri(self, directory, uri): """ Use ``urllib.urlretrieve`` to download package to file in sandbox dir. @param directory: directory to download to @type directory: string @param uri: uri to download @type uri: string @returns: 0 = success or 1 for failed do...
def is_decomposed(P): """ Check if a polynomial (array) is on component form. Args: P (Poly): Input data. Returns: (bool): True if all polynomials in ``P`` are on component form. Examples: >>> x,y = cp.variable(2) >>> print(cp.is_decomposed(...
def function[is_decomposed, parameter[P]]: constant[ Check if a polynomial (array) is on component form. Args: P (Poly): Input data. Returns: (bool): True if all polynomials in ``P`` are on component form. Examples: >>> x,y = cp.variable(2) ...
keyword[def] identifier[is_decomposed] ( identifier[P] ): literal[string] keyword[if] identifier[P] . identifier[shape] : keyword[return] identifier[min] ([ identifier[is_decomposed] ( identifier[poly] ) keyword[for] identifier[poly] keyword[in] identifier[P] ]) keyword[return] identifi...
def is_decomposed(P): """ Check if a polynomial (array) is on component form. Args: P (Poly): Input data. Returns: (bool): True if all polynomials in ``P`` are on component form. Examples: >>> x,y = cp.variable(2) >>> print(cp.is_decomposed(...
def batch_update(self, command, rows): """ Для массовой вставки умеренных объемов 1-5к записей за вызов :param command: SQL insert or updtae :param rows: list of dict :return: dict """ request = { "database": { "alias": self.__options[...
def function[batch_update, parameter[self, command, rows]]: constant[ Для массовой вставки умеренных объемов 1-5к записей за вызов :param command: SQL insert or updtae :param rows: list of dict :return: dict ] variable[request] assign[=] dictionary[[<ast.Constant...
keyword[def] identifier[batch_update] ( identifier[self] , identifier[command] , identifier[rows] ): literal[string] identifier[request] ={ literal[string] :{ literal[string] : identifier[self] . identifier[__options] [ literal[string] ] }, literal[string] :{ ...
def batch_update(self, command, rows): """ Для массовой вставки умеренных объемов 1-5к записей за вызов :param command: SQL insert or updtae :param rows: list of dict :return: dict """ request = {'database': {'alias': self.__options['dbAlias']}, 'batchUpdate': {'command'...
def _colorspace(self, image, colorspace): """ Sets the image's colorspace. This is typical 'RGB' or 'GRAY', but may be other things, depending on your choice of Engine. :param PIL.Image image: The image whose colorspace to adjust. :param str colorspace: One of either 'RGB' or 'G...
def function[_colorspace, parameter[self, image, colorspace]]: constant[ Sets the image's colorspace. This is typical 'RGB' or 'GRAY', but may be other things, depending on your choice of Engine. :param PIL.Image image: The image whose colorspace to adjust. :param str colorspace...
keyword[def] identifier[_colorspace] ( identifier[self] , identifier[image] , identifier[colorspace] ): literal[string] keyword[if] identifier[colorspace] == literal[string] : keyword[if] identifier[image] . identifier[mode] == literal[string] : keyword[...
def _colorspace(self, image, colorspace): """ Sets the image's colorspace. This is typical 'RGB' or 'GRAY', but may be other things, depending on your choice of Engine. :param PIL.Image image: The image whose colorspace to adjust. :param str colorspace: One of either 'RGB' or 'GRAY'...
def _on_disconnect(self): """Callback when a device is disconnected unexpectedly. Args: adapter_id (int): An ID for the adapter that was connected to the device connection_id (int): An ID for the connection that has become disconnected """ self._logger.info("Con...
def function[_on_disconnect, parameter[self]]: constant[Callback when a device is disconnected unexpectedly. Args: adapter_id (int): An ID for the adapter that was connected to the device connection_id (int): An ID for the connection that has become disconnected ] ...
keyword[def] identifier[_on_disconnect] ( identifier[self] ): literal[string] identifier[self] . identifier[_logger] . identifier[info] ( literal[string] , identifier[self] . identifier[connection_string] ) identifier[self] . identifier[connection_interrupted] = keyword[True]
def _on_disconnect(self): """Callback when a device is disconnected unexpectedly. Args: adapter_id (int): An ID for the adapter that was connected to the device connection_id (int): An ID for the connection that has become disconnected """ self._logger.info('Connection t...
def _log_level_changed(self, name, old, new): """Adjust the log level when log_level is set.""" if isinstance(new, basestring): new = getattr(logging, new) self.log_level = new self.log.setLevel(new)
def function[_log_level_changed, parameter[self, name, old, new]]: constant[Adjust the log level when log_level is set.] if call[name[isinstance], parameter[name[new], name[basestring]]] begin[:] variable[new] assign[=] call[name[getattr], parameter[name[logging], name[new]]] ...
keyword[def] identifier[_log_level_changed] ( identifier[self] , identifier[name] , identifier[old] , identifier[new] ): literal[string] keyword[if] identifier[isinstance] ( identifier[new] , identifier[basestring] ): identifier[new] = identifier[getattr] ( identifier[logging] , ident...
def _log_level_changed(self, name, old, new): """Adjust the log level when log_level is set.""" if isinstance(new, basestring): new = getattr(logging, new) self.log_level = new # depends on [control=['if'], data=[]] self.log.setLevel(new)
def absent(name, **kwargs): ''' Ensures that the mediatype does not exist, eventually deletes the mediatype. :param name: name of the mediatype :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix ...
def function[absent, parameter[name]]: constant[ Ensures that the mediatype does not exist, eventually deletes the mediatype. :param name: name of the mediatype :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_passwor...
keyword[def] identifier[absent] ( identifier[name] ,** identifier[kwargs] ): literal[string] identifier[connection_args] ={} keyword[if] literal[string] keyword[in] identifier[kwargs] : identifier[connection_args] [ literal[string] ]= identifier[kwargs] [ literal[string] ] keyword[if]...
def absent(name, **kwargs): """ Ensures that the mediatype does not exist, eventually deletes the mediatype. :param name: name of the mediatype :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix ...
def handle(self, *args, **options): """This function is called by the Django API to specify how this object will be saved to the database. """ taxonomy_id = options['taxonomy_id'] # Remove leading and trailing blank characters in "common_name" # and "scientific_name ...
def function[handle, parameter[self]]: constant[This function is called by the Django API to specify how this object will be saved to the database. ] variable[taxonomy_id] assign[=] call[name[options]][constant[taxonomy_id]] variable[common_name] assign[=] call[call[name[options]...
keyword[def] identifier[handle] ( identifier[self] ,* identifier[args] ,** identifier[options] ): literal[string] identifier[taxonomy_id] = identifier[options] [ literal[string] ] identifier[common_name] = identifier[options] [ literal[string] ]. identifier[strip] () ...
def handle(self, *args, **options): """This function is called by the Django API to specify how this object will be saved to the database. """ taxonomy_id = options['taxonomy_id'] # Remove leading and trailing blank characters in "common_name" # and "scientific_name common_name = opt...
def _JoinKeyPath(self, path_segments): """Joins the path segments into key path. Args: path_segments (list[str]): Windows Registry key path segments. Returns: str: key path. """ # This is an optimized way to combine the path segments into a single path # and combine multiple succes...
def function[_JoinKeyPath, parameter[self, path_segments]]: constant[Joins the path segments into key path. Args: path_segments (list[str]): Windows Registry key path segments. Returns: str: key path. ] variable[path_segments] assign[=] <ast.ListComp object at 0x7da18dc042b0> ...
keyword[def] identifier[_JoinKeyPath] ( identifier[self] , identifier[path_segments] ): literal[string] identifier[path_segments] =[ identifier[segment] . identifier[split] ( identifier[definitions] . identifier[KEY_PATH_SEPARATOR] ) keyword[for] identifier[segment] keyword[in] ...
def _JoinKeyPath(self, path_segments): """Joins the path segments into key path. Args: path_segments (list[str]): Windows Registry key path segments. Returns: str: key path. """ # This is an optimized way to combine the path segments into a single path # and combine multiple succes...
def bed(args): """ %prog bed binfile fastafile Write bed files where the bases have at least certain depth. """ p = OptionParser(bed.__doc__) p.add_option("-o", dest="output", default="stdout", help="Output file name [default: %default]") p.add_option("--cutoff", dest="cutoff", ...
def function[bed, parameter[args]]: constant[ %prog bed binfile fastafile Write bed files where the bases have at least certain depth. ] variable[p] assign[=] call[name[OptionParser], parameter[name[bed].__doc__]] call[name[p].add_option, parameter[constant[-o]]] call[name[p...
keyword[def] identifier[bed] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[bed] . identifier[__doc__] ) identifier[p] . identifier[add_option] ( literal[string] , identifier[dest] = literal[string] , identifier[default] = literal[string] , identifier[...
def bed(args): """ %prog bed binfile fastafile Write bed files where the bases have at least certain depth. """ p = OptionParser(bed.__doc__) p.add_option('-o', dest='output', default='stdout', help='Output file name [default: %default]') p.add_option('--cutoff', dest='cutoff', default=10, ...
def show_xref(self, f_a): """ Display where this field is read or written """ if f_a: bytecode._PrintSubBanner("XREF Read") xrefs_from = f_a.get_xref_read() for ref_class, ref_method in xrefs_from: bytecode._PrintDefault(ref_method....
def function[show_xref, parameter[self, f_a]]: constant[ Display where this field is read or written ] if name[f_a] begin[:] call[name[bytecode]._PrintSubBanner, parameter[constant[XREF Read]]] variable[xrefs_from] assign[=] call[name[f_a].get_xref_rea...
keyword[def] identifier[show_xref] ( identifier[self] , identifier[f_a] ): literal[string] keyword[if] identifier[f_a] : identifier[bytecode] . identifier[_PrintSubBanner] ( literal[string] ) identifier[xrefs_from] = identifier[f_a] . identifier[get_xref_read] () ...
def show_xref(self, f_a): """ Display where this field is read or written """ if f_a: bytecode._PrintSubBanner('XREF Read') xrefs_from = f_a.get_xref_read() for (ref_class, ref_method) in xrefs_from: bytecode._PrintDefault(ref_method.get_name()) ...
def _update_mean_coords(self, dig, N, centers_sum, **paircoords): """ Update the mean coordinate sums """ if N is None or centers_sum is None: return N.flat[:] += utils.bincount(dig, 1., minlength=N.size) for i, dim in enumerate(self.dims): size = centers_sum...
def function[_update_mean_coords, parameter[self, dig, N, centers_sum]]: constant[ Update the mean coordinate sums ] if <ast.BoolOp object at 0x7da18bcc9bd0> begin[:] return[None] <ast.AugAssign object at 0x7da18bccb5b0> for taget[tuple[[<ast.Name object at 0x7da20e95...
keyword[def] identifier[_update_mean_coords] ( identifier[self] , identifier[dig] , identifier[N] , identifier[centers_sum] ,** identifier[paircoords] ): literal[string] keyword[if] identifier[N] keyword[is] keyword[None] keyword[or] identifier[centers_sum] keyword[is] keyword[None] : keywor...
def _update_mean_coords(self, dig, N, centers_sum, **paircoords): """ Update the mean coordinate sums """ if N is None or centers_sum is None: return # depends on [control=['if'], data=[]] N.flat[:] += utils.bincount(dig, 1.0, minlength=N.size) for (i, dim) in enumerate(self.dim...
def parse_tasks_file_header(header, input_file_param_util, output_file_param_util): """Parse the header from the tasks file into env, input, output definitions. Elements are formatted similar to their equivalent command-line arguments, but with associated values coming from the data r...
def function[parse_tasks_file_header, parameter[header, input_file_param_util, output_file_param_util]]: constant[Parse the header from the tasks file into env, input, output definitions. Elements are formatted similar to their equivalent command-line arguments, but with associated values coming from the d...
keyword[def] identifier[parse_tasks_file_header] ( identifier[header] , identifier[input_file_param_util] , identifier[output_file_param_util] ): literal[string] identifier[job_params] =[] keyword[for] identifier[col] keyword[in] identifier[header] : identifier[col_type] = literal[string] ...
def parse_tasks_file_header(header, input_file_param_util, output_file_param_util): """Parse the header from the tasks file into env, input, output definitions. Elements are formatted similar to their equivalent command-line arguments, but with associated values coming from the data rows. Environment variab...
def run(self): ''' Execute the batch run ''' args = [[], self.opts['fun'], self.opts['arg'], self.opts['timeout'], 'list', ] bnum = self.get_bnum() # No targets to run if not self.mini...
def function[run, parameter[self]]: constant[ Execute the batch run ] variable[args] assign[=] list[[<ast.List object at 0x7da1b208fac0>, <ast.Subscript object at 0x7da1b208f9d0>, <ast.Subscript object at 0x7da1b208da20>, <ast.Subscript object at 0x7da1b208d150>, <ast.Constant object at ...
keyword[def] identifier[run] ( identifier[self] ): literal[string] identifier[args] =[[], identifier[self] . identifier[opts] [ literal[string] ], identifier[self] . identifier[opts] [ literal[string] ], identifier[self] . identifier[opts] [ literal[string] ], li...
def run(self): """ Execute the batch run """ args = [[], self.opts['fun'], self.opts['arg'], self.opts['timeout'], 'list'] bnum = self.get_bnum() # No targets to run if not self.minions: return # depends on [control=['if'], data=[]] to_run = copy.deepcopy(self.minions) ...
def main(): """ NAME aarm_magic.py DESCRIPTION Converts AARM data to best-fit tensor (6 elements plus sigma) Original program ARMcrunch written to accomodate ARM anisotropy data collected from 6 axial directions (+X,+Y,+Z,-X,-Y,-Z) using the off-axis remanence ...
def function[main, parameter[]]: constant[ NAME aarm_magic.py DESCRIPTION Converts AARM data to best-fit tensor (6 elements plus sigma) Original program ARMcrunch written to accomodate ARM anisotropy data collected from 6 axial directions (+X,+Y,+Z,-X,-Y,-Z) using th...
keyword[def] identifier[main] (): literal[string] identifier[args] = identifier[sys] . identifier[argv] keyword[if] literal[string] keyword[in] identifier[args] : identifier[print] ( identifier[main] . identifier[__doc__] ) identifier[sys] . identifier[exit] () ...
def main(): """ NAME aarm_magic.py DESCRIPTION Converts AARM data to best-fit tensor (6 elements plus sigma) Original program ARMcrunch written to accomodate ARM anisotropy data collected from 6 axial directions (+X,+Y,+Z,-X,-Y,-Z) using the off-axis remanence ...
def flattened(self, pred=flattened_pred_default): """Flattens nodes by hoisting children up to ancestor nodes. A node is hoisted if pred(node) returns True. """ if self.is_value: return self new_children = [] for child in self.children: if child.is_empty: continue n...
def function[flattened, parameter[self, pred]]: constant[Flattens nodes by hoisting children up to ancestor nodes. A node is hoisted if pred(node) returns True. ] if name[self].is_value begin[:] return[name[self]] variable[new_children] assign[=] list[[]] for taget[name[...
keyword[def] identifier[flattened] ( identifier[self] , identifier[pred] = identifier[flattened_pred_default] ): literal[string] keyword[if] identifier[self] . identifier[is_value] : keyword[return] identifier[self] identifier[new_children] =[] keyword[for] identifier[child] keyword...
def flattened(self, pred=flattened_pred_default): """Flattens nodes by hoisting children up to ancestor nodes. A node is hoisted if pred(node) returns True. """ if self.is_value: return self # depends on [control=['if'], data=[]] new_children = [] for child in self.children: if...
def getMovie(): """ Returns the movie instance for the loader widget. :return <QMovie> """ if not XLoaderWidget.MOVIE: filename = projexui.resources.find('img/ajax_loader.gif') XLoaderWidget.MOVIE = QMovie() XLoaderWidget.MOVIE.set...
def function[getMovie, parameter[]]: constant[ Returns the movie instance for the loader widget. :return <QMovie> ] if <ast.UnaryOp object at 0x7da2043445b0> begin[:] variable[filename] assign[=] call[name[projexui].resources.find, parameter[constant[...
keyword[def] identifier[getMovie] (): literal[string] keyword[if] keyword[not] identifier[XLoaderWidget] . identifier[MOVIE] : identifier[filename] = identifier[projexui] . identifier[resources] . identifier[find] ( literal[string] ) identifier[XLoaderWidget] . identifie...
def getMovie(): """ Returns the movie instance for the loader widget. :return <QMovie> """ if not XLoaderWidget.MOVIE: filename = projexui.resources.find('img/ajax_loader.gif') XLoaderWidget.MOVIE = QMovie() XLoaderWidget.MOVIE.setFileName(filename) ...
def add_resource(self, descriptor): """https://github.com/frictionlessdata/datapackage-py#package """ self.__current_descriptor.setdefault('resources', []) self.__current_descriptor['resources'].append(descriptor) self.__build() return self.__resources[-1]
def function[add_resource, parameter[self, descriptor]]: constant[https://github.com/frictionlessdata/datapackage-py#package ] call[name[self].__current_descriptor.setdefault, parameter[constant[resources], list[[]]]] call[call[name[self].__current_descriptor][constant[resources]].append...
keyword[def] identifier[add_resource] ( identifier[self] , identifier[descriptor] ): literal[string] identifier[self] . identifier[__current_descriptor] . identifier[setdefault] ( literal[string] ,[]) identifier[self] . identifier[__current_descriptor] [ literal[string] ]. identifier[appen...
def add_resource(self, descriptor): """https://github.com/frictionlessdata/datapackage-py#package """ self.__current_descriptor.setdefault('resources', []) self.__current_descriptor['resources'].append(descriptor) self.__build() return self.__resources[-1]
def find_instances(instance_id=None, name=None, tags=None, region=None, key=None, keyid=None, profile=None, return_objs=False, in_states=None, filters=None): ''' Given instance properties, find and return matching instance ids CLI Examples: .. code-block:: bash ...
def function[find_instances, parameter[instance_id, name, tags, region, key, keyid, profile, return_objs, in_states, filters]]: constant[ Given instance properties, find and return matching instance ids CLI Examples: .. code-block:: bash salt myminion boto_ec2.find_instances # Lists all i...
keyword[def] identifier[find_instances] ( identifier[instance_id] = keyword[None] , identifier[name] = keyword[None] , identifier[tags] = keyword[None] , identifier[region] = keyword[None] , identifier[key] = keyword[None] , identifier[keyid] = keyword[None] , identifier[profile] = keyword[None] , identifier[return_...
def find_instances(instance_id=None, name=None, tags=None, region=None, key=None, keyid=None, profile=None, return_objs=False, in_states=None, filters=None): """ Given instance properties, find and return matching instance ids CLI Examples: .. code-block:: bash salt myminion boto_ec2.find_ins...
def create(**kwargs): """ Create and a return a specialized contract based on the given secType, or a general Contract if secType is not given. """ secType = kwargs.get('secType', '') cls = { '': Contract, 'STK': Stock, 'OPT': Option, ...
def function[create, parameter[]]: constant[ Create and a return a specialized contract based on the given secType, or a general Contract if secType is not given. ] variable[secType] assign[=] call[name[kwargs].get, parameter[constant[secType], constant[]]] variable[cls] ...
keyword[def] identifier[create] (** identifier[kwargs] ): literal[string] identifier[secType] = identifier[kwargs] . identifier[get] ( literal[string] , literal[string] ) identifier[cls] ={ literal[string] : identifier[Contract] , literal[string] : identifier[Stock] , ...
def create(**kwargs): """ Create and a return a specialized contract based on the given secType, or a general Contract if secType is not given. """ secType = kwargs.get('secType', '') cls = {'': Contract, 'STK': Stock, 'OPT': Option, 'FUT': Future, 'CONTFUT': ContFuture, 'CASH': Fore...
def processHierarchical(self): """Main process.for hierarchial segmentation. Returns ------- est_idxs : list List with np.arrays for each layer of segmentation containing the estimated indeces for the segment boundaries. est_labels : list List ...
def function[processHierarchical, parameter[self]]: constant[Main process.for hierarchial segmentation. Returns ------- est_idxs : list List with np.arrays for each layer of segmentation containing the estimated indeces for the segment boundaries. est_labe...
keyword[def] identifier[processHierarchical] ( identifier[self] ): literal[string] identifier[F] = identifier[self] . identifier[_preprocess] () identifier[F] = identifier[librosa] . identifier[util] . identifier[normalize] ( identifier[F] , identifier[axis] = literal[int] ) ident...
def processHierarchical(self): """Main process.for hierarchial segmentation. Returns ------- est_idxs : list List with np.arrays for each layer of segmentation containing the estimated indeces for the segment boundaries. est_labels : list List with...
def xccdf(params): ''' Run ``oscap xccdf`` commands on minions. It uses cp.push_dir to upload the generated files to the salt master in the master's minion files cachedir (defaults to ``/var/cache/salt/master/minions/minion-id/files``) It needs ``file_recv`` set to ``True`` in the master config...
def function[xccdf, parameter[params]]: constant[ Run ``oscap xccdf`` commands on minions. It uses cp.push_dir to upload the generated files to the salt master in the master's minion files cachedir (defaults to ``/var/cache/salt/master/minions/minion-id/files``) It needs ``file_recv`` set t...
keyword[def] identifier[xccdf] ( identifier[params] ): literal[string] identifier[params] = identifier[shlex] . identifier[split] ( identifier[params] ) identifier[policy] = identifier[params] [- literal[int] ] identifier[success] = keyword[True] identifier[error] = keyword[None] ide...
def xccdf(params): """ Run ``oscap xccdf`` commands on minions. It uses cp.push_dir to upload the generated files to the salt master in the master's minion files cachedir (defaults to ``/var/cache/salt/master/minions/minion-id/files``) It needs ``file_recv`` set to ``True`` in the master config...
def ascii_encoding(self): """ :return: str: Returns the ASCII-encoded string Thorn (Þ, þ) and Ash(Æ, æ) are substituted by the digraphs 'th' and 'ae' respectively. Wynn(Ƿ, ƿ) and Eth(Ð, ð) are replaced by 'w' and 'd'. Examples: >>> Word('ġelǣd').ascii_encod...
def function[ascii_encoding, parameter[self]]: constant[ :return: str: Returns the ASCII-encoded string Thorn (Þ, þ) and Ash(Æ, æ) are substituted by the digraphs 'th' and 'ae' respectively. Wynn(Ƿ, ƿ) and Eth(Ð, ð) are replaced by 'w' and 'd'. Examples: >>...
keyword[def] identifier[ascii_encoding] ( identifier[self] ): literal[string] identifier[w] = identifier[self] . identifier[remove_diacritics] () keyword[for] identifier[k] , identifier[val] keyword[in] identifier[zip] ( identifier[Normalize] . identifier[keys] (), identifier[Normaliz...
def ascii_encoding(self): """ :return: str: Returns the ASCII-encoded string Thorn (Þ, þ) and Ash(Æ, æ) are substituted by the digraphs 'th' and 'ae' respectively. Wynn(Ƿ, ƿ) and Eth(Ð, ð) are replaced by 'w' and 'd'. Examples: >>> Word('ġelǣd').ascii_encoding(...
def _fit_RSA_UV(self, X, Y, X_base, scan_onsets=None, coords=None, inten=None): """ The major utility of fitting Bayesian RSA. Note that there is a naming change of variable. X in fit() is changed to Y here, and design in fit() is changed to X here. This i...
def function[_fit_RSA_UV, parameter[self, X, Y, X_base, scan_onsets, coords, inten]]: constant[ The major utility of fitting Bayesian RSA. Note that there is a naming change of variable. X in fit() is changed to Y here, and design in fit() is changed to X here. This is becaus...
keyword[def] identifier[_fit_RSA_UV] ( identifier[self] , identifier[X] , identifier[Y] , identifier[X_base] , identifier[scan_onsets] = keyword[None] , identifier[coords] = keyword[None] , identifier[inten] = keyword[None] ): literal[string] identifier[GP_inten] = identifier[self] . identifier[GP...
def _fit_RSA_UV(self, X, Y, X_base, scan_onsets=None, coords=None, inten=None): """ The major utility of fitting Bayesian RSA. Note that there is a naming change of variable. X in fit() is changed to Y here, and design in fit() is changed to X here. This is because we follow the ...
def submit_reading(basename, pmid_list_filename, readers, start_ix=None, end_ix=None, pmids_per_job=3000, num_tries=2, force_read=False, force_fulltext=False, project_name=None): """Submit an old-style pmid-centered no-database s3 only reading job. This function is provide...
def function[submit_reading, parameter[basename, pmid_list_filename, readers, start_ix, end_ix, pmids_per_job, num_tries, force_read, force_fulltext, project_name]]: constant[Submit an old-style pmid-centered no-database s3 only reading job. This function is provided for the sake of backward compatibility....
keyword[def] identifier[submit_reading] ( identifier[basename] , identifier[pmid_list_filename] , identifier[readers] , identifier[start_ix] = keyword[None] , identifier[end_ix] = keyword[None] , identifier[pmids_per_job] = literal[int] , identifier[num_tries] = literal[int] , identifier[force_read] = keyword[False...
def submit_reading(basename, pmid_list_filename, readers, start_ix=None, end_ix=None, pmids_per_job=3000, num_tries=2, force_read=False, force_fulltext=False, project_name=None): """Submit an old-style pmid-centered no-database s3 only reading job. This function is provided for the sake of backward compatibili...
def chunks(sliceable, n): """ returns a list of lists of any slice-able object each of max lentgh n :Parameters: -sliceable: (string|list|tuple) any sliceable object - n max elements of ech chunk :Example: >>> chunksn([1,2,3,4,5,6,7,8,9,'x'], 4) [[1, 2, 3, 4], [5, 6, 7, ...
def function[chunks, parameter[sliceable, n]]: constant[ returns a list of lists of any slice-able object each of max lentgh n :Parameters: -sliceable: (string|list|tuple) any sliceable object - n max elements of ech chunk :Example: >>> chunksn([1,2,3,4,5,6,7,8,9,'x'], 4) ...
keyword[def] identifier[chunks] ( identifier[sliceable] , identifier[n] ): literal[string] keyword[return] [ identifier[sliceable] [ identifier[i] : identifier[i] + identifier[n] ] keyword[for] identifier[i] keyword[in] identifier[range] ( literal[int] , identifier[len] ( identifier[sliceable] ), identi...
def chunks(sliceable, n): """ returns a list of lists of any slice-able object each of max lentgh n :Parameters: -sliceable: (string|list|tuple) any sliceable object - n max elements of ech chunk :Example: >>> chunksn([1,2,3,4,5,6,7,8,9,'x'], 4) [[1, 2, 3, 4], [5, 6, 7, ...
def rmon_alarm_entry_alarm_falling_threshold(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") rmon = ET.SubElement(config, "rmon", xmlns="urn:brocade.com:mgmt:brocade-rmon") alarm_entry = ET.SubElement(rmon, "alarm-entry") alarm_index_key = ET.Sub...
def function[rmon_alarm_entry_alarm_falling_threshold, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[rmon] assign[=] call[name[ET].SubElement, parameter[name[config], constant[rmon]]] varia...
keyword[def] identifier[rmon_alarm_entry_alarm_falling_threshold] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[rmon] = identifier[ET] . identifier[SubElement] ( identifier[config] , lit...
def rmon_alarm_entry_alarm_falling_threshold(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') rmon = ET.SubElement(config, 'rmon', xmlns='urn:brocade.com:mgmt:brocade-rmon') alarm_entry = ET.SubElement(rmon, 'alarm-entry') alarm_index_key = ET.SubElement(alarm_entry,...
def modified(self): 'return datetime.datetime' return dateutil.parser.parse(str(self.f.currentRevision.modified))
def function[modified, parameter[self]]: constant[return datetime.datetime] return[call[name[dateutil].parser.parse, parameter[call[name[str], parameter[name[self].f.currentRevision.modified]]]]]
keyword[def] identifier[modified] ( identifier[self] ): literal[string] keyword[return] identifier[dateutil] . identifier[parser] . identifier[parse] ( identifier[str] ( identifier[self] . identifier[f] . identifier[currentRevision] . identifier[modified] ))
def modified(self): """return datetime.datetime""" return dateutil.parser.parse(str(self.f.currentRevision.modified))
def assign(self, expr): """Give *expr* a name.""" name = self.variable() self.statements.append(ast.Assign([ast.Name(name, ast.Store())], expr)) return ast.Name(name, ast.Load())
def function[assign, parameter[self, expr]]: constant[Give *expr* a name.] variable[name] assign[=] call[name[self].variable, parameter[]] call[name[self].statements.append, parameter[call[name[ast].Assign, parameter[list[[<ast.Call object at 0x7da1b1649390>]], name[expr]]]]] return[call[nam...
keyword[def] identifier[assign] ( identifier[self] , identifier[expr] ): literal[string] identifier[name] = identifier[self] . identifier[variable] () identifier[self] . identifier[statements] . identifier[append] ( identifier[ast] . identifier[Assign] ([ identifier[ast] . identifier[Name]...
def assign(self, expr): """Give *expr* a name.""" name = self.variable() self.statements.append(ast.Assign([ast.Name(name, ast.Store())], expr)) return ast.Name(name, ast.Load())