code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def info(self): '''Return the header fields as a Message: Returns: Message: An instance of :class:`email.message.Message`. If Python 2, returns an instance of :class:`mimetools.Message`. ''' if sys.version_info[0] == 2: return mimetools.Message(io.Str...
def function[info, parameter[self]]: constant[Return the header fields as a Message: Returns: Message: An instance of :class:`email.message.Message`. If Python 2, returns an instance of :class:`mimetools.Message`. ] if compare[call[name[sys].version_info][constan...
keyword[def] identifier[info] ( identifier[self] ): literal[string] keyword[if] identifier[sys] . identifier[version_info] [ literal[int] ]== literal[int] : keyword[return] identifier[mimetools] . identifier[Message] ( identifier[io] . identifier[StringIO] ( identifier[str] ( identif...
def info(self): """Return the header fields as a Message: Returns: Message: An instance of :class:`email.message.Message`. If Python 2, returns an instance of :class:`mimetools.Message`. """ if sys.version_info[0] == 2: return mimetools.Message(io.StringIO(str(se...
def downloadDatabases(self, savepath=None, unpack=False): """ Download databases. Parameters: savepath (str): Defaults to current working dir. unpack (bool): Unpack the zip file. """ url = self.url('/diagnostics/databases') filepath = utils.do...
def function[downloadDatabases, parameter[self, savepath, unpack]]: constant[ Download databases. Parameters: savepath (str): Defaults to current working dir. unpack (bool): Unpack the zip file. ] variable[url] assign[=] call[name[self].url, parameter...
keyword[def] identifier[downloadDatabases] ( identifier[self] , identifier[savepath] = keyword[None] , identifier[unpack] = keyword[False] ): literal[string] identifier[url] = identifier[self] . identifier[url] ( literal[string] ) identifier[filepath] = identifier[utils] . identifier[downl...
def downloadDatabases(self, savepath=None, unpack=False): """ Download databases. Parameters: savepath (str): Defaults to current working dir. unpack (bool): Unpack the zip file. """ url = self.url('/diagnostics/databases') filepath = utils.download(url, ...
def _retrieve(self, uid): """Return a dict with the contents of the paste, including the raw data, if any, as the key 'data'. Must pass in uid, not shortid.""" query = dict(uid=uid) doc = self.db.pastes.find_one(query) if 'data_id' in doc: data_id = doc.pop('data_id')...
def function[_retrieve, parameter[self, uid]]: constant[Return a dict with the contents of the paste, including the raw data, if any, as the key 'data'. Must pass in uid, not shortid.] variable[query] assign[=] call[name[dict], parameter[]] variable[doc] assign[=] call[name[self].db.past...
keyword[def] identifier[_retrieve] ( identifier[self] , identifier[uid] ): literal[string] identifier[query] = identifier[dict] ( identifier[uid] = identifier[uid] ) identifier[doc] = identifier[self] . identifier[db] . identifier[pastes] . identifier[find_one] ( identifier[query] ) ...
def _retrieve(self, uid): """Return a dict with the contents of the paste, including the raw data, if any, as the key 'data'. Must pass in uid, not shortid.""" query = dict(uid=uid) doc = self.db.pastes.find_one(query) if 'data_id' in doc: data_id = doc.pop('data_id') gfs = gridf...
def isConnected(self, fromName, toName): """ Are these two layers connected this way? """ for c in self.connections: if (c.fromLayer.name == fromName and c.toLayer.name == toName): return 1 return 0
def function[isConnected, parameter[self, fromName, toName]]: constant[ Are these two layers connected this way? ] for taget[name[c]] in starred[name[self].connections] begin[:] if <ast.BoolOp object at 0x7da1b035a530> begin[:] return[constant[1]] return[constant[0]]
keyword[def] identifier[isConnected] ( identifier[self] , identifier[fromName] , identifier[toName] ): literal[string] keyword[for] identifier[c] keyword[in] identifier[self] . identifier[connections] : keyword[if] ( identifier[c] . identifier[fromLayer] . identifier[name] == identi...
def isConnected(self, fromName, toName): """ Are these two layers connected this way? """ for c in self.connections: if c.fromLayer.name == fromName and c.toLayer.name == toName: return 1 # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['c']] return 0
def end_day_to_datetime(end_day, config): """ Convert a given end day to its proper datetime. This is non trivial because of variable ``day_start``. We want to make sure that even if an 'end day' is specified the actual point in time may reach into the following day. Args: end (datetim...
def function[end_day_to_datetime, parameter[end_day, config]]: constant[ Convert a given end day to its proper datetime. This is non trivial because of variable ``day_start``. We want to make sure that even if an 'end day' is specified the actual point in time may reach into the following day. ...
keyword[def] identifier[end_day_to_datetime] ( identifier[end_day] , identifier[config] ): literal[string] identifier[day_start_time] = identifier[config] [ literal[string] ] identifier[day_end_time] = identifier[get_day_end] ( identifier[config] ) keyword[if] identifier[day_start_time] == ide...
def end_day_to_datetime(end_day, config): """ Convert a given end day to its proper datetime. This is non trivial because of variable ``day_start``. We want to make sure that even if an 'end day' is specified the actual point in time may reach into the following day. Args: end (datetim...
def p_gate_op_5(self, program): """ gate_op : BARRIER id_list ';' """ program[0] = node.Barrier([program[2]]) self.verify_bit_list(program[2]) self.verify_distinct([program[2]])
def function[p_gate_op_5, parameter[self, program]]: constant[ gate_op : BARRIER id_list ';' ] call[name[program]][constant[0]] assign[=] call[name[node].Barrier, parameter[list[[<ast.Subscript object at 0x7da1b03a8970>]]]] call[name[self].verify_bit_list, parameter[call[name[pro...
keyword[def] identifier[p_gate_op_5] ( identifier[self] , identifier[program] ): literal[string] identifier[program] [ literal[int] ]= identifier[node] . identifier[Barrier] ([ identifier[program] [ literal[int] ]]) identifier[self] . identifier[verify_bit_list] ( identifier[program] [ lit...
def p_gate_op_5(self, program): """ gate_op : BARRIER id_list ';' """ program[0] = node.Barrier([program[2]]) self.verify_bit_list(program[2]) self.verify_distinct([program[2]])
def systemCTypeOfSig(signalItem): """ Check if is register or wire """ if signalItem._const or\ arr_any(signalItem.drivers, lambda d: isinstance(d, HdlStatement) and d._now_is_event_dependent): return SIGNAL_TYPE.REG else: return SIGNAL_TYPE.WIRE
def function[systemCTypeOfSig, parameter[signalItem]]: constant[ Check if is register or wire ] if <ast.BoolOp object at 0x7da1b05c6d40> begin[:] return[name[SIGNAL_TYPE].REG]
keyword[def] identifier[systemCTypeOfSig] ( identifier[signalItem] ): literal[string] keyword[if] identifier[signalItem] . identifier[_const] keyword[or] identifier[arr_any] ( identifier[signalItem] . identifier[drivers] , keyword[lambda] identifier[d] : identifier[isinstance] ( identifier[d] , id...
def systemCTypeOfSig(signalItem): """ Check if is register or wire """ if signalItem._const or arr_any(signalItem.drivers, lambda d: isinstance(d, HdlStatement) and d._now_is_event_dependent): return SIGNAL_TYPE.REG # depends on [control=['if'], data=[]] else: return SIGNAL_TYPE.WIR...
def constant(func): """Decorate a function so that the result is a constant value. Functions wraped by this decorator will be run just one time. The computational result will be stored and reused for any other input. To store each result for each input, use :func:`memoized` instead. """ @wraps...
def function[constant, parameter[func]]: constant[Decorate a function so that the result is a constant value. Functions wraped by this decorator will be run just one time. The computational result will be stored and reused for any other input. To store each result for each input, use :func:`memoiz...
keyword[def] identifier[constant] ( identifier[func] ): literal[string] @ identifier[wraps] ( identifier[func] ) keyword[def] identifier[_] (* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[_] . identifier[res] : identif...
def constant(func): """Decorate a function so that the result is a constant value. Functions wraped by this decorator will be run just one time. The computational result will be stored and reused for any other input. To store each result for each input, use :func:`memoized` instead. """ @wrap...
def get_var(self, key): 'Retrieve one saved variable from the database.' vt = quote(self.__vars_table) data = self.execute(u'SELECT * FROM %s WHERE `key` = ?' % vt, [key], commit = False) if data == []: raise NameError(u'The DumpTruck variables table doesn\'t have a value for %s.' % key) else:...
def function[get_var, parameter[self, key]]: constant[Retrieve one saved variable from the database.] variable[vt] assign[=] call[name[quote], parameter[name[self].__vars_table]] variable[data] assign[=] call[name[self].execute, parameter[binary_operation[constant[SELECT * FROM %s WHERE `key` = ...
keyword[def] identifier[get_var] ( identifier[self] , identifier[key] ): literal[string] identifier[vt] = identifier[quote] ( identifier[self] . identifier[__vars_table] ) identifier[data] = identifier[self] . identifier[execute] ( literal[string] % identifier[vt] ,[ identifier[key] ], identifier[comm...
def get_var(self, key): """Retrieve one saved variable from the database.""" vt = quote(self.__vars_table) data = self.execute(u'SELECT * FROM %s WHERE `key` = ?' % vt, [key], commit=False) if data == []: raise NameError(u"The DumpTruck variables table doesn't have a value for %s." % key) # dep...
def load_from_cache(**kwargs): ''' :param kwargs: keyword args for :func:`~dxpy.bindings.search.find_one_data_object`, with the exception of "project" :raises: :exc:`~dxpy.exceptions.DXError` if "project" is given, if this is called with dxpy.JOB_ID not set, or if "DX_PROJECT_CACHE_ID" is not found in the e...
def function[load_from_cache, parameter[]]: constant[ :param kwargs: keyword args for :func:`~dxpy.bindings.search.find_one_data_object`, with the exception of "project" :raises: :exc:`~dxpy.exceptions.DXError` if "project" is given, if this is called with dxpy.JOB_ID not set, or if "DX_PROJECT_CACHE_ID...
keyword[def] identifier[load_from_cache] (** identifier[kwargs] ): literal[string] keyword[if] literal[string] keyword[in] identifier[kwargs] : keyword[raise] identifier[DXError] ( literal[string] ) keyword[if] identifier[dxpy] . identifier[JOB_ID] keyword[is] keyword[None] : ...
def load_from_cache(**kwargs): """ :param kwargs: keyword args for :func:`~dxpy.bindings.search.find_one_data_object`, with the exception of "project" :raises: :exc:`~dxpy.exceptions.DXError` if "project" is given, if this is called with dxpy.JOB_ID not set, or if "DX_PROJECT_CACHE_ID" is not found in the e...
def bracket_split(source, brackets=('()', '{}', '[]'), strip=False): """DOES NOT RETURN EMPTY STRINGS (can only return empty bracket content if strip=True)""" starts = [e[0] for e in brackets] in_bracket = 0 n = 0 last = 0 while n < len(source): e = source[n] if not in_bracket an...
def function[bracket_split, parameter[source, brackets, strip]]: constant[DOES NOT RETURN EMPTY STRINGS (can only return empty bracket content if strip=True)] variable[starts] assign[=] <ast.ListComp object at 0x7da20c6e6f80> variable[in_bracket] assign[=] constant[0] variable[n] assign[...
keyword[def] identifier[bracket_split] ( identifier[source] , identifier[brackets] =( literal[string] , literal[string] , literal[string] ), identifier[strip] = keyword[False] ): literal[string] identifier[starts] =[ identifier[e] [ literal[int] ] keyword[for] identifier[e] keyword[in] identifier[bracke...
def bracket_split(source, brackets=('()', '{}', '[]'), strip=False): """DOES NOT RETURN EMPTY STRINGS (can only return empty bracket content if strip=True)""" starts = [e[0] for e in brackets] in_bracket = 0 n = 0 last = 0 while n < len(source): e = source[n] if not in_bracket an...
def iter_tasks(matrix, names, groups): """Iterate tasks.""" # Build name index name_index = dict([(task.get('name', ''), index) for index, task in enumerate(matrix)]) for index, task in enumerate(matrix): name = task.get('name', '') group = task.get('group', '') hidden = task.g...
def function[iter_tasks, parameter[matrix, names, groups]]: constant[Iterate tasks.] variable[name_index] assign[=] call[name[dict], parameter[<ast.ListComp object at 0x7da18c4cfb80>]] for taget[tuple[[<ast.Name object at 0x7da18c4cc3d0>, <ast.Name object at 0x7da18c4cff70>]]] in starred[call[na...
keyword[def] identifier[iter_tasks] ( identifier[matrix] , identifier[names] , identifier[groups] ): literal[string] identifier[name_index] = identifier[dict] ([( identifier[task] . identifier[get] ( literal[string] , literal[string] ), identifier[index] ) keyword[for] identifier[index] , identifier...
def iter_tasks(matrix, names, groups): """Iterate tasks.""" # Build name index name_index = dict([(task.get('name', ''), index) for (index, task) in enumerate(matrix)]) for (index, task) in enumerate(matrix): name = task.get('name', '') group = task.get('group', '') hidden = task...
def set_xlim(self, xlim): '''set new X bounds''' if self.xlim_pipe is not None and self.xlim != xlim: #print("send0: ", graph_count, xlim) try: self.xlim_pipe[0].send(xlim) except IOError: return False self.xlim = xlim ...
def function[set_xlim, parameter[self, xlim]]: constant[set new X bounds] if <ast.BoolOp object at 0x7da20c76fd30> begin[:] <ast.Try object at 0x7da20c76e3e0> name[self].xlim assign[=] name[xlim] return[constant[True]]
keyword[def] identifier[set_xlim] ( identifier[self] , identifier[xlim] ): literal[string] keyword[if] identifier[self] . identifier[xlim_pipe] keyword[is] keyword[not] keyword[None] keyword[and] identifier[self] . identifier[xlim] != identifier[xlim] : keyword[try] : ...
def set_xlim(self, xlim): """set new X bounds""" if self.xlim_pipe is not None and self.xlim != xlim: #print("send0: ", graph_count, xlim) try: self.xlim_pipe[0].send(xlim) # depends on [control=['try'], data=[]] except IOError: return False # depends on [contro...
def _format_report_line(self, test, time_taken, color, status, percent): """Format a single report line.""" return "[{0}] {3:04.2f}% {1}: {2}".format( status, test, self._colored_time(time_taken, color), percent )
def function[_format_report_line, parameter[self, test, time_taken, color, status, percent]]: constant[Format a single report line.] return[call[constant[[{0}] {3:04.2f}% {1}: {2}].format, parameter[name[status], name[test], call[name[self]._colored_time, parameter[name[time_taken], name[color]]], name[perc...
keyword[def] identifier[_format_report_line] ( identifier[self] , identifier[test] , identifier[time_taken] , identifier[color] , identifier[status] , identifier[percent] ): literal[string] keyword[return] literal[string] . identifier[format] ( identifier[status] , identifier[test] , iden...
def _format_report_line(self, test, time_taken, color, status, percent): """Format a single report line.""" return '[{0}] {3:04.2f}% {1}: {2}'.format(status, test, self._colored_time(time_taken, color), percent)
def random_density_matrix(length, rank=None, method='Hilbert-Schmidt', seed=None): """Deprecated in 0.8+ """ warnings.warn('The random_density_matrix() function in qiskit.tools.qi has been ' 'deprecated and will be removed in the future. Instead use ' 'the function in qis...
def function[random_density_matrix, parameter[length, rank, method, seed]]: constant[Deprecated in 0.8+ ] call[name[warnings].warn, parameter[constant[The random_density_matrix() function in qiskit.tools.qi has been deprecated and will be removed in the future. Instead use the function in qiskit.qua...
keyword[def] identifier[random_density_matrix] ( identifier[length] , identifier[rank] = keyword[None] , identifier[method] = literal[string] , identifier[seed] = keyword[None] ): literal[string] identifier[warnings] . identifier[warn] ( literal[string] literal[string] literal[string] , id...
def random_density_matrix(length, rank=None, method='Hilbert-Schmidt', seed=None): """Deprecated in 0.8+ """ warnings.warn('The random_density_matrix() function in qiskit.tools.qi has been deprecated and will be removed in the future. Instead use the function in qiskit.quantum_info.random', DeprecationWarni...
def polarization_vector(phi, theta, alpha, beta, p, numeric=False, abstract=False): """This function returns a unitary vector describing the polarization of plane waves.: INPUT: - ``phi`` - The spherical coordinates azimuthal angle of the wave vector\ k. - ``theta`` - Th...
def function[polarization_vector, parameter[phi, theta, alpha, beta, p, numeric, abstract]]: constant[This function returns a unitary vector describing the polarization of plane waves.: INPUT: - ``phi`` - The spherical coordinates azimuthal angle of the wave vector k. - ``theta`` - The spher...
keyword[def] identifier[polarization_vector] ( identifier[phi] , identifier[theta] , identifier[alpha] , identifier[beta] , identifier[p] , identifier[numeric] = keyword[False] , identifier[abstract] = keyword[False] ): literal[string] keyword[if] identifier[abstract] : identifier[Nl] = identifi...
def polarization_vector(phi, theta, alpha, beta, p, numeric=False, abstract=False): """This function returns a unitary vector describing the polarization of plane waves.: INPUT: - ``phi`` - The spherical coordinates azimuthal angle of the wave vector k. - ``theta`` - The spherical coordinates po...
def find_lt(a, x): """Find rightmost value less than x""" i = bisect.bisect_left(a, x) if i: return a[i-1] raise ValueError
def function[find_lt, parameter[a, x]]: constant[Find rightmost value less than x] variable[i] assign[=] call[name[bisect].bisect_left, parameter[name[a], name[x]]] if name[i] begin[:] return[call[name[a]][binary_operation[name[i] - constant[1]]]] <ast.Raise object at 0x7da20c991330>
keyword[def] identifier[find_lt] ( identifier[a] , identifier[x] ): literal[string] identifier[i] = identifier[bisect] . identifier[bisect_left] ( identifier[a] , identifier[x] ) keyword[if] identifier[i] : keyword[return] identifier[a] [ identifier[i] - literal[int] ] keyword[raise] ...
def find_lt(a, x): """Find rightmost value less than x""" i = bisect.bisect_left(a, x) if i: return a[i - 1] # depends on [control=['if'], data=[]] raise ValueError
def sort(self): """ Sort triggers and their associated responses """ # Sort triggers by word and character length first for priority, triggers in self._triggers.items(): self._log.debug('Sorting priority {priority} triggers'.format(priority=priority)) # G...
def function[sort, parameter[self]]: constant[ Sort triggers and their associated responses ] for taget[tuple[[<ast.Name object at 0x7da1b164bbe0>, <ast.Name object at 0x7da1b1648970>]]] in starred[call[name[self]._triggers.items, parameter[]]] begin[:] call[name[self]._l...
keyword[def] identifier[sort] ( identifier[self] ): literal[string] keyword[for] identifier[priority] , identifier[triggers] keyword[in] identifier[self] . identifier[_triggers] . identifier[items] (): identifier[self] . identifier[_log] . identifier[debug] ( literal[string...
def sort(self): """ Sort triggers and their associated responses """ # Sort triggers by word and character length first for (priority, triggers) in self._triggers.items(): self._log.debug('Sorting priority {priority} triggers'.format(priority=priority)) # Get and sort our ato...
def handle(self, key, value): ''' Processes a vaild action info request @param key: The key that matched the request @param value: The value associated with the key ''' # break down key elements = key.split(":") if len(elements) != 4: self.lo...
def function[handle, parameter[self, key, value]]: constant[ Processes a vaild action info request @param key: The key that matched the request @param value: The value associated with the key ] variable[elements] assign[=] call[name[key].split, parameter[constant[:]]] ...
keyword[def] identifier[handle] ( identifier[self] , identifier[key] , identifier[value] ): literal[string] identifier[elements] = identifier[key] . identifier[split] ( literal[string] ) keyword[if] identifier[len] ( identifier[elements] )!= literal[int] : identifie...
def handle(self, key, value): """ Processes a vaild action info request @param key: The key that matched the request @param value: The value associated with the key """ # break down key elements = key.split(':') if len(elements) != 4: self.logger.warn('Stop reque...
def run(self, duration, obs): """Run the simulation. Parameters ---------- duration : Real a duration for running a simulation. A simulation is expected to be stopped at t() + duration. observers : list of Obeservers, optional observers ...
def function[run, parameter[self, duration, obs]]: constant[Run the simulation. Parameters ---------- duration : Real a duration for running a simulation. A simulation is expected to be stopped at t() + duration. observers : list of Obeservers, option...
keyword[def] identifier[run] ( identifier[self] , identifier[duration] , identifier[obs] ): literal[string] keyword[from] identifier[ecell4_base] . identifier[core] keyword[import] identifier[TimeoutObserver] identifier[timeout] = identifier[TimeoutObserver] ( identifier[self] . ident...
def run(self, duration, obs): """Run the simulation. Parameters ---------- duration : Real a duration for running a simulation. A simulation is expected to be stopped at t() + duration. observers : list of Obeservers, optional observers ...
def _exec_command(adb_cmd): """ Format adb command and execute it in shell :param adb_cmd: list adb command to execute :return: string '0' and shell command output if successful, otherwise raise CalledProcessError exception and return error code """ t = tempfile.TemporaryFile() final_adb...
def function[_exec_command, parameter[adb_cmd]]: constant[ Format adb command and execute it in shell :param adb_cmd: list adb command to execute :return: string '0' and shell command output if successful, otherwise raise CalledProcessError exception and return error code ] variable[...
keyword[def] identifier[_exec_command] ( identifier[adb_cmd] ): literal[string] identifier[t] = identifier[tempfile] . identifier[TemporaryFile] () identifier[final_adb_cmd] =[] keyword[for] identifier[e] keyword[in] identifier[adb_cmd] : keyword[if] identifier[e] != literal[string] ...
def _exec_command(adb_cmd): """ Format adb command and execute it in shell :param adb_cmd: list adb command to execute :return: string '0' and shell command output if successful, otherwise raise CalledProcessError exception and return error code """ t = tempfile.TemporaryFile() final_adb...
def _set_mpls_reopt_lsp(self, v, load=False): """ Setter method for mpls_reopt_lsp, mapped from YANG variable /brocade_mpls_rpc/mpls_reopt_lsp (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_mpls_reopt_lsp is considered as a private method. Backends looking to ...
def function[_set_mpls_reopt_lsp, parameter[self, v, load]]: constant[ Setter method for mpls_reopt_lsp, mapped from YANG variable /brocade_mpls_rpc/mpls_reopt_lsp (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_mpls_reopt_lsp is considered as a private met...
keyword[def] identifier[_set_mpls_reopt_lsp] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : ...
def _set_mpls_reopt_lsp(self, v, load=False): """ Setter method for mpls_reopt_lsp, mapped from YANG variable /brocade_mpls_rpc/mpls_reopt_lsp (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_mpls_reopt_lsp is considered as a private method. Backends looking to ...
def extend(self, values): """Extend the array, appending the given values.""" self.database.run_script( 'array_extend', keys=[self.key], args=values)
def function[extend, parameter[self, values]]: constant[Extend the array, appending the given values.] call[name[self].database.run_script, parameter[constant[array_extend]]]
keyword[def] identifier[extend] ( identifier[self] , identifier[values] ): literal[string] identifier[self] . identifier[database] . identifier[run_script] ( literal[string] , identifier[keys] =[ identifier[self] . identifier[key] ], identifier[args] = identifier[values] ...
def extend(self, values): """Extend the array, appending the given values.""" self.database.run_script('array_extend', keys=[self.key], args=values)
def upstart( state, host, name, running=True, restarted=False, reloaded=False, command=None, enabled=None, ): ''' Manage the state of upstart managed services. + name: name of the service to manage + running: whether the service should be running + restarted: whether the service should ...
def function[upstart, parameter[state, host, name, running, restarted, reloaded, command, enabled]]: constant[ Manage the state of upstart managed services. + name: name of the service to manage + running: whether the service should be running + restarted: whether the service should be restarte...
keyword[def] identifier[upstart] ( identifier[state] , identifier[host] , identifier[name] , identifier[running] = keyword[True] , identifier[restarted] = keyword[False] , identifier[reloaded] = keyword[False] , identifier[command] = keyword[None] , identifier[enabled] = keyword[None] , ): literal[string] ...
def upstart(state, host, name, running=True, restarted=False, reloaded=False, command=None, enabled=None): """ Manage the state of upstart managed services. + name: name of the service to manage + running: whether the service should be running + restarted: whether the service should be restarted ...
def _render_rst(self): # pragma: no cover """Render lines of reStructuredText for items yielded by :meth:`~doctor.docs.base.BaseHarness.iter_annotations`. """ # Create a mapping of headers to annotations. We want to group # all annotations by a header, but they could be in mult...
def function[_render_rst, parameter[self]]: constant[Render lines of reStructuredText for items yielded by :meth:`~doctor.docs.base.BaseHarness.iter_annotations`. ] variable[heading_to_annotations_map] assign[=] call[name[defaultdict], parameter[name[list]]] for taget[tuple[[<ast...
keyword[def] identifier[_render_rst] ( identifier[self] ): literal[string] identifier[heading_to_annotations_map] = identifier[defaultdict] ( identifier[list] ) keyword[for] identifier[heading] , identifier[route] , identifier[handler] , identi...
def _render_rst(self): # pragma: no cover 'Render lines of reStructuredText for items yielded by\n :meth:`~doctor.docs.base.BaseHarness.iter_annotations`.\n ' # Create a mapping of headers to annotations. We want to group # all annotations by a header, but they could be in multiple handlers ...
def _iter_info(self, niter, level=logging.INFO): """ Log iteration number and mismatch Parameters ---------- level logging level Returns ------- None """ max_mis = self.iter_mis[niter - 1] msg = ' Iter {:<d}. max misma...
def function[_iter_info, parameter[self, niter, level]]: constant[ Log iteration number and mismatch Parameters ---------- level logging level Returns ------- None ] variable[max_mis] assign[=] call[name[self].iter_mis][binary_...
keyword[def] identifier[_iter_info] ( identifier[self] , identifier[niter] , identifier[level] = identifier[logging] . identifier[INFO] ): literal[string] identifier[max_mis] = identifier[self] . identifier[iter_mis] [ identifier[niter] - literal[int] ] identifier[msg] = literal[string] . ...
def _iter_info(self, niter, level=logging.INFO): """ Log iteration number and mismatch Parameters ---------- level logging level Returns ------- None """ max_mis = self.iter_mis[niter - 1] msg = ' Iter {:<d}. max mismatch = {:8.7f...
def save_all(self): """Save all opened files. Iterate through self.data and call save() on any modified files. """ for index in range(self.get_stack_count()): if self.data[index].editor.document().isModified(): self.save(index)
def function[save_all, parameter[self]]: constant[Save all opened files. Iterate through self.data and call save() on any modified files. ] for taget[name[index]] in starred[call[name[range], parameter[call[name[self].get_stack_count, parameter[]]]]] begin[:] if call[cal...
keyword[def] identifier[save_all] ( identifier[self] ): literal[string] keyword[for] identifier[index] keyword[in] identifier[range] ( identifier[self] . identifier[get_stack_count] ()): keyword[if] identifier[self] . identifier[data] [ identifier[index] ]. identifier[editor] . ...
def save_all(self): """Save all opened files. Iterate through self.data and call save() on any modified files. """ for index in range(self.get_stack_count()): if self.data[index].editor.document().isModified(): self.save(index) # depends on [control=['if'], data=[]] # depe...
def _process_out_of_bounds(self, value, start, end): "Clips out of bounds values" if isinstance(value, np.datetime64): v = dt64_to_dt(value) if isinstance(start, (int, float)): start = convert_timestamp(start) if isinstance(end, (int, float)): ...
def function[_process_out_of_bounds, parameter[self, value, start, end]]: constant[Clips out of bounds values] if call[name[isinstance], parameter[name[value], name[np].datetime64]] begin[:] variable[v] assign[=] call[name[dt64_to_dt], parameter[name[value]]] if call[name...
keyword[def] identifier[_process_out_of_bounds] ( identifier[self] , identifier[value] , identifier[start] , identifier[end] ): literal[string] keyword[if] identifier[isinstance] ( identifier[value] , identifier[np] . identifier[datetime64] ): identifier[v] = identifier[dt64_to_dt] ( ...
def _process_out_of_bounds(self, value, start, end): """Clips out of bounds values""" if isinstance(value, np.datetime64): v = dt64_to_dt(value) if isinstance(start, (int, float)): start = convert_timestamp(start) # depends on [control=['if'], data=[]] if isinstance(end, (in...
def start(self, timeout=None): """ Start OpenVPN and block until the connection is opened or there is an error :param timeout: time in seconds to wait for process to start :return: """ if not timeout: timeout = self.timeout self.thread.start() ...
def function[start, parameter[self, timeout]]: constant[ Start OpenVPN and block until the connection is opened or there is an error :param timeout: time in seconds to wait for process to start :return: ] if <ast.UnaryOp object at 0x7da1b2844eb0> begin[:] ...
keyword[def] identifier[start] ( identifier[self] , identifier[timeout] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[timeout] : identifier[timeout] = identifier[self] . identifier[timeout] identifier[self] . identifier[thread] . identifier[start] (...
def start(self, timeout=None): """ Start OpenVPN and block until the connection is opened or there is an error :param timeout: time in seconds to wait for process to start :return: """ if not timeout: timeout = self.timeout # depends on [control=['if'], data=[]] ...
def avail_locations(conn=None, call=None): ''' List available locations for Azure ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) if not conn: ...
def function[avail_locations, parameter[conn, call]]: constant[ List available locations for Azure ] if compare[name[call] equal[==] constant[action]] begin[:] <ast.Raise object at 0x7da20c6aada0> if <ast.UnaryOp object at 0x7da20c6a8430> begin[:] variable[conn] a...
keyword[def] identifier[avail_locations] ( identifier[conn] = keyword[None] , identifier[call] = keyword[None] ): literal[string] keyword[if] identifier[call] == literal[string] : keyword[raise] identifier[SaltCloudSystemExit] ( literal[string] literal[string] ) ...
def avail_locations(conn=None, call=None): """ List available locations for Azure """ if call == 'action': raise SaltCloudSystemExit('The avail_locations function must be called with -f or --function, or with the --list-locations option') # depends on [control=['if'], data=[]] if not conn: ...
def create_pipeline(name, unique_id, description='', region=None, key=None, keyid=None, profile=None): ''' Create a new, empty pipeline. This function is idempotent. CLI example: .. code-block:: bash salt myminion boto_datapipeline.create_pipeline my_name my_unique_id ...
def function[create_pipeline, parameter[name, unique_id, description, region, key, keyid, profile]]: constant[ Create a new, empty pipeline. This function is idempotent. CLI example: .. code-block:: bash salt myminion boto_datapipeline.create_pipeline my_name my_unique_id ] va...
keyword[def] identifier[create_pipeline] ( identifier[name] , identifier[unique_id] , identifier[description] = literal[string] , identifier[region] = keyword[None] , identifier[key] = keyword[None] , identifier[keyid] = keyword[None] , identifier[profile] = keyword[None] ): literal[string] identifier[cli...
def create_pipeline(name, unique_id, description='', region=None, key=None, keyid=None, profile=None): """ Create a new, empty pipeline. This function is idempotent. CLI example: .. code-block:: bash salt myminion boto_datapipeline.create_pipeline my_name my_unique_id """ client = _ge...
def complex_files(script='d[1]+1j*d[2]', escript=None, paths=None, **kwargs): """ Loads files and plots complex data in the real-imaginary plane. Parameters ---------- script='d[1]+1j*d[2]' Complex-valued script for data array. escript=None Complex-valued script fo...
def function[complex_files, parameter[script, escript, paths]]: constant[ Loads files and plots complex data in the real-imaginary plane. Parameters ---------- script='d[1]+1j*d[2]' Complex-valued script for data array. escript=None Complex-valued script for er...
keyword[def] identifier[complex_files] ( identifier[script] = literal[string] , identifier[escript] = keyword[None] , identifier[paths] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[ds] = identifier[_data] . identifier[load_multiple] ( identifier[paths] = identifier[paths] ) ke...
def complex_files(script='d[1]+1j*d[2]', escript=None, paths=None, **kwargs): """ Loads files and plots complex data in the real-imaginary plane. Parameters ---------- script='d[1]+1j*d[2]' Complex-valued script for data array. escript=None Complex-valued script fo...
def es_version(self, url): """Get Elasticsearch version. Get the version of Elasticsearch. This is useful because Elasticsearch and Kibiter are paired (same major version for 5, 6). :param url: Elasticseearch url hosting Kibiter indices :returns: major version, as string ...
def function[es_version, parameter[self, url]]: constant[Get Elasticsearch version. Get the version of Elasticsearch. This is useful because Elasticsearch and Kibiter are paired (same major version for 5, 6). :param url: Elasticseearch url hosting Kibiter indices :returns: ma...
keyword[def] identifier[es_version] ( identifier[self] , identifier[url] ): literal[string] keyword[try] : identifier[res] = identifier[self] . identifier[grimoire_con] . identifier[get] ( identifier[url] ) identifier[res] . identifier[raise_for_status] () id...
def es_version(self, url): """Get Elasticsearch version. Get the version of Elasticsearch. This is useful because Elasticsearch and Kibiter are paired (same major version for 5, 6). :param url: Elasticseearch url hosting Kibiter indices :returns: major version, as string ...
def get_modules(modulepath): """return all found modules at modulepath (eg, foo.bar) including modulepath module""" m = importlib.import_module(modulepath) mpath = m.__file__ ret = set([m]) if "__init__." in mpath.lower(): mpath = os.path.dirname(mpath) # https://docs.python.org/2/...
def function[get_modules, parameter[modulepath]]: constant[return all found modules at modulepath (eg, foo.bar) including modulepath module] variable[m] assign[=] call[name[importlib].import_module, parameter[name[modulepath]]] variable[mpath] assign[=] name[m].__file__ variable[ret] ass...
keyword[def] identifier[get_modules] ( identifier[modulepath] ): literal[string] identifier[m] = identifier[importlib] . identifier[import_module] ( identifier[modulepath] ) identifier[mpath] = identifier[m] . identifier[__file__] identifier[ret] = identifier[set] ([ identifier[m] ]) keywo...
def get_modules(modulepath): """return all found modules at modulepath (eg, foo.bar) including modulepath module""" m = importlib.import_module(modulepath) mpath = m.__file__ ret = set([m]) if '__init__.' in mpath.lower(): mpath = os.path.dirname(mpath) # https://docs.python.org/2/li...
def monitor_key_get(service, key): """ Gets the value of an existing key in the monitor cluster. :param service: six.string_types. The Ceph user name to run the command under :param key: six.string_types. The key to search for. :return: Returns the value of that key or None if not found. """ ...
def function[monitor_key_get, parameter[service, key]]: constant[ Gets the value of an existing key in the monitor cluster. :param service: six.string_types. The Ceph user name to run the command under :param key: six.string_types. The key to search for. :return: Returns the value of that key o...
keyword[def] identifier[monitor_key_get] ( identifier[service] , identifier[key] ): literal[string] keyword[try] : identifier[output] = identifier[check_output] ( [ literal[string] , literal[string] , identifier[service] , literal[string] , literal[string] , identifier[str] ( iden...
def monitor_key_get(service, key): """ Gets the value of an existing key in the monitor cluster. :param service: six.string_types. The Ceph user name to run the command under :param key: six.string_types. The key to search for. :return: Returns the value of that key or None if not found. """ ...
def _openResources(self): """ Evaluates the function to result an array """ arr = self._fun() check_is_an_array(arr) self._array = arr
def function[_openResources, parameter[self]]: constant[ Evaluates the function to result an array ] variable[arr] assign[=] call[name[self]._fun, parameter[]] call[name[check_is_an_array], parameter[name[arr]]] name[self]._array assign[=] name[arr]
keyword[def] identifier[_openResources] ( identifier[self] ): literal[string] identifier[arr] = identifier[self] . identifier[_fun] () identifier[check_is_an_array] ( identifier[arr] ) identifier[self] . identifier[_array] = identifier[arr]
def _openResources(self): """ Evaluates the function to result an array """ arr = self._fun() check_is_an_array(arr) self._array = arr
def poll(self): """return pairs of package indices and results of finished tasks This method does not wait for tasks to finish. Returns ------- list A list of pairs of package indices and results """ self.runid_to_return.extend(self.dispatcher.poll...
def function[poll, parameter[self]]: constant[return pairs of package indices and results of finished tasks This method does not wait for tasks to finish. Returns ------- list A list of pairs of package indices and results ] call[name[self].runid_to...
keyword[def] identifier[poll] ( identifier[self] ): literal[string] identifier[self] . identifier[runid_to_return] . identifier[extend] ( identifier[self] . identifier[dispatcher] . identifier[poll] ()) identifier[ret] = identifier[self] . identifier[_collect_all_finished_pkgidx_result_pa...
def poll(self): """return pairs of package indices and results of finished tasks This method does not wait for tasks to finish. Returns ------- list A list of pairs of package indices and results """ self.runid_to_return.extend(self.dispatcher.poll()) r...
def time_multi_coincidence(times, slide_step=0, slop=.003, pivot='H1', fixed='L1'): """ Find multi detector concidences. Parameters ---------- times: dict of numpy.ndarrays Dictionary keyed by ifo of the times of each single detector trigger. slide_step: float ...
def function[time_multi_coincidence, parameter[times, slide_step, slop, pivot, fixed]]: constant[ Find multi detector concidences. Parameters ---------- times: dict of numpy.ndarrays Dictionary keyed by ifo of the times of each single detector trigger. slide_step: float The inte...
keyword[def] identifier[time_multi_coincidence] ( identifier[times] , identifier[slide_step] = literal[int] , identifier[slop] = literal[int] , identifier[pivot] = literal[string] , identifier[fixed] = literal[string] ): literal[string] keyword[def] identifier[win] ( identifier[ifo1] , identifi...
def time_multi_coincidence(times, slide_step=0, slop=0.003, pivot='H1', fixed='L1'): """ Find multi detector concidences. Parameters ---------- times: dict of numpy.ndarrays Dictionary keyed by ifo of the times of each single detector trigger. slide_step: float The interval between ...
def info_dialog(self, title="Information", message="", **kwargs): """ Show an information dialog Usage: C{dialog.info_dialog(title="Information", message="", **kwargs)} @param title: window title for the dialog @param message: message displayed in the dialog ...
def function[info_dialog, parameter[self, title, message]]: constant[ Show an information dialog Usage: C{dialog.info_dialog(title="Information", message="", **kwargs)} @param title: window title for the dialog @param message: message displayed in the dialog ...
keyword[def] identifier[info_dialog] ( identifier[self] , identifier[title] = literal[string] , identifier[message] = literal[string] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[self] . identifier[_run_zenity] ( identifier[title] ,[ literal[string] , literal[string] , iden...
def info_dialog(self, title='Information', message='', **kwargs): """ Show an information dialog Usage: C{dialog.info_dialog(title="Information", message="", **kwargs)} @param title: window title for the dialog @param message: message displayed in the dialog ...
def image(random=random, width=800, height=600, https=False, *args, **kwargs): """ Generate the address of a placeholder image. >>> mock_random.seed(0) >>> image(random=mock_random) 'http://dummyimage.com/800x600/292929/e3e3e3&text=mighty poop' >>> image(random=mock_random, width=60, height=60)...
def function[image, parameter[random, width, height, https]]: constant[ Generate the address of a placeholder image. >>> mock_random.seed(0) >>> image(random=mock_random) 'http://dummyimage.com/800x600/292929/e3e3e3&text=mighty poop' >>> image(random=mock_random, width=60, height=60) 'h...
keyword[def] identifier[image] ( identifier[random] = identifier[random] , identifier[width] = literal[int] , identifier[height] = literal[int] , identifier[https] = keyword[False] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[target_fn] = identifier[noun] keyword[if] ide...
def image(random=random, width=800, height=600, https=False, *args, **kwargs): """ Generate the address of a placeholder image. >>> mock_random.seed(0) >>> image(random=mock_random) 'http://dummyimage.com/800x600/292929/e3e3e3&text=mighty poop' >>> image(random=mock_random, width=60, height=60)...
def select_best_block(blocks): """Return best block selected based on simple heuristic.""" # TODO make this cleverer with more stats if not blocks: raise ValueError("No suitable blocks were found in assembly.") best_block = max(blocks, key=lambda b: b[1]['packed_instr']) if best_block[1]['pa...
def function[select_best_block, parameter[blocks]]: constant[Return best block selected based on simple heuristic.] if <ast.UnaryOp object at 0x7da20c6abac0> begin[:] <ast.Raise object at 0x7da20c6a89d0> variable[best_block] assign[=] call[name[max], parameter[name[blocks]]] if c...
keyword[def] identifier[select_best_block] ( identifier[blocks] ): literal[string] keyword[if] keyword[not] identifier[blocks] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[best_block] = identifier[max] ( identifier[blocks] , identifier[key] = keyword[lambda] ...
def select_best_block(blocks): """Return best block selected based on simple heuristic.""" # TODO make this cleverer with more stats if not blocks: raise ValueError('No suitable blocks were found in assembly.') # depends on [control=['if'], data=[]] best_block = max(blocks, key=lambda b: b[1]['...
def compute_index(self, axis, data_object, compute_diff=True): """Computes the index after a number of rows have been removed. Note: In order for this to be used properly, the indexes must not be changed before you compute this. Args: axis: The axis to extract the index...
def function[compute_index, parameter[self, axis, data_object, compute_diff]]: constant[Computes the index after a number of rows have been removed. Note: In order for this to be used properly, the indexes must not be changed before you compute this. Args: axis: The axi...
keyword[def] identifier[compute_index] ( identifier[self] , identifier[axis] , identifier[data_object] , identifier[compute_diff] = keyword[True] ): literal[string] keyword[def] identifier[pandas_index_extraction] ( identifier[df] , identifier[axis] ): keyword[if] keyword[not] iden...
def compute_index(self, axis, data_object, compute_diff=True): """Computes the index after a number of rows have been removed. Note: In order for this to be used properly, the indexes must not be changed before you compute this. Args: axis: The axis to extract the index fro...
def dump(self, f, indent=''): """Dump this keyword to a file-like object""" if self.__unit is None: print(("%s%s %s" % (indent, self.__name, self.__value)).rstrip(), file=f) else: print(("%s%s [%s] %s" % (indent, self.__name, self.__unit, self.__value)).rstrip(), file=f)
def function[dump, parameter[self, f, indent]]: constant[Dump this keyword to a file-like object] if compare[name[self].__unit is constant[None]] begin[:] call[name[print], parameter[call[binary_operation[constant[%s%s %s] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Name object at 0x7...
keyword[def] identifier[dump] ( identifier[self] , identifier[f] , identifier[indent] = literal[string] ): literal[string] keyword[if] identifier[self] . identifier[__unit] keyword[is] keyword[None] : identifier[print] (( literal[string] %( identifier[indent] , identifier[self] . id...
def dump(self, f, indent=''): """Dump this keyword to a file-like object""" if self.__unit is None: print(('%s%s %s' % (indent, self.__name, self.__value)).rstrip(), file=f) # depends on [control=['if'], data=[]] else: print(('%s%s [%s] %s' % (indent, self.__name, self.__unit, self.__value)...
def isemptyfile(filepath): """Determine if the file both exists and isempty Args: filepath (str, path): file path Returns: bool """ exists = os.path.exists(safepath(filepath)) if exists: filesize = os.path.getsize(safepath(filepath)) return filesize == 0 els...
def function[isemptyfile, parameter[filepath]]: constant[Determine if the file both exists and isempty Args: filepath (str, path): file path Returns: bool ] variable[exists] assign[=] call[name[os].path.exists, parameter[call[name[safepath], parameter[name[filepath]]]]] ...
keyword[def] identifier[isemptyfile] ( identifier[filepath] ): literal[string] identifier[exists] = identifier[os] . identifier[path] . identifier[exists] ( identifier[safepath] ( identifier[filepath] )) keyword[if] identifier[exists] : identifier[filesize] = identifier[os] . identifier[path...
def isemptyfile(filepath): """Determine if the file both exists and isempty Args: filepath (str, path): file path Returns: bool """ exists = os.path.exists(safepath(filepath)) if exists: filesize = os.path.getsize(safepath(filepath)) return filesize == 0 # depe...
def add_column(self, func, name=None, show=True): """Add a column function which takes an id as argument and returns a value.""" assert func name = name or func.__name__ if name == '<lambda>': raise ValueError("Please provide a valid name for " + name) d = {'f...
def function[add_column, parameter[self, func, name, show]]: constant[Add a column function which takes an id as argument and returns a value.] assert[name[func]] variable[name] assign[=] <ast.BoolOp object at 0x7da1b120b1f0> if compare[name[name] equal[==] constant[<lambda>]] begin[...
keyword[def] identifier[add_column] ( identifier[self] , identifier[func] , identifier[name] = keyword[None] , identifier[show] = keyword[True] ): literal[string] keyword[assert] identifier[func] identifier[name] = identifier[name] keyword[or] identifier[func] . identifier[__name__] ...
def add_column(self, func, name=None, show=True): """Add a column function which takes an id as argument and returns a value.""" assert func name = name or func.__name__ if name == '<lambda>': raise ValueError('Please provide a valid name for ' + name) # depends on [control=['if'], data...
def predict(self, X): """Predict risk score of experiencing an event. Higher scores indicate shorter survival (high risk), lower scores longer survival (low risk). Parameters ---------- X : array-like, shape = (n_samples, n_features) The input samples. ...
def function[predict, parameter[self, X]]: constant[Predict risk score of experiencing an event. Higher scores indicate shorter survival (high risk), lower scores longer survival (low risk). Parameters ---------- X : array-like, shape = (n_samples, n_features) ...
keyword[def] identifier[predict] ( identifier[self] , identifier[X] ): literal[string] identifier[K] = identifier[self] . identifier[_get_kernel] ( identifier[X] , identifier[self] . identifier[X_fit_] ) identifier[pred] =- identifier[numpy] . identifier[dot] ( identifier[self] . identifie...
def predict(self, X): """Predict risk score of experiencing an event. Higher scores indicate shorter survival (high risk), lower scores longer survival (low risk). Parameters ---------- X : array-like, shape = (n_samples, n_features) The input samples. ...
def update(self, id, name, incident_preference): """ This API endpoint allows you to update an alert policy :type id: integer :param id: The id of the policy :type name: str :param name: The name of the policy :type incident_preference: str :param incid...
def function[update, parameter[self, id, name, incident_preference]]: constant[ This API endpoint allows you to update an alert policy :type id: integer :param id: The id of the policy :type name: str :param name: The name of the policy :type incident_preferenc...
keyword[def] identifier[update] ( identifier[self] , identifier[id] , identifier[name] , identifier[incident_preference] ): literal[string] identifier[data] ={ literal[string] :{ literal[string] : identifier[name] , literal[string] : identifier[incident_preference] ...
def update(self, id, name, incident_preference): """ This API endpoint allows you to update an alert policy :type id: integer :param id: The id of the policy :type name: str :param name: The name of the policy :type incident_preference: str :param incident_...
def insert_taxon_in_new_fasta_file(self, aln): """primer4clades infers the codon usage table from the taxon names in the sequences. These names need to be enclosed by square brackets and be present in the description of the FASTA sequence. The position is not important. I will i...
def function[insert_taxon_in_new_fasta_file, parameter[self, aln]]: constant[primer4clades infers the codon usage table from the taxon names in the sequences. These names need to be enclosed by square brackets and be present in the description of the FASTA sequence. The position is not ...
keyword[def] identifier[insert_taxon_in_new_fasta_file] ( identifier[self] , identifier[aln] ): literal[string] identifier[new_seq_records] =[] keyword[for] identifier[seq_record] keyword[in] identifier[SeqIO] . identifier[parse] ( identifier[aln] , literal[string] ): ident...
def insert_taxon_in_new_fasta_file(self, aln): """primer4clades infers the codon usage table from the taxon names in the sequences. These names need to be enclosed by square brackets and be present in the description of the FASTA sequence. The position is not important. I will inser...
def name(self): """ The entry’s base filename, relative to the scandir() path argument. Returns: str: name. """ name = self._name.rstrip('/') if self._bytes_path: name = fsencode(name) return name
def function[name, parameter[self]]: constant[ The entry’s base filename, relative to the scandir() path argument. Returns: str: name. ] variable[name] assign[=] call[name[self]._name.rstrip, parameter[constant[/]]] if name[self]._bytes_path begin[:] ...
keyword[def] identifier[name] ( identifier[self] ): literal[string] identifier[name] = identifier[self] . identifier[_name] . identifier[rstrip] ( literal[string] ) keyword[if] identifier[self] . identifier[_bytes_path] : identifier[name] = identifier[fsencode] ( identifier[n...
def name(self): """ The entry’s base filename, relative to the scandir() path argument. Returns: str: name. """ name = self._name.rstrip('/') if self._bytes_path: name = fsencode(name) # depends on [control=['if'], data=[]] return name
def find_next_word_beginning(self, count=1, WORD=False): """ Return an index relative to the cursor position pointing to the start of the next word. Return `None` if nothing was found. """ if count < 0: return self.find_previous_word_beginning(count=-count, WORD=WORD)...
def function[find_next_word_beginning, parameter[self, count, WORD]]: constant[ Return an index relative to the cursor position pointing to the start of the next word. Return `None` if nothing was found. ] if compare[name[count] less[<] constant[0]] begin[:] return[call[n...
keyword[def] identifier[find_next_word_beginning] ( identifier[self] , identifier[count] = literal[int] , identifier[WORD] = keyword[False] ): literal[string] keyword[if] identifier[count] < literal[int] : keyword[return] identifier[self] . identifier[find_previous_word_beginning] ( ...
def find_next_word_beginning(self, count=1, WORD=False): """ Return an index relative to the cursor position pointing to the start of the next word. Return `None` if nothing was found. """ if count < 0: return self.find_previous_word_beginning(count=-count, WORD=WORD) # depends ...
def run(self): """The main loop of the frontend. Here incoming messages from the service are processed and forwarded to the corresponding callback methods.""" self.log.debug("Entered main loop") while not self.shutdown: # If no service is running slow down the main loop ...
def function[run, parameter[self]]: constant[The main loop of the frontend. Here incoming messages from the service are processed and forwarded to the corresponding callback methods.] call[name[self].log.debug, parameter[constant[Entered main loop]]] while <ast.UnaryOp object at 0x7da18c...
keyword[def] identifier[run] ( identifier[self] ): literal[string] identifier[self] . identifier[log] . identifier[debug] ( literal[string] ) keyword[while] keyword[not] identifier[self] . identifier[shutdown] : keyword[if] keyword[not] identifier[self] . identifi...
def run(self): """The main loop of the frontend. Here incoming messages from the service are processed and forwarded to the corresponding callback methods.""" self.log.debug('Entered main loop') while not self.shutdown: # If no service is running slow down the main loop if not self._...
def deleteMask(self,signature): """ Delete just the mask that matches the signature given.""" if signature in self.masklist: self.masklist[signature] = None else: log.warning("No matching mask")
def function[deleteMask, parameter[self, signature]]: constant[ Delete just the mask that matches the signature given.] if compare[name[signature] in name[self].masklist] begin[:] call[name[self].masklist][name[signature]] assign[=] constant[None]
keyword[def] identifier[deleteMask] ( identifier[self] , identifier[signature] ): literal[string] keyword[if] identifier[signature] keyword[in] identifier[self] . identifier[masklist] : identifier[self] . identifier[masklist] [ identifier[signature] ]= keyword[None] keywor...
def deleteMask(self, signature): """ Delete just the mask that matches the signature given.""" if signature in self.masklist: self.masklist[signature] = None # depends on [control=['if'], data=['signature']] else: log.warning('No matching mask')
def _get_serializer(self, _type): """Gets a serializer for a particular type. For primitives, returns the serializer from the module-level serializers. For arrays and objects, uses the special _get_T_serializer methods to build the encoders and decoders. """ if _type in _...
def function[_get_serializer, parameter[self, _type]]: constant[Gets a serializer for a particular type. For primitives, returns the serializer from the module-level serializers. For arrays and objects, uses the special _get_T_serializer methods to build the encoders and decoders. ...
keyword[def] identifier[_get_serializer] ( identifier[self] , identifier[_type] ): literal[string] keyword[if] identifier[_type] keyword[in] identifier[_serializers] : keyword[return] identifier[_serializers] [ identifier[_type] ] keyword[elif] identifier[_ty...
def _get_serializer(self, _type): """Gets a serializer for a particular type. For primitives, returns the serializer from the module-level serializers. For arrays and objects, uses the special _get_T_serializer methods to build the encoders and decoders. """ if _type in _serializ...
def recover_constants(py_source, replacements): #now has n^2 complexity. improve to n '''Converts identifiers representing Js constants to the PyJs constants PyJsNumberConst_1_ which has the true value of 5 will be converted to PyJsNumber(5)''' for identifier, value in replacements.it...
def function[recover_constants, parameter[py_source, replacements]]: constant[Converts identifiers representing Js constants to the PyJs constants PyJsNumberConst_1_ which has the true value of 5 will be converted to PyJsNumber(5)] for taget[tuple[[<ast.Name object at 0x7da20c795690>, <ast.Name obje...
keyword[def] identifier[recover_constants] ( identifier[py_source] , identifier[replacements] ): literal[string] keyword[for] identifier[identifier] , identifier[value] keyword[in] identifier[replacements] . identifier[iteritems] (): keyword[if] identifier[identifier] . identifier[startswith]...
def recover_constants(py_source, replacements): #now has n^2 complexity. improve to n 'Converts identifiers representing Js constants to the PyJs constants\n PyJsNumberConst_1_ which has the true value of 5 will be converted to PyJsNumber(5)' for (identifier, value) in replacements.iteritems(): if i...
def get_client_by_appid(self, authorizer_appid): """ 通过 authorizer_appid 获取 Client 对象 :params authorizer_appid: 授权公众号appid """ access_token_key = '{0}_access_token'.format(authorizer_appid) refresh_token_key = '{0}_refresh_token'.format(authorizer_appid) access_t...
def function[get_client_by_appid, parameter[self, authorizer_appid]]: constant[ 通过 authorizer_appid 获取 Client 对象 :params authorizer_appid: 授权公众号appid ] variable[access_token_key] assign[=] call[constant[{0}_access_token].format, parameter[name[authorizer_appid]]] variabl...
keyword[def] identifier[get_client_by_appid] ( identifier[self] , identifier[authorizer_appid] ): literal[string] identifier[access_token_key] = literal[string] . identifier[format] ( identifier[authorizer_appid] ) identifier[refresh_token_key] = literal[string] . identifier[format] ( iden...
def get_client_by_appid(self, authorizer_appid): """ 通过 authorizer_appid 获取 Client 对象 :params authorizer_appid: 授权公众号appid """ access_token_key = '{0}_access_token'.format(authorizer_appid) refresh_token_key = '{0}_refresh_token'.format(authorizer_appid) access_token = self.sess...
def run_apidoc(_): """This method is required by the setup method below.""" import os dirname = os.path.dirname(__file__) ignore_paths = [os.path.join(dirname, '../../aaf2/model'),] # https://github.com/sphinx-doc/sphinx/blob/master/sphinx/ext/apidoc.py argv = [ '--force', '--no-...
def function[run_apidoc, parameter[_]]: constant[This method is required by the setup method below.] import module[os] variable[dirname] assign[=] call[name[os].path.dirname, parameter[name[__file__]]] variable[ignore_paths] assign[=] list[[<ast.Call object at 0x7da1b16328c0>]] varia...
keyword[def] identifier[run_apidoc] ( identifier[_] ): literal[string] keyword[import] identifier[os] identifier[dirname] = identifier[os] . identifier[path] . identifier[dirname] ( identifier[__file__] ) identifier[ignore_paths] =[ identifier[os] . identifier[path] . identifier[join] ( identif...
def run_apidoc(_): """This method is required by the setup method below.""" import os dirname = os.path.dirname(__file__) ignore_paths = [os.path.join(dirname, '../../aaf2/model')] # https://github.com/sphinx-doc/sphinx/blob/master/sphinx/ext/apidoc.py argv = ['--force', '--no-toc', '--separate'...
def _follow_next(self, url): """Follow the 'next' link on paginated results.""" response = self._json(self._get(url), 200) data = response['data'] next_url = self._get_attribute(response, 'links', 'next') while next_url is not None: response = self._json(self._get(ne...
def function[_follow_next, parameter[self, url]]: constant[Follow the 'next' link on paginated results.] variable[response] assign[=] call[name[self]._json, parameter[call[name[self]._get, parameter[name[url]]], constant[200]]] variable[data] assign[=] call[name[response]][constant[data]] ...
keyword[def] identifier[_follow_next] ( identifier[self] , identifier[url] ): literal[string] identifier[response] = identifier[self] . identifier[_json] ( identifier[self] . identifier[_get] ( identifier[url] ), literal[int] ) identifier[data] = identifier[response] [ literal[string] ] ...
def _follow_next(self, url): """Follow the 'next' link on paginated results.""" response = self._json(self._get(url), 200) data = response['data'] next_url = self._get_attribute(response, 'links', 'next') while next_url is not None: response = self._json(self._get(next_url), 200) dat...
def add(self, document=None, watermark=None, underneath=False, output=None, suffix='watermarked', method='pdfrw'): """ Add a watermark file to an existing PDF document. Rotate and upscale watermark file as needed to fit existing PDF document. Watermark can be overlayed or placed undern...
def function[add, parameter[self, document, watermark, underneath, output, suffix, method]]: constant[ Add a watermark file to an existing PDF document. Rotate and upscale watermark file as needed to fit existing PDF document. Watermark can be overlayed or placed underneath. :...
keyword[def] identifier[add] ( identifier[self] , identifier[document] = keyword[None] , identifier[watermark] = keyword[None] , identifier[underneath] = keyword[False] , identifier[output] = keyword[None] , identifier[suffix] = literal[string] , identifier[method] = literal[string] ): literal[string] ...
def add(self, document=None, watermark=None, underneath=False, output=None, suffix='watermarked', method='pdfrw'): """ Add a watermark file to an existing PDF document. Rotate and upscale watermark file as needed to fit existing PDF document. Watermark can be overlayed or placed underneath...
def _warcprox_opts(self, args): ''' Takes args as produced by the argument parser built by _build_arg_parser and builds warcprox arguments object suitable to pass to warcprox.main.init_controller. Copies some arguments, renames some, populates some with defaults appropriate for b...
def function[_warcprox_opts, parameter[self, args]]: constant[ Takes args as produced by the argument parser built by _build_arg_parser and builds warcprox arguments object suitable to pass to warcprox.main.init_controller. Copies some arguments, renames some, populates some with...
keyword[def] identifier[_warcprox_opts] ( identifier[self] , identifier[args] ): literal[string] identifier[warcprox_opts] = identifier[warcprox] . identifier[Options] () identifier[warcprox_opts] . identifier[address] = literal[string] identifier[warcprox_opts]...
def _warcprox_opts(self, args): """ Takes args as produced by the argument parser built by _build_arg_parser and builds warcprox arguments object suitable to pass to warcprox.main.init_controller. Copies some arguments, renames some, populates some with defaults appropriate for brozz...
def write(self, version): # type: (str) -> None """ Write the project version to .py file. This will regex search in the file for a ``__version__ = VERSION_STRING`` and substitute the version string for the new version. """ with open(self.version_file) as fp: ...
def function[write, parameter[self, version]]: constant[ Write the project version to .py file. This will regex search in the file for a ``__version__ = VERSION_STRING`` and substitute the version string for the new version. ] with call[name[open], parameter[name[self].v...
keyword[def] identifier[write] ( identifier[self] , identifier[version] ): literal[string] keyword[with] identifier[open] ( identifier[self] . identifier[version_file] ) keyword[as] identifier[fp] : identifier[content] = identifier[fp] . identifier[read] () identifier[ver_...
def write(self, version): # type: (str) -> None ' Write the project version to .py file.\n\n This will regex search in the file for a\n ``__version__ = VERSION_STRING`` and substitute the version string\n for the new version.\n ' with open(self.version_file) as fp: conten...
def rtt_get_num_down_buffers(self): """After starting RTT, get the current number of down buffers. Args: self (JLink): the ``JLink`` instance Returns: The number of configured down buffers on the target. Raises: JLinkRTTException if the underlying JLINK_RT...
def function[rtt_get_num_down_buffers, parameter[self]]: constant[After starting RTT, get the current number of down buffers. Args: self (JLink): the ``JLink`` instance Returns: The number of configured down buffers on the target. Raises: JLinkRTTException...
keyword[def] identifier[rtt_get_num_down_buffers] ( identifier[self] ): literal[string] identifier[cmd] = identifier[enums] . identifier[JLinkRTTCommand] . identifier[GETNUMBUF] identifier[dir] = identifier[ctypes] . identifier[c_int] ( identifier[enums] . identifier[JLinkRTTDirection] . ...
def rtt_get_num_down_buffers(self): """After starting RTT, get the current number of down buffers. Args: self (JLink): the ``JLink`` instance Returns: The number of configured down buffers on the target. Raises: JLinkRTTException if the underlying JLINK_RTTERM...
def history_view(self, request, object_id, extra_context=None): "The 'history' admin view for this model." from django.contrib.admin.models import LogEntry # First check if the user can see this history. model = self.model obj = get_object_or_404(self.get_queryset(request), ...
def function[history_view, parameter[self, request, object_id, extra_context]]: constant[The 'history' admin view for this model.] from relative_module[django.contrib.admin.models] import module[LogEntry] variable[model] assign[=] name[self].model variable[obj] assign[=] call[name[get_object...
keyword[def] identifier[history_view] ( identifier[self] , identifier[request] , identifier[object_id] , identifier[extra_context] = keyword[None] ): literal[string] keyword[from] identifier[django] . identifier[contrib] . identifier[admin] . identifier[models] keyword[import] identifier[LogEntr...
def history_view(self, request, object_id, extra_context=None): """The 'history' admin view for this model.""" from django.contrib.admin.models import LogEntry # First check if the user can see this history. model = self.model obj = get_object_or_404(self.get_queryset(request), pk=unquote(object_id)...
def trimmed(self, n_peaks): """ :param n_peaks: number of peaks to keep :returns: an isotope pattern with removed low-intensity peaks :rtype: CentroidedSpectrum """ result = self.copy() result.trim(n_peaks) return result
def function[trimmed, parameter[self, n_peaks]]: constant[ :param n_peaks: number of peaks to keep :returns: an isotope pattern with removed low-intensity peaks :rtype: CentroidedSpectrum ] variable[result] assign[=] call[name[self].copy, parameter[]] call[name[re...
keyword[def] identifier[trimmed] ( identifier[self] , identifier[n_peaks] ): literal[string] identifier[result] = identifier[self] . identifier[copy] () identifier[result] . identifier[trim] ( identifier[n_peaks] ) keyword[return] identifier[result]
def trimmed(self, n_peaks): """ :param n_peaks: number of peaks to keep :returns: an isotope pattern with removed low-intensity peaks :rtype: CentroidedSpectrum """ result = self.copy() result.trim(n_peaks) return result
def make_h5_file(filename,out_dir='./', new_filename = None, max_load = None): ''' Converts file to HDF5 (.h5) format. Default saves output in current dir. ''' fil_file = Waterfall(filename, max_load = max_load) if not new_filename: new_filename = out_dir+filename.replace('.fil','.h5').split('/...
def function[make_h5_file, parameter[filename, out_dir, new_filename, max_load]]: constant[ Converts file to HDF5 (.h5) format. Default saves output in current dir. ] variable[fil_file] assign[=] call[name[Waterfall], parameter[name[filename]]] if <ast.UnaryOp object at 0x7da18f09e3b0> begin...
keyword[def] identifier[make_h5_file] ( identifier[filename] , identifier[out_dir] = literal[string] , identifier[new_filename] = keyword[None] , identifier[max_load] = keyword[None] ): literal[string] identifier[fil_file] = identifier[Waterfall] ( identifier[filename] , identifier[max_load] = identifier[...
def make_h5_file(filename, out_dir='./', new_filename=None, max_load=None): """ Converts file to HDF5 (.h5) format. Default saves output in current dir. """ fil_file = Waterfall(filename, max_load=max_load) if not new_filename: new_filename = out_dir + filename.replace('.fil', '.h5').split('/')[...
def getArc(prom, sig, mc, pos, zerolat): """ Returns the arc of direction between a promissor and a significator. Arguments are also the MC, the geoposition and zerolat to assume zero ecliptical latitudes. ZeroLat true => inZodiaco, false => inMundo """ pRA, pDecl = prom.eqCoords(...
def function[getArc, parameter[prom, sig, mc, pos, zerolat]]: constant[ Returns the arc of direction between a promissor and a significator. Arguments are also the MC, the geoposition and zerolat to assume zero ecliptical latitudes. ZeroLat true => inZodiaco, false => inMundo ] ...
keyword[def] identifier[getArc] ( identifier[prom] , identifier[sig] , identifier[mc] , identifier[pos] , identifier[zerolat] ): literal[string] identifier[pRA] , identifier[pDecl] = identifier[prom] . identifier[eqCoords] ( identifier[zerolat] ) identifier[sRa] , identifier[sDecl] = identifier[sig] ....
def getArc(prom, sig, mc, pos, zerolat): """ Returns the arc of direction between a promissor and a significator. Arguments are also the MC, the geoposition and zerolat to assume zero ecliptical latitudes. ZeroLat true => inZodiaco, false => inMundo """ (pRA, pDecl) = prom.eqCoord...
def write_to_file(self, file_path=''): """ Writes the user emails to file. """ with open(file_path, 'w+') as out: out.write('user, email\n') sorted_names = sorted(self.logins_lower)#sort based on lowercase for login in sorted_names: out...
def function[write_to_file, parameter[self, file_path]]: constant[ Writes the user emails to file. ] with call[name[open], parameter[name[file_path], constant[w+]]] begin[:] call[name[out].write, parameter[constant[user, email ]]] variable[sorted_names] as...
keyword[def] identifier[write_to_file] ( identifier[self] , identifier[file_path] = literal[string] ): literal[string] keyword[with] identifier[open] ( identifier[file_path] , literal[string] ) keyword[as] identifier[out] : identifier[out] . identifier[write] ( literal[string] ) ...
def write_to_file(self, file_path=''): """ Writes the user emails to file. """ with open(file_path, 'w+') as out: out.write('user, email\n') sorted_names = sorted(self.logins_lower) #sort based on lowercase for login in sorted_names: out.write(self.logins_low...
def runSearchFeatures(self, request): """ Returns a SearchFeaturesResponse for the specified SearchFeaturesRequest object. :param request: JSON string representing searchFeaturesRequest :return: JSON string representing searchFeatureResponse """ return self.runSe...
def function[runSearchFeatures, parameter[self, request]]: constant[ Returns a SearchFeaturesResponse for the specified SearchFeaturesRequest object. :param request: JSON string representing searchFeaturesRequest :return: JSON string representing searchFeatureResponse ] ...
keyword[def] identifier[runSearchFeatures] ( identifier[self] , identifier[request] ): literal[string] keyword[return] identifier[self] . identifier[runSearchRequest] ( identifier[request] , identifier[protocol] . identifier[SearchFeaturesRequest] , identifier[protocol] . identif...
def runSearchFeatures(self, request): """ Returns a SearchFeaturesResponse for the specified SearchFeaturesRequest object. :param request: JSON string representing searchFeaturesRequest :return: JSON string representing searchFeatureResponse """ return self.runSearchRequ...
def Uninstall(self, package_name, keep_data=False, timeout_ms=None): """Removes a package from the device. Args: package_name: Package name of target package. keep_data: whether to keep the data and cache directories timeout_ms: Expected timeout for pushing and installing....
def function[Uninstall, parameter[self, package_name, keep_data, timeout_ms]]: constant[Removes a package from the device. Args: package_name: Package name of target package. keep_data: whether to keep the data and cache directories timeout_ms: Expected timeout for pushing...
keyword[def] identifier[Uninstall] ( identifier[self] , identifier[package_name] , identifier[keep_data] = keyword[False] , identifier[timeout_ms] = keyword[None] ): literal[string] identifier[cmd] =[ literal[string] ] keyword[if] identifier[keep_data] : identifier[cmd] . ide...
def Uninstall(self, package_name, keep_data=False, timeout_ms=None): """Removes a package from the device. Args: package_name: Package name of target package. keep_data: whether to keep the data and cache directories timeout_ms: Expected timeout for pushing and installing. ...
def qos_map_cos_traffic_class_cos7(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") qos = ET.SubElement(config, "qos", xmlns="urn:brocade.com:mgmt:brocade-qos") map = ET.SubElement(qos, "map") cos_traffic_class = ET.SubElement(map, "cos-traffic-cl...
def function[qos_map_cos_traffic_class_cos7, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[qos] assign[=] call[name[ET].SubElement, parameter[name[config], constant[qos]]] variable[map] ass...
keyword[def] identifier[qos_map_cos_traffic_class_cos7] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[qos] = identifier[ET] . identifier[SubElement] ( identifier[config] , literal[string...
def qos_map_cos_traffic_class_cos7(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') qos = ET.SubElement(config, 'qos', xmlns='urn:brocade.com:mgmt:brocade-qos') map = ET.SubElement(qos, 'map') cos_traffic_class = ET.SubElement(map, 'cos-traffic-class') name_key =...
def create_server(self, datacenter_id, server): """ Creates a server within the data center. :param datacenter_id: The unique ID of the data center. :type datacenter_id: ``str`` :param server: A dict of the server to be created. :type server: ``dic...
def function[create_server, parameter[self, datacenter_id, server]]: constant[ Creates a server within the data center. :param datacenter_id: The unique ID of the data center. :type datacenter_id: ``str`` :param server: A dict of the server to be created. ...
keyword[def] identifier[create_server] ( identifier[self] , identifier[datacenter_id] , identifier[server] ): literal[string] identifier[data] = identifier[json] . identifier[dumps] ( identifier[self] . identifier[_create_server_dict] ( identifier[server] )) identifier[response] = identi...
def create_server(self, datacenter_id, server): """ Creates a server within the data center. :param datacenter_id: The unique ID of the data center. :type datacenter_id: ``str`` :param server: A dict of the server to be created. :type server: ``dict`` ...
def upload_jterator_project(self, pipeline, handles): '''Uploads a *jterator* project. Parameters ---------- pipeline: dict description of the jterator pipeline handles: dict, optional description of each module in the jterator pipeline See also ...
def function[upload_jterator_project, parameter[self, pipeline, handles]]: constant[Uploads a *jterator* project. Parameters ---------- pipeline: dict description of the jterator pipeline handles: dict, optional description of each module in the jterator ...
keyword[def] identifier[upload_jterator_project] ( identifier[self] , identifier[pipeline] , identifier[handles] ): literal[string] identifier[logger] . identifier[info] ( literal[string] , identifier[self] . identifier[experiment_name] ) identifier[content] ={ l...
def upload_jterator_project(self, pipeline, handles): """Uploads a *jterator* project. Parameters ---------- pipeline: dict description of the jterator pipeline handles: dict, optional description of each module in the jterator pipeline See also ...
def create_absolute_values_structure(layer, fields): """Helper function to create the structure for absolute values. :param layer: The vector layer. :type layer: QgsVectorLayer :param fields: List of name field on which we want to aggregate. :type fields: list :return: The data structure. ...
def function[create_absolute_values_structure, parameter[layer, fields]]: constant[Helper function to create the structure for absolute values. :param layer: The vector layer. :type layer: QgsVectorLayer :param fields: List of name field on which we want to aggregate. :type fields: list :...
keyword[def] identifier[create_absolute_values_structure] ( identifier[layer] , identifier[fields] ): literal[string] identifier[source_fields] = identifier[layer] . identifier[keywords] [ literal[string] ] identifier[absolute_fields] =[ identifier[field] [ literal[string] ] keyword[for] id...
def create_absolute_values_structure(layer, fields): """Helper function to create the structure for absolute values. :param layer: The vector layer. :type layer: QgsVectorLayer :param fields: List of name field on which we want to aggregate. :type fields: list :return: The data structure. ...
def subscribe_list(self, list_id): """ Subscribe to a list :param list_id: list ID number :return: :class:`~responsebot.models.List` object """ return List(tweepy_list_to_json(self._client.subscribe_list(list_id=list_id)))
def function[subscribe_list, parameter[self, list_id]]: constant[ Subscribe to a list :param list_id: list ID number :return: :class:`~responsebot.models.List` object ] return[call[name[List], parameter[call[name[tweepy_list_to_json], parameter[call[name[self]._client.subscr...
keyword[def] identifier[subscribe_list] ( identifier[self] , identifier[list_id] ): literal[string] keyword[return] identifier[List] ( identifier[tweepy_list_to_json] ( identifier[self] . identifier[_client] . identifier[subscribe_list] ( identifier[list_id] = identifier[list_id] )))
def subscribe_list(self, list_id): """ Subscribe to a list :param list_id: list ID number :return: :class:`~responsebot.models.List` object """ return List(tweepy_list_to_json(self._client.subscribe_list(list_id=list_id)))
def isEquilateral(self): ''' True if all sides of the triangle are the same length. All equilateral triangles are also isosceles. All equilateral triangles are also acute. ''' if not nearly_eq(self.a, self.b): return False if not nearly_eq(self.b, s...
def function[isEquilateral, parameter[self]]: constant[ True if all sides of the triangle are the same length. All equilateral triangles are also isosceles. All equilateral triangles are also acute. ] if <ast.UnaryOp object at 0x7da1b10d69b0> begin[:] return[con...
keyword[def] identifier[isEquilateral] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[nearly_eq] ( identifier[self] . identifier[a] , identifier[self] . identifier[b] ): keyword[return] keyword[False] keyword[if] keyword[not] identifier[nearly...
def isEquilateral(self): """ True if all sides of the triangle are the same length. All equilateral triangles are also isosceles. All equilateral triangles are also acute. """ if not nearly_eq(self.a, self.b): return False # depends on [control=['if'], data=[]] if ...
def validate(df, criteria={}, exclude_on_fail=False, **kwargs): """Validate scenarios using criteria on timeseries values Parameters ---------- df: IamDataFrame instance args: see `IamDataFrame.validate()` for details kwargs: passed to `df.filter()` """ fdf = df.filter(**kwargs) if ...
def function[validate, parameter[df, criteria, exclude_on_fail]]: constant[Validate scenarios using criteria on timeseries values Parameters ---------- df: IamDataFrame instance args: see `IamDataFrame.validate()` for details kwargs: passed to `df.filter()` ] variable[fdf] assig...
keyword[def] identifier[validate] ( identifier[df] , identifier[criteria] ={}, identifier[exclude_on_fail] = keyword[False] ,** identifier[kwargs] ): literal[string] identifier[fdf] = identifier[df] . identifier[filter] (** identifier[kwargs] ) keyword[if] identifier[len] ( identifier[fdf] . identifi...
def validate(df, criteria={}, exclude_on_fail=False, **kwargs): """Validate scenarios using criteria on timeseries values Parameters ---------- df: IamDataFrame instance args: see `IamDataFrame.validate()` for details kwargs: passed to `df.filter()` """ fdf = df.filter(**kwargs) if ...
def drop_matching_records(self, check): """Remove a record from the DB.""" matches = self._match(check) for m in matches: del self._records[m['msg_id']]
def function[drop_matching_records, parameter[self, check]]: constant[Remove a record from the DB.] variable[matches] assign[=] call[name[self]._match, parameter[name[check]]] for taget[name[m]] in starred[name[matches]] begin[:] <ast.Delete object at 0x7da18ede79d0>
keyword[def] identifier[drop_matching_records] ( identifier[self] , identifier[check] ): literal[string] identifier[matches] = identifier[self] . identifier[_match] ( identifier[check] ) keyword[for] identifier[m] keyword[in] identifier[matches] : keyword[del] identifier[s...
def drop_matching_records(self, check): """Remove a record from the DB.""" matches = self._match(check) for m in matches: del self._records[m['msg_id']] # depends on [control=['for'], data=['m']]
def main(): """ Commandline interface to extract parameters. """ setup_main_logger(console=True, file_logging=False) params = argparse.ArgumentParser(description="Extract specific parameters.") arguments.add_extract_args(params) args = params.parse_args() extract_parameters(args)
def function[main, parameter[]]: constant[ Commandline interface to extract parameters. ] call[name[setup_main_logger], parameter[]] variable[params] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[arguments].add_extract_args, parameter[name[params]]] ...
keyword[def] identifier[main] (): literal[string] identifier[setup_main_logger] ( identifier[console] = keyword[True] , identifier[file_logging] = keyword[False] ) identifier[params] = identifier[argparse] . identifier[ArgumentParser] ( identifier[description] = literal[string] ) identifier[argum...
def main(): """ Commandline interface to extract parameters. """ setup_main_logger(console=True, file_logging=False) params = argparse.ArgumentParser(description='Extract specific parameters.') arguments.add_extract_args(params) args = params.parse_args() extract_parameters(args)
def split_values(ustring, sep=u','): """ Splits unicode string with separator C{sep}, but skips escaped separator. @param ustring: string to split @type ustring: C{unicode} @param sep: separator (default to u',') @type sep: C{unicode} @return: tuple of splitted elements ...
def function[split_values, parameter[ustring, sep]]: constant[ Splits unicode string with separator C{sep}, but skips escaped separator. @param ustring: string to split @type ustring: C{unicode} @param sep: separator (default to u',') @type sep: C{unicode} @return: tup...
keyword[def] identifier[split_values] ( identifier[ustring] , identifier[sep] = literal[string] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[ustring] , identifier[six] . identifier[text_type] ), literal[string] % identifier[type] ( identifier[ustring] ) identifier[...
def split_values(ustring, sep=u','): """ Splits unicode string with separator C{sep}, but skips escaped separator. @param ustring: string to split @type ustring: C{unicode} @param sep: separator (default to u',') @type sep: C{unicode} @return: tuple of splitted elements ...
def get_start_time(self): """ Return the start time of the entry as a :class:`datetime.time` object. If the start time is `None`, the end time of the previous entry will be returned instead. If the current entry doesn't have a duration in the form of a tuple, if there's no previo...
def function[get_start_time, parameter[self]]: constant[ Return the start time of the entry as a :class:`datetime.time` object. If the start time is `None`, the end time of the previous entry will be returned instead. If the current entry doesn't have a duration in the form of a ...
keyword[def] identifier[get_start_time] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[self] . identifier[duration] , identifier[tuple] ): keyword[return] keyword[None] keyword[if] identifier[self] . identifier[duration...
def get_start_time(self): """ Return the start time of the entry as a :class:`datetime.time` object. If the start time is `None`, the end time of the previous entry will be returned instead. If the current entry doesn't have a duration in the form of a tuple, if there's no previous e...
def update(self, other=(), **kwargs): '''Just like `dict.update`''' _kwargs = dict(kwargs) _kwargs.update(other) for key, value in _kwargs.items(): self[key] = value
def function[update, parameter[self, other]]: constant[Just like `dict.update`] variable[_kwargs] assign[=] call[name[dict], parameter[name[kwargs]]] call[name[_kwargs].update, parameter[name[other]]] for taget[tuple[[<ast.Name object at 0x7da1b1b6b520>, <ast.Name object at 0x7da1b1b6af5...
keyword[def] identifier[update] ( identifier[self] , identifier[other] =(),** identifier[kwargs] ): literal[string] identifier[_kwargs] = identifier[dict] ( identifier[kwargs] ) identifier[_kwargs] . identifier[update] ( identifier[other] ) keyword[for] identifier[key] , identifi...
def update(self, other=(), **kwargs): """Just like `dict.update`""" _kwargs = dict(kwargs) _kwargs.update(other) for (key, value) in _kwargs.items(): self[key] = value # depends on [control=['for'], data=[]]
def _setweights(self): "Apply dropout to the raw weights." for layer in self.layer_names: raw_w = getattr(self, f'{layer}_raw') self.module._parameters[layer] = F.dropout(raw_w, p=self.weight_p, training=self.training)
def function[_setweights, parameter[self]]: constant[Apply dropout to the raw weights.] for taget[name[layer]] in starred[name[self].layer_names] begin[:] variable[raw_w] assign[=] call[name[getattr], parameter[name[self], <ast.JoinedStr object at 0x7da1b1e9a980>]] call[n...
keyword[def] identifier[_setweights] ( identifier[self] ): literal[string] keyword[for] identifier[layer] keyword[in] identifier[self] . identifier[layer_names] : identifier[raw_w] = identifier[getattr] ( identifier[self] , literal[string] ) identifier[self] . identifie...
def _setweights(self): """Apply dropout to the raw weights.""" for layer in self.layer_names: raw_w = getattr(self, f'{layer}_raw') self.module._parameters[layer] = F.dropout(raw_w, p=self.weight_p, training=self.training) # depends on [control=['for'], data=['layer']]
def load_device(self, serial=None): """Creates an AndroidDevice for the given serial number. If no serial is given, it will read from the ANDROID_SERIAL environmental variable. If the environmental variable is not set, then it will read from 'adb devices' if there is only one. "...
def function[load_device, parameter[self, serial]]: constant[Creates an AndroidDevice for the given serial number. If no serial is given, it will read from the ANDROID_SERIAL environmental variable. If the environmental variable is not set, then it will read from 'adb devices' if there ...
keyword[def] identifier[load_device] ( identifier[self] , identifier[serial] = keyword[None] ): literal[string] identifier[serials] = identifier[android_device] . identifier[list_adb_devices] () keyword[if] keyword[not] identifier[serials] : keyword[raise] identifier[Error]...
def load_device(self, serial=None): """Creates an AndroidDevice for the given serial number. If no serial is given, it will read from the ANDROID_SERIAL environmental variable. If the environmental variable is not set, then it will read from 'adb devices' if there is only one. """ ...
def warp(self, order): """对order/market的封装 [description] Arguments: order {[type]} -- [description] Returns: [type] -- [description] """ # 因为成交模式对时间的封装 if order.order_model == ORDER_MODEL.MARKET: if order.frequence is FREQ...
def function[warp, parameter[self, order]]: constant[对order/market的封装 [description] Arguments: order {[type]} -- [description] Returns: [type] -- [description] ] if compare[name[order].order_model equal[==] name[ORDER_MODEL].MARKET] begin[:] ...
keyword[def] identifier[warp] ( identifier[self] , identifier[order] ): literal[string] keyword[if] identifier[order] . identifier[order_model] == identifier[ORDER_MODEL] . identifier[MARKET] : keyword[if] identifier[order] . identifier[frequence] keyword[is] identifier...
def warp(self, order): """对order/market的封装 [description] Arguments: order {[type]} -- [description] Returns: [type] -- [description] """ # 因为成交模式对时间的封装 if order.order_model == ORDER_MODEL.MARKET: if order.frequence is FREQUENCE.DAY: ...
def powernodes_containing(self, name, directly=False) -> iter: """Yield all power nodes containing (power) node of given *name*. If *directly* is True, will only yield the direct parent of given name. """ if directly: yield from (node for node in self.all_in(name) ...
def function[powernodes_containing, parameter[self, name, directly]]: constant[Yield all power nodes containing (power) node of given *name*. If *directly* is True, will only yield the direct parent of given name. ] if name[directly] begin[:] <ast.YieldFrom object at 0x...
keyword[def] identifier[powernodes_containing] ( identifier[self] , identifier[name] , identifier[directly] = keyword[False] )-> identifier[iter] : literal[string] keyword[if] identifier[directly] : keyword[yield] keyword[from] ( identifier[node] keyword[for] identifier[node] keyw...
def powernodes_containing(self, name, directly=False) -> iter: """Yield all power nodes containing (power) node of given *name*. If *directly* is True, will only yield the direct parent of given name. """ if directly: yield from (node for node in self.all_in(name) if name in self.inclu...
def _write_str(self, data): """ Converts the given data then writes it :param data: Data to be written :return: The result of ``self.output.write()`` """ with self.__lock: self.output.write( to_str(data, self.encoding) .encode(...
def function[_write_str, parameter[self, data]]: constant[ Converts the given data then writes it :param data: Data to be written :return: The result of ``self.output.write()`` ] with name[self].__lock begin[:] call[name[self].output.write, parameter[call...
keyword[def] identifier[_write_str] ( identifier[self] , identifier[data] ): literal[string] keyword[with] identifier[self] . identifier[__lock] : identifier[self] . identifier[output] . identifier[write] ( identifier[to_str] ( identifier[data] , identifier[self] . identi...
def _write_str(self, data): """ Converts the given data then writes it :param data: Data to be written :return: The result of ``self.output.write()`` """ with self.__lock: self.output.write(to_str(data, self.encoding).encode().decode(self.out_encoding, errors='replace'))...
def demo(host, port): """Basic demo of the monitoring capabilities.""" # logging.basicConfig(level=logging.DEBUG) loop = asyncio.get_event_loop() stl = AsyncSatel(host, port, loop, [1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 15, 16, 17, 18, 19, ...
def function[demo, parameter[host, port]]: constant[Basic demo of the monitoring capabilities.] variable[loop] assign[=] call[name[asyncio].get_event_loop, parameter[]] variable[stl] assign[=] call[name[AsyncSatel], parameter[name[host], name[port], name[loop], list[[<ast.Constant object at 0x7d...
keyword[def] identifier[demo] ( identifier[host] , identifier[port] ): literal[string] identifier[loop] = identifier[asyncio] . identifier[get_event_loop] () identifier[stl] = identifier[AsyncSatel] ( identifier[host] , identifier[port] , identifier[loop] , [ literal[int] , literal...
def demo(host, port): """Basic demo of the monitoring capabilities.""" # logging.basicConfig(level=logging.DEBUG) loop = asyncio.get_event_loop() stl = AsyncSatel(host, port, loop, [1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30], [8, 9, 10]) loop.run_...
def _init(): """Initialize the furious context and registry. NOTE: Do not directly run this method. """ # If there is a context and it is initialized to this request, # return, otherwise reinitialize the _local_context. if (hasattr(_local_context, '_initialized') and _local_context....
def function[_init, parameter[]]: constant[Initialize the furious context and registry. NOTE: Do not directly run this method. ] if <ast.BoolOp object at 0x7da1b197e950> begin[:] return[None] name[_local_context].registry assign[=] list[[]] name[_local_context]._executin...
keyword[def] identifier[_init] (): literal[string] keyword[if] ( identifier[hasattr] ( identifier[_local_context] , literal[string] ) keyword[and] identifier[_local_context] . identifier[_initialized] == identifier[os] . identifier[environ] . identifier[get] ( literal[string] )): k...
def _init(): """Initialize the furious context and registry. NOTE: Do not directly run this method. """ # If there is a context and it is initialized to this request, # return, otherwise reinitialize the _local_context. if hasattr(_local_context, '_initialized') and _local_context._initialized ...
def addVar(self, sig: object, name: str, sigType: VCD_SIG_TYPE, width: int, valueFormatter: Callable[["Value"], str]): """ Add variable to scope :ivar sig: user specified object to keep track of VcdVarInfo in change() :ivar sigType: vcd type name :ivar valueForma...
def function[addVar, parameter[self, sig, name, sigType, width, valueFormatter]]: constant[ Add variable to scope :ivar sig: user specified object to keep track of VcdVarInfo in change() :ivar sigType: vcd type name :ivar valueFormatter: value which converts new value in change...
keyword[def] identifier[addVar] ( identifier[self] , identifier[sig] : identifier[object] , identifier[name] : identifier[str] , identifier[sigType] : identifier[VCD_SIG_TYPE] , identifier[width] : identifier[int] , identifier[valueFormatter] : identifier[Callable] [[ literal[string] ], identifier[str] ]): ...
def addVar(self, sig: object, name: str, sigType: VCD_SIG_TYPE, width: int, valueFormatter: Callable[['Value'], str]): """ Add variable to scope :ivar sig: user specified object to keep track of VcdVarInfo in change() :ivar sigType: vcd type name :ivar valueFormatter: value which c...
def itunessd_to_dics(itunessd): """ :param itunessd: the whole iTunesSD bytes data :return: translate to tree object, see doc of dics_to_itunessd """ # header header_size = get_table_size(header_table) header_chunk = itunessd[0:header_size] header_dic = chunk_to_dic(header_chunk, header...
def function[itunessd_to_dics, parameter[itunessd]]: constant[ :param itunessd: the whole iTunesSD bytes data :return: translate to tree object, see doc of dics_to_itunessd ] variable[header_size] assign[=] call[name[get_table_size], parameter[name[header_table]]] variable[header_chu...
keyword[def] identifier[itunessd_to_dics] ( identifier[itunessd] ): literal[string] identifier[header_size] = identifier[get_table_size] ( identifier[header_table] ) identifier[header_chunk] = identifier[itunessd] [ literal[int] : identifier[header_size] ] identifier[header_dic] = identifie...
def itunessd_to_dics(itunessd): """ :param itunessd: the whole iTunesSD bytes data :return: translate to tree object, see doc of dics_to_itunessd """ # header header_size = get_table_size(header_table) header_chunk = itunessd[0:header_size] header_dic = chunk_to_dic(header_chunk, header_...
def _convert_and_box_cache(arg, cache_array, box, errors, name=None): """ Convert array of dates with a cache and box the result Parameters ---------- arg : integer, float, string, datetime, list, tuple, 1-d array, Series cache_array : Series Cache of converted, unique dates box : b...
def function[_convert_and_box_cache, parameter[arg, cache_array, box, errors, name]]: constant[ Convert array of dates with a cache and box the result Parameters ---------- arg : integer, float, string, datetime, list, tuple, 1-d array, Series cache_array : Series Cache of converted...
keyword[def] identifier[_convert_and_box_cache] ( identifier[arg] , identifier[cache_array] , identifier[box] , identifier[errors] , identifier[name] = keyword[None] ): literal[string] keyword[from] identifier[pandas] keyword[import] identifier[Series] , identifier[DatetimeIndex] , identifier[Index] ...
def _convert_and_box_cache(arg, cache_array, box, errors, name=None): """ Convert array of dates with a cache and box the result Parameters ---------- arg : integer, float, string, datetime, list, tuple, 1-d array, Series cache_array : Series Cache of converted, unique dates box : b...
def lookup_token(self, token=None, accessor=False, wrap_ttl=None): """GET /auth/token/lookup/<token> GET /auth/token/lookup-accessor/<token-accessor> GET /auth/token/lookup-self :param token: :type token: str. :param accessor: :type accessor: str. :para...
def function[lookup_token, parameter[self, token, accessor, wrap_ttl]]: constant[GET /auth/token/lookup/<token> GET /auth/token/lookup-accessor/<token-accessor> GET /auth/token/lookup-self :param token: :type token: str. :param accessor: :type accessor: str. ...
keyword[def] identifier[lookup_token] ( identifier[self] , identifier[token] = keyword[None] , identifier[accessor] = keyword[False] , identifier[wrap_ttl] = keyword[None] ): literal[string] identifier[token_param] ={ literal[string] : identifier[token] , } identifier[acce...
def lookup_token(self, token=None, accessor=False, wrap_ttl=None): """GET /auth/token/lookup/<token> GET /auth/token/lookup-accessor/<token-accessor> GET /auth/token/lookup-self :param token: :type token: str. :param accessor: :type accessor: str. :param wr...
def get_buildroot(self, worker_metadatas): """ Build the buildroot entry of the metadata. :return: list, containing dicts of partial metadata """ buildroots = [] for platform in sorted(worker_metadatas.keys()): for instance in worker_metadatas[platform]['buil...
def function[get_buildroot, parameter[self, worker_metadatas]]: constant[ Build the buildroot entry of the metadata. :return: list, containing dicts of partial metadata ] variable[buildroots] assign[=] list[[]] for taget[name[platform]] in starred[call[name[sorted], para...
keyword[def] identifier[get_buildroot] ( identifier[self] , identifier[worker_metadatas] ): literal[string] identifier[buildroots] =[] keyword[for] identifier[platform] keyword[in] identifier[sorted] ( identifier[worker_metadatas] . identifier[keys] ()): keyword[for] ident...
def get_buildroot(self, worker_metadatas): """ Build the buildroot entry of the metadata. :return: list, containing dicts of partial metadata """ buildroots = [] for platform in sorted(worker_metadatas.keys()): for instance in worker_metadatas[platform]['buildroots']: ...
def get_locations_list(self, lower_bound=0, upper_bound=None): """ Return the internal location list. Args: lower_bound: upper_bound: Returns: """ real_upper_bound = upper_bound if upper_bound is None: real_upper_bound = self....
def function[get_locations_list, parameter[self, lower_bound, upper_bound]]: constant[ Return the internal location list. Args: lower_bound: upper_bound: Returns: ] variable[real_upper_bound] assign[=] name[upper_bound] if compare[name[up...
keyword[def] identifier[get_locations_list] ( identifier[self] , identifier[lower_bound] = literal[int] , identifier[upper_bound] = keyword[None] ): literal[string] identifier[real_upper_bound] = identifier[upper_bound] keyword[if] identifier[upper_bound] keyword[is] keyword[None] : ...
def get_locations_list(self, lower_bound=0, upper_bound=None): """ Return the internal location list. Args: lower_bound: upper_bound: Returns: """ real_upper_bound = upper_bound if upper_bound is None: real_upper_bound = self.nbr_of_sub_locat...
def poisson(x, layer_fn=tf.compat.v1.layers.dense, log_rate_fn=lambda x: x, name=None): """Constructs a trainable `tfd.Poisson` distribution. This function creates a Poisson distribution parameterized by log rate. Using default args, this function is mathematically equivalent ...
def function[poisson, parameter[x, layer_fn, log_rate_fn, name]]: constant[Constructs a trainable `tfd.Poisson` distribution. This function creates a Poisson distribution parameterized by log rate. Using default args, this function is mathematically equivalent to: ```none Y = Poisson(log_rate=matmul(W...
keyword[def] identifier[poisson] ( identifier[x] , identifier[layer_fn] = identifier[tf] . identifier[compat] . identifier[v1] . identifier[layers] . identifier[dense] , identifier[log_rate_fn] = keyword[lambda] identifier[x] : identifier[x] , identifier[name] = keyword[None] ): literal[string] keyword[wit...
def poisson(x, layer_fn=tf.compat.v1.layers.dense, log_rate_fn=lambda x: x, name=None): """Constructs a trainable `tfd.Poisson` distribution. This function creates a Poisson distribution parameterized by log rate. Using default args, this function is mathematically equivalent to: ```none Y = Poisson(log_r...
def cftime_to_timestamp(date, time_unit='us'): """Converts cftime to timestamp since epoch in milliseconds Non-standard calendars (e.g. Julian or no leap calendars) are converted to standard Gregorian calendar. This can cause extra space to be added for dates that don't exist in the original calend...
def function[cftime_to_timestamp, parameter[date, time_unit]]: constant[Converts cftime to timestamp since epoch in milliseconds Non-standard calendars (e.g. Julian or no leap calendars) are converted to standard Gregorian calendar. This can cause extra space to be added for dates that don't exist ...
keyword[def] identifier[cftime_to_timestamp] ( identifier[date] , identifier[time_unit] = literal[string] ): literal[string] keyword[import] identifier[cftime] identifier[utime] = identifier[cftime] . identifier[utime] ( literal[string] ) keyword[if] identifier[time_unit] == literal[string] : ...
def cftime_to_timestamp(date, time_unit='us'): """Converts cftime to timestamp since epoch in milliseconds Non-standard calendars (e.g. Julian or no leap calendars) are converted to standard Gregorian calendar. This can cause extra space to be added for dates that don't exist in the original calend...
def _psi_n(x, n, b): """ Compute the n-th term in the infinite sum of the Jacobi density. """ return 2**(b-1) / gamma(b) * (-1)**n * \ np.exp(gammaln(n+b) - gammaln(n+1) + np.log(2*n+b) - 0.5 * np.log(2*np.pi*x**3) - (2*n+b)**2 / (8.*x))
def function[_psi_n, parameter[x, n, b]]: constant[ Compute the n-th term in the infinite sum of the Jacobi density. ] return[binary_operation[binary_operation[binary_operation[binary_operation[constant[2] ** binary_operation[name[b] - constant[1]]] / call[name[gamma], parameter[name[b]]]] * bin...
keyword[def] identifier[_psi_n] ( identifier[x] , identifier[n] , identifier[b] ): literal[string] keyword[return] literal[int] **( identifier[b] - literal[int] )/ identifier[gamma] ( identifier[b] )*(- literal[int] )** identifier[n] * identifier[np] . identifier[exp] ( identifier[gammaln] ( identifier[n]...
def _psi_n(x, n, b): """ Compute the n-th term in the infinite sum of the Jacobi density. """ return 2 ** (b - 1) / gamma(b) * (-1) ** n * np.exp(gammaln(n + b) - gammaln(n + 1) + np.log(2 * n + b) - 0.5 * np.log(2 * np.pi * x ** 3) - (2 * n + b) ** 2 / (8.0 * x))
def _build_proxy_contract_creation_constructor(self, master_copy: str, initializer: bytes, funder: str, payment_toke...
def function[_build_proxy_contract_creation_constructor, parameter[self, master_copy, initializer, funder, payment_token, payment]]: constant[ :param master_copy: Master Copy of Gnosis Safe already deployed :param initializer: Data initializer to send to GnosisSafe setup method :param fu...
keyword[def] identifier[_build_proxy_contract_creation_constructor] ( identifier[self] , identifier[master_copy] : identifier[str] , identifier[initializer] : identifier[bytes] , identifier[funder] : identifier[str] , identifier[payment_token] : identifier[str] , identifier[payment] : identifier[int] )-> identif...
def _build_proxy_contract_creation_constructor(self, master_copy: str, initializer: bytes, funder: str, payment_token: str, payment: int) -> ContractConstructor: """ :param master_copy: Master Copy of Gnosis Safe already deployed :param initializer: Data initializer to send to GnosisSafe setup metho...
def endpoint_class(collection): """Return the :class:`sandman.model.Model` associated with the endpoint *collection*. :param string collection: a :class:`sandman.model.Model` endpoint :rtype: :class:`sandman.model.Model` """ with app.app_context(): try: cls = current_app.cl...
def function[endpoint_class, parameter[collection]]: constant[Return the :class:`sandman.model.Model` associated with the endpoint *collection*. :param string collection: a :class:`sandman.model.Model` endpoint :rtype: :class:`sandman.model.Model` ] with call[name[app].app_context, par...
keyword[def] identifier[endpoint_class] ( identifier[collection] ): literal[string] keyword[with] identifier[app] . identifier[app_context] (): keyword[try] : identifier[cls] = identifier[current_app] . identifier[class_references] [ identifier[collection] ] keyword[except] ...
def endpoint_class(collection): """Return the :class:`sandman.model.Model` associated with the endpoint *collection*. :param string collection: a :class:`sandman.model.Model` endpoint :rtype: :class:`sandman.model.Model` """ with app.app_context(): try: cls = current_app.cl...
def extent_to_array(extent, source_crs, dest_crs=None): """Convert the supplied extent to geographic and return as an array. :param extent: Rectangle defining a spatial extent in any CRS. :type extent: QgsRectangle :param source_crs: Coordinate system used for input extent. :type source_crs: QgsCo...
def function[extent_to_array, parameter[extent, source_crs, dest_crs]]: constant[Convert the supplied extent to geographic and return as an array. :param extent: Rectangle defining a spatial extent in any CRS. :type extent: QgsRectangle :param source_crs: Coordinate system used for input extent. ...
keyword[def] identifier[extent_to_array] ( identifier[extent] , identifier[source_crs] , identifier[dest_crs] = keyword[None] ): literal[string] keyword[if] identifier[dest_crs] keyword[is] keyword[None] : identifier[geo_crs] = identifier[QgsCoordinateReferenceSystem] () identifier[ge...
def extent_to_array(extent, source_crs, dest_crs=None): """Convert the supplied extent to geographic and return as an array. :param extent: Rectangle defining a spatial extent in any CRS. :type extent: QgsRectangle :param source_crs: Coordinate system used for input extent. :type source_crs: QgsCo...
def args_str(self): """ Return an args string for the repr. """ matched = [str(m) for m in self._matchers[:self._position]] unmatched = [str(m) for m in self._matchers[self._position:]] return 'matched=[{}], unmatched=[{}]'.format( ', '.join(matched), ', '.joi...
def function[args_str, parameter[self]]: constant[ Return an args string for the repr. ] variable[matched] assign[=] <ast.ListComp object at 0x7da1b242ad70> variable[unmatched] assign[=] <ast.ListComp object at 0x7da1b2428670> return[call[constant[matched=[{}], unmatched=[{}]...
keyword[def] identifier[args_str] ( identifier[self] ): literal[string] identifier[matched] =[ identifier[str] ( identifier[m] ) keyword[for] identifier[m] keyword[in] identifier[self] . identifier[_matchers] [: identifier[self] . identifier[_position] ]] identifier[unmatched] =[ identi...
def args_str(self): """ Return an args string for the repr. """ matched = [str(m) for m in self._matchers[:self._position]] unmatched = [str(m) for m in self._matchers[self._position:]] return 'matched=[{}], unmatched=[{}]'.format(', '.join(matched), ', '.join(unmatched))