code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def gelman_rubin(x, return_var=False): """ Returns estimate of R for a set of traces. The Gelman-Rubin diagnostic tests for lack of convergence by comparing the variance between multiple chains to the variance within each chain. If convergence has been achieved, the between-chain and within-chain v...
def function[gelman_rubin, parameter[x, return_var]]: constant[ Returns estimate of R for a set of traces. The Gelman-Rubin diagnostic tests for lack of convergence by comparing the variance between multiple chains to the variance within each chain. If convergence has been achieved, the between-cha...
keyword[def] identifier[gelman_rubin] ( identifier[x] , identifier[return_var] = keyword[False] ): literal[string] keyword[if] identifier[np] . identifier[shape] ( identifier[x] )<( literal[int] ,): keyword[raise] identifier[ValueError] ( literal[string] ) keyword[try] : ...
def gelman_rubin(x, return_var=False): """ Returns estimate of R for a set of traces. The Gelman-Rubin diagnostic tests for lack of convergence by comparing the variance between multiple chains to the variance within each chain. If convergence has been achieved, the between-chain and within-chain v...
def convert_md_to_rst(md_path, rst_temp_path): """ Convert the contents of a file from Markdown to reStructuredText. Returns the converted text as a Unicode string. Arguments: md_path: a path to a UTF-8 encoded Markdown file to convert. rst_temp_path: a temporary path to which to write t...
def function[convert_md_to_rst, parameter[md_path, rst_temp_path]]: constant[ Convert the contents of a file from Markdown to reStructuredText. Returns the converted text as a Unicode string. Arguments: md_path: a path to a UTF-8 encoded Markdown file to convert. rst_temp_path: a tem...
keyword[def] identifier[convert_md_to_rst] ( identifier[md_path] , identifier[rst_temp_path] ): literal[string] identifier[command] = literal[string] %( identifier[rst_temp_path] , identifier[md_path] ) identifier[print] ( literal[string] %( identifier[md_path] , identifier[rst_temp_path] , ...
def convert_md_to_rst(md_path, rst_temp_path): """ Convert the contents of a file from Markdown to reStructuredText. Returns the converted text as a Unicode string. Arguments: md_path: a path to a UTF-8 encoded Markdown file to convert. rst_temp_path: a temporary path to which to write t...
def grad(heads, variables, head_grads=None, retain_graph=None, create_graph=False, train_mode=True): #pylint: disable=redefined-outer-name """Compute the gradients of heads w.r.t variables. Gradients will be returned as new NDArrays instead of stored into `variable.grad`. Supports recording gradie...
def function[grad, parameter[heads, variables, head_grads, retain_graph, create_graph, train_mode]]: constant[Compute the gradients of heads w.r.t variables. Gradients will be returned as new NDArrays instead of stored into `variable.grad`. Supports recording gradient graph for computing higher order gr...
keyword[def] identifier[grad] ( identifier[heads] , identifier[variables] , identifier[head_grads] = keyword[None] , identifier[retain_graph] = keyword[None] , identifier[create_graph] = keyword[False] , identifier[train_mode] = keyword[True] ): literal[string] identifier[head_handles] , identifier[hgrad_...
def grad(heads, variables, head_grads=None, retain_graph=None, create_graph=False, train_mode=True): #pylint: disable=redefined-outer-name 'Compute the gradients of heads w.r.t variables. Gradients will be\n returned as new NDArrays instead of stored into `variable.grad`.\n Supports recording gradient graph ...
def hrscan(self, name, key_start, key_end, limit=10): """ Return a dict mapping key/value in the top ``limit`` keys between ``key_start`` and ``key_end`` within hash ``name`` in descending order .. note:: The range is (``key_start``, ``key_end``]. The ``key_start`` isn't in t...
def function[hrscan, parameter[self, name, key_start, key_end, limit]]: constant[ Return a dict mapping key/value in the top ``limit`` keys between ``key_start`` and ``key_end`` within hash ``name`` in descending order .. note:: The range is (``key_start``, ``key_end``]. The ``key_start...
keyword[def] identifier[hrscan] ( identifier[self] , identifier[name] , identifier[key_start] , identifier[key_end] , identifier[limit] = literal[int] ): literal[string] identifier[limit] = identifier[get_positive_integer] ( literal[string] , identifier[limit] ) keyword[return] identifier...
def hrscan(self, name, key_start, key_end, limit=10): """ Return a dict mapping key/value in the top ``limit`` keys between ``key_start`` and ``key_end`` within hash ``name`` in descending order .. note:: The range is (``key_start``, ``key_end``]. The ``key_start`` isn't in the r...
def ping(awsclient, function_name, alias_name=ALIAS_NAME, version=None): """Send a ping request to a lambda function. :param awsclient: :param function_name: :param alias_name: :param version: :return: ping response payload """ log.debug('sending ping to lambda function: %s', function_n...
def function[ping, parameter[awsclient, function_name, alias_name, version]]: constant[Send a ping request to a lambda function. :param awsclient: :param function_name: :param alias_name: :param version: :return: ping response payload ] call[name[log].debug, parameter[constant[s...
keyword[def] identifier[ping] ( identifier[awsclient] , identifier[function_name] , identifier[alias_name] = identifier[ALIAS_NAME] , identifier[version] = keyword[None] ): literal[string] identifier[log] . identifier[debug] ( literal[string] , identifier[function_name] ) identifier[payload] = literal...
def ping(awsclient, function_name, alias_name=ALIAS_NAME, version=None): """Send a ping request to a lambda function. :param awsclient: :param function_name: :param alias_name: :param version: :return: ping response payload """ log.debug('sending ping to lambda function: %s', function_n...
def _copy_element_meta_data_from_meta_file_data(meta_data, element_m, element_name, element_id): """Helper method to assign the meta of the given element The method assigns the meta data of the elements from the given meta data dictionary. The copied meta data is then removed from the dictionar...
def function[_copy_element_meta_data_from_meta_file_data, parameter[meta_data, element_m, element_name, element_id]]: constant[Helper method to assign the meta of the given element The method assigns the meta data of the elements from the given meta data dictionary. The copied meta data is then...
keyword[def] identifier[_copy_element_meta_data_from_meta_file_data] ( identifier[meta_data] , identifier[element_m] , identifier[element_name] , identifier[element_id] ): literal[string] identifier[meta_data_element_id] = identifier[element_name] + identifier[str] ( identifier[element_id] ) ...
def _copy_element_meta_data_from_meta_file_data(meta_data, element_m, element_name, element_id): """Helper method to assign the meta of the given element The method assigns the meta data of the elements from the given meta data dictionary. The copied meta data is then removed from the dictionary. ...
def create_user(self, customer_id, name, login, password, role=FastlyRoles.USER, require_new_password=True): """Create a user.""" body = self._formdata({ "customer_id": customer_id, "name": name, "login": login, "password": password, "role": role, "require_new_password": require_new_password, },...
def function[create_user, parameter[self, customer_id, name, login, password, role, require_new_password]]: constant[Create a user.] variable[body] assign[=] call[name[self]._formdata, parameter[dictionary[[<ast.Constant object at 0x7da1b11101c0>, <ast.Constant object at 0x7da1b11125c0>, <ast.Constant o...
keyword[def] identifier[create_user] ( identifier[self] , identifier[customer_id] , identifier[name] , identifier[login] , identifier[password] , identifier[role] = identifier[FastlyRoles] . identifier[USER] , identifier[require_new_password] = keyword[True] ): literal[string] identifier[body] = identifier[sel...
def create_user(self, customer_id, name, login, password, role=FastlyRoles.USER, require_new_password=True): """Create a user.""" body = self._formdata({'customer_id': customer_id, 'name': name, 'login': login, 'password': password, 'role': role, 'require_new_password': require_new_password}, FastlyUser.FIELDS)...
def raise_or_lock(self, key, timeout): """ Checks if the task is locked and raises an exception, else locks the task. By default, the tasks and the key expire after 60 minutes. (meaning it will not be executed and the lock will clear). """ acquired = Lock( sel...
def function[raise_or_lock, parameter[self, key, timeout]]: constant[ Checks if the task is locked and raises an exception, else locks the task. By default, the tasks and the key expire after 60 minutes. (meaning it will not be executed and the lock will clear). ] variabl...
keyword[def] identifier[raise_or_lock] ( identifier[self] , identifier[key] , identifier[timeout] ): literal[string] identifier[acquired] = identifier[Lock] ( identifier[self] . identifier[redis] , identifier[key] , identifier[timeout] = identifier[timeout] , ide...
def raise_or_lock(self, key, timeout): """ Checks if the task is locked and raises an exception, else locks the task. By default, the tasks and the key expire after 60 minutes. (meaning it will not be executed and the lock will clear). """ acquired = Lock(self.redis, key, timeout...
def send_data(socket, data, scan_parameters={}, name='ReadoutData'): '''Sends the data of every read out (raw data and meta data) via ZeroMQ to a specified socket ''' if not scan_parameters: scan_parameters = {} data_meta_data = dict( name=name, dtype=str(data[0].dtype), ...
def function[send_data, parameter[socket, data, scan_parameters, name]]: constant[Sends the data of every read out (raw data and meta data) via ZeroMQ to a specified socket ] if <ast.UnaryOp object at 0x7da1b11a2c20> begin[:] variable[scan_parameters] assign[=] dictionary[[], []] ...
keyword[def] identifier[send_data] ( identifier[socket] , identifier[data] , identifier[scan_parameters] ={}, identifier[name] = literal[string] ): literal[string] keyword[if] keyword[not] identifier[scan_parameters] : identifier[scan_parameters] ={} identifier[data_meta_data] = identifier[...
def send_data(socket, data, scan_parameters={}, name='ReadoutData'): """Sends the data of every read out (raw data and meta data) via ZeroMQ to a specified socket """ if not scan_parameters: scan_parameters = {} # depends on [control=['if'], data=[]] # float # float # int # dict da...
def present(name, vname=None, vdata=None, vtype='REG_SZ', use_32bit_registry=False, win_owner=None, win_perms=None, win_deny_perms=None, win_inheritance=True, win_perms_reset=False): r''' Ensure a registr...
def function[present, parameter[name, vname, vdata, vtype, use_32bit_registry, win_owner, win_perms, win_deny_perms, win_inheritance, win_perms_reset]]: constant[ Ensure a registry key or value is present. Args: name (str): A string value representing the full path of the key to in...
keyword[def] identifier[present] ( identifier[name] , identifier[vname] = keyword[None] , identifier[vdata] = keyword[None] , identifier[vtype] = literal[string] , identifier[use_32bit_registry] = keyword[False] , identifier[win_owner] = keyword[None] , identifier[win_perms] = keyword[None] , identifier[win_de...
def present(name, vname=None, vdata=None, vtype='REG_SZ', use_32bit_registry=False, win_owner=None, win_perms=None, win_deny_perms=None, win_inheritance=True, win_perms_reset=False): """ Ensure a registry key or value is present. Args: name (str): A string value representing the full p...
def get_satellite5_info(self, branch_info): """ Get remote_leaf for Satellite 5 Managed box """ logger.debug( "Remote branch not -1 but remote leaf is -1, must be Satellite 5") if os.path.isfile('/etc/sysconfig/rhn/systemid'): logger.debug("Found systemid ...
def function[get_satellite5_info, parameter[self, branch_info]]: constant[ Get remote_leaf for Satellite 5 Managed box ] call[name[logger].debug, parameter[constant[Remote branch not -1 but remote leaf is -1, must be Satellite 5]]] if call[name[os].path.isfile, parameter[constant...
keyword[def] identifier[get_satellite5_info] ( identifier[self] , identifier[branch_info] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] ) keyword[if] identifier[os] . identifier[path] . identifier[isfile] ( literal[string] ): identifier[...
def get_satellite5_info(self, branch_info): """ Get remote_leaf for Satellite 5 Managed box """ logger.debug('Remote branch not -1 but remote leaf is -1, must be Satellite 5') if os.path.isfile('/etc/sysconfig/rhn/systemid'): logger.debug('Found systemid file') sat5_conf = ET...
def diff(self, dt=None, abs=True): """ Returns the difference between two Time objects as an Duration. :type dt: Time or None :param abs: Whether to return an absolute interval or not :type abs: bool :rtype: Duration """ if dt is None: dt = ...
def function[diff, parameter[self, dt, abs]]: constant[ Returns the difference between two Time objects as an Duration. :type dt: Time or None :param abs: Whether to return an absolute interval or not :type abs: bool :rtype: Duration ] if compare[name[d...
keyword[def] identifier[diff] ( identifier[self] , identifier[dt] = keyword[None] , identifier[abs] = keyword[True] ): literal[string] keyword[if] identifier[dt] keyword[is] keyword[None] : identifier[dt] = identifier[pendulum] . identifier[now] (). identifier[time] () keyw...
def diff(self, dt=None, abs=True): """ Returns the difference between two Time objects as an Duration. :type dt: Time or None :param abs: Whether to return an absolute interval or not :type abs: bool :rtype: Duration """ if dt is None: dt = pendulum.now...
def iter_filth(self, text): """Iterate over the different types of filth that can exist. """ # currently doing this by aggregating all_filths and then sorting # inline instead of with a Filth.__cmp__ method, which is apparently # much slower http://stackoverflow.com/a/988728/5647...
def function[iter_filth, parameter[self, text]]: constant[Iterate over the different types of filth that can exist. ] variable[all_filths] assign[=] list[[]] for taget[name[detector]] in starred[call[name[self]._detectors.values, parameter[]]] begin[:] for taget[name[filt...
keyword[def] identifier[iter_filth] ( identifier[self] , identifier[text] ): literal[string] identifier[all_filths] =[] keyword[for] identifier[detector] keyword[in] identifier[self] . identifier[_detectors] . identifier[val...
def iter_filth(self, text): """Iterate over the different types of filth that can exist. """ # currently doing this by aggregating all_filths and then sorting # inline instead of with a Filth.__cmp__ method, which is apparently # much slower http://stackoverflow.com/a/988728/564709 # # N...
def update(self, ns, docid, raw, **kw): """ Perform a single update operation. {'docid': ObjectId('4e95ae3616692111bb000001'), 'ns': u'mydb.tweets', 'raw': {u'h': -5295451122737468990L, u'ns': u'mydb.tweets', u'o': {u'$set': {u'con...
def function[update, parameter[self, ns, docid, raw]]: constant[ Perform a single update operation. {'docid': ObjectId('4e95ae3616692111bb000001'), 'ns': u'mydb.tweets', 'raw': {u'h': -5295451122737468990L, u'ns': u'mydb.tweets', u...
keyword[def] identifier[update] ( identifier[self] , identifier[ns] , identifier[docid] , identifier[raw] ,** identifier[kw] ): literal[string] identifier[self] . identifier[_dest_coll] ( identifier[ns] ). identifier[update] ( identifier[raw] [ literal[string] ], identifier[raw] [ literal[string] ]...
def update(self, ns, docid, raw, **kw): """ Perform a single update operation. {'docid': ObjectId('4e95ae3616692111bb000001'), 'ns': u'mydb.tweets', 'raw': {u'h': -5295451122737468990L, u'ns': u'mydb.tweets', u'o': {u'$set': {u'content...
def process_single_message_from_queue(self): """ Tries to read a single message from the queue and let the associated task process it. :return: bool: True if we processed a message, otherwise False """ try: message = self.message_queue.get_nowait() task_id...
def function[process_single_message_from_queue, parameter[self]]: constant[ Tries to read a single message from the queue and let the associated task process it. :return: bool: True if we processed a message, otherwise False ] <ast.Try object at 0x7da18bc718a0>
keyword[def] identifier[process_single_message_from_queue] ( identifier[self] ): literal[string] keyword[try] : identifier[message] = identifier[self] . identifier[message_queue] . identifier[get_nowait] () identifier[task_id] , identifier[data] = identifier[message] ...
def process_single_message_from_queue(self): """ Tries to read a single message from the queue and let the associated task process it. :return: bool: True if we processed a message, otherwise False """ try: message = self.message_queue.get_nowait() (task_id, data) = messa...
def char_spacing(self, dots): '''Specifes character spacing in dots. Args: dots: the character spacing you desire, in dots Returns: None Raises: RuntimeError: Invalid dot amount. ''' if dots in range(0,127): self.se...
def function[char_spacing, parameter[self, dots]]: constant[Specifes character spacing in dots. Args: dots: the character spacing you desire, in dots Returns: None Raises: RuntimeError: Invalid dot amount. ] if compare[name[dot...
keyword[def] identifier[char_spacing] ( identifier[self] , identifier[dots] ): literal[string] keyword[if] identifier[dots] keyword[in] identifier[range] ( literal[int] , literal[int] ): identifier[self] . identifier[send] ( identifier[chr] ( literal[int] )+ identifier[chr] ( litera...
def char_spacing(self, dots): """Specifes character spacing in dots. Args: dots: the character spacing you desire, in dots Returns: None Raises: RuntimeError: Invalid dot amount. """ if dots in range(0, 127): self.send(chr(27) ...
def visit(self, obj): """Visit a node or a list of nodes. Other values are ignored""" if isinstance(obj, list): return list(filter(lambda x: x is not None, map(self.visit, obj))) elif isinstance(obj, ast.AST): return self._visit_one(obj) else: return o...
def function[visit, parameter[self, obj]]: constant[Visit a node or a list of nodes. Other values are ignored] if call[name[isinstance], parameter[name[obj], name[list]]] begin[:] return[call[name[list], parameter[call[name[filter], parameter[<ast.Lambda object at 0x7da18dc9ab90>, call[name[map]...
keyword[def] identifier[visit] ( identifier[self] , identifier[obj] ): literal[string] keyword[if] identifier[isinstance] ( identifier[obj] , identifier[list] ): keyword[return] identifier[list] ( identifier[filter] ( keyword[lambda] identifier[x] : identifier[x] keyword[is] keywo...
def visit(self, obj): """Visit a node or a list of nodes. Other values are ignored""" if isinstance(obj, list): return list(filter(lambda x: x is not None, map(self.visit, obj))) # depends on [control=['if'], data=[]] elif isinstance(obj, ast.AST): return self._visit_one(obj) # depends on ...
def linescore(self): """Returns the linescore for the game as a DataFrame.""" doc = self.get_main_doc() table = doc('table#line_score') columns = [th.text() for th in table('tr.thead').items('th')] columns[0] = 'team_id' data = [ [sportsref.utils.flatten_lin...
def function[linescore, parameter[self]]: constant[Returns the linescore for the game as a DataFrame.] variable[doc] assign[=] call[name[self].get_main_doc, parameter[]] variable[table] assign[=] call[name[doc], parameter[constant[table#line_score]]] variable[columns] assign[=] <ast.List...
keyword[def] identifier[linescore] ( identifier[self] ): literal[string] identifier[doc] = identifier[self] . identifier[get_main_doc] () identifier[table] = identifier[doc] ( literal[string] ) identifier[columns] =[ identifier[th] . identifier[text] () keyword[for] identifier[t...
def linescore(self): """Returns the linescore for the game as a DataFrame.""" doc = self.get_main_doc() table = doc('table#line_score') columns = [th.text() for th in table('tr.thead').items('th')] columns[0] = 'team_id' data = [[sportsref.utils.flatten_links(td) for td in tr('td').items()] for ...
def _handle_response(self): """ returns RESTBase response if appropriate """ content = self.cache['restbase']['info']['content-type'] if content.startswith('text/html'): html = self.cache['restbase']['response'] if isinstance(html, bytes): ...
def function[_handle_response, parameter[self]]: constant[ returns RESTBase response if appropriate ] variable[content] assign[=] call[call[call[name[self].cache][constant[restbase]]][constant[info]]][constant[content-type]] if call[name[content].startswith, parameter[constant[te...
keyword[def] identifier[_handle_response] ( identifier[self] ): literal[string] identifier[content] = identifier[self] . identifier[cache] [ literal[string] ][ literal[string] ][ literal[string] ] keyword[if] identifier[content] . identifier[startswith] ( literal[string] ): i...
def _handle_response(self): """ returns RESTBase response if appropriate """ content = self.cache['restbase']['info']['content-type'] if content.startswith('text/html'): html = self.cache['restbase']['response'] if isinstance(html, bytes): html = html.decode('utf-...
def collision_encode(self, src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta): ''' Information about a potential collision src : Collision data source (uint8_t) id ...
def function[collision_encode, parameter[self, src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta]]: constant[ Information about a potential collision src : Collision data source (uint8_t) ...
keyword[def] identifier[collision_encode] ( identifier[self] , identifier[src] , identifier[id] , identifier[action] , identifier[threat_level] , identifier[time_to_minimum_delta] , identifier[altitude_minimum_delta] , identifier[horizontal_minimum_delta] ): literal[string] keyword[...
def collision_encode(self, src, id, action, threat_level, time_to_minimum_delta, altitude_minimum_delta, horizontal_minimum_delta): """ Information about a potential collision src : Collision data source (uint8_t) id : Uni...
def add_variable(self, v, bias, vartype=None): """Add variable v and/or its bias to a binary quadratic model. Args: v (variable): The variable to add to the model. Can be any python object that is a valid dict key. bias (bias): Li...
def function[add_variable, parameter[self, v, bias, vartype]]: constant[Add variable v and/or its bias to a binary quadratic model. Args: v (variable): The variable to add to the model. Can be any python object that is a valid dict key. bias (bia...
keyword[def] identifier[add_variable] ( identifier[self] , identifier[v] , identifier[bias] , identifier[vartype] = keyword[None] ): literal[string] keyword[if] identifier[vartype] keyword[is] keyword[not] keyword[None] keyword[and] identifier[vartype] keyword[is] keyword[not] id...
def add_variable(self, v, bias, vartype=None): """Add variable v and/or its bias to a binary quadratic model. Args: v (variable): The variable to add to the model. Can be any python object that is a valid dict key. bias (bias): Linear...
def apply_widget_options(self, field_name): """ Applies additional widget options like changing the input type of DateInput and TimeInput to "date" / "time" to enable Browser date pickers or other attributes/properties. """ widget = self.fields[field_name].widget ...
def function[apply_widget_options, parameter[self, field_name]]: constant[ Applies additional widget options like changing the input type of DateInput and TimeInput to "date" / "time" to enable Browser date pickers or other attributes/properties. ] variable[widget] assign...
keyword[def] identifier[apply_widget_options] ( identifier[self] , identifier[field_name] ): literal[string] identifier[widget] = identifier[self] . identifier[fields] [ identifier[field_name] ]. identifier[widget] keyword[if] identifier[isinstance] ( identifier[widget] , identifier[for...
def apply_widget_options(self, field_name): """ Applies additional widget options like changing the input type of DateInput and TimeInput to "date" / "time" to enable Browser date pickers or other attributes/properties. """ widget = self.fields[field_name].widget if isinstanc...
def _cryptodome_encrypt(cipher_factory, plaintext, key, iv): """Use a Pycryptodome cipher factory to encrypt data. :param cipher_factory: Factory callable that builds a Pycryptodome Cipher instance based on the key and IV :type cipher_factory: callable :param bytes plaintext: Plaintext data to ...
def function[_cryptodome_encrypt, parameter[cipher_factory, plaintext, key, iv]]: constant[Use a Pycryptodome cipher factory to encrypt data. :param cipher_factory: Factory callable that builds a Pycryptodome Cipher instance based on the key and IV :type cipher_factory: callable :param byte...
keyword[def] identifier[_cryptodome_encrypt] ( identifier[cipher_factory] , identifier[plaintext] , identifier[key] , identifier[iv] ): literal[string] identifier[encryptor] = identifier[cipher_factory] ( identifier[key] , identifier[iv] ) keyword[return] identifier[encryptor] . identifier[encrypt] (...
def _cryptodome_encrypt(cipher_factory, plaintext, key, iv): """Use a Pycryptodome cipher factory to encrypt data. :param cipher_factory: Factory callable that builds a Pycryptodome Cipher instance based on the key and IV :type cipher_factory: callable :param bytes plaintext: Plaintext data to ...
def pretty_str(self, indent=0): """Return a human-readable string representation of this object. Kwargs: indent (int): The amount of spaces to use as indentation. """ return '\n\n'.join( codeobj.pretty_str(indent=indent) for codeobj in self.ch...
def function[pretty_str, parameter[self, indent]]: constant[Return a human-readable string representation of this object. Kwargs: indent (int): The amount of spaces to use as indentation. ] return[call[constant[ ].join, parameter[<ast.GeneratorExp object at 0x7da18eb57cd0>]]]
keyword[def] identifier[pretty_str] ( identifier[self] , identifier[indent] = literal[int] ): literal[string] keyword[return] literal[string] . identifier[join] ( identifier[codeobj] . identifier[pretty_str] ( identifier[indent] = identifier[indent] ) keyword[for] identifier[cod...
def pretty_str(self, indent=0): """Return a human-readable string representation of this object. Kwargs: indent (int): The amount of spaces to use as indentation. """ return '\n\n'.join((codeobj.pretty_str(indent=indent) for codeobj in self.children))
def create_Variable(self,name,value,dimensions,toCreate=None,createDim=None,extend=True): """ create_Variable : This function adds data to :class:`altimetry.data.hydro_data` :parameter name: name of the parameter to create :parameter value: values associated to the variable...
def function[create_Variable, parameter[self, name, value, dimensions, toCreate, createDim, extend]]: constant[ create_Variable : This function adds data to :class:`altimetry.data.hydro_data` :parameter name: name of the parameter to create :parameter value: values associated to...
keyword[def] identifier[create_Variable] ( identifier[self] , identifier[name] , identifier[value] , identifier[dimensions] , identifier[toCreate] = keyword[None] , identifier[createDim] = keyword[None] , identifier[extend] = keyword[True] ): literal[string] ...
def create_Variable(self, name, value, dimensions, toCreate=None, createDim=None, extend=True): """ create_Variable : This function adds data to :class:`altimetry.data.hydro_data` :parameter name: name of the parameter to create :parameter value: values associated to the variable. M...
def implicitly_wait(self, time_to_wait): """ Sets a sticky timeout to implicitly wait for an element to be found, or a command to complete. This method only needs to be called one time per session. To set the timeout for calls to execute_async_script, see set_script_time...
def function[implicitly_wait, parameter[self, time_to_wait]]: constant[ Sets a sticky timeout to implicitly wait for an element to be found, or a command to complete. This method only needs to be called one time per session. To set the timeout for calls to execute_async_...
keyword[def] identifier[implicitly_wait] ( identifier[self] , identifier[time_to_wait] ): literal[string] keyword[if] identifier[self] . identifier[w3c] : identifier[self] . identifier[execute] ( identifier[Command] . identifier[SET_TIMEOUTS] ,{ literal[string] : identifi...
def implicitly_wait(self, time_to_wait): """ Sets a sticky timeout to implicitly wait for an element to be found, or a command to complete. This method only needs to be called one time per session. To set the timeout for calls to execute_async_script, see set_script_timeout....
def originalTextFor(expr, asString=True): """Helper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. ...
def function[originalTextFor, parameter[expr, asString]]: constant[Helper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the orig...
keyword[def] identifier[originalTextFor] ( identifier[expr] , identifier[asString] = keyword[True] ): literal[string] identifier[locMarker] = identifier[Empty] (). identifier[setParseAction] ( keyword[lambda] identifier[s] , identifier[loc] , identifier[t] : identifier[loc] ) identifier[endlocMarker]...
def originalTextFor(expr, asString=True): """Helper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. ...
def is_admin(self): """Is the user a system administrator""" return self.role == self.roles.administrator.value and self.state == State.approved
def function[is_admin, parameter[self]]: constant[Is the user a system administrator] return[<ast.BoolOp object at 0x7da204347850>]
keyword[def] identifier[is_admin] ( identifier[self] ): literal[string] keyword[return] identifier[self] . identifier[role] == identifier[self] . identifier[roles] . identifier[administrator] . identifier[value] keyword[and] identifier[self] . identifier[state] == identifier[State] . identifier[...
def is_admin(self): """Is the user a system administrator""" return self.role == self.roles.administrator.value and self.state == State.approved
def _Liquid(T, P=0.1): """Supplementary release on properties of liquid water at 0.1 MPa Parameters ---------- T : float Temperature, [K] P : float Pressure, [MPa] Although this relation is for P=0.1MPa, can be extrapoled at pressure 0.3 MPa Returns ------- ...
def function[_Liquid, parameter[T, P]]: constant[Supplementary release on properties of liquid water at 0.1 MPa Parameters ---------- T : float Temperature, [K] P : float Pressure, [MPa] Although this relation is for P=0.1MPa, can be extrapoled at pressure 0.3 MP...
keyword[def] identifier[_Liquid] ( identifier[T] , identifier[P] = literal[int] ): literal[string] keyword[if] identifier[T] <= literal[int] keyword[or] identifier[T] >= literal[int] keyword[or] identifier[P] < literal[int] keyword[or] identifier[P] > literal[int] : keyword[raise] ide...
def _Liquid(T, P=0.1): """Supplementary release on properties of liquid water at 0.1 MPa Parameters ---------- T : float Temperature, [K] P : float Pressure, [MPa] Although this relation is for P=0.1MPa, can be extrapoled at pressure 0.3 MPa Returns ------- ...
def get_alias(self, alias=None, manifest=None, verify=True, sizes=False, dcd=None): # pylint: disable=too-many-arguments """ Get the blob hashes assigned to an alias. :param alias: Alias name. You ...
def function[get_alias, parameter[self, alias, manifest, verify, sizes, dcd]]: constant[ Get the blob hashes assigned to an alias. :param alias: Alias name. You almost definitely will only need to pass this argument. :type alias: str :param manifest: If you previously obtained ...
keyword[def] identifier[get_alias] ( identifier[self] , identifier[alias] = keyword[None] , identifier[manifest] = keyword[None] , identifier[verify] = keyword[True] , identifier[sizes] = keyword[False] , identifier[dcd] = keyword[None] ): literal[string] keyword[return] identifier[self] . i...
def get_alias(self, alias=None, manifest=None, verify=True, sizes=False, dcd=None): # pylint: disable=too-many-arguments "\n Get the blob hashes assigned to an alias.\n\n :param alias: Alias name. You almost definitely will only need to pass this argument.\n :type alias: str\n\n :par...
def find_coordinates(hmms, bit_thresh): """ find 16S rRNA gene sequence coordinates """ # get coordinates from cmsearch output seq2hmm = parse_hmm(hmms, bit_thresh) seq2hmm = best_model(seq2hmm) group2hmm = {} # group2hmm[seq][group] = [model, strand, coordinates, matches, gaps] for seq,...
def function[find_coordinates, parameter[hmms, bit_thresh]]: constant[ find 16S rRNA gene sequence coordinates ] variable[seq2hmm] assign[=] call[name[parse_hmm], parameter[name[hmms], name[bit_thresh]]] variable[seq2hmm] assign[=] call[name[best_model], parameter[name[seq2hmm]]] ...
keyword[def] identifier[find_coordinates] ( identifier[hmms] , identifier[bit_thresh] ): literal[string] identifier[seq2hmm] = identifier[parse_hmm] ( identifier[hmms] , identifier[bit_thresh] ) identifier[seq2hmm] = identifier[best_model] ( identifier[seq2hmm] ) identifier[group2hmm] ={} ...
def find_coordinates(hmms, bit_thresh): """ find 16S rRNA gene sequence coordinates """ # get coordinates from cmsearch output seq2hmm = parse_hmm(hmms, bit_thresh) seq2hmm = best_model(seq2hmm) group2hmm = {} # group2hmm[seq][group] = [model, strand, coordinates, matches, gaps] for (se...
def totz(when, tz=None): """ Return a date, time, or datetime converted to a datetime in the given timezone. If when is a datetime and has no timezone it is assumed to be local time. Date and time objects are also assumed to be UTC. The tz value defaults to UTC. Raise TypeError if when cannot be convert...
def function[totz, parameter[when, tz]]: constant[ Return a date, time, or datetime converted to a datetime in the given timezone. If when is a datetime and has no timezone it is assumed to be local time. Date and time objects are also assumed to be UTC. The tz value defaults to UTC. Raise TypeError...
keyword[def] identifier[totz] ( identifier[when] , identifier[tz] = keyword[None] ): literal[string] keyword[if] identifier[when] keyword[is] keyword[None] : keyword[return] keyword[None] identifier[when] = identifier[to_datetime] ( identifier[when] ) keyword[if] identifier[when] ....
def totz(when, tz=None): """ Return a date, time, or datetime converted to a datetime in the given timezone. If when is a datetime and has no timezone it is assumed to be local time. Date and time objects are also assumed to be UTC. The tz value defaults to UTC. Raise TypeError if when cannot be convert...
def delegate_method(other, method, name=None): """Add a method to the current class that delegates to another method. The *other* argument must be a property that returns the instance to delegate to. Due to an implementation detail, the property must be defined in the current class. The *method* argume...
def function[delegate_method, parameter[other, method, name]]: constant[Add a method to the current class that delegates to another method. The *other* argument must be a property that returns the instance to delegate to. Due to an implementation detail, the property must be defined in the current ...
keyword[def] identifier[delegate_method] ( identifier[other] , identifier[method] , identifier[name] = keyword[None] ): literal[string] identifier[frame] = identifier[sys] . identifier[_getframe] ( literal[int] ) identifier[classdict] = identifier[frame] . identifier[f_locals] @ identifier[funct...
def delegate_method(other, method, name=None): """Add a method to the current class that delegates to another method. The *other* argument must be a property that returns the instance to delegate to. Due to an implementation detail, the property must be defined in the current class. The *method* argume...
def create_table(self, model): """Create model and table in database. >> migrator.create_table(model) """ self.orm[model._meta.table_name] = model model._meta.database = self.database self.ops.append(model.create_table) return model
def function[create_table, parameter[self, model]]: constant[Create model and table in database. >> migrator.create_table(model) ] call[name[self].orm][name[model]._meta.table_name] assign[=] name[model] name[model]._meta.database assign[=] name[self].database call[name[...
keyword[def] identifier[create_table] ( identifier[self] , identifier[model] ): literal[string] identifier[self] . identifier[orm] [ identifier[model] . identifier[_meta] . identifier[table_name] ]= identifier[model] identifier[model] . identifier[_meta] . identifier[database] = identifie...
def create_table(self, model): """Create model and table in database. >> migrator.create_table(model) """ self.orm[model._meta.table_name] = model model._meta.database = self.database self.ops.append(model.create_table) return model
def labels(self): """ Get field label for fields """ if type(self.object_list) == type([]): model = self.formset.model else: model = self.object_list.model for field in self.visible_fields: name = None if self.formset: ...
def function[labels, parameter[self]]: constant[ Get field label for fields ] if compare[call[name[type], parameter[name[self].object_list]] equal[==] call[name[type], parameter[list[[]]]]] begin[:] variable[model] assign[=] name[self].formset.model for taget[name...
keyword[def] identifier[labels] ( identifier[self] ): literal[string] keyword[if] identifier[type] ( identifier[self] . identifier[object_list] )== identifier[type] ([]): identifier[model] = identifier[self] . identifier[formset] . identifier[model] keyword[else] : ...
def labels(self): """ Get field label for fields """ if type(self.object_list) == type([]): model = self.formset.model # depends on [control=['if'], data=[]] else: model = self.object_list.model for field in self.visible_fields: name = None if self.formse...
def parse(readDataInstance): """ Returns a new L{NETDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NETDirectory} object. @rtype: L{NETDirectory} @return: A new L{NETDirec...
def function[parse, parameter[readDataInstance]]: constant[ Returns a new L{NETDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NETDirectory} object. @rtype: L{NETDirectory} ...
keyword[def] identifier[parse] ( identifier[readDataInstance] ): literal[string] identifier[nd] = identifier[NETDirectory] () identifier[nd] . identifier[directory] = identifier[NetDirectory] . identifier[parse] ( identifier[readDataInstance] ) identifier[nd] . identifier[netMeta...
def parse(readDataInstance): """ Returns a new L{NETDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NETDirectory} object. @rtype: L{NETDirectory} @return: A new L{NETDirectory...
def _compute_median_z1pt0(self, vs30): """ Compute and return median z1pt0 (in m), equation 17, pqge 79. """ z1pt0_median = np.zeros_like(vs30) + 6.745 idx = np.where((vs30 >= 180.0) & (vs30 <= 500.0)) z1pt0_median[idx] = 6.745 - 1.35 * np.log(vs30[idx] / 180.0) ...
def function[_compute_median_z1pt0, parameter[self, vs30]]: constant[ Compute and return median z1pt0 (in m), equation 17, pqge 79. ] variable[z1pt0_median] assign[=] binary_operation[call[name[np].zeros_like, parameter[name[vs30]]] + constant[6.745]] variable[idx] assign[=] call...
keyword[def] identifier[_compute_median_z1pt0] ( identifier[self] , identifier[vs30] ): literal[string] identifier[z1pt0_median] = identifier[np] . identifier[zeros_like] ( identifier[vs30] )+ literal[int] identifier[idx] = identifier[np] . identifier[where] (( identifier[vs30] >= litera...
def _compute_median_z1pt0(self, vs30): """ Compute and return median z1pt0 (in m), equation 17, pqge 79. """ z1pt0_median = np.zeros_like(vs30) + 6.745 idx = np.where((vs30 >= 180.0) & (vs30 <= 500.0)) z1pt0_median[idx] = 6.745 - 1.35 * np.log(vs30[idx] / 180.0) idx = vs30 > 500.0 ...
def sync(self): """Retrieve areas from ElkM1""" self.elk.send(as_encode()) self.get_descriptions(TextDescriptions.AREA.value)
def function[sync, parameter[self]]: constant[Retrieve areas from ElkM1] call[name[self].elk.send, parameter[call[name[as_encode], parameter[]]]] call[name[self].get_descriptions, parameter[name[TextDescriptions].AREA.value]]
keyword[def] identifier[sync] ( identifier[self] ): literal[string] identifier[self] . identifier[elk] . identifier[send] ( identifier[as_encode] ()) identifier[self] . identifier[get_descriptions] ( identifier[TextDescriptions] . identifier[AREA] . identifier[value] )
def sync(self): """Retrieve areas from ElkM1""" self.elk.send(as_encode()) self.get_descriptions(TextDescriptions.AREA.value)
def get_duration(self): """Get game duration.""" postgame = self.get_postgame() if postgame: return postgame.duration_int * 1000 duration = self._header.initial.restore_time try: while self._handle.tell() < self.size: operation = mgz.body.o...
def function[get_duration, parameter[self]]: constant[Get game duration.] variable[postgame] assign[=] call[name[self].get_postgame, parameter[]] if name[postgame] begin[:] return[binary_operation[name[postgame].duration_int * constant[1000]]] variable[duration] assign[=] name[se...
keyword[def] identifier[get_duration] ( identifier[self] ): literal[string] identifier[postgame] = identifier[self] . identifier[get_postgame] () keyword[if] identifier[postgame] : keyword[return] identifier[postgame] . identifier[duration_int] * literal[int] ident...
def get_duration(self): """Get game duration.""" postgame = self.get_postgame() if postgame: return postgame.duration_int * 1000 # depends on [control=['if'], data=[]] duration = self._header.initial.restore_time try: while self._handle.tell() < self.size: operation = mg...
def current_boost_dir(): """Returns the (relative) path to the Boost source-directory this file is located in (if any).""" # Path to directory containing this script. path = os.path.dirname( os.path.realpath(__file__) ) # Making sure it is located in "${boost-dir}/libs/mpl/preprocessed". for directo...
def function[current_boost_dir, parameter[]]: constant[Returns the (relative) path to the Boost source-directory this file is located in (if any).] variable[path] assign[=] call[name[os].path.dirname, parameter[call[name[os].path.realpath, parameter[name[__file__]]]]] for taget[name[directory]] ...
keyword[def] identifier[current_boost_dir] (): literal[string] identifier[path] = identifier[os] . identifier[path] . identifier[dirname] ( identifier[os] . identifier[path] . identifier[realpath] ( identifier[__file__] )) keyword[for] identifier[directory] keyword[in] identifier[reversed...
def current_boost_dir(): """Returns the (relative) path to the Boost source-directory this file is located in (if any).""" # Path to directory containing this script. path = os.path.dirname(os.path.realpath(__file__)) # Making sure it is located in "${boost-dir}/libs/mpl/preprocessed". for directory...
def get_mem(self, id): """Fetch the memory with the supplied id""" for m in self.mems: if m.id == id: return m return None
def function[get_mem, parameter[self, id]]: constant[Fetch the memory with the supplied id] for taget[name[m]] in starred[name[self].mems] begin[:] if compare[name[m].id equal[==] name[id]] begin[:] return[name[m]] return[constant[None]]
keyword[def] identifier[get_mem] ( identifier[self] , identifier[id] ): literal[string] keyword[for] identifier[m] keyword[in] identifier[self] . identifier[mems] : keyword[if] identifier[m] . identifier[id] == identifier[id] : keyword[return] identifier[m] ...
def get_mem(self, id): """Fetch the memory with the supplied id""" for m in self.mems: if m.id == id: return m # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['m']] return None
def set(self, lo, hi): """ Set the fractional values of the slider position. :param lo: lower end of the scrollbar (between 0 and 1) :type lo: float :param hi: upper end of the scrollbar (between 0 and 1) :type hi: float """ if float(lo) <= 0.0 an...
def function[set, parameter[self, lo, hi]]: constant[ Set the fractional values of the slider position. :param lo: lower end of the scrollbar (between 0 and 1) :type lo: float :param hi: upper end of the scrollbar (between 0 and 1) :type hi: float ] ...
keyword[def] identifier[set] ( identifier[self] , identifier[lo] , identifier[hi] ): literal[string] keyword[if] identifier[float] ( identifier[lo] )<= literal[int] keyword[and] identifier[float] ( identifier[hi] )>= literal[int] : keyword[if] identifier[self] . identifier[_layout]...
def set(self, lo, hi): """ Set the fractional values of the slider position. :param lo: lower end of the scrollbar (between 0 and 1) :type lo: float :param hi: upper end of the scrollbar (between 0 and 1) :type hi: float """ if float(lo) <= 0.0 and float(...
def remove_dirs(dpath, verbose=None, ignore_errors=True, dryrun=False, quiet=QUIET): r""" Recursively removes a single directory (need to change function name) DEPRICATE Args: dpath (str): directory path dryrun (bool): (default = False) ignore_errors (bool): (d...
def function[remove_dirs, parameter[dpath, verbose, ignore_errors, dryrun, quiet]]: constant[ Recursively removes a single directory (need to change function name) DEPRICATE Args: dpath (str): directory path dryrun (bool): (default = False) ignore_errors (bool): (default =...
keyword[def] identifier[remove_dirs] ( identifier[dpath] , identifier[verbose] = keyword[None] , identifier[ignore_errors] = keyword[True] , identifier[dryrun] = keyword[False] , identifier[quiet] = identifier[QUIET] ): literal[string] keyword[if] identifier[verbose] keyword[is] keyword[None] : ...
def remove_dirs(dpath, verbose=None, ignore_errors=True, dryrun=False, quiet=QUIET): """ Recursively removes a single directory (need to change function name) DEPRICATE Args: dpath (str): directory path dryrun (bool): (default = False) ignore_errors (bool): (default = True) ...
def evaluate_method(method, events, aux=0.): """Evaluate a TMVA::MethodBase over a NumPy array. .. warning:: TMVA::Reader has known problems with thread safety in versions of ROOT earlier than 6.03. There will potentially be a crash if you call ``method = reader.FindMVA(name)`` in Python and then...
def function[evaluate_method, parameter[method, events, aux]]: constant[Evaluate a TMVA::MethodBase over a NumPy array. .. warning:: TMVA::Reader has known problems with thread safety in versions of ROOT earlier than 6.03. There will potentially be a crash if you call ``method = reader.FindMV...
keyword[def] identifier[evaluate_method] ( identifier[method] , identifier[events] , identifier[aux] = literal[int] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[method] , identifier[TMVA] . identifier[MethodBase] ): keyword[raise] identifier[TypeError] ( liter...
def evaluate_method(method, events, aux=0.0): """Evaluate a TMVA::MethodBase over a NumPy array. .. warning:: TMVA::Reader has known problems with thread safety in versions of ROOT earlier than 6.03. There will potentially be a crash if you call ``method = reader.FindMVA(name)`` in Python and the...
def bibtex_run(self): ''' Start bibtex run. ''' self.log.info('Running bibtex...') try: with open(os.devnull, 'w') as null: Popen(['bibtex', self.project_name], stdout=null).wait() except OSError: self.log.error(NO_LATEX_ERROR % 'bi...
def function[bibtex_run, parameter[self]]: constant[ Start bibtex run. ] call[name[self].log.info, parameter[constant[Running bibtex...]]] <ast.Try object at 0x7da18dc05630> call[name[shutil].copy, parameter[binary_operation[constant[%s.bib] <ast.Mod object at 0x7da2590d6920>...
keyword[def] identifier[bibtex_run] ( identifier[self] ): literal[string] identifier[self] . identifier[log] . identifier[info] ( literal[string] ) keyword[try] : keyword[with] identifier[open] ( identifier[os] . identifier[devnull] , literal[string] ) keyword[as] identifier...
def bibtex_run(self): """ Start bibtex run. """ self.log.info('Running bibtex...') try: with open(os.devnull, 'w') as null: Popen(['bibtex', self.project_name], stdout=null).wait() # depends on [control=['with'], data=['null']] # depends on [control=['try'], data=[]] ...
def edit_rules(self, description, key, value): ''' Edit all rules that match a specified description. @description - The description to match against. @key - The key to change for each matching rule. @value - The new key value for each matching rule. Retur...
def function[edit_rules, parameter[self, description, key, value]]: constant[ Edit all rules that match a specified description. @description - The description to match against. @key - The key to change for each matching rule. @value - The new key value for each ma...
keyword[def] identifier[edit_rules] ( identifier[self] , identifier[description] , identifier[key] , identifier[value] ): literal[string] identifier[count] = literal[int] identifier[description] = identifier[description] . identifier[lower] () keyword[for] identifier[i] keywor...
def edit_rules(self, description, key, value): """ Edit all rules that match a specified description. @description - The description to match against. @key - The key to change for each matching rule. @value - The new key value for each matching rule. Returns t...
def get_argument_parser(): """Function to obtain the argument parser. Returns ------- A fully configured `argparse.ArgumentParser` object. Notes ----- This function is used by the `sphinx-argparse` extension for sphinx. """ file_mv = cli.file_mv desc = 'Find all runs (SRR..) ...
def function[get_argument_parser, parameter[]]: constant[Function to obtain the argument parser. Returns ------- A fully configured `argparse.ArgumentParser` object. Notes ----- This function is used by the `sphinx-argparse` extension for sphinx. ] variable[file_mv] assign...
keyword[def] identifier[get_argument_parser] (): literal[string] identifier[file_mv] = identifier[cli] . identifier[file_mv] identifier[desc] = literal[string] identifier[parser] = identifier[cli] . identifier[get_argument_parser] ( identifier[desc] = identifier[desc] ) identifier[parse...
def get_argument_parser(): """Function to obtain the argument parser. Returns ------- A fully configured `argparse.ArgumentParser` object. Notes ----- This function is used by the `sphinx-argparse` extension for sphinx. """ file_mv = cli.file_mv desc = 'Find all runs (SRR..) a...
def is_correct(self): """Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool """ state = True cls = se...
def function[is_correct, parameter[self]]: constant[Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool ] vari...
keyword[def] identifier[is_correct] ( identifier[self] ): literal[string] identifier[state] = keyword[True] identifier[cls] = identifier[self] . identifier[__class__] keyword[if] keyword[not] identifier[self] . identifier[notificationways] : ...
def is_correct(self): """Check if this object configuration is correct :: * Check our own specific properties * Call our parent class is_correct checker :return: True if the configuration is correct, otherwise False :rtype: bool """ state = True cls = self.__class__...
def infer(cls, sub_ija, T_ia, root_state, pc=0.01, gap_limit=0.01, Nit=30, dp=1e-5, **kwargs): """ Infer a GTR model by specifying the number of transitions and time spent in each character. The basic equation that is being solved is :math:`n_{ij} = pi_i W_{ij} T_j` ...
def function[infer, parameter[cls, sub_ija, T_ia, root_state, pc, gap_limit, Nit, dp]]: constant[ Infer a GTR model by specifying the number of transitions and time spent in each character. The basic equation that is being solved is :math:`n_{ij} = pi_i W_{ij} T_j` where :math:...
keyword[def] identifier[infer] ( identifier[cls] , identifier[sub_ija] , identifier[T_ia] , identifier[root_state] , identifier[pc] = literal[int] , identifier[gap_limit] = literal[int] , identifier[Nit] = literal[int] , identifier[dp] = literal[int] ,** identifier[kwargs] ): literal[string] keywo...
def infer(cls, sub_ija, T_ia, root_state, pc=0.01, gap_limit=0.01, Nit=30, dp=1e-05, **kwargs): """ Infer a GTR model by specifying the number of transitions and time spent in each character. The basic equation that is being solved is :math:`n_{ij} = pi_i W_{ij} T_j` where :math:`n...
def list_sources(embedding_name=None): """Get valid token embedding names and their pre-trained file names. To load token embedding vectors from an externally hosted pre-trained token embedding file, such as those of GloVe and FastText, one should use `gluonnlp.embedding.create(embedding_name, source)...
def function[list_sources, parameter[embedding_name]]: constant[Get valid token embedding names and their pre-trained file names. To load token embedding vectors from an externally hosted pre-trained token embedding file, such as those of GloVe and FastText, one should use `gluonnlp.embedding.crea...
keyword[def] identifier[list_sources] ( identifier[embedding_name] = keyword[None] ): literal[string] identifier[text_embedding_reg] = identifier[registry] . identifier[get_registry] ( identifier[TokenEmbedding] ) keyword[if] identifier[embedding_name] keyword[is] keyword[not] keyword[None] : ...
def list_sources(embedding_name=None): """Get valid token embedding names and their pre-trained file names. To load token embedding vectors from an externally hosted pre-trained token embedding file, such as those of GloVe and FastText, one should use `gluonnlp.embedding.create(embedding_name, source)...
def Exception(obj, eng, callbacks, exc_info): """Handle general exceptions in workflow, saving states.""" exception_repr = ''.join(traceback.format_exception(*exc_info)) msg = "Error:\n%s" % (exception_repr) eng.log.error(msg) if obj: # Sets an error message as a tupl...
def function[Exception, parameter[obj, eng, callbacks, exc_info]]: constant[Handle general exceptions in workflow, saving states.] variable[exception_repr] assign[=] call[constant[].join, parameter[call[name[traceback].format_exception, parameter[<ast.Starred object at 0x7da20c7cab60>]]]] variab...
keyword[def] identifier[Exception] ( identifier[obj] , identifier[eng] , identifier[callbacks] , identifier[exc_info] ): literal[string] identifier[exception_repr] = literal[string] . identifier[join] ( identifier[traceback] . identifier[format_exception] (* identifier[exc_info] )) identif...
def Exception(obj, eng, callbacks, exc_info): """Handle general exceptions in workflow, saving states.""" exception_repr = ''.join(traceback.format_exception(*exc_info)) msg = 'Error:\n%s' % exception_repr eng.log.error(msg) if obj: # Sets an error message as a tuple (title, details) ...
def get_stories(label_type): """ Returns a list of the stories in the Na corpus. """ prefixes = get_story_prefixes(label_type) texts = list(set([prefix.split(".")[0].split("/")[1] for prefix in prefixes])) return texts
def function[get_stories, parameter[label_type]]: constant[ Returns a list of the stories in the Na corpus. ] variable[prefixes] assign[=] call[name[get_story_prefixes], parameter[name[label_type]]] variable[texts] assign[=] call[name[list], parameter[call[name[set], parameter[<ast.ListComp obje...
keyword[def] identifier[get_stories] ( identifier[label_type] ): literal[string] identifier[prefixes] = identifier[get_story_prefixes] ( identifier[label_type] ) identifier[texts] = identifier[list] ( identifier[set] ([ identifier[prefix] . identifier[split] ( literal[string] )[ literal[int] ]. ident...
def get_stories(label_type): """ Returns a list of the stories in the Na corpus. """ prefixes = get_story_prefixes(label_type) texts = list(set([prefix.split('.')[0].split('/')[1] for prefix in prefixes])) return texts
def extract_commands(imported_vars): """ 从传入的变量列表中提取命令( ``click.core.Command`` )对象 :param dict_items imported_vars: 字典的键值条目列表 :return: 判定为终端命令的对象字典 :rtype: dict(str, object) """ commands = dict() for tup in imported_vars: name, obj = tup if is_command_object(obj): ...
def function[extract_commands, parameter[imported_vars]]: constant[ 从传入的变量列表中提取命令( ``click.core.Command`` )对象 :param dict_items imported_vars: 字典的键值条目列表 :return: 判定为终端命令的对象字典 :rtype: dict(str, object) ] variable[commands] assign[=] call[name[dict], parameter[]] for taget[nam...
keyword[def] identifier[extract_commands] ( identifier[imported_vars] ): literal[string] identifier[commands] = identifier[dict] () keyword[for] identifier[tup] keyword[in] identifier[imported_vars] : identifier[name] , identifier[obj] = identifier[tup] keyword[if] identifier[is...
def extract_commands(imported_vars): """ 从传入的变量列表中提取命令( ``click.core.Command`` )对象 :param dict_items imported_vars: 字典的键值条目列表 :return: 判定为终端命令的对象字典 :rtype: dict(str, object) """ commands = dict() for tup in imported_vars: (name, obj) = tup if is_command_object(obj): ...
def _softmax(x, dim): """Computes softmax along a specified dim. Keras currently lacks this feature. """ if K.backend() == 'tensorflow': import tensorflow as tf return tf.nn.softmax(x, dim) elif K.backend() is 'cntk': import cntk return cntk.softmax(x, dim) elif K.ba...
def function[_softmax, parameter[x, dim]]: constant[Computes softmax along a specified dim. Keras currently lacks this feature. ] if compare[call[name[K].backend, parameter[]] equal[==] constant[tensorflow]] begin[:] import module[tensorflow] as alias[tf] return[call[name[tf].nn.soft...
keyword[def] identifier[_softmax] ( identifier[x] , identifier[dim] ): literal[string] keyword[if] identifier[K] . identifier[backend] ()== literal[string] : keyword[import] identifier[tensorflow] keyword[as] identifier[tf] keyword[return] identifier[tf] . identifier[nn] . identifi...
def _softmax(x, dim): """Computes softmax along a specified dim. Keras currently lacks this feature. """ if K.backend() == 'tensorflow': import tensorflow as tf return tf.nn.softmax(x, dim) # depends on [control=['if'], data=[]] elif K.backend() is 'cntk': import cntk re...
def getexptimeimg(self,chip): """ Notes ===== Return an array representing the exposure time per pixel for the detector. This method will be overloaded for IR detectors which have their own EXP arrays, namely, WFC3/IR and NICMOS images. :units: None ...
def function[getexptimeimg, parameter[self, chip]]: constant[ Notes ===== Return an array representing the exposure time per pixel for the detector. This method will be overloaded for IR detectors which have their own EXP arrays, namely, WFC3/IR and NICMOS images. ...
keyword[def] identifier[getexptimeimg] ( identifier[self] , identifier[chip] ): literal[string] identifier[sci_chip] = identifier[self] . identifier[_image] [ identifier[self] . identifier[scienceExt] , identifier[chip] ] keyword[if] identifier[sci_chip] . identifier[_wtscl_par] == litera...
def getexptimeimg(self, chip): """ Notes ===== Return an array representing the exposure time per pixel for the detector. This method will be overloaded for IR detectors which have their own EXP arrays, namely, WFC3/IR and NICMOS images. :units: None ...
def unwrap(self, value, session=None): ''' Validates ``value`` and then returns a dictionary with each key in ``value`` mapped to its value unwrapped using ``DictField.value_type`` ''' self.validate_unwrap(value) ret = {} for k, v in value.items(): ret[k] ...
def function[unwrap, parameter[self, value, session]]: constant[ Validates ``value`` and then returns a dictionary with each key in ``value`` mapped to its value unwrapped using ``DictField.value_type`` ] call[name[self].validate_unwrap, parameter[name[value]]] variable[ret] ...
keyword[def] identifier[unwrap] ( identifier[self] , identifier[value] , identifier[session] = keyword[None] ): literal[string] identifier[self] . identifier[validate_unwrap] ( identifier[value] ) identifier[ret] ={} keyword[for] identifier[k] , identifier[v] keyword[in] identi...
def unwrap(self, value, session=None): """ Validates ``value`` and then returns a dictionary with each key in ``value`` mapped to its value unwrapped using ``DictField.value_type`` """ self.validate_unwrap(value) ret = {} for (k, v) in value.items(): ret[k] = self.value_type....
def OpenChildren(self, children=None, mode="r", limit=None, chunk_limit=100000, age=NEWEST_TIME): """Yields AFF4 Objects of all our direct children. This method efficiently returns all attributes for our children dir...
def function[OpenChildren, parameter[self, children, mode, limit, chunk_limit, age]]: constant[Yields AFF4 Objects of all our direct children. This method efficiently returns all attributes for our children directly, in a few data store round trips. We use the directory indexes to query the data st...
keyword[def] identifier[OpenChildren] ( identifier[self] , identifier[children] = keyword[None] , identifier[mode] = literal[string] , identifier[limit] = keyword[None] , identifier[chunk_limit] = literal[int] , identifier[age] = identifier[NEWEST_TIME] ): literal[string] keyword[if] identifier[child...
def OpenChildren(self, children=None, mode='r', limit=None, chunk_limit=100000, age=NEWEST_TIME): """Yields AFF4 Objects of all our direct children. This method efficiently returns all attributes for our children directly, in a few data store round trips. We use the directory indexes to query the data ...
def plaintext_request(self, registration_id, data=None, collapse_key=None, delay_while_idle=False, time_to_live=None, retries=5, dry_run=False): """ Makes a plaintext request to GCM servers :param registration_id: string of the registration id :param data: dict...
def function[plaintext_request, parameter[self, registration_id, data, collapse_key, delay_while_idle, time_to_live, retries, dry_run]]: constant[ Makes a plaintext request to GCM servers :param registration_id: string of the registration id :param data: dict mapping of key-value pairs ...
keyword[def] identifier[plaintext_request] ( identifier[self] , identifier[registration_id] , identifier[data] = keyword[None] , identifier[collapse_key] = keyword[None] , identifier[delay_while_idle] = keyword[False] , identifier[time_to_live] = keyword[None] , identifier[retries] = literal[int] , identifier[dry_ru...
def plaintext_request(self, registration_id, data=None, collapse_key=None, delay_while_idle=False, time_to_live=None, retries=5, dry_run=False): """ Makes a plaintext request to GCM servers :param registration_id: string of the registration id :param data: dict mapping of key-value pairs of...
def asyncPipeStrregex(context=None, _INPUT=None, conf=None, **kwargs): """A string module that asynchronously replaces text using regexes. Each has the general format: "In [field] replace [regex pattern] with [text]". Loopable. Parameters ---------- context : pipe2py.Context object _INPUT :...
def function[asyncPipeStrregex, parameter[context, _INPUT, conf]]: constant[A string module that asynchronously replaces text using regexes. Each has the general format: "In [field] replace [regex pattern] with [text]". Loopable. Parameters ---------- context : pipe2py.Context object _I...
keyword[def] identifier[asyncPipeStrregex] ( identifier[context] = keyword[None] , identifier[_INPUT] = keyword[None] , identifier[conf] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[splits] = keyword[yield] identifier[asyncGetSplits] ( identifier[_INPUT] , identifier[conf] [ litera...
def asyncPipeStrregex(context=None, _INPUT=None, conf=None, **kwargs): """A string module that asynchronously replaces text using regexes. Each has the general format: "In [field] replace [regex pattern] with [text]". Loopable. Parameters ---------- context : pipe2py.Context object _INPUT :...
def assignrepr(self, prefix: str = '') -> str: """Return a |repr| string with a prefixed assignment.""" lines = ['%sNode("%s", variable="%s",' % (prefix, self.name, self.variable)] if self.keywords: subprefix = '%skeywords=' % (' '*(len(prefix)+5)) with o...
def function[assignrepr, parameter[self, prefix]]: constant[Return a |repr| string with a prefixed assignment.] variable[lines] assign[=] list[[<ast.BinOp object at 0x7da18f09d480>]] if name[self].keywords begin[:] variable[subprefix] assign[=] binary_operation[constant[%skeyword...
keyword[def] identifier[assignrepr] ( identifier[self] , identifier[prefix] : identifier[str] = literal[string] )-> identifier[str] : literal[string] identifier[lines] =[ literal[string] %( identifier[prefix] , identifier[self] . identifier[name] , identifier[self] . identifier[variable] )...
def assignrepr(self, prefix: str='') -> str: """Return a |repr| string with a prefixed assignment.""" lines = ['%sNode("%s", variable="%s",' % (prefix, self.name, self.variable)] if self.keywords: subprefix = '%skeywords=' % (' ' * (len(prefix) + 5)) with objecttools.repr_.preserve_strings(T...
def nexec(statement, globals=None, locals=None, **kwargs): """Execute *statement* using *globals* and *locals* dictionaries as *global* and *local* namespace. *statement* is transformed using :class:`.NapiTransformer`.""" try: import __builtin__ as builtins except ImportError: impo...
def function[nexec, parameter[statement, globals, locals]]: constant[Execute *statement* using *globals* and *locals* dictionaries as *global* and *local* namespace. *statement* is transformed using :class:`.NapiTransformer`.] <ast.Try object at 0x7da1b2886920> from relative_module[ast] import ...
keyword[def] identifier[nexec] ( identifier[statement] , identifier[globals] = keyword[None] , identifier[locals] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[try] : keyword[import] identifier[__builtin__] keyword[as] identifier[builtins] keyword[except] identifier[...
def nexec(statement, globals=None, locals=None, **kwargs): """Execute *statement* using *globals* and *locals* dictionaries as *global* and *local* namespace. *statement* is transformed using :class:`.NapiTransformer`.""" try: import __builtin__ as builtins # depends on [control=['try'], data=...
def chisqprob(x, df): """ Probability value (1-tail) for the Chi^2 probability distribution. Broadcasting rules apply. Parameters ---------- x : array_like or float > 0 df : array_like or float, probably int >= 1 Returns ------- chisqprob : ndarray The area from `chis...
def function[chisqprob, parameter[x, df]]: constant[ Probability value (1-tail) for the Chi^2 probability distribution. Broadcasting rules apply. Parameters ---------- x : array_like or float > 0 df : array_like or float, probably int >= 1 Returns ------- chisqprob : ndar...
keyword[def] identifier[chisqprob] ( identifier[x] , identifier[df] ): literal[string] keyword[if] identifier[x] <= literal[int] : keyword[return] literal[int] keyword[if] identifier[x] == literal[int] : keyword[return] literal[int] keyword[if] identifier[df] <= literal[i...
def chisqprob(x, df): """ Probability value (1-tail) for the Chi^2 probability distribution. Broadcasting rules apply. Parameters ---------- x : array_like or float > 0 df : array_like or float, probably int >= 1 Returns ------- chisqprob : ndarray The area from `chis...
def insertBulkBlock(self): """ API to insert a bulk block :param blockDump: Output of the block dump command :type blockDump: dict """ try: body = request.body.read() indata = cjson.decode(body) if (indata.get("file_parent_list", []) ...
def function[insertBulkBlock, parameter[self]]: constant[ API to insert a bulk block :param blockDump: Output of the block dump command :type blockDump: dict ] <ast.Try object at 0x7da20c796b30>
keyword[def] identifier[insertBulkBlock] ( identifier[self] ): literal[string] keyword[try] : identifier[body] = identifier[request] . identifier[body] . identifier[read] () identifier[indata] = identifier[cjson] . identifier[decode] ( identifier[body] ) keywo...
def insertBulkBlock(self): """ API to insert a bulk block :param blockDump: Output of the block dump command :type blockDump: dict """ try: body = request.body.read() indata = cjson.decode(body) if indata.get('file_parent_list', []) and indata.get('datas...
def setLocation(self, location): """ Change the upper left-hand corner to a new ``Location`` Doesn't change width or height """ if not location or not isinstance(location, Location): raise ValueError("setLocation expected a Location object") self.x = location.x ...
def function[setLocation, parameter[self, location]]: constant[ Change the upper left-hand corner to a new ``Location`` Doesn't change width or height ] if <ast.BoolOp object at 0x7da2041da4d0> begin[:] <ast.Raise object at 0x7da2041d90f0> name[self].x assign[=] name[loc...
keyword[def] identifier[setLocation] ( identifier[self] , identifier[location] ): literal[string] keyword[if] keyword[not] identifier[location] keyword[or] keyword[not] identifier[isinstance] ( identifier[location] , identifier[Location] ): keyword[raise] identifier[ValueError] (...
def setLocation(self, location): """ Change the upper left-hand corner to a new ``Location`` Doesn't change width or height """ if not location or not isinstance(location, Location): raise ValueError('setLocation expected a Location object') # depends on [control=['if'], data=[]] s...
def load(cls, path, name): """Imports the specified ``proteindb`` file from the hard disk. :param path: filedirectory of the ``proteindb`` file :param name: filename without the file extension ".proteindb" .. note:: this generates rather large files, which actually take longer ...
def function[load, parameter[cls, path, name]]: constant[Imports the specified ``proteindb`` file from the hard disk. :param path: filedirectory of the ``proteindb`` file :param name: filename without the file extension ".proteindb" .. note:: this generates rather large files, which ac...
keyword[def] identifier[load] ( identifier[cls] , identifier[path] , identifier[name] ): literal[string] identifier[filepath] = identifier[aux] . identifier[joinpath] ( identifier[path] , identifier[name] + literal[string] ) keyword[with] identifier[zipfile] . identifier[ZipFile] ( ident...
def load(cls, path, name): """Imports the specified ``proteindb`` file from the hard disk. :param path: filedirectory of the ``proteindb`` file :param name: filename without the file extension ".proteindb" .. note:: this generates rather large files, which actually take longer ...
def get_all_environment_option_pool(self, id_environment=None, option_id=None, option_type=None): """Get all Option VIP by Environment . :return: Dictionary with the following structure: :: {[{‘id’: < id >, option: { 'id': <id> ...
def function[get_all_environment_option_pool, parameter[self, id_environment, option_id, option_type]]: constant[Get all Option VIP by Environment . :return: Dictionary with the following structure: :: {[{‘id’: < id >, option: { 'id': <id> ...
keyword[def] identifier[get_all_environment_option_pool] ( identifier[self] , identifier[id_environment] = keyword[None] , identifier[option_id] = keyword[None] , identifier[option_type] = keyword[None] ): literal[string] identifier[url] = literal[string] keyword[if] identifier[id_envir...
def get_all_environment_option_pool(self, id_environment=None, option_id=None, option_type=None): """Get all Option VIP by Environment . :return: Dictionary with the following structure: :: {[{‘id’: < id >, option: { 'id': <id> '...
def check_query(state, query, error_msg=None, expand_msg=None): """Run arbitrary queries against to the DB connection to verify the database state. For queries that do not return any output (INSERTs, UPDATEs, ...), you cannot use functions like ``check_col()`` and ``is_equal()`` to verify the query result....
def function[check_query, parameter[state, query, error_msg, expand_msg]]: constant[Run arbitrary queries against to the DB connection to verify the database state. For queries that do not return any output (INSERTs, UPDATEs, ...), you cannot use functions like ``check_col()`` and ``is_equal()`` to ver...
keyword[def] identifier[check_query] ( identifier[state] , identifier[query] , identifier[error_msg] = keyword[None] , identifier[expand_msg] = keyword[None] ): literal[string] keyword[if] identifier[error_msg] keyword[is] keyword[None] : identifier[error_msg] = literal[string] keyword[i...
def check_query(state, query, error_msg=None, expand_msg=None): """Run arbitrary queries against to the DB connection to verify the database state. For queries that do not return any output (INSERTs, UPDATEs, ...), you cannot use functions like ``check_col()`` and ``is_equal()`` to verify the query result....
def pandas_mesh(df): """Create numpy 2-D "meshgrid" from 3+ columns in a Pandas DataFrame Arguments: df (DataFrame): Must have 3 or 4 columns of numerical data Returns: OrderedDict: column labels from the data frame are the keys, values are 2-D matrices All matrices have shape NxM, whe...
def function[pandas_mesh, parameter[df]]: constant[Create numpy 2-D "meshgrid" from 3+ columns in a Pandas DataFrame Arguments: df (DataFrame): Must have 3 or 4 columns of numerical data Returns: OrderedDict: column labels from the data frame are the keys, values are 2-D matrices A...
keyword[def] identifier[pandas_mesh] ( identifier[df] ): literal[string] identifier[xyz] =[ identifier[df] [ identifier[c] ]. identifier[values] keyword[for] identifier[c] keyword[in] identifier[df] . identifier[columns] ] identifier[index] = identifier[pd] . identifier[MultiIndex] . identifier[fr...
def pandas_mesh(df): """Create numpy 2-D "meshgrid" from 3+ columns in a Pandas DataFrame Arguments: df (DataFrame): Must have 3 or 4 columns of numerical data Returns: OrderedDict: column labels from the data frame are the keys, values are 2-D matrices All matrices have shape NxM, whe...
def peers(self): "list of the (host, port) pairs of all connected peer Hubs" return [addr for (addr, peer) in self._dispatcher.peers.items() if peer.up]
def function[peers, parameter[self]]: constant[list of the (host, port) pairs of all connected peer Hubs] return[<ast.ListComp object at 0x7da2043462f0>]
keyword[def] identifier[peers] ( identifier[self] ): literal[string] keyword[return] [ identifier[addr] keyword[for] ( identifier[addr] , identifier[peer] ) keyword[in] identifier[self] . identifier[_dispatcher] . identifier[peers] . identifier[items] () keyword[if] identifier[peer] . i...
def peers(self): """list of the (host, port) pairs of all connected peer Hubs""" return [addr for (addr, peer) in self._dispatcher.peers.items() if peer.up]
def removeChild(self, child): """ Remove a child from this element. The child element is returned, and it's parentNode element is reset. """ super(Table, self).removeChild(child) if child.tagName == ligolw.Column.tagName: self._update_column_info() return child
def function[removeChild, parameter[self, child]]: constant[ Remove a child from this element. The child element is returned, and it's parentNode element is reset. ] call[call[name[super], parameter[name[Table], name[self]]].removeChild, parameter[name[child]]] if compare[name[child].tagN...
keyword[def] identifier[removeChild] ( identifier[self] , identifier[child] ): literal[string] identifier[super] ( identifier[Table] , identifier[self] ). identifier[removeChild] ( identifier[child] ) keyword[if] identifier[child] . identifier[tagName] == identifier[ligolw] . identifier[Column] . identifie...
def removeChild(self, child): """ Remove a child from this element. The child element is returned, and it's parentNode element is reset. """ super(Table, self).removeChild(child) if child.tagName == ligolw.Column.tagName: self._update_column_info() # depends on [control=['if'], data=[]] ...
def get_strain_label(entry, viral=False): """Try to extract a strain from an assemly summary entry. First this checks 'infraspecific_name', then 'isolate', then it tries to get it from 'organism_name'. If all fails, it falls back to just returning the assembly accesion number. """ def get_strai...
def function[get_strain_label, parameter[entry, viral]]: constant[Try to extract a strain from an assemly summary entry. First this checks 'infraspecific_name', then 'isolate', then it tries to get it from 'organism_name'. If all fails, it falls back to just returning the assembly accesion number. ...
keyword[def] identifier[get_strain_label] ( identifier[entry] , identifier[viral] = keyword[False] ): literal[string] keyword[def] identifier[get_strain] ( identifier[entry] ): identifier[strain] = identifier[entry] [ literal[string] ] keyword[if] identifier[strain] != literal[string] :...
def get_strain_label(entry, viral=False): """Try to extract a strain from an assemly summary entry. First this checks 'infraspecific_name', then 'isolate', then it tries to get it from 'organism_name'. If all fails, it falls back to just returning the assembly accesion number. """ def get_stra...
def isclosed(self): """This function determines if a connected path is closed.""" assert len(self) != 0 assert self.iscontinuous() return self.start == self.end
def function[isclosed, parameter[self]]: constant[This function determines if a connected path is closed.] assert[compare[call[name[len], parameter[name[self]]] not_equal[!=] constant[0]]] assert[call[name[self].iscontinuous, parameter[]]] return[compare[name[self].start equal[==] name[self].end]]
keyword[def] identifier[isclosed] ( identifier[self] ): literal[string] keyword[assert] identifier[len] ( identifier[self] )!= literal[int] keyword[assert] identifier[self] . identifier[iscontinuous] () keyword[return] identifier[self] . identifier[start] == identifier[self] ....
def isclosed(self): """This function determines if a connected path is closed.""" assert len(self) != 0 assert self.iscontinuous() return self.start == self.end
def encrypt(self, data, *args, **kwargs): ''' Sign/Encrypt :param data: Data to encrypt :param recipients: Single key ID or list of mutiple IDs. Will be ignored if symmetric :param sign_key: Key for signing data before encryption. No sign will be made when not given :par...
def function[encrypt, parameter[self, data]]: constant[ Sign/Encrypt :param data: Data to encrypt :param recipients: Single key ID or list of mutiple IDs. Will be ignored if symmetric :param sign_key: Key for signing data before encryption. No sign will be made when not given ...
keyword[def] identifier[encrypt] ( identifier[self] , identifier[data] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[self] . identifier[encrypt_file] ( identifier[self] . identifier[create_stream] ( identifier[data] ),* identifier[args] ,** identifier[kwa...
def encrypt(self, data, *args, **kwargs): """ Sign/Encrypt :param data: Data to encrypt :param recipients: Single key ID or list of mutiple IDs. Will be ignored if symmetric :param sign_key: Key for signing data before encryption. No sign will be made when not given :param p...
def _add_halfwave(data, events, s_freq, opts): """Find the next zero crossing and the intervening peak and add them to events. If no zero found before max_dur, event is discarded. If peak-to-peak is smaller than min_ptp, the event is discarded. Parameters ---------- data : ndarray (dtype='float...
def function[_add_halfwave, parameter[data, events, s_freq, opts]]: constant[Find the next zero crossing and the intervening peak and add them to events. If no zero found before max_dur, event is discarded. If peak-to-peak is smaller than min_ptp, the event is discarded. Parameters ---------- ...
keyword[def] identifier[_add_halfwave] ( identifier[data] , identifier[events] , identifier[s_freq] , identifier[opts] ): literal[string] identifier[max_dur] = identifier[opts] . identifier[duration] [ literal[int] ] keyword[if] identifier[max_dur] keyword[is] keyword[None] : identifier[ma...
def _add_halfwave(data, events, s_freq, opts): """Find the next zero crossing and the intervening peak and add them to events. If no zero found before max_dur, event is discarded. If peak-to-peak is smaller than min_ptp, the event is discarded. Parameters ---------- data : ndarray (dtype='float...
def mquery(self, lpAddress): """ Query memory information from the address space of the process. Returns a L{win32.MemoryBasicInformation} object. @see: U{http://msdn.microsoft.com/en-us/library/aa366907(VS.85).aspx} @type lpAddress: int @param lpAddress: Address of me...
def function[mquery, parameter[self, lpAddress]]: constant[ Query memory information from the address space of the process. Returns a L{win32.MemoryBasicInformation} object. @see: U{http://msdn.microsoft.com/en-us/library/aa366907(VS.85).aspx} @type lpAddress: int @par...
keyword[def] identifier[mquery] ( identifier[self] , identifier[lpAddress] ): literal[string] identifier[hProcess] = identifier[self] . identifier[get_handle] ( identifier[win32] . identifier[PROCESS_QUERY_INFORMATION] ) keyword[return] identifier[win32] . identifier[VirtualQueryEx] ( ide...
def mquery(self, lpAddress): """ Query memory information from the address space of the process. Returns a L{win32.MemoryBasicInformation} object. @see: U{http://msdn.microsoft.com/en-us/library/aa366907(VS.85).aspx} @type lpAddress: int @param lpAddress: Address of memory...
def p_pvar_inst_def(self, p): '''pvar_inst_def : IDENT LPAREN lconst_list RPAREN SEMI | IDENT SEMI | NOT IDENT LPAREN lconst_list RPAREN SEMI | NOT IDENT SEMI | IDENT LPAREN lconst_list RPAREN ASSIGN_EQUAL range_...
def function[p_pvar_inst_def, parameter[self, p]]: constant[pvar_inst_def : IDENT LPAREN lconst_list RPAREN SEMI | IDENT SEMI | NOT IDENT LPAREN lconst_list RPAREN SEMI | NOT IDENT SEMI | IDENT LPAREN lconst_list...
keyword[def] identifier[p_pvar_inst_def] ( identifier[self] , identifier[p] ): literal[string] keyword[if] identifier[len] ( identifier[p] )== literal[int] : identifier[p] [ literal[int] ]=(( identifier[p] [ literal[int] ], identifier[p] [ literal[int] ]), keyword[True] ) key...
def p_pvar_inst_def(self, p): """pvar_inst_def : IDENT LPAREN lconst_list RPAREN SEMI | IDENT SEMI | NOT IDENT LPAREN lconst_list RPAREN SEMI | NOT IDENT SEMI | IDENT LPAREN lconst_list RPAREN ASSIGN_EQUAL range_cons...
def generateUnabridgedAPI(self): ''' Generates the unabridged (full) API listing into ``self.unabridged_api_file``. This is necessary as some items may not show up in either hierarchy view, depending on: 1. The item. For example, if a namespace has only one member which is a ...
def function[generateUnabridgedAPI, parameter[self]]: constant[ Generates the unabridged (full) API listing into ``self.unabridged_api_file``. This is necessary as some items may not show up in either hierarchy view, depending on: 1. The item. For example, if a namespace has on...
keyword[def] identifier[generateUnabridgedAPI] ( identifier[self] ): literal[string] identifier[all_namespaces] =[] identifier[all_class_like] =[] identifier[all_enums] =[] identifier[all_unions] =[] identifier[all_functions] =...
def generateUnabridgedAPI(self): """ Generates the unabridged (full) API listing into ``self.unabridged_api_file``. This is necessary as some items may not show up in either hierarchy view, depending on: 1. The item. For example, if a namespace has only one member which is a ...
def _other_wrapper(self, name, writing): """Wrap a stream attribute in an other_wrapper. Args: name: the name of the stream attribute to wrap. Returns: other_wrapper which is described below. """ io_attr = getattr(self._io, name) def other_wrapper(*...
def function[_other_wrapper, parameter[self, name, writing]]: constant[Wrap a stream attribute in an other_wrapper. Args: name: the name of the stream attribute to wrap. Returns: other_wrapper which is described below. ] variable[io_attr] assign[=] call[name...
keyword[def] identifier[_other_wrapper] ( identifier[self] , identifier[name] , identifier[writing] ): literal[string] identifier[io_attr] = identifier[getattr] ( identifier[self] . identifier[_io] , identifier[name] ) keyword[def] identifier[other_wrapper] (* identifier[args] ,** identi...
def _other_wrapper(self, name, writing): """Wrap a stream attribute in an other_wrapper. Args: name: the name of the stream attribute to wrap. Returns: other_wrapper which is described below. """ io_attr = getattr(self._io, name) def other_wrapper(*args, **kwar...
def hash_blocks(text, hashes): """Hashes HTML block tags. PARAMETERS: text -- str; Markdown text hashes -- dict; a dictionary of all hashes, where keys are hashes and values are their unhashed versions. When HTML block tags are used, all content inside the tags is preserved as-...
def function[hash_blocks, parameter[text, hashes]]: constant[Hashes HTML block tags. PARAMETERS: text -- str; Markdown text hashes -- dict; a dictionary of all hashes, where keys are hashes and values are their unhashed versions. When HTML block tags are used, all content insid...
keyword[def] identifier[hash_blocks] ( identifier[text] , identifier[hashes] ): literal[string] keyword[def] identifier[sub] ( identifier[match] ): identifier[block] = identifier[match] . identifier[group] ( literal[int] ) identifier[hashed] = identifier[hash_text] ( identifier[block] , ...
def hash_blocks(text, hashes): """Hashes HTML block tags. PARAMETERS: text -- str; Markdown text hashes -- dict; a dictionary of all hashes, where keys are hashes and values are their unhashed versions. When HTML block tags are used, all content inside the tags is preserved as-...
def get_fields(schema, exclude_dump_only=False): """Return fields from schema :param Schema schema: A marshmallow Schema instance or a class object :param bool exclude_dump_only: whether to filter fields in Meta.dump_only :rtype: dict, of field name field object pairs """ if hasattr(schema, "fi...
def function[get_fields, parameter[schema, exclude_dump_only]]: constant[Return fields from schema :param Schema schema: A marshmallow Schema instance or a class object :param bool exclude_dump_only: whether to filter fields in Meta.dump_only :rtype: dict, of field name field object pairs ] ...
keyword[def] identifier[get_fields] ( identifier[schema] , identifier[exclude_dump_only] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[schema] , literal[string] ): identifier[fields] = identifier[schema] . identifier[fields] keyword[elif] identifier[hasat...
def get_fields(schema, exclude_dump_only=False): """Return fields from schema :param Schema schema: A marshmallow Schema instance or a class object :param bool exclude_dump_only: whether to filter fields in Meta.dump_only :rtype: dict, of field name field object pairs """ if hasattr(schema, 'fi...
def clip_foreign(network): """ Delete all components and timelines located outside of Germany. Add transborder flows divided by country of origin as network.foreign_trade. Parameters ---------- network : :class:`pypsa.Network Overall container of PyPSA Returns ------- n...
def function[clip_foreign, parameter[network]]: constant[ Delete all components and timelines located outside of Germany. Add transborder flows divided by country of origin as network.foreign_trade. Parameters ---------- network : :class:`pypsa.Network Overall container of PyPSA...
keyword[def] identifier[clip_foreign] ( identifier[network] ): literal[string] identifier[foreign_buses] = identifier[network] . identifier[buses] [ identifier[network] . identifier[buses] . identifier[country_code] != literal[string] ] identifier[network] . identifier[buses] = identifier[netw...
def clip_foreign(network): """ Delete all components and timelines located outside of Germany. Add transborder flows divided by country of origin as network.foreign_trade. Parameters ---------- network : :class:`pypsa.Network Overall container of PyPSA Returns ------- n...
def GenomicRangeFromString(range_string,payload=None,dir=None): """Constructor for a GenomicRange object that takes a string""" m = re.match('^(.+):(\d+)-(\d+)$',range_string) if not m: sys.stderr.write("ERROR bad genomic range string\n"+range_string+"\n") sys.exit() chr = m.group(1) start = int(m.g...
def function[GenomicRangeFromString, parameter[range_string, payload, dir]]: constant[Constructor for a GenomicRange object that takes a string] variable[m] assign[=] call[name[re].match, parameter[constant[^(.+):(\d+)-(\d+)$], name[range_string]]] if <ast.UnaryOp object at 0x7da18f58f190> begin...
keyword[def] identifier[GenomicRangeFromString] ( identifier[range_string] , identifier[payload] = keyword[None] , identifier[dir] = keyword[None] ): literal[string] identifier[m] = identifier[re] . identifier[match] ( literal[string] , identifier[range_string] ) keyword[if] keyword[not] identifier[m] : ...
def GenomicRangeFromString(range_string, payload=None, dir=None): """Constructor for a GenomicRange object that takes a string""" m = re.match('^(.+):(\\d+)-(\\d+)$', range_string) if not m: sys.stderr.write('ERROR bad genomic range string\n' + range_string + '\n') sys.exit() # depends on [...
def codepoint_included(self, codepoint): """Check if codepoint matches any of the defined codepoints.""" if self.codepoints == None: return True for cp in self.codepoints: mismatch = False for i in range(len(cp)): if (cp[i] is not None) and (cp...
def function[codepoint_included, parameter[self, codepoint]]: constant[Check if codepoint matches any of the defined codepoints.] if compare[name[self].codepoints equal[==] constant[None]] begin[:] return[constant[True]] for taget[name[cp]] in starred[name[self].codepoints] begin[:] ...
keyword[def] identifier[codepoint_included] ( identifier[self] , identifier[codepoint] ): literal[string] keyword[if] identifier[self] . identifier[codepoints] == keyword[None] : keyword[return] keyword[True] keyword[for] identifier[cp] keyword[in] identifier[self] . ide...
def codepoint_included(self, codepoint): """Check if codepoint matches any of the defined codepoints.""" if self.codepoints == None: return True # depends on [control=['if'], data=[]] for cp in self.codepoints: mismatch = False for i in range(len(cp)): if cp[i] is not No...
def get_type(self): """Get the type of the item. :return: the type of the item. :returntype: `unicode`""" item_type = self.xmlnode.prop("type") if not item_type: item_type = "?" return item_type.decode("utf-8")
def function[get_type, parameter[self]]: constant[Get the type of the item. :return: the type of the item. :returntype: `unicode`] variable[item_type] assign[=] call[name[self].xmlnode.prop, parameter[constant[type]]] if <ast.UnaryOp object at 0x7da18eb56ce0> begin[:] ...
keyword[def] identifier[get_type] ( identifier[self] ): literal[string] identifier[item_type] = identifier[self] . identifier[xmlnode] . identifier[prop] ( literal[string] ) keyword[if] keyword[not] identifier[item_type] : identifier[item_type] = literal[string] ke...
def get_type(self): """Get the type of the item. :return: the type of the item. :returntype: `unicode`""" item_type = self.xmlnode.prop('type') if not item_type: item_type = '?' # depends on [control=['if'], data=[]] return item_type.decode('utf-8')
def get_docargs(self, args=None, prt=None, **kws): """Pare down docopt. Return a minimal dictionary and a set containing runtime arg values.""" args_user = sys.argv[1:] if args is None else args arg_kws = self._get_docargs(args_user, prt) if 'intvals' in kws: self._set_intval...
def function[get_docargs, parameter[self, args, prt]]: constant[Pare down docopt. Return a minimal dictionary and a set containing runtime arg values.] variable[args_user] assign[=] <ast.IfExp object at 0x7da20c6ab010> variable[arg_kws] assign[=] call[name[self]._get_docargs, parameter[name[args...
keyword[def] identifier[get_docargs] ( identifier[self] , identifier[args] = keyword[None] , identifier[prt] = keyword[None] ,** identifier[kws] ): literal[string] identifier[args_user] = identifier[sys] . identifier[argv] [ literal[int] :] keyword[if] identifier[args] keyword[is] keyword[None] ...
def get_docargs(self, args=None, prt=None, **kws): """Pare down docopt. Return a minimal dictionary and a set containing runtime arg values.""" args_user = sys.argv[1:] if args is None else args arg_kws = self._get_docargs(args_user, prt) if 'intvals' in kws: self._set_intvals(arg_kws, kws['intv...
def set_string(_bytearray, byte_index, value, max_size): """ Set string value :params value: string data :params max_size: max possible string size """ if six.PY2: assert isinstance(value, (str, unicode)) else: assert isinstance(value, str) size = len(value) # FAIL ...
def function[set_string, parameter[_bytearray, byte_index, value, max_size]]: constant[ Set string value :params value: string data :params max_size: max possible string size ] if name[six].PY2 begin[:] assert[call[name[isinstance], parameter[name[value], tuple[[<ast.Name object...
keyword[def] identifier[set_string] ( identifier[_bytearray] , identifier[byte_index] , identifier[value] , identifier[max_size] ): literal[string] keyword[if] identifier[six] . identifier[PY2] : keyword[assert] identifier[isinstance] ( identifier[value] ,( identifier[str] , identifier[unicode] ...
def set_string(_bytearray, byte_index, value, max_size): """ Set string value :params value: string data :params max_size: max possible string size """ if six.PY2: assert isinstance(value, (str, unicode)) # depends on [control=['if'], data=[]] else: assert isinstance(value,...
def encode(self): """Encode the DAT packet. This method populates self.buffer, and returns self for easy method chaining.""" if len(self.data) == 0: log.debug("Encoding an empty DAT packet") data = self.data if not isinstance(self.data, bytes): data = self...
def function[encode, parameter[self]]: constant[Encode the DAT packet. This method populates self.buffer, and returns self for easy method chaining.] if compare[call[name[len], parameter[name[self].data]] equal[==] constant[0]] begin[:] call[name[log].debug, parameter[constant[En...
keyword[def] identifier[encode] ( identifier[self] ): literal[string] keyword[if] identifier[len] ( identifier[self] . identifier[data] )== literal[int] : identifier[log] . identifier[debug] ( literal[string] ) identifier[data] = identifier[self] . identifier[data] ...
def encode(self): """Encode the DAT packet. This method populates self.buffer, and returns self for easy method chaining.""" if len(self.data) == 0: log.debug('Encoding an empty DAT packet') # depends on [control=['if'], data=[]] data = self.data if not isinstance(self.data, bytes): ...
def _jit_get_rotation_matrix(axis, angle): """Returns the rotation matrix. This function returns a matrix for the counterclockwise rotation around the given axis. The Input angle is in radians. Args: axis (vector): angle (float): Returns: Rotation matrix (np.array): ...
def function[_jit_get_rotation_matrix, parameter[axis, angle]]: constant[Returns the rotation matrix. This function returns a matrix for the counterclockwise rotation around the given axis. The Input angle is in radians. Args: axis (vector): angle (float): Returns: ...
keyword[def] identifier[_jit_get_rotation_matrix] ( identifier[axis] , identifier[angle] ): literal[string] identifier[axis] = identifier[_jit_normalize] ( identifier[axis] ) identifier[a] = identifier[m] . identifier[cos] ( identifier[angle] / literal[int] ) identifier[b] , identifier[c] , ident...
def _jit_get_rotation_matrix(axis, angle): """Returns the rotation matrix. This function returns a matrix for the counterclockwise rotation around the given axis. The Input angle is in radians. Args: axis (vector): angle (float): Returns: Rotation matrix (np.array): ...
def doc_unwrap(raw_doc): """ Applies two transformations to raw_doc: 1. N consecutive newlines are converted into N-1 newlines. 2. A lone newline is converted to a space, which basically unwraps text. Returns a new string, or None if the input was None. """ if raw_doc is None: retur...
def function[doc_unwrap, parameter[raw_doc]]: constant[ Applies two transformations to raw_doc: 1. N consecutive newlines are converted into N-1 newlines. 2. A lone newline is converted to a space, which basically unwraps text. Returns a new string, or None if the input was None. ] ...
keyword[def] identifier[doc_unwrap] ( identifier[raw_doc] ): literal[string] keyword[if] identifier[raw_doc] keyword[is] keyword[None] : keyword[return] keyword[None] identifier[docstring] = literal[string] identifier[consecutive_newlines] = literal[int] keyword[for] id...
def doc_unwrap(raw_doc): """ Applies two transformations to raw_doc: 1. N consecutive newlines are converted into N-1 newlines. 2. A lone newline is converted to a space, which basically unwraps text. Returns a new string, or None if the input was None. """ if raw_doc is None: retur...
def iterencode(self, o): """ Encode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) """ if self.check_circular: ...
def function[iterencode, parameter[self, o]]: constant[ Encode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) ] if ...
keyword[def] identifier[iterencode] ( identifier[self] , identifier[o] ): literal[string] keyword[if] identifier[self] . identifier[check_circular] : identifier[markers] ={} keyword[else] : identifier[markers] = keyword[None] keyword[return] identifier...
def iterencode(self, o): """ Encode the given object and yield each string representation as available. For example:: for chunk in JSONEncoder().iterencode(bigobject): mysocket.write(chunk) """ if self.check_circular: mark...
def search_registered_query_deleted_for_facet(self, facet, **kwargs): # noqa: E501 """Lists the values of a specific facet over the customer's deleted derived metric definitions # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronou...
def function[search_registered_query_deleted_for_facet, parameter[self, facet]]: constant[Lists the values of a specific facet over the customer's deleted derived metric definitions # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchro...
keyword[def] identifier[search_registered_query_deleted_for_facet] ( identifier[self] , identifier[facet] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): key...
def search_registered_query_deleted_for_facet(self, facet, **kwargs): # noqa: E501 "Lists the values of a specific facet over the customer's deleted derived metric definitions # noqa: E501\n\n # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous ...
def _in_range(self, index): """ Returns True if index is in range """ if isinstance(index, slice): in_range = index.start < index.stop and \ index.start >= self.start and \ index.stop <= self.end else: in_range = index >= self.start and \ ...
def function[_in_range, parameter[self, index]]: constant[ Returns True if index is in range ] if call[name[isinstance], parameter[name[index], name[slice]]] begin[:] variable[in_range] assign[=] <ast.BoolOp object at 0x7da18fe92c20> return[name[in_range]]
keyword[def] identifier[_in_range] ( identifier[self] , identifier[index] ): literal[string] keyword[if] identifier[isinstance] ( identifier[index] , identifier[slice] ): identifier[in_range] = identifier[index] . identifier[start] < identifier[index] . identifier[stop] keyword[and] ...
def _in_range(self, index): """ Returns True if index is in range """ if isinstance(index, slice): in_range = index.start < index.stop and index.start >= self.start and (index.stop <= self.end) # depends on [control=['if'], data=[]] else: in_range = index >= self.start and index <= self.end...
def handle_absolute(self, event): """Absolute mouse position on the screen.""" (x_val, y_val) = self._get_absolute(event) x_event, y_event = self.emulate_abs( int(x_val), int(y_val), self.timeval) self.events.append(x_event) self.events.append(...
def function[handle_absolute, parameter[self, event]]: constant[Absolute mouse position on the screen.] <ast.Tuple object at 0x7da1b08e6ce0> assign[=] call[name[self]._get_absolute, parameter[name[event]]] <ast.Tuple object at 0x7da1b08e45e0> assign[=] call[name[self].emulate_abs, parameter[call...
keyword[def] identifier[handle_absolute] ( identifier[self] , identifier[event] ): literal[string] ( identifier[x_val] , identifier[y_val] )= identifier[self] . identifier[_get_absolute] ( identifier[event] ) identifier[x_event] , identifier[y_event] = identifier[self] . identifier[emulate_...
def handle_absolute(self, event): """Absolute mouse position on the screen.""" (x_val, y_val) = self._get_absolute(event) (x_event, y_event) = self.emulate_abs(int(x_val), int(y_val), self.timeval) self.events.append(x_event) self.events.append(y_event)
def patch_namespaced_endpoints(self, name, namespace, body, **kwargs): """ partially update the specified Endpoints This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_namespaced_endpoint...
def function[patch_namespaced_endpoints, parameter[self, name, namespace, body]]: constant[ partially update the specified Endpoints This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_na...
keyword[def] identifier[patch_namespaced_endpoints] ( identifier[self] , identifier[name] , identifier[namespace] , identifier[body] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[...
def patch_namespaced_endpoints(self, name, namespace, body, **kwargs): """ partially update the specified Endpoints This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_namespaced_endpoints(na...
def stopped(name=None, containers=None, shutdown_timeout=None, unpause=False, error_on_absent=True, **kwargs): ''' Ensure that a container (or containers) is stopped name Name or ID of the container containers Run this state o...
def function[stopped, parameter[name, containers, shutdown_timeout, unpause, error_on_absent]]: constant[ Ensure that a container (or containers) is stopped name Name or ID of the container containers Run this state on more than one container at a time. The following two ex...
keyword[def] identifier[stopped] ( identifier[name] = keyword[None] , identifier[containers] = keyword[None] , identifier[shutdown_timeout] = keyword[None] , identifier[unpause] = keyword[False] , identifier[error_on_absent] = keyword[True] , ** identifier[kwargs] ): literal[string] identifier[ret] ={ ...
def stopped(name=None, containers=None, shutdown_timeout=None, unpause=False, error_on_absent=True, **kwargs): """ Ensure that a container (or containers) is stopped name Name or ID of the container containers Run this state on more than one container at a time. The following two ...
def _split_symbol_mappings(df, exchanges): """Split out the symbol: sid mappings from the raw data. Parameters ---------- df : pd.DataFrame The dataframe with multiple rows for each symbol: sid pair. exchanges : pd.DataFrame The exchanges table. Returns ------- asset_in...
def function[_split_symbol_mappings, parameter[df, exchanges]]: constant[Split out the symbol: sid mappings from the raw data. Parameters ---------- df : pd.DataFrame The dataframe with multiple rows for each symbol: sid pair. exchanges : pd.DataFrame The exchanges table. R...
keyword[def] identifier[_split_symbol_mappings] ( identifier[df] , identifier[exchanges] ): literal[string] identifier[mappings] = identifier[df] [ identifier[list] ( identifier[mapping_columns] )] keyword[with] identifier[pd] . identifier[option_context] ( literal[string] , keyword[None] ): ...
def _split_symbol_mappings(df, exchanges): """Split out the symbol: sid mappings from the raw data. Parameters ---------- df : pd.DataFrame The dataframe with multiple rows for each symbol: sid pair. exchanges : pd.DataFrame The exchanges table. Returns ------- asset_in...
def agent_check_warn(consul_url=None, token=None, checkid=None, **kwargs): ''' This endpoint is used with a check that is of the TTL type. When this is called, the status of the check is set to warning and the TTL clock is reset. :param consul_url: The Consul server URL. :param checkid: The ID ...
def function[agent_check_warn, parameter[consul_url, token, checkid]]: constant[ This endpoint is used with a check that is of the TTL type. When this is called, the status of the check is set to warning and the TTL clock is reset. :param consul_url: The Consul server URL. :param checkid: T...
keyword[def] identifier[agent_check_warn] ( identifier[consul_url] = keyword[None] , identifier[token] = keyword[None] , identifier[checkid] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[ret] ={} identifier[query_params] ={} keyword[if] keyword[not] identifier[consul_url]...
def agent_check_warn(consul_url=None, token=None, checkid=None, **kwargs): """ This endpoint is used with a check that is of the TTL type. When this is called, the status of the check is set to warning and the TTL clock is reset. :param consul_url: The Consul server URL. :param checkid: The ID ...
def retry(num_attempts=3, exception_class=Exception, log=None, sleeptime=1): """ >>> def fail(): ... runs[0] += 1 ... raise ValueError() >>> runs = [0]; retry(sleeptime=0)(fail)() Traceback (most recent call last): ... ValueError >>> runs [3] >>> runs = [0]; retry(2, ...
def function[retry, parameter[num_attempts, exception_class, log, sleeptime]]: constant[ >>> def fail(): ... runs[0] += 1 ... raise ValueError() >>> runs = [0]; retry(sleeptime=0)(fail)() Traceback (most recent call last): ... ValueError >>> runs [3] >>> runs = [0...
keyword[def] identifier[retry] ( identifier[num_attempts] = literal[int] , identifier[exception_class] = identifier[Exception] , identifier[log] = keyword[None] , identifier[sleeptime] = literal[int] ): literal[string] keyword[def] identifier[decorator] ( identifier[func] ): @ identifier[functool...
def retry(num_attempts=3, exception_class=Exception, log=None, sleeptime=1): """ >>> def fail(): ... runs[0] += 1 ... raise ValueError() >>> runs = [0]; retry(sleeptime=0)(fail)() Traceback (most recent call last): ... ValueError >>> runs [3] >>> runs = [0]; retry(2, ...
def remove_perm(perm, user_or_group, forum=None): """ Remove a permission to a user (anonymous or not) or a group. """ user, group = get_identity(user_or_group) perm = ForumPermission.objects.get(codename=perm) if user: UserForumPermission.objects.filter( forum=forum, per...
def function[remove_perm, parameter[perm, user_or_group, forum]]: constant[ Remove a permission to a user (anonymous or not) or a group. ] <ast.Tuple object at 0x7da2044c12a0> assign[=] call[name[get_identity], parameter[name[user_or_group]]] variable[perm] assign[=] call[name[ForumPermission].o...
keyword[def] identifier[remove_perm] ( identifier[perm] , identifier[user_or_group] , identifier[forum] = keyword[None] ): literal[string] identifier[user] , identifier[group] = identifier[get_identity] ( identifier[user_or_group] ) identifier[perm] = identifier[ForumPermission] . identifier[objects] ...
def remove_perm(perm, user_or_group, forum=None): """ Remove a permission to a user (anonymous or not) or a group. """ (user, group) = get_identity(user_or_group) perm = ForumPermission.objects.get(codename=perm) if user: UserForumPermission.objects.filter(forum=forum, permission=perm, user=user...
def _descend_namespace(caller_globals, name): """ Given a globals dictionary, and a name of the form "a.b.c.d", recursively walk the globals expanding caller_globals['a']['b']['c']['d'] returning the result. Raises an exception (IndexError) on failure. """ names = name.split('.') cur = call...
def function[_descend_namespace, parameter[caller_globals, name]]: constant[ Given a globals dictionary, and a name of the form "a.b.c.d", recursively walk the globals expanding caller_globals['a']['b']['c']['d'] returning the result. Raises an exception (IndexError) on failure. ] variab...
keyword[def] identifier[_descend_namespace] ( identifier[caller_globals] , identifier[name] ): literal[string] identifier[names] = identifier[name] . identifier[split] ( literal[string] ) identifier[cur] = identifier[caller_globals] keyword[for] identifier[i] keyword[in] identifier[names] : ...
def _descend_namespace(caller_globals, name): """ Given a globals dictionary, and a name of the form "a.b.c.d", recursively walk the globals expanding caller_globals['a']['b']['c']['d'] returning the result. Raises an exception (IndexError) on failure. """ names = name.split('.') cur = calle...