code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def send_email(template_name, context=None, *args, **kwargs): """ Send a templated email. To generate the message used for the email, the method first searches for an HTML template with the given name (eg: <template>.html), and renders it with the provided context. The process is repeated for t...
def function[send_email, parameter[template_name, context]]: constant[ Send a templated email. To generate the message used for the email, the method first searches for an HTML template with the given name (eg: <template>.html), and renders it with the provided context. The process is repea...
keyword[def] identifier[send_email] ( identifier[template_name] , identifier[context] = keyword[None] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[context] = identifier[context] keyword[or] {} keyword[try] : identifier[html] = identifier[render_to_string] ( ...
def send_email(template_name, context=None, *args, **kwargs): """ Send a templated email. To generate the message used for the email, the method first searches for an HTML template with the given name (eg: <template>.html), and renders it with the provided context. The process is repeated for t...
def autoconnect_thread(monitor): """Thread which detects USB Serial devices connecting and disconnecting.""" monitor.start() monitor.filter_by('tty') epoll = select.epoll() epoll.register(monitor.fileno(), select.POLLIN) while True: try: events = epoll.poll() except...
def function[autoconnect_thread, parameter[monitor]]: constant[Thread which detects USB Serial devices connecting and disconnecting.] call[name[monitor].start, parameter[]] call[name[monitor].filter_by, parameter[constant[tty]]] variable[epoll] assign[=] call[name[select].epoll, paramete...
keyword[def] identifier[autoconnect_thread] ( identifier[monitor] ): literal[string] identifier[monitor] . identifier[start] () identifier[monitor] . identifier[filter_by] ( literal[string] ) identifier[epoll] = identifier[select] . identifier[epoll] () identifier[epoll] . identifier[regist...
def autoconnect_thread(monitor): """Thread which detects USB Serial devices connecting and disconnecting.""" monitor.start() monitor.filter_by('tty') epoll = select.epoll() epoll.register(monitor.fileno(), select.POLLIN) while True: try: events = epoll.poll() # depends on [c...
def do_ls(self, params): """ \x1b[1mNAME\x1b[0m ls - Lists the znodes for the given <path> \x1b[1mSYNOPSIS\x1b[0m ls <path> [watch] [sep] \x1b[1mOPTIONS\x1b[0m * watch: set a (child) watch on the path (default: false) * sep: separator to be used (default: '\\n') \x1b[1mEXAMPLE...
def function[do_ls, parameter[self, params]]: constant[ NAME ls - Lists the znodes for the given <path> SYNOPSIS ls <path> [watch] [sep] OPTIONS * watch: set a (child) watch on the path (default: false) * sep: separator to be used (default: '\n') EX...
keyword[def] identifier[do_ls] ( identifier[self] , identifier[params] ): literal[string] identifier[watcher] = keyword[lambda] identifier[evt] : identifier[self] . identifier[show_output] ( identifier[str] ( identifier[evt] )) identifier[kwargs] ={ literal[string] : identifier[watcher] }...
def do_ls(self, params): """ \x1b[1mNAME\x1b[0m ls - Lists the znodes for the given <path> \x1b[1mSYNOPSIS\x1b[0m ls <path> [watch] [sep] \x1b[1mOPTIONS\x1b[0m * watch: set a (child) watch on the path (default: false) * sep: separator to be used (default: '\\n') \x1b[1mEXAMPLES\x1...
def do_region(self, x, y, w, h): """Apply region selection.""" if (x is None): self.logger.debug("region: full (nop)") else: self.logger.debug("region: (%d,%d,%d,%d)" % (x, y, w, h)) self.image = self.image.crop((x, y, x + w, y + h)) self.width = w...
def function[do_region, parameter[self, x, y, w, h]]: constant[Apply region selection.] if compare[name[x] is constant[None]] begin[:] call[name[self].logger.debug, parameter[constant[region: full (nop)]]]
keyword[def] identifier[do_region] ( identifier[self] , identifier[x] , identifier[y] , identifier[w] , identifier[h] ): literal[string] keyword[if] ( identifier[x] keyword[is] keyword[None] ): identifier[self] . identifier[logger] . identifier[debug] ( literal[string] ) key...
def do_region(self, x, y, w, h): """Apply region selection.""" if x is None: self.logger.debug('region: full (nop)') # depends on [control=['if'], data=[]] else: self.logger.debug('region: (%d,%d,%d,%d)' % (x, y, w, h)) self.image = self.image.crop((x, y, x + w, y + h)) self...
def _determine_scaling_policies(scaling_policies, scaling_policies_from_pillar): ''' helper method for present. ensure that scaling_policies are set ''' pillar_scaling_policies = copy.deepcopy( __salt__['config.option'](scaling_policies_from_pillar, {}) ) if not scaling_policies and pil...
def function[_determine_scaling_policies, parameter[scaling_policies, scaling_policies_from_pillar]]: constant[ helper method for present. ensure that scaling_policies are set ] variable[pillar_scaling_policies] assign[=] call[name[copy].deepcopy, parameter[call[call[name[__salt__]][constant[co...
keyword[def] identifier[_determine_scaling_policies] ( identifier[scaling_policies] , identifier[scaling_policies_from_pillar] ): literal[string] identifier[pillar_scaling_policies] = identifier[copy] . identifier[deepcopy] ( identifier[__salt__] [ literal[string] ]( identifier[scaling_policies_from_p...
def _determine_scaling_policies(scaling_policies, scaling_policies_from_pillar): """ helper method for present. ensure that scaling_policies are set """ pillar_scaling_policies = copy.deepcopy(__salt__['config.option'](scaling_policies_from_pillar, {})) if not scaling_policies and pillar_scaling_po...
def delete_tag(self, project, repository, tag_name): """ Creates a tag using the information provided in the {@link RestCreateTagRequest request} The authenticated user must have REPO_WRITE permission for the context repository to call this resource. :param project: :param reposi...
def function[delete_tag, parameter[self, project, repository, tag_name]]: constant[ Creates a tag using the information provided in the {@link RestCreateTagRequest request} The authenticated user must have REPO_WRITE permission for the context repository to call this resource. :param pro...
keyword[def] identifier[delete_tag] ( identifier[self] , identifier[project] , identifier[repository] , identifier[tag_name] ): literal[string] identifier[url] = literal[string] . identifier[format] ( identifier[project] = identifier[project] , identifier[repository] = identifier[repositor...
def delete_tag(self, project, repository, tag_name): """ Creates a tag using the information provided in the {@link RestCreateTagRequest request} The authenticated user must have REPO_WRITE permission for the context repository to call this resource. :param project: :param repository...
def _tiff_from_exif_segment(cls, stream, offset, segment_length): """ Return a |Tiff| instance parsed from the Exif APP1 segment of *segment_length* at *offset* in *stream*. """ # wrap full segment in its own stream and feed to Tiff() stream.seek(offset+8) segment...
def function[_tiff_from_exif_segment, parameter[cls, stream, offset, segment_length]]: constant[ Return a |Tiff| instance parsed from the Exif APP1 segment of *segment_length* at *offset* in *stream*. ] call[name[stream].seek, parameter[binary_operation[name[offset] + constant[8]...
keyword[def] identifier[_tiff_from_exif_segment] ( identifier[cls] , identifier[stream] , identifier[offset] , identifier[segment_length] ): literal[string] identifier[stream] . identifier[seek] ( identifier[offset] + literal[int] ) identifier[segment_bytes] = identifier[stream] ....
def _tiff_from_exif_segment(cls, stream, offset, segment_length): """ Return a |Tiff| instance parsed from the Exif APP1 segment of *segment_length* at *offset* in *stream*. """ # wrap full segment in its own stream and feed to Tiff() stream.seek(offset + 8) segment_bytes = strea...
def get_default_config(self): """ Returns the default collector settings """ config = super(NetstatCollector, self).get_default_config() config.update({ 'path': 'netstat', }) return config
def function[get_default_config, parameter[self]]: constant[ Returns the default collector settings ] variable[config] assign[=] call[call[name[super], parameter[name[NetstatCollector], name[self]]].get_default_config, parameter[]] call[name[config].update, parameter[dictionary[[...
keyword[def] identifier[get_default_config] ( identifier[self] ): literal[string] identifier[config] = identifier[super] ( identifier[NetstatCollector] , identifier[self] ). identifier[get_default_config] () identifier[config] . identifier[update] ({ literal[string] : literal[stri...
def get_default_config(self): """ Returns the default collector settings """ config = super(NetstatCollector, self).get_default_config() config.update({'path': 'netstat'}) return config
def sched(self): """ Yield CPU. This will choose another process from the RUNNNIG list and change current running process. May give the same cpu if only one running process. """ if len(self.procs) > 1: logger.info("SCHED:") logger.info(...
def function[sched, parameter[self]]: constant[ Yield CPU. This will choose another process from the RUNNNIG list and change current running process. May give the same cpu if only one running process. ] if compare[call[name[len], parameter[name[self].procs]] g...
keyword[def] identifier[sched] ( identifier[self] ): literal[string] keyword[if] identifier[len] ( identifier[self] . identifier[procs] )> literal[int] : identifier[logger] . identifier[info] ( literal[string] ) identifier[logger] . identifier[info] ( literal[string] , id...
def sched(self): """ Yield CPU. This will choose another process from the RUNNNIG list and change current running process. May give the same cpu if only one running process. """ if len(self.procs) > 1: logger.info('SCHED:') logger.info('\tProcess: %r',...
def to_ogc_wkt(self): """ Returns the CS as a OGC WKT formatted string. """ string = 'PROJCS["%s", %s, %s, ' % (self.name, self.geogcs.to_ogc_wkt(), self.proj.to_ogc_wkt() ) string += ", ".join(param.to_ogc_wkt() for param in self.params) string += ', %s' % self.unit.to_o...
def function[to_ogc_wkt, parameter[self]]: constant[ Returns the CS as a OGC WKT formatted string. ] variable[string] assign[=] binary_operation[constant[PROJCS["%s", %s, %s, ] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Attribute object at 0x7da18c4cf280>, <ast.Call object at 0x7da18...
keyword[def] identifier[to_ogc_wkt] ( identifier[self] ): literal[string] identifier[string] = literal[string] %( identifier[self] . identifier[name] , identifier[self] . identifier[geogcs] . identifier[to_ogc_wkt] (), identifier[self] . identifier[proj] . identifier[to_ogc_wkt] ()) identi...
def to_ogc_wkt(self): """ Returns the CS as a OGC WKT formatted string. """ string = 'PROJCS["%s", %s, %s, ' % (self.name, self.geogcs.to_ogc_wkt(), self.proj.to_ogc_wkt()) string += ', '.join((param.to_ogc_wkt() for param in self.params)) string += ', %s' % self.unit.to_ogc_wkt() st...
def get_D_square_min(atoms_now, atoms_old, i_now, j_now, delta_plus_epsilon=None): """ Calculate the D^2_min norm of Falk and Langer """ nat = len(atoms_now) assert len(atoms_now) == len(atoms_old) pos_now = atoms_now.positions pos_old = atoms_old.positions # Compute current and old di...
def function[get_D_square_min, parameter[atoms_now, atoms_old, i_now, j_now, delta_plus_epsilon]]: constant[ Calculate the D^2_min norm of Falk and Langer ] variable[nat] assign[=] call[name[len], parameter[name[atoms_now]]] assert[compare[call[name[len], parameter[name[atoms_now]]] equal[==...
keyword[def] identifier[get_D_square_min] ( identifier[atoms_now] , identifier[atoms_old] , identifier[i_now] , identifier[j_now] , identifier[delta_plus_epsilon] = keyword[None] ): literal[string] identifier[nat] = identifier[len] ( identifier[atoms_now] ) keyword[assert] identifier[len] ( identifie...
def get_D_square_min(atoms_now, atoms_old, i_now, j_now, delta_plus_epsilon=None): """ Calculate the D^2_min norm of Falk and Langer """ nat = len(atoms_now) assert len(atoms_now) == len(atoms_old) pos_now = atoms_now.positions pos_old = atoms_old.positions # Compute current and old dist...
def dafrda(handle, begin, end): """ Read the double precision data bounded by two addresses within a DAF. Deprecated: This routine has been superseded by :func:`dafgda` and :func:`dafgsr`. This routine is supported for purposes of backward compatibility only. http://naif.jpl.nasa.gov/pub/naif...
def function[dafrda, parameter[handle, begin, end]]: constant[ Read the double precision data bounded by two addresses within a DAF. Deprecated: This routine has been superseded by :func:`dafgda` and :func:`dafgsr`. This routine is supported for purposes of backward compatibility only. ht...
keyword[def] identifier[dafrda] ( identifier[handle] , identifier[begin] , identifier[end] ): literal[string] identifier[handle] = identifier[ctypes] . identifier[c_int] ( identifier[handle] ) identifier[begin] = identifier[ctypes] . identifier[c_int] ( identifier[begin] ) identifier[end] = ident...
def dafrda(handle, begin, end): """ Read the double precision data bounded by two addresses within a DAF. Deprecated: This routine has been superseded by :func:`dafgda` and :func:`dafgsr`. This routine is supported for purposes of backward compatibility only. http://naif.jpl.nasa.gov/pub/naif...
def tob32(val): """Return provided 32 bit value as a string of four bytes.""" ret = bytearray(4) ret[0] = (val>>24)&M8 ret[1] = (val>>16)&M8 ret[2] = (val>>8)&M8 ret[3] = val&M8 return ret
def function[tob32, parameter[val]]: constant[Return provided 32 bit value as a string of four bytes.] variable[ret] assign[=] call[name[bytearray], parameter[constant[4]]] call[name[ret]][constant[0]] assign[=] binary_operation[binary_operation[name[val] <ast.RShift object at 0x7da2590d6a40> co...
keyword[def] identifier[tob32] ( identifier[val] ): literal[string] identifier[ret] = identifier[bytearray] ( literal[int] ) identifier[ret] [ literal[int] ]=( identifier[val] >> literal[int] )& identifier[M8] identifier[ret] [ literal[int] ]=( identifier[val] >> literal[int] )& identifier[M8] ...
def tob32(val): """Return provided 32 bit value as a string of four bytes.""" ret = bytearray(4) ret[0] = val >> 24 & M8 ret[1] = val >> 16 & M8 ret[2] = val >> 8 & M8 ret[3] = val & M8 return ret
def setup_address(self, name, address=default, transact={}): """ Set up the name to point to the supplied address. The sender of the transaction must own the name, or its parent name. Example: If the caller owns ``parentname.eth`` with no subdomains and calls this method...
def function[setup_address, parameter[self, name, address, transact]]: constant[ Set up the name to point to the supplied address. The sender of the transaction must own the name, or its parent name. Example: If the caller owns ``parentname.eth`` with no subdomains and c...
keyword[def] identifier[setup_address] ( identifier[self] , identifier[name] , identifier[address] = identifier[default] , identifier[transact] ={}): literal[string] identifier[owner] = identifier[self] . identifier[setup_owner] ( identifier[name] , identifier[transact] = identifier[transact] ) ...
def setup_address(self, name, address=default, transact={}): """ Set up the name to point to the supplied address. The sender of the transaction must own the name, or its parent name. Example: If the caller owns ``parentname.eth`` with no subdomains and calls this method wit...
def smear(self, sigma): """ Apply Gaussian smearing to spectrum y value. Args: sigma: Std dev for Gaussian smear function """ diff = [self.x[i + 1] - self.x[i] for i in range(len(self.x) - 1)] avg_x_per_step = np.sum(diff) / len(diff) if len(self.ydim...
def function[smear, parameter[self, sigma]]: constant[ Apply Gaussian smearing to spectrum y value. Args: sigma: Std dev for Gaussian smear function ] variable[diff] assign[=] <ast.ListComp object at 0x7da18f00de70> variable[avg_x_per_step] assign[=] binary_o...
keyword[def] identifier[smear] ( identifier[self] , identifier[sigma] ): literal[string] identifier[diff] =[ identifier[self] . identifier[x] [ identifier[i] + literal[int] ]- identifier[self] . identifier[x] [ identifier[i] ] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier...
def smear(self, sigma): """ Apply Gaussian smearing to spectrum y value. Args: sigma: Std dev for Gaussian smear function """ diff = [self.x[i + 1] - self.x[i] for i in range(len(self.x) - 1)] avg_x_per_step = np.sum(diff) / len(diff) if len(self.ydim) == 1: ...
def submit_link(self, title, url): """Submit link to this subreddit (POST). Calls :meth:`narwal.Reddit.submit_link`. :param title: title of submission :param url: url submission links to """ return self._reddit.submit_link(self.display_name, title, url)
def function[submit_link, parameter[self, title, url]]: constant[Submit link to this subreddit (POST). Calls :meth:`narwal.Reddit.submit_link`. :param title: title of submission :param url: url submission links to ] return[call[name[self]._reddit.submit_link, parameter[name...
keyword[def] identifier[submit_link] ( identifier[self] , identifier[title] , identifier[url] ): literal[string] keyword[return] identifier[self] . identifier[_reddit] . identifier[submit_link] ( identifier[self] . identifier[display_name] , identifier[title] , identifier[url] )
def submit_link(self, title, url): """Submit link to this subreddit (POST). Calls :meth:`narwal.Reddit.submit_link`. :param title: title of submission :param url: url submission links to """ return self._reddit.submit_link(self.display_name, title, url)
def cleanup_service(self, factory, svc_registration): # type: (Any, ServiceRegistration) -> bool """ If this bundle used that factory, releases the reference; else does nothing :param factory: The service factory :param svc_registration: The ServiceRegistration object ...
def function[cleanup_service, parameter[self, factory, svc_registration]]: constant[ If this bundle used that factory, releases the reference; else does nothing :param factory: The service factory :param svc_registration: The ServiceRegistration object :return: True if t...
keyword[def] identifier[cleanup_service] ( identifier[self] , identifier[factory] , identifier[svc_registration] ): literal[string] identifier[svc_ref] = identifier[svc_registration] . identifier[get_reference] () keyword[try] : identifier[services] , identifier[_] =...
def cleanup_service(self, factory, svc_registration): # type: (Any, ServiceRegistration) -> bool '\n If this bundle used that factory, releases the reference; else does\n nothing\n\n :param factory: The service factory\n :param svc_registration: The ServiceRegistration object\n ...
def del_register_user(self, register_user): """ Deletes registration object from database :param register_user: RegisterUser object to delete """ try: self.get_session.delete(register_user) self.get_session.commit() return True ...
def function[del_register_user, parameter[self, register_user]]: constant[ Deletes registration object from database :param register_user: RegisterUser object to delete ] <ast.Try object at 0x7da20c7c9030>
keyword[def] identifier[del_register_user] ( identifier[self] , identifier[register_user] ): literal[string] keyword[try] : identifier[self] . identifier[get_session] . identifier[delete] ( identifier[register_user] ) identifier[self] . identifier[get_session] . identifier...
def del_register_user(self, register_user): """ Deletes registration object from database :param register_user: RegisterUser object to delete """ try: self.get_session.delete(register_user) self.get_session.commit() return True # depends on [control=['tr...
def _unpack_v2(h5file, stage): '''Unpack groups from HDF5 v2 file''' points = np.array(h5file['neuron1/%s/points' % stage]) # from documentation: The /neuron1/structure/unraveled reuses /neuron1/structure/raw groups_stage = stage if stage != 'unraveled' else 'raw' groups = np.array(h5file['neuron1/s...
def function[_unpack_v2, parameter[h5file, stage]]: constant[Unpack groups from HDF5 v2 file] variable[points] assign[=] call[name[np].array, parameter[call[name[h5file]][binary_operation[constant[neuron1/%s/points] <ast.Mod object at 0x7da2590d6920> name[stage]]]]] variable[groups_stage] assign...
keyword[def] identifier[_unpack_v2] ( identifier[h5file] , identifier[stage] ): literal[string] identifier[points] = identifier[np] . identifier[array] ( identifier[h5file] [ literal[string] % identifier[stage] ]) identifier[groups_stage] = identifier[stage] keyword[if] identifier[stage] != lit...
def _unpack_v2(h5file, stage): """Unpack groups from HDF5 v2 file""" points = np.array(h5file['neuron1/%s/points' % stage]) # from documentation: The /neuron1/structure/unraveled reuses /neuron1/structure/raw groups_stage = stage if stage != 'unraveled' else 'raw' groups = np.array(h5file['neuron1/s...
def tx_is_data_script(out_script, blockchain='bitcoin', **blockchain_opts): """ Given a blockchain name and an output script (tx['outs'][x]['script']), determine whether or not it is a data-bearing script---i.e. one with data for the state engine. Return True if so Reurn False if not """ if...
def function[tx_is_data_script, parameter[out_script, blockchain]]: constant[ Given a blockchain name and an output script (tx['outs'][x]['script']), determine whether or not it is a data-bearing script---i.e. one with data for the state engine. Return True if so Reurn False if not ] ...
keyword[def] identifier[tx_is_data_script] ( identifier[out_script] , identifier[blockchain] = literal[string] ,** identifier[blockchain_opts] ): literal[string] keyword[if] identifier[blockchain] == literal[string] : keyword[return] identifier[btc_tx_output_script_has_data] ( identifier[out_scr...
def tx_is_data_script(out_script, blockchain='bitcoin', **blockchain_opts): """ Given a blockchain name and an output script (tx['outs'][x]['script']), determine whether or not it is a data-bearing script---i.e. one with data for the state engine. Return True if so Reurn False if not """ if...
def run(self): """ Perform the actual VASP run. Returns: (subprocess.Popen) Used for monitoring. """ cmd = list(self.vasp_cmd) if self.auto_gamma: vi = VaspInput.from_directory(".") kpts = vi["KPOINTS"] if kpts.style == Kpo...
def function[run, parameter[self]]: constant[ Perform the actual VASP run. Returns: (subprocess.Popen) Used for monitoring. ] variable[cmd] assign[=] call[name[list], parameter[name[self].vasp_cmd]] if name[self].auto_gamma begin[:] variable[v...
keyword[def] identifier[run] ( identifier[self] ): literal[string] identifier[cmd] = identifier[list] ( identifier[self] . identifier[vasp_cmd] ) keyword[if] identifier[self] . identifier[auto_gamma] : identifier[vi] = identifier[VaspInput] . identifier[from_directory] ( lite...
def run(self): """ Perform the actual VASP run. Returns: (subprocess.Popen) Used for monitoring. """ cmd = list(self.vasp_cmd) if self.auto_gamma: vi = VaspInput.from_directory('.') kpts = vi['KPOINTS'] if kpts.style == Kpoints.supported_modes.Gam...
def flexifunction_read_req_encode(self, target_system, target_component, read_req_type, data_index): ''' Reqest reading of flexifunction data target_system : System ID (uint8_t) target_component : Component ID (uint8_t) ...
def function[flexifunction_read_req_encode, parameter[self, target_system, target_component, read_req_type, data_index]]: constant[ Reqest reading of flexifunction data target_system : System ID (uint8_t) target_component : Component ID (uint...
keyword[def] identifier[flexifunction_read_req_encode] ( identifier[self] , identifier[target_system] , identifier[target_component] , identifier[read_req_type] , identifier[data_index] ): literal[string] keyword[return] identifier[MAVLink_flexifunction_read_req_message] ( identifi...
def flexifunction_read_req_encode(self, target_system, target_component, read_req_type, data_index): """ Reqest reading of flexifunction data target_system : System ID (uint8_t) target_component : Component ID (uint8_t) read_req_t...
def merkleroot(hashes): """ Args: hashes: reversed binary form of transactions hashes, e.g.: ``binascii.unhexlify(h)[::-1] for h in block['tx']]`` Returns: merkle root in hexadecimal form """ if len(hashes) == 1: return binascii.hexlify(bytearray(reversed(hashes[0...
def function[merkleroot, parameter[hashes]]: constant[ Args: hashes: reversed binary form of transactions hashes, e.g.: ``binascii.unhexlify(h)[::-1] for h in block['tx']]`` Returns: merkle root in hexadecimal form ] if compare[call[name[len], parameter[name[hashe...
keyword[def] identifier[merkleroot] ( identifier[hashes] ): literal[string] keyword[if] identifier[len] ( identifier[hashes] )== literal[int] : keyword[return] identifier[binascii] . identifier[hexlify] ( identifier[bytearray] ( identifier[reversed] ( identifier[hashes] [ literal[int] ]))) ...
def merkleroot(hashes): """ Args: hashes: reversed binary form of transactions hashes, e.g.: ``binascii.unhexlify(h)[::-1] for h in block['tx']]`` Returns: merkle root in hexadecimal form """ if len(hashes) == 1: return binascii.hexlify(bytearray(reversed(hashes[0...
def modified(self): """Union[datetime.datetime, None]: Datetime at which the dataset was last modified (:data:`None` until set from the server). """ modified_time = self._properties.get("lastModifiedTime") if modified_time is not None: # modified_time will be in milli...
def function[modified, parameter[self]]: constant[Union[datetime.datetime, None]: Datetime at which the dataset was last modified (:data:`None` until set from the server). ] variable[modified_time] assign[=] call[name[self]._properties.get, parameter[constant[lastModifiedTime]]] ...
keyword[def] identifier[modified] ( identifier[self] ): literal[string] identifier[modified_time] = identifier[self] . identifier[_properties] . identifier[get] ( literal[string] ) keyword[if] identifier[modified_time] keyword[is] keyword[not] keyword[None] : keyw...
def modified(self): """Union[datetime.datetime, None]: Datetime at which the dataset was last modified (:data:`None` until set from the server). """ modified_time = self._properties.get('lastModifiedTime') if modified_time is not None: # modified_time will be in milliseconds. ...
def load_from_remote(remote_name, owner=None): """ Loads the data from a remote repository. :param remote_name: The name of the dataset in the remote repository :param owner: (optional) The owner of the dataset. If nothing is provided, the current user is used. For public datasets use 'pu...
def function[load_from_remote, parameter[remote_name, owner]]: constant[ Loads the data from a remote repository. :param remote_name: The name of the dataset in the remote repository :param owner: (optional) The owner of the dataset. If nothing is provided, the current user is used. F...
keyword[def] identifier[load_from_remote] ( identifier[remote_name] , identifier[owner] = keyword[None] ): literal[string] keyword[from] .. keyword[import] identifier[GMQLDataset] identifier[pmg] = identifier[get_python_manager] () identifier[remote_manager] = identifier[get_remote_manager] () ...
def load_from_remote(remote_name, owner=None): """ Loads the data from a remote repository. :param remote_name: The name of the dataset in the remote repository :param owner: (optional) The owner of the dataset. If nothing is provided, the current user is used. For public datasets use 'pu...
def updown(self, increment): """ 屏幕上下滚动 :params incrment: 1 向下滚动 -1 向上滚动 """ scroll_line_num = self.screen_height - 4 # paging if increment == -1 and self.markline == 0 and self.topline != 0: self.topline -= 1 elif in...
def function[updown, parameter[self, increment]]: constant[ 屏幕上下滚动 :params incrment: 1 向下滚动 -1 向上滚动 ] variable[scroll_line_num] assign[=] binary_operation[name[self].screen_height - constant[4]] if <ast.BoolOp object at 0x7da1b2345e70> begin[:] ...
keyword[def] identifier[updown] ( identifier[self] , identifier[increment] ): literal[string] identifier[scroll_line_num] = identifier[self] . identifier[screen_height] - literal[int] keyword[if] identifier[increment] ==- literal[int] keyword[and] identifier[self] . identifier...
def updown(self, increment): """ 屏幕上下滚动 :params incrment: 1 向下滚动 -1 向上滚动 """ scroll_line_num = self.screen_height - 4 # paging if increment == -1 and self.markline == 0 and (self.topline != 0): self.topline -= 1 # depends on [control=['if'], da...
def reweight_run(res, logp_new, logp_old=None): """ Reweight a given run based on a new target distribution. Parameters ---------- res : :class:`~dynesty.results.Results` instance The :class:`~dynesty.results.Results` instance taken from a previous nested sampling run. logp_new...
def function[reweight_run, parameter[res, logp_new, logp_old]]: constant[ Reweight a given run based on a new target distribution. Parameters ---------- res : :class:`~dynesty.results.Results` instance The :class:`~dynesty.results.Results` instance taken from a previous nested s...
keyword[def] identifier[reweight_run] ( identifier[res] , identifier[logp_new] , identifier[logp_old] = keyword[None] ): literal[string] keyword[if] identifier[logp_old] keyword[is] keyword[None] : identifier[logp_old] = identifier[res] [ literal[string] ] identifier[logrwt] = identi...
def reweight_run(res, logp_new, logp_old=None): """ Reweight a given run based on a new target distribution. Parameters ---------- res : :class:`~dynesty.results.Results` instance The :class:`~dynesty.results.Results` instance taken from a previous nested sampling run. logp_new...
def output(self, to=None, *args, **kwargs): '''Outputs to a stream (like a file or request)''' for blok in self: blok.output(to, *args, **kwargs) return self
def function[output, parameter[self, to]]: constant[Outputs to a stream (like a file or request)] for taget[name[blok]] in starred[name[self]] begin[:] call[name[blok].output, parameter[name[to], <ast.Starred object at 0x7da1b0034d90>]] return[name[self]]
keyword[def] identifier[output] ( identifier[self] , identifier[to] = keyword[None] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[for] identifier[blok] keyword[in] identifier[self] : identifier[blok] . identifier[output] ( identifier[to] ,* identifier[args] ,...
def output(self, to=None, *args, **kwargs): """Outputs to a stream (like a file or request)""" for blok in self: blok.output(to, *args, **kwargs) # depends on [control=['for'], data=['blok']] return self
def categorize(self, name, value, criteria, color=None, marker=None, linestyle=None): """Assign scenarios to a category according to specific criteria or display the category assignment Parameters ---------- name: str category column name v...
def function[categorize, parameter[self, name, value, criteria, color, marker, linestyle]]: constant[Assign scenarios to a category according to specific criteria or display the category assignment Parameters ---------- name: str category column name value: s...
keyword[def] identifier[categorize] ( identifier[self] , identifier[name] , identifier[value] , identifier[criteria] , identifier[color] = keyword[None] , identifier[marker] = keyword[None] , identifier[linestyle] = keyword[None] ): literal[string] keyword[for] identifier[kind] , identif...
def categorize(self, name, value, criteria, color=None, marker=None, linestyle=None): """Assign scenarios to a category according to specific criteria or display the category assignment Parameters ---------- name: str category column name value: str c...
def advance_cluster_time(self, cluster_time): """Update the cluster time for this session. :Parameters: - `cluster_time`: The :data:`~pymongo.client_session.ClientSession.cluster_time` from another `ClientSession` instance. """ if not isinstance(cluster...
def function[advance_cluster_time, parameter[self, cluster_time]]: constant[Update the cluster time for this session. :Parameters: - `cluster_time`: The :data:`~pymongo.client_session.ClientSession.cluster_time` from another `ClientSession` instance. ] ...
keyword[def] identifier[advance_cluster_time] ( identifier[self] , identifier[cluster_time] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[cluster_time] , identifier[abc] . identifier[Mapping] ): keyword[raise] identifier[TypeError] ( li...
def advance_cluster_time(self, cluster_time): """Update the cluster time for this session. :Parameters: - `cluster_time`: The :data:`~pymongo.client_session.ClientSession.cluster_time` from another `ClientSession` instance. """ if not isinstance(cluster_time, a...
def debug(self): """Return debug setting""" debug = False if os.path.isfile(os.path.join(self.tcex.args.tc_temp_path, 'DEBUG')): debug = True return debug
def function[debug, parameter[self]]: constant[Return debug setting] variable[debug] assign[=] constant[False] if call[name[os].path.isfile, parameter[call[name[os].path.join, parameter[name[self].tcex.args.tc_temp_path, constant[DEBUG]]]]] begin[:] variable[debug] assign[=] cons...
keyword[def] identifier[debug] ( identifier[self] ): literal[string] identifier[debug] = keyword[False] keyword[if] identifier[os] . identifier[path] . identifier[isfile] ( identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[tcex] . identifier[args] . ide...
def debug(self): """Return debug setting""" debug = False if os.path.isfile(os.path.join(self.tcex.args.tc_temp_path, 'DEBUG')): debug = True # depends on [control=['if'], data=[]] return debug
def deleteInactiveDevicesByAge(self, age_days): """ Delete all inactive devices from the device list storage and cache that are older then a given number of days. This also deletes the corresponding sessions, so if a device comes active again and tries to send you an encrypted message yo...
def function[deleteInactiveDevicesByAge, parameter[self, age_days]]: constant[ Delete all inactive devices from the device list storage and cache that are older then a given number of days. This also deletes the corresponding sessions, so if a device comes active again and tries to send ...
keyword[def] identifier[deleteInactiveDevicesByAge] ( identifier[self] , identifier[age_days] ): literal[string] keyword[if] identifier[age_days] < literal[int] : keyword[return] identifier[now] = identifier[time] . identifier[time] () identifier[bare_jids] = key...
def deleteInactiveDevicesByAge(self, age_days): """ Delete all inactive devices from the device list storage and cache that are older then a given number of days. This also deletes the corresponding sessions, so if a device comes active again and tries to send you an encrypted message you wi...
def _SI(size, K=1024, i='i'): '''Return size as SI string. ''' if 1 < K < size: f = float(size) for si in iter('KMGPTE'): f /= K if f < K: return ' or %.1f %s%sB' % (f, si, i) return ''
def function[_SI, parameter[size, K, i]]: constant[Return size as SI string. ] if compare[constant[1] less[<] name[K]] begin[:] variable[f] assign[=] call[name[float], parameter[name[size]]] for taget[name[si]] in starred[call[name[iter], parameter[constant[KMGPTE]]]]...
keyword[def] identifier[_SI] ( identifier[size] , identifier[K] = literal[int] , identifier[i] = literal[string] ): literal[string] keyword[if] literal[int] < identifier[K] < identifier[size] : identifier[f] = identifier[float] ( identifier[size] ) keyword[for] identifier[si] keyword[i...
def _SI(size, K=1024, i='i'): """Return size as SI string. """ if 1 < K < size: f = float(size) for si in iter('KMGPTE'): f /= K if f < K: return ' or %.1f %s%sB' % (f, si, i) # depends on [control=['if'], data=['f']] # depends on [control=['for'], d...
def insert_before(self, target): """insert this widget into the targets parent before the target""" if not target.parent: return target.parent.insert(target.parent.sprites.index(target), self)
def function[insert_before, parameter[self, target]]: constant[insert this widget into the targets parent before the target] if <ast.UnaryOp object at 0x7da204566920> begin[:] return[None] call[name[target].parent.insert, parameter[call[name[target].parent.sprites.index, parameter[name[t...
keyword[def] identifier[insert_before] ( identifier[self] , identifier[target] ): literal[string] keyword[if] keyword[not] identifier[target] . identifier[parent] : keyword[return] identifier[target] . identifier[parent] . identifier[insert] ( identifier[target] . identifie...
def insert_before(self, target): """insert this widget into the targets parent before the target""" if not target.parent: return # depends on [control=['if'], data=[]] target.parent.insert(target.parent.sprites.index(target), self)
def begin_tag(self, name: str) -> Node: """Save the current index under the given name.""" # Check if we could attach tag cache to current rule_nodes scope self.tag_cache[name] = Tag(self._stream, self._stream.index) return True
def function[begin_tag, parameter[self, name]]: constant[Save the current index under the given name.] call[name[self].tag_cache][name[name]] assign[=] call[name[Tag], parameter[name[self]._stream, name[self]._stream.index]] return[constant[True]]
keyword[def] identifier[begin_tag] ( identifier[self] , identifier[name] : identifier[str] )-> identifier[Node] : literal[string] identifier[self] . identifier[tag_cache] [ identifier[name] ]= identifier[Tag] ( identifier[self] . identifier[_stream] , identifier[self] . identifier[_stream]...
def begin_tag(self, name: str) -> Node: """Save the current index under the given name.""" # Check if we could attach tag cache to current rule_nodes scope self.tag_cache[name] = Tag(self._stream, self._stream.index) return True
def keys(self): """D.keys() -> a set-like object providing a view on D's keys""" return set( row[self._keycol] for row in self._connection.execute( """SELECT DISTINCT {} FROM {} ORDER BY {} ASC;""".format( self.selkeycol, self.table, ...
def function[keys, parameter[self]]: constant[D.keys() -> a set-like object providing a view on D's keys] return[call[name[set], parameter[<ast.GeneratorExp object at 0x7da18bccaf50>]]]
keyword[def] identifier[keys] ( identifier[self] ): literal[string] keyword[return] identifier[set] ( identifier[row] [ identifier[self] . identifier[_keycol] ] keyword[for] identifier[row] keyword[in] identifier[self] . identifier[_connection] . identifier[execute] ( literal[...
def keys(self): """D.keys() -> a set-like object providing a view on D's keys""" return set((row[self._keycol] for row in self._connection.execute('SELECT DISTINCT {} FROM {} ORDER BY {} ASC;'.format(self.selkeycol, self.table, self._keycol))))
def _get_data_volumes(vm_): ''' Construct a list of optional data volumes from the cloud profile ''' ret = [] volumes = vm_['volumes'] for key, value in six.iteritems(volumes): # Verify the required 'disk_size' property is present in the cloud # profile config if 'disk_si...
def function[_get_data_volumes, parameter[vm_]]: constant[ Construct a list of optional data volumes from the cloud profile ] variable[ret] assign[=] list[[]] variable[volumes] assign[=] call[name[vm_]][constant[volumes]] for taget[tuple[[<ast.Name object at 0x7da1b2088a90>, <ast...
keyword[def] identifier[_get_data_volumes] ( identifier[vm_] ): literal[string] identifier[ret] =[] identifier[volumes] = identifier[vm_] [ literal[string] ] keyword[for] identifier[key] , identifier[value] keyword[in] identifier[six] . identifier[iteritems] ( identifier[volumes] ): ...
def _get_data_volumes(vm_): """ Construct a list of optional data volumes from the cloud profile """ ret = [] volumes = vm_['volumes'] for (key, value) in six.iteritems(volumes): # Verify the required 'disk_size' property is present in the cloud # profile config if 'disk_...
def _addrinfo_or_none(contact_point, port): """ A helper function that wraps socket.getaddrinfo and returns None when it fails to, e.g. resolve one of the hostnames. Used to address PYTHON-895. """ try: return socket.getaddrinfo(contact_point, port, sock...
def function[_addrinfo_or_none, parameter[contact_point, port]]: constant[ A helper function that wraps socket.getaddrinfo and returns None when it fails to, e.g. resolve one of the hostnames. Used to address PYTHON-895. ] <ast.Try object at 0x7da1b22af3d0>
keyword[def] identifier[_addrinfo_or_none] ( identifier[contact_point] , identifier[port] ): literal[string] keyword[try] : keyword[return] identifier[socket] . identifier[getaddrinfo] ( identifier[contact_point] , identifier[port] , identifier[socket] . identifier[AF_UNSPEC] , identifie...
def _addrinfo_or_none(contact_point, port): """ A helper function that wraps socket.getaddrinfo and returns None when it fails to, e.g. resolve one of the hostnames. Used to address PYTHON-895. """ try: return socket.getaddrinfo(contact_point, port, socket.AF_UNSPEC, socket.SOCK_STREAM) ...
def ratio(self, internal_standard=None): """ Calculates the ratio of all analytes to a single analyte. Parameters ---------- internal_standard : str The name of the analyte to divide all other analytes by. Returns ------- None ...
def function[ratio, parameter[self, internal_standard]]: constant[ Calculates the ratio of all analytes to a single analyte. Parameters ---------- internal_standard : str The name of the analyte to divide all other analytes by. Returns --...
keyword[def] identifier[ratio] ( identifier[self] , identifier[internal_standard] = keyword[None] ): literal[string] keyword[if] literal[string] keyword[not] keyword[in] identifier[self] . identifier[stages_complete] : keyword[raise] identifier[RuntimeError] ( literal[string] ) ...
def ratio(self, internal_standard=None): """ Calculates the ratio of all analytes to a single analyte. Parameters ---------- internal_standard : str The name of the analyte to divide all other analytes by. Returns ------- None ...
def _output_dir( self, ext, is_instance=False, interpolatable=False, autohinted=False, is_variable=False, ): """Generate an output directory. Args: ext: extension string. is_instance: The output is instance font or ...
def function[_output_dir, parameter[self, ext, is_instance, interpolatable, autohinted, is_variable]]: constant[Generate an output directory. Args: ext: extension string. is_instance: The output is instance font or not. interpolatable: The output is i...
keyword[def] identifier[_output_dir] ( identifier[self] , identifier[ext] , identifier[is_instance] = keyword[False] , identifier[interpolatable] = keyword[False] , identifier[autohinted] = keyword[False] , identifier[is_variable] = keyword[False] , ): literal[string] keyword[assert] keywor...
def _output_dir(self, ext, is_instance=False, interpolatable=False, autohinted=False, is_variable=False): """Generate an output directory. Args: ext: extension string. is_instance: The output is instance font or not. interpolatable: The output is interpol...
def execute(self, command, path=None): """Execute command with os.popen and return output.""" logger = logging.getLogger(__name__) self.check_executable() logger.debug("Executing command `%s` (cwd: %s)" % (command, path)) process = subprocess.Popen( command, ...
def function[execute, parameter[self, command, path]]: constant[Execute command with os.popen and return output.] variable[logger] assign[=] call[name[logging].getLogger, parameter[name[__name__]]] call[name[self].check_executable, parameter[]] call[name[logger].debug, parameter[binary_o...
keyword[def] identifier[execute] ( identifier[self] , identifier[command] , identifier[path] = keyword[None] ): literal[string] identifier[logger] = identifier[logging] . identifier[getLogger] ( identifier[__name__] ) identifier[self] . identifier[check_executable] () identifier[...
def execute(self, command, path=None): """Execute command with os.popen and return output.""" logger = logging.getLogger(__name__) self.check_executable() logger.debug('Executing command `%s` (cwd: %s)' % (command, path)) process = subprocess.Popen(command, shell=True, cwd=path, stdout=subprocess.PI...
def find_vm(self, name): """ Try and find a VM by name :param name: Name of the VM :type name: str """ try: domain = self.hyper.lookupByName(name) VM = VirtualMachine(domain, self) except libvirtError: VM = None return V...
def function[find_vm, parameter[self, name]]: constant[ Try and find a VM by name :param name: Name of the VM :type name: str ] <ast.Try object at 0x7da1b27ea1d0> return[name[VM]]
keyword[def] identifier[find_vm] ( identifier[self] , identifier[name] ): literal[string] keyword[try] : identifier[domain] = identifier[self] . identifier[hyper] . identifier[lookupByName] ( identifier[name] ) identifier[VM] = identifier[VirtualMachine] ( identifier[domai...
def find_vm(self, name): """ Try and find a VM by name :param name: Name of the VM :type name: str """ try: domain = self.hyper.lookupByName(name) VM = VirtualMachine(domain, self) # depends on [control=['try'], data=[]] except libvirtError: VM = None...
def get_psf_pix(self, ra, dec): """ Determine the local psf (a,b,pa) at a given sky location. The psf is in pixel coordinates. Parameters ---------- ra, dec : float The sky position (degrees). Returns ------- a, b, pa : float ...
def function[get_psf_pix, parameter[self, ra, dec]]: constant[ Determine the local psf (a,b,pa) at a given sky location. The psf is in pixel coordinates. Parameters ---------- ra, dec : float The sky position (degrees). Returns ------- ...
keyword[def] identifier[get_psf_pix] ( identifier[self] , identifier[ra] , identifier[dec] ): literal[string] identifier[psf_sky] = identifier[self] . identifier[get_psf_sky] ( identifier[ra] , identifier[dec] ) identifier[psf_pix] = identifier[self] . identifier[wcshelper] . identifier[sk...
def get_psf_pix(self, ra, dec): """ Determine the local psf (a,b,pa) at a given sky location. The psf is in pixel coordinates. Parameters ---------- ra, dec : float The sky position (degrees). Returns ------- a, b, pa : float ...
def const_shuffle(arr, seed=23980): """ Shuffle an array in-place with a fixed seed. """ old_seed = np.random.seed() np.random.seed(seed) np.random.shuffle(arr) np.random.seed(old_seed)
def function[const_shuffle, parameter[arr, seed]]: constant[ Shuffle an array in-place with a fixed seed. ] variable[old_seed] assign[=] call[name[np].random.seed, parameter[]] call[name[np].random.seed, parameter[name[seed]]] call[name[np].random.shuffle, parameter[name[arr]]] ...
keyword[def] identifier[const_shuffle] ( identifier[arr] , identifier[seed] = literal[int] ): literal[string] identifier[old_seed] = identifier[np] . identifier[random] . identifier[seed] () identifier[np] . identifier[random] . identifier[seed] ( identifier[seed] ) identifier[np] . identifier[ra...
def const_shuffle(arr, seed=23980): """ Shuffle an array in-place with a fixed seed. """ old_seed = np.random.seed() np.random.seed(seed) np.random.shuffle(arr) np.random.seed(old_seed)
def build_docker_run_command(configuration): """ Translate a declarative docker `configuration` to a `docker run` command. Parameters ---------- configuration : dict configuration Returns ------- args : list sequence of command line arguments to run a command in a conta...
def function[build_docker_run_command, parameter[configuration]]: constant[ Translate a declarative docker `configuration` to a `docker run` command. Parameters ---------- configuration : dict configuration Returns ------- args : list sequence of command line argume...
keyword[def] identifier[build_docker_run_command] ( identifier[configuration] ): literal[string] identifier[parts] = identifier[configuration] . identifier[pop] ( literal[string] ). identifier[split] () identifier[parts] . identifier[append] ( literal[string] ) identifier[run] = identifier[confi...
def build_docker_run_command(configuration): """ Translate a declarative docker `configuration` to a `docker run` command. Parameters ---------- configuration : dict configuration Returns ------- args : list sequence of command line arguments to run a command in a conta...
def get_identities(self, item): """Return the identities from an item""" item = item['data'] # Changeset owner user = item['owner'] identity = self.get_sh_identity(user) yield identity # Patchset uploader and author if 'patchSets' in item: f...
def function[get_identities, parameter[self, item]]: constant[Return the identities from an item] variable[item] assign[=] call[name[item]][constant[data]] variable[user] assign[=] call[name[item]][constant[owner]] variable[identity] assign[=] call[name[self].get_sh_identity, parameter[n...
keyword[def] identifier[get_identities] ( identifier[self] , identifier[item] ): literal[string] identifier[item] = identifier[item] [ literal[string] ] identifier[user] = identifier[item] [ literal[string] ] identifier[identity] = identifier[self] . identifier[get_sh_i...
def get_identities(self, item): """Return the identities from an item""" item = item['data'] # Changeset owner user = item['owner'] identity = self.get_sh_identity(user) yield identity # Patchset uploader and author if 'patchSets' in item: for patchset in item['patchSets']: ...
def get(self): """API endpoint to retrieve a list of links to transaction outputs. Returns: A :obj:`list` of :cls:`str` of links to outputs. """ parser = reqparse.RequestParser() parser.add_argument('public_key', type=parameters.valid_ed25519, ...
def function[get, parameter[self]]: constant[API endpoint to retrieve a list of links to transaction outputs. Returns: A :obj:`list` of :cls:`str` of links to outputs. ] variable[parser] assign[=] call[name[reqparse].RequestParser, parameter[]] call[n...
keyword[def] identifier[get] ( identifier[self] ): literal[string] identifier[parser] = identifier[reqparse] . identifier[RequestParser] () identifier[parser] . identifier[add_argument] ( literal[string] , identifier[type] = identifier[parameters] . identifier[valid_ed25519] , ide...
def get(self): """API endpoint to retrieve a list of links to transaction outputs. Returns: A :obj:`list` of :cls:`str` of links to outputs. """ parser = reqparse.RequestParser() parser.add_argument('public_key', type=parameters.valid_ed25519, required=True) ...
def from_path(list_of_dir): """Create a new FileCollection and add all files from ``dir_path``. :param list_of_dir: absolute dir path, WinDir instance, list of absolute dir path or list of WinDir instance. **中文文档** 添加dir_path目录下的所有文件到一个新的FileCollec...
def function[from_path, parameter[list_of_dir]]: constant[Create a new FileCollection and add all files from ``dir_path``. :param list_of_dir: absolute dir path, WinDir instance, list of absolute dir path or list of WinDir instance. **中文文档** 添加dir_...
keyword[def] identifier[from_path] ( identifier[list_of_dir] ): literal[string] keyword[if] identifier[isinstance] ( identifier[list_of_dir] , identifier[str] ): identifier[list_of_dir] =[ identifier[list_of_dir] ,] keyword[elif] identifier[isinstance] ( identifier[list_of_d...
def from_path(list_of_dir): """Create a new FileCollection and add all files from ``dir_path``. :param list_of_dir: absolute dir path, WinDir instance, list of absolute dir path or list of WinDir instance. **中文文档** 添加dir_path目录下的所有文件到一个新的FileCollection...
def init(self, advertise_addr=None, listen_addr='0.0.0.0:2377', force_new_cluster=False, default_addr_pool=None, subnet_size=None, **kwargs): """ Initialize a new swarm on this Engine. Args: advertise_addr (str): Externally reachable address advertised to ...
def function[init, parameter[self, advertise_addr, listen_addr, force_new_cluster, default_addr_pool, subnet_size]]: constant[ Initialize a new swarm on this Engine. Args: advertise_addr (str): Externally reachable address advertised to other nodes. This can either b...
keyword[def] identifier[init] ( identifier[self] , identifier[advertise_addr] = keyword[None] , identifier[listen_addr] = literal[string] , identifier[force_new_cluster] = keyword[False] , identifier[default_addr_pool] = keyword[None] , identifier[subnet_size] = keyword[None] ,** identifier[kwargs] ): lite...
def init(self, advertise_addr=None, listen_addr='0.0.0.0:2377', force_new_cluster=False, default_addr_pool=None, subnet_size=None, **kwargs): """ Initialize a new swarm on this Engine. Args: advertise_addr (str): Externally reachable address advertised to other nodes. Th...
def ip_hide_ext_community_list_holder_extcommunity_list_extcommunity_list_num(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") ip = ET.SubElement(config, "ip", xmlns="urn:brocade.com:mgmt:brocade-common-def") hide_ext_community_list_holder = ET.SubElement...
def function[ip_hide_ext_community_list_holder_extcommunity_list_extcommunity_list_num, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[ip] assign[=] call[name[ET].SubElement, parameter[name[config],...
keyword[def] identifier[ip_hide_ext_community_list_holder_extcommunity_list_extcommunity_list_num] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[ip] = identifier[ET] . identifier[SubElem...
def ip_hide_ext_community_list_holder_extcommunity_list_extcommunity_list_num(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') ip = ET.SubElement(config, 'ip', xmlns='urn:brocade.com:mgmt:brocade-common-def') hide_ext_community_list_holder = ET.SubElement(ip, 'hide-ext-c...
def main(): """ Entry point for Ellis. """ # Monkey patch warnings.showwarning: warnings.showwarning = customized_warning # Read command line args, if any: args = read_cmdline() # Configuration file, if given on the command line: config_file = args['config_file'] try: ...
def function[main, parameter[]]: constant[ Entry point for Ellis. ] name[warnings].showwarning assign[=] name[customized_warning] variable[args] assign[=] call[name[read_cmdline], parameter[]] variable[config_file] assign[=] call[name[args]][constant[config_file]] <ast.Try ob...
keyword[def] identifier[main] (): literal[string] identifier[warnings] . identifier[showwarning] = identifier[customized_warning] identifier[args] = identifier[read_cmdline] () identifier[config_file] = identifier[args] [ literal[string] ] keyword[try] : identifie...
def main(): """ Entry point for Ellis. """ # Monkey patch warnings.showwarning: warnings.showwarning = customized_warning # Read command line args, if any: args = read_cmdline() # Configuration file, if given on the command line: config_file = args['config_file'] try: ell...
def file(cls, path, encoding=None, parser=None): """Set a file as a source. File are parsed as literal python dicts by default, this behaviour can be configured. Args: path: The path to the file to be parsed encoding: The encoding of the file. De...
def function[file, parameter[cls, path, encoding, parser]]: constant[Set a file as a source. File are parsed as literal python dicts by default, this behaviour can be configured. Args: path: The path to the file to be parsed encoding: The encoding of the file. ...
keyword[def] identifier[file] ( identifier[cls] , identifier[path] , identifier[encoding] = keyword[None] , identifier[parser] = keyword[None] ): literal[string] identifier[cls] . identifier[__hierarchy] . identifier[append] ( identifier[file] . identifier[File] ( identifier[path] , identifier[enco...
def file(cls, path, encoding=None, parser=None): """Set a file as a source. File are parsed as literal python dicts by default, this behaviour can be configured. Args: path: The path to the file to be parsed encoding: The encoding of the file. Defaul...
def trace_scan(loop_fn, initial_state, elems, trace_fn, parallel_iterations=10, name=None): """A simplified version of `tf.scan` that has configurable tracing. This function repeatedly calls `loop_fn(state, elem)`, where `state` is the `i...
def function[trace_scan, parameter[loop_fn, initial_state, elems, trace_fn, parallel_iterations, name]]: constant[A simplified version of `tf.scan` that has configurable tracing. This function repeatedly calls `loop_fn(state, elem)`, where `state` is the `initial_state` during the first iteration, and the ...
keyword[def] identifier[trace_scan] ( identifier[loop_fn] , identifier[initial_state] , identifier[elems] , identifier[trace_fn] , identifier[parallel_iterations] = literal[int] , identifier[name] = keyword[None] ): literal[string] keyword[with] identifier[tf] . identifier[compat] . identifier[v1] . iden...
def trace_scan(loop_fn, initial_state, elems, trace_fn, parallel_iterations=10, name=None): """A simplified version of `tf.scan` that has configurable tracing. This function repeatedly calls `loop_fn(state, elem)`, where `state` is the `initial_state` during the first iteration, and the return value of `loop_f...
def insert(table, datas, avoid_conflict=False): """ Insert row from datas :param table: Safe table name :param datas: List of dicts. :param avoid_conflict: Allows ignoring error if already exists (do nothing then) :return: """ if avoid_conflict: debut...
def function[insert, parameter[table, datas, avoid_conflict]]: constant[ Insert row from datas :param table: Safe table name :param datas: List of dicts. :param avoid_conflict: Allows ignoring error if already exists (do nothing then) :return: ] if name[avoid_con...
keyword[def] identifier[insert] ( identifier[table] , identifier[datas] , identifier[avoid_conflict] = keyword[False] ): literal[string] keyword[if] identifier[avoid_conflict] : identifier[debut] = literal[string] keyword[else] : identifier[debut] = literal[stri...
def insert(table, datas, avoid_conflict=False): """ Insert row from datas :param table: Safe table name :param datas: List of dicts. :param avoid_conflict: Allows ignoring error if already exists (do nothing then) :return: """ if avoid_conflict: debut = 'INSERT I...
def as_a_dict(self): """ Displays the index as a dictionary. This includes the design document id, index name, index type, and index definition. :returns: Dictionary representation of the index as a dictionary """ index_dict = { 'ddoc': self._ddoc_id, ...
def function[as_a_dict, parameter[self]]: constant[ Displays the index as a dictionary. This includes the design document id, index name, index type, and index definition. :returns: Dictionary representation of the index as a dictionary ] variable[index_dict] assign[=] ...
keyword[def] identifier[as_a_dict] ( identifier[self] ): literal[string] identifier[index_dict] ={ literal[string] : identifier[self] . identifier[_ddoc_id] , literal[string] : identifier[self] . identifier[_name] , literal[string] : identifier[self] . identifier[_type] ,...
def as_a_dict(self): """ Displays the index as a dictionary. This includes the design document id, index name, index type, and index definition. :returns: Dictionary representation of the index as a dictionary """ index_dict = {'ddoc': self._ddoc_id, 'name': self._name, 'type':...
def has_departure_delay(self, subpartcheck=True): """ Deprecated """ if self.status != 'VOLGENS-PLAN': return True if subpartcheck and self.trip_parts[0].has_delay: return True if self.requested_time != self.departure_time_actual: retur...
def function[has_departure_delay, parameter[self, subpartcheck]]: constant[ Deprecated ] if compare[name[self].status not_equal[!=] constant[VOLGENS-PLAN]] begin[:] return[constant[True]] if <ast.BoolOp object at 0x7da1b1d210f0> begin[:] return[constant[True]] ...
keyword[def] identifier[has_departure_delay] ( identifier[self] , identifier[subpartcheck] = keyword[True] ): literal[string] keyword[if] identifier[self] . identifier[status] != literal[string] : keyword[return] keyword[True] keyword[if] identifier[subpartcheck] keyword[...
def has_departure_delay(self, subpartcheck=True): """ Deprecated """ if self.status != 'VOLGENS-PLAN': return True # depends on [control=['if'], data=[]] if subpartcheck and self.trip_parts[0].has_delay: return True # depends on [control=['if'], data=[]] if self.request...
def qsize(self, qname): """Return the approximate size of the queue.""" if qname in self._queues: return self._queues[qname].qsize() else: raise ValueError(_("queue %s is not defined"), qname)
def function[qsize, parameter[self, qname]]: constant[Return the approximate size of the queue.] if compare[name[qname] in name[self]._queues] begin[:] return[call[call[name[self]._queues][name[qname]].qsize, parameter[]]]
keyword[def] identifier[qsize] ( identifier[self] , identifier[qname] ): literal[string] keyword[if] identifier[qname] keyword[in] identifier[self] . identifier[_queues] : keyword[return] identifier[self] . identifier[_queues] [ identifier[qname] ]. identifier[qsize] () ke...
def qsize(self, qname): """Return the approximate size of the queue.""" if qname in self._queues: return self._queues[qname].qsize() # depends on [control=['if'], data=['qname']] else: raise ValueError(_('queue %s is not defined'), qname)
def _ensure_values(data: Mapping[str, Any]) -> Tuple[Dict[str, Any], bool]: """ Make sure we have appropriate keys and say if we should write """ to_return = {} should_write = False for keyname, typekind, default in REQUIRED_DATA: if keyname not in data: LOG.debug(f"Defaulted config ...
def function[_ensure_values, parameter[data]]: constant[ Make sure we have appropriate keys and say if we should write ] variable[to_return] assign[=] dictionary[[], []] variable[should_write] assign[=] constant[False] for taget[tuple[[<ast.Name object at 0x7da1b0927280>, <ast.Name objec...
keyword[def] identifier[_ensure_values] ( identifier[data] : identifier[Mapping] [ identifier[str] , identifier[Any] ])-> identifier[Tuple] [ identifier[Dict] [ identifier[str] , identifier[Any] ], identifier[bool] ]: literal[string] identifier[to_return] ={} identifier[should_write] = keyword[False] ...
def _ensure_values(data: Mapping[str, Any]) -> Tuple[Dict[str, Any], bool]: """ Make sure we have appropriate keys and say if we should write """ to_return = {} should_write = False for (keyname, typekind, default) in REQUIRED_DATA: if keyname not in data: LOG.debug(f'Defaulted confi...
def valid_arxiv_categories(): """List of all arXiv categories that ever existed. Example: >>> from inspire_schemas.utils import valid_arxiv_categories >>> 'funct-an' in valid_arxiv_categories() True """ schema = load_schema('elements/arxiv_categories') categories = schema['...
def function[valid_arxiv_categories, parameter[]]: constant[List of all arXiv categories that ever existed. Example: >>> from inspire_schemas.utils import valid_arxiv_categories >>> 'funct-an' in valid_arxiv_categories() True ] variable[schema] assign[=] call[name[load_...
keyword[def] identifier[valid_arxiv_categories] (): literal[string] identifier[schema] = identifier[load_schema] ( literal[string] ) identifier[categories] = identifier[schema] [ literal[string] ] identifier[categories] . identifier[extend] ( identifier[_NEW_CATEGORIES] . identifier[keys] ()) ...
def valid_arxiv_categories(): """List of all arXiv categories that ever existed. Example: >>> from inspire_schemas.utils import valid_arxiv_categories >>> 'funct-an' in valid_arxiv_categories() True """ schema = load_schema('elements/arxiv_categories') categories = schema['...
def select_many(self, projector, selector=identity): '''Projects each element of a sequence to an intermediate new sequence, flattens the resulting sequence into one sequence and optionally transforms the flattened sequence using a selector function. Args: projector: A...
def function[select_many, parameter[self, projector, selector]]: constant[Projects each element of a sequence to an intermediate new sequence, flattens the resulting sequence into one sequence and optionally transforms the flattened sequence using a selector function. Args: ...
keyword[def] identifier[select_many] ( identifier[self] , identifier[projector] , identifier[selector] = identifier[identity] ): literal[string] identifier[sequences] =( identifier[self] . identifier[_create] ( identifier[item] ). identifier[select] ( identifier[projector] ) keyword[for] identif...
def select_many(self, projector, selector=identity): """Projects each element of a sequence to an intermediate new sequence, flattens the resulting sequence into one sequence and optionally transforms the flattened sequence using a selector function. Args: projector: A unary fun...
def fcoe_get_interface_output_fcoe_intf_list_fcoe_intf_peer_fcf_mac(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") fcoe_get_interface = ET.Element("fcoe_get_interface") config = fcoe_get_interface output = ET.SubElement(fcoe_get_interface, "outp...
def function[fcoe_get_interface_output_fcoe_intf_list_fcoe_intf_peer_fcf_mac, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[fcoe_get_interface] assign[=] call[name[ET].Element, parameter[constant[f...
keyword[def] identifier[fcoe_get_interface_output_fcoe_intf_list_fcoe_intf_peer_fcf_mac] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[fcoe_get_interface] = identifier[ET] . identifier[E...
def fcoe_get_interface_output_fcoe_intf_list_fcoe_intf_peer_fcf_mac(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') fcoe_get_interface = ET.Element('fcoe_get_interface') config = fcoe_get_interface output = ET.SubElement(fcoe_get_interface, 'output') fcoe_intf_l...
def limit(self, limit): """ Limit the number of rows returned from the database. :param limit: The number of rows to return in the recipe. 0 will return all rows. :type limit: int """ if self._limit != limit: self.dirty = True self._...
def function[limit, parameter[self, limit]]: constant[ Limit the number of rows returned from the database. :param limit: The number of rows to return in the recipe. 0 will return all rows. :type limit: int ] if compare[name[self]._limit not_equal[!=] name[...
keyword[def] identifier[limit] ( identifier[self] , identifier[limit] ): literal[string] keyword[if] identifier[self] . identifier[_limit] != identifier[limit] : identifier[self] . identifier[dirty] = keyword[True] identifier[self] . identifier[_limit] = identifier[limit...
def limit(self, limit): """ Limit the number of rows returned from the database. :param limit: The number of rows to return in the recipe. 0 will return all rows. :type limit: int """ if self._limit != limit: self.dirty = True self._limit = limit #...
def get(self, resource_id=None, resource_action=None, resource_cls=None, single_resource=False): """ Gets the details for one or more resources by ID Args: cls - gophish.models.Model - The resource class resource_id - str - The end...
def function[get, parameter[self, resource_id, resource_action, resource_cls, single_resource]]: constant[ Gets the details for one or more resources by ID Args: cls - gophish.models.Model - The resource class resource_id - str - The endpoint (URL path) for the resource ...
keyword[def] identifier[get] ( identifier[self] , identifier[resource_id] = keyword[None] , identifier[resource_action] = keyword[None] , identifier[resource_cls] = keyword[None] , identifier[single_resource] = keyword[False] ): literal[string] identifier[endpoint] = identifier[self] . identif...
def get(self, resource_id=None, resource_action=None, resource_cls=None, single_resource=False): """ Gets the details for one or more resources by ID Args: cls - gophish.models.Model - The resource class resource_id - str - The endpoint (URL path) for the resource resour...
def __construct_byset(self, start, byxxx, base): """ If a `BYXXX` sequence is passed to the constructor at the same level as `FREQ` (e.g. `FREQ=HOURLY,BYHOUR={2,4,7},INTERVAL=3`), there are some specifications which cannot be reached given some starting conditions. This occurs w...
def function[__construct_byset, parameter[self, start, byxxx, base]]: constant[ If a `BYXXX` sequence is passed to the constructor at the same level as `FREQ` (e.g. `FREQ=HOURLY,BYHOUR={2,4,7},INTERVAL=3`), there are some specifications which cannot be reached given some starting conditi...
keyword[def] identifier[__construct_byset] ( identifier[self] , identifier[start] , identifier[byxxx] , identifier[base] ): literal[string] identifier[cset] = identifier[set] () keyword[if] identifier[isinstance] ( identifier[byxxx] , identifier[integer_types] ): i...
def __construct_byset(self, start, byxxx, base): """ If a `BYXXX` sequence is passed to the constructor at the same level as `FREQ` (e.g. `FREQ=HOURLY,BYHOUR={2,4,7},INTERVAL=3`), there are some specifications which cannot be reached given some starting conditions. This occurs whene...
def calculate_tensor_to_probability_map_output_shapes(operator): ''' Allowed input/output patterns are ONNX < 1.2 1. [1, C] ---> ---> A map 2. [1, C_1, ..., C_n] ---> A map ONNX >= 1.2 1. [N, C] ---> ---> A sequence of maps 2. [N, C_1, ..., C_n] ---> A sequence of maps ...
def function[calculate_tensor_to_probability_map_output_shapes, parameter[operator]]: constant[ Allowed input/output patterns are ONNX < 1.2 1. [1, C] ---> ---> A map 2. [1, C_1, ..., C_n] ---> A map ONNX >= 1.2 1. [N, C] ---> ---> A sequence of maps 2. [N, C_1, ..., ...
keyword[def] identifier[calculate_tensor_to_probability_map_output_shapes] ( identifier[operator] ): literal[string] identifier[check_input_and_output_numbers] ( identifier[operator] , identifier[input_count_range] = literal[int] , identifier[output_count_range] = literal[int] ) identifier[check_input...
def calculate_tensor_to_probability_map_output_shapes(operator): """ Allowed input/output patterns are ONNX < 1.2 1. [1, C] ---> ---> A map 2. [1, C_1, ..., C_n] ---> A map ONNX >= 1.2 1. [N, C] ---> ---> A sequence of maps 2. [N, C_1, ..., C_n] ---> A sequence of maps ...
def sync(self): """ Upload the changed registers to the chip This will check which register have been changed since the last sync and send them to the chip. You need to call this method if you modify one of the register attributes (mcp23017.IODIRA for example) or if you use one of the h...
def function[sync, parameter[self]]: constant[ Upload the changed registers to the chip This will check which register have been changed since the last sync and send them to the chip. You need to call this method if you modify one of the register attributes (mcp23017.IODIRA for example) or ...
keyword[def] identifier[sync] ( identifier[self] ): literal[string] identifier[registers] ={ literal[int] : literal[string] , literal[int] : literal[string] , literal[int] : literal[string] , literal[int] : literal[string] , literal[int] : literal[string...
def sync(self): """ Upload the changed registers to the chip This will check which register have been changed since the last sync and send them to the chip. You need to call this method if you modify one of the register attributes (mcp23017.IODIRA for example) or if you use one of the helpe...
def add_subsegment(self, subsegment): """ Add input subsegment as a child subsegment. """ self._check_ended() subsegment.parent_id = self.id self.subsegments.append(subsegment)
def function[add_subsegment, parameter[self, subsegment]]: constant[ Add input subsegment as a child subsegment. ] call[name[self]._check_ended, parameter[]] name[subsegment].parent_id assign[=] name[self].id call[name[self].subsegments.append, parameter[name[subsegment]]...
keyword[def] identifier[add_subsegment] ( identifier[self] , identifier[subsegment] ): literal[string] identifier[self] . identifier[_check_ended] () identifier[subsegment] . identifier[parent_id] = identifier[self] . identifier[id] identifier[self] . identifier[subsegments] . id...
def add_subsegment(self, subsegment): """ Add input subsegment as a child subsegment. """ self._check_ended() subsegment.parent_id = self.id self.subsegments.append(subsegment)
def get_conversion_factor(self, new_unit): """ Returns a conversion factor between this unit and a new unit. Compound units are supported, but must have the same powers in each unit type. Args: new_unit: The new unit. """ uo_base, ofactor = self.as_ba...
def function[get_conversion_factor, parameter[self, new_unit]]: constant[ Returns a conversion factor between this unit and a new unit. Compound units are supported, but must have the same powers in each unit type. Args: new_unit: The new unit. ] <ast...
keyword[def] identifier[get_conversion_factor] ( identifier[self] , identifier[new_unit] ): literal[string] identifier[uo_base] , identifier[ofactor] = identifier[self] . identifier[as_base_units] identifier[un_base] , identifier[nfactor] = identifier[Unit] ( identifier[new_unit] ). ident...
def get_conversion_factor(self, new_unit): """ Returns a conversion factor between this unit and a new unit. Compound units are supported, but must have the same powers in each unit type. Args: new_unit: The new unit. """ (uo_base, ofactor) = self.as_base_uni...
def update_fw(self, nids, fw_type, fw_ver, fw_path=None): """Update firwmare of all node_ids in nids.""" fw_bin = None if fw_path: fw_bin = load_fw(fw_path) if not fw_bin: return self.ota.make_update(nids, fw_type, fw_ver, fw_bin)
def function[update_fw, parameter[self, nids, fw_type, fw_ver, fw_path]]: constant[Update firwmare of all node_ids in nids.] variable[fw_bin] assign[=] constant[None] if name[fw_path] begin[:] variable[fw_bin] assign[=] call[name[load_fw], parameter[name[fw_path]]] ...
keyword[def] identifier[update_fw] ( identifier[self] , identifier[nids] , identifier[fw_type] , identifier[fw_ver] , identifier[fw_path] = keyword[None] ): literal[string] identifier[fw_bin] = keyword[None] keyword[if] identifier[fw_path] : identifier[fw_bin] = identifier[l...
def update_fw(self, nids, fw_type, fw_ver, fw_path=None): """Update firwmare of all node_ids in nids.""" fw_bin = None if fw_path: fw_bin = load_fw(fw_path) if not fw_bin: return # depends on [control=['if'], data=[]] # depends on [control=['if'], data=[]] self.ota.make_upd...
async def pin_6_pwm_128(my_board): """ Set digital pin 6 as a PWM output and set its output value to 128 @param my_board: A PymataCore instance @return: No Return Value """ # set the pin mode await my_board.set_pin_mode(6, Constants.PWM) # set the pin to 128 await my_board.analog_wr...
<ast.AsyncFunctionDef object at 0x7da18eb54550>
keyword[async] keyword[def] identifier[pin_6_pwm_128] ( identifier[my_board] ): literal[string] keyword[await] identifier[my_board] . identifier[set_pin_mode] ( literal[int] , identifier[Constants] . identifier[PWM] ) keyword[await] identifier[my_board] . identifier[analog_write] ( liter...
async def pin_6_pwm_128(my_board): """ Set digital pin 6 as a PWM output and set its output value to 128 @param my_board: A PymataCore instance @return: No Return Value """ # set the pin mode await my_board.set_pin_mode(6, Constants.PWM) # set the pin to 128 await my_board.analog_wri...
def valid_words_set(path_to_user_dictionary=None, user_dictionary_words=None): """Get a set of valid words. If :path_to_user_dictionary: is specified, then the newline-separated words in that file will be added to the word set. """ def read_file(binary_file): """Read a b...
def function[valid_words_set, parameter[path_to_user_dictionary, user_dictionary_words]]: constant[Get a set of valid words. If :path_to_user_dictionary: is specified, then the newline-separated words in that file will be added to the word set. ] def function[read_file, parameter[binary_fil...
keyword[def] identifier[valid_words_set] ( identifier[path_to_user_dictionary] = keyword[None] , identifier[user_dictionary_words] = keyword[None] ): literal[string] keyword[def] identifier[read_file] ( identifier[binary_file] ): literal[string] keyword[return] identifier[binary_file]...
def valid_words_set(path_to_user_dictionary=None, user_dictionary_words=None): """Get a set of valid words. If :path_to_user_dictionary: is specified, then the newline-separated words in that file will be added to the word set. """ def read_file(binary_file): """Read a binary file for its ...
def set_time(self, time): ''' Converts time data into a pandas date object. Parameters ---------- time: netcdf Contains time information. Returns ------- pandas.DatetimeIndex ''' times = num2date(time[:].squeeze(), time.units)...
def function[set_time, parameter[self, time]]: constant[ Converts time data into a pandas date object. Parameters ---------- time: netcdf Contains time information. Returns ------- pandas.DatetimeIndex ] variable[times] assign...
keyword[def] identifier[set_time] ( identifier[self] , identifier[time] ): literal[string] identifier[times] = identifier[num2date] ( identifier[time] [:]. identifier[squeeze] (), identifier[time] . identifier[units] ) identifier[self] . identifier[time] = identifier[pd] . identifier[Datet...
def set_time(self, time): """ Converts time data into a pandas date object. Parameters ---------- time: netcdf Contains time information. Returns ------- pandas.DatetimeIndex """ times = num2date(time[:].squeeze(), time.units) sel...
def sign(self, data, b64=True): """Sign data with the private key and return the signed data. The signed data will be Base64 encoded if b64 is True. """ padder = padding.PKCS1v15() signer = self.private_key.signer(padder, None) if not isinstance(data, six.binary_type): ...
def function[sign, parameter[self, data, b64]]: constant[Sign data with the private key and return the signed data. The signed data will be Base64 encoded if b64 is True. ] variable[padder] assign[=] call[name[padding].PKCS1v15, parameter[]] variable[signer] assign[=] call[name[...
keyword[def] identifier[sign] ( identifier[self] , identifier[data] , identifier[b64] = keyword[True] ): literal[string] identifier[padder] = identifier[padding] . identifier[PKCS1v15] () identifier[signer] = identifier[self] . identifier[private_key] . identifier[signer] ( identifier[padd...
def sign(self, data, b64=True): """Sign data with the private key and return the signed data. The signed data will be Base64 encoded if b64 is True. """ padder = padding.PKCS1v15() signer = self.private_key.signer(padder, None) if not isinstance(data, six.binary_type): data = da...
def DeleteUserDefinedFunction(self, udf_link, options=None): """Deletes a user defined function. :param str udf_link: The link to the user defined function. :param dict options: The request options for the request. :return: The deleted UDF. :...
def function[DeleteUserDefinedFunction, parameter[self, udf_link, options]]: constant[Deletes a user defined function. :param str udf_link: The link to the user defined function. :param dict options: The request options for the request. :return: The ...
keyword[def] identifier[DeleteUserDefinedFunction] ( identifier[self] , identifier[udf_link] , identifier[options] = keyword[None] ): literal[string] keyword[if] identifier[options] keyword[is] keyword[None] : identifier[options] ={} identifier[path] = identifier[base] . i...
def DeleteUserDefinedFunction(self, udf_link, options=None): """Deletes a user defined function. :param str udf_link: The link to the user defined function. :param dict options: The request options for the request. :return: The deleted UDF. :rtyp...
def sample(self): "Return a random sample from the distribution." if self.sampler is None: self.sampler = weighted_sampler(self.dictionary.keys(), self.dictionary.values()) return self.sampler()
def function[sample, parameter[self]]: constant[Return a random sample from the distribution.] if compare[name[self].sampler is constant[None]] begin[:] name[self].sampler assign[=] call[name[weighted_sampler], parameter[call[name[self].dictionary.keys, parameter[]], call[name[self].dict...
keyword[def] identifier[sample] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[sampler] keyword[is] keyword[None] : identifier[self] . identifier[sampler] = identifier[weighted_sampler] ( identifier[self] . identifier[dictionary] . identifier[keys] (...
def sample(self): """Return a random sample from the distribution.""" if self.sampler is None: self.sampler = weighted_sampler(self.dictionary.keys(), self.dictionary.values()) # depends on [control=['if'], data=[]] return self.sampler()
def sapm_effective_irradiance(self, poa_direct, poa_diffuse, airmass_absolute, aoi, reference_irradiance=1000): """ Use the :py:func:`sapm_effective_irradiance` function, the input parameters, and ``self.module_parameters`` to c...
def function[sapm_effective_irradiance, parameter[self, poa_direct, poa_diffuse, airmass_absolute, aoi, reference_irradiance]]: constant[ Use the :py:func:`sapm_effective_irradiance` function, the input parameters, and ``self.module_parameters`` to calculate effective irradiance. ...
keyword[def] identifier[sapm_effective_irradiance] ( identifier[self] , identifier[poa_direct] , identifier[poa_diffuse] , identifier[airmass_absolute] , identifier[aoi] , identifier[reference_irradiance] = literal[int] ): literal[string] keyword[return] identifier[sapm_effective_irradiance] ( ...
def sapm_effective_irradiance(self, poa_direct, poa_diffuse, airmass_absolute, aoi, reference_irradiance=1000): """ Use the :py:func:`sapm_effective_irradiance` function, the input parameters, and ``self.module_parameters`` to calculate effective irradiance. Parameters -----...
def Find(self, node_type, item_type): ''' method for finding specific types of notation from nodes. will currently return the first one it encounters because this method's only really intended for some types of notation for which the exact value doesn't really matter. :...
def function[Find, parameter[self, node_type, item_type]]: constant[ method for finding specific types of notation from nodes. will currently return the first one it encounters because this method's only really intended for some types of notation for which the exact value doesn't really ...
keyword[def] identifier[Find] ( identifier[self] , identifier[node_type] , identifier[item_type] ): literal[string] keyword[if] identifier[node_type] == identifier[OtherNodes] . identifier[DirectionNode] : identifier[child] = identifier[self] . identifier[GetChild] ( identifier[len] ...
def Find(self, node_type, item_type): """ method for finding specific types of notation from nodes. will currently return the first one it encounters because this method's only really intended for some types of notation for which the exact value doesn't really matter. :para...
def som_get_capture_objects(som_pointer): """! @brief Returns list of indexes of captured objects by each neuron. @param[in] som_pointer (c_pointer): pointer to object of self-organized map. """ ccore = ccore_library.get() ccore.som_get_capture_objects.restype = POI...
def function[som_get_capture_objects, parameter[som_pointer]]: constant[! @brief Returns list of indexes of captured objects by each neuron. @param[in] som_pointer (c_pointer): pointer to object of self-organized map. ] variable[ccore] assign[=] call[name[ccore_library].get, parame...
keyword[def] identifier[som_get_capture_objects] ( identifier[som_pointer] ): literal[string] identifier[ccore] = identifier[ccore_library] . identifier[get] () identifier[ccore] . identifier[som_get_capture_objects] . identifier[restype] = identifier[POINTER] ( identifier[pyclustering_package]...
def som_get_capture_objects(som_pointer): """! @brief Returns list of indexes of captured objects by each neuron. @param[in] som_pointer (c_pointer): pointer to object of self-organized map. """ ccore = ccore_library.get() ccore.som_get_capture_objects.restype = POINTER(pyclustering_pa...
def export_for_schema(self): """ Returns a string version of these replication options which are suitable for use in a CREATE KEYSPACE statement. """ if self.options_map: return dict((str(key), str(value)) for key, value in self.options_map.items()) return "{'...
def function[export_for_schema, parameter[self]]: constant[ Returns a string version of these replication options which are suitable for use in a CREATE KEYSPACE statement. ] if name[self].options_map begin[:] return[call[name[dict], parameter[<ast.GeneratorExp object at ...
keyword[def] identifier[export_for_schema] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[options_map] : keyword[return] identifier[dict] (( identifier[str] ( identifier[key] ), identifier[str] ( identifier[value] )) keyword[for] identifier[key] , id...
def export_for_schema(self): """ Returns a string version of these replication options which are suitable for use in a CREATE KEYSPACE statement. """ if self.options_map: return dict(((str(key), str(value)) for (key, value) in self.options_map.items())) # depends on [control=['i...
def mark_dead(self, connection, now=None): """ Mark the connection as dead (failed). Remove it from the live pool and put it on a timeout. :arg connection: the failed instance """ # allow inject for testing purposes now = now if now else time.time() try: ...
def function[mark_dead, parameter[self, connection, now]]: constant[ Mark the connection as dead (failed). Remove it from the live pool and put it on a timeout. :arg connection: the failed instance ] variable[now] assign[=] <ast.IfExp object at 0x7da20e956e00> <ast.T...
keyword[def] identifier[mark_dead] ( identifier[self] , identifier[connection] , identifier[now] = keyword[None] ): literal[string] identifier[now] = identifier[now] keyword[if] identifier[now] keyword[else] identifier[time] . identifier[time] () keyword[try] : id...
def mark_dead(self, connection, now=None): """ Mark the connection as dead (failed). Remove it from the live pool and put it on a timeout. :arg connection: the failed instance """ # allow inject for testing purposes now = now if now else time.time() try: self.con...
def create(name='local'): """Creates a new KVStore. For single machine training, there are two commonly used types: ``local``: Copies all gradients to CPU memory and updates weights there. ``device``: Aggregates gradients and updates weights on GPUs. With this setting, the KVStore also attempts t...
def function[create, parameter[name]]: constant[Creates a new KVStore. For single machine training, there are two commonly used types: ``local``: Copies all gradients to CPU memory and updates weights there. ``device``: Aggregates gradients and updates weights on GPUs. With this setting, the ...
keyword[def] identifier[create] ( identifier[name] = literal[string] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[name] , identifier[string_types] ): keyword[raise] identifier[TypeError] ( literal[string] ) identifier[handle] = identifier[KVStoreHandle] (...
def create(name='local'): """Creates a new KVStore. For single machine training, there are two commonly used types: ``local``: Copies all gradients to CPU memory and updates weights there. ``device``: Aggregates gradients and updates weights on GPUs. With this setting, the KVStore also attempts t...
def sensor_bias_encode(self, axBias, ayBias, azBias, gxBias, gyBias, gzBias): ''' Accelerometer and gyro biases. axBias : Accelerometer X bias (m/s) (float) ayBias : Accelerometer Y bias (m/s) (float) ...
def function[sensor_bias_encode, parameter[self, axBias, ayBias, azBias, gxBias, gyBias, gzBias]]: constant[ Accelerometer and gyro biases. axBias : Accelerometer X bias (m/s) (float) ayBias : Accelerometer Y bias (m/s) (floa...
keyword[def] identifier[sensor_bias_encode] ( identifier[self] , identifier[axBias] , identifier[ayBias] , identifier[azBias] , identifier[gxBias] , identifier[gyBias] , identifier[gzBias] ): literal[string] keyword[return] identifier[MAVLink_sensor_bias_message] ( identifier[axBia...
def sensor_bias_encode(self, axBias, ayBias, azBias, gxBias, gyBias, gzBias): """ Accelerometer and gyro biases. axBias : Accelerometer X bias (m/s) (float) ayBias : Accelerometer Y bias (m/s) (float) azBias ...
def perform_put(self, path, body, x_ms_version=None): ''' Performs a PUT request and returns the response. path: Path to the resource. Ex: '/<subscription-id>/services/hostedservices/<service-name>' body: Body for the PUT request. x_ms_version...
def function[perform_put, parameter[self, path, body, x_ms_version]]: constant[ Performs a PUT request and returns the response. path: Path to the resource. Ex: '/<subscription-id>/services/hostedservices/<service-name>' body: Body for the PUT request...
keyword[def] identifier[perform_put] ( identifier[self] , identifier[path] , identifier[body] , identifier[x_ms_version] = keyword[None] ): literal[string] identifier[request] = identifier[HTTPRequest] () identifier[request] . identifier[method] = literal[string] identifier[reque...
def perform_put(self, path, body, x_ms_version=None): """ Performs a PUT request and returns the response. path: Path to the resource. Ex: '/<subscription-id>/services/hostedservices/<service-name>' body: Body for the PUT request. x_ms_version: ...
def get_os_filename (path): """Return filesystem path for given URL path.""" if os.name == 'nt': path = prepare_urlpath_for_nt(path) res = urllib.url2pathname(fileutil.pathencode(path)) if os.name == 'nt' and res.endswith(':') and len(res) == 2: # Work around http://bugs.python.org/issue...
def function[get_os_filename, parameter[path]]: constant[Return filesystem path for given URL path.] if compare[name[os].name equal[==] constant[nt]] begin[:] variable[path] assign[=] call[name[prepare_urlpath_for_nt], parameter[name[path]]] variable[res] assign[=] call[name[urll...
keyword[def] identifier[get_os_filename] ( identifier[path] ): literal[string] keyword[if] identifier[os] . identifier[name] == literal[string] : identifier[path] = identifier[prepare_urlpath_for_nt] ( identifier[path] ) identifier[res] = identifier[urllib] . identifier[url2pathname] ( ident...
def get_os_filename(path): """Return filesystem path for given URL path.""" if os.name == 'nt': path = prepare_urlpath_for_nt(path) # depends on [control=['if'], data=[]] res = urllib.url2pathname(fileutil.pathencode(path)) if os.name == 'nt' and res.endswith(':') and (len(res) == 2): #...
def gfrefn(t1, t2, s1, s2): """ For those times when we can't do better, we use a bisection method to find the next time at which to test for state change. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfrefn_c.html :param t1: One of two values bracketing a state change. :type t1: fl...
def function[gfrefn, parameter[t1, t2, s1, s2]]: constant[ For those times when we can't do better, we use a bisection method to find the next time at which to test for state change. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfrefn_c.html :param t1: One of two values bracketing a...
keyword[def] identifier[gfrefn] ( identifier[t1] , identifier[t2] , identifier[s1] , identifier[s2] ): literal[string] identifier[t1] = identifier[ctypes] . identifier[c_double] ( identifier[t1] ) identifier[t2] = identifier[ctypes] . identifier[c_double] ( identifier[t2] ) identifier[s1] = ident...
def gfrefn(t1, t2, s1, s2): """ For those times when we can't do better, we use a bisection method to find the next time at which to test for state change. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfrefn_c.html :param t1: One of two values bracketing a state change. :type t1: fl...
def parent_callback(self, parent_fu): """Callback from executor future to update the parent. Args: - parent_fu (Future): Future returned by the executor along with callback Returns: - None Updates the super() with the result() or exception() """ ...
def function[parent_callback, parameter[self, parent_fu]]: constant[Callback from executor future to update the parent. Args: - parent_fu (Future): Future returned by the executor along with callback Returns: - None Updates the super() with the result() or exce...
keyword[def] identifier[parent_callback] ( identifier[self] , identifier[parent_fu] ): literal[string] keyword[if] identifier[parent_fu] . identifier[done] () keyword[is] keyword[True] : identifier[e] = identifier[parent_fu] . identifier[_exception] keyword[if] identif...
def parent_callback(self, parent_fu): """Callback from executor future to update the parent. Args: - parent_fu (Future): Future returned by the executor along with callback Returns: - None Updates the super() with the result() or exception() """ if pare...
def detectSymbianOS(self): """Return detection of SymbianOS Detects if the current device is any Symbian OS-based device, including older S60, Series 70, Series 80, Series 90, and UIQ, or other browsers running on these devices. """ return UAgentInfo.deviceSymbian in sel...
def function[detectSymbianOS, parameter[self]]: constant[Return detection of SymbianOS Detects if the current device is any Symbian OS-based device, including older S60, Series 70, Series 80, Series 90, and UIQ, or other browsers running on these devices. ] return[<ast.BoolO...
keyword[def] identifier[detectSymbianOS] ( identifier[self] ): literal[string] keyword[return] identifier[UAgentInfo] . identifier[deviceSymbian] keyword[in] identifier[self] . identifier[__userAgent] keyword[or] identifier[UAgentInfo] . identifier[deviceS60] keyword[in] identifier[self] . i...
def detectSymbianOS(self): """Return detection of SymbianOS Detects if the current device is any Symbian OS-based device, including older S60, Series 70, Series 80, Series 90, and UIQ, or other browsers running on these devices. """ return UAgentInfo.deviceSymbian in self.__user...
def send_audio_file( self, audio_file, device_state, authentication_headers, dialog_request_id, distance_profile, audio_format ): """ Send audio to AVS The file-like object are steaming uploaded for improved latency. Returns: bytes -- wav audio bytes ret...
def function[send_audio_file, parameter[self, audio_file, device_state, authentication_headers, dialog_request_id, distance_profile, audio_format]]: constant[ Send audio to AVS The file-like object are steaming uploaded for improved latency. Returns: bytes -- wav audio byte...
keyword[def] identifier[send_audio_file] ( identifier[self] , identifier[audio_file] , identifier[device_state] , identifier[authentication_headers] , identifier[dialog_request_id] , identifier[distance_profile] , identifier[audio_format] ): literal[string] identifier[payload] ={ liter...
def send_audio_file(self, audio_file, device_state, authentication_headers, dialog_request_id, distance_profile, audio_format): """ Send audio to AVS The file-like object are steaming uploaded for improved latency. Returns: bytes -- wav audio bytes returned from AVS ""...
def preprocess_text(text_string, function_list): ''' Given each function within function_list, applies the order of functions put forward onto text_string, returning the processed string as type str. Keyword argument: - function_list: list of functions available in preprocessing.text - text_st...
def function[preprocess_text, parameter[text_string, function_list]]: constant[ Given each function within function_list, applies the order of functions put forward onto text_string, returning the processed string as type str. Keyword argument: - function_list: list of functions available in p...
keyword[def] identifier[preprocess_text] ( identifier[text_string] , identifier[function_list] ): literal[string] keyword[if] identifier[text_string] keyword[is] keyword[None] keyword[or] identifier[text_string] == literal[string] : keyword[return] literal[string] keyword[elif] identi...
def preprocess_text(text_string, function_list): """ Given each function within function_list, applies the order of functions put forward onto text_string, returning the processed string as type str. Keyword argument: - function_list: list of functions available in preprocessing.text - text_st...
def ntoreturn(self): """Extract ntoreturn counter if available (lazy).""" if not self._counters_calculated: self._counters_calculated = True self._extract_counters() return self._ntoreturn
def function[ntoreturn, parameter[self]]: constant[Extract ntoreturn counter if available (lazy).] if <ast.UnaryOp object at 0x7da1b1782920> begin[:] name[self]._counters_calculated assign[=] constant[True] call[name[self]._extract_counters, parameter[]] return[name[s...
keyword[def] identifier[ntoreturn] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_counters_calculated] : identifier[self] . identifier[_counters_calculated] = keyword[True] identifier[self] . identifier[_extract_counters] (...
def ntoreturn(self): """Extract ntoreturn counter if available (lazy).""" if not self._counters_calculated: self._counters_calculated = True self._extract_counters() # depends on [control=['if'], data=[]] return self._ntoreturn
def get_achievements(self, name): """Get achievements for a player. Must match on name, not index, since order is not always the same. """ postgame = self.get_postgame() if not postgame: return None for achievements in postgame.achievements: # ach...
def function[get_achievements, parameter[self, name]]: constant[Get achievements for a player. Must match on name, not index, since order is not always the same. ] variable[postgame] assign[=] call[name[self].get_postgame, parameter[]] if <ast.UnaryOp object at 0x7da1b25ee6e0> b...
keyword[def] identifier[get_achievements] ( identifier[self] , identifier[name] ): literal[string] identifier[postgame] = identifier[self] . identifier[get_postgame] () keyword[if] keyword[not] identifier[postgame] : keyword[return] keyword[None] keyword[for] ide...
def get_achievements(self, name): """Get achievements for a player. Must match on name, not index, since order is not always the same. """ postgame = self.get_postgame() if not postgame: return None # depends on [control=['if'], data=[]] for achievements in postgame.achievement...
def reset_failed_attempts(ip_address=None, username=None): """ reset the failed attempts for these ip's and usernames """ pipe = REDIS_SERVER.pipeline() unblock_ip(ip_address, pipe=pipe) unblock_username(username, pipe=pipe) pipe.execute()
def function[reset_failed_attempts, parameter[ip_address, username]]: constant[ reset the failed attempts for these ip's and usernames ] variable[pipe] assign[=] call[name[REDIS_SERVER].pipeline, parameter[]] call[name[unblock_ip], parameter[name[ip_address]]] call[name[unblock_usern...
keyword[def] identifier[reset_failed_attempts] ( identifier[ip_address] = keyword[None] , identifier[username] = keyword[None] ): literal[string] identifier[pipe] = identifier[REDIS_SERVER] . identifier[pipeline] () identifier[unblock_ip] ( identifier[ip_address] , identifier[pipe] = identifier[pipe]...
def reset_failed_attempts(ip_address=None, username=None): """ reset the failed attempts for these ip's and usernames """ pipe = REDIS_SERVER.pipeline() unblock_ip(ip_address, pipe=pipe) unblock_username(username, pipe=pipe) pipe.execute()
def run_datafind_instance(cp, outputDir, connection, observatory, frameType, startTime, endTime, ifo, tags=None): """ This function will query the datafind server once to find frames between the specified times for the specified frame type and observatory. Parameters -----...
def function[run_datafind_instance, parameter[cp, outputDir, connection, observatory, frameType, startTime, endTime, ifo, tags]]: constant[ This function will query the datafind server once to find frames between the specified times for the specified frame type and observatory. Parameters -----...
keyword[def] identifier[run_datafind_instance] ( identifier[cp] , identifier[outputDir] , identifier[connection] , identifier[observatory] , identifier[frameType] , identifier[startTime] , identifier[endTime] , identifier[ifo] , identifier[tags] = keyword[None] ): literal[string] keyword[if] identifier[t...
def run_datafind_instance(cp, outputDir, connection, observatory, frameType, startTime, endTime, ifo, tags=None): """ This function will query the datafind server once to find frames between the specified times for the specified frame type and observatory. Parameters ---------- cp : ConfigParse...
def re_parser(self, scode, *args): """ args: [arg1, arg2] arg[0] = a valid regex pattern arg[1] : if startswith('@') call sub; if startswith('$') call finditer, $0, $1 means group index. return an ensure_list """ def gen_match(matches, num): ...
def function[re_parser, parameter[self, scode]]: constant[ args: [arg1, arg2] arg[0] = a valid regex pattern arg[1] : if startswith('@') call sub; if startswith('$') call finditer, $0, $1 means group index. return an ensure_list ] def function[...
keyword[def] identifier[re_parser] ( identifier[self] , identifier[scode] ,* identifier[args] ): literal[string] keyword[def] identifier[gen_match] ( identifier[matches] , identifier[num] ): keyword[for] identifier[match] keyword[in] identifier[matches] : keyword[...
def re_parser(self, scode, *args): """ args: [arg1, arg2] arg[0] = a valid regex pattern arg[1] : if startswith('@') call sub; if startswith('$') call finditer, $0, $1 means group index. return an ensure_list """ def gen_match(matches, num): f...
def _checkIdEquality(self, requestedEffect, effect): """ Tests whether a requested effect and an effect present in an annotation are equal. """ return self._idPresent(requestedEffect) and ( effect.term_id == requestedEffect.term_id)
def function[_checkIdEquality, parameter[self, requestedEffect, effect]]: constant[ Tests whether a requested effect and an effect present in an annotation are equal. ] return[<ast.BoolOp object at 0x7da18f812830>]
keyword[def] identifier[_checkIdEquality] ( identifier[self] , identifier[requestedEffect] , identifier[effect] ): literal[string] keyword[return] identifier[self] . identifier[_idPresent] ( identifier[requestedEffect] ) keyword[and] ( identifier[effect] . identifier[term_id] == identifie...
def _checkIdEquality(self, requestedEffect, effect): """ Tests whether a requested effect and an effect present in an annotation are equal. """ return self._idPresent(requestedEffect) and effect.term_id == requestedEffect.term_id
def python_2_unicode_compatible(klass): """ A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class. """ if PY2: ...
def function[python_2_unicode_compatible, parameter[klass]]: constant[ A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to t...
keyword[def] identifier[python_2_unicode_compatible] ( identifier[klass] ): literal[string] keyword[if] identifier[PY2] : keyword[if] literal[string] keyword[not] keyword[in] identifier[klass] . identifier[__dict__] : keyword[raise] identifier[ValueError] ( literal[string] ...
def python_2_unicode_compatible(klass): """ A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class. """ if PY2: ...
def block_lengths(self): """Gets the lengths of the blocks. Note: This works with the property structure `_lengths_cache` to avoid having to recompute these values each time they are needed. """ if self._lengths_cache is None: # The first column will have the cor...
def function[block_lengths, parameter[self]]: constant[Gets the lengths of the blocks. Note: This works with the property structure `_lengths_cache` to avoid having to recompute these values each time they are needed. ] if compare[name[self]._lengths_cache is constant[None]]...
keyword[def] identifier[block_lengths] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_lengths_cache] keyword[is] keyword[None] : identifier[self] . identifier[_lengths_cache] =( [ identifier[obj] . identifier[l...
def block_lengths(self): """Gets the lengths of the blocks. Note: This works with the property structure `_lengths_cache` to avoid having to recompute these values each time they are needed. """ if self._lengths_cache is None: # The first column will have the correct lengths...
def get_job_logs(id): """Get the crawl logs from the job.""" crawler_job = models.CrawlerJob.query.filter_by(id=id).one_or_none() if crawler_job is None: click.secho( ( "CrawlJob %s was not found, maybe it's not a crawl job?" % id ), ...
def function[get_job_logs, parameter[id]]: constant[Get the crawl logs from the job.] variable[crawler_job] assign[=] call[call[name[models].CrawlerJob.query.filter_by, parameter[]].one_or_none, parameter[]] if compare[name[crawler_job] is constant[None]] begin[:] call[name[click...
keyword[def] identifier[get_job_logs] ( identifier[id] ): literal[string] identifier[crawler_job] = identifier[models] . identifier[CrawlerJob] . identifier[query] . identifier[filter_by] ( identifier[id] = identifier[id] ). identifier[one_or_none] () keyword[if] identifier[crawler_job] keyword[is] ...
def get_job_logs(id): """Get the crawl logs from the job.""" crawler_job = models.CrawlerJob.query.filter_by(id=id).one_or_none() if crawler_job is None: click.secho("CrawlJob %s was not found, maybe it's not a crawl job?" % id, fg='yellow') sys.exit(1) # depends on [control=['if'], data=[]...
def update_q(self, state_key, action_key, reward_value, next_max_q): ''' Update Q-Value. Args: state_key: The key of state. action_key: The key of action. reward_value: R-Value(Reward). next_max_q: Ma...
def function[update_q, parameter[self, state_key, action_key, reward_value, next_max_q]]: constant[ Update Q-Value. Args: state_key: The key of state. action_key: The key of action. reward_value: R-Value(Reward). ...
keyword[def] identifier[update_q] ( identifier[self] , identifier[state_key] , identifier[action_key] , identifier[reward_value] , identifier[next_max_q] ): literal[string] identifier[q] = identifier[self] . identifier[extract_q_df] ( identifier[state_key] , identifier[action_key] ) ...
def update_q(self, state_key, action_key, reward_value, next_max_q): """ Update Q-Value. Args: state_key: The key of state. action_key: The key of action. reward_value: R-Value(Reward). next_max_q: Maximu...
def add_sample(self, name, labels, value, timestamp=None, exemplar=None): """Add a sample to the metric. Internal-only, do not use.""" self.samples.append(Sample(name, labels, value, timestamp, exemplar))
def function[add_sample, parameter[self, name, labels, value, timestamp, exemplar]]: constant[Add a sample to the metric. Internal-only, do not use.] call[name[self].samples.append, parameter[call[name[Sample], parameter[name[name], name[labels], name[value], name[timestamp], name[exemplar]]]]]
keyword[def] identifier[add_sample] ( identifier[self] , identifier[name] , identifier[labels] , identifier[value] , identifier[timestamp] = keyword[None] , identifier[exemplar] = keyword[None] ): literal[string] identifier[self] . identifier[samples] . identifier[append] ( identifier[Sample] ( ide...
def add_sample(self, name, labels, value, timestamp=None, exemplar=None): """Add a sample to the metric. Internal-only, do not use.""" self.samples.append(Sample(name, labels, value, timestamp, exemplar))