code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def build_table(self, table, force=False): """Build all of the sources for a table """ sources = self._resolve_sources(None, [table]) for source in sources: self.build_source(None, source, force=force) self.unify_partitions()
def function[build_table, parameter[self, table, force]]: constant[Build all of the sources for a table ] variable[sources] assign[=] call[name[self]._resolve_sources, parameter[constant[None], list[[<ast.Name object at 0x7da18f58de70>]]]] for taget[name[source]] in starred[name[sources]] begin[...
keyword[def] identifier[build_table] ( identifier[self] , identifier[table] , identifier[force] = keyword[False] ): literal[string] identifier[sources] = identifier[self] . identifier[_resolve_sources] ( keyword[None] ,[ identifier[table] ]) keyword[for] identifier[source] keyword[in] ...
def build_table(self, table, force=False): """Build all of the sources for a table """ sources = self._resolve_sources(None, [table]) for source in sources: self.build_source(None, source, force=force) # depends on [control=['for'], data=['source']] self.unify_partitions()
def _append_instruction(self, obj, qargs=None): """Update the current Operator by apply an instruction.""" if isinstance(obj, Instruction): chan = None if obj.name == 'reset': # For superoperator evolution we can simulate a reset as # a non-unitary...
def function[_append_instruction, parameter[self, obj, qargs]]: constant[Update the current Operator by apply an instruction.] if call[name[isinstance], parameter[name[obj], name[Instruction]]] begin[:] variable[chan] assign[=] constant[None] if compare[name[obj].name equ...
keyword[def] identifier[_append_instruction] ( identifier[self] , identifier[obj] , identifier[qargs] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[obj] , identifier[Instruction] ): identifier[chan] = keyword[None] keyword[if] identi...
def _append_instruction(self, obj, qargs=None): """Update the current Operator by apply an instruction.""" if isinstance(obj, Instruction): chan = None if obj.name == 'reset': # For superoperator evolution we can simulate a reset as # a non-unitary supeorperator matrix ...
def gcd(*numbers): """ Returns the greatest common divisor for a sequence of numbers. Args: \*numbers: Sequence of numbers. Returns: (int) Greatest common divisor of numbers. """ n = numbers[0] for i in numbers: n = pygcd(n, i) return n
def function[gcd, parameter[]]: constant[ Returns the greatest common divisor for a sequence of numbers. Args: \*numbers: Sequence of numbers. Returns: (int) Greatest common divisor of numbers. ] variable[n] assign[=] call[name[numbers]][constant[0]] for taget[n...
keyword[def] identifier[gcd] (* identifier[numbers] ): literal[string] identifier[n] = identifier[numbers] [ literal[int] ] keyword[for] identifier[i] keyword[in] identifier[numbers] : identifier[n] = identifier[pygcd] ( identifier[n] , identifier[i] ) keyword[return] identifier[n]
def gcd(*numbers): """ Returns the greatest common divisor for a sequence of numbers. Args: \\*numbers: Sequence of numbers. Returns: (int) Greatest common divisor of numbers. """ n = numbers[0] for i in numbers: n = pygcd(n, i) # depends on [control=['for'], data=...
def tokenize(self, s): """ Tokenizes the string. :param s: the string to tokenize :type s: str :return: the iterator :rtype: TokenIterator """ javabridge.call(self.jobject, "tokenize", "(Ljava/lang/String;)V", s) return TokenIterator(self)
def function[tokenize, parameter[self, s]]: constant[ Tokenizes the string. :param s: the string to tokenize :type s: str :return: the iterator :rtype: TokenIterator ] call[name[javabridge].call, parameter[name[self].jobject, constant[tokenize], constant[...
keyword[def] identifier[tokenize] ( identifier[self] , identifier[s] ): literal[string] identifier[javabridge] . identifier[call] ( identifier[self] . identifier[jobject] , literal[string] , literal[string] , identifier[s] ) keyword[return] identifier[TokenIterator] ( identifier[self] )
def tokenize(self, s): """ Tokenizes the string. :param s: the string to tokenize :type s: str :return: the iterator :rtype: TokenIterator """ javabridge.call(self.jobject, 'tokenize', '(Ljava/lang/String;)V', s) return TokenIterator(self)
def marker(self, *args): """ Defines markers one at a time for your graph args are of the form:: <marker type>, <color>, <data set index>, <data point>, <size>, <priority> see the official developers doc for the comp...
def function[marker, parameter[self]]: constant[ Defines markers one at a time for your graph args are of the form:: <marker type>, <color>, <data set index>, <data point>, <size>, <priority> see the official develop...
keyword[def] identifier[marker] ( identifier[self] ,* identifier[args] ): literal[string] keyword[if] identifier[len] ( identifier[args] [ literal[int] ])== literal[int] : keyword[assert] identifier[args] [ literal[int] ] keyword[in] identifier[MARKERS] , literal[string] % identifie...
def marker(self, *args): """ Defines markers one at a time for your graph args are of the form:: <marker type>, <color>, <data set index>, <data point>, <size>, <priority> see the official developers doc for the complete...
def return_net(word,word_net,depth=1): '''Creates a list of unique words that are at a provided depth from root word. @Args: -- word : root word from which the linked words should be returned. word_net : word network (dictionary of word instances)to be refered in this process. depth : ...
def function[return_net, parameter[word, word_net, depth]]: constant[Creates a list of unique words that are at a provided depth from root word. @Args: -- word : root word from which the linked words should be returned. word_net : word network (dictionary of word instances)to be refered i...
keyword[def] identifier[return_net] ( identifier[word] , identifier[word_net] , identifier[depth] = literal[int] ): literal[string] keyword[if] identifier[depth] < literal[int] : keyword[raise] identifier[Exception] ( identifier[TAG] + literal[string] ) keyword[if] identifier[depth] == literal[int]...
def return_net(word, word_net, depth=1): """Creates a list of unique words that are at a provided depth from root word. @Args: -- word : root word from which the linked words should be returned. word_net : word network (dictionary of word instances)to be refered in this process. depth : ...
def format_content_type_object(repo, content_type, uuid): """ Return a content object from a repository for a given content_type and uuid :param Repo repo: The git repository. :param str content_type: The content type to list :returns: dict """ try: storage_manag...
def function[format_content_type_object, parameter[repo, content_type, uuid]]: constant[ Return a content object from a repository for a given content_type and uuid :param Repo repo: The git repository. :param str content_type: The content type to list :returns: dict ] ...
keyword[def] identifier[format_content_type_object] ( identifier[repo] , identifier[content_type] , identifier[uuid] ): literal[string] keyword[try] : identifier[storage_manager] = identifier[StorageManager] ( identifier[repo] ) identifier[model_class] = identifier[load_model_class] ( ide...
def format_content_type_object(repo, content_type, uuid): """ Return a content object from a repository for a given content_type and uuid :param Repo repo: The git repository. :param str content_type: The content type to list :returns: dict """ try: storage_manag...
def iter_replace_strings(replacements): """Create a function that uses replacement pairs to process a string. The returned function takes an iterator and yields on each processed line. Args: replacements: Dict containing 'find_string': 'replace_string' pairs Return...
def function[iter_replace_strings, parameter[replacements]]: constant[Create a function that uses replacement pairs to process a string. The returned function takes an iterator and yields on each processed line. Args: replacements: Dict containing 'find_string': 'replace_st...
keyword[def] identifier[iter_replace_strings] ( identifier[replacements] ): literal[string] keyword[def] identifier[function_iter_replace_strings] ( identifier[iterable_strings] ): literal[string] keyword[for] identifier[string] keyword[in] identifier[iterable_strings...
def iter_replace_strings(replacements): """Create a function that uses replacement pairs to process a string. The returned function takes an iterator and yields on each processed line. Args: replacements: Dict containing 'find_string': 'replace_string' pairs Returns: ...
def _derive_checksum(self, s): """ Derive the checksum :param str s: Random string for which to derive the checksum """ checksum = hashlib.sha256(bytes(s, "ascii")).hexdigest() return checksum[:4]
def function[_derive_checksum, parameter[self, s]]: constant[ Derive the checksum :param str s: Random string for which to derive the checksum ] variable[checksum] assign[=] call[call[name[hashlib].sha256, parameter[call[name[bytes], parameter[name[s], constant[ascii]]]]].hexdigest,...
keyword[def] identifier[_derive_checksum] ( identifier[self] , identifier[s] ): literal[string] identifier[checksum] = identifier[hashlib] . identifier[sha256] ( identifier[bytes] ( identifier[s] , literal[string] )). identifier[hexdigest] () keyword[return] identifier[checksum] [: litera...
def _derive_checksum(self, s): """ Derive the checksum :param str s: Random string for which to derive the checksum """ checksum = hashlib.sha256(bytes(s, 'ascii')).hexdigest() return checksum[:4]
def _process_trace(trace_file, index_file, trace, name, index): """Support function for coda_output(); writes output to files""" if ndim(trace) > 1: trace = swapaxes(trace, 0, 1) for i, seq in enumerate(trace): _name = '%s_%s' % (name, i) index = _process_trace(trace_fil...
def function[_process_trace, parameter[trace_file, index_file, trace, name, index]]: constant[Support function for coda_output(); writes output to files] if compare[call[name[ndim], parameter[name[trace]]] greater[>] constant[1]] begin[:] variable[trace] assign[=] call[name[swapaxes], pa...
keyword[def] identifier[_process_trace] ( identifier[trace_file] , identifier[index_file] , identifier[trace] , identifier[name] , identifier[index] ): literal[string] keyword[if] identifier[ndim] ( identifier[trace] )> literal[int] : identifier[trace] = identifier[swapaxes] ( identifier[trace] ...
def _process_trace(trace_file, index_file, trace, name, index): """Support function for coda_output(); writes output to files""" if ndim(trace) > 1: trace = swapaxes(trace, 0, 1) for (i, seq) in enumerate(trace): _name = '%s_%s' % (name, i) index = _process_trace(trace_fi...
def findRoleID(self, name): """searches the roles by name and returns the role's ID""" for r in self: if r['name'].lower() == name.lower(): return r['id'] del r return None
def function[findRoleID, parameter[self, name]]: constant[searches the roles by name and returns the role's ID] for taget[name[r]] in starred[name[self]] begin[:] if compare[call[call[name[r]][constant[name]].lower, parameter[]] equal[==] call[name[name].lower, parameter[]]] begin[:] ...
keyword[def] identifier[findRoleID] ( identifier[self] , identifier[name] ): literal[string] keyword[for] identifier[r] keyword[in] identifier[self] : keyword[if] identifier[r] [ literal[string] ]. identifier[lower] ()== identifier[name] . identifier[lower] (): key...
def findRoleID(self, name): """searches the roles by name and returns the role's ID""" for r in self: if r['name'].lower() == name.lower(): return r['id'] # depends on [control=['if'], data=[]] del r # depends on [control=['for'], data=['r']] return None
def delete_zone(zone_id, profile): ''' Delete a zone. :param zone_id: Zone to delete. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :rtype: ``bool`` CLI Example: .. code-block:: bash salt myminion libcloud_dns.delete_zone google.com pro...
def function[delete_zone, parameter[zone_id, profile]]: constant[ Delete a zone. :param zone_id: Zone to delete. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :rtype: ``bool`` CLI Example: .. code-block:: bash salt myminion libcloud...
keyword[def] identifier[delete_zone] ( identifier[zone_id] , identifier[profile] ): literal[string] identifier[conn] = identifier[_get_driver] ( identifier[profile] = identifier[profile] ) identifier[zone] = identifier[conn] . identifier[get_zone] ( identifier[zone_id] = identifier[zone_id] ) key...
def delete_zone(zone_id, profile): """ Delete a zone. :param zone_id: Zone to delete. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :rtype: ``bool`` CLI Example: .. code-block:: bash salt myminion libcloud_dns.delete_zone google.com pro...
def read(self, url): """Read storage at a given url""" (store_name, path) = self._split_url(url) adapter = self._create_adapter(store_name) lines = [] with adapter.open(path) as f: for line in f: lines.append(line.decode()) return lines
def function[read, parameter[self, url]]: constant[Read storage at a given url] <ast.Tuple object at 0x7da1b1b03820> assign[=] call[name[self]._split_url, parameter[name[url]]] variable[adapter] assign[=] call[name[self]._create_adapter, parameter[name[store_name]]] variable[lines] assig...
keyword[def] identifier[read] ( identifier[self] , identifier[url] ): literal[string] ( identifier[store_name] , identifier[path] )= identifier[self] . identifier[_split_url] ( identifier[url] ) identifier[adapter] = identifier[self] . identifier[_create_adapter] ( identifier[store_name] ) ...
def read(self, url): """Read storage at a given url""" (store_name, path) = self._split_url(url) adapter = self._create_adapter(store_name) lines = [] with adapter.open(path) as f: for line in f: lines.append(line.decode()) # depends on [control=['for'], data=['line']] # depend...
def sort_dict(unsorted_dict): """ Return a OrderedDict ordered by key names from the :unsorted_dict: """ sorted_dict = OrderedDict() # sort items before inserting them into a dict for key, value in sorted(unsorted_dict.items(), key=itemgetter(0)): sorted_dict[key] = value return sort...
def function[sort_dict, parameter[unsorted_dict]]: constant[ Return a OrderedDict ordered by key names from the :unsorted_dict: ] variable[sorted_dict] assign[=] call[name[OrderedDict], parameter[]] for taget[tuple[[<ast.Name object at 0x7da1b0fe56f0>, <ast.Name object at 0x7da1b0fe7190>...
keyword[def] identifier[sort_dict] ( identifier[unsorted_dict] ): literal[string] identifier[sorted_dict] = identifier[OrderedDict] () keyword[for] identifier[key] , identifier[value] keyword[in] identifier[sorted] ( identifier[unsorted_dict] . identifier[items] (), identifier[key] = identifie...
def sort_dict(unsorted_dict): """ Return a OrderedDict ordered by key names from the :unsorted_dict: """ sorted_dict = OrderedDict() # sort items before inserting them into a dict for (key, value) in sorted(unsorted_dict.items(), key=itemgetter(0)): sorted_dict[key] = value # depends on...
def find(self, package, **kwargs): """ Find a package using package finders. Return the first package found. Args: package (str): package to find. **kwargs (): additional keyword arguments used by finders. Returns: PackageSpec: if package fo...
def function[find, parameter[self, package]]: constant[ Find a package using package finders. Return the first package found. Args: package (str): package to find. **kwargs (): additional keyword arguments used by finders. Returns: PackageSp...
keyword[def] identifier[find] ( identifier[self] , identifier[package] ,** identifier[kwargs] ): literal[string] keyword[for] identifier[finder] keyword[in] identifier[self] . identifier[finders] : identifier[package_spec] = identifier[finder] . identifier[find] ( identifier[package...
def find(self, package, **kwargs): """ Find a package using package finders. Return the first package found. Args: package (str): package to find. **kwargs (): additional keyword arguments used by finders. Returns: PackageSpec: if package found,...
def read(sensor): """ distance of object in front of sensor in CM. """ import time import RPi.GPIO as GPIO # Disable any warning message such as GPIO pins in use GPIO.setwarnings(False) # use the values of the GPIO pins, and not the actual pin number # so if you connect to ...
def function[read, parameter[sensor]]: constant[ distance of object in front of sensor in CM. ] import module[time] import module[RPi.GPIO] as alias[GPIO] call[name[GPIO].setwarnings, parameter[constant[False]]] call[name[GPIO].setmode, parameter[name[GPIO].BCM]] if compa...
keyword[def] identifier[read] ( identifier[sensor] ): literal[string] keyword[import] identifier[time] keyword[import] identifier[RPi] . identifier[GPIO] keyword[as] identifier[GPIO] identifier[GPIO] . identifier[setwarnings] ( keyword[False] ) identifier[GPI...
def read(sensor): """ distance of object in front of sensor in CM. """ import time import RPi.GPIO as GPIO # Disable any warning message such as GPIO pins in use GPIO.setwarnings(False) # use the values of the GPIO pins, and not the actual pin number # so if you connect to GPIO 25 wh...
def local_expiring_lru(obj): """ Property that maps to a key in a local dict-like attribute. self._cache must be an OrderedDict self._cache_size must be defined as LRU size self._cache_ttl is the expiration time in seconds .. class Foo(object): def __init__(self,...
def function[local_expiring_lru, parameter[obj]]: constant[ Property that maps to a key in a local dict-like attribute. self._cache must be an OrderedDict self._cache_size must be defined as LRU size self._cache_ttl is the expiration time in seconds .. class Foo(object): ...
keyword[def] identifier[local_expiring_lru] ( identifier[obj] ): literal[string] @ identifier[wraps] ( identifier[obj] ) keyword[def] identifier[memoizer] (* identifier[args] ,** identifier[kwargs] ): identifier[instance] = identifier[args] [ literal[int] ] identifier[lru_size] = ide...
def local_expiring_lru(obj): """ Property that maps to a key in a local dict-like attribute. self._cache must be an OrderedDict self._cache_size must be defined as LRU size self._cache_ttl is the expiration time in seconds .. class Foo(object): def __init__(self,...
def on_open(self, ws): """Websocket on_open event handler""" def keep_alive(interval): while True: time.sleep(interval) self.ping() start_new_thread(keep_alive, (self.keep_alive_interval, ))
def function[on_open, parameter[self, ws]]: constant[Websocket on_open event handler] def function[keep_alive, parameter[interval]]: while constant[True] begin[:] call[name[time].sleep, parameter[name[interval]]] call[name[self].ping, param...
keyword[def] identifier[on_open] ( identifier[self] , identifier[ws] ): literal[string] keyword[def] identifier[keep_alive] ( identifier[interval] ): keyword[while] keyword[True] : identifier[time] . identifier[sleep] ( identifier[interval] ) identif...
def on_open(self, ws): """Websocket on_open event handler""" def keep_alive(interval): while True: time.sleep(interval) self.ping() # depends on [control=['while'], data=[]] start_new_thread(keep_alive, (self.keep_alive_interval,))
def apply_transformation(self, structure, return_ranked_list=False): """ Apply the transformation. Args: structure: input structure return_ranked_list (bool/int): Boolean stating whether or not multiple structures are returned. If return_ranked_list is ...
def function[apply_transformation, parameter[self, structure, return_ranked_list]]: constant[ Apply the transformation. Args: structure: input structure return_ranked_list (bool/int): Boolean stating whether or not multiple structures are returned. If ret...
keyword[def] identifier[apply_transformation] ( identifier[self] , identifier[structure] , identifier[return_ranked_list] = keyword[False] ): literal[string] identifier[sp] = identifier[get_el_sp] ( identifier[self] . identifier[specie_to_remove] ) identifier[specie_indices] =[ identifier[...
def apply_transformation(self, structure, return_ranked_list=False): """ Apply the transformation. Args: structure: input structure return_ranked_list (bool/int): Boolean stating whether or not multiple structures are returned. If return_ranked_list is ...
def _download_and_clean_file(filename, url): """Downloads data from url, and makes changes to match the CSV format.""" temp_file, _ = urllib.request.urlretrieve(url) with tf.gfile.Open(temp_file, 'r') as temp_eval_file: with tf.gfile.Open(filename, 'w') as eval_file: for line in temp_eval_file: ...
def function[_download_and_clean_file, parameter[filename, url]]: constant[Downloads data from url, and makes changes to match the CSV format.] <ast.Tuple object at 0x7da204620c40> assign[=] call[name[urllib].request.urlretrieve, parameter[name[url]]] with call[name[tf].gfile.Open, parameter[nam...
keyword[def] identifier[_download_and_clean_file] ( identifier[filename] , identifier[url] ): literal[string] identifier[temp_file] , identifier[_] = identifier[urllib] . identifier[request] . identifier[urlretrieve] ( identifier[url] ) keyword[with] identifier[tf] . identifier[gfile] . identifier[Open] ( ...
def _download_and_clean_file(filename, url): """Downloads data from url, and makes changes to match the CSV format.""" (temp_file, _) = urllib.request.urlretrieve(url) with tf.gfile.Open(temp_file, 'r') as temp_eval_file: with tf.gfile.Open(filename, 'w') as eval_file: for line in temp_e...
def list_kinesis_applications(region, filter_by_kwargs): """List all the kinesis applications along with the shards for each stream""" conn = boto.kinesis.connect_to_region(region) streams = conn.list_streams()['StreamNames'] kinesis_streams = {} for stream_name in streams: shard_ids = [] ...
def function[list_kinesis_applications, parameter[region, filter_by_kwargs]]: constant[List all the kinesis applications along with the shards for each stream] variable[conn] assign[=] call[name[boto].kinesis.connect_to_region, parameter[name[region]]] variable[streams] assign[=] call[call[name[...
keyword[def] identifier[list_kinesis_applications] ( identifier[region] , identifier[filter_by_kwargs] ): literal[string] identifier[conn] = identifier[boto] . identifier[kinesis] . identifier[connect_to_region] ( identifier[region] ) identifier[streams] = identifier[conn] . identifier[list_streams] (...
def list_kinesis_applications(region, filter_by_kwargs): """List all the kinesis applications along with the shards for each stream""" conn = boto.kinesis.connect_to_region(region) streams = conn.list_streams()['StreamNames'] kinesis_streams = {} for stream_name in streams: shard_ids = [] ...
def atan(x): """ Inverse tangent """ if isinstance(x, UncertainFunction): mcpts = np.arctan(x._mcpts) return UncertainFunction(mcpts) else: return np.arctan(x)
def function[atan, parameter[x]]: constant[ Inverse tangent ] if call[name[isinstance], parameter[name[x], name[UncertainFunction]]] begin[:] variable[mcpts] assign[=] call[name[np].arctan, parameter[name[x]._mcpts]] return[call[name[UncertainFunction], parameter[name[mcp...
keyword[def] identifier[atan] ( identifier[x] ): literal[string] keyword[if] identifier[isinstance] ( identifier[x] , identifier[UncertainFunction] ): identifier[mcpts] = identifier[np] . identifier[arctan] ( identifier[x] . identifier[_mcpts] ) keyword[return] identifier[UncertainFunct...
def atan(x): """ Inverse tangent """ if isinstance(x, UncertainFunction): mcpts = np.arctan(x._mcpts) return UncertainFunction(mcpts) # depends on [control=['if'], data=[]] else: return np.arctan(x)
def select_event( event = None, selection = "ejets" ): """ Select a HEP event. """ if selection == "ejets": # Require single lepton. # Require >= 4 jets. if \ 0 < len(event.el_pt) < 2 and \ len(event.jet_pt) >= 4 and \ len(event...
def function[select_event, parameter[event, selection]]: constant[ Select a HEP event. ] if compare[name[selection] equal[==] constant[ejets]] begin[:] if <ast.BoolOp object at 0x7da1b28ff220> begin[:] return[constant[True]]
keyword[def] identifier[select_event] ( identifier[event] = keyword[None] , identifier[selection] = literal[string] ): literal[string] keyword[if] identifier[selection] == literal[string] : keyword[if] literal[int] < identifier[len] ( identifier[event] . identifier[el_pt] )< literal...
def select_event(event=None, selection='ejets'): """ Select a HEP event. """ if selection == 'ejets': # Require single lepton. # Require >= 4 jets. if 0 < len(event.el_pt) < 2 and len(event.jet_pt) >= 4 and (len(event.ljet_m) >= 1): return True # depends on [control=...
def check_column(state, name, missing_msg=None, expand_msg=None): """Zoom in on a particular column in the query result, by name. After zooming in on a column, which is represented as a single-column query result, you can use ``has_equal_value()`` to verify whether the column in the solution query result ...
def function[check_column, parameter[state, name, missing_msg, expand_msg]]: constant[Zoom in on a particular column in the query result, by name. After zooming in on a column, which is represented as a single-column query result, you can use ``has_equal_value()`` to verify whether the column in the so...
keyword[def] identifier[check_column] ( identifier[state] , identifier[name] , identifier[missing_msg] = keyword[None] , identifier[expand_msg] = keyword[None] ): literal[string] keyword[if] identifier[missing_msg] keyword[is] keyword[None] : identifier[missing_msg] = literal[string] key...
def check_column(state, name, missing_msg=None, expand_msg=None): """Zoom in on a particular column in the query result, by name. After zooming in on a column, which is represented as a single-column query result, you can use ``has_equal_value()`` to verify whether the column in the solution query result ...
def add(self, data): """Add data to the buffer""" assert isinstance(data, bytes) with self.lock: self.buf += data
def function[add, parameter[self, data]]: constant[Add data to the buffer] assert[call[name[isinstance], parameter[name[data], name[bytes]]]] with name[self].lock begin[:] <ast.AugAssign object at 0x7da20e9b2b90>
keyword[def] identifier[add] ( identifier[self] , identifier[data] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[data] , identifier[bytes] ) keyword[with] identifier[self] . identifier[lock] : identifier[self] . identifier[buf] += identifier[data]
def add(self, data): """Add data to the buffer""" assert isinstance(data, bytes) with self.lock: self.buf += data # depends on [control=['with'], data=[]]
def safe_list_set(plist, idx, fill_with, value): """ Sets: ``` plist[idx] = value ``` If len(plist) is smaller than what idx is trying to dereferece, we first grow plist to get the needed capacity and fill the new elements with fill_with (or fill_with(), if it's a callable). ""...
def function[safe_list_set, parameter[plist, idx, fill_with, value]]: constant[ Sets: ``` plist[idx] = value ``` If len(plist) is smaller than what idx is trying to dereferece, we first grow plist to get the needed capacity and fill the new elements with fill_with (or fill_with...
keyword[def] identifier[safe_list_set] ( identifier[plist] , identifier[idx] , identifier[fill_with] , identifier[value] ): literal[string] keyword[try] : identifier[plist] [ identifier[idx] ]= identifier[value] keyword[return] keyword[except] identifier[IndexError] : ke...
def safe_list_set(plist, idx, fill_with, value): """ Sets: ``` plist[idx] = value ``` If len(plist) is smaller than what idx is trying to dereferece, we first grow plist to get the needed capacity and fill the new elements with fill_with (or fill_with(), if it's a callable). ""...
def get_shutit_pexpect_session_from_id(self, shutit_pexpect_id): """Get the pexpect session from the given identifier. """ shutit_global.shutit_global_object.yield_to_draw() for key in self.shutit_pexpect_sessions: if self.shutit_pexpect_sessions[key].pexpect_session_id == shutit_pexpect_id: return self....
def function[get_shutit_pexpect_session_from_id, parameter[self, shutit_pexpect_id]]: constant[Get the pexpect session from the given identifier. ] call[name[shutit_global].shutit_global_object.yield_to_draw, parameter[]] for taget[name[key]] in starred[name[self].shutit_pexpect_sessions] begi...
keyword[def] identifier[get_shutit_pexpect_session_from_id] ( identifier[self] , identifier[shutit_pexpect_id] ): literal[string] identifier[shutit_global] . identifier[shutit_global_object] . identifier[yield_to_draw] () keyword[for] identifier[key] keyword[in] identifier[self] . identifier[shutit_pexpe...
def get_shutit_pexpect_session_from_id(self, shutit_pexpect_id): """Get the pexpect session from the given identifier. """ shutit_global.shutit_global_object.yield_to_draw() for key in self.shutit_pexpect_sessions: if self.shutit_pexpect_sessions[key].pexpect_session_id == shutit_pexpect_id: ...
def plot_d_delta_m(fignum, Bdm, DdeltaM, s): """ function to plot d (Delta M)/dB curves Parameters __________ fignum : matplotlib figure number Bdm : change in field Ddelta M : change in delta M s : specimen name """ plt.figure(num=fignum) plt.clf() if not isServer: ...
def function[plot_d_delta_m, parameter[fignum, Bdm, DdeltaM, s]]: constant[ function to plot d (Delta M)/dB curves Parameters __________ fignum : matplotlib figure number Bdm : change in field Ddelta M : change in delta M s : specimen name ] call[name[plt].figure, param...
keyword[def] identifier[plot_d_delta_m] ( identifier[fignum] , identifier[Bdm] , identifier[DdeltaM] , identifier[s] ): literal[string] identifier[plt] . identifier[figure] ( identifier[num] = identifier[fignum] ) identifier[plt] . identifier[clf] () keyword[if] keyword[not] identifier[isServer...
def plot_d_delta_m(fignum, Bdm, DdeltaM, s): """ function to plot d (Delta M)/dB curves Parameters __________ fignum : matplotlib figure number Bdm : change in field Ddelta M : change in delta M s : specimen name """ plt.figure(num=fignum) plt.clf() if not isServer: ...
def _at_content(self, calculator, rule, scope, block): """ Implements @content """ if '@content' not in rule.options: log.error("Content string not found for @content (%s)", rule.file_and_line) rule.unparsed_contents = rule.options.pop('@content', '') self.man...
def function[_at_content, parameter[self, calculator, rule, scope, block]]: constant[ Implements @content ] if compare[constant[@content] <ast.NotIn object at 0x7da2590d7190> name[rule].options] begin[:] call[name[log].error, parameter[constant[Content string not found fo...
keyword[def] identifier[_at_content] ( identifier[self] , identifier[calculator] , identifier[rule] , identifier[scope] , identifier[block] ): literal[string] keyword[if] literal[string] keyword[not] keyword[in] identifier[rule] . identifier[options] : identifier[log] . identifier[...
def _at_content(self, calculator, rule, scope, block): """ Implements @content """ if '@content' not in rule.options: log.error('Content string not found for @content (%s)', rule.file_and_line) # depends on [control=['if'], data=[]] rule.unparsed_contents = rule.options.pop('@conten...
def unused_keys(self): """Lists all keys which are present in the ConfigTree but which have not been accessed.""" unused = set() for k, c in self._children.items(): if isinstance(c, ConfigNode): if not c.has_been_accessed(): unused.add(k) ...
def function[unused_keys, parameter[self]]: constant[Lists all keys which are present in the ConfigTree but which have not been accessed.] variable[unused] assign[=] call[name[set], parameter[]] for taget[tuple[[<ast.Name object at 0x7da18dc99690>, <ast.Name object at 0x7da18dc98f70>]]] in starr...
keyword[def] identifier[unused_keys] ( identifier[self] ): literal[string] identifier[unused] = identifier[set] () keyword[for] identifier[k] , identifier[c] keyword[in] identifier[self] . identifier[_children] . identifier[items] (): keyword[if] identifier[isinstance] ( i...
def unused_keys(self): """Lists all keys which are present in the ConfigTree but which have not been accessed.""" unused = set() for (k, c) in self._children.items(): if isinstance(c, ConfigNode): if not c.has_been_accessed(): unused.add(k) # depends on [control=['if'], ...
def max_likelihood(self, data, weights=None, stats=None): """ Maximize the likelihood for given data :param data: :param weights: :param stats: :return: """ if isinstance(data, list): x = np.vstack([d[0] for d in data]) y = np.vstac...
def function[max_likelihood, parameter[self, data, weights, stats]]: constant[ Maximize the likelihood for given data :param data: :param weights: :param stats: :return: ] if call[name[isinstance], parameter[name[data], name[list]]] begin[:] ...
keyword[def] identifier[max_likelihood] ( identifier[self] , identifier[data] , identifier[weights] = keyword[None] , identifier[stats] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[data] , identifier[list] ): identifier[x] = identifier[np] . ident...
def max_likelihood(self, data, weights=None, stats=None): """ Maximize the likelihood for given data :param data: :param weights: :param stats: :return: """ if isinstance(data, list): x = np.vstack([d[0] for d in data]) y = np.vstack([d[1] for d in...
def _decode_codepage(codepage, data): """ Args: codepage (int) data (bytes) Returns: `text` Decodes data using the given codepage. If some data can't be decoded using the codepage it will not fail. """ assert isinstance(data, bytes) if not data: return ...
def function[_decode_codepage, parameter[codepage, data]]: constant[ Args: codepage (int) data (bytes) Returns: `text` Decodes data using the given codepage. If some data can't be decoded using the codepage it will not fail. ] assert[call[name[isinstance], parame...
keyword[def] identifier[_decode_codepage] ( identifier[codepage] , identifier[data] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[data] , identifier[bytes] ) keyword[if] keyword[not] identifier[data] : keyword[return] literal[string] identifier[l...
def _decode_codepage(codepage, data): """ Args: codepage (int) data (bytes) Returns: `text` Decodes data using the given codepage. If some data can't be decoded using the codepage it will not fail. """ assert isinstance(data, bytes) if not data: return u'...
def get_transactions_csv(self, include_investment=False, acct=0): """Returns the raw CSV transaction data as downloaded from Mint. If include_investment == True, also includes transactions that Mint classifies as investment-related. You may find that the investment transaction data is ...
def function[get_transactions_csv, parameter[self, include_investment, acct]]: constant[Returns the raw CSV transaction data as downloaded from Mint. If include_investment == True, also includes transactions that Mint classifies as investment-related. You may find that the investment t...
keyword[def] identifier[get_transactions_csv] ( identifier[self] , identifier[include_investment] = keyword[False] , identifier[acct] = literal[int] ): literal[string] identifier[params] = keyword[None] keyword[if] identifier[include_investment] keyword[or] ...
def get_transactions_csv(self, include_investment=False, acct=0): """Returns the raw CSV transaction data as downloaded from Mint. If include_investment == True, also includes transactions that Mint classifies as investment-related. You may find that the investment transaction data is not ...
def sanity_check( state: MediatorTransferState, channelidentifiers_to_channels: ChannelMap, ) -> None: """ Check invariants that must hold. """ # if a transfer is paid we must know the secret all_transfers_states = itertools.chain( (pair.payee_state for pair in state.transfers_pair)...
def function[sanity_check, parameter[state, channelidentifiers_to_channels]]: constant[ Check invariants that must hold. ] variable[all_transfers_states] assign[=] call[name[itertools].chain, parameter[<ast.GeneratorExp object at 0x7da1b19511e0>, <ast.GeneratorExp object at 0x7da1b1951090>]] if ...
keyword[def] identifier[sanity_check] ( identifier[state] : identifier[MediatorTransferState] , identifier[channelidentifiers_to_channels] : identifier[ChannelMap] , )-> keyword[None] : literal[string] identifier[all_transfers_states] = identifier[itertools] . identifier[chain] ( ( identifier[p...
def sanity_check(state: MediatorTransferState, channelidentifiers_to_channels: ChannelMap) -> None: """ Check invariants that must hold. """ # if a transfer is paid we must know the secret all_transfers_states = itertools.chain((pair.payee_state for pair in state.transfers_pair), (pair.payer_state for pair ...
def popitem (self): """Remove oldest key from dict and return item.""" if self._keys: k = self._keys[0] v = self[k] del self[k] return (k, v) raise KeyError("popitem() on empty dictionary")
def function[popitem, parameter[self]]: constant[Remove oldest key from dict and return item.] if name[self]._keys begin[:] variable[k] assign[=] call[name[self]._keys][constant[0]] variable[v] assign[=] call[name[self]][name[k]] <ast.Delete object at 0x7da1b0aba3...
keyword[def] identifier[popitem] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_keys] : identifier[k] = identifier[self] . identifier[_keys] [ literal[int] ] identifier[v] = identifier[self] [ identifier[k] ] keyword[del] id...
def popitem(self): """Remove oldest key from dict and return item.""" if self._keys: k = self._keys[0] v = self[k] del self[k] return (k, v) # depends on [control=['if'], data=[]] raise KeyError('popitem() on empty dictionary')
def _update_solution_data(self, s, HH, CC, C0): """ Returns the voltage angle and generator set-point vectors. """ x = s["x"] Va_v = self.om.get_var("Va") Pg_v = self.om.get_var("Pg") Va = x[Va_v.i1:Va_v.iN + 1] Pg = x[Pg_v.i1:Pg_v.iN + 1] # f = 0.5 * dot(...
def function[_update_solution_data, parameter[self, s, HH, CC, C0]]: constant[ Returns the voltage angle and generator set-point vectors. ] variable[x] assign[=] call[name[s]][constant[x]] variable[Va_v] assign[=] call[name[self].om.get_var, parameter[constant[Va]]] variable[Pg_v...
keyword[def] identifier[_update_solution_data] ( identifier[self] , identifier[s] , identifier[HH] , identifier[CC] , identifier[C0] ): literal[string] identifier[x] = identifier[s] [ literal[string] ] identifier[Va_v] = identifier[self] . identifier[om] . identifier[get_var] ( literal[str...
def _update_solution_data(self, s, HH, CC, C0): """ Returns the voltage angle and generator set-point vectors. """ x = s['x'] Va_v = self.om.get_var('Va') Pg_v = self.om.get_var('Pg') Va = x[Va_v.i1:Va_v.iN + 1] Pg = x[Pg_v.i1:Pg_v.iN + 1] # f = 0.5 * dot(x.T * HH, x) + dot(CC...
def kube_node_status_condition(self, metric, scraper_config): """ The ready status of a cluster node. v1.0+""" base_check_name = scraper_config['namespace'] + '.node' metric_name = scraper_config['namespace'] + '.nodes.by_condition' by_condition_counter = Counter() for sample in...
def function[kube_node_status_condition, parameter[self, metric, scraper_config]]: constant[ The ready status of a cluster node. v1.0+] variable[base_check_name] assign[=] binary_operation[call[name[scraper_config]][constant[namespace]] + constant[.node]] variable[metric_name] assign[=] binary_o...
keyword[def] identifier[kube_node_status_condition] ( identifier[self] , identifier[metric] , identifier[scraper_config] ): literal[string] identifier[base_check_name] = identifier[scraper_config] [ literal[string] ]+ literal[string] identifier[metric_name] = identifier[scraper_config] [ ...
def kube_node_status_condition(self, metric, scraper_config): """ The ready status of a cluster node. v1.0+""" base_check_name = scraper_config['namespace'] + '.node' metric_name = scraper_config['namespace'] + '.nodes.by_condition' by_condition_counter = Counter() for sample in metric.samples: ...
def readTableFromDelimited(f, separator="\t"): """ Reads a table object from given plain delimited file. """ rowNames = [] columnNames = [] matrix = [] first = True for line in f.readlines(): line = line.rstrip() if len(line) == 0: continue row = lin...
def function[readTableFromDelimited, parameter[f, separator]]: constant[ Reads a table object from given plain delimited file. ] variable[rowNames] assign[=] list[[]] variable[columnNames] assign[=] list[[]] variable[matrix] assign[=] list[[]] variable[first] assign[=] co...
keyword[def] identifier[readTableFromDelimited] ( identifier[f] , identifier[separator] = literal[string] ): literal[string] identifier[rowNames] =[] identifier[columnNames] =[] identifier[matrix] =[] identifier[first] = keyword[True] keyword[for] identifier[line] keyword[in] ident...
def readTableFromDelimited(f, separator='\t'): """ Reads a table object from given plain delimited file. """ rowNames = [] columnNames = [] matrix = [] first = True for line in f.readlines(): line = line.rstrip() if len(line) == 0: continue # depends on [cont...
def _transform(self, df): """Private transform method of a Transformer. This serves as batch-prediction method for our purposes. """ output_col = self.getOutputCol() label_col = self.getLabelCol() new_schema = copy.deepcopy(df.schema) new_schema.add(StructField(output_col...
def function[_transform, parameter[self, df]]: constant[Private transform method of a Transformer. This serves as batch-prediction method for our purposes. ] variable[output_col] assign[=] call[name[self].getOutputCol, parameter[]] variable[label_col] assign[=] call[name[self].getLabelCo...
keyword[def] identifier[_transform] ( identifier[self] , identifier[df] ): literal[string] identifier[output_col] = identifier[self] . identifier[getOutputCol] () identifier[label_col] = identifier[self] . identifier[getLabelCol] () identifier[new_schema] = identifier[copy] . iden...
def _transform(self, df): """Private transform method of a Transformer. This serves as batch-prediction method for our purposes. """ output_col = self.getOutputCol() label_col = self.getLabelCol() new_schema = copy.deepcopy(df.schema) new_schema.add(StructField(output_col, StringType(), True...
def correct_dactyl_chain(self, scansion: str) -> str: """ Three or more unstressed accents in a row is a broken dactyl chain, best detected and processed backwards. Since this method takes a Procrustean approach to modifying the scansion pattern, it is not used by default in the...
def function[correct_dactyl_chain, parameter[self, scansion]]: constant[ Three or more unstressed accents in a row is a broken dactyl chain, best detected and processed backwards. Since this method takes a Procrustean approach to modifying the scansion pattern, it is not used by...
keyword[def] identifier[correct_dactyl_chain] ( identifier[self] , identifier[scansion] : identifier[str] )-> identifier[str] : literal[string] identifier[mark_list] = identifier[string_utils] . identifier[mark_list] ( identifier[scansion] ) identifier[vals] = identifier[list] ( identifier...
def correct_dactyl_chain(self, scansion: str) -> str: """ Three or more unstressed accents in a row is a broken dactyl chain, best detected and processed backwards. Since this method takes a Procrustean approach to modifying the scansion pattern, it is not used by default in the sca...
def get_cfg(ast_func): """ Traverses the AST and returns the corresponding CFG :param ast_func: The AST representation of function :type ast_func: ast.Function :returns: The CFG representation of the function :rtype: cfg.Function """ cfg_func = cfg.Function() for ast_var in ast_fun...
def function[get_cfg, parameter[ast_func]]: constant[ Traverses the AST and returns the corresponding CFG :param ast_func: The AST representation of function :type ast_func: ast.Function :returns: The CFG representation of the function :rtype: cfg.Function ] variable[cfg_func] ...
keyword[def] identifier[get_cfg] ( identifier[ast_func] ): literal[string] identifier[cfg_func] = identifier[cfg] . identifier[Function] () keyword[for] identifier[ast_var] keyword[in] identifier[ast_func] . identifier[input_variable_list] : identifier[cfg_var] = identifier[cfg_func] . ide...
def get_cfg(ast_func): """ Traverses the AST and returns the corresponding CFG :param ast_func: The AST representation of function :type ast_func: ast.Function :returns: The CFG representation of the function :rtype: cfg.Function """ cfg_func = cfg.Function() for ast_var in ast_fun...
def escape_LDAP(ldap_string): # type: (str) -> str # pylint: disable=C0103 """ Escape a string to let it go in an LDAP filter :param ldap_string: The string to escape :return: The protected string """ if not ldap_string: # No content return ldap_string # Protect esc...
def function[escape_LDAP, parameter[ldap_string]]: constant[ Escape a string to let it go in an LDAP filter :param ldap_string: The string to escape :return: The protected string ] if <ast.UnaryOp object at 0x7da20c6e4be0> begin[:] return[name[ldap_string]] assert[call[name[...
keyword[def] identifier[escape_LDAP] ( identifier[ldap_string] ): literal[string] keyword[if] keyword[not] identifier[ldap_string] : keyword[return] identifier[ldap_string] keyword[assert] identifier[is_string] ( identifier[ldap_string] ) identifier[ldap_string] = i...
def escape_LDAP(ldap_string): # type: (str) -> str # pylint: disable=C0103 '\n Escape a string to let it go in an LDAP filter\n\n :param ldap_string: The string to escape\n :return: The protected string\n ' if not ldap_string: # No content return ldap_string # depends on [co...
def get_config_from_file(conf_properties_files): """Reads properties files and saves them to a config object :param conf_properties_files: comma-separated list of properties files :returns: config object """ # Initialize the config object config = ExtendedConfigParser() ...
def function[get_config_from_file, parameter[conf_properties_files]]: constant[Reads properties files and saves them to a config object :param conf_properties_files: comma-separated list of properties files :returns: config object ] variable[config] assign[=] call[name[ExtendedC...
keyword[def] identifier[get_config_from_file] ( identifier[conf_properties_files] ): literal[string] identifier[config] = identifier[ExtendedConfigParser] () identifier[logger] = identifier[logging] . identifier[getLogger] ( identifier[__name__] ) identifier[fou...
def get_config_from_file(conf_properties_files): """Reads properties files and saves them to a config object :param conf_properties_files: comma-separated list of properties files :returns: config object """ # Initialize the config object config = ExtendedConfigParser() logger =...
def mean_sq_jump_dist(self, discard_frac=0.1): """Mean squared jumping distance estimated from chain. Parameters ---------- discard_frac: float fraction of iterations to discard at the beginning (as a burn-in) Returns ------- float """ ...
def function[mean_sq_jump_dist, parameter[self, discard_frac]]: constant[Mean squared jumping distance estimated from chain. Parameters ---------- discard_frac: float fraction of iterations to discard at the beginning (as a burn-in) Returns ------- ...
keyword[def] identifier[mean_sq_jump_dist] ( identifier[self] , identifier[discard_frac] = literal[int] ): literal[string] identifier[discard] = identifier[int] ( identifier[self] . identifier[niter] * identifier[discard_frac] ) keyword[return] identifier[msjd] ( identifier[self] . identi...
def mean_sq_jump_dist(self, discard_frac=0.1): """Mean squared jumping distance estimated from chain. Parameters ---------- discard_frac: float fraction of iterations to discard at the beginning (as a burn-in) Returns ------- float """ disca...
def dbmax10years(self, value=None): """ Corresponds to IDD Field `dbmax10years` 10-year return period values for maximum extreme dry-bulb temperature Args: value (float): value for IDD Field `dbmax10years` Unit: C if `value` is None it will not be ch...
def function[dbmax10years, parameter[self, value]]: constant[ Corresponds to IDD Field `dbmax10years` 10-year return period values for maximum extreme dry-bulb temperature Args: value (float): value for IDD Field `dbmax10years` Unit: C if `value` is ...
keyword[def] identifier[dbmax10years] ( identifier[self] , identifier[value] = keyword[None] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[not] keyword[None] : keyword[try] : identifier[value] = identifier[float] ( identifier[value] ) ...
def dbmax10years(self, value=None): """ Corresponds to IDD Field `dbmax10years` 10-year return period values for maximum extreme dry-bulb temperature Args: value (float): value for IDD Field `dbmax10years` Unit: C if `value` is None it will not be checke...
def update(self, friendly_name): """ Update the FunctionInstance :param unicode friendly_name: The friendly_name :returns: Updated FunctionInstance :rtype: twilio.rest.serverless.v1.service.function.FunctionInstance """ data = values.of({'FriendlyName': friendly...
def function[update, parameter[self, friendly_name]]: constant[ Update the FunctionInstance :param unicode friendly_name: The friendly_name :returns: Updated FunctionInstance :rtype: twilio.rest.serverless.v1.service.function.FunctionInstance ] variable[data] as...
keyword[def] identifier[update] ( identifier[self] , identifier[friendly_name] ): literal[string] identifier[data] = identifier[values] . identifier[of] ({ literal[string] : identifier[friendly_name] ,}) identifier[payload] = identifier[self] . identifier[_version] . identifier[update] ( ...
def update(self, friendly_name): """ Update the FunctionInstance :param unicode friendly_name: The friendly_name :returns: Updated FunctionInstance :rtype: twilio.rest.serverless.v1.service.function.FunctionInstance """ data = values.of({'FriendlyName': friendly_name}) ...
def get_relationships(schema, model_field=False): """Return relationship fields of a schema :param Schema schema: a marshmallow schema :param list: list of relationship fields of a schema """ relationships = [key for (key, value) in schema._declared_fields.items() if isinstance(value, Relationship)...
def function[get_relationships, parameter[schema, model_field]]: constant[Return relationship fields of a schema :param Schema schema: a marshmallow schema :param list: list of relationship fields of a schema ] variable[relationships] assign[=] <ast.ListComp object at 0x7da1b17fae00> ...
keyword[def] identifier[get_relationships] ( identifier[schema] , identifier[model_field] = keyword[False] ): literal[string] identifier[relationships] =[ identifier[key] keyword[for] ( identifier[key] , identifier[value] ) keyword[in] identifier[schema] . identifier[_declared_fields] . identifier[items]...
def get_relationships(schema, model_field=False): """Return relationship fields of a schema :param Schema schema: a marshmallow schema :param list: list of relationship fields of a schema """ relationships = [key for (key, value) in schema._declared_fields.items() if isinstance(value, Relationship)...
def get(self, cycle_list, dataitem=None, isotope=None, sparse=1): """ Simple function that simply calls h5T.py get method. There are three ways to call this function. Parameters ---------- cycle_list : string, list If cycle_list is a string, then get interpa...
def function[get, parameter[self, cycle_list, dataitem, isotope, sparse]]: constant[ Simple function that simply calls h5T.py get method. There are three ways to call this function. Parameters ---------- cycle_list : string, list If cycle_list is a string, t...
keyword[def] identifier[get] ( identifier[self] , identifier[cycle_list] , identifier[dataitem] = keyword[None] , identifier[isotope] = keyword[None] , identifier[sparse] = literal[int] ): literal[string] keyword[return] identifier[self] . identifier[se] . identifier[get] ( identifier[cycle_list] ...
def get(self, cycle_list, dataitem=None, isotope=None, sparse=1): """ Simple function that simply calls h5T.py get method. There are three ways to call this function. Parameters ---------- cycle_list : string, list If cycle_list is a string, then get interpates ...
def _string_literal_to_string(string_literal_token): """Converts the StringLiteral token to a plain string: get text content, removes quote characters, and unescapes it. :param string_literal_token: The string literal :return: """ token_text = string_literal_token.getText() return token_tex...
def function[_string_literal_to_string, parameter[string_literal_token]]: constant[Converts the StringLiteral token to a plain string: get text content, removes quote characters, and unescapes it. :param string_literal_token: The string literal :return: ] variable[token_text] assign[=] ...
keyword[def] identifier[_string_literal_to_string] ( identifier[string_literal_token] ): literal[string] identifier[token_text] = identifier[string_literal_token] . identifier[getText] () keyword[return] identifier[token_text] [ literal[int] :- literal[int] ]. identifier[replace] ( literal[string] , ...
def _string_literal_to_string(string_literal_token): """Converts the StringLiteral token to a plain string: get text content, removes quote characters, and unescapes it. :param string_literal_token: The string literal :return: """ token_text = string_literal_token.getText() return token_tex...
def add_handlers(web_app, config): """Add the appropriate handlers to the web app. """ base_url = web_app.settings['base_url'] url = ujoin(base_url, config.page_url) assets_dir = config.assets_dir package_file = os.path.join(assets_dir, 'package.json') with open(package_file) as fid: ...
def function[add_handlers, parameter[web_app, config]]: constant[Add the appropriate handlers to the web app. ] variable[base_url] assign[=] call[name[web_app].settings][constant[base_url]] variable[url] assign[=] call[name[ujoin], parameter[name[base_url], name[config].page_url]] va...
keyword[def] identifier[add_handlers] ( identifier[web_app] , identifier[config] ): literal[string] identifier[base_url] = identifier[web_app] . identifier[settings] [ literal[string] ] identifier[url] = identifier[ujoin] ( identifier[base_url] , identifier[config] . identifier[page_url] ) identi...
def add_handlers(web_app, config): """Add the appropriate handlers to the web app. """ base_url = web_app.settings['base_url'] url = ujoin(base_url, config.page_url) assets_dir = config.assets_dir package_file = os.path.join(assets_dir, 'package.json') with open(package_file) as fid: ...
def fields(self): """ Return the fields specified in the pattern using Python's formatting mini-language. """ parse = list(string.Formatter().parse(self.pattern)) return [f for f in zip(*parse)[1] if f is not None]
def function[fields, parameter[self]]: constant[ Return the fields specified in the pattern using Python's formatting mini-language. ] variable[parse] assign[=] call[name[list], parameter[call[call[name[string].Formatter, parameter[]].parse, parameter[name[self].pattern]]]] r...
keyword[def] identifier[fields] ( identifier[self] ): literal[string] identifier[parse] = identifier[list] ( identifier[string] . identifier[Formatter] (). identifier[parse] ( identifier[self] . identifier[pattern] )) keyword[return] [ identifier[f] keyword[for] identifier[f] keyword[in...
def fields(self): """ Return the fields specified in the pattern using Python's formatting mini-language. """ parse = list(string.Formatter().parse(self.pattern)) return [f for f in zip(*parse)[1] if f is not None]
def getServiceMessages(self, remote): """Get service messages from CCU / Homegear""" try: return self.proxies["%s-%s" % (self._interface_id, remote)].getServiceMessages() except Exception as err: LOG.debug("ServerThread.getServiceMessages: Exception: %s" % str(err))
def function[getServiceMessages, parameter[self, remote]]: constant[Get service messages from CCU / Homegear] <ast.Try object at 0x7da1b06558a0>
keyword[def] identifier[getServiceMessages] ( identifier[self] , identifier[remote] ): literal[string] keyword[try] : keyword[return] identifier[self] . identifier[proxies] [ literal[string] %( identifier[self] . identifier[_interface_id] , identifier[remote] )]. identifier[getService...
def getServiceMessages(self, remote): """Get service messages from CCU / Homegear""" try: return self.proxies['%s-%s' % (self._interface_id, remote)].getServiceMessages() # depends on [control=['try'], data=[]] except Exception as err: LOG.debug('ServerThread.getServiceMessages: Exception: ...
def check(source, filename='<string>', report_level=docutils.utils.Reporter.INFO_LEVEL, ignore=None, debug=False): """Yield errors. Use lower report_level for noisier error output. Each yielded error is a tuple of the form: (line_number, message) Line ...
def function[check, parameter[source, filename, report_level, ignore, debug]]: constant[Yield errors. Use lower report_level for noisier error output. Each yielded error is a tuple of the form: (line_number, message) Line numbers are indexed at 1 and are with respect to the full RST file...
keyword[def] identifier[check] ( identifier[source] , identifier[filename] = literal[string] , identifier[report_level] = identifier[docutils] . identifier[utils] . identifier[Reporter] . identifier[INFO_LEVEL] , identifier[ignore] = keyword[None] , identifier[debug] = keyword[False] ): literal[string] ...
def check(source, filename='<string>', report_level=docutils.utils.Reporter.INFO_LEVEL, ignore=None, debug=False): """Yield errors. Use lower report_level for noisier error output. Each yielded error is a tuple of the form: (line_number, message) Line numbers are indexed at 1 and are with re...
def hav_dist(locs1, locs2): """ Return a distance matrix between two set of coordinates. Use geometric distance (default) or haversine distance (if longlat=True). Parameters ---------- locs1 : numpy.array The first set of coordinates as [(long, lat), (long, lat)]. locs2 : numpy.arra...
def function[hav_dist, parameter[locs1, locs2]]: constant[ Return a distance matrix between two set of coordinates. Use geometric distance (default) or haversine distance (if longlat=True). Parameters ---------- locs1 : numpy.array The first set of coordinates as [(long, lat), (long...
keyword[def] identifier[hav_dist] ( identifier[locs1] , identifier[locs2] ): literal[string] identifier[cos_lat1] = identifier[np] . identifier[cos] ( identifier[locs1] [..., literal[int] ]) identifier[cos_lat2] = identifier[np] . identifier[cos] ( identifier[locs2] [..., literal[int] ]) ...
def hav_dist(locs1, locs2): """ Return a distance matrix between two set of coordinates. Use geometric distance (default) or haversine distance (if longlat=True). Parameters ---------- locs1 : numpy.array The first set of coordinates as [(long, lat), (long, lat)]. locs2 : numpy.arra...
def _set_show_clock(self, v, load=False): """ Setter method for show_clock, mapped from YANG variable /brocade_clock_rpc/show_clock (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_show_clock is considered as a private method. Backends looking to populate this v...
def function[_set_show_clock, parameter[self, v, load]]: constant[ Setter method for show_clock, mapped from YANG variable /brocade_clock_rpc/show_clock (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_show_clock is considered as a private method. Backends l...
keyword[def] identifier[_set_show_clock] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : ide...
def _set_show_clock(self, v, load=False): """ Setter method for show_clock, mapped from YANG variable /brocade_clock_rpc/show_clock (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_show_clock is considered as a private method. Backends looking to populate this v...
def suffix(filename,suffix): ''' returns a filenames with ``suffix`` inserted before the dataset suffix ''' return os.path.split(re.sub(_afni_suffix_regex,"%s\g<1>" % suffix,str(filename)))[1]
def function[suffix, parameter[filename, suffix]]: constant[ returns a filenames with ``suffix`` inserted before the dataset suffix ] return[call[call[name[os].path.split, parameter[call[name[re].sub, parameter[name[_afni_suffix_regex], binary_operation[constant[%s\g<1>] <ast.Mod object at 0x7da2590d6920> n...
keyword[def] identifier[suffix] ( identifier[filename] , identifier[suffix] ): literal[string] keyword[return] identifier[os] . identifier[path] . identifier[split] ( identifier[re] . identifier[sub] ( identifier[_afni_suffix_regex] , literal[string] % identifier[suffix] , identifier[str] ( identifier[fil...
def suffix(filename, suffix): """ returns a filenames with ``suffix`` inserted before the dataset suffix """ return os.path.split(re.sub(_afni_suffix_regex, '%s\\g<1>' % suffix, str(filename)))[1]
def deriv(self, x: str, ctype: ContentType) -> SchemaPattern: """Return derivative of the receiver.""" return Alternative.combine(self.left.deriv(x, ctype), self.right.deriv(x, ctype))
def function[deriv, parameter[self, x, ctype]]: constant[Return derivative of the receiver.] return[call[name[Alternative].combine, parameter[call[name[self].left.deriv, parameter[name[x], name[ctype]]], call[name[self].right.deriv, parameter[name[x], name[ctype]]]]]]
keyword[def] identifier[deriv] ( identifier[self] , identifier[x] : identifier[str] , identifier[ctype] : identifier[ContentType] )-> identifier[SchemaPattern] : literal[string] keyword[return] identifier[Alternative] . identifier[combine] ( identifier[self] . identifier[left] . identifier[deriv] ...
def deriv(self, x: str, ctype: ContentType) -> SchemaPattern: """Return derivative of the receiver.""" return Alternative.combine(self.left.deriv(x, ctype), self.right.deriv(x, ctype))
def _get_dstk_intersections(self, address, dstk_address): """ Find the unique tokens in the original address and the returned address. """ # Normalize both addresses normalized_address = self._normalize(address) normalized_dstk_address = self._normalize(dstk_address) ...
def function[_get_dstk_intersections, parameter[self, address, dstk_address]]: constant[ Find the unique tokens in the original address and the returned address. ] variable[normalized_address] assign[=] call[name[self]._normalize, parameter[name[address]]] variable[normalized_dst...
keyword[def] identifier[_get_dstk_intersections] ( identifier[self] , identifier[address] , identifier[dstk_address] ): literal[string] identifier[normalized_address] = identifier[self] . identifier[_normalize] ( identifier[address] ) identifier[normalized_dstk_address] = identifi...
def _get_dstk_intersections(self, address, dstk_address): """ Find the unique tokens in the original address and the returned address. """ # Normalize both addresses normalized_address = self._normalize(address) normalized_dstk_address = self._normalize(dstk_address) address_uniques ...
def get_default_config(self): """ Returns default collector settings. """ config = super(FilesCollector, self).get_default_config() config.update({ 'path': '.', 'dir': '/tmp/diamond', 'delete': False, }) return config
def function[get_default_config, parameter[self]]: constant[ Returns default collector settings. ] variable[config] assign[=] call[call[name[super], parameter[name[FilesCollector], name[self]]].get_default_config, parameter[]] call[name[config].update, parameter[dictionary[[<ast....
keyword[def] identifier[get_default_config] ( identifier[self] ): literal[string] identifier[config] = identifier[super] ( identifier[FilesCollector] , identifier[self] ). identifier[get_default_config] () identifier[config] . identifier[update] ({ literal[string] : literal[string...
def get_default_config(self): """ Returns default collector settings. """ config = super(FilesCollector, self).get_default_config() config.update({'path': '.', 'dir': '/tmp/diamond', 'delete': False}) return config
def dump_inline_table(self, section): """Preserve inline table in its compact syntax instead of expanding into subsection. https://github.com/toml-lang/toml#user-content-inline-table """ retval = "" if isinstance(section, dict): val_list = [] for ...
def function[dump_inline_table, parameter[self, section]]: constant[Preserve inline table in its compact syntax instead of expanding into subsection. https://github.com/toml-lang/toml#user-content-inline-table ] variable[retval] assign[=] constant[] if call[name[isinstan...
keyword[def] identifier[dump_inline_table] ( identifier[self] , identifier[section] ): literal[string] identifier[retval] = literal[string] keyword[if] identifier[isinstance] ( identifier[section] , identifier[dict] ): identifier[val_list] =[] keyword[for] iden...
def dump_inline_table(self, section): """Preserve inline table in its compact syntax instead of expanding into subsection. https://github.com/toml-lang/toml#user-content-inline-table """ retval = '' if isinstance(section, dict): val_list = [] for (k, v) in section.it...
def __extend_uri(prefixes, short): """ Extend a prefixed uri with the help of a specific dictionary of prefixes :param prefixes: Dictionary of prefixes :param short: Prefixed uri to be extended :return: """ for prefix in prefixes: if short.startswith(prefix): return short...
def function[__extend_uri, parameter[prefixes, short]]: constant[ Extend a prefixed uri with the help of a specific dictionary of prefixes :param prefixes: Dictionary of prefixes :param short: Prefixed uri to be extended :return: ] for taget[name[prefix]] in starred[name[prefixes]] b...
keyword[def] identifier[__extend_uri] ( identifier[prefixes] , identifier[short] ): literal[string] keyword[for] identifier[prefix] keyword[in] identifier[prefixes] : keyword[if] identifier[short] . identifier[startswith] ( identifier[prefix] ): keyword[return] identifier[short] ...
def __extend_uri(prefixes, short): """ Extend a prefixed uri with the help of a specific dictionary of prefixes :param prefixes: Dictionary of prefixes :param short: Prefixed uri to be extended :return: """ for prefix in prefixes: if short.startswith(prefix): return short...
def dict_strict_update(base_dict, update_dict): """ This function updates base_dict with update_dict if and only if update_dict does not contain keys that are not already in base_dict. It is essentially a more strict interpretation of the term "updating" the dict. If update_dict contains keys that ...
def function[dict_strict_update, parameter[base_dict, update_dict]]: constant[ This function updates base_dict with update_dict if and only if update_dict does not contain keys that are not already in base_dict. It is essentially a more strict interpretation of the term "updating" the dict. If ...
keyword[def] identifier[dict_strict_update] ( identifier[base_dict] , identifier[update_dict] ): literal[string] identifier[additional_keys] = identifier[set] ( identifier[update_dict] . identifier[keys] ())- identifier[set] ( identifier[base_dict] . identifier[keys] ()) keyword[if] identifier[len] (...
def dict_strict_update(base_dict, update_dict): """ This function updates base_dict with update_dict if and only if update_dict does not contain keys that are not already in base_dict. It is essentially a more strict interpretation of the term "updating" the dict. If update_dict contains keys that ...
def get_feature(self, ds, feat): """Return filtered feature data The features are filtered according to the user-defined filters, using the information in `ds._filter`. In addition, all `nan` and `inf` values are purged. Parameters ---------- ds: dclab.rtdc_data...
def function[get_feature, parameter[self, ds, feat]]: constant[Return filtered feature data The features are filtered according to the user-defined filters, using the information in `ds._filter`. In addition, all `nan` and `inf` values are purged. Parameters ---------- ...
keyword[def] identifier[get_feature] ( identifier[self] , identifier[ds] , identifier[feat] ): literal[string] keyword[if] identifier[ds] . identifier[config] [ literal[string] ][ literal[string] ]: identifier[x] = identifier[ds] [ identifier[feat] ][ identifier[ds] . identifier[_filt...
def get_feature(self, ds, feat): """Return filtered feature data The features are filtered according to the user-defined filters, using the information in `ds._filter`. In addition, all `nan` and `inf` values are purged. Parameters ---------- ds: dclab.rtdc_dataset....
def QueryAttachments(self, document_link, query, options=None): """Queries attachments in a document. :param str document_link: The link to the document. :param (str or dict) query: :param dict options: The request options for the request. :return: ...
def function[QueryAttachments, parameter[self, document_link, query, options]]: constant[Queries attachments in a document. :param str document_link: The link to the document. :param (str or dict) query: :param dict options: The request options for the request. ...
keyword[def] identifier[QueryAttachments] ( identifier[self] , identifier[document_link] , identifier[query] , identifier[options] = keyword[None] ): literal[string] keyword[if] identifier[options] keyword[is] keyword[None] : identifier[options] ={} identifier[path] = iden...
def QueryAttachments(self, document_link, query, options=None): """Queries attachments in a document. :param str document_link: The link to the document. :param (str or dict) query: :param dict options: The request options for the request. :return: ...
def cortex_rgba_plot_2D(the_map, rgba, axes=None, triangulation=None): ''' cortex_rgba_plot_2D(map, rgba, axes) plots the given cortical map on the given axes using the given (n x 4) matrix of vertex colors and yields the resulting polygon collection object. cortex_rgba_plot_2D(map, rgba) uses matplot...
def function[cortex_rgba_plot_2D, parameter[the_map, rgba, axes, triangulation]]: constant[ cortex_rgba_plot_2D(map, rgba, axes) plots the given cortical map on the given axes using the given (n x 4) matrix of vertex colors and yields the resulting polygon collection object. cortex_rgba_plot_2D(ma...
keyword[def] identifier[cortex_rgba_plot_2D] ( identifier[the_map] , identifier[rgba] , identifier[axes] = keyword[None] , identifier[triangulation] = keyword[None] ): literal[string] identifier[cmap] = identifier[colors_to_cmap] ( identifier[rgba] ) identifier[zs] = identifier[np] . identifier[linspa...
def cortex_rgba_plot_2D(the_map, rgba, axes=None, triangulation=None): """ cortex_rgba_plot_2D(map, rgba, axes) plots the given cortical map on the given axes using the given (n x 4) matrix of vertex colors and yields the resulting polygon collection object. cortex_rgba_plot_2D(map, rgba) uses matplot...
def setup(self, app: web.Application): """ Installation routes to app.router :param app: instance of aiohttp.web.Application """ if self.app is app: raise ValueError('The router is already configured ' 'for this application') self.app = a...
def function[setup, parameter[self, app]]: constant[ Installation routes to app.router :param app: instance of aiohttp.web.Application ] if compare[name[self].app is name[app]] begin[:] <ast.Raise object at 0x7da1b0c53bb0> name[self].app assign[=] name[app] varia...
keyword[def] identifier[setup] ( identifier[self] , identifier[app] : identifier[web] . identifier[Application] ): literal[string] keyword[if] identifier[self] . identifier[app] keyword[is] identifier[app] : keyword[raise] identifier[ValueError] ( literal[string] lite...
def setup(self, app: web.Application): """ Installation routes to app.router :param app: instance of aiohttp.web.Application """ if self.app is app: raise ValueError('The router is already configured for this application') # depends on [control=['if'], data=[]] self.app = app r...
def generate_workflow_description(self): ''' Generate workflow json for launching the workflow against the gbdx api Args: None Returns: json string ''' if not self.tasks: raise WorkflowError('Workflow contains no tasks, and cannot be ...
def function[generate_workflow_description, parameter[self]]: constant[ Generate workflow json for launching the workflow against the gbdx api Args: None Returns: json string ] if <ast.UnaryOp object at 0x7da1aff36350> begin[:] <ast.Raise...
keyword[def] identifier[generate_workflow_description] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[tasks] : keyword[raise] identifier[WorkflowError] ( literal[string] ) identifier[self] . identifier[definition] = identifier[...
def generate_workflow_description(self): """ Generate workflow json for launching the workflow against the gbdx api Args: None Returns: json string """ if not self.tasks: raise WorkflowError('Workflow contains no tasks, and cannot be executed.') ...
def n_exec_stmt(self, node): """ exec_stmt ::= expr exprlist DUP_TOP EXEC_STMT exec_stmt ::= expr exprlist EXEC_STMT """ start = len(self.f.getvalue()) + len(self.indent) try: super(FragmentsWalker, self).n_exec_stmt(node) except GenericASTTraversalPru...
def function[n_exec_stmt, parameter[self, node]]: constant[ exec_stmt ::= expr exprlist DUP_TOP EXEC_STMT exec_stmt ::= expr exprlist EXEC_STMT ] variable[start] assign[=] binary_operation[call[name[len], parameter[call[name[self].f.getvalue, parameter[]]]] + call[name[len], para...
keyword[def] identifier[n_exec_stmt] ( identifier[self] , identifier[node] ): literal[string] identifier[start] = identifier[len] ( identifier[self] . identifier[f] . identifier[getvalue] ())+ identifier[len] ( identifier[self] . identifier[indent] ) keyword[try] : identifier[...
def n_exec_stmt(self, node): """ exec_stmt ::= expr exprlist DUP_TOP EXEC_STMT exec_stmt ::= expr exprlist EXEC_STMT """ start = len(self.f.getvalue()) + len(self.indent) try: super(FragmentsWalker, self).n_exec_stmt(node) # depends on [control=['try'], data=[]] except G...
def prompt_user_to_select_link(self, links): """ Prompt the user to select a link from a list to open. Return the link that was selected, or ``None`` if no link was selected. """ link_pages = self.get_link_pages(links) n = 0 while n in range(len(link_pages)): ...
def function[prompt_user_to_select_link, parameter[self, links]]: constant[ Prompt the user to select a link from a list to open. Return the link that was selected, or ``None`` if no link was selected. ] variable[link_pages] assign[=] call[name[self].get_link_pages, parameter[na...
keyword[def] identifier[prompt_user_to_select_link] ( identifier[self] , identifier[links] ): literal[string] identifier[link_pages] = identifier[self] . identifier[get_link_pages] ( identifier[links] ) identifier[n] = literal[int] keyword[while] identifier[n] keyword[in] iden...
def prompt_user_to_select_link(self, links): """ Prompt the user to select a link from a list to open. Return the link that was selected, or ``None`` if no link was selected. """ link_pages = self.get_link_pages(links) n = 0 while n in range(len(link_pages)): link_page =...
def get_lan_ip(interface="default"): if sys.version_info < (3, 0, 0): if type(interface) == str: interface = unicode(interface) else: if type(interface) == bytes: interface = interface.decode("utf-8") # Get ID of interface that handles WAN stuff. default_gateway ...
def function[get_lan_ip, parameter[interface]]: if compare[name[sys].version_info less[<] tuple[[<ast.Constant object at 0x7da1b065b7c0>, <ast.Constant object at 0x7da1b065a590>, <ast.Constant object at 0x7da18f720820>]]] begin[:] if compare[call[name[type], parameter[name[interface]]] equal[==]...
keyword[def] identifier[get_lan_ip] ( identifier[interface] = literal[string] ): keyword[if] identifier[sys] . identifier[version_info] <( literal[int] , literal[int] , literal[int] ): keyword[if] identifier[type] ( identifier[interface] )== identifier[str] : identifier[interface] = ident...
def get_lan_ip(interface='default'): if sys.version_info < (3, 0, 0): if type(interface) == str: interface = unicode(interface) # depends on [control=['if'], data=[]] # depends on [control=['if'], data=[]] elif type(interface) == bytes: interface = interface.decode('utf-8') # depe...
def add_pipe( self, component, name=None, before=None, after=None, first=None, last=None ): """Add a component to the processing pipeline. Valid components are callables that take a `Doc` object, modify it and return it. Only one of before/after/first/last can be set. Default behavio...
def function[add_pipe, parameter[self, component, name, before, after, first, last]]: constant[Add a component to the processing pipeline. Valid components are callables that take a `Doc` object, modify it and return it. Only one of before/after/first/last can be set. Default behaviour is "last"...
keyword[def] identifier[add_pipe] ( identifier[self] , identifier[component] , identifier[name] = keyword[None] , identifier[before] = keyword[None] , identifier[after] = keyword[None] , identifier[first] = keyword[None] , identifier[last] = keyword[None] ): literal[string] keyword[if] keyword[n...
def add_pipe(self, component, name=None, before=None, after=None, first=None, last=None): """Add a component to the processing pipeline. Valid components are callables that take a `Doc` object, modify it and return it. Only one of before/after/first/last can be set. Default behaviour is "last". ...
def getFileSystemSize(dirPath): """ Return the free space, and total size of the file system hosting `dirPath`. :param str dirPath: A valid path to a directory. :return: free space and total size of file system :rtype: tuple """ assert os.path.exists(dirPath) diskStats = os.statvfs(dirP...
def function[getFileSystemSize, parameter[dirPath]]: constant[ Return the free space, and total size of the file system hosting `dirPath`. :param str dirPath: A valid path to a directory. :return: free space and total size of file system :rtype: tuple ] assert[call[name[os].path.exists,...
keyword[def] identifier[getFileSystemSize] ( identifier[dirPath] ): literal[string] keyword[assert] identifier[os] . identifier[path] . identifier[exists] ( identifier[dirPath] ) identifier[diskStats] = identifier[os] . identifier[statvfs] ( identifier[dirPath] ) identifier[freeSpace] = identifi...
def getFileSystemSize(dirPath): """ Return the free space, and total size of the file system hosting `dirPath`. :param str dirPath: A valid path to a directory. :return: free space and total size of file system :rtype: tuple """ assert os.path.exists(dirPath) diskStats = os.statvfs(dirP...
def OnExitSelectionMode(self, event): """Event handler for leaving selection mode, enables cell edits""" self.grid.sel_mode_cursor = None self.grid.EnableDragGridSize(True) self.grid.EnableEditing(True)
def function[OnExitSelectionMode, parameter[self, event]]: constant[Event handler for leaving selection mode, enables cell edits] name[self].grid.sel_mode_cursor assign[=] constant[None] call[name[self].grid.EnableDragGridSize, parameter[constant[True]]] call[name[self].grid.EnableEditin...
keyword[def] identifier[OnExitSelectionMode] ( identifier[self] , identifier[event] ): literal[string] identifier[self] . identifier[grid] . identifier[sel_mode_cursor] = keyword[None] identifier[self] . identifier[grid] . identifier[EnableDragGridSize] ( keyword[True] ) identif...
def OnExitSelectionMode(self, event): """Event handler for leaving selection mode, enables cell edits""" self.grid.sel_mode_cursor = None self.grid.EnableDragGridSize(True) self.grid.EnableEditing(True)
def __analizar_observaciones(self, ret): "Comprueba y extrae observaciones si existen en la respuesta XML" self.Observaciones = [obs["codigoDescripcion"] for obs in ret.get('arrayObservaciones', [])] self.Obs = '\n'.join(["%(codigo)s: %(descripcion)s" % obs for obs in self.Observaciones])
def function[__analizar_observaciones, parameter[self, ret]]: constant[Comprueba y extrae observaciones si existen en la respuesta XML] name[self].Observaciones assign[=] <ast.ListComp object at 0x7da18f58f6d0> name[self].Obs assign[=] call[constant[ ].join, parameter[<ast.ListComp object at 0x7...
keyword[def] identifier[__analizar_observaciones] ( identifier[self] , identifier[ret] ): literal[string] identifier[self] . identifier[Observaciones] =[ identifier[obs] [ literal[string] ] keyword[for] identifier[obs] keyword[in] identifier[ret] . identifier[get] ( literal[string] ,[])] ...
def __analizar_observaciones(self, ret): """Comprueba y extrae observaciones si existen en la respuesta XML""" self.Observaciones = [obs['codigoDescripcion'] for obs in ret.get('arrayObservaciones', [])] self.Obs = '\n'.join(['%(codigo)s: %(descripcion)s' % obs for obs in self.Observaciones])
def dumps(obj, *transformers): """ Serializes Java primitive data and objects unmarshaled by load(s) before into string. :param obj: A Python primitive object, or one loaded using load(s) :param transformers: Custom transformers to use :return: The serialized data as a string """ marsha...
def function[dumps, parameter[obj]]: constant[ Serializes Java primitive data and objects unmarshaled by load(s) before into string. :param obj: A Python primitive object, or one loaded using load(s) :param transformers: Custom transformers to use :return: The serialized data as a string ...
keyword[def] identifier[dumps] ( identifier[obj] ,* identifier[transformers] ): literal[string] identifier[marshaller] = identifier[JavaObjectMarshaller] () keyword[for] identifier[transformer] keyword[in] identifier[transformers] : identifier[marshaller] . identifier[add_transformer]...
def dumps(obj, *transformers): """ Serializes Java primitive data and objects unmarshaled by load(s) before into string. :param obj: A Python primitive object, or one loaded using load(s) :param transformers: Custom transformers to use :return: The serialized data as a string """ marsha...
def get_gates(): """ get all gates known on the Ariane server :return: """ LOGGER.debug("GateService.get_gates") params = SessionService.complete_transactional_req(None) if params is None: if MappingService.driver_type != DriverFactory.DRIVER_REST: ...
def function[get_gates, parameter[]]: constant[ get all gates known on the Ariane server :return: ] call[name[LOGGER].debug, parameter[constant[GateService.get_gates]]] variable[params] assign[=] call[name[SessionService].complete_transactional_req, parameter[constant[Non...
keyword[def] identifier[get_gates] (): literal[string] identifier[LOGGER] . identifier[debug] ( literal[string] ) identifier[params] = identifier[SessionService] . identifier[complete_transactional_req] ( keyword[None] ) keyword[if] identifier[params] keyword[is] keyword[None] ...
def get_gates(): """ get all gates known on the Ariane server :return: """ LOGGER.debug('GateService.get_gates') params = SessionService.complete_transactional_req(None) if params is None: if MappingService.driver_type != DriverFactory.DRIVER_REST: params = {'...
def no_intersections(nodes1, degree1, nodes2, degree2): r"""Determine if one surface is in the other. Helper for :func:`combine_intersections` that handles the case of no points of intersection. In this case, either the surfaces are disjoint or one is fully contained in the other. To check contain...
def function[no_intersections, parameter[nodes1, degree1, nodes2, degree2]]: constant[Determine if one surface is in the other. Helper for :func:`combine_intersections` that handles the case of no points of intersection. In this case, either the surfaces are disjoint or one is fully contained in th...
keyword[def] identifier[no_intersections] ( identifier[nodes1] , identifier[degree1] , identifier[nodes2] , identifier[degree2] ): literal[string] keyword[from] identifier[bezier] keyword[import] identifier[_surface_intersection] identifier[located] = identifier[_surface_intersection] . iden...
def no_intersections(nodes1, degree1, nodes2, degree2): """Determine if one surface is in the other. Helper for :func:`combine_intersections` that handles the case of no points of intersection. In this case, either the surfaces are disjoint or one is fully contained in the other. To check containm...
def keys_breadth_first(self, include_dicts=False): """a generator that returns all the keys in a set of nested DotDict instances. The keys take the form X.Y.Z""" namespaces = [] for key in self._key_order: if isinstance(getattr(self, key), DotDict): namespace...
def function[keys_breadth_first, parameter[self, include_dicts]]: constant[a generator that returns all the keys in a set of nested DotDict instances. The keys take the form X.Y.Z] variable[namespaces] assign[=] list[[]] for taget[name[key]] in starred[name[self]._key_order] begin[:] ...
keyword[def] identifier[keys_breadth_first] ( identifier[self] , identifier[include_dicts] = keyword[False] ): literal[string] identifier[namespaces] =[] keyword[for] identifier[key] keyword[in] identifier[self] . identifier[_key_order] : keyword[if] identifier[isinstance]...
def keys_breadth_first(self, include_dicts=False): """a generator that returns all the keys in a set of nested DotDict instances. The keys take the form X.Y.Z""" namespaces = [] for key in self._key_order: if isinstance(getattr(self, key), DotDict): namespaces.append(key) ...
def has_nrows( state, incorrect_msg="Your query returned a table with {{n_stu}} row{{'s' if n_stu > 1 else ''}} while it should return a table with {{n_sol}} row{{'s' if n_sol > 1 else ''}}.", ): """Test whether the student and solution query results have equal numbers of rows. Args: incorr...
def function[has_nrows, parameter[state, incorrect_msg]]: constant[Test whether the student and solution query results have equal numbers of rows. Args: incorrect_msg: If specified, this overrides the automatically generated feedback message in case the number of rows in ...
keyword[def] identifier[has_nrows] ( identifier[state] , identifier[incorrect_msg] = literal[string] , ): literal[string] identifier[has_result] ( identifier[state] ) identifier[n_stu] = identifier[len] ( identifier[next] ( identifier[iter] ( identifier[state] . identifier[student_result...
def has_nrows(state, incorrect_msg="Your query returned a table with {{n_stu}} row{{'s' if n_stu > 1 else ''}} while it should return a table with {{n_sol}} row{{'s' if n_sol > 1 else ''}}."): """Test whether the student and solution query results have equal numbers of rows. Args: incorrect_msg: If...
def delaunay_2d(self, tol=1e-05, alpha=0.0, offset=1.0, bound=False): """Apply a delaunay 2D filter along the best fitting plane. This extracts the grid's points and perfoms the triangulation on those alone. """ return PolyData(self.points).delaunay_2d(tol=tol, alpha=alpha, offset=offset...
def function[delaunay_2d, parameter[self, tol, alpha, offset, bound]]: constant[Apply a delaunay 2D filter along the best fitting plane. This extracts the grid's points and perfoms the triangulation on those alone. ] return[call[call[name[PolyData], parameter[name[self].points]].delaunay_2d,...
keyword[def] identifier[delaunay_2d] ( identifier[self] , identifier[tol] = literal[int] , identifier[alpha] = literal[int] , identifier[offset] = literal[int] , identifier[bound] = keyword[False] ): literal[string] keyword[return] identifier[PolyData] ( identifier[self] . identifier[points] ). id...
def delaunay_2d(self, tol=1e-05, alpha=0.0, offset=1.0, bound=False): """Apply a delaunay 2D filter along the best fitting plane. This extracts the grid's points and perfoms the triangulation on those alone. """ return PolyData(self.points).delaunay_2d(tol=tol, alpha=alpha, offset=offset, bound=...
def is_debugged(self): """ Tries to determine if the process is being debugged by another process. It may detect other debuggers besides WinAppDbg. @rtype: bool @return: C{True} if the process has a debugger attached. @warning: May return inaccurate results...
def function[is_debugged, parameter[self]]: constant[ Tries to determine if the process is being debugged by another process. It may detect other debuggers besides WinAppDbg. @rtype: bool @return: C{True} if the process has a debugger attached. @warning: Ma...
keyword[def] identifier[is_debugged] ( identifier[self] ): literal[string] identifier[hProcess] = identifier[self] . identifier[get_handle] ( identifier[win32] . identifier[PROCESS_QUERY_INFORMATION] ) keyword[return] identifier[win32] . identifier[CheckRemoteDebuggerPresent] ( i...
def is_debugged(self): """ Tries to determine if the process is being debugged by another process. It may detect other debuggers besides WinAppDbg. @rtype: bool @return: C{True} if the process has a debugger attached. @warning: May return inaccurate results whe...
def run_cli( executable, mets_url=None, resolver=None, workspace=None, page_id=None, log_level=None, input_file_grp=None, output_file_grp=None, parameter=None, working_dir=None, ): """ Create a workspace for mets_url and run MP CLI ...
def function[run_cli, parameter[executable, mets_url, resolver, workspace, page_id, log_level, input_file_grp, output_file_grp, parameter, working_dir]]: constant[ Create a workspace for mets_url and run MP CLI through it ] variable[workspace] assign[=] call[name[_get_workspace], parameter[name[...
keyword[def] identifier[run_cli] ( identifier[executable] , identifier[mets_url] = keyword[None] , identifier[resolver] = keyword[None] , identifier[workspace] = keyword[None] , identifier[page_id] = keyword[None] , identifier[log_level] = keyword[None] , identifier[input_file_grp] = keyword[None] , identifie...
def run_cli(executable, mets_url=None, resolver=None, workspace=None, page_id=None, log_level=None, input_file_grp=None, output_file_grp=None, parameter=None, working_dir=None): """ Create a workspace for mets_url and run MP CLI through it """ workspace = _get_workspace(workspace, resolver, mets_url, wo...
def to_credentials(arg): ''' to_credentials(arg) converts arg into a pair (key, secret) if arg can be coerced into such a pair and otherwise raises an error. Possible inputs include: * A tuple (key, secret) * A mapping with the keys 'key' and 'secret' * The name of a file that c...
def function[to_credentials, parameter[arg]]: constant[ to_credentials(arg) converts arg into a pair (key, secret) if arg can be coerced into such a pair and otherwise raises an error. Possible inputs include: * A tuple (key, secret) * A mapping with the keys 'key' and 'secret' ...
keyword[def] identifier[to_credentials] ( identifier[arg] ): literal[string] keyword[if] identifier[pimms] . identifier[is_str] ( identifier[arg] ): keyword[try] : keyword[return] identifier[load_credentials] ( identifier[arg] ) keyword[except] identifier[Exception] : keyword[pass] ...
def to_credentials(arg): """ to_credentials(arg) converts arg into a pair (key, secret) if arg can be coerced into such a pair and otherwise raises an error. Possible inputs include: * A tuple (key, secret) * A mapping with the keys 'key' and 'secret' * The name of a file that c...
def ToJson(self): """ Convert object members to a dictionary that can be parsed as JSON. Returns: dict: """ obj = { 'usage': self.Usage, 'data': '' if not self.Data else self.Data.hex() } return obj
def function[ToJson, parameter[self]]: constant[ Convert object members to a dictionary that can be parsed as JSON. Returns: dict: ] variable[obj] assign[=] dictionary[[<ast.Constant object at 0x7da1b1dd0700>, <ast.Constant object at 0x7da1b1dd0760>], [<ast.Attribut...
keyword[def] identifier[ToJson] ( identifier[self] ): literal[string] identifier[obj] ={ literal[string] : identifier[self] . identifier[Usage] , literal[string] : literal[string] keyword[if] keyword[not] identifier[self] . identifier[Data] keyword[else] identifier[self] . id...
def ToJson(self): """ Convert object members to a dictionary that can be parsed as JSON. Returns: dict: """ obj = {'usage': self.Usage, 'data': '' if not self.Data else self.Data.hex()} return obj
def makevAndvPfuncs(self,policyFunc): ''' Constructs the marginal value function for this period. Parameters ---------- policyFunc : function Consumption and medical care function for this period, defined over market resources, permanent income level, and...
def function[makevAndvPfuncs, parameter[self, policyFunc]]: constant[ Constructs the marginal value function for this period. Parameters ---------- policyFunc : function Consumption and medical care function for this period, defined over market resources,...
keyword[def] identifier[makevAndvPfuncs] ( identifier[self] , identifier[policyFunc] ): literal[string] identifier[mCount] = identifier[self] . identifier[aXtraGrid] . identifier[size] identifier[pCount] = identifier[self] . identifier[pLvlGrid] . identifier[size] ident...
def makevAndvPfuncs(self, policyFunc): """ Constructs the marginal value function for this period. Parameters ---------- policyFunc : function Consumption and medical care function for this period, defined over market resources, permanent income level, and th...
def paste(**kwargs): """Returns system clipboard contents.""" clip.OpenClipboard() d = clip.GetClipboardData(win32con.CF_UNICODETEXT) clip.CloseClipboard() return d
def function[paste, parameter[]]: constant[Returns system clipboard contents.] call[name[clip].OpenClipboard, parameter[]] variable[d] assign[=] call[name[clip].GetClipboardData, parameter[name[win32con].CF_UNICODETEXT]] call[name[clip].CloseClipboard, parameter[]] return[name[d]]
keyword[def] identifier[paste] (** identifier[kwargs] ): literal[string] identifier[clip] . identifier[OpenClipboard] () identifier[d] = identifier[clip] . identifier[GetClipboardData] ( identifier[win32con] . identifier[CF_UNICODETEXT] ) identifier[clip] . identifier[CloseClipboard] () key...
def paste(**kwargs): """Returns system clipboard contents.""" clip.OpenClipboard() d = clip.GetClipboardData(win32con.CF_UNICODETEXT) clip.CloseClipboard() return d
def shape_offset_y(self): """Return y distance of shape origin from local coordinate origin. The returned integer represents the topmost extent of the freeform shape, in local coordinates. Note that the bounding box of the shape need not start at the local origin. """ mi...
def function[shape_offset_y, parameter[self]]: constant[Return y distance of shape origin from local coordinate origin. The returned integer represents the topmost extent of the freeform shape, in local coordinates. Note that the bounding box of the shape need not start at the local ori...
keyword[def] identifier[shape_offset_y] ( identifier[self] ): literal[string] identifier[min_y] = identifier[self] . identifier[_start_y] keyword[for] identifier[drawing_operation] keyword[in] identifier[self] : keyword[if] identifier[hasattr] ( identifier[drawing_operati...
def shape_offset_y(self): """Return y distance of shape origin from local coordinate origin. The returned integer represents the topmost extent of the freeform shape, in local coordinates. Note that the bounding box of the shape need not start at the local origin. """ min_y = se...
def _tostring(value): '''Convert value to XML compatible string''' if value is True: value = 'true' elif value is False: value = 'false' elif value is None: value = '' return unicode(value)
def function[_tostring, parameter[value]]: constant[Convert value to XML compatible string] if compare[name[value] is constant[True]] begin[:] variable[value] assign[=] constant[true] return[call[name[unicode], parameter[name[value]]]]
keyword[def] identifier[_tostring] ( identifier[value] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[True] : identifier[value] = literal[string] keyword[elif] identifier[value] keyword[is] keyword[False] : identifier[value] = literal[...
def _tostring(value): """Convert value to XML compatible string""" if value is True: value = 'true' # depends on [control=['if'], data=['value']] elif value is False: value = 'false' # depends on [control=['if'], data=['value']] elif value is None: value = '' # depends on [con...
def _get_sv_callers(items): """ return a sorted list of all of the structural variant callers run """ callers = [] for data in items: for sv in data.get("sv", []): callers.append(sv["variantcaller"]) return list(set([x for x in callers if x != "sv-ensemble"])).sort()
def function[_get_sv_callers, parameter[items]]: constant[ return a sorted list of all of the structural variant callers run ] variable[callers] assign[=] list[[]] for taget[name[data]] in starred[name[items]] begin[:] for taget[name[sv]] in starred[call[name[data].get, p...
keyword[def] identifier[_get_sv_callers] ( identifier[items] ): literal[string] identifier[callers] =[] keyword[for] identifier[data] keyword[in] identifier[items] : keyword[for] identifier[sv] keyword[in] identifier[data] . identifier[get] ( literal[string] ,[]): identifie...
def _get_sv_callers(items): """ return a sorted list of all of the structural variant callers run """ callers = [] for data in items: for sv in data.get('sv', []): callers.append(sv['variantcaller']) # depends on [control=['for'], data=['sv']] # depends on [control=['for'], dat...
def set_computer_desc(desc=None): ''' Set the Windows computer description Args: desc (str): The computer description Returns: str: Description if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt 'minion-id' system.set_computer_desc...
def function[set_computer_desc, parameter[desc]]: constant[ Set the Windows computer description Args: desc (str): The computer description Returns: str: Description if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt 'minion-id...
keyword[def] identifier[set_computer_desc] ( identifier[desc] = keyword[None] ): literal[string] keyword[if] identifier[six] . identifier[PY2] : identifier[desc] = identifier[_to_unicode] ( identifier[desc] ) identifier[system_info] = identifier[win32net] . identifier[NetS...
def set_computer_desc(desc=None): """ Set the Windows computer description Args: desc (str): The computer description Returns: str: Description if successful, otherwise ``False`` CLI Example: .. code-block:: bash salt 'minion-id' system.set_computer_desc...
def relation(self, other): # type: (Term) -> int """ Returns the relationship between the package versions allowed by this term and another. """ if self.dependency.name != other.dependency.name: raise ValueError( "{} should refer to {}".format(other, ...
def function[relation, parameter[self, other]]: constant[ Returns the relationship between the package versions allowed by this term and another. ] if compare[name[self].dependency.name not_equal[!=] name[other].dependency.name] begin[:] <ast.Raise object at 0x7da18fe9220...
keyword[def] identifier[relation] ( identifier[self] , identifier[other] ): literal[string] keyword[if] identifier[self] . identifier[dependency] . identifier[name] != identifier[other] . identifier[dependency] . identifier[name] : keyword[raise] identifier[ValueError] ( ...
def relation(self, other): # type: (Term) -> int '\n Returns the relationship between the package versions\n allowed by this term and another.\n ' if self.dependency.name != other.dependency.name: raise ValueError('{} should refer to {}'.format(other, self.dependency.name)) # depe...
def read_length_and_key(fp): """ Helper to read descriptor key. """ length = read_fmt('I', fp)[0] key = fp.read(length or 4) if length == 0 and key not in _TERMS: logger.debug('Unknown term: %r' % (key)) _TERMS.add(key) return key
def function[read_length_and_key, parameter[fp]]: constant[ Helper to read descriptor key. ] variable[length] assign[=] call[call[name[read_fmt], parameter[constant[I], name[fp]]]][constant[0]] variable[key] assign[=] call[name[fp].read, parameter[<ast.BoolOp object at 0x7da1b26af250>]] ...
keyword[def] identifier[read_length_and_key] ( identifier[fp] ): literal[string] identifier[length] = identifier[read_fmt] ( literal[string] , identifier[fp] )[ literal[int] ] identifier[key] = identifier[fp] . identifier[read] ( identifier[length] keyword[or] literal[int] ) keyword[if] identi...
def read_length_and_key(fp): """ Helper to read descriptor key. """ length = read_fmt('I', fp)[0] key = fp.read(length or 4) if length == 0 and key not in _TERMS: logger.debug('Unknown term: %r' % key) _TERMS.add(key) # depends on [control=['if'], data=[]] return key
def _suggest_normalized_version(s): """Suggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a n...
def function[_suggest_normalized_version, parameter[s]]: constant[Suggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from th...
keyword[def] identifier[_suggest_normalized_version] ( identifier[s] ): literal[string] keyword[try] : identifier[_normalized_key] ( identifier[s] ) keyword[return] identifier[s] keyword[except] identifier[UnsupportedVersionError] : keyword[pass] identifier[rs] = i...
def _suggest_normalized_version(s): """Suggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a n...
def checkCorpNum(self, MemberCorpNum, CheckCorpNum): """ νœ΄νμ—…μ‘°νšŒ - 단건 args MemberCorpNum : νŒλΉŒνšŒμ› μ‚¬μ—…μžλ²ˆν˜Έ CorpNum : μ‘°νšŒν•  μ‚¬μ—…μžλ²ˆν˜Έ MgtKey : λ¬Έμ„œκ΄€λ¦¬λ²ˆν˜Έ return νœ΄νμ—…μ •λ³΄ object raise PopbillException """ ...
def function[checkCorpNum, parameter[self, MemberCorpNum, CheckCorpNum]]: constant[ νœ΄νμ—…μ‘°νšŒ - 단건 args MemberCorpNum : νŒλΉŒνšŒμ› μ‚¬μ—…μžλ²ˆν˜Έ CorpNum : μ‘°νšŒν•  μ‚¬μ—…μžλ²ˆν˜Έ MgtKey : λ¬Έμ„œκ΄€λ¦¬λ²ˆν˜Έ return νœ΄νμ—…μ •λ³΄ object raise Popbill...
keyword[def] identifier[checkCorpNum] ( identifier[self] , identifier[MemberCorpNum] , identifier[CheckCorpNum] ): literal[string] keyword[if] identifier[MemberCorpNum] == keyword[None] keyword[or] identifier[MemberCorpNum] == literal[string] : keyword[raise] identifier[PopbillExc...
def checkCorpNum(self, MemberCorpNum, CheckCorpNum): """ νœ΄νμ—…μ‘°νšŒ - 단건 args MemberCorpNum : νŒλΉŒνšŒμ› μ‚¬μ—…μžλ²ˆν˜Έ CorpNum : μ‘°νšŒν•  μ‚¬μ—…μžλ²ˆν˜Έ MgtKey : λ¬Έμ„œκ΄€λ¦¬λ²ˆν˜Έ return νœ΄νμ—…μ •λ³΄ object raise PopbillException """ if Me...
def confirm_vlan(self, number_net, id_environment_vlan, ip_version=None): """Checking if the vlan insert need to be confirmed :param number_net: Filter by vlan number column :param id_environment_vlan: Filter by environment ID related :param ip_version: Ip version for checking ...
def function[confirm_vlan, parameter[self, number_net, id_environment_vlan, ip_version]]: constant[Checking if the vlan insert need to be confirmed :param number_net: Filter by vlan number column :param id_environment_vlan: Filter by environment ID related :param ip_version: Ip version ...
keyword[def] identifier[confirm_vlan] ( identifier[self] , identifier[number_net] , identifier[id_environment_vlan] , identifier[ip_version] = keyword[None] ): literal[string] identifier[url] = literal[string] + identifier[str] ( identifier[number_net] )+ literal[string] + identifier[id_environmen...
def confirm_vlan(self, number_net, id_environment_vlan, ip_version=None): """Checking if the vlan insert need to be confirmed :param number_net: Filter by vlan number column :param id_environment_vlan: Filter by environment ID related :param ip_version: Ip version for checking :ret...
def notebook_complete(self, **kwargs): """ Finalize the metadata for a notebook and save the notebook to the output path. Called by Engine when execution concludes, regardless of exceptions. """ self.end_time = self.now() self.nb.metadata.papermill['end_time'] = ...
def function[notebook_complete, parameter[self]]: constant[ Finalize the metadata for a notebook and save the notebook to the output path. Called by Engine when execution concludes, regardless of exceptions. ] name[self].end_time assign[=] call[name[self].now, parameter[...
keyword[def] identifier[notebook_complete] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[end_time] = identifier[self] . identifier[now] () identifier[self] . identifier[nb] . identifier[metadata] . identifier[papermill] [ literal[string] ]= iden...
def notebook_complete(self, **kwargs): """ Finalize the metadata for a notebook and save the notebook to the output path. Called by Engine when execution concludes, regardless of exceptions. """ self.end_time = self.now() self.nb.metadata.papermill['end_time'] = self.end_tim...
def compassmot_status_send(self, throttle, current, interference, CompensationX, CompensationY, CompensationZ, force_mavlink1=False): ''' Status of compassmot calibration throttle : throttle (percent*10) (uint16_t) current ...
def function[compassmot_status_send, parameter[self, throttle, current, interference, CompensationX, CompensationY, CompensationZ, force_mavlink1]]: constant[ Status of compassmot calibration throttle : throttle (percent*10) (uint16_t) current ...
keyword[def] identifier[compassmot_status_send] ( identifier[self] , identifier[throttle] , identifier[current] , identifier[interference] , identifier[CompensationX] , identifier[CompensationY] , identifier[CompensationZ] , identifier[force_mavlink1] = keyword[False] ): literal[string] ...
def compassmot_status_send(self, throttle, current, interference, CompensationX, CompensationY, CompensationZ, force_mavlink1=False): """ Status of compassmot calibration throttle : throttle (percent*10) (uint16_t) current : current...
def _unapply_interception(target, ctx=None): """Unapply interception on input target in cleaning it. :param routine target: target from where removing an interception function. is_joinpoint(target) must be True. :param ctx: target ctx. """ # try to get the right ctx if ctx is None: ...
def function[_unapply_interception, parameter[target, ctx]]: constant[Unapply interception on input target in cleaning it. :param routine target: target from where removing an interception function. is_joinpoint(target) must be True. :param ctx: target ctx. ] if compare[name[ctx] is...
keyword[def] identifier[_unapply_interception] ( identifier[target] , identifier[ctx] = keyword[None] ): literal[string] keyword[if] identifier[ctx] keyword[is] keyword[None] : identifier[ctx] = identifier[find_ctx] ( identifier[elt] = identifier[target] ) identifier[interc...
def _unapply_interception(target, ctx=None): """Unapply interception on input target in cleaning it. :param routine target: target from where removing an interception function. is_joinpoint(target) must be True. :param ctx: target ctx. """ # try to get the right ctx if ctx is None: ...
def get_real_percent(self): """get_real_percent() Returns the unmodified percentage of the score based on a 0-point scale.""" if not (self.votes and self.score): return 0 return 100 * (self.get_real_rating() / self.field.range)
def function[get_real_percent, parameter[self]]: constant[get_real_percent() Returns the unmodified percentage of the score based on a 0-point scale.] if <ast.UnaryOp object at 0x7da18dc05480> begin[:] return[constant[0]] return[binary_operation[constant[100] * binary_operat...
keyword[def] identifier[get_real_percent] ( identifier[self] ): literal[string] keyword[if] keyword[not] ( identifier[self] . identifier[votes] keyword[and] identifier[self] . identifier[score] ): keyword[return] literal[int] keyword[return] literal[int] *( identifier[se...
def get_real_percent(self): """get_real_percent() Returns the unmodified percentage of the score based on a 0-point scale.""" if not (self.votes and self.score): return 0 # depends on [control=['if'], data=[]] return 100 * (self.get_real_rating() / self.field.range)
def _compute_initial_out_degree(self): """The number of operations which use each tensor as input. Returns: a {string, int} mapping tensor name to the number of operations which use it as input, or one plus that quantity if the tensor is final. """ out_degree = collections.defaultdict(int) ...
def function[_compute_initial_out_degree, parameter[self]]: constant[The number of operations which use each tensor as input. Returns: a {string, int} mapping tensor name to the number of operations which use it as input, or one plus that quantity if the tensor is final. ] variable[...
keyword[def] identifier[_compute_initial_out_degree] ( identifier[self] ): literal[string] identifier[out_degree] = identifier[collections] . identifier[defaultdict] ( identifier[int] ) keyword[for] identifier[tensor_name] keyword[in] identifier[self] . identifier[get_all_tensor_names] (...
def _compute_initial_out_degree(self): """The number of operations which use each tensor as input. Returns: a {string, int} mapping tensor name to the number of operations which use it as input, or one plus that quantity if the tensor is final. """ out_degree = collections.defaultdict(int) ...