code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def quick_menu(self, banner, list_line_format, choice_list): """ Function to display a quick menu for user input **Parameters:** - **banner:** Text to display before menu - **list_line_format:** Print'ing string with format spots for index + tuple values - **choic...
def function[quick_menu, parameter[self, banner, list_line_format, choice_list]]: constant[ Function to display a quick menu for user input **Parameters:** - **banner:** Text to display before menu - **list_line_format:** Print'ing string with format spots for index + tuple...
keyword[def] identifier[quick_menu] ( identifier[self] , identifier[banner] , identifier[list_line_format] , identifier[choice_list] ): literal[string] identifier[invalid] = keyword[True] identifier[menu_int] =- literal[int] keyword[while] identifier[invalid]...
def quick_menu(self, banner, list_line_format, choice_list): """ Function to display a quick menu for user input **Parameters:** - **banner:** Text to display before menu - **list_line_format:** Print'ing string with format spots for index + tuple values - **choice_li...
def validate(config): ''' Validate the beacon configuration ''' # Configuration for adb beacon should be a dictionary with states array if not isinstance(config, list): log.info('Configuration for adb beacon must be a list.') return False, ('Configuration for adb beacon must be a lis...
def function[validate, parameter[config]]: constant[ Validate the beacon configuration ] if <ast.UnaryOp object at 0x7da1b21ea710> begin[:] call[name[log].info, parameter[constant[Configuration for adb beacon must be a list.]]] return[tuple[[<ast.Constant object at 0x7da1...
keyword[def] identifier[validate] ( identifier[config] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[config] , identifier[list] ): identifier[log] . identifier[info] ( literal[string] ) keyword[return] keyword[False] ,( literal[string] ) ide...
def validate(config): """ Validate the beacon configuration """ # Configuration for adb beacon should be a dictionary with states array if not isinstance(config, list): log.info('Configuration for adb beacon must be a list.') return (False, 'Configuration for adb beacon must be a lis...
def add_permission(self, topic, label, account_ids, actions): """ Adds a statement to a topic's access control policy, granting access for the specified AWS accounts to the specified actions. :type topic: string :param topic: The ARN of the topic. :type label: string ...
def function[add_permission, parameter[self, topic, label, account_ids, actions]]: constant[ Adds a statement to a topic's access control policy, granting access for the specified AWS accounts to the specified actions. :type topic: string :param topic: The ARN of the topic. ...
keyword[def] identifier[add_permission] ( identifier[self] , identifier[topic] , identifier[label] , identifier[account_ids] , identifier[actions] ): literal[string] identifier[params] ={ literal[string] : literal[string] , literal[string] : identifier[topic] , literal[string] : i...
def add_permission(self, topic, label, account_ids, actions): """ Adds a statement to a topic's access control policy, granting access for the specified AWS accounts to the specified actions. :type topic: string :param topic: The ARN of the topic. :type label: string ...
def consumer(self, service, data, to_update, status): """ call the consumer and handle the data :param service: :param data: :param to_update: :param status: :return: status """ # consumer - the service which uses the data ...
def function[consumer, parameter[self, service, data, to_update, status]]: constant[ call the consumer and handle the data :param service: :param data: :param to_update: :param status: :return: status ] variable[service_cons...
keyword[def] identifier[consumer] ( identifier[self] , identifier[service] , identifier[data] , identifier[to_update] , identifier[status] ): literal[string] identifier[service_consumer] = identifier[default_provider] . identifier[get_service] ( identifier[str] ( identifier[service] . iden...
def consumer(self, service, data, to_update, status): """ call the consumer and handle the data :param service: :param data: :param to_update: :param status: :return: status """ # consumer - the service which uses the data servi...
def _read_settings(self, retry=True): """Read the information from the Hottop. Read the settings from the serial interface and convert them into a human-readable format that can be shared back to the end-user. Reading from the serial interface will occasionally produce strange results o...
def function[_read_settings, parameter[self, retry]]: constant[Read the information from the Hottop. Read the settings from the serial interface and convert them into a human-readable format that can be shared back to the end-user. Reading from the serial interface will occasionally pro...
keyword[def] identifier[_read_settings] ( identifier[self] , identifier[retry] = keyword[True] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_conn] . identifier[isOpen] (): identifier[self] . identifier[_log] . identifier[debug] ( literal[string] ) ...
def _read_settings(self, retry=True): """Read the information from the Hottop. Read the settings from the serial interface and convert them into a human-readable format that can be shared back to the end-user. Reading from the serial interface will occasionally produce strange results or ...
def _prepare_trans_tar(name, sls_opts, mods=None, pillar=None, extra_filerefs=''): ''' Prepares a self contained tarball that has the state to be applied in the container ''' chunks = _compile_state(sls_opts, mods) # reuse it from salt.ssh, however this function should ...
def function[_prepare_trans_tar, parameter[name, sls_opts, mods, pillar, extra_filerefs]]: constant[ Prepares a self contained tarball that has the state to be applied in the container ] variable[chunks] assign[=] call[name[_compile_state], parameter[name[sls_opts], name[mods]]] vari...
keyword[def] identifier[_prepare_trans_tar] ( identifier[name] , identifier[sls_opts] , identifier[mods] = keyword[None] , identifier[pillar] = keyword[None] , identifier[extra_filerefs] = literal[string] ): literal[string] identifier[chunks] = identifier[_compile_state] ( identifier[sls_opts] , identifie...
def _prepare_trans_tar(name, sls_opts, mods=None, pillar=None, extra_filerefs=''): """ Prepares a self contained tarball that has the state to be applied in the container """ chunks = _compile_state(sls_opts, mods) # reuse it from salt.ssh, however this function should # be somewhere else ...
def parse_filename(filename): """Parse media filename for metadata. :param str filename: the name of media file :returns: dict of metadata attributes found in filename or None if no matching expression. :rtype: dict """ _patterns = patterns.get_expressions() result = {} ...
def function[parse_filename, parameter[filename]]: constant[Parse media filename for metadata. :param str filename: the name of media file :returns: dict of metadata attributes found in filename or None if no matching expression. :rtype: dict ] variable[_patterns] assign[=...
keyword[def] identifier[parse_filename] ( identifier[filename] ): literal[string] identifier[_patterns] = identifier[patterns] . identifier[get_expressions] () identifier[result] ={} keyword[for] identifier[cmatcher] keyword[in] identifier[_patterns] : identifier[match] = identifier...
def parse_filename(filename): """Parse media filename for metadata. :param str filename: the name of media file :returns: dict of metadata attributes found in filename or None if no matching expression. :rtype: dict """ _patterns = patterns.get_expressions() result = {} fo...
def _y_axis(self): """Make the y axis: labels and guides""" if not self._y_labels or not self.show_y_labels: return axis = self.svg.node( self.nodes['plot'], class_="axis y%s" % (' always_show' if self.show_y_guides else '') ) if (0 not in [l...
def function[_y_axis, parameter[self]]: constant[Make the y axis: labels and guides] if <ast.BoolOp object at 0x7da2045649d0> begin[:] return[None] variable[axis] assign[=] call[name[self].svg.node, parameter[call[name[self].nodes][constant[plot]]]] if <ast.BoolOp object at 0x7da...
keyword[def] identifier[_y_axis] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_y_labels] keyword[or] keyword[not] identifier[self] . identifier[show_y_labels] : keyword[return] identifier[axis] = identifier[self] . identif...
def _y_axis(self): """Make the y axis: labels and guides""" if not self._y_labels or not self.show_y_labels: return # depends on [control=['if'], data=[]] axis = self.svg.node(self.nodes['plot'], class_='axis y%s' % (' always_show' if self.show_y_guides else '')) if 0 not in [label[1] for label...
def define_page_breakpoint(self, dwProcessId, address, pages = 1, condition = True, action = None): """ Creates a disabled page breakpoint at the given address. @se...
def function[define_page_breakpoint, parameter[self, dwProcessId, address, pages, condition, action]]: constant[ Creates a disabled page breakpoint at the given address. @see: L{has_page_breakpoint}, L{get_page_breakpoint}, L{enable_page_breakpoint}, ...
keyword[def] identifier[define_page_breakpoint] ( identifier[self] , identifier[dwProcessId] , identifier[address] , identifier[pages] = literal[int] , identifier[condition] = keyword[True] , identifier[action] = keyword[None] ): literal[string] identifier[process] = identifier[self] . identifier...
def define_page_breakpoint(self, dwProcessId, address, pages=1, condition=True, action=None): """ Creates a disabled page breakpoint at the given address. @see: L{has_page_breakpoint}, L{get_page_breakpoint}, L{enable_page_breakpoint}, L{enable_one_sh...
def cleanup(self): """ Remove empty keys from this object. Should always be called after the result is final. :return: """ empty_keys = [k for k, v in self.items() if not v] for k in empty_keys: del self[k]
def function[cleanup, parameter[self]]: constant[ Remove empty keys from this object. Should always be called after the result is final. :return: ] variable[empty_keys] assign[=] <ast.ListComp object at 0x7da20c992710> for taget[name[k]] in starred[name[empty_keys]] begin...
keyword[def] identifier[cleanup] ( identifier[self] ): literal[string] identifier[empty_keys] =[ identifier[k] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[self] . identifier[items] () keyword[if] keyword[not] identifier[v] ] keyword[for] identifier[k] keyword...
def cleanup(self): """ Remove empty keys from this object. Should always be called after the result is final. :return: """ empty_keys = [k for (k, v) in self.items() if not v] for k in empty_keys: del self[k] # depends on [control=['for'], data=['k']]
def change_analysis_requests_id_formatting(portal, p_type="AnalysisRequest"): """Applies the system's Sample ID Formatting to Analysis Request """ ar_id_format = dict( form='{sampleType}-{seq:04d}', portal_type='AnalysisRequest', prefix='analysisrequest', sequence_type='gener...
def function[change_analysis_requests_id_formatting, parameter[portal, p_type]]: constant[Applies the system's Sample ID Formatting to Analysis Request ] variable[ar_id_format] assign[=] call[name[dict], parameter[]] variable[bs] assign[=] name[portal].bika_setup variable[id_formatti...
keyword[def] identifier[change_analysis_requests_id_formatting] ( identifier[portal] , identifier[p_type] = literal[string] ): literal[string] identifier[ar_id_format] = identifier[dict] ( identifier[form] = literal[string] , identifier[portal_type] = literal[string] , identifier[prefix] = l...
def change_analysis_requests_id_formatting(portal, p_type='AnalysisRequest'): """Applies the system's Sample ID Formatting to Analysis Request """ ar_id_format = dict(form='{sampleType}-{seq:04d}', portal_type='AnalysisRequest', prefix='analysisrequest', sequence_type='generated', counter_type='', split_len...
def add_not_null(self, model, *names): """Add not null.""" for name in names: field = model._meta.fields[name] field.null = False self.ops.append(self.migrator.add_not_null(model._meta.table_name, field.column_name)) return model
def function[add_not_null, parameter[self, model]]: constant[Add not null.] for taget[name[name]] in starred[name[names]] begin[:] variable[field] assign[=] call[name[model]._meta.fields][name[name]] name[field].null assign[=] constant[False] call[name[sel...
keyword[def] identifier[add_not_null] ( identifier[self] , identifier[model] ,* identifier[names] ): literal[string] keyword[for] identifier[name] keyword[in] identifier[names] : identifier[field] = identifier[model] . identifier[_meta] . identifier[fields] [ identifier[name] ] ...
def add_not_null(self, model, *names): """Add not null.""" for name in names: field = model._meta.fields[name] field.null = False self.ops.append(self.migrator.add_not_null(model._meta.table_name, field.column_name)) # depends on [control=['for'], data=['name']] return model
def view(request, namespace, docid): """The initial view, does not provide the document content yet""" if flat.users.models.hasreadpermission(request.user.username, namespace, request): if 'autodeclare' in settings.CONFIGURATIONS[request.session['configuration']]: if flat.users.models.haswri...
def function[view, parameter[request, namespace, docid]]: constant[The initial view, does not provide the document content yet] if call[name[flat].users.models.hasreadpermission, parameter[name[request].user.username, name[namespace], name[request]]] begin[:] if compare[constant[autodecl...
keyword[def] identifier[view] ( identifier[request] , identifier[namespace] , identifier[docid] ): literal[string] keyword[if] identifier[flat] . identifier[users] . identifier[models] . identifier[hasreadpermission] ( identifier[request] . identifier[user] . identifier[username] , identifier[namespace] ,...
def view(request, namespace, docid): """The initial view, does not provide the document content yet""" if flat.users.models.hasreadpermission(request.user.username, namespace, request): if 'autodeclare' in settings.CONFIGURATIONS[request.session['configuration']]: if flat.users.models.haswri...
def insert_and_publish_uow(self, job_record, start_id, end_id): """ method creates and publishes a unit_of_work. it also handles DuplicateKeyError and attempts recovery :return: tuple (uow, is_duplicate) :raise UserWarning: if the recovery from DuplicateKeyError was unsuccessful """ ...
def function[insert_and_publish_uow, parameter[self, job_record, start_id, end_id]]: constant[ method creates and publishes a unit_of_work. it also handles DuplicateKeyError and attempts recovery :return: tuple (uow, is_duplicate) :raise UserWarning: if the recovery from DuplicateKeyError was un...
keyword[def] identifier[insert_and_publish_uow] ( identifier[self] , identifier[job_record] , identifier[start_id] , identifier[end_id] ): literal[string] identifier[process_name] = identifier[job_record] . identifier[process_name] identifier[timeperiod] = identifier[job_record] . identif...
def insert_and_publish_uow(self, job_record, start_id, end_id): """ method creates and publishes a unit_of_work. it also handles DuplicateKeyError and attempts recovery :return: tuple (uow, is_duplicate) :raise UserWarning: if the recovery from DuplicateKeyError was unsuccessful """ proc...
def assert_element_absent(self, selector, by=By.CSS_SELECTOR, timeout=settings.SMALL_TIMEOUT): """ Similar to wait_for_element_absent() - returns nothing. As above, will raise an exception if the element stays present. Returns True if successful. Default tim...
def function[assert_element_absent, parameter[self, selector, by, timeout]]: constant[ Similar to wait_for_element_absent() - returns nothing. As above, will raise an exception if the element stays present. Returns True if successful. Default timeout = SMALL_TIMEOUT. ] if <ast.Bo...
keyword[def] identifier[assert_element_absent] ( identifier[self] , identifier[selector] , identifier[by] = identifier[By] . identifier[CSS_SELECTOR] , identifier[timeout] = identifier[settings] . identifier[SMALL_TIMEOUT] ): literal[string] keyword[if] identifier[self] . identifier[timeout_multi...
def assert_element_absent(self, selector, by=By.CSS_SELECTOR, timeout=settings.SMALL_TIMEOUT): """ Similar to wait_for_element_absent() - returns nothing. As above, will raise an exception if the element stays present. Returns True if successful. Default timeout = SMALL_TIMEOUT. """ if s...
def clean(): """ Clean data created by this script """ for queue in MyQueue.collection().instances(): queue.delete() for job in MyJob.collection().instances(): job.delete() for person in Person.collection().instances(): person.delete()
def function[clean, parameter[]]: constant[ Clean data created by this script ] for taget[name[queue]] in starred[call[call[name[MyQueue].collection, parameter[]].instances, parameter[]]] begin[:] call[name[queue].delete, parameter[]] for taget[name[job]] in starred[call[...
keyword[def] identifier[clean] (): literal[string] keyword[for] identifier[queue] keyword[in] identifier[MyQueue] . identifier[collection] (). identifier[instances] (): identifier[queue] . identifier[delete] () keyword[for] identifier[job] keyword[in] identifier[MyJob] . identifier[coll...
def clean(): """ Clean data created by this script """ for queue in MyQueue.collection().instances(): queue.delete() # depends on [control=['for'], data=['queue']] for job in MyJob.collection().instances(): job.delete() # depends on [control=['for'], data=['job']] for person in...
def add(self, entities): """ Adds the given entities to the cache, if they weren't saved before. """ if not utils.is_list_like(entities): # Invariant: all "chats" and "users" are always iterables, # and "user" never is (so we wrap it inside a list). en...
def function[add, parameter[self, entities]]: constant[ Adds the given entities to the cache, if they weren't saved before. ] if <ast.UnaryOp object at 0x7da1b21daec0> begin[:] variable[entities] assign[=] call[name[itertools].chain, parameter[call[name[getattr], paramete...
keyword[def] identifier[add] ( identifier[self] , identifier[entities] ): literal[string] keyword[if] keyword[not] identifier[utils] . identifier[is_list_like] ( identifier[entities] ): identifier[entities] = identifier[itertools] . identifier[chain] ( ...
def add(self, entities): """ Adds the given entities to the cache, if they weren't saved before. """ if not utils.is_list_like(entities): # Invariant: all "chats" and "users" are always iterables, # and "user" never is (so we wrap it inside a list). entities = itertools.c...
def gp_size(self, _gp_size): """Store the new start address attribute of the BFD file being processed. """ if not self._ptr: raise BfdException("BFD not initialized") return _bfd.set_gp_size(self._ptr, _gp_size)
def function[gp_size, parameter[self, _gp_size]]: constant[Store the new start address attribute of the BFD file being processed. ] if <ast.UnaryOp object at 0x7da207f9ad70> begin[:] <ast.Raise object at 0x7da207f99210> return[call[name[_bfd].set_gp_size, parameter[n...
keyword[def] identifier[gp_size] ( identifier[self] , identifier[_gp_size] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_ptr] : keyword[raise] identifier[BfdException] ( literal[string] ) keyword[return] identifier[_bfd] . identifier[set_gp_si...
def gp_size(self, _gp_size): """Store the new start address attribute of the BFD file being processed. """ if not self._ptr: raise BfdException('BFD not initialized') # depends on [control=['if'], data=[]] return _bfd.set_gp_size(self._ptr, _gp_size)
def add(self, vm): """ Add a DalvikVMFormat to this Analysis :param vm: :class:`dvm.DalvikVMFormat` to add to this Analysis """ self.vms.append(vm) for current_class in vm.get_classes(): self.classes[current_class.get_name()] = ClassAnalysis(current_class) ...
def function[add, parameter[self, vm]]: constant[ Add a DalvikVMFormat to this Analysis :param vm: :class:`dvm.DalvikVMFormat` to add to this Analysis ] call[name[self].vms.append, parameter[name[vm]]] for taget[name[current_class]] in starred[call[name[vm].get_classes, ...
keyword[def] identifier[add] ( identifier[self] , identifier[vm] ): literal[string] identifier[self] . identifier[vms] . identifier[append] ( identifier[vm] ) keyword[for] identifier[current_class] keyword[in] identifier[vm] . identifier[get_classes] (): identifier[self] . ...
def add(self, vm): """ Add a DalvikVMFormat to this Analysis :param vm: :class:`dvm.DalvikVMFormat` to add to this Analysis """ self.vms.append(vm) for current_class in vm.get_classes(): self.classes[current_class.get_name()] = ClassAnalysis(current_class) # depends on [con...
def pformat(tree): """Recursively formats a tree into a nice string representation. Example Input: yahoo = tt.Tree(tt.Node("CEO")) yahoo.root.add(tt.Node("Infra")) yahoo.root[0].add(tt.Node("Boss")) yahoo.root[0][0].add(tt.Node("Me")) yahoo.root.add(tt.Node("Mobile")) yahoo.root.a...
def function[pformat, parameter[tree]]: constant[Recursively formats a tree into a nice string representation. Example Input: yahoo = tt.Tree(tt.Node("CEO")) yahoo.root.add(tt.Node("Infra")) yahoo.root[0].add(tt.Node("Boss")) yahoo.root[0][0].add(tt.Node("Me")) yahoo.root.add(tt.No...
keyword[def] identifier[pformat] ( identifier[tree] ): literal[string] keyword[if] identifier[tree] . identifier[empty] (): keyword[return] literal[string] identifier[buf] = identifier[six] . identifier[StringIO] () keyword[for] identifier[line] keyword[in] identifier[_pformat] ( i...
def pformat(tree): """Recursively formats a tree into a nice string representation. Example Input: yahoo = tt.Tree(tt.Node("CEO")) yahoo.root.add(tt.Node("Infra")) yahoo.root[0].add(tt.Node("Boss")) yahoo.root[0][0].add(tt.Node("Me")) yahoo.root.add(tt.Node("Mobile")) yahoo.root.a...
def cycle_slice(sliceable, start, end): """Given a list, return right hand cycle direction slice from start to end. Usage:: >>> array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> cycle_slice(array, 4, 7) # from array[4] to array[7] [4, 5, 6, 7] >>> cycle_slice(array, 8, 2) # from arra...
def function[cycle_slice, parameter[sliceable, start, end]]: constant[Given a list, return right hand cycle direction slice from start to end. Usage:: >>> array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> cycle_slice(array, 4, 7) # from array[4] to array[7] [4, 5, 6, 7] >>> cycle...
keyword[def] identifier[cycle_slice] ( identifier[sliceable] , identifier[start] , identifier[end] ): literal[string] keyword[if] identifier[type] ( identifier[sliceable] )!= identifier[list] : identifier[sliceable] = identifier[list] ( identifier[sliceable] ) keyword[if] identifier[end] >...
def cycle_slice(sliceable, start, end): """Given a list, return right hand cycle direction slice from start to end. Usage:: >>> array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> cycle_slice(array, 4, 7) # from array[4] to array[7] [4, 5, 6, 7] >>> cycle_slice(array, 8, 2) # from arra...
def mod_repo(repo, **kwargs): ''' Modify one or more values for a repo. If the repo does not exist, it will be created, so long as uri is defined. The following options are available to modify a repo definition: repo alias by which opkg refers to the repo. uri the URI to the r...
def function[mod_repo, parameter[repo]]: constant[ Modify one or more values for a repo. If the repo does not exist, it will be created, so long as uri is defined. The following options are available to modify a repo definition: repo alias by which opkg refers to the repo. uri ...
keyword[def] identifier[mod_repo] ( identifier[repo] ,** identifier[kwargs] ): literal[string] identifier[repos] = identifier[list_repos] () identifier[found] = keyword[False] identifier[uri] = literal[string] keyword[if] literal[string] keyword[in] identifier[kwargs] : identif...
def mod_repo(repo, **kwargs): """ Modify one or more values for a repo. If the repo does not exist, it will be created, so long as uri is defined. The following options are available to modify a repo definition: repo alias by which opkg refers to the repo. uri the URI to the r...
def generate_run_info(): """ 获取当前运行状态 """ uptime = datetime.datetime.now() - datetime.datetime.fromtimestamp(glb.run_info.create_time()) memory_usage = glb.run_info.memory_info().rss msg = '[当前时间] {now:%H:%M:%S}\n[运行时间] {uptime}\n[内存占用] {memory}\n[发送消息] {messages}'.format( now=datetime.d...
def function[generate_run_info, parameter[]]: constant[ 获取当前运行状态 ] variable[uptime] assign[=] binary_operation[call[name[datetime].datetime.now, parameter[]] - call[name[datetime].datetime.fromtimestamp, parameter[call[name[glb].run_info.create_time, parameter[]]]]] variable[memory_usage...
keyword[def] identifier[generate_run_info] (): literal[string] identifier[uptime] = identifier[datetime] . identifier[datetime] . identifier[now] ()- identifier[datetime] . identifier[datetime] . identifier[fromtimestamp] ( identifier[glb] . identifier[run_info] . identifier[create_time] ()) identifie...
def generate_run_info(): """ 获取当前运行状态 """ uptime = datetime.datetime.now() - datetime.datetime.fromtimestamp(glb.run_info.create_time()) memory_usage = glb.run_info.memory_info().rss msg = '[当前时间] {now:%H:%M:%S}\n[运行时间] {uptime}\n[内存占用] {memory}\n[发送消息] {messages}'.format(now=datetime.datetime.n...
def fetch_next(self): """A Future used with `gen.coroutine`_ to asynchronously retrieve the next document in the result set, fetching a batch of documents from the server if necessary. Resolves to ``False`` if there are no more documents, otherwise :meth:`next_object` is guaranteed to re...
def function[fetch_next, parameter[self]]: constant[A Future used with `gen.coroutine`_ to asynchronously retrieve the next document in the result set, fetching a batch of documents from the server if necessary. Resolves to ``False`` if there are no more documents, otherwise :meth:`next_...
keyword[def] identifier[fetch_next] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_buffer_size] () keyword[and] identifier[self] . identifier[alive] : keyword[return] identifier[self] . identifier[_get_more] () keywor...
def fetch_next(self): """A Future used with `gen.coroutine`_ to asynchronously retrieve the next document in the result set, fetching a batch of documents from the server if necessary. Resolves to ``False`` if there are no more documents, otherwise :meth:`next_object` is guaranteed to return...
def get_bond_lengths(self, indices): """Return the distances between given atoms. Calculates the distance between the atoms with indices ``i`` and ``b``. The indices can be given in three ways: * As simple list ``[i, b]`` * As list of lists: ``[[i1, b1], [i2, b2]...]`` ...
def function[get_bond_lengths, parameter[self, indices]]: constant[Return the distances between given atoms. Calculates the distance between the atoms with indices ``i`` and ``b``. The indices can be given in three ways: * As simple list ``[i, b]`` * As list of lists: `...
keyword[def] identifier[get_bond_lengths] ( identifier[self] , identifier[indices] ): literal[string] identifier[coords] =[ literal[string] , literal[string] , literal[string] ] keyword[if] identifier[isinstance] ( identifier[indices] , identifier[pd] . identifier[DataFrame] ): ...
def get_bond_lengths(self, indices): """Return the distances between given atoms. Calculates the distance between the atoms with indices ``i`` and ``b``. The indices can be given in three ways: * As simple list ``[i, b]`` * As list of lists: ``[[i1, b1], [i2, b2]...]`` ...
def jpegrescan(ext_args): """Run the EXTERNAL program jpegrescan.""" args = copy.copy(_JPEGRESCAN_ARGS) if Settings.jpegrescan_multithread: args += ['-t'] if Settings.destroy_metadata: args += ['-s'] args += [ext_args.old_filename, ext_args.new_filename] extern.run_ext(args) ...
def function[jpegrescan, parameter[ext_args]]: constant[Run the EXTERNAL program jpegrescan.] variable[args] assign[=] call[name[copy].copy, parameter[name[_JPEGRESCAN_ARGS]]] if name[Settings].jpegrescan_multithread begin[:] <ast.AugAssign object at 0x7da18fe933a0> if name[Setti...
keyword[def] identifier[jpegrescan] ( identifier[ext_args] ): literal[string] identifier[args] = identifier[copy] . identifier[copy] ( identifier[_JPEGRESCAN_ARGS] ) keyword[if] identifier[Settings] . identifier[jpegrescan_multithread] : identifier[args] +=[ literal[string] ] keyword[if...
def jpegrescan(ext_args): """Run the EXTERNAL program jpegrescan.""" args = copy.copy(_JPEGRESCAN_ARGS) if Settings.jpegrescan_multithread: args += ['-t'] # depends on [control=['if'], data=[]] if Settings.destroy_metadata: args += ['-s'] # depends on [control=['if'], data=[]] args...
def w_diffuser_inner(sed_inputs=sed_dict): """Return the inner width of each diffuser in the sedimentation tank. Parameters ---------- sed_inputs : dict A dictionary of all of the constant inputs needed for sedimentation tank calculations can be found in sed.yaml Returns ------- ...
def function[w_diffuser_inner, parameter[sed_inputs]]: constant[Return the inner width of each diffuser in the sedimentation tank. Parameters ---------- sed_inputs : dict A dictionary of all of the constant inputs needed for sedimentation tank calculations can be found in sed.yaml ...
keyword[def] identifier[w_diffuser_inner] ( identifier[sed_inputs] = identifier[sed_dict] ): literal[string] keyword[return] identifier[ut] . identifier[ceil_nearest] ( identifier[w_diffuser_inner_min] ( identifier[sed_inputs] ). identifier[magnitude] , ( identifier[np] . identifier[arange] ( literal[...
def w_diffuser_inner(sed_inputs=sed_dict): """Return the inner width of each diffuser in the sedimentation tank. Parameters ---------- sed_inputs : dict A dictionary of all of the constant inputs needed for sedimentation tank calculations can be found in sed.yaml Returns ------- ...
def coerce_value(cls, v): """Coerce a value to the right type for the collection, or return it if it is already of the right type.""" if isinstance(v, cls.itemtype): return v else: try: return cls.coerceitem(v) except Exception as e: ...
def function[coerce_value, parameter[cls, v]]: constant[Coerce a value to the right type for the collection, or return it if it is already of the right type.] if call[name[isinstance], parameter[name[v], name[cls].itemtype]] begin[:] return[name[v]]
keyword[def] identifier[coerce_value] ( identifier[cls] , identifier[v] ): literal[string] keyword[if] identifier[isinstance] ( identifier[v] , identifier[cls] . identifier[itemtype] ): keyword[return] identifier[v] keyword[else] : keyword[try] : ...
def coerce_value(cls, v): """Coerce a value to the right type for the collection, or return it if it is already of the right type.""" if isinstance(v, cls.itemtype): return v # depends on [control=['if'], data=[]] else: try: return cls.coerceitem(v) # depends on [contro...
def ConvCnstrMODMaskDcpl(*args, **kwargs): """A wrapper function that dynamically defines a class derived from one of the implementations of the Convolutional Constrained MOD with Mask Decoupling problems, and returns an object instantiated with the provided. parameters. The wrapper is designed to allow...
def function[ConvCnstrMODMaskDcpl, parameter[]]: constant[A wrapper function that dynamically defines a class derived from one of the implementations of the Convolutional Constrained MOD with Mask Decoupling problems, and returns an object instantiated with the provided. parameters. The wrapper is d...
keyword[def] identifier[ConvCnstrMODMaskDcpl] (* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] literal[string] keyword[in] identifier[kwargs] : identifier[method] = identifier[kwargs] [ literal[string] ] keyword[del] identifier[kwargs] [ literal[string] ...
def ConvCnstrMODMaskDcpl(*args, **kwargs): """A wrapper function that dynamically defines a class derived from one of the implementations of the Convolutional Constrained MOD with Mask Decoupling problems, and returns an object instantiated with the provided. parameters. The wrapper is designed to allow...
def ntp_server_ip(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") ntp = ET.SubElement(config, "ntp", xmlns="urn:brocade.com:mgmt:brocade-ntp") server = ET.SubElement(ntp, "server") use_vrf_key = ET.SubElement(server, "use-vrf") use_vrf_ke...
def function[ntp_server_ip, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[ntp] assign[=] call[name[ET].SubElement, parameter[name[config], constant[ntp]]] variable[server] assign[=] call[na...
keyword[def] identifier[ntp_server_ip] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[ntp] = identifier[ET] . identifier[SubElement] ( identifier[config] , literal[string] , identifier[xm...
def ntp_server_ip(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') ntp = ET.SubElement(config, 'ntp', xmlns='urn:brocade.com:mgmt:brocade-ntp') server = ET.SubElement(ntp, 'server') use_vrf_key = ET.SubElement(server, 'use-vrf') use_vrf_key.text = kwargs.pop('use...
async def _do_ping(self): """ Ping the agents """ # the list() call here is needed, as we remove entries from _registered_agents! for agent_addr, friendly_name in list(self._registered_agents.items()): try: ping_count = self._ping_count.get(agent_addr, 0) ...
<ast.AsyncFunctionDef object at 0x7da207f98bb0>
keyword[async] keyword[def] identifier[_do_ping] ( identifier[self] ): literal[string] keyword[for] identifier[agent_addr] , identifier[friendly_name] keyword[in] identifier[list] ( identifier[self] . identifier[_registered_agents] . identifier[items] ()): keyword[try] : ...
async def _do_ping(self): """ Ping the agents """ # the list() call here is needed, as we remove entries from _registered_agents! for (agent_addr, friendly_name) in list(self._registered_agents.items()): try: ping_count = self._ping_count.get(agent_addr, 0) if ping_count > 5:...
def pad_trajectories(trajectories, boundary=20): """Pad trajectories to a bucket length that is a multiple of boundary. Args: trajectories: list[(observation, actions, rewards)], where each observation is shaped (t+1,) + OBS and actions & rewards are shaped (t,), with the length of the list being B...
def function[pad_trajectories, parameter[trajectories, boundary]]: constant[Pad trajectories to a bucket length that is a multiple of boundary. Args: trajectories: list[(observation, actions, rewards)], where each observation is shaped (t+1,) + OBS and actions & rewards are shaped (t,), with the ...
keyword[def] identifier[pad_trajectories] ( identifier[trajectories] , identifier[boundary] = literal[int] ): literal[string] identifier[t_max] = identifier[max] ( identifier[r] . identifier[shape] [ literal[int] ] keyword[for] ( identifier[_] , identifier[_] , identifier[r] ) keyword[in] identifier[traje...
def pad_trajectories(trajectories, boundary=20): """Pad trajectories to a bucket length that is a multiple of boundary. Args: trajectories: list[(observation, actions, rewards)], where each observation is shaped (t+1,) + OBS and actions & rewards are shaped (t,), with the length of the list being...
def retrieve_xml(pdb_id, silent = True): '''The RCSB website now compresses XML files.''' xml_gz = retrieve_file_from_RCSB(get_rcsb_files_connection(), "/download/%s.xml.gz" % pdb_id, silent = silent) cf = StringIO.StringIO() cf.write(xml_gz) cf.seek(0) df = gzip.GzipFile(fileobj = cf, mode='rb'...
def function[retrieve_xml, parameter[pdb_id, silent]]: constant[The RCSB website now compresses XML files.] variable[xml_gz] assign[=] call[name[retrieve_file_from_RCSB], parameter[call[name[get_rcsb_files_connection], parameter[]], binary_operation[constant[/download/%s.xml.gz] <ast.Mod object at 0x7da...
keyword[def] identifier[retrieve_xml] ( identifier[pdb_id] , identifier[silent] = keyword[True] ): literal[string] identifier[xml_gz] = identifier[retrieve_file_from_RCSB] ( identifier[get_rcsb_files_connection] (), literal[string] % identifier[pdb_id] , identifier[silent] = identifier[silent] ) ident...
def retrieve_xml(pdb_id, silent=True): """The RCSB website now compresses XML files.""" xml_gz = retrieve_file_from_RCSB(get_rcsb_files_connection(), '/download/%s.xml.gz' % pdb_id, silent=silent) cf = StringIO.StringIO() cf.write(xml_gz) cf.seek(0) df = gzip.GzipFile(fileobj=cf, mode='rb') ...
def delete(self, container_id=None, sudo=None): '''delete an instance based on container_id. Parameters ========== container_id: the container_id to delete sudo: whether to issue the command with sudo (or not) a container started with sudo will belong to the root user ...
def function[delete, parameter[self, container_id, sudo]]: constant[delete an instance based on container_id. Parameters ========== container_id: the container_id to delete sudo: whether to issue the command with sudo (or not) a container started with sudo will belong t...
keyword[def] identifier[delete] ( identifier[self] , identifier[container_id] = keyword[None] , identifier[sudo] = keyword[None] ): literal[string] identifier[sudo] = identifier[self] . identifier[_get_sudo] ( identifier[sudo] ) identifier[container_id] = identifier[self] . identifier[get_container_id...
def delete(self, container_id=None, sudo=None): """delete an instance based on container_id. Parameters ========== container_id: the container_id to delete sudo: whether to issue the command with sudo (or not) a container started with sudo will belong to the root user ...
def write_frame(self, buf): ''' Write the frame into an existing buffer. ''' writer = Writer(buf) writer.write_octet(self.type()) writer.write_short(self.channel_id) # Track the position where we're going to write the total length # of the frame arguments...
def function[write_frame, parameter[self, buf]]: constant[ Write the frame into an existing buffer. ] variable[writer] assign[=] call[name[Writer], parameter[name[buf]]] call[name[writer].write_octet, parameter[call[name[self].type, parameter[]]]] call[name[writer].write_...
keyword[def] identifier[write_frame] ( identifier[self] , identifier[buf] ): literal[string] identifier[writer] = identifier[Writer] ( identifier[buf] ) identifier[writer] . identifier[write_octet] ( identifier[self] . identifier[type] ()) identifier[writer] . identifier[write_sho...
def write_frame(self, buf): """ Write the frame into an existing buffer. """ writer = Writer(buf) writer.write_octet(self.type()) writer.write_short(self.channel_id) # Track the position where we're going to write the total length # of the frame arguments. stream_args_len_pos...
def p_while_sentence(p): """ statement : while_start co_statements_co label_end_while | while_start program_co label_end_while """ gl.LOOPS.pop() q = make_block(p[2], p[3]) if is_number(p[1]) and p[1].value: if q is None: warning(p[1].lineno, "Condition is alwa...
def function[p_while_sentence, parameter[p]]: constant[ statement : while_start co_statements_co label_end_while | while_start program_co label_end_while ] call[name[gl].LOOPS.pop, parameter[]] variable[q] assign[=] call[name[make_block], parameter[call[name[p]][constant[2]...
keyword[def] identifier[p_while_sentence] ( identifier[p] ): literal[string] identifier[gl] . identifier[LOOPS] . identifier[pop] () identifier[q] = identifier[make_block] ( identifier[p] [ literal[int] ], identifier[p] [ literal[int] ]) keyword[if] identifier[is_number] ( identifier[p] [ liter...
def p_while_sentence(p): """ statement : while_start co_statements_co label_end_while | while_start program_co label_end_while """ gl.LOOPS.pop() q = make_block(p[2], p[3]) if is_number(p[1]) and p[1].value: if q is None: warning(p[1].lineno, 'Condition is alway...
def _analyze(self): """ The main analysis routine. :return: None """ self._pre_analysis() if self._graph_visitor is None: # There is no base graph that we can rely on. The analysis itself should generate successors for the # current job. ...
def function[_analyze, parameter[self]]: constant[ The main analysis routine. :return: None ] call[name[self]._pre_analysis, parameter[]] if compare[name[self]._graph_visitor is constant[None]] begin[:] call[name[self]._analysis_core_baremetal, parameter[...
keyword[def] identifier[_analyze] ( identifier[self] ): literal[string] identifier[self] . identifier[_pre_analysis] () keyword[if] identifier[self] . identifier[_graph_visitor] keyword[is] keyword[None] : identifier[self] . identifier[_analysi...
def _analyze(self): """ The main analysis routine. :return: None """ self._pre_analysis() if self._graph_visitor is None: # There is no base graph that we can rely on. The analysis itself should generate successors for the # current job. # An example is the C...
def format_cert_name(env='', account='', region='', certificate=None): """Format the SSL certificate name into ARN for ELB. Args: env (str): Account environment name account (str): Account number for ARN region (str): AWS Region. certificate (str): Name of SSL certificate R...
def function[format_cert_name, parameter[env, account, region, certificate]]: constant[Format the SSL certificate name into ARN for ELB. Args: env (str): Account environment name account (str): Account number for ARN region (str): AWS Region. certificate (str): Name of SSL c...
keyword[def] identifier[format_cert_name] ( identifier[env] = literal[string] , identifier[account] = literal[string] , identifier[region] = literal[string] , identifier[certificate] = keyword[None] ): literal[string] identifier[cert_name] = keyword[None] keyword[if] identifier[certificate] : ...
def format_cert_name(env='', account='', region='', certificate=None): """Format the SSL certificate name into ARN for ELB. Args: env (str): Account environment name account (str): Account number for ARN region (str): AWS Region. certificate (str): Name of SSL certificate R...
def set_up(self): """ This class overrides this method """ self.menu.pause() curses.def_prog_mode() self.menu.clear_screen()
def function[set_up, parameter[self]]: constant[ This class overrides this method ] call[name[self].menu.pause, parameter[]] call[name[curses].def_prog_mode, parameter[]] call[name[self].menu.clear_screen, parameter[]]
keyword[def] identifier[set_up] ( identifier[self] ): literal[string] identifier[self] . identifier[menu] . identifier[pause] () identifier[curses] . identifier[def_prog_mode] () identifier[self] . identifier[menu] . identifier[clear_screen] ()
def set_up(self): """ This class overrides this method """ self.menu.pause() curses.def_prog_mode() self.menu.clear_screen()
def get_tables_for_bind(self, bind=None): """Returns a list of all tables relevant for a bind.""" result = [] for table in itervalues(self.Model.metadata.tables): if table.info.get('bind_key') == bind: result.append(table) return result
def function[get_tables_for_bind, parameter[self, bind]]: constant[Returns a list of all tables relevant for a bind.] variable[result] assign[=] list[[]] for taget[name[table]] in starred[call[name[itervalues], parameter[name[self].Model.metadata.tables]]] begin[:] if compare[cal...
keyword[def] identifier[get_tables_for_bind] ( identifier[self] , identifier[bind] = keyword[None] ): literal[string] identifier[result] =[] keyword[for] identifier[table] keyword[in] identifier[itervalues] ( identifier[self] . identifier[Model] . identifier[metadata] . identifier[table...
def get_tables_for_bind(self, bind=None): """Returns a list of all tables relevant for a bind.""" result = [] for table in itervalues(self.Model.metadata.tables): if table.info.get('bind_key') == bind: result.append(table) # depends on [control=['if'], data=[]] # depends on [control=['...
def filter_out_spontaneous_genes(genes, custom_spont_id=None): """Return the DictList of genes that are not spontaneous in a model. Args: genes (DictList): Genes DictList custom_spont_id (str): Optional custom spontaneous ID if it does not match the regular expression ``[Ss](_|)0001`` Retu...
def function[filter_out_spontaneous_genes, parameter[genes, custom_spont_id]]: constant[Return the DictList of genes that are not spontaneous in a model. Args: genes (DictList): Genes DictList custom_spont_id (str): Optional custom spontaneous ID if it does not match the regular expression ...
keyword[def] identifier[filter_out_spontaneous_genes] ( identifier[genes] , identifier[custom_spont_id] = keyword[None] ): literal[string] identifier[new_genes] = identifier[DictList] () keyword[for] identifier[gene] keyword[in] identifier[genes] : keyword[if] keyword[not] identifier[is_...
def filter_out_spontaneous_genes(genes, custom_spont_id=None): """Return the DictList of genes that are not spontaneous in a model. Args: genes (DictList): Genes DictList custom_spont_id (str): Optional custom spontaneous ID if it does not match the regular expression ``[Ss](_|)0001`` Retu...
def read_file(path): """Read the file from the given path. If ``path`` is an absolute path, reads a file from the local filesystem. For relative paths, read the file using the storage backend configured using :ref:`CA_FILE_STORAGE <settings-ca-file-storage>`. """ if os.path.isabs(path): wit...
def function[read_file, parameter[path]]: constant[Read the file from the given path. If ``path`` is an absolute path, reads a file from the local filesystem. For relative paths, read the file using the storage backend configured using :ref:`CA_FILE_STORAGE <settings-ca-file-storage>`. ] if...
keyword[def] identifier[read_file] ( identifier[path] ): literal[string] keyword[if] identifier[os] . identifier[path] . identifier[isabs] ( identifier[path] ): keyword[with] identifier[wrap_file_exceptions] (): keyword[with] identifier[open] ( identifier[path] , literal[string] ) ...
def read_file(path): """Read the file from the given path. If ``path`` is an absolute path, reads a file from the local filesystem. For relative paths, read the file using the storage backend configured using :ref:`CA_FILE_STORAGE <settings-ca-file-storage>`. """ if os.path.isabs(path): wit...
def edit(self, image_id, name=None, note=None, tag=None): """Edit image related details. :param int image_id: The ID of the image :param string name: Name of the Image. :param string note: Note of the image. :param string tag: Tags of the image to be updated to. """ ...
def function[edit, parameter[self, image_id, name, note, tag]]: constant[Edit image related details. :param int image_id: The ID of the image :param string name: Name of the Image. :param string note: Note of the image. :param string tag: Tags of the image to be updated to. ...
keyword[def] identifier[edit] ( identifier[self] , identifier[image_id] , identifier[name] = keyword[None] , identifier[note] = keyword[None] , identifier[tag] = keyword[None] ): literal[string] identifier[obj] ={} keyword[if] identifier[name] : identifier[obj] [ literal[stri...
def edit(self, image_id, name=None, note=None, tag=None): """Edit image related details. :param int image_id: The ID of the image :param string name: Name of the Image. :param string note: Note of the image. :param string tag: Tags of the image to be updated to. """ obj ...
def create_box_comments(self, box_key, message, **kwargs): '''Creates a comments in a box with the provided attributes. Args: box_key key for box message message string kwargs {} see StreakComment object for more information return (status code, comment dict) ''' uri = '/'.join([ self....
def function[create_box_comments, parameter[self, box_key, message]]: constant[Creates a comments in a box with the provided attributes. Args: box_key key for box message message string kwargs {} see StreakComment object for more information return (status code, comment dict) ] v...
keyword[def] identifier[create_box_comments] ( identifier[self] , identifier[box_key] , identifier[message] ,** identifier[kwargs] ): literal[string] identifier[uri] = literal[string] . identifier[join] ([ identifier[self] . identifier[api_uri] , identifier[self] . identifier[boxes_suffix] , identifie...
def create_box_comments(self, box_key, message, **kwargs): """Creates a comments in a box with the provided attributes. Args: box_key key for box message message string kwargs {} see StreakComment object for more information return (status code, comment dict) """ uri = '/'.join([self.api...
def listen_forever( self, timeout_ms: int = 30000, exception_handler: Callable[[Exception], None] = None, bad_sync_timeout: int = 5, ): """ Keep listening for events forever. Args: timeout_ms: How long to poll the Home Server for be...
def function[listen_forever, parameter[self, timeout_ms, exception_handler, bad_sync_timeout]]: constant[ Keep listening for events forever. Args: timeout_ms: How long to poll the Home Server for before retrying. exception_handler: Optional exception handler function whic...
keyword[def] identifier[listen_forever] ( identifier[self] , identifier[timeout_ms] : identifier[int] = literal[int] , identifier[exception_handler] : identifier[Callable] [[ identifier[Exception] ], keyword[None] ]= keyword[None] , identifier[bad_sync_timeout] : identifier[int] = literal[int] , ): liter...
def listen_forever(self, timeout_ms: int=30000, exception_handler: Callable[[Exception], None]=None, bad_sync_timeout: int=5): """ Keep listening for events forever. Args: timeout_ms: How long to poll the Home Server for before retrying. exception_handler: Optional exception ...
def url_regex_generator(*, relative: bool, require_tld: bool) -> Pattern[str]: """ Url regex generator taken from Marshmallow library, for details please follow library source code: https://github.com/marshmallow-code/marshmallow/blob/298870ef6c089fb4d91efae9ca4168453ffe00d2/marshmallow/validate.py#...
def function[url_regex_generator, parameter[]]: constant[ Url regex generator taken from Marshmallow library, for details please follow library source code: https://github.com/marshmallow-code/marshmallow/blob/298870ef6c089fb4d91efae9ca4168453ffe00d2/marshmallow/validate.py#L37 ] return[...
keyword[def] identifier[url_regex_generator] (*, identifier[relative] : identifier[bool] , identifier[require_tld] : identifier[bool] )-> identifier[Pattern] [ identifier[str] ]: literal[string] keyword[return] identifier[re] . identifier[compile] ( literal[string] . identifier[join] ( ( lit...
def url_regex_generator(*, relative: bool, require_tld: bool) -> Pattern[str]: """ Url regex generator taken from Marshmallow library, for details please follow library source code: https://github.com/marshmallow-code/marshmallow/blob/298870ef6c089fb4d91efae9ca4168453ffe00d2/marshmallow/validate.py#...
def cnst_A(self, X): r"""Compute :math:`A \mathbf{x}` component of ADMM problem constraint. """ return self.block_cat(self.cnst_A0(X), self.cnst_A1(X))
def function[cnst_A, parameter[self, X]]: constant[Compute :math:`A \mathbf{x}` component of ADMM problem constraint. ] return[call[name[self].block_cat, parameter[call[name[self].cnst_A0, parameter[name[X]]], call[name[self].cnst_A1, parameter[name[X]]]]]]
keyword[def] identifier[cnst_A] ( identifier[self] , identifier[X] ): literal[string] keyword[return] identifier[self] . identifier[block_cat] ( identifier[self] . identifier[cnst_A0] ( identifier[X] ), identifier[self] . identifier[cnst_A1] ( identifier[X] ))
def cnst_A(self, X): """Compute :math:`A \\mathbf{x}` component of ADMM problem constraint. """ return self.block_cat(self.cnst_A0(X), self.cnst_A1(X))
def _parse_proto(prototxt_fname): """Parse Caffe prototxt into symbol string """ proto = caffe_parser.read_prototxt(prototxt_fname) # process data layer input_name, input_dim, layers = _get_input(proto) # only support single input, so always use `data` as the input data mapping = {input_nam...
def function[_parse_proto, parameter[prototxt_fname]]: constant[Parse Caffe prototxt into symbol string ] variable[proto] assign[=] call[name[caffe_parser].read_prototxt, parameter[name[prototxt_fname]]] <ast.Tuple object at 0x7da1b1e74640> assign[=] call[name[_get_input], parameter[name[pro...
keyword[def] identifier[_parse_proto] ( identifier[prototxt_fname] ): literal[string] identifier[proto] = identifier[caffe_parser] . identifier[read_prototxt] ( identifier[prototxt_fname] ) identifier[input_name] , identifier[input_dim] , identifier[layers] = identifier[_get_input] ( identifier[...
def _parse_proto(prototxt_fname): """Parse Caffe prototxt into symbol string """ proto = caffe_parser.read_prototxt(prototxt_fname) # process data layer (input_name, input_dim, layers) = _get_input(proto) # only support single input, so always use `data` as the input data mapping = {input_na...
def _compute_stress_drop_adjustment(self, SC, mag, scale_fac): """ Compute equation (6) p. 2200 """ return scale_fac * np.minimum( SC['delta'] + 0.05, 0.05 + SC['delta'] * ( np.maximum(mag - SC['M1'], 0) / (SC['Mh'] - SC['M1']) ) ...
def function[_compute_stress_drop_adjustment, parameter[self, SC, mag, scale_fac]]: constant[ Compute equation (6) p. 2200 ] return[binary_operation[name[scale_fac] * call[name[np].minimum, parameter[binary_operation[call[name[SC]][constant[delta]] + constant[0.05]], binary_operation[constan...
keyword[def] identifier[_compute_stress_drop_adjustment] ( identifier[self] , identifier[SC] , identifier[mag] , identifier[scale_fac] ): literal[string] keyword[return] identifier[scale_fac] * identifier[np] . identifier[minimum] ( identifier[SC] [ literal[string] ]+ literal[int] , ...
def _compute_stress_drop_adjustment(self, SC, mag, scale_fac): """ Compute equation (6) p. 2200 """ return scale_fac * np.minimum(SC['delta'] + 0.05, 0.05 + SC['delta'] * (np.maximum(mag - SC['M1'], 0) / (SC['Mh'] - SC['M1'])))
def get_template_object(template_file=''): """Retrieve template. Args: template_file (str): Name of template file. Returns: jinja2.Template: Template ready to render. Raises: AssertionError: Configured path for templates does not exist. :obj:`foremast.exceptions.Forema...
def function[get_template_object, parameter[template_file]]: constant[Retrieve template. Args: template_file (str): Name of template file. Returns: jinja2.Template: Template ready to render. Raises: AssertionError: Configured path for templates does not exist. :obj...
keyword[def] identifier[get_template_object] ( identifier[template_file] = literal[string] ): literal[string] identifier[jinja_template_paths_obj] =[] keyword[if] identifier[TEMPLATES_PATH] : identifier[external_templates] = identifier[pathlib] . identifier[Path] ( identifier[TEMPLATES_PATH...
def get_template_object(template_file=''): """Retrieve template. Args: template_file (str): Name of template file. Returns: jinja2.Template: Template ready to render. Raises: AssertionError: Configured path for templates does not exist. :obj:`foremast.exceptions.Forema...
def _decode_buffer(f): """ String types are normal (byte)strings starting with an integer followed by ':' which designates the string’s length. Since there’s no way to specify the byte type in bencoded files, we have to guess """ strlen = int(_readuntil(f, _TYPE_SEP)) buf = f.read(strlen) if not len(buf) ==...
def function[_decode_buffer, parameter[f]]: constant[ String types are normal (byte)strings starting with an integer followed by ':' which designates the string’s length. Since there’s no way to specify the byte type in bencoded files, we have to guess ] variable[strlen] assign[=] call[name[int]...
keyword[def] identifier[_decode_buffer] ( identifier[f] ): literal[string] identifier[strlen] = identifier[int] ( identifier[_readuntil] ( identifier[f] , identifier[_TYPE_SEP] )) identifier[buf] = identifier[f] . identifier[read] ( identifier[strlen] ) keyword[if] keyword[not] identifier[len] ( identifier...
def _decode_buffer(f): """ String types are normal (byte)strings starting with an integer followed by ':' which designates the string’s length. Since there’s no way to specify the byte type in bencoded files, we have to guess """ strlen = int(_readuntil(f, _TYPE_SEP)) buf = f.read(strlen) if not...
def compress_repr(self) -> Optional[str]: """Try to find a compressed parameter value representation and return it. |Parameter.compress_repr| raises a |NotImplementedError| when failing to find a compressed representation. .. testsetup:: >>> from hydpy import pub ...
def function[compress_repr, parameter[self]]: constant[Try to find a compressed parameter value representation and return it. |Parameter.compress_repr| raises a |NotImplementedError| when failing to find a compressed representation. .. testsetup:: >>> from hydpy im...
keyword[def] identifier[compress_repr] ( identifier[self] )-> identifier[Optional] [ identifier[str] ]: literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[self] , literal[string] ): keyword[return] literal[string] keyword[if] keyword[not] identifie...
def compress_repr(self) -> Optional[str]: """Try to find a compressed parameter value representation and return it. |Parameter.compress_repr| raises a |NotImplementedError| when failing to find a compressed representation. .. testsetup:: >>> from hydpy import pub ...
def create(self, file_or_path, **kwargs): """ Creates an upload for the given file or path. """ opened = False if isinstance(file_or_path, str_type()): file_or_path = open(file_or_path, 'rb') opened = True elif not getattr(file_or_path, 'read', Fa...
def function[create, parameter[self, file_or_path]]: constant[ Creates an upload for the given file or path. ] variable[opened] assign[=] constant[False] if call[name[isinstance], parameter[name[file_or_path], call[name[str_type], parameter[]]]] begin[:] variable[...
keyword[def] identifier[create] ( identifier[self] , identifier[file_or_path] ,** identifier[kwargs] ): literal[string] identifier[opened] = keyword[False] keyword[if] identifier[isinstance] ( identifier[file_or_path] , identifier[str_type] ()): identifier[file_or_path] = i...
def create(self, file_or_path, **kwargs): """ Creates an upload for the given file or path. """ opened = False if isinstance(file_or_path, str_type()): file_or_path = open(file_or_path, 'rb') opened = True # depends on [control=['if'], data=[]] elif not getattr(file_or_p...
def predict_log_proba(self, X): """ Return log-probability estimates for the test vector X. Parameters ---------- X : array-like, shape = [n_samples, n_features] Returns ------- C : array-like, shape = [n_samples, n_classes] Returns the log-p...
def function[predict_log_proba, parameter[self, X]]: constant[ Return log-probability estimates for the test vector X. Parameters ---------- X : array-like, shape = [n_samples, n_features] Returns ------- C : array-like, shape = [n_samples, n_classes] ...
keyword[def] identifier[predict_log_proba] ( identifier[self] , identifier[X] ): literal[string] identifier[jll] = identifier[self] . identifier[_joint_log_likelihood] ( identifier[X] ) identifier[log_prob_x] = identifier[logsumexp] ( identifier[jll] , identifier[axis] = literal[...
def predict_log_proba(self, X): """ Return log-probability estimates for the test vector X. Parameters ---------- X : array-like, shape = [n_samples, n_features] Returns ------- C : array-like, shape = [n_samples, n_classes] Returns the log-proba...
def cudnnActivationBackward(handle, mode, alpha, srcDesc, srcData, srcDiffDesc, srcDiffData, destDesc, destData, beta, destDiffDesc, destDiffData): """" Gradient of activation function. This routine computes the gradient of a neuron activation function. In-place operation i...
def function[cudnnActivationBackward, parameter[handle, mode, alpha, srcDesc, srcData, srcDiffDesc, srcDiffData, destDesc, destData, beta, destDiffDesc, destDiffData]]: constant[" Gradient of activation function. This routine computes the gradient of a neuron activation function. In-place operatio...
keyword[def] identifier[cudnnActivationBackward] ( identifier[handle] , identifier[mode] , identifier[alpha] , identifier[srcDesc] , identifier[srcData] , identifier[srcDiffDesc] , identifier[srcDiffData] , identifier[destDesc] , identifier[destData] , identifier[beta] , identifier[destDiffDesc] , identifier[destDif...
def cudnnActivationBackward(handle, mode, alpha, srcDesc, srcData, srcDiffDesc, srcDiffData, destDesc, destData, beta, destDiffDesc, destDiffData): """" Gradient of activation function. This routine computes the gradient of a neuron activation function. In-place operation is allowed for this routine; ...
def Cplm(self): r'''Liquid-phase heat capacity of the mixture at its current temperature and composition, in units of [J/mol/K]. For calculation of this property at other temperatures or compositions, or specifying manually the method used to calculate it, and more - see the object ...
def function[Cplm, parameter[self]]: constant[Liquid-phase heat capacity of the mixture at its current temperature and composition, in units of [J/mol/K]. For calculation of this property at other temperatures or compositions, or specifying manually the method used to calculate it, and m...
keyword[def] identifier[Cplm] ( identifier[self] ): literal[string] keyword[return] identifier[self] . identifier[HeatCapacityLiquidMixture] ( identifier[self] . identifier[T] , identifier[self] . identifier[P] , identifier[self] . identifier[zs] , identifier[self] . identifier[ws] )
def Cplm(self): """Liquid-phase heat capacity of the mixture at its current temperature and composition, in units of [J/mol/K]. For calculation of this property at other temperatures or compositions, or specifying manually the method used to calculate it, and more - see the object or...
def is_break_tag(self, el): """Check if tag is an element we should break on.""" name = el.name return name in self.break_tags or name in self.user_break_tags
def function[is_break_tag, parameter[self, el]]: constant[Check if tag is an element we should break on.] variable[name] assign[=] name[el].name return[<ast.BoolOp object at 0x7da18f8107f0>]
keyword[def] identifier[is_break_tag] ( identifier[self] , identifier[el] ): literal[string] identifier[name] = identifier[el] . identifier[name] keyword[return] identifier[name] keyword[in] identifier[self] . identifier[break_tags] keyword[or] identifier[name] keyword[in] identif...
def is_break_tag(self, el): """Check if tag is an element we should break on.""" name = el.name return name in self.break_tags or name in self.user_break_tags
def _check_endings(self): """Check begin/end of slug, raises Error if malformed.""" if self.slug.startswith("/") and self.slug.endswith("/"): raise InvalidSlugError( _("Invalid slug. Did you mean {}, without the leading and trailing slashes?".format(self.slug.strip("/")))) ...
def function[_check_endings, parameter[self]]: constant[Check begin/end of slug, raises Error if malformed.] if <ast.BoolOp object at 0x7da18ede6710> begin[:] <ast.Raise object at 0x7da18ede50f0>
keyword[def] identifier[_check_endings] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[slug] . identifier[startswith] ( literal[string] ) keyword[and] identifier[self] . identifier[slug] . identifier[endswith] ( literal[string] ): keyword[raise] iden...
def _check_endings(self): """Check begin/end of slug, raises Error if malformed.""" if self.slug.startswith('/') and self.slug.endswith('/'): raise InvalidSlugError(_('Invalid slug. Did you mean {}, without the leading and trailing slashes?'.format(self.slug.strip('/')))) # depends on [control=['if'], ...
def mass_3d(self, R, Rs, rho0, r_core): """ mass enclosed a 3d sphere or radius r :param r: :param Ra: :param Rs: :return: """ b = r_core * Rs ** -1 x = R * Rs ** -1 M_0 = 4 * np.pi * Rs**3 * rho0 return M_0 * (x * (1+x) ** -1 * ...
def function[mass_3d, parameter[self, R, Rs, rho0, r_core]]: constant[ mass enclosed a 3d sphere or radius r :param r: :param Ra: :param Rs: :return: ] variable[b] assign[=] binary_operation[name[r_core] * binary_operation[name[Rs] ** <ast.UnaryOp object ...
keyword[def] identifier[mass_3d] ( identifier[self] , identifier[R] , identifier[Rs] , identifier[rho0] , identifier[r_core] ): literal[string] identifier[b] = identifier[r_core] * identifier[Rs] **- literal[int] identifier[x] = identifier[R] * identifier[Rs] **- literal[int] i...
def mass_3d(self, R, Rs, rho0, r_core): """ mass enclosed a 3d sphere or radius r :param r: :param Ra: :param Rs: :return: """ b = r_core * Rs ** (-1) x = R * Rs ** (-1) M_0 = 4 * np.pi * Rs ** 3 * rho0 return M_0 * (x * (1 + x) ** (-1) * (-1 + b) ** ...
def dfs_preorder(self, reverse=False): """Generator that returns each element of the tree in Preorder order. Keyword arguments: reverse -- if true, the search is done from right to left.""" stack = deque() stack.append(self) while stack: node = stack.pop() ...
def function[dfs_preorder, parameter[self, reverse]]: constant[Generator that returns each element of the tree in Preorder order. Keyword arguments: reverse -- if true, the search is done from right to left.] variable[stack] assign[=] call[name[deque], parameter[]] call[name[stac...
keyword[def] identifier[dfs_preorder] ( identifier[self] , identifier[reverse] = keyword[False] ): literal[string] identifier[stack] = identifier[deque] () identifier[stack] . identifier[append] ( identifier[self] ) keyword[while] identifier[stack] : identifier[node]...
def dfs_preorder(self, reverse=False): """Generator that returns each element of the tree in Preorder order. Keyword arguments: reverse -- if true, the search is done from right to left.""" stack = deque() stack.append(self) while stack: node = stack.pop() yield node ...
def get(self, request, *args, **kwargs): """ Do the login and password protection. """ response = super(EntryProtectionMixin, self).get( request, *args, **kwargs) if self.object.login_required and not request.user.is_authenticated: return self.login() ...
def function[get, parameter[self, request]]: constant[ Do the login and password protection. ] variable[response] assign[=] call[call[name[super], parameter[name[EntryProtectionMixin], name[self]]].get, parameter[name[request], <ast.Starred object at 0x7da18fe93430>]] if <ast.Boo...
keyword[def] identifier[get] ( identifier[self] , identifier[request] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[response] = identifier[super] ( identifier[EntryProtectionMixin] , identifier[self] ). identifier[get] ( identifier[request] ,* identifier[args] ,*...
def get(self, request, *args, **kwargs): """ Do the login and password protection. """ response = super(EntryProtectionMixin, self).get(request, *args, **kwargs) if self.object.login_required and (not request.user.is_authenticated): return self.login() # depends on [control=['if'], ...
def memoize(func): """ Decorator to cause a function to cache it's results for each combination of inputs and return the cached result on subsequent calls. Does not support named arguments or arg values that are not hashable. >>> @memoize ... def foo(x): ... print('running function wit...
def function[memoize, parameter[func]]: constant[ Decorator to cause a function to cache it's results for each combination of inputs and return the cached result on subsequent calls. Does not support named arguments or arg values that are not hashable. >>> @memoize ... def foo(x): ... ...
keyword[def] identifier[memoize] ( identifier[func] ): literal[string] identifier[func] . identifier[_result_cache] ={} @ identifier[wraps] ( identifier[func] ) keyword[def] identifier[_memoized_func] (* identifier[args] ,** identifier[kwargs] ): identifier[key] =( identifier[args] , id...
def memoize(func): """ Decorator to cause a function to cache it's results for each combination of inputs and return the cached result on subsequent calls. Does not support named arguments or arg values that are not hashable. >>> @memoize ... def foo(x): ... print('running function wit...
def create_network_interface(SubnetId=None, Description=None, PrivateIpAddress=None, Groups=None, PrivateIpAddresses=None, SecondaryPrivateIpAddressCount=None, Ipv6Addresses=None, Ipv6AddressCount=None, DryRun=None): """ Creates a network interface in the specified subnet. For more information about network...
def function[create_network_interface, parameter[SubnetId, Description, PrivateIpAddress, Groups, PrivateIpAddresses, SecondaryPrivateIpAddressCount, Ipv6Addresses, Ipv6AddressCount, DryRun]]: constant[ Creates a network interface in the specified subnet. For more information about network interfaces, s...
keyword[def] identifier[create_network_interface] ( identifier[SubnetId] = keyword[None] , identifier[Description] = keyword[None] , identifier[PrivateIpAddress] = keyword[None] , identifier[Groups] = keyword[None] , identifier[PrivateIpAddresses] = keyword[None] , identifier[SecondaryPrivateIpAddressCount] = keyword...
def create_network_interface(SubnetId=None, Description=None, PrivateIpAddress=None, Groups=None, PrivateIpAddresses=None, SecondaryPrivateIpAddressCount=None, Ipv6Addresses=None, Ipv6AddressCount=None, DryRun=None): """ Creates a network interface in the specified subnet. For more information about network...
def create(self, name, nopassword=None, secret=None, encryption=None): """Creates a new user on the local system. Creating users requires either a secret (password) or the nopassword keyword to be specified. Args: name (str): The name of the user to craete nopa...
def function[create, parameter[self, name, nopassword, secret, encryption]]: constant[Creates a new user on the local system. Creating users requires either a secret (password) or the nopassword keyword to be specified. Args: name (str): The name of the user to craete ...
keyword[def] identifier[create] ( identifier[self] , identifier[name] , identifier[nopassword] = keyword[None] , identifier[secret] = keyword[None] , identifier[encryption] = keyword[None] ): literal[string] keyword[if] identifier[secret] keyword[is] keyword[not] keyword[None] : ke...
def create(self, name, nopassword=None, secret=None, encryption=None): """Creates a new user on the local system. Creating users requires either a secret (password) or the nopassword keyword to be specified. Args: name (str): The name of the user to craete nopasswo...
def cuda_architecture_flags(device_info): """ Emit a list of architecture flags for each CUDA device found ['--gpu-architecture=sm_30', '--gpu-architecture=sm_52'] """ # Figure out the necessary device architectures if len(device_info['devices']) == 0: archs = ['--gpu-architecture=sm_30'...
def function[cuda_architecture_flags, parameter[device_info]]: constant[ Emit a list of architecture flags for each CUDA device found ['--gpu-architecture=sm_30', '--gpu-architecture=sm_52'] ] if compare[call[name[len], parameter[call[name[device_info]][constant[devices]]]] equal[==] constan...
keyword[def] identifier[cuda_architecture_flags] ( identifier[device_info] ): literal[string] keyword[if] identifier[len] ( identifier[device_info] [ literal[string] ])== literal[int] : identifier[archs] =[ literal[string] ] identifier[log] . identifier[info] ( literal[string] . ide...
def cuda_architecture_flags(device_info): """ Emit a list of architecture flags for each CUDA device found ['--gpu-architecture=sm_30', '--gpu-architecture=sm_52'] """ # Figure out the necessary device architectures if len(device_info['devices']) == 0: archs = ['--gpu-architecture=sm_30'...
def _parse_authors(authors): """ Parse informations about authors of the book. Args: dom (obj): HTMLElement containing slice of the page with details. Returns: list: List of :class:`.Author` objects. Blank if no author \ found. """ link = authors.find("a") lin...
def function[_parse_authors, parameter[authors]]: constant[ Parse informations about authors of the book. Args: dom (obj): HTMLElement containing slice of the page with details. Returns: list: List of :class:`.Author` objects. Blank if no author found. ] v...
keyword[def] identifier[_parse_authors] ( identifier[authors] ): literal[string] identifier[link] = identifier[authors] . identifier[find] ( literal[string] ) identifier[link] = identifier[link] [ literal[int] ]. identifier[params] . identifier[get] ( literal[string] ) keyword[if] identifier[link] k...
def _parse_authors(authors): """ Parse informations about authors of the book. Args: dom (obj): HTMLElement containing slice of the page with details. Returns: list: List of :class:`.Author` objects. Blank if no author found. """ link = authors.find('a') link ...
def get(self, r): """ Returns precomputed value of the given expression """ if r is None: return None if r.lower() == '(sp)' and self.stack: return self.stack[-1] if r[:1] == '(': return self.mem[r[1:-1]] r = r.lower() if is_...
def function[get, parameter[self, r]]: constant[ Returns precomputed value of the given expression ] if compare[name[r] is constant[None]] begin[:] return[constant[None]] if <ast.BoolOp object at 0x7da1b069c880> begin[:] return[call[name[self].stack][<ast.UnaryOp object a...
keyword[def] identifier[get] ( identifier[self] , identifier[r] ): literal[string] keyword[if] identifier[r] keyword[is] keyword[None] : keyword[return] keyword[None] keyword[if] identifier[r] . identifier[lower] ()== literal[string] keyword[and] identifier[self] . id...
def get(self, r): """ Returns precomputed value of the given expression """ if r is None: return None # depends on [control=['if'], data=[]] if r.lower() == '(sp)' and self.stack: return self.stack[-1] # depends on [control=['if'], data=[]] if r[:1] == '(': return self....
def graphql_to_sql(schema, graphql_query, parameters, compiler_metadata, type_equivalence_hints=None): """Compile the GraphQL input using the schema into a SQL query and associated metadata. Args: schema: GraphQL schema object describing the schema of the graph to be queried ...
def function[graphql_to_sql, parameter[schema, graphql_query, parameters, compiler_metadata, type_equivalence_hints]]: constant[Compile the GraphQL input using the schema into a SQL query and associated metadata. Args: schema: GraphQL schema object describing the schema of the graph to be queried ...
keyword[def] identifier[graphql_to_sql] ( identifier[schema] , identifier[graphql_query] , identifier[parameters] , identifier[compiler_metadata] , identifier[type_equivalence_hints] = keyword[None] ): literal[string] identifier[compilation_result] = identifier[compile_graphql_to_sql] ( identifier[sc...
def graphql_to_sql(schema, graphql_query, parameters, compiler_metadata, type_equivalence_hints=None): """Compile the GraphQL input using the schema into a SQL query and associated metadata. Args: schema: GraphQL schema object describing the schema of the graph to be queried graphql_query: the ...
def sync_camera_gyro(image_sequence_or_flow, image_timestamps, gyro_data, gyro_timestamps, levels=6, full_output=False): """Get time offset that aligns image timestamps with gyro timestamps. Given an image sequence, and gyroscope data, with their respective timestamps, calculate the offset that aligns ...
def function[sync_camera_gyro, parameter[image_sequence_or_flow, image_timestamps, gyro_data, gyro_timestamps, levels, full_output]]: constant[Get time offset that aligns image timestamps with gyro timestamps. Given an image sequence, and gyroscope data, with their respective timestamps, calculate ...
keyword[def] identifier[sync_camera_gyro] ( identifier[image_sequence_or_flow] , identifier[image_timestamps] , identifier[gyro_data] , identifier[gyro_timestamps] , identifier[levels] = literal[int] , identifier[full_output] = keyword[False] ): literal[string] keyword[try] : keyword[assert]...
def sync_camera_gyro(image_sequence_or_flow, image_timestamps, gyro_data, gyro_timestamps, levels=6, full_output=False): """Get time offset that aligns image timestamps with gyro timestamps. Given an image sequence, and gyroscope data, with their respective timestamps, calculate the offset that aligns ...
def parse_int(str_num): """ Given an integer number, return its value, or None if it could not be parsed. Allowed formats: DECIMAL, HEXA (0xnnn, $nnnn or nnnnh) :param str_num: (string) the number to be parsed :return: an integer number or None if it could not be parsedd """ str_num = (str_n...
def function[parse_int, parameter[str_num]]: constant[ Given an integer number, return its value, or None if it could not be parsed. Allowed formats: DECIMAL, HEXA (0xnnn, $nnnn or nnnnh) :param str_num: (string) the number to be parsed :return: an integer number or None if it could not be parse...
keyword[def] identifier[parse_int] ( identifier[str_num] ): literal[string] identifier[str_num] =( identifier[str_num] keyword[or] literal[string] ). identifier[strip] (). identifier[upper] () keyword[if] keyword[not] identifier[str_num] : keyword[return] keyword[None] identifier[...
def parse_int(str_num): """ Given an integer number, return its value, or None if it could not be parsed. Allowed formats: DECIMAL, HEXA (0xnnn, $nnnn or nnnnh) :param str_num: (string) the number to be parsed :return: an integer number or None if it could not be parsedd """ str_num = (str_n...
def in_project_directory() -> bool: """ Returns whether or not the current working directory is a Cauldron project directory, which contains a cauldron.json file. """ current_directory = os.path.realpath(os.curdir) project_path = os.path.join(current_directory, 'cauldron.json') return os.pat...
def function[in_project_directory, parameter[]]: constant[ Returns whether or not the current working directory is a Cauldron project directory, which contains a cauldron.json file. ] variable[current_directory] assign[=] call[name[os].path.realpath, parameter[name[os].curdir]] varia...
keyword[def] identifier[in_project_directory] ()-> identifier[bool] : literal[string] identifier[current_directory] = identifier[os] . identifier[path] . identifier[realpath] ( identifier[os] . identifier[curdir] ) identifier[project_path] = identifier[os] . identifier[path] . identifier[join] ( ident...
def in_project_directory() -> bool: """ Returns whether or not the current working directory is a Cauldron project directory, which contains a cauldron.json file. """ current_directory = os.path.realpath(os.curdir) project_path = os.path.join(current_directory, 'cauldron.json') return os.pat...
def events(self): ''' A generator that will return all ansible job events in the order that they were emitted from Ansible Example: { "event":"runner_on_ok", "uuid":"00a50d9c-161a-4b74-b978-9f60becaf209", "stdout":"ok: [localhost] => {\\...
def function[events, parameter[self]]: constant[ A generator that will return all ansible job events in the order that they were emitted from Ansible Example: { "event":"runner_on_ok", "uuid":"00a50d9c-161a-4b74-b978-9f60becaf209", "stdo...
keyword[def] identifier[events] ( identifier[self] ): literal[string] identifier[event_path] = identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[config] . identifier[artifact_dir] , literal[string] ) keyword[if] keyword[not] identifier[os] . identifier[...
def events(self): """ A generator that will return all ansible job events in the order that they were emitted from Ansible Example: { "event":"runner_on_ok", "uuid":"00a50d9c-161a-4b74-b978-9f60becaf209", "stdout":"ok: [localhost] => {\\r\\n...
def update_network(network, update_nodes = True, update_links = True, update_groups = True, update_scenarios = True, **kwargs): """ Update an entire network """ log.info("Updating Network %s", network.name) user_id = kwargs.get('user_id') #check_perm('update_network') ...
def function[update_network, parameter[network, update_nodes, update_links, update_groups, update_scenarios]]: constant[ Update an entire network ] call[name[log].info, parameter[constant[Updating Network %s], name[network].name]] variable[user_id] assign[=] call[name[kwargs].get, pa...
keyword[def] identifier[update_network] ( identifier[network] , identifier[update_nodes] = keyword[True] , identifier[update_links] = keyword[True] , identifier[update_groups] = keyword[True] , identifier[update_scenarios] = keyword[True] , ** identifier[kwargs] ): literal[string] identifier[log] . ide...
def update_network(network, update_nodes=True, update_links=True, update_groups=True, update_scenarios=True, **kwargs): """ Update an entire network """ log.info('Updating Network %s', network.name) user_id = kwargs.get('user_id') #check_perm('update_network') try: net_i = db.DBS...
def mtf_image_transformer_base_imagenet_mp64(): """Model parallel ImageNet parameters.""" hparams = mtf_image_transformer_base_imagenet() hparams.mesh_shape = "model:8;batch:4" hparams.layout = "batch:batch;d_ff:model;heads:model" hparams.batch_size = 8 hparams.img_len = 64 hparams.num_decoder_layers = 8 ...
def function[mtf_image_transformer_base_imagenet_mp64, parameter[]]: constant[Model parallel ImageNet parameters.] variable[hparams] assign[=] call[name[mtf_image_transformer_base_imagenet], parameter[]] name[hparams].mesh_shape assign[=] constant[model:8;batch:4] name[hparams].layout as...
keyword[def] identifier[mtf_image_transformer_base_imagenet_mp64] (): literal[string] identifier[hparams] = identifier[mtf_image_transformer_base_imagenet] () identifier[hparams] . identifier[mesh_shape] = literal[string] identifier[hparams] . identifier[layout] = literal[string] identifier[hparams]...
def mtf_image_transformer_base_imagenet_mp64(): """Model parallel ImageNet parameters.""" hparams = mtf_image_transformer_base_imagenet() hparams.mesh_shape = 'model:8;batch:4' hparams.layout = 'batch:batch;d_ff:model;heads:model' hparams.batch_size = 8 hparams.img_len = 64 hparams.num_decod...
def ip_to_long (ip): """ Convert ip address to a network byte order 32-bit integer. """ quad = ip.split('.') if len(quad) == 1: quad = quad + [0, 0, 0] elif len(quad) < 4: host = quad[-1:] quad = quad[:-1] + [0,] * (4 - len(quad)) + host lip = 0 for q in quad: ...
def function[ip_to_long, parameter[ip]]: constant[ Convert ip address to a network byte order 32-bit integer. ] variable[quad] assign[=] call[name[ip].split, parameter[constant[.]]] if compare[call[name[len], parameter[name[quad]]] equal[==] constant[1]] begin[:] variable[...
keyword[def] identifier[ip_to_long] ( identifier[ip] ): literal[string] identifier[quad] = identifier[ip] . identifier[split] ( literal[string] ) keyword[if] identifier[len] ( identifier[quad] )== literal[int] : identifier[quad] = identifier[quad] +[ literal[int] , literal[int] , literal[int...
def ip_to_long(ip): """ Convert ip address to a network byte order 32-bit integer. """ quad = ip.split('.') if len(quad) == 1: quad = quad + [0, 0, 0] # depends on [control=['if'], data=[]] elif len(quad) < 4: host = quad[-1:] quad = quad[:-1] + [0] * (4 - len(quad)) + ho...
def get_current_tag(self) -> typing.Optional[str]: """ :return: tag name if current commit is on tag, else None :rtype: optional str """ tags = list(self.repo.tags) if not tags: LOGGER.debug('no tag found') return None for tag in tags: ...
def function[get_current_tag, parameter[self]]: constant[ :return: tag name if current commit is on tag, else None :rtype: optional str ] variable[tags] assign[=] call[name[list], parameter[name[self].repo.tags]] if <ast.UnaryOp object at 0x7da2054a4fa0> begin[:] ...
keyword[def] identifier[get_current_tag] ( identifier[self] )-> identifier[typing] . identifier[Optional] [ identifier[str] ]: literal[string] identifier[tags] = identifier[list] ( identifier[self] . identifier[repo] . identifier[tags] ) keyword[if] keyword[not] identifier[tags] : ...
def get_current_tag(self) -> typing.Optional[str]: """ :return: tag name if current commit is on tag, else None :rtype: optional str """ tags = list(self.repo.tags) if not tags: LOGGER.debug('no tag found') return None # depends on [control=['if'], data=[]] for t...
def dateof(tag_name, tags): """Given a list of tags, returns the datetime of the tag with the given name; Otherwise None.""" for tag in tags: if tag['name'] == tag_name: commit = read_url(tag['commit']['url']) return parse_timestamp(commit['commit']['committer']['date']) retu...
def function[dateof, parameter[tag_name, tags]]: constant[Given a list of tags, returns the datetime of the tag with the given name; Otherwise None.] for taget[name[tag]] in starred[name[tags]] begin[:] if compare[call[name[tag]][constant[name]] equal[==] name[tag_name]] begin[:] ...
keyword[def] identifier[dateof] ( identifier[tag_name] , identifier[tags] ): literal[string] keyword[for] identifier[tag] keyword[in] identifier[tags] : keyword[if] identifier[tag] [ literal[string] ]== identifier[tag_name] : identifier[commit] = identifier[read_url] ( identifier[...
def dateof(tag_name, tags): """Given a list of tags, returns the datetime of the tag with the given name; Otherwise None.""" for tag in tags: if tag['name'] == tag_name: commit = read_url(tag['commit']['url']) return parse_timestamp(commit['commit']['committer']['date']) # depen...
def spklef(filename): """ Load an ephemeris file for use by the readers. Return that file's handle, to be used by other SPK routines to refer to the file. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spklef_c.html :param filename: Name of the file to be loaded. :type filename: str ...
def function[spklef, parameter[filename]]: constant[ Load an ephemeris file for use by the readers. Return that file's handle, to be used by other SPK routines to refer to the file. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spklef_c.html :param filename: Name of the file to be l...
keyword[def] identifier[spklef] ( identifier[filename] ): literal[string] identifier[filename] = identifier[stypes] . identifier[stringToCharP] ( identifier[filename] ) identifier[handle] = identifier[ctypes] . identifier[c_int] () identifier[libspice] . identifier[spklef_c] ( identifier[filename...
def spklef(filename): """ Load an ephemeris file for use by the readers. Return that file's handle, to be used by other SPK routines to refer to the file. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spklef_c.html :param filename: Name of the file to be loaded. :type filename: str ...
def parse_args(argv): """ Parse commandline arguments. Arguments: argv -- An argument list without the program name. """ output_funcs = { 'json': dump_as_json, 'tsv': dump_as_two_item_tsv, } default_output_func_key = 'json' parser = argparse.ArgumentParser() ...
def function[parse_args, parameter[argv]]: constant[ Parse commandline arguments. Arguments: argv -- An argument list without the program name. ] variable[output_funcs] assign[=] dictionary[[<ast.Constant object at 0x7da1b23470a0>, <ast.Constant object at 0x7da1b23460b0>], [<ast.Nam...
keyword[def] identifier[parse_args] ( identifier[argv] ): literal[string] identifier[output_funcs] ={ literal[string] : identifier[dump_as_json] , literal[string] : identifier[dump_as_two_item_tsv] , } identifier[default_output_func_key] = literal[string] identifier[parser] = iden...
def parse_args(argv): """ Parse commandline arguments. Arguments: argv -- An argument list without the program name. """ output_funcs = {'json': dump_as_json, 'tsv': dump_as_two_item_tsv} default_output_func_key = 'json' parser = argparse.ArgumentParser() parser.add_argument('-v...
def list_records(self, limit=None, offset=None): """ Returns a list of all records configured for this domain. """ return self.manager.list_records(self, limit=limit, offset=offset)
def function[list_records, parameter[self, limit, offset]]: constant[ Returns a list of all records configured for this domain. ] return[call[name[self].manager.list_records, parameter[name[self]]]]
keyword[def] identifier[list_records] ( identifier[self] , identifier[limit] = keyword[None] , identifier[offset] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[manager] . identifier[list_records] ( identifier[self] , identifier[limit] = identifier[limit] , identi...
def list_records(self, limit=None, offset=None): """ Returns a list of all records configured for this domain. """ return self.manager.list_records(self, limit=limit, offset=offset)
def check_signature(self, msgbuf, srcSystem, srcComponent): '''check signature on incoming message''' if isinstance(msgbuf, array.array): msgbuf = msgbuf.tostring() timestamp_buf = msgbuf[-12:-6] link_id = msgbuf[-13] (tlow, thigh) = struct.unp...
def function[check_signature, parameter[self, msgbuf, srcSystem, srcComponent]]: constant[check signature on incoming message] if call[name[isinstance], parameter[name[msgbuf], name[array].array]] begin[:] variable[msgbuf] assign[=] call[name[msgbuf].tostring, parameter[]] variab...
keyword[def] identifier[check_signature] ( identifier[self] , identifier[msgbuf] , identifier[srcSystem] , identifier[srcComponent] ): literal[string] keyword[if] identifier[isinstance] ( identifier[msgbuf] , identifier[array] . identifier[array] ): identifier[msgbuf] = id...
def check_signature(self, msgbuf, srcSystem, srcComponent): """check signature on incoming message""" if isinstance(msgbuf, array.array): msgbuf = msgbuf.tostring() # depends on [control=['if'], data=[]] timestamp_buf = msgbuf[-12:-6] link_id = msgbuf[-13] (tlow, thigh) = struct.unpack('<IH...
def _call_multi_fortran_z_attr(self, names, data_types, num_elems, entry_nums, attr_nums, var_names, input_type_code, func, data_offset=None): """Calls Fortran function that reads attribute data. data_offset translates unsign...
def function[_call_multi_fortran_z_attr, parameter[self, names, data_types, num_elems, entry_nums, attr_nums, var_names, input_type_code, func, data_offset]]: constant[Calls Fortran function that reads attribute data. data_offset translates unsigned into signed. If number read in is neg...
keyword[def] identifier[_call_multi_fortran_z_attr] ( identifier[self] , identifier[names] , identifier[data_types] , identifier[num_elems] , identifier[entry_nums] , identifier[attr_nums] , identifier[var_names] , identifier[input_type_code] , identifier[func] , identifier[data_offset] = keyword[None] ): ...
def _call_multi_fortran_z_attr(self, names, data_types, num_elems, entry_nums, attr_nums, var_names, input_type_code, func, data_offset=None): """Calls Fortran function that reads attribute data. data_offset translates unsigned into signed. If number read in is negative, offset added. ...
def league_scores(self, total_data, time, show_datetime, use_12_hour_format): """Prints the data in a pretty format""" for match in total_data['matches']: self.scores(self.parse_result(match), add_new_line=not show_datetime) if show_datetime: ...
def function[league_scores, parameter[self, total_data, time, show_datetime, use_12_hour_format]]: constant[Prints the data in a pretty format] for taget[name[match]] in starred[call[name[total_data]][constant[matches]]] begin[:] call[name[self].scores, parameter[call[name[self].parse_re...
keyword[def] identifier[league_scores] ( identifier[self] , identifier[total_data] , identifier[time] , identifier[show_datetime] , identifier[use_12_hour_format] ): literal[string] keyword[for] identifier[match] keyword[in] identifier[total_data] [ literal[string] ]: identifier[se...
def league_scores(self, total_data, time, show_datetime, use_12_hour_format): """Prints the data in a pretty format""" for match in total_data['matches']: self.scores(self.parse_result(match), add_new_line=not show_datetime) if show_datetime: click.secho(' %s' % Stdout.utc_to_local...
def folderitem(self, obj, item, index): """Augment folder listing item with additional data """ url = item.get("url") title = item.get("Title") item["replace"]["Title"] = get_link(url, value=title) item["getDate"] = self.localize_date(obj.getDate()) item["getVali...
def function[folderitem, parameter[self, obj, item, index]]: constant[Augment folder listing item with additional data ] variable[url] assign[=] call[name[item].get, parameter[constant[url]]] variable[title] assign[=] call[name[item].get, parameter[constant[Title]]] call[call[nam...
keyword[def] identifier[folderitem] ( identifier[self] , identifier[obj] , identifier[item] , identifier[index] ): literal[string] identifier[url] = identifier[item] . identifier[get] ( literal[string] ) identifier[title] = identifier[item] . identifier[get] ( literal[string] ) i...
def folderitem(self, obj, item, index): """Augment folder listing item with additional data """ url = item.get('url') title = item.get('Title') item['replace']['Title'] = get_link(url, value=title) item['getDate'] = self.localize_date(obj.getDate()) item['getValidFrom'] = self.localize_d...
def ones(shape, dtype=float64, order='C'): """ Create a local bolt array of ones. Parameters ---------- shape : tuple Dimensions of the desired array dtype : data-type, optional, default=float64 The desired data-type for the array. (see numpy) ...
def function[ones, parameter[shape, dtype, order]]: constant[ Create a local bolt array of ones. Parameters ---------- shape : tuple Dimensions of the desired array dtype : data-type, optional, default=float64 The desired data-type for the array....
keyword[def] identifier[ones] ( identifier[shape] , identifier[dtype] = identifier[float64] , identifier[order] = literal[string] ): literal[string] keyword[from] identifier[numpy] keyword[import] identifier[ones] keyword[return] identifier[ConstructLocal] . identifier[_wrap] ( identi...
def ones(shape, dtype=float64, order='C'): """ Create a local bolt array of ones. Parameters ---------- shape : tuple Dimensions of the desired array dtype : data-type, optional, default=float64 The desired data-type for the array. (see numpy) ...
def metatiles_are_equal(tile_data_1, tile_data_2): """ Return True if the two tiles are both zipped metatiles and contain the same set of files with the same contents. This ignores the timestamp of the individual files in the zip files, as well as their order or any other metadata. """ try:...
def function[metatiles_are_equal, parameter[tile_data_1, tile_data_2]]: constant[ Return True if the two tiles are both zipped metatiles and contain the same set of files with the same contents. This ignores the timestamp of the individual files in the zip files, as well as their order or any ot...
keyword[def] identifier[metatiles_are_equal] ( identifier[tile_data_1] , identifier[tile_data_2] ): literal[string] keyword[try] : identifier[buf_1] = identifier[StringIO] . identifier[StringIO] ( identifier[tile_data_1] ) identifier[buf_2] = identifier[StringIO] . identifier[StringIO] (...
def metatiles_are_equal(tile_data_1, tile_data_2): """ Return True if the two tiles are both zipped metatiles and contain the same set of files with the same contents. This ignores the timestamp of the individual files in the zip files, as well as their order or any other metadata. """ try: ...
def sort_arbitrarily_ordered_nexson(blob): """Primarily used for testing (getting nice diffs). Calls sort_meta_elements and then sorts otu, node and edge list by id """ # otu, node and edge elements have no necessary orger in v0.0 or v1.0 v = detect_nexson_version(blob) nex = get_nexml_el(blob) ...
def function[sort_arbitrarily_ordered_nexson, parameter[blob]]: constant[Primarily used for testing (getting nice diffs). Calls sort_meta_elements and then sorts otu, node and edge list by id ] variable[v] assign[=] call[name[detect_nexson_version], parameter[name[blob]]] variable[nex] a...
keyword[def] identifier[sort_arbitrarily_ordered_nexson] ( identifier[blob] ): literal[string] identifier[v] = identifier[detect_nexson_version] ( identifier[blob] ) identifier[nex] = identifier[get_nexml_el] ( identifier[blob] ) keyword[if] identifier[_is_by_id_hbf] ( identifier[v] ): ...
def sort_arbitrarily_ordered_nexson(blob): """Primarily used for testing (getting nice diffs). Calls sort_meta_elements and then sorts otu, node and edge list by id """ # otu, node and edge elements have no necessary orger in v0.0 or v1.0 v = detect_nexson_version(blob) nex = get_nexml_el(blob) ...
def raw(self, raw): """ Sets the raw of this RuntimeRawExtension. Raw is the underlying serialization of this object. :param raw: The raw of this RuntimeRawExtension. :type: str """ if raw is None: raise ValueError("Invalid value for `raw`, must not b...
def function[raw, parameter[self, raw]]: constant[ Sets the raw of this RuntimeRawExtension. Raw is the underlying serialization of this object. :param raw: The raw of this RuntimeRawExtension. :type: str ] if compare[name[raw] is constant[None]] begin[:] ...
keyword[def] identifier[raw] ( identifier[self] , identifier[raw] ): literal[string] keyword[if] identifier[raw] keyword[is] keyword[None] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[if] identifier[raw] keyword[is] keyword[not] keyword[None] ke...
def raw(self, raw): """ Sets the raw of this RuntimeRawExtension. Raw is the underlying serialization of this object. :param raw: The raw of this RuntimeRawExtension. :type: str """ if raw is None: raise ValueError('Invalid value for `raw`, must not be `None`') ...
def _parse2(self, fragments): """ Second stage of parsing: convert ``fragments`` into the list of code objects. This method in fact does more than simple conversion of fragments into objects. It also attempts to group certain fragments into one, if they in fact seem like a single piece....
def function[_parse2, parameter[self, fragments]]: constant[ Second stage of parsing: convert ``fragments`` into the list of code objects. This method in fact does more than simple conversion of fragments into objects. It also attempts to group certain fragments into one, if they in fac...
keyword[def] identifier[_parse2] ( identifier[self] , identifier[fragments] ): literal[string] identifier[out] =[] identifier[tokens] = identifier[self] . identifier[_tokens] identifier[i] = literal[int] identifier[saved_start] = keyword[None] keyword[while] ...
def _parse2(self, fragments): """ Second stage of parsing: convert ``fragments`` into the list of code objects. This method in fact does more than simple conversion of fragments into objects. It also attempts to group certain fragments into one, if they in fact seem like a single piece. For...
def _replace(expr, pat, repl, n=-1, case=True, flags=0, regex=True): """ Replace occurrence of pattern/regex in the sequence or scalar with some other string. Equivalent to str.replace() :param expr: :param pat: Character sequence or regular expression :param repl: Replacement :param n: Num...
def function[_replace, parameter[expr, pat, repl, n, case, flags, regex]]: constant[ Replace occurrence of pattern/regex in the sequence or scalar with some other string. Equivalent to str.replace() :param expr: :param pat: Character sequence or regular expression :param repl: Replacement ...
keyword[def] identifier[_replace] ( identifier[expr] , identifier[pat] , identifier[repl] , identifier[n] =- literal[int] , identifier[case] = keyword[True] , identifier[flags] = literal[int] , identifier[regex] = keyword[True] ): literal[string] keyword[return] identifier[_string_op] ( identifier[expr] ...
def _replace(expr, pat, repl, n=-1, case=True, flags=0, regex=True): """ Replace occurrence of pattern/regex in the sequence or scalar with some other string. Equivalent to str.replace() :param expr: :param pat: Character sequence or regular expression :param repl: Replacement :param n: Num...
def _request(self, typ, id=0, method='GET', params=None, data=None, url=None): """ send the request, return response obj """ headers = { "Accept": "application/json" } auth = None if self.user: auth = (self.user, self.password) if not url: ...
def function[_request, parameter[self, typ, id, method, params, data, url]]: constant[ send the request, return response obj ] variable[headers] assign[=] dictionary[[<ast.Constant object at 0x7da18bcc9ae0>], [<ast.Constant object at 0x7da18bccb700>]] variable[auth] assign[=] con...
keyword[def] identifier[_request] ( identifier[self] , identifier[typ] , identifier[id] = literal[int] , identifier[method] = literal[string] , identifier[params] = keyword[None] , identifier[data] = keyword[None] , identifier[url] = keyword[None] ): literal[string] identifier[headers] ={ literal[...
def _request(self, typ, id=0, method='GET', params=None, data=None, url=None): """ send the request, return response obj """ headers = {'Accept': 'application/json'} auth = None if self.user: auth = (self.user, self.password) # depends on [control=['if'], data=[]] if not url...
def set_surfaces(self, df_surfaces): ''' Reset the contents of the tree view to show one row per surface, with a column containing the alpha multiplier for the corresponding surface (in the range [0, 1]), indexed by surface name. For example: | index | alpha | ...
def function[set_surfaces, parameter[self, df_surfaces]]: constant[ Reset the contents of the tree view to show one row per surface, with a column containing the alpha multiplier for the corresponding surface (in the range [0, 1]), indexed by surface name. For example: ...
keyword[def] identifier[set_surfaces] ( identifier[self] , identifier[df_surfaces] ): literal[string] keyword[for] identifier[column] keyword[in] identifier[self] . identifier[treeview_layers] . identifier[get_columns] (): identifier[self] . identifier[treeview_layers] . identifier[...
def set_surfaces(self, df_surfaces): """ Reset the contents of the tree view to show one row per surface, with a column containing the alpha multiplier for the corresponding surface (in the range [0, 1]), indexed by surface name. For example: | index | alpha | ...
def profile_option(f): """ Configures --profile option for CLI :param f: Callback Function to be passed to Click """ def callback(ctx, param, value): state = ctx.ensure_object(Context) state.profile = value return value return click.option('--profile', ...
def function[profile_option, parameter[f]]: constant[ Configures --profile option for CLI :param f: Callback Function to be passed to Click ] def function[callback, parameter[ctx, param, value]]: variable[state] assign[=] call[name[ctx].ensure_object, parameter[name[Context]...
keyword[def] identifier[profile_option] ( identifier[f] ): literal[string] keyword[def] identifier[callback] ( identifier[ctx] , identifier[param] , identifier[value] ): identifier[state] = identifier[ctx] . identifier[ensure_object] ( identifier[Context] ) identifier[state] . identifier...
def profile_option(f): """ Configures --profile option for CLI :param f: Callback Function to be passed to Click """ def callback(ctx, param, value): state = ctx.ensure_object(Context) state.profile = value return value return click.option('--profile', expose_value=Fals...
def merge_into(self, other): """Merge two simple selectors together. This is expected to be the selector being injected into `other` -- that is, `other` is the selector for a block using ``@extend``, and `self` is a selector being extended. Element tokens must come first, and p...
def function[merge_into, parameter[self, other]]: constant[Merge two simple selectors together. This is expected to be the selector being injected into `other` -- that is, `other` is the selector for a block using ``@extend``, and `self` is a selector being extended. Element to...
keyword[def] identifier[merge_into] ( identifier[self] , identifier[other] ): literal[string] identifier[element] =[] identifier[middle] =[] identifier[pseudo] =[] keyword[for] identifier[token] keyword[in] identifi...
def merge_into(self, other): """Merge two simple selectors together. This is expected to be the selector being injected into `other` -- that is, `other` is the selector for a block using ``@extend``, and `self` is a selector being extended. Element tokens must come first, and pseud...
def command_drop_tables(self, meta_name=None): ''' Drops all tables without dropping a database:: ./manage.py sqla:drop_tables [meta_name] ''' answer = six.moves.input(u'All data will lost. Are you sure? [y/N] ') if answer.strip().lower()!='y': sys.exit(...
def function[command_drop_tables, parameter[self, meta_name]]: constant[ Drops all tables without dropping a database:: ./manage.py sqla:drop_tables [meta_name] ] variable[answer] assign[=] call[name[six].moves.input, parameter[constant[All data will lost. Are you sure? [y/N...
keyword[def] identifier[command_drop_tables] ( identifier[self] , identifier[meta_name] = keyword[None] ): literal[string] identifier[answer] = identifier[six] . identifier[moves] . identifier[input] ( literal[string] ) keyword[if] identifier[answer] . identifier[strip] (). identifier[lo...
def command_drop_tables(self, meta_name=None): """ Drops all tables without dropping a database:: ./manage.py sqla:drop_tables [meta_name] """ answer = six.moves.input(u'All data will lost. Are you sure? [y/N] ') if answer.strip().lower() != 'y': sys.exit('Interrupted') ...
def reverse_delete_ipv6(self, subid, ipaddr, params=None): ''' /v1/server/reverse_delete_ipv6 POST - account Remove a reverse DNS entry for an IPv6 address of a virtual machine. Upon success, DNS changes may take 6-12 hours to become active. Link: https://www.vultr.com/api/#serv...
def function[reverse_delete_ipv6, parameter[self, subid, ipaddr, params]]: constant[ /v1/server/reverse_delete_ipv6 POST - account Remove a reverse DNS entry for an IPv6 address of a virtual machine. Upon success, DNS changes may take 6-12 hours to become active. Link: https://w...
keyword[def] identifier[reverse_delete_ipv6] ( identifier[self] , identifier[subid] , identifier[ipaddr] , identifier[params] = keyword[None] ): literal[string] identifier[params] = identifier[update_params] ( identifier[params] ,{ literal[string] : identifier[subid] , literal[str...
def reverse_delete_ipv6(self, subid, ipaddr, params=None): """ /v1/server/reverse_delete_ipv6 POST - account Remove a reverse DNS entry for an IPv6 address of a virtual machine. Upon success, DNS changes may take 6-12 hours to become active. Link: https://www.vultr.com/api/#server_r...
def print_user_sets(wordsets, print_terms): """Print all user sets by title. If 'print_terms', also prints all terms of all user sets. :param wordsets: List of WordSet. :param print_terms: If True, also prints all terms of all user sets. """ if not wordsets: print('No sets found') else: ...
def function[print_user_sets, parameter[wordsets, print_terms]]: constant[Print all user sets by title. If 'print_terms', also prints all terms of all user sets. :param wordsets: List of WordSet. :param print_terms: If True, also prints all terms of all user sets. ] if <ast.UnaryOp object at...
keyword[def] identifier[print_user_sets] ( identifier[wordsets] , identifier[print_terms] ): literal[string] keyword[if] keyword[not] identifier[wordsets] : identifier[print] ( literal[string] ) keyword[else] : identifier[print] ( literal[string] . identifier[format] ( identifier[l...
def print_user_sets(wordsets, print_terms): """Print all user sets by title. If 'print_terms', also prints all terms of all user sets. :param wordsets: List of WordSet. :param print_terms: If True, also prints all terms of all user sets. """ if not wordsets: print('No sets found') # depends...
def is_all_field_none(self): """ :rtype: bool """ if self._uuid is not None: return False if self._created is not None: return False if self._updated is not None: return False if self._attachment is not None: ret...
def function[is_all_field_none, parameter[self]]: constant[ :rtype: bool ] if compare[name[self]._uuid is_not constant[None]] begin[:] return[constant[False]] if compare[name[self]._created is_not constant[None]] begin[:] return[constant[False]] if compare...
keyword[def] identifier[is_all_field_none] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_uuid] keyword[is] keyword[not] keyword[None] : keyword[return] keyword[False] keyword[if] identifier[self] . identifier[_created] keyword[is] ...
def is_all_field_none(self): """ :rtype: bool """ if self._uuid is not None: return False # depends on [control=['if'], data=[]] if self._created is not None: return False # depends on [control=['if'], data=[]] if self._updated is not None: return False # depen...
def _uncached_match(self, text, pos, cache, error): """Return length of match, ``None`` if no match.""" m = self.re.match(text, pos) if m is not None: span = m.span() node = RegexNode(self, text, pos, pos + span[1] - span[0]) node.match = m # TODO: A terrible...
def function[_uncached_match, parameter[self, text, pos, cache, error]]: constant[Return length of match, ``None`` if no match.] variable[m] assign[=] call[name[self].re.match, parameter[name[text], name[pos]]] if compare[name[m] is_not constant[None]] begin[:] variable[span] ass...
keyword[def] identifier[_uncached_match] ( identifier[self] , identifier[text] , identifier[pos] , identifier[cache] , identifier[error] ): literal[string] identifier[m] = identifier[self] . identifier[re] . identifier[match] ( identifier[text] , identifier[pos] ) keyword[if] identifier[m...
def _uncached_match(self, text, pos, cache, error): """Return length of match, ``None`` if no match.""" m = self.re.match(text, pos) if m is not None: span = m.span() node = RegexNode(self, text, pos, pos + span[1] - span[0]) node.match = m # TODO: A terrible idea for cache size? ...
def info(self, **kwargs): """ Get the detailed information about a particular credit record. This is currently only supported with the new credit model found in TV. These ids can be found from any TV credit response as well as the tv_credits and combined_credits methods for pe...
def function[info, parameter[self]]: constant[ Get the detailed information about a particular credit record. This is currently only supported with the new credit model found in TV. These ids can be found from any TV credit response as well as the tv_credits and combined_credi...
keyword[def] identifier[info] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[path] = identifier[self] . identifier[_get_credit_id_path] ( literal[string] ) identifier[response] = identifier[self] . identifier[_GET] ( identifier[path] , identifier[kwargs] ) ...
def info(self, **kwargs): """ Get the detailed information about a particular credit record. This is currently only supported with the new credit model found in TV. These ids can be found from any TV credit response as well as the tv_credits and combined_credits methods for people...