code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def __ensure_suffix_stem(t, suffix): """ Ensure that the target t has the given suffix, and return the file's stem. """ tpath = str(t) if not tpath.endswith(suffix): stem = tpath tpath += suffix return tpath, stem else: stem, ext = os.path.splitext(tpath) ...
def function[__ensure_suffix_stem, parameter[t, suffix]]: constant[ Ensure that the target t has the given suffix, and return the file's stem. ] variable[tpath] assign[=] call[name[str], parameter[name[t]]] if <ast.UnaryOp object at 0x7da2041d9ff0> begin[:] variable[stem] assign[...
keyword[def] identifier[__ensure_suffix_stem] ( identifier[t] , identifier[suffix] ): literal[string] identifier[tpath] = identifier[str] ( identifier[t] ) keyword[if] keyword[not] identifier[tpath] . identifier[endswith] ( identifier[suffix] ): identifier[stem] = identifier[tpath] ...
def __ensure_suffix_stem(t, suffix): """ Ensure that the target t has the given suffix, and return the file's stem. """ tpath = str(t) if not tpath.endswith(suffix): stem = tpath tpath += suffix return (tpath, stem) # depends on [control=['if'], data=[]] else: (stem, ext...
def process(self, user, timestamp, data=None): """ Processes a user event. :Parameters: user : `hashable` A hashable value to identify a user (`int` or `str` are OK) timestamp : :class:`mwtypes.Timestamp` The timestamp of the event ...
def function[process, parameter[self, user, timestamp, data]]: constant[ Processes a user event. :Parameters: user : `hashable` A hashable value to identify a user (`int` or `str` are OK) timestamp : :class:`mwtypes.Timestamp` The timestam...
keyword[def] identifier[process] ( identifier[self] , identifier[user] , identifier[timestamp] , identifier[data] = keyword[None] ): literal[string] identifier[event] = identifier[Event] ( identifier[user] , identifier[mwtypes] . identifier[Timestamp] ( identifier[timestamp] ), identifier[self] . i...
def process(self, user, timestamp, data=None): """ Processes a user event. :Parameters: user : `hashable` A hashable value to identify a user (`int` or `str` are OK) timestamp : :class:`mwtypes.Timestamp` The timestamp of the event ...
def block_partition(block, i): """ Returns two blocks, as a result of partitioning the given one at i-th instruction. """ i += 1 new_block = BasicBlock(block.asm[i:]) block.mem = block.mem[:i] block.asm = block.asm[:i] block.update_labels() new_block.update_labels() new_block.go...
def function[block_partition, parameter[block, i]]: constant[ Returns two blocks, as a result of partitioning the given one at i-th instruction. ] <ast.AugAssign object at 0x7da18f09f430> variable[new_block] assign[=] call[name[BasicBlock], parameter[call[name[block].asm][<ast.Slice object a...
keyword[def] identifier[block_partition] ( identifier[block] , identifier[i] ): literal[string] identifier[i] += literal[int] identifier[new_block] = identifier[BasicBlock] ( identifier[block] . identifier[asm] [ identifier[i] :]) identifier[block] . identifier[mem] = identifier[block] . identif...
def block_partition(block, i): """ Returns two blocks, as a result of partitioning the given one at i-th instruction. """ i += 1 new_block = BasicBlock(block.asm[i:]) block.mem = block.mem[:i] block.asm = block.asm[:i] block.update_labels() new_block.update_labels() new_block.goe...
def length(string, until=None): """ Returns the number of graphemes in the string. Note that this functions needs to traverse the full string to calculate the length, unlike `len(string)` and it's time consumption is linear to the length of the string (up to the `until` value). Only counts up ...
def function[length, parameter[string, until]]: constant[ Returns the number of graphemes in the string. Note that this functions needs to traverse the full string to calculate the length, unlike `len(string)` and it's time consumption is linear to the length of the string (up to the `until` va...
keyword[def] identifier[length] ( identifier[string] , identifier[until] = keyword[None] ): literal[string] keyword[if] identifier[until] keyword[is] keyword[None] : keyword[return] identifier[sum] ( literal[int] keyword[for] identifier[_] keyword[in] identifier[GraphemeIterator] ( identif...
def length(string, until=None): """ Returns the number of graphemes in the string. Note that this functions needs to traverse the full string to calculate the length, unlike `len(string)` and it's time consumption is linear to the length of the string (up to the `until` value). Only counts up ...
def receive(self, command_id, streams=('stdout', 'stderr'), command_timeout=60): """ Recieves data :param command_id: :param streams: :param command_timeout: :return: """ logging.info('receive command: ' + command_id) response_streams = dict.fromke...
def function[receive, parameter[self, command_id, streams, command_timeout]]: constant[ Recieves data :param command_id: :param streams: :param command_timeout: :return: ] call[name[logging].info, parameter[binary_operation[constant[receive command: ] + na...
keyword[def] identifier[receive] ( identifier[self] , identifier[command_id] , identifier[streams] =( literal[string] , literal[string] ), identifier[command_timeout] = literal[int] ): literal[string] identifier[logging] . identifier[info] ( literal[string] + identifier[command_id] ) ident...
def receive(self, command_id, streams=('stdout', 'stderr'), command_timeout=60): """ Recieves data :param command_id: :param streams: :param command_timeout: :return: """ logging.info('receive command: ' + command_id) response_streams = dict.fromkeys(streams, ...
def _check_for_int(x): """ This is a compatibility function that takes a C{float} and converts it to an C{int} if the values are equal. """ try: y = int(x) except (OverflowError, ValueError): pass else: # There is no way in AMF0 to distinguish between integers and flo...
def function[_check_for_int, parameter[x]]: constant[ This is a compatibility function that takes a C{float} and converts it to an C{int} if the values are equal. ] <ast.Try object at 0x7da1b2345c00> return[name[x]]
keyword[def] identifier[_check_for_int] ( identifier[x] ): literal[string] keyword[try] : identifier[y] = identifier[int] ( identifier[x] ) keyword[except] ( identifier[OverflowError] , identifier[ValueError] ): keyword[pass] keyword[else] : keyword[if] identifie...
def _check_for_int(x): """ This is a compatibility function that takes a C{float} and converts it to an C{int} if the values are equal. """ try: y = int(x) # depends on [control=['try'], data=[]] except (OverflowError, ValueError): pass # depends on [control=['except'], data=[]...
def from_bytes(b): """ Generates either a HDPrivateKey or HDPublicKey from the underlying bytes. The serialization must conform to the description in: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format Args: b (bytes): A byte stream ...
def function[from_bytes, parameter[b]]: constant[ Generates either a HDPrivateKey or HDPublicKey from the underlying bytes. The serialization must conform to the description in: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format Args: ...
keyword[def] identifier[from_bytes] ( identifier[b] ): literal[string] keyword[if] identifier[len] ( identifier[b] )< literal[int] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[version] = identifier[int] . identifier[from_bytes] ( identifier[b] [: l...
def from_bytes(b): """ Generates either a HDPrivateKey or HDPublicKey from the underlying bytes. The serialization must conform to the description in: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format Args: b (bytes): A byte stream conf...
def cudnnCreateFilterDescriptor(): """" Create a filter descriptor. This function creates a filter descriptor object by allocating the memory needed to hold its opaque structure. Parameters ---------- Returns ------- wDesc : cudnnFilterDescriptor Handle to a newly allocate...
def function[cudnnCreateFilterDescriptor, parameter[]]: constant[" Create a filter descriptor. This function creates a filter descriptor object by allocating the memory needed to hold its opaque structure. Parameters ---------- Returns ------- wDesc : cudnnFilterDescriptor ...
keyword[def] identifier[cudnnCreateFilterDescriptor] (): literal[string] identifier[wDesc] = identifier[ctypes] . identifier[c_void_p] () identifier[status] = identifier[_libcudnn] . identifier[cudnnCreateFilterDescriptor] ( identifier[ctypes] . identifier[byref] ( identifier[wDesc] )) identifie...
def cudnnCreateFilterDescriptor(): """" Create a filter descriptor. This function creates a filter descriptor object by allocating the memory needed to hold its opaque structure. Parameters ---------- Returns ------- wDesc : cudnnFilterDescriptor Handle to a newly allocate...
def _freeze(self) -> OrderedDict: """ Evaluate all of the column values and return the result :return: column/value tuples """ return OrderedDict(**{k: getattr(self, k, None) for k in super().__getattribute__("_columns")})
def function[_freeze, parameter[self]]: constant[ Evaluate all of the column values and return the result :return: column/value tuples ] return[call[name[OrderedDict], parameter[]]]
keyword[def] identifier[_freeze] ( identifier[self] )-> identifier[OrderedDict] : literal[string] keyword[return] identifier[OrderedDict] (**{ identifier[k] : identifier[getattr] ( identifier[self] , identifier[k] , keyword[None] ) keyword[for] identifier[k] keyword[in] identifier[super] (). id...
def _freeze(self) -> OrderedDict: """ Evaluate all of the column values and return the result :return: column/value tuples """ return OrderedDict(**{k: getattr(self, k, None) for k in super().__getattribute__('_columns')})
def SetSelected(self, node): """Set our selected node""" self.selected_node = node index = self.NodeToIndex(node) if index != -1: self.Focus(index) self.Select(index, True) return index
def function[SetSelected, parameter[self, node]]: constant[Set our selected node] name[self].selected_node assign[=] name[node] variable[index] assign[=] call[name[self].NodeToIndex, parameter[name[node]]] if compare[name[index] not_equal[!=] <ast.UnaryOp object at 0x7da18f00d540>] begin...
keyword[def] identifier[SetSelected] ( identifier[self] , identifier[node] ): literal[string] identifier[self] . identifier[selected_node] = identifier[node] identifier[index] = identifier[self] . identifier[NodeToIndex] ( identifier[node] ) keyword[if] identifier[index] !=- lit...
def SetSelected(self, node): """Set our selected node""" self.selected_node = node index = self.NodeToIndex(node) if index != -1: self.Focus(index) self.Select(index, True) # depends on [control=['if'], data=['index']] return index
def find_available_vc_vers(self): """ Find all available Microsoft Visual C++ versions. """ ms = self.ri.microsoft vckeys = (self.ri.vc, self.ri.vc_for_python, self.ri.vs) vc_vers = [] for hkey in self.ri.HKEYS: for key in vckeys: try: ...
def function[find_available_vc_vers, parameter[self]]: constant[ Find all available Microsoft Visual C++ versions. ] variable[ms] assign[=] name[self].ri.microsoft variable[vckeys] assign[=] tuple[[<ast.Attribute object at 0x7da1b1b87820>, <ast.Attribute object at 0x7da1b1b86f80>...
keyword[def] identifier[find_available_vc_vers] ( identifier[self] ): literal[string] identifier[ms] = identifier[self] . identifier[ri] . identifier[microsoft] identifier[vckeys] =( identifier[self] . identifier[ri] . identifier[vc] , identifier[self] . identifier[ri] . identifier[vc_for...
def find_available_vc_vers(self): """ Find all available Microsoft Visual C++ versions. """ ms = self.ri.microsoft vckeys = (self.ri.vc, self.ri.vc_for_python, self.ri.vs) vc_vers = [] for hkey in self.ri.HKEYS: for key in vckeys: try: bkey = winre...
def network(self, network_id): """Returns :class:`Network` instance for ``network_id`` :type network_id: str :param network_id: This is the ID of the network. This can be found by visiting your class page on Piazza's web UI and grabbing it from https://piazz...
def function[network, parameter[self, network_id]]: constant[Returns :class:`Network` instance for ``network_id`` :type network_id: str :param network_id: This is the ID of the network. This can be found by visiting your class page on Piazza's web UI and grabbing it fro...
keyword[def] identifier[network] ( identifier[self] , identifier[network_id] ): literal[string] identifier[self] . identifier[_ensure_authenticated] () keyword[return] identifier[Network] ( identifier[network_id] , identifier[self] . identifier[_rpc_api] . identifier[session] )
def network(self, network_id): """Returns :class:`Network` instance for ``network_id`` :type network_id: str :param network_id: This is the ID of the network. This can be found by visiting your class page on Piazza's web UI and grabbing it from https://piazza.co...
def mirror_sources(self, sourcedir, targetdir=None, recursive=True, excludes=[]): """ Mirroring compilable sources filepaths to their targets. Args: sourcedir (str): Directory path to scan. Keyword Arguments: absolute (bool): Returned path...
def function[mirror_sources, parameter[self, sourcedir, targetdir, recursive, excludes]]: constant[ Mirroring compilable sources filepaths to their targets. Args: sourcedir (str): Directory path to scan. Keyword Arguments: absolute (bool): Returned paths will be...
keyword[def] identifier[mirror_sources] ( identifier[self] , identifier[sourcedir] , identifier[targetdir] = keyword[None] , identifier[recursive] = keyword[True] , identifier[excludes] =[]): literal[string] identifier[sources] = identifier[self] . identifier[compilable_sources] ( identif...
def mirror_sources(self, sourcedir, targetdir=None, recursive=True, excludes=[]): """ Mirroring compilable sources filepaths to their targets. Args: sourcedir (str): Directory path to scan. Keyword Arguments: absolute (bool): Returned paths will be absolute using ...
def _get_nearest_indexer(self, target, limit, tolerance): """ Get the indexer for the nearest index labels; requires an index with values that can be subtracted from each other (e.g., not strings or tuples). """ left_indexer = self.get_indexer(target, 'pad', limit=limit) ...
def function[_get_nearest_indexer, parameter[self, target, limit, tolerance]]: constant[ Get the indexer for the nearest index labels; requires an index with values that can be subtracted from each other (e.g., not strings or tuples). ] variable[left_indexer] assign[=] ca...
keyword[def] identifier[_get_nearest_indexer] ( identifier[self] , identifier[target] , identifier[limit] , identifier[tolerance] ): literal[string] identifier[left_indexer] = identifier[self] . identifier[get_indexer] ( identifier[target] , literal[string] , identifier[limit] = identifier[limit] )...
def _get_nearest_indexer(self, target, limit, tolerance): """ Get the indexer for the nearest index labels; requires an index with values that can be subtracted from each other (e.g., not strings or tuples). """ left_indexer = self.get_indexer(target, 'pad', limit=limit) righ...
def bel_edges( self, nanopub: Mapping[str, Any], namespace_targets: Mapping[str, List[str]] = {}, rules: List[str] = [], orthologize_target: str = None, ) -> List[Mapping[str, Any]]: """Create BEL Edges from BEL nanopub Args: nanopub (Mapping[str,...
def function[bel_edges, parameter[self, nanopub, namespace_targets, rules, orthologize_target]]: constant[Create BEL Edges from BEL nanopub Args: nanopub (Mapping[str, Any]): bel nanopub namespace_targets (Mapping[str, List[str]]): what namespaces to canonicalize rul...
keyword[def] identifier[bel_edges] ( identifier[self] , identifier[nanopub] : identifier[Mapping] [ identifier[str] , identifier[Any] ], identifier[namespace_targets] : identifier[Mapping] [ identifier[str] , identifier[List] [ identifier[str] ]]={}, identifier[rules] : identifier[List] [ identifier[str] ]=[], i...
def bel_edges(self, nanopub: Mapping[str, Any], namespace_targets: Mapping[str, List[str]]={}, rules: List[str]=[], orthologize_target: str=None) -> List[Mapping[str, Any]]: """Create BEL Edges from BEL nanopub Args: nanopub (Mapping[str, Any]): bel nanopub namespace_targets (Mappin...
def start(self): """ Start the GNS3 VM. """ # get a NAT interface number nat_interface_number = yield from self._look_for_interface("nat") if nat_interface_number < 0: raise GNS3VMError("The GNS3 VM: {} must have a NAT interface configured in order to start"....
def function[start, parameter[self]]: constant[ Start the GNS3 VM. ] variable[nat_interface_number] assign[=] <ast.YieldFrom object at 0x7da18f7229b0> if compare[name[nat_interface_number] less[<] constant[0]] begin[:] <ast.Raise object at 0x7da18ede4e80> variable...
keyword[def] identifier[start] ( identifier[self] ): literal[string] identifier[nat_interface_number] = keyword[yield] keyword[from] identifier[self] . identifier[_look_for_interface] ( literal[string] ) keyword[if] identifier[nat_interface_number] < literal[int] : ...
def start(self): """ Start the GNS3 VM. """ # get a NAT interface number nat_interface_number = (yield from self._look_for_interface('nat')) if nat_interface_number < 0: raise GNS3VMError('The GNS3 VM: {} must have a NAT interface configured in order to start'.format(self.vmname)...
def create(self, index, doc_type, body, id=None, **query_params): """ Adds a typed JSON document in a specific index, making it searchable. Behind the scenes this method calls index(..., op_type='create') `<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html>`...
def function[create, parameter[self, index, doc_type, body, id]]: constant[ Adds a typed JSON document in a specific index, making it searchable. Behind the scenes this method calls index(..., op_type='create') `<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_....
keyword[def] identifier[create] ( identifier[self] , identifier[index] , identifier[doc_type] , identifier[body] , identifier[id] = keyword[None] ,** identifier[query_params] ): literal[string] identifier[query_params] [ literal[string] ]= literal[string] identifier[result] = keyword[yiel...
def create(self, index, doc_type, body, id=None, **query_params): """ Adds a typed JSON document in a specific index, making it searchable. Behind the scenes this method calls index(..., op_type='create') `<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html>`_ ...
def parse_fields(attributes): """Parse model fields.""" return tuple(field.bind_name(name) for name, field in six.iteritems(attributes) if isinstance(field, fields.Field))
def function[parse_fields, parameter[attributes]]: constant[Parse model fields.] return[call[name[tuple], parameter[<ast.GeneratorExp object at 0x7da2054a6440>]]]
keyword[def] identifier[parse_fields] ( identifier[attributes] ): literal[string] keyword[return] identifier[tuple] ( identifier[field] . identifier[bind_name] ( identifier[name] ) keyword[for] identifier[name] , identifier[field] keyword[in] identifier[six] . identifier[iteritems] ( i...
def parse_fields(attributes): """Parse model fields.""" return tuple((field.bind_name(name) for (name, field) in six.iteritems(attributes) if isinstance(field, fields.Field)))
def quote_names(db, names): """psycopg2 doesn't know how to quote identifier names, so we ask the server""" c = db.cursor() c.execute("SELECT pg_catalog.quote_ident(n) FROM pg_catalog.unnest(%s::text[]) n", [list(names)]) return [name for (name,) in c]
def function[quote_names, parameter[db, names]]: constant[psycopg2 doesn't know how to quote identifier names, so we ask the server] variable[c] assign[=] call[name[db].cursor, parameter[]] call[name[c].execute, parameter[constant[SELECT pg_catalog.quote_ident(n) FROM pg_catalog.unnest(%s::text[...
keyword[def] identifier[quote_names] ( identifier[db] , identifier[names] ): literal[string] identifier[c] = identifier[db] . identifier[cursor] () identifier[c] . identifier[execute] ( literal[string] ,[ identifier[list] ( identifier[names] )]) keyword[return] [ identifier[name] keyword[for] ( ...
def quote_names(db, names): """psycopg2 doesn't know how to quote identifier names, so we ask the server""" c = db.cursor() c.execute('SELECT pg_catalog.quote_ident(n) FROM pg_catalog.unnest(%s::text[]) n', [list(names)]) return [name for (name,) in c]
def parse_gptl(file_path, var_list): """ Read a GPTL timing file and extract some data. Args: file_path: the path to the GPTL timing file var_list: a list of strings to look for in the file Returns: A dict containing key-value pairs of the livvkit and the times associat...
def function[parse_gptl, parameter[file_path, var_list]]: constant[ Read a GPTL timing file and extract some data. Args: file_path: the path to the GPTL timing file var_list: a list of strings to look for in the file Returns: A dict containing key-value pairs of the livvkit...
keyword[def] identifier[parse_gptl] ( identifier[file_path] , identifier[var_list] ): literal[string] identifier[timing_result] = identifier[dict] () keyword[if] identifier[os] . identifier[path] . identifier[isfile] ( identifier[file_path] ): keyword[with] identifier[open] ( identifier[fil...
def parse_gptl(file_path, var_list): """ Read a GPTL timing file and extract some data. Args: file_path: the path to the GPTL timing file var_list: a list of strings to look for in the file Returns: A dict containing key-value pairs of the livvkit and the times associat...
def get_frames(self): "Define an iterator that will return frames at the given blocksize" nb_frames = self.input_totalframes // self.output_blocksize if self.input_totalframes % self.output_blocksize == 0: nb_frames -= 1 # Last frame must send eod=True for index in xrange(...
def function[get_frames, parameter[self]]: constant[Define an iterator that will return frames at the given blocksize] variable[nb_frames] assign[=] binary_operation[name[self].input_totalframes <ast.FloorDiv object at 0x7da2590d6bc0> name[self].output_blocksize] if compare[binary_operation[name...
keyword[def] identifier[get_frames] ( identifier[self] ): literal[string] identifier[nb_frames] = identifier[self] . identifier[input_totalframes] // identifier[self] . identifier[output_blocksize] keyword[if] identifier[self] . identifier[input_totalframes] % identifier[self] . identif...
def get_frames(self): """Define an iterator that will return frames at the given blocksize""" nb_frames = self.input_totalframes // self.output_blocksize if self.input_totalframes % self.output_blocksize == 0: nb_frames -= 1 # Last frame must send eod=True # depends on [control=['if'], data=[]] ...
def _iterate_managers(connection, skip): """Iterate over instantiated managers.""" for idx, name, manager_cls in _iterate_manage_classes(skip): if name in skip: continue try: manager = manager_cls(connection=connection) except TypeError as e: click.se...
def function[_iterate_managers, parameter[connection, skip]]: constant[Iterate over instantiated managers.] for taget[tuple[[<ast.Name object at 0x7da1b00fa200>, <ast.Name object at 0x7da1b00f93c0>, <ast.Name object at 0x7da1b00f8b50>]]] in starred[call[name[_iterate_manage_classes], parameter[name[skip...
keyword[def] identifier[_iterate_managers] ( identifier[connection] , identifier[skip] ): literal[string] keyword[for] identifier[idx] , identifier[name] , identifier[manager_cls] keyword[in] identifier[_iterate_manage_classes] ( identifier[skip] ): keyword[if] identifier[name] keyword[in] i...
def _iterate_managers(connection, skip): """Iterate over instantiated managers.""" for (idx, name, manager_cls) in _iterate_manage_classes(skip): if name in skip: continue # depends on [control=['if'], data=[]] try: manager = manager_cls(connection=connection) # depends...
def from_json(cls, data, result=None): """ Create new Node element from JSON data :param data: Element data from JSON :type data: Dict :param result: The result this element belongs to :type result: overpy.Result :return: New instance of Node :rtype: over...
def function[from_json, parameter[cls, data, result]]: constant[ Create new Node element from JSON data :param data: Element data from JSON :type data: Dict :param result: The result this element belongs to :type result: overpy.Result :return: New instance of Nod...
keyword[def] identifier[from_json] ( identifier[cls] , identifier[data] , identifier[result] = keyword[None] ): literal[string] keyword[if] identifier[data] . identifier[get] ( literal[string] )!= identifier[cls] . identifier[_type_value] : keyword[raise] identifier[exception] . iden...
def from_json(cls, data, result=None): """ Create new Node element from JSON data :param data: Element data from JSON :type data: Dict :param result: The result this element belongs to :type result: overpy.Result :return: New instance of Node :rtype: overpy.N...
def add_predicate(self, predicate_obj): """ Adds a predicate to the semantic layer @type predicate_obj: L{Cpredicate} @param predicate_obj: the predicate object """ if self.srl_layer is None: self.srl_layer = Csrl() self.root.append(self.srl_layer....
def function[add_predicate, parameter[self, predicate_obj]]: constant[ Adds a predicate to the semantic layer @type predicate_obj: L{Cpredicate} @param predicate_obj: the predicate object ] if compare[name[self].srl_layer is constant[None]] begin[:] name[s...
keyword[def] identifier[add_predicate] ( identifier[self] , identifier[predicate_obj] ): literal[string] keyword[if] identifier[self] . identifier[srl_layer] keyword[is] keyword[None] : identifier[self] . identifier[srl_layer] = identifier[Csrl] () identifier[self] . id...
def add_predicate(self, predicate_obj): """ Adds a predicate to the semantic layer @type predicate_obj: L{Cpredicate} @param predicate_obj: the predicate object """ if self.srl_layer is None: self.srl_layer = Csrl() self.root.append(self.srl_layer.get_node()) # d...
def battlecry_requires_target(self): """ True if the play action of the card requires a target """ if self.has_combo and self.controller.combo: if PlayReq.REQ_TARGET_FOR_COMBO in self.requirements: return True for req in TARGETING_PREREQUISITES: if req in self.requirements: return True return...
def function[battlecry_requires_target, parameter[self]]: constant[ True if the play action of the card requires a target ] if <ast.BoolOp object at 0x7da18ede4160> begin[:] if compare[name[PlayReq].REQ_TARGET_FOR_COMBO in name[self].requirements] begin[:] return[constant...
keyword[def] identifier[battlecry_requires_target] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[has_combo] keyword[and] identifier[self] . identifier[controller] . identifier[combo] : keyword[if] identifier[PlayReq] . identifier[REQ_TARGET_FOR_COMBO] keyword[in] ide...
def battlecry_requires_target(self): """ True if the play action of the card requires a target """ if self.has_combo and self.controller.combo: if PlayReq.REQ_TARGET_FOR_COMBO in self.requirements: return True # depends on [control=['if'], data=[]] # depends on [control=['if'], data=[]...
def dbg_print(self, indent=0): """ Print out debugging information. """ lst = [] more_data = False for i, addr in enumerate(self.mem.keys()): lst.append(addr) if i >= 20: more_data = True break for addr in s...
def function[dbg_print, parameter[self, indent]]: constant[ Print out debugging information. ] variable[lst] assign[=] list[[]] variable[more_data] assign[=] constant[False] for taget[tuple[[<ast.Name object at 0x7da18eb55f30>, <ast.Name object at 0x7da18eb57970>]]] in st...
keyword[def] identifier[dbg_print] ( identifier[self] , identifier[indent] = literal[int] ): literal[string] identifier[lst] =[] identifier[more_data] = keyword[False] keyword[for] identifier[i] , identifier[addr] keyword[in] identifier[enumerate] ( identifier[self] . identifi...
def dbg_print(self, indent=0): """ Print out debugging information. """ lst = [] more_data = False for (i, addr) in enumerate(self.mem.keys()): lst.append(addr) if i >= 20: more_data = True break # depends on [control=['if'], data=[]] # depends o...
def cmd_move(db=None): """Rename a database within a server. When used with --force, an existing database with the same name as DEST is replaced, the original is renamed out of place in the form DEST_old_YYYYMMDD (unless --no-backup is specified). """ if db is None: db = connect() pg_m...
def function[cmd_move, parameter[db]]: constant[Rename a database within a server. When used with --force, an existing database with the same name as DEST is replaced, the original is renamed out of place in the form DEST_old_YYYYMMDD (unless --no-backup is specified). ] if compare[name[db]...
keyword[def] identifier[cmd_move] ( identifier[db] = keyword[None] ): literal[string] keyword[if] identifier[db] keyword[is] keyword[None] : identifier[db] = identifier[connect] () identifier[pg_move_extended] ( identifier[db] , identifier[args] . identifier[src] , identifier[args] . iden...
def cmd_move(db=None): """Rename a database within a server. When used with --force, an existing database with the same name as DEST is replaced, the original is renamed out of place in the form DEST_old_YYYYMMDD (unless --no-backup is specified). """ if db is None: db = connect() # depend...
def compare(a, b): """Compares two timestamps. ``a`` and ``b`` must be the same type, in addition to normal representations of timestamps that order naturally, they can be rfc3339 formatted strings. Args: a (string|object): a timestamp b (string|object): another timestamp Returns:...
def function[compare, parameter[a, b]]: constant[Compares two timestamps. ``a`` and ``b`` must be the same type, in addition to normal representations of timestamps that order naturally, they can be rfc3339 formatted strings. Args: a (string|object): a timestamp b (string|object): ...
keyword[def] identifier[compare] ( identifier[a] , identifier[b] ): literal[string] identifier[a_is_text] = identifier[isinstance] ( identifier[a] , identifier[basestring] ) identifier[b_is_text] = identifier[isinstance] ( identifier[b] , identifier[basestring] ) keyword[if] identifier[type] ( i...
def compare(a, b): """Compares two timestamps. ``a`` and ``b`` must be the same type, in addition to normal representations of timestamps that order naturally, they can be rfc3339 formatted strings. Args: a (string|object): a timestamp b (string|object): another timestamp Returns:...
def call_servo(examples, serving_bundle): """Send an RPC request to the Servomatic prediction service. Args: examples: A list of examples that matches the model spec. serving_bundle: A `ServingBundle` object that contains the information to make the serving request. Returns: A ClassificationRe...
def function[call_servo, parameter[examples, serving_bundle]]: constant[Send an RPC request to the Servomatic prediction service. Args: examples: A list of examples that matches the model spec. serving_bundle: A `ServingBundle` object that contains the information to make the serving request. ...
keyword[def] identifier[call_servo] ( identifier[examples] , identifier[serving_bundle] ): literal[string] identifier[parsed_url] = identifier[urlparse] ( literal[string] + identifier[serving_bundle] . identifier[inference_address] ) identifier[channel] = identifier[implementations] . identifier[insecure_ch...
def call_servo(examples, serving_bundle): """Send an RPC request to the Servomatic prediction service. Args: examples: A list of examples that matches the model spec. serving_bundle: A `ServingBundle` object that contains the information to make the serving request. Returns: A Classification...
def remove_coreference_layer(self): """ Removes the constituency layer (if exists) of the object (in memory) """ if self.coreference_layer is not None: this_node = self.coreference_layer.get_node() self.root.remove(this_node) if self.header is not None: ...
def function[remove_coreference_layer, parameter[self]]: constant[ Removes the constituency layer (if exists) of the object (in memory) ] if compare[name[self].coreference_layer is_not constant[None]] begin[:] variable[this_node] assign[=] call[name[self].coreference_laye...
keyword[def] identifier[remove_coreference_layer] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[coreference_layer] keyword[is] keyword[not] keyword[None] : identifier[this_node] = identifier[self] . identifier[coreference_layer] . identifier[get_no...
def remove_coreference_layer(self): """ Removes the constituency layer (if exists) of the object (in memory) """ if self.coreference_layer is not None: this_node = self.coreference_layer.get_node() self.root.remove(this_node) # depends on [control=['if'], data=[]] if self.he...
def _create_container_ships(self, hosts): """ :param hosts: :return: """ container_ships = {} if hosts: if 'default' not in hosts: default_container_ship = self._create_container_ship(None) container_ships['default'] = {def...
def function[_create_container_ships, parameter[self, hosts]]: constant[ :param hosts: :return: ] variable[container_ships] assign[=] dictionary[[], []] if name[hosts] begin[:] if compare[constant[default] <ast.NotIn object at 0x7da2590d7190> name[hosts]] ...
keyword[def] identifier[_create_container_ships] ( identifier[self] , identifier[hosts] ): literal[string] identifier[container_ships] ={} keyword[if] identifier[hosts] : keyword[if] literal[string] keyword[not] keyword[in] identifier[hosts] : identifier...
def _create_container_ships(self, hosts): """ :param hosts: :return: """ container_ships = {} if hosts: if 'default' not in hosts: default_container_ship = self._create_container_ship(None) container_ships['default'] = {default_container_ship.url.getur...
def list(self, include_claimed=False, echo=False, marker=None, limit=None): """ Returns a list of messages for this queue. By default only unclaimed messages are returned; if you want claimed messages included, pass `include_claimed=True`. Also, the requester's own messages are ...
def function[list, parameter[self, include_claimed, echo, marker, limit]]: constant[ Returns a list of messages for this queue. By default only unclaimed messages are returned; if you want claimed messages included, pass `include_claimed=True`. Also, the requester's own messages...
keyword[def] identifier[list] ( identifier[self] , identifier[include_claimed] = keyword[False] , identifier[echo] = keyword[False] , identifier[marker] = keyword[None] , identifier[limit] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[_message_manager] . identifi...
def list(self, include_claimed=False, echo=False, marker=None, limit=None): """ Returns a list of messages for this queue. By default only unclaimed messages are returned; if you want claimed messages included, pass `include_claimed=True`. Also, the requester's own messages are not ...
def GetFileLines(filename, newline=None, encoding=None): ''' Reads a file and returns its contents as a list of lines. Works for both local and remote files. :param unicode filename: :param None|''|'\n'|'\r'|'\r\n' newline: Controls universal newlines. See 'io.open' newline parameter d...
def function[GetFileLines, parameter[filename, newline, encoding]]: constant[ Reads a file and returns its contents as a list of lines. Works for both local and remote files. :param unicode filename: :param None|''|' '|' '|' ' newline: Controls universal newlines. See 'io.open' ne...
keyword[def] identifier[GetFileLines] ( identifier[filename] , identifier[newline] = keyword[None] , identifier[encoding] = keyword[None] ): literal[string] keyword[return] identifier[GetFileContents] ( identifier[filename] , identifier[binary] = keyword[False] , identifier[encoding] = iden...
def GetFileLines(filename, newline=None, encoding=None): """ Reads a file and returns its contents as a list of lines. Works for both local and remote files. :param unicode filename: :param None|''|' '|'\r'|'\r ' newline: Controls universal newlines. See 'io.open' newline parameter doc...
def get_session_token(self): """ Use the accession token to request a new session token """ # self.logging.info('Getting session token') # Rather than testing any previous session tokens to see if they are still valid, simply delete old tokens in # preparation of the crea...
def function[get_session_token, parameter[self]]: constant[ Use the accession token to request a new session token ] <ast.Try object at 0x7da1b1eedc60> variable[session_request] assign[=] call[name[OAuth1Session], parameter[name[self].consumer_key, name[self].consumer_secret]] ...
keyword[def] identifier[get_session_token] ( identifier[self] ): literal[string] keyword[try] : identifier[os] . identifier[remove] ( identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[file_path] , literal[string] )) ...
def get_session_token(self): """ Use the accession token to request a new session token """ # self.logging.info('Getting session token') # Rather than testing any previous session tokens to see if they are still valid, simply delete old tokens in # preparation of the creation of new ones...
def reproject_to_grid_coordinates(self, grid_coordinates, interp=gdalconst.GRA_NearestNeighbour): """ Reprojects data in this layer to match that in the GridCoordinates object. """ source_dataset = self.grid_coordinates._as_gdal_dataset() dest_dataset = grid_coordinates._as_gdal_dataset(...
def function[reproject_to_grid_coordinates, parameter[self, grid_coordinates, interp]]: constant[ Reprojects data in this layer to match that in the GridCoordinates object. ] variable[source_dataset] assign[=] call[name[self].grid_coordinates._as_gdal_dataset, parameter[]] variable[dest_...
keyword[def] identifier[reproject_to_grid_coordinates] ( identifier[self] , identifier[grid_coordinates] , identifier[interp] = identifier[gdalconst] . identifier[GRA_NearestNeighbour] ): literal[string] identifier[source_dataset] = identifier[self] . identifier[grid_coordinates] . identifier[_as_g...
def reproject_to_grid_coordinates(self, grid_coordinates, interp=gdalconst.GRA_NearestNeighbour): """ Reprojects data in this layer to match that in the GridCoordinates object. """ source_dataset = self.grid_coordinates._as_gdal_dataset() dest_dataset = grid_coordinates._as_gdal_dataset() rb = s...
def get_data(img_path): """get the (1, 3, h, w) np.array data for the supplied image Args: img_path (string): the input image path Returns: np.array: image data in a (1, 3, h, w) shape """ mean = np.array([123.68, 116.779, 103.939]) ...
def function[get_data, parameter[img_path]]: constant[get the (1, 3, h, w) np.array data for the supplied image Args: img_path (string): the input image path Returns: np.array: image data in a (1, 3, h, w) shape ] variable[mea...
keyword[def] identifier[get_data] ( identifier[img_path] ): literal[string] identifier[mean] = identifier[np] . identifier[array] ([ literal[int] , literal[int] , literal[int] ]) identifier[img] = identifier[Image] . identifier[open] ( identifier[img_path] ) identifier[img] = identifier[np] . ide...
def get_data(img_path): """get the (1, 3, h, w) np.array data for the supplied image Args: img_path (string): the input image path Returns: np.array: image data in a (1, 3, h, w) shape """ mean = np.array([123.68, 116.779, 103.939]) ...
def expand_rmf_matrix(rmf): """Expand an RMF matrix stored in compressed form. *rmf* An RMF object as might be returned by ``sherpa.astro.ui.get_rmf()``. Returns: A non-sparse RMF matrix. The Response Matrix Function (RMF) of an X-ray telescope like Chandra can be stored in a sparse fo...
def function[expand_rmf_matrix, parameter[rmf]]: constant[Expand an RMF matrix stored in compressed form. *rmf* An RMF object as might be returned by ``sherpa.astro.ui.get_rmf()``. Returns: A non-sparse RMF matrix. The Response Matrix Function (RMF) of an X-ray telescope like Chandra c...
keyword[def] identifier[expand_rmf_matrix] ( identifier[rmf] ): literal[string] identifier[n_chan] = identifier[rmf] . identifier[e_min] . identifier[size] identifier[n_energy] = identifier[rmf] . identifier[n_grp] . identifier[size] identifier[expanded] = identifier[np] . identifier[zeros] ((...
def expand_rmf_matrix(rmf): """Expand an RMF matrix stored in compressed form. *rmf* An RMF object as might be returned by ``sherpa.astro.ui.get_rmf()``. Returns: A non-sparse RMF matrix. The Response Matrix Function (RMF) of an X-ray telescope like Chandra can be stored in a sparse fo...
def script_to_address(script, vbyte=0): ''' Like script_to_address but supports altcoins Copied 2015-10-02 from https://github.com/mflaxman/pybitcointools/blob/faf56c53148989ea390238c3c4541a6ae1d601f5/bitcoin/transaction.py#L224-L236 ''' if re.match('^[0-9a-fA-F]*$', script): script = binasc...
def function[script_to_address, parameter[script, vbyte]]: constant[ Like script_to_address but supports altcoins Copied 2015-10-02 from https://github.com/mflaxman/pybitcointools/blob/faf56c53148989ea390238c3c4541a6ae1d601f5/bitcoin/transaction.py#L224-L236 ] if call[name[re].match, paramet...
keyword[def] identifier[script_to_address] ( identifier[script] , identifier[vbyte] = literal[int] ): literal[string] keyword[if] identifier[re] . identifier[match] ( literal[string] , identifier[script] ): identifier[script] = identifier[binascii] . identifier[unhexlify] ( identifier[script] ) ...
def script_to_address(script, vbyte=0): """ Like script_to_address but supports altcoins Copied 2015-10-02 from https://github.com/mflaxman/pybitcointools/blob/faf56c53148989ea390238c3c4541a6ae1d601f5/bitcoin/transaction.py#L224-L236 """ if re.match('^[0-9a-fA-F]*$', script): script = binasc...
def version(self): """Returns the device's version. The device's version is returned as a string of the format: M.mr where ``M`` is major number, ``m`` is minor number, and ``r`` is revision character. Args: self (JLink): the ``JLink`` instance Returns: ...
def function[version, parameter[self]]: constant[Returns the device's version. The device's version is returned as a string of the format: M.mr where ``M`` is major number, ``m`` is minor number, and ``r`` is revision character. Args: self (JLink): the ``JLink`` insta...
keyword[def] identifier[version] ( identifier[self] ): literal[string] identifier[version] = identifier[int] ( identifier[self] . identifier[_dll] . identifier[JLINKARM_GetDLLVersion] ()) identifier[major] = identifier[version] / literal[int] identifier[minor] =( identifier[versi...
def version(self): """Returns the device's version. The device's version is returned as a string of the format: M.mr where ``M`` is major number, ``m`` is minor number, and ``r`` is revision character. Args: self (JLink): the ``JLink`` instance Returns: ...
def _fetch_objects(self, key, value): """Fetch Multiple linked objects""" return self.to_cls.query.filter(**{key: value})
def function[_fetch_objects, parameter[self, key, value]]: constant[Fetch Multiple linked objects] return[call[name[self].to_cls.query.filter, parameter[]]]
keyword[def] identifier[_fetch_objects] ( identifier[self] , identifier[key] , identifier[value] ): literal[string] keyword[return] identifier[self] . identifier[to_cls] . identifier[query] . identifier[filter] (**{ identifier[key] : identifier[value] })
def _fetch_objects(self, key, value): """Fetch Multiple linked objects""" return self.to_cls.query.filter(**{key: value})
def tempo_account_add_account(self, data=None): """ Creates Account, adding new Account requires the Manage Accounts Permission. :param data: String then it will convert to json :return: """ url = 'rest/tempo-accounts/1/account/' if data is None: retur...
def function[tempo_account_add_account, parameter[self, data]]: constant[ Creates Account, adding new Account requires the Manage Accounts Permission. :param data: String then it will convert to json :return: ] variable[url] assign[=] constant[rest/tempo-accounts/1/accoun...
keyword[def] identifier[tempo_account_add_account] ( identifier[self] , identifier[data] = keyword[None] ): literal[string] identifier[url] = literal[string] keyword[if] identifier[data] keyword[is] keyword[None] : keyword[return] literal[string] keyword[return]...
def tempo_account_add_account(self, data=None): """ Creates Account, adding new Account requires the Manage Accounts Permission. :param data: String then it will convert to json :return: """ url = 'rest/tempo-accounts/1/account/' if data is None: return 'Please, provi...
def create_objective(self, objective_form=None): """Creates a new Objective. arg: objectiveForm (osid.learning.ObjectiveForm): the form for this Objective return: (osid.learning.Objective) - the new Objective raise: IllegalState - objectiveForm already used in a crea...
def function[create_objective, parameter[self, objective_form]]: constant[Creates a new Objective. arg: objectiveForm (osid.learning.ObjectiveForm): the form for this Objective return: (osid.learning.Objective) - the new Objective raise: IllegalState - objectiveForm ...
keyword[def] identifier[create_objective] ( identifier[self] , identifier[objective_form] = keyword[None] ): literal[string] keyword[if] identifier[objective_form] keyword[is] keyword[None] : keyword[raise] identifier[NullArgument] () keyword[if] keyword[not] identifier[...
def create_objective(self, objective_form=None): """Creates a new Objective. arg: objectiveForm (osid.learning.ObjectiveForm): the form for this Objective return: (osid.learning.Objective) - the new Objective raise: IllegalState - objectiveForm already used in a create ...
def naturalize_thing(self, string): """ Make a naturalized version of a general string, not a person's name. e.g., title of a book, a band's name, etc. string -- a lowercase string. """ # Things we want to move to the back of the string: articles = [ ...
def function[naturalize_thing, parameter[self, string]]: constant[ Make a naturalized version of a general string, not a person's name. e.g., title of a book, a band's name, etc. string -- a lowercase string. ] variable[articles] assign[=] list[[<ast.Constant object at 0...
keyword[def] identifier[naturalize_thing] ( identifier[self] , identifier[string] ): literal[string] identifier[articles] =[ literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , li...
def naturalize_thing(self, string): """ Make a naturalized version of a general string, not a person's name. e.g., title of a book, a band's name, etc. string -- a lowercase string. """ # Things we want to move to the back of the string: articles = ['a', 'an', 'the', 'un', '...
def switches(self): """ List of all switches currently registered. """ results = [ switch for name, switch in self.storage.iteritems() if name.startswith(self.__joined_namespace) ] return results
def function[switches, parameter[self]]: constant[ List of all switches currently registered. ] variable[results] assign[=] <ast.ListComp object at 0x7da18f09d150> return[name[results]]
keyword[def] identifier[switches] ( identifier[self] ): literal[string] identifier[results] =[ identifier[switch] keyword[for] identifier[name] , identifier[switch] keyword[in] identifier[self] . identifier[storage] . identifier[iteritems] () keyword[if] identifier[name] . id...
def switches(self): """ List of all switches currently registered. """ results = [switch for (name, switch) in self.storage.iteritems() if name.startswith(self.__joined_namespace)] return results
def provider(cls, note, provider=None, name=False): """Register a provider, either a Provider class or a generator. Provider class:: from jeni import Injector as BaseInjector from jeni import Provider class Injector(BaseInjector): pass ...
def function[provider, parameter[cls, note, provider, name]]: constant[Register a provider, either a Provider class or a generator. Provider class:: from jeni import Injector as BaseInjector from jeni import Provider class Injector(BaseInjector): pa...
keyword[def] identifier[provider] ( identifier[cls] , identifier[note] , identifier[provider] = keyword[None] , identifier[name] = keyword[False] ): literal[string] keyword[def] identifier[decorator] ( identifier[provider] ): keyword[if] identifier[inspect] . identifier[isgeneratorfu...
def provider(cls, note, provider=None, name=False): """Register a provider, either a Provider class or a generator. Provider class:: from jeni import Injector as BaseInjector from jeni import Provider class Injector(BaseInjector): pass @Inj...
def remove_all_annotations_from_tier(self, id_tier, clean=True): """remove all annotations from a tier :param str id_tier: Name of the tier. :raises KeyError: If the tier is non existent. """ for aid in self.tiers[id_tier][0]: del(self.annotations[aid]) for a...
def function[remove_all_annotations_from_tier, parameter[self, id_tier, clean]]: constant[remove all annotations from a tier :param str id_tier: Name of the tier. :raises KeyError: If the tier is non existent. ] for taget[name[aid]] in starred[call[call[name[self].tiers][name[id...
keyword[def] identifier[remove_all_annotations_from_tier] ( identifier[self] , identifier[id_tier] , identifier[clean] = keyword[True] ): literal[string] keyword[for] identifier[aid] keyword[in] identifier[self] . identifier[tiers] [ identifier[id_tier] ][ literal[int] ]: keyword[de...
def remove_all_annotations_from_tier(self, id_tier, clean=True): """remove all annotations from a tier :param str id_tier: Name of the tier. :raises KeyError: If the tier is non existent. """ for aid in self.tiers[id_tier][0]: del self.annotations[aid] # depends on [control=['f...
def minutes_for_sessions_in_range(self, start_session_label, end_session_label): """ Returns all the minutes for all the sessions from the given start session label to the given end session label, inclusive. Par...
def function[minutes_for_sessions_in_range, parameter[self, start_session_label, end_session_label]]: constant[ Returns all the minutes for all the sessions from the given start session label to the given end session label, inclusive. Parameters ---------- start_session_...
keyword[def] identifier[minutes_for_sessions_in_range] ( identifier[self] , identifier[start_session_label] , identifier[end_session_label] ): literal[string] identifier[first_minute] , identifier[_] = identifier[self] . identifier[open_and_close_for_session] ( identifier[start_session_label] ) ...
def minutes_for_sessions_in_range(self, start_session_label, end_session_label): """ Returns all the minutes for all the sessions from the given start session label to the given end session label, inclusive. Parameters ---------- start_session_label: pd.Timestamp ...
def send_frame(self, cmd, headers=None, body=''): """ Encode and send a stomp frame through the underlying transport: :param str cmd: the protocol command :param dict headers: a map of headers to include in the frame :param body: the content of the message """ ...
def function[send_frame, parameter[self, cmd, headers, body]]: constant[ Encode and send a stomp frame through the underlying transport: :param str cmd: the protocol command :param dict headers: a map of headers to include in the frame :param body: the content of the mes...
keyword[def] identifier[send_frame] ( identifier[self] , identifier[cmd] , identifier[headers] = keyword[None] , identifier[body] = literal[string] ): literal[string] keyword[if] identifier[cmd] != identifier[CMD_CONNECT] : keyword[if] identifier[headers] keyword[is] keyword[None] ...
def send_frame(self, cmd, headers=None, body=''): """ Encode and send a stomp frame through the underlying transport: :param str cmd: the protocol command :param dict headers: a map of headers to include in the frame :param body: the content of the message """ if...
def execute(self, command, args): """ Event firing and exception conversion around command execution. Common exceptions are run through our exception handler for pretty-printing or debugging and then converted to SystemExit so the interpretor will exit without further ado (or be caught i...
def function[execute, parameter[self, command, args]]: constant[ Event firing and exception conversion around command execution. Common exceptions are run through our exception handler for pretty-printing or debugging and then converted to SystemExit so the interpretor will exit without ...
keyword[def] identifier[execute] ( identifier[self] , identifier[command] , identifier[args] ): literal[string] identifier[self] . identifier[fire_event] ( literal[string] , identifier[command] , identifier[args] ) keyword[try] : keyword[try] : identifier[resu...
def execute(self, command, args): """ Event firing and exception conversion around command execution. Common exceptions are run through our exception handler for pretty-printing or debugging and then converted to SystemExit so the interpretor will exit without further ado (or be caught if ...
def getAsKmlGrid(self, session, path=None, documentName=None, colorRamp=ColorRampEnum.COLOR_RAMP_HUE, alpha=1.0, noDataValue=None): """ Retrieve the raster as a KML document with each cell of the raster represented as a vector polygon. The result is a vector grid of raster c...
def function[getAsKmlGrid, parameter[self, session, path, documentName, colorRamp, alpha, noDataValue]]: constant[ Retrieve the raster as a KML document with each cell of the raster represented as a vector polygon. The result is a vector grid of raster cells. Cells with the no data value are exc...
keyword[def] identifier[getAsKmlGrid] ( identifier[self] , identifier[session] , identifier[path] = keyword[None] , identifier[documentName] = keyword[None] , identifier[colorRamp] = identifier[ColorRampEnum] . identifier[COLOR_RAMP_HUE] , identifier[alpha] = literal[int] , identifier[noDataValue] = keyword[None] ):...
def getAsKmlGrid(self, session, path=None, documentName=None, colorRamp=ColorRampEnum.COLOR_RAMP_HUE, alpha=1.0, noDataValue=None): """ Retrieve the raster as a KML document with each cell of the raster represented as a vector polygon. The result is a vector grid of raster cells. Cells with the no d...
def compute_distance(a, b): ''' Computes a modified Levenshtein distance between two strings, comparing the lowercase versions of each string and accounting for QWERTY distance. Arguments: - a (str) String to compare to 'b' - b (str) String to compare to 'a' Returns: - (int...
def function[compute_distance, parameter[a, b]]: constant[ Computes a modified Levenshtein distance between two strings, comparing the lowercase versions of each string and accounting for QWERTY distance. Arguments: - a (str) String to compare to 'b' - b (str) String to compare to '...
keyword[def] identifier[compute_distance] ( identifier[a] , identifier[b] ): literal[string] keyword[if] keyword[not] identifier[a] : keyword[return] identifier[len] ( identifier[b] ) keyword[if] keyword[not] identifier[b] : keyword[return] identifier[len] ( identifier[a]...
def compute_distance(a, b): """ Computes a modified Levenshtein distance between two strings, comparing the lowercase versions of each string and accounting for QWERTY distance. Arguments: - a (str) String to compare to 'b' - b (str) String to compare to 'a' Returns: - (int...
def get(self, key, prompt_default='', prompt_help=''): """ Return the value for key from the environment or keyring. The keyring value is resolved from a local namespace or a global one. """ value = super(DjSecret, self).get(key, prompt_default, prompt_help='') if not val...
def function[get, parameter[self, key, prompt_default, prompt_help]]: constant[ Return the value for key from the environment or keyring. The keyring value is resolved from a local namespace or a global one. ] variable[value] assign[=] call[call[name[super], parameter[name[DjSecr...
keyword[def] identifier[get] ( identifier[self] , identifier[key] , identifier[prompt_default] = literal[string] , identifier[prompt_help] = literal[string] ): literal[string] identifier[value] = identifier[super] ( identifier[DjSecret] , identifier[self] ). identifier[get] ( identifier[key] , iden...
def get(self, key, prompt_default='', prompt_help=''): """ Return the value for key from the environment or keyring. The keyring value is resolved from a local namespace or a global one. """ value = super(DjSecret, self).get(key, prompt_default, prompt_help='') if not value and self....
def resize_image_to_fit_width(image, dest_w): """ Resize and image to fit the passed in width, keeping the aspect ratio the same :param image: PIL.Image :param dest_w: The desired width """ scale_factor = dest_w / image.size[0] dest_h = image.size[1] * scale_factor scaled_image = i...
def function[resize_image_to_fit_width, parameter[image, dest_w]]: constant[ Resize and image to fit the passed in width, keeping the aspect ratio the same :param image: PIL.Image :param dest_w: The desired width ] variable[scale_factor] assign[=] binary_operation[name[dest_w] / call[na...
keyword[def] identifier[resize_image_to_fit_width] ( identifier[image] , identifier[dest_w] ): literal[string] identifier[scale_factor] = identifier[dest_w] / identifier[image] . identifier[size] [ literal[int] ] identifier[dest_h] = identifier[image] . identifier[size] [ literal[int] ]* identifier[sc...
def resize_image_to_fit_width(image, dest_w): """ Resize and image to fit the passed in width, keeping the aspect ratio the same :param image: PIL.Image :param dest_w: The desired width """ scale_factor = dest_w / image.size[0] dest_h = image.size[1] * scale_factor scaled_image = image....
def sftp( task: Task, src: str, dst: str, action: str, dry_run: Optional[bool] = None ) -> Result: """ Transfer files from/to the device using sftp protocol Example:: nornir.run(files.sftp, action="put", src="README.md", dst="/tmp/REA...
def function[sftp, parameter[task, src, dst, action, dry_run]]: constant[ Transfer files from/to the device using sftp protocol Example:: nornir.run(files.sftp, action="put", src="README.md", dst="/tmp/README.md") Arguments: ...
keyword[def] identifier[sftp] ( identifier[task] : identifier[Task] , identifier[src] : identifier[str] , identifier[dst] : identifier[str] , identifier[action] : identifier[str] , identifier[dry_run] : identifier[Optional] [ identifier[bool] ]= keyword[None] )-> identifier[Result] : literal[string] iden...
def sftp(task: Task, src: str, dst: str, action: str, dry_run: Optional[bool]=None) -> Result: """ Transfer files from/to the device using sftp protocol Example:: nornir.run(files.sftp, action="put", src="README.md", dst="/tmp/README.md")...
def get_backspace_count(self, buffer): """ Given the input buffer, calculate how many backspaces are needed to erase the text that triggered this folder. """ if TriggerMode.ABBREVIATION in self.modes and self.backspace: if self._should_trigger_abbreviation(buffer): ...
def function[get_backspace_count, parameter[self, buffer]]: constant[ Given the input buffer, calculate how many backspaces are needed to erase the text that triggered this folder. ] if <ast.BoolOp object at 0x7da18eb578b0> begin[:] if call[name[self]._should_trig...
keyword[def] identifier[get_backspace_count] ( identifier[self] , identifier[buffer] ): literal[string] keyword[if] identifier[TriggerMode] . identifier[ABBREVIATION] keyword[in] identifier[self] . identifier[modes] keyword[and] identifier[self] . identifier[backspace] : keyword[i...
def get_backspace_count(self, buffer): """ Given the input buffer, calculate how many backspaces are needed to erase the text that triggered this folder. """ if TriggerMode.ABBREVIATION in self.modes and self.backspace: if self._should_trigger_abbreviation(buffer): ab...
def ssh_compute_add_host_and_key(public_key, hostname, private_address, application_name, user=None): """Add a compute nodes ssh details to local cache. Collect various hostname variations and add the corresponding host keys to the local known hosts file. Finally, add the s...
def function[ssh_compute_add_host_and_key, parameter[public_key, hostname, private_address, application_name, user]]: constant[Add a compute nodes ssh details to local cache. Collect various hostname variations and add the corresponding host keys to the local known hosts file. Finally, add the supplied...
keyword[def] identifier[ssh_compute_add_host_and_key] ( identifier[public_key] , identifier[hostname] , identifier[private_address] , identifier[application_name] , identifier[user] = keyword[None] ): literal[string] identifier[hosts] =[ identifier[private_address] ] keyword[if] keyword[n...
def ssh_compute_add_host_and_key(public_key, hostname, private_address, application_name, user=None): """Add a compute nodes ssh details to local cache. Collect various hostname variations and add the corresponding host keys to the local known hosts file. Finally, add the supplied public key to the aut...
def generateSplines(self): """#TODO: docstring """ _ = returnSplineList(self.dependentVar, self.independentVar, subsetPercentage=self.splineSubsetPercentage, cycles=self.splineCycles, minKnotPoints=self.spline...
def function[generateSplines, parameter[self]]: constant[#TODO: docstring ] variable[_] assign[=] call[name[returnSplineList], parameter[name[self].dependentVar, name[self].independentVar]] name[self].splines assign[=] name[_]
keyword[def] identifier[generateSplines] ( identifier[self] ): literal[string] identifier[_] = identifier[returnSplineList] ( identifier[self] . identifier[dependentVar] , identifier[self] . identifier[independentVar] , identifier[subsetPercentage] = identifier[self] . identifier[splineSub...
def generateSplines(self): """#TODO: docstring """ _ = returnSplineList(self.dependentVar, self.independentVar, subsetPercentage=self.splineSubsetPercentage, cycles=self.splineCycles, minKnotPoints=self.splineMinKnotPoins, initialKnots=self.splineInitialKnots, splineOrder=self.splineOrder, terminalExpan...
def autocomplete(query, country=None, hurricanes=False, cities=True, timeout=5): """Make an autocomplete API request This can be used to find cities and/or hurricanes by name :param string query: city :param string country: restrict search to a specific country. Must be a two letter country code :...
def function[autocomplete, parameter[query, country, hurricanes, cities, timeout]]: constant[Make an autocomplete API request This can be used to find cities and/or hurricanes by name :param string query: city :param string country: restrict search to a specific country. Must be a two letter count...
keyword[def] identifier[autocomplete] ( identifier[query] , identifier[country] = keyword[None] , identifier[hurricanes] = keyword[False] , identifier[cities] = keyword[True] , identifier[timeout] = literal[int] ): literal[string] identifier[data] ={} identifier[data] [ literal[string] ]= identifier[q...
def autocomplete(query, country=None, hurricanes=False, cities=True, timeout=5): """Make an autocomplete API request This can be used to find cities and/or hurricanes by name :param string query: city :param string country: restrict search to a specific country. Must be a two letter country code :...
def scrape_all_files(self): """ Generator that yields one by one the return value for self.read_dcm for each file within this set """ try: for dcmf in self.items: yield self.read_dcm(dcmf) except IOError as ioe: raise IOError('Error...
def function[scrape_all_files, parameter[self]]: constant[ Generator that yields one by one the return value for self.read_dcm for each file within this set ] <ast.Try object at 0x7da1afef8550>
keyword[def] identifier[scrape_all_files] ( identifier[self] ): literal[string] keyword[try] : keyword[for] identifier[dcmf] keyword[in] identifier[self] . identifier[items] : keyword[yield] identifier[self] . identifier[read_dcm] ( identifier[dcmf] ) keyw...
def scrape_all_files(self): """ Generator that yields one by one the return value for self.read_dcm for each file within this set """ try: for dcmf in self.items: yield self.read_dcm(dcmf) # depends on [control=['for'], data=['dcmf']] # depends on [control=['try'], ...
def update(context, resource, **kwargs): """Update a specific resource""" etag = kwargs.pop('etag') id = kwargs.pop('id') data = utils.sanitize_kwargs(**kwargs) uri = '%s/%s/%s' % (context.dci_cs_api, resource, id) r = context.session.put(uri, timeout=HTTP_TIMEOUT, he...
def function[update, parameter[context, resource]]: constant[Update a specific resource] variable[etag] assign[=] call[name[kwargs].pop, parameter[constant[etag]]] variable[id] assign[=] call[name[kwargs].pop, parameter[constant[id]]] variable[data] assign[=] call[name[utils].sanitize_kw...
keyword[def] identifier[update] ( identifier[context] , identifier[resource] ,** identifier[kwargs] ): literal[string] identifier[etag] = identifier[kwargs] . identifier[pop] ( literal[string] ) identifier[id] = identifier[kwargs] . identifier[pop] ( literal[string] ) identifier[data] = identifie...
def update(context, resource, **kwargs): """Update a specific resource""" etag = kwargs.pop('etag') id = kwargs.pop('id') data = utils.sanitize_kwargs(**kwargs) uri = '%s/%s/%s' % (context.dci_cs_api, resource, id) r = context.session.put(uri, timeout=HTTP_TIMEOUT, headers={'If-match': etag}, js...
def from_kwargs(cls, **kwargs): """Creates a new instance of self from the given keyword arguments. Each argument will correspond to a field in the returned array, with the name of the field given by the keyword, and the value(s) whatever the keyword was set to. Each keyword may be set t...
def function[from_kwargs, parameter[cls]]: constant[Creates a new instance of self from the given keyword arguments. Each argument will correspond to a field in the returned array, with the name of the field given by the keyword, and the value(s) whatever the keyword was set to. Each key...
keyword[def] identifier[from_kwargs] ( identifier[cls] ,** identifier[kwargs] ): literal[string] identifier[arrays] =[] identifier[names] =[] keyword[for] identifier[p] , identifier[vals] keyword[in] identifier[kwargs] . identifier[items] (): keyword[if] keyword[n...
def from_kwargs(cls, **kwargs): """Creates a new instance of self from the given keyword arguments. Each argument will correspond to a field in the returned array, with the name of the field given by the keyword, and the value(s) whatever the keyword was set to. Each keyword may be set to a ...
def cinterpolate(p, axis_values, pixelgrid): """ Interpolates in a grid prepared by create_pixeltypegrid(). Does a similar thing as :py:func:`interpolate`, but does everything in C. p is an array of parameter arrays. Careful, the shape of input :envvar:`p` and output is the transpose ...
def function[cinterpolate, parameter[p, axis_values, pixelgrid]]: constant[ Interpolates in a grid prepared by create_pixeltypegrid(). Does a similar thing as :py:func:`interpolate`, but does everything in C. p is an array of parameter arrays. Careful, the shape of input :envvar:`...
keyword[def] identifier[cinterpolate] ( identifier[p] , identifier[axis_values] , identifier[pixelgrid] ): literal[string] identifier[res] = identifier[libphoebe] . identifier[interp] ( identifier[p] , identifier[axis_values] , identifier[pixelgrid] ) keyword[return] identifier[res]
def cinterpolate(p, axis_values, pixelgrid): """ Interpolates in a grid prepared by create_pixeltypegrid(). Does a similar thing as :py:func:`interpolate`, but does everything in C. p is an array of parameter arrays. Careful, the shape of input :envvar:`p` and output is the transpose ...
def ip_to_host(ip): ''' Returns the hostname of a given IP ''' try: hostname, aliaslist, ipaddrlist = socket.gethostbyaddr(ip) except Exception as exc: log.debug('salt.utils.network.ip_to_host(%r) failed: %s', ip, exc) hostname = None return hostname
def function[ip_to_host, parameter[ip]]: constant[ Returns the hostname of a given IP ] <ast.Try object at 0x7da1b1f7b460> return[name[hostname]]
keyword[def] identifier[ip_to_host] ( identifier[ip] ): literal[string] keyword[try] : identifier[hostname] , identifier[aliaslist] , identifier[ipaddrlist] = identifier[socket] . identifier[gethostbyaddr] ( identifier[ip] ) keyword[except] identifier[Exception] keyword[as] identifier[exc]...
def ip_to_host(ip): """ Returns the hostname of a given IP """ try: (hostname, aliaslist, ipaddrlist) = socket.gethostbyaddr(ip) # depends on [control=['try'], data=[]] except Exception as exc: log.debug('salt.utils.network.ip_to_host(%r) failed: %s', ip, exc) hostname = Non...
def msg2repr(msg, processor, **config): """ Return a human-readable or "natural language" representation of a dict-like fedmsg message. Think of this as the 'top-most level' function in this module. """ fmt = u"{title} -- {subtitle} {link}" title = msg2title(msg, **config) subtitle = proce...
def function[msg2repr, parameter[msg, processor]]: constant[ Return a human-readable or "natural language" representation of a dict-like fedmsg message. Think of this as the 'top-most level' function in this module. ] variable[fmt] assign[=] constant[{title} -- {subtitle} {link}] v...
keyword[def] identifier[msg2repr] ( identifier[msg] , identifier[processor] ,** identifier[config] ): literal[string] identifier[fmt] = literal[string] identifier[title] = identifier[msg2title] ( identifier[msg] ,** identifier[config] ) identifier[subtitle] = identifier[processor] . identifier[s...
def msg2repr(msg, processor, **config): """ Return a human-readable or "natural language" representation of a dict-like fedmsg message. Think of this as the 'top-most level' function in this module. """ fmt = u'{title} -- {subtitle} {link}' title = msg2title(msg, **config) subtitle = proce...
def fill_sampling(slice_list, N): """Given a list of slices, draw N samples such that each slice contributes as much as possible Parameters -------------------------- slice_list : list of Slice List of slices N : int Number of samples to draw """ A = [len(s.inliers) for s in...
def function[fill_sampling, parameter[slice_list, N]]: constant[Given a list of slices, draw N samples such that each slice contributes as much as possible Parameters -------------------------- slice_list : list of Slice List of slices N : int Number of samples to draw ] ...
keyword[def] identifier[fill_sampling] ( identifier[slice_list] , identifier[N] ): literal[string] identifier[A] =[ identifier[len] ( identifier[s] . identifier[inliers] ) keyword[for] identifier[s] keyword[in] identifier[slice_list] ] identifier[N_max] = identifier[np] . identifier[sum] ( identifi...
def fill_sampling(slice_list, N): """Given a list of slices, draw N samples such that each slice contributes as much as possible Parameters -------------------------- slice_list : list of Slice List of slices N : int Number of samples to draw """ A = [len(s.inliers) for s in...
def register(self, server, username, password): """ Register a new GenePattern server session for the provided server, username and password. Return the session. :param server: :param username: :param password: :return: """ # Create the session ...
def function[register, parameter[self, server, username, password]]: constant[ Register a new GenePattern server session for the provided server, username and password. Return the session. :param server: :param username: :param password: :return: ] ...
keyword[def] identifier[register] ( identifier[self] , identifier[server] , identifier[username] , identifier[password] ): literal[string] identifier[session] = identifier[gp] . identifier[GPServer] ( identifier[server] , identifier[username] , identifier[password] ) id...
def register(self, server, username, password): """ Register a new GenePattern server session for the provided server, username and password. Return the session. :param server: :param username: :param password: :return: """ # Create the session session...
def add_delegate(self, callback): """ Registers a new delegate callback The prototype should be function(data), where data will be the decoded json push Args: callback (function): method to trigger when push center receives events """ if callback in sel...
def function[add_delegate, parameter[self, callback]]: constant[ Registers a new delegate callback The prototype should be function(data), where data will be the decoded json push Args: callback (function): method to trigger when push center receives events ] ...
keyword[def] identifier[add_delegate] ( identifier[self] , identifier[callback] ): literal[string] keyword[if] identifier[callback] keyword[in] identifier[self] . identifier[_delegate_methods] : keyword[return] identifier[self] . identifier[_delegate_methods] . identifie...
def add_delegate(self, callback): """ Registers a new delegate callback The prototype should be function(data), where data will be the decoded json push Args: callback (function): method to trigger when push center receives events """ if callback in self._delega...
def configure_create(self, ns, definition): """ Register a create endpoint. The definition's func should be a create function, which must: - accept kwargs for the request and path data - return a new item :param ns: the namespace :param definition: the endpoint ...
def function[configure_create, parameter[self, ns, definition]]: constant[ Register a create endpoint. The definition's func should be a create function, which must: - accept kwargs for the request and path data - return a new item :param ns: the namespace :para...
keyword[def] identifier[configure_create] ( identifier[self] , identifier[ns] , identifier[definition] ): literal[string] @ identifier[self] . identifier[add_route] ( identifier[ns] . identifier[collection_path] , identifier[Operation] . identifier[Create] , identifier[ns] ) @ identifier[req...
def configure_create(self, ns, definition): """ Register a create endpoint. The definition's func should be a create function, which must: - accept kwargs for the request and path data - return a new item :param ns: the namespace :param definition: the endpoint defi...
def _run_dragonpy_cli(self, *args): """ Run DragonPy cli with given args. Add "--verbosity" from GUI. """ verbosity = self.frame_settings.var_verbosity.get() verbosity_no = VERBOSITY_DICT2[verbosity] log.debug("Verbosity: %i (%s)" % (verbosity_no, verbosity)) ...
def function[_run_dragonpy_cli, parameter[self]]: constant[ Run DragonPy cli with given args. Add "--verbosity" from GUI. ] variable[verbosity] assign[=] call[name[self].frame_settings.var_verbosity.get, parameter[]] variable[verbosity_no] assign[=] call[name[VERBOSITY_DI...
keyword[def] identifier[_run_dragonpy_cli] ( identifier[self] ,* identifier[args] ): literal[string] identifier[verbosity] = identifier[self] . identifier[frame_settings] . identifier[var_verbosity] . identifier[get] () identifier[verbosity_no] = identifier[VERBOSITY_DICT2] [ identifier[ve...
def _run_dragonpy_cli(self, *args): """ Run DragonPy cli with given args. Add "--verbosity" from GUI. """ verbosity = self.frame_settings.var_verbosity.get() verbosity_no = VERBOSITY_DICT2[verbosity] log.debug('Verbosity: %i (%s)' % (verbosity_no, verbosity)) # "--log_list", ...
def memoize(Class, *args, **kwargs): ''' Memoize/record a function inside this vlermv. :: @Vlermv.cache('~/.http') def get(url): return requests.get(url, auth = ('username', 'password')) The args and kwargs get passed to the Vlermv with some slight chang...
def function[memoize, parameter[Class]]: constant[ Memoize/record a function inside this vlermv. :: @Vlermv.cache('~/.http') def get(url): return requests.get(url, auth = ('username', 'password')) The args and kwargs get passed to the Vlermv with some sl...
keyword[def] identifier[memoize] ( identifier[Class] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[def] identifier[decorator] ( identifier[func] ): keyword[if] identifier[len] ( identifier[args] )== literal[int] : keyword[if] identifier[hasat...
def memoize(Class, *args, **kwargs): """ Memoize/record a function inside this vlermv. :: @Vlermv.cache('~/.http') def get(url): return requests.get(url, auth = ('username', 'password')) The args and kwargs get passed to the Vlermv with some slight changes. ...
def fetchone(self): """Fetch next row""" self._check_executed() row = self.read_next() if row is None: return None self.rownumber += 1 return row
def function[fetchone, parameter[self]]: constant[Fetch next row] call[name[self]._check_executed, parameter[]] variable[row] assign[=] call[name[self].read_next, parameter[]] if compare[name[row] is constant[None]] begin[:] return[constant[None]] <ast.AugAssign object at 0x7...
keyword[def] identifier[fetchone] ( identifier[self] ): literal[string] identifier[self] . identifier[_check_executed] () identifier[row] = identifier[self] . identifier[read_next] () keyword[if] identifier[row] keyword[is] keyword[None] : keyword[return] keyword[...
def fetchone(self): """Fetch next row""" self._check_executed() row = self.read_next() if row is None: return None # depends on [control=['if'], data=[]] self.rownumber += 1 return row
def user_login(self, email=None, password=None): """Login with email, password and get back a session cookie :type email: str :param email: The email used for authentication :type password: str :param password: The password used for authentication """ self._rpc...
def function[user_login, parameter[self, email, password]]: constant[Login with email, password and get back a session cookie :type email: str :param email: The email used for authentication :type password: str :param password: The password used for authentication ] ...
keyword[def] identifier[user_login] ( identifier[self] , identifier[email] = keyword[None] , identifier[password] = keyword[None] ): literal[string] identifier[self] . identifier[_rpc_api] = identifier[PiazzaRPC] () identifier[self] . identifier[_rpc_api] . identifier[user_login] ( identif...
def user_login(self, email=None, password=None): """Login with email, password and get back a session cookie :type email: str :param email: The email used for authentication :type password: str :param password: The password used for authentication """ self._rpc_api = P...
def init_sqlite_db(path, initTime=False): """ Initialize SQLite Database Args: path(str): Path to database (Ex. '/home/username/my_sqlite.db'). initTime(Optional[bool]): If True, it will print the amount of time to generate database. Example:: from gsshapy.lib.db_tools...
def function[init_sqlite_db, parameter[path, initTime]]: constant[ Initialize SQLite Database Args: path(str): Path to database (Ex. '/home/username/my_sqlite.db'). initTime(Optional[bool]): If True, it will print the amount of time to generate database. Example:: ...
keyword[def] identifier[init_sqlite_db] ( identifier[path] , identifier[initTime] = keyword[False] ): literal[string] identifier[sqlite_base_url] = literal[string] identifier[sqlalchemy_url] = identifier[sqlite_base_url] + identifier[path] identifier[init_time] = identifier[init_db] ( identif...
def init_sqlite_db(path, initTime=False): """ Initialize SQLite Database Args: path(str): Path to database (Ex. '/home/username/my_sqlite.db'). initTime(Optional[bool]): If True, it will print the amount of time to generate database. Example:: from gsshapy.lib.db_tools...
def create_output_directories(self): """Create output directories for thumbnails and original images.""" check_or_create_dir(self.dst_path) if self.medias: check_or_create_dir(join(self.dst_path, self.settings['thumb_dir'])) if self.medi...
def function[create_output_directories, parameter[self]]: constant[Create output directories for thumbnails and original images.] call[name[check_or_create_dir], parameter[name[self].dst_path]] if name[self].medias begin[:] call[name[check_or_create_dir], parameter[call[name[join...
keyword[def] identifier[create_output_directories] ( identifier[self] ): literal[string] identifier[check_or_create_dir] ( identifier[self] . identifier[dst_path] ) keyword[if] identifier[self] . identifier[medias] : identifier[check_or_create_dir] ( identifier[join] ( ident...
def create_output_directories(self): """Create output directories for thumbnails and original images.""" check_or_create_dir(self.dst_path) if self.medias: check_or_create_dir(join(self.dst_path, self.settings['thumb_dir'])) # depends on [control=['if'], data=[]] if self.medias and self.setting...
def pop_fw_local(self, tenant_id, net_id, direc, node_ip): """Populate the local cache. Read the Network DB and populate the local cache. Read the subnet from the Subnet DB, given the net_id and populate the cache. """ net = self.get_network(net_id) serv_obj = se...
def function[pop_fw_local, parameter[self, tenant_id, net_id, direc, node_ip]]: constant[Populate the local cache. Read the Network DB and populate the local cache. Read the subnet from the Subnet DB, given the net_id and populate the cache. ] variable[net] assign[=] cal...
keyword[def] identifier[pop_fw_local] ( identifier[self] , identifier[tenant_id] , identifier[net_id] , identifier[direc] , identifier[node_ip] ): literal[string] identifier[net] = identifier[self] . identifier[get_network] ( identifier[net_id] ) identifier[serv_obj] = identifier[self] . i...
def pop_fw_local(self, tenant_id, net_id, direc, node_ip): """Populate the local cache. Read the Network DB and populate the local cache. Read the subnet from the Subnet DB, given the net_id and populate the cache. """ net = self.get_network(net_id) serv_obj = self.get_servi...
def get_machine_stats(self): ''' Gather spider based stats ''' self.logger.debug("Gathering machine stats") the_dict = {} keys = self.redis_conn.keys('stats:crawler:*:*:*:*') for key in keys: # break down key elements = key.split(":") ...
def function[get_machine_stats, parameter[self]]: constant[ Gather spider based stats ] call[name[self].logger.debug, parameter[constant[Gathering machine stats]]] variable[the_dict] assign[=] dictionary[[], []] variable[keys] assign[=] call[name[self].redis_conn.keys, pa...
keyword[def] identifier[get_machine_stats] ( identifier[self] ): literal[string] identifier[self] . identifier[logger] . identifier[debug] ( literal[string] ) identifier[the_dict] ={} identifier[keys] = identifier[self] . identifier[redis_conn] . identifier[keys] ( literal[string]...
def get_machine_stats(self): """ Gather spider based stats """ self.logger.debug('Gathering machine stats') the_dict = {} keys = self.redis_conn.keys('stats:crawler:*:*:*:*') for key in keys: # break down key elements = key.split(':') machine = elements[2] ...
def remove_sort(self, field_name): """ Clears sorting criteria affecting ``field_name``. """ self.sorts = [dict(field=value) for field, value in self.sorts if field is not field_name]
def function[remove_sort, parameter[self, field_name]]: constant[ Clears sorting criteria affecting ``field_name``. ] name[self].sorts assign[=] <ast.ListComp object at 0x7da204620670>
keyword[def] identifier[remove_sort] ( identifier[self] , identifier[field_name] ): literal[string] identifier[self] . identifier[sorts] =[ identifier[dict] ( identifier[field] = identifier[value] ) keyword[for] identifier[field] , identifier[value] keyword[in] identifier[self] . identifier[sort...
def remove_sort(self, field_name): """ Clears sorting criteria affecting ``field_name``. """ self.sorts = [dict(field=value) for (field, value) in self.sorts if field is not field_name]
def handleStatus(self, version, code, message): "extends handleStatus to instantiate a local response object" proxy.ProxyClient.handleStatus(self, version, code, message) # client.Response is currently just a container for needed data self._response = client.Response(version, code, messa...
def function[handleStatus, parameter[self, version, code, message]]: constant[extends handleStatus to instantiate a local response object] call[name[proxy].ProxyClient.handleStatus, parameter[name[self], name[version], name[code], name[message]]] name[self]._response assign[=] call[name[client]....
keyword[def] identifier[handleStatus] ( identifier[self] , identifier[version] , identifier[code] , identifier[message] ): literal[string] identifier[proxy] . identifier[ProxyClient] . identifier[handleStatus] ( identifier[self] , identifier[version] , identifier[code] , identifier[message] ) ...
def handleStatus(self, version, code, message): """extends handleStatus to instantiate a local response object""" proxy.ProxyClient.handleStatus(self, version, code, message) # client.Response is currently just a container for needed data self._response = client.Response(version, code, message, {}, None...
def extract_optional_location_root_info(ir_blocks): """Construct a mapping from locations within @optional to their correspoding optional Traverse. Args: ir_blocks: list of IR blocks to extract optional data from Returns: tuple (complex_optional_roots, location_to_optional_roots): ...
def function[extract_optional_location_root_info, parameter[ir_blocks]]: constant[Construct a mapping from locations within @optional to their correspoding optional Traverse. Args: ir_blocks: list of IR blocks to extract optional data from Returns: tuple (complex_optional_roots, locati...
keyword[def] identifier[extract_optional_location_root_info] ( identifier[ir_blocks] ): literal[string] identifier[complex_optional_roots] =[] identifier[location_to_optional_roots] = identifier[dict] () identifier[in_optional_root_locations] =[] identifier[encounte...
def extract_optional_location_root_info(ir_blocks): """Construct a mapping from locations within @optional to their correspoding optional Traverse. Args: ir_blocks: list of IR blocks to extract optional data from Returns: tuple (complex_optional_roots, location_to_optional_roots): ...
def _wrap_type_instantiation(self, type_cls): """Wrap the creation of the type so that we can provide a null-stream to initialize it""" def wrapper(*args, **kwargs): # use args for struct arguments?? return type_cls(stream=self._null_stream) return wrapper
def function[_wrap_type_instantiation, parameter[self, type_cls]]: constant[Wrap the creation of the type so that we can provide a null-stream to initialize it] def function[wrapper, parameter[]]: return[call[name[type_cls], parameter[]]] return[name[wrapper]]
keyword[def] identifier[_wrap_type_instantiation] ( identifier[self] , identifier[type_cls] ): literal[string] keyword[def] identifier[wrapper] (* identifier[args] ,** identifier[kwargs] ): keyword[return] identifier[type_cls] ( identifier[stream] = identifier[self] . identi...
def _wrap_type_instantiation(self, type_cls): """Wrap the creation of the type so that we can provide a null-stream to initialize it""" def wrapper(*args, **kwargs): # use args for struct arguments?? return type_cls(stream=self._null_stream) return wrapper
def _populate_audio_file(self): """ Create the ``self.audio_file`` object by reading the audio file at ``self.audio_file_path_absolute``. """ self.log(u"Populate audio file...") if self.audio_file_path_absolute is not None: self.log([u"audio_file_path_absolute...
def function[_populate_audio_file, parameter[self]]: constant[ Create the ``self.audio_file`` object by reading the audio file at ``self.audio_file_path_absolute``. ] call[name[self].log, parameter[constant[Populate audio file...]]] if compare[name[self].audio_file_path_a...
keyword[def] identifier[_populate_audio_file] ( identifier[self] ): literal[string] identifier[self] . identifier[log] ( literal[string] ) keyword[if] identifier[self] . identifier[audio_file_path_absolute] keyword[is] keyword[not] keyword[None] : identifier[self] . identi...
def _populate_audio_file(self): """ Create the ``self.audio_file`` object by reading the audio file at ``self.audio_file_path_absolute``. """ self.log(u'Populate audio file...') if self.audio_file_path_absolute is not None: self.log([u"audio_file_path_absolute is '%s'", self....
def visit_ExceptHandler(self, node): """OUT = body's, RAISES = body's""" currs = (node,) raises = () for n in node.body: self.result.add_node(n) for curr in currs: self.result.add_edge(curr, n) currs, nraises = self.visit(n) ...
def function[visit_ExceptHandler, parameter[self, node]]: constant[OUT = body's, RAISES = body's] variable[currs] assign[=] tuple[[<ast.Name object at 0x7da18dc05e40>]] variable[raises] assign[=] tuple[[]] for taget[name[n]] in starred[name[node].body] begin[:] call[name[...
keyword[def] identifier[visit_ExceptHandler] ( identifier[self] , identifier[node] ): literal[string] identifier[currs] =( identifier[node] ,) identifier[raises] =() keyword[for] identifier[n] keyword[in] identifier[node] . identifier[body] : identifier[self] . ide...
def visit_ExceptHandler(self, node): """OUT = body's, RAISES = body's""" currs = (node,) raises = () for n in node.body: self.result.add_node(n) for curr in currs: self.result.add_edge(curr, n) # depends on [control=['for'], data=['curr']] (currs, nraises) = self.vis...
def cylinder_inertia(mass, radius, height, transform=None): """ Return the inertia tensor of a cylinder. Parameters ------------ mass : float Mass of cylinder radius : float Radius of cylinder height : float Height of cylinder transform : (4,4) float Transformati...
def function[cylinder_inertia, parameter[mass, radius, height, transform]]: constant[ Return the inertia tensor of a cylinder. Parameters ------------ mass : float Mass of cylinder radius : float Radius of cylinder height : float Height of cylinder transform : (4,4...
keyword[def] identifier[cylinder_inertia] ( identifier[mass] , identifier[radius] , identifier[height] , identifier[transform] = keyword[None] ): literal[string] identifier[h2] , identifier[r2] = identifier[height] ** literal[int] , identifier[radius] ** literal[int] identifier[diagonal] = identifier...
def cylinder_inertia(mass, radius, height, transform=None): """ Return the inertia tensor of a cylinder. Parameters ------------ mass : float Mass of cylinder radius : float Radius of cylinder height : float Height of cylinder transform : (4,4) float Transformati...
def server(self): """ All in one endpoints. This property is created automaticly if you have implemented all the getters and setters. However, if you are not satisfied with the getter and setter, you can create a validator with :class:`OAuth2RequestValidator`:: clas...
def function[server, parameter[self]]: constant[ All in one endpoints. This property is created automaticly if you have implemented all the getters and setters. However, if you are not satisfied with the getter and setter, you can create a validator with :class:`OAuth2RequestVal...
keyword[def] identifier[server] ( identifier[self] ): literal[string] identifier[expires_in] = identifier[self] . identifier[app] . identifier[config] . identifier[get] ( literal[string] ) identifier[token_generator] = identifier[self] . identifier[app] . identifier[config] . identifier[ge...
def server(self): """ All in one endpoints. This property is created automaticly if you have implemented all the getters and setters. However, if you are not satisfied with the getter and setter, you can create a validator with :class:`OAuth2RequestValidator`:: class My...
def periodogram(self): """An alias to :class:`~spectrum.periodogram.Periodogram` The parameters are extracted from the attributes. Relevant attributes ares :attr:`window`, attr:`sampling`, attr:`NFFT`, attr:`scale_by_freq`, :attr:`detrend`. .. plot:: :width: 80% ...
def function[periodogram, parameter[self]]: constant[An alias to :class:`~spectrum.periodogram.Periodogram` The parameters are extracted from the attributes. Relevant attributes ares :attr:`window`, attr:`sampling`, attr:`NFFT`, attr:`scale_by_freq`, :attr:`detrend`. .. plot:: ...
keyword[def] identifier[periodogram] ( identifier[self] ): literal[string] keyword[from] . identifier[periodogram] keyword[import] identifier[speriodogram] identifier[psd] = identifier[speriodogram] ( identifier[self] . identifier[data] , identifier[window] = identifier[self] . identifi...
def periodogram(self): """An alias to :class:`~spectrum.periodogram.Periodogram` The parameters are extracted from the attributes. Relevant attributes ares :attr:`window`, attr:`sampling`, attr:`NFFT`, attr:`scale_by_freq`, :attr:`detrend`. .. plot:: :width: 80% ...
def full_upload(self, _type, block_num): """ Uploads a full block body from AG. The whole block (including header and footer) is copied into the user buffer. :param block_num: Number of Block """ _buffer = buffer_type() size = c_int(sizeof(_buffer)) ...
def function[full_upload, parameter[self, _type, block_num]]: constant[ Uploads a full block body from AG. The whole block (including header and footer) is copied into the user buffer. :param block_num: Number of Block ] variable[_buffer] assign[=] call[name[buff...
keyword[def] identifier[full_upload] ( identifier[self] , identifier[_type] , identifier[block_num] ): literal[string] identifier[_buffer] = identifier[buffer_type] () identifier[size] = identifier[c_int] ( identifier[sizeof] ( identifier[_buffer] )) identifier[block_type] = ident...
def full_upload(self, _type, block_num): """ Uploads a full block body from AG. The whole block (including header and footer) is copied into the user buffer. :param block_num: Number of Block """ _buffer = buffer_type() size = c_int(sizeof(_buffer)) block_type = ...
def format_name(self): """Formats the media file based on enhanced metadata. The actual name of the file and even the name of the directory structure where the file is to be stored. """ self.formatted_filename = formatter.format_filename( self.series_name, self.seaso...
def function[format_name, parameter[self]]: constant[Formats the media file based on enhanced metadata. The actual name of the file and even the name of the directory structure where the file is to be stored. ] name[self].formatted_filename assign[=] call[name[formatter].format_...
keyword[def] identifier[format_name] ( identifier[self] ): literal[string] identifier[self] . identifier[formatted_filename] = identifier[formatter] . identifier[format_filename] ( identifier[self] . identifier[series_name] , identifier[self] . identifier[season_number] , identifi...
def format_name(self): """Formats the media file based on enhanced metadata. The actual name of the file and even the name of the directory structure where the file is to be stored. """ self.formatted_filename = formatter.format_filename(self.series_name, self.season_number, self.episod...
def find_visible_elements(driver, selector, by=By.CSS_SELECTOR): """ Finds all WebElements that match a selector and are visible. Similar to webdriver.find_elements. @Params driver - the webdriver object (required) selector - the locator that is used to search the DOM (required) by - the met...
def function[find_visible_elements, parameter[driver, selector, by]]: constant[ Finds all WebElements that match a selector and are visible. Similar to webdriver.find_elements. @Params driver - the webdriver object (required) selector - the locator that is used to search the DOM (required) ...
keyword[def] identifier[find_visible_elements] ( identifier[driver] , identifier[selector] , identifier[by] = identifier[By] . identifier[CSS_SELECTOR] ): literal[string] identifier[elements] = identifier[driver] . identifier[find_elements] ( identifier[by] = identifier[by] , identifier[value] = identifier...
def find_visible_elements(driver, selector, by=By.CSS_SELECTOR): """ Finds all WebElements that match a selector and are visible. Similar to webdriver.find_elements. @Params driver - the webdriver object (required) selector - the locator that is used to search the DOM (required) by - the met...
def export_cfg(obj, file_name): """ Exports curves and surfaces in libconfig format. .. note:: Requires `libconf <https://pypi.org/project/libconf/>`_ package. Libconfig format is also used by the `geomdl command-line application <https://github.com/orbingol/geomdl-cli>`_ as a way to input sh...
def function[export_cfg, parameter[obj, file_name]]: constant[ Exports curves and surfaces in libconfig format. .. note:: Requires `libconf <https://pypi.org/project/libconf/>`_ package. Libconfig format is also used by the `geomdl command-line application <https://github.com/orbingol/geomdl-...
keyword[def] identifier[export_cfg] ( identifier[obj] , identifier[file_name] ): literal[string] keyword[def] identifier[callback] ( identifier[data] ): keyword[return] identifier[libconf] . identifier[dumps] ( identifier[data] ) keyword[try] : keyword[import] identifier...
def export_cfg(obj, file_name): """ Exports curves and surfaces in libconfig format. .. note:: Requires `libconf <https://pypi.org/project/libconf/>`_ package. Libconfig format is also used by the `geomdl command-line application <https://github.com/orbingol/geomdl-cli>`_ as a way to input sh...
def create_pathlist(self, initial_pathlist): """ Add to pathlist Python library paths to be skipped from module reloading. """ # Get standard installation paths try: paths = sysconfig.get_paths() standard_paths = [paths['stdlib'], ...
def function[create_pathlist, parameter[self, initial_pathlist]]: constant[ Add to pathlist Python library paths to be skipped from module reloading. ] <ast.Try object at 0x7da18bc71390> <ast.Try object at 0x7da18bc709a0> return[binary_operation[binary_operation[name[initial_...
keyword[def] identifier[create_pathlist] ( identifier[self] , identifier[initial_pathlist] ): literal[string] keyword[try] : identifier[paths] = identifier[sysconfig] . identifier[get_paths] () identifier[standard_paths] =[ identifier[paths] [ literal[string] ], ...
def create_pathlist(self, initial_pathlist): """ Add to pathlist Python library paths to be skipped from module reloading. """ # Get standard installation paths try: paths = sysconfig.get_paths() standard_paths = [paths['stdlib'], paths['purelib'], paths['scripts'], p...
def sync_request(self, command, payload, retry=2): """Request data.""" loop = asyncio.get_event_loop() task = loop.create_task(self.request(command, payload, retry)) return loop.run_until_complete(task)
def function[sync_request, parameter[self, command, payload, retry]]: constant[Request data.] variable[loop] assign[=] call[name[asyncio].get_event_loop, parameter[]] variable[task] assign[=] call[name[loop].create_task, parameter[call[name[self].request, parameter[name[command], name[payload], ...
keyword[def] identifier[sync_request] ( identifier[self] , identifier[command] , identifier[payload] , identifier[retry] = literal[int] ): literal[string] identifier[loop] = identifier[asyncio] . identifier[get_event_loop] () identifier[task] = identifier[loop] . identifier[create_task] ( ...
def sync_request(self, command, payload, retry=2): """Request data.""" loop = asyncio.get_event_loop() task = loop.create_task(self.request(command, payload, retry)) return loop.run_until_complete(task)
def get_partitions( self, schema, table_name, filter=None): """ Returns a list of all partitions in a table. Works only for tables with less than 32767 (java short max val). For subpartitioned table, the number might easily exceed this. >>> hh = HiveMetastoreHook() ...
def function[get_partitions, parameter[self, schema, table_name, filter]]: constant[ Returns a list of all partitions in a table. Works only for tables with less than 32767 (java short max val). For subpartitioned table, the number might easily exceed this. >>> hh = HiveMetastor...
keyword[def] identifier[get_partitions] ( identifier[self] , identifier[schema] , identifier[table_name] , identifier[filter] = keyword[None] ): literal[string] keyword[with] identifier[self] . identifier[metastore] keyword[as] identifier[client] : identifier[table] = identifier[cl...
def get_partitions(self, schema, table_name, filter=None): """ Returns a list of all partitions in a table. Works only for tables with less than 32767 (java short max val). For subpartitioned table, the number might easily exceed this. >>> hh = HiveMetastoreHook() >>> t = 's...
def _format_multirow(self, row, ilevels, i, rows): r""" Check following rows, whether row should be a multirow e.g.: becomes: a & 0 & \multirow{2}{*}{a} & 0 & & 1 & & 1 & b & 0 & \cline{1-2} b & 0 & """ for j in range(ileve...
def function[_format_multirow, parameter[self, row, ilevels, i, rows]]: constant[ Check following rows, whether row should be a multirow e.g.: becomes: a & 0 & \multirow{2}{*}{a} & 0 & & 1 & & 1 & b & 0 & \cline{1-2} b & 0 & ] ...
keyword[def] identifier[_format_multirow] ( identifier[self] , identifier[row] , identifier[ilevels] , identifier[i] , identifier[rows] ): literal[string] keyword[for] identifier[j] keyword[in] identifier[range] ( identifier[ilevels] ): keyword[if] identifier[row] [ identifier[j] ]...
def _format_multirow(self, row, ilevels, i, rows): """ Check following rows, whether row should be a multirow e.g.: becomes: a & 0 & \\multirow{2}{*}{a} & 0 & & 1 & & 1 & b & 0 & \\cline{1-2} b & 0 & """ for j in range(ilevels): ...
def record_event(self, event: Event) -> None: """ Record the event async. """ from polyaxon.celery_api import celery_app from polyaxon.settings import EventsCeleryTasks if not event.ref_id: event.ref_id = self.get_ref_id() serialized_event = event.ser...
def function[record_event, parameter[self, event]]: constant[ Record the event async. ] from relative_module[polyaxon.celery_api] import module[celery_app] from relative_module[polyaxon.settings] import module[EventsCeleryTasks] if <ast.UnaryOp object at 0x7da20c991780> begin[:] ...
keyword[def] identifier[record_event] ( identifier[self] , identifier[event] : identifier[Event] )-> keyword[None] : literal[string] keyword[from] identifier[polyaxon] . identifier[celery_api] keyword[import] identifier[celery_app] keyword[from] identifier[polyaxon] . identifier[setti...
def record_event(self, event: Event) -> None: """ Record the event async. """ from polyaxon.celery_api import celery_app from polyaxon.settings import EventsCeleryTasks if not event.ref_id: event.ref_id = self.get_ref_id() # depends on [control=['if'], data=[]] serialized_ev...
def registerFunction(self, name, f, returnType=None): """An alias for :func:`spark.udf.register`. See :meth:`pyspark.sql.UDFRegistration.register`. .. note:: Deprecated in 2.3.0. Use :func:`spark.udf.register` instead. """ warnings.warn( "Deprecated in 2.3.0. Use spa...
def function[registerFunction, parameter[self, name, f, returnType]]: constant[An alias for :func:`spark.udf.register`. See :meth:`pyspark.sql.UDFRegistration.register`. .. note:: Deprecated in 2.3.0. Use :func:`spark.udf.register` instead. ] call[name[warnings].warn, parameter[...
keyword[def] identifier[registerFunction] ( identifier[self] , identifier[name] , identifier[f] , identifier[returnType] = keyword[None] ): literal[string] identifier[warnings] . identifier[warn] ( literal[string] , identifier[DeprecationWarning] ) keyword[return] identi...
def registerFunction(self, name, f, returnType=None): """An alias for :func:`spark.udf.register`. See :meth:`pyspark.sql.UDFRegistration.register`. .. note:: Deprecated in 2.3.0. Use :func:`spark.udf.register` instead. """ warnings.warn('Deprecated in 2.3.0. Use spark.udf.register inste...
def removeItem( self ): """ Removes the item from the menu. """ item = self.uiMenuTREE.currentItem() if ( not item ): return opts = QMessageBox.Yes | QMessageBox.No answer = QMessageBox.question( self, 'R...
def function[removeItem, parameter[self]]: constant[ Removes the item from the menu. ] variable[item] assign[=] call[name[self].uiMenuTREE.currentItem, parameter[]] if <ast.UnaryOp object at 0x7da1b253a620> begin[:] return[None] variable[opts] assign[=] binary_ope...
keyword[def] identifier[removeItem] ( identifier[self] ): literal[string] identifier[item] = identifier[self] . identifier[uiMenuTREE] . identifier[currentItem] () keyword[if] ( keyword[not] identifier[item] ): keyword[return] identifier[opts] = identifier[QMessage...
def removeItem(self): """ Removes the item from the menu. """ item = self.uiMenuTREE.currentItem() if not item: return # depends on [control=['if'], data=[]] opts = QMessageBox.Yes | QMessageBox.No answer = QMessageBox.question(self, 'Remove Item', 'Are you sure you want to ...
def update_user(self, user_id, roles=None, netmask=None, secret=None, pubkey=None): """Update user. Returns the raw response object. Arguments: user_id: User id of user to update roles: Role netm...
def function[update_user, parameter[self, user_id, roles, netmask, secret, pubkey]]: constant[Update user. Returns the raw response object. Arguments: user_id: User id of user to update roles: Role netmask: Limit user c...
keyword[def] identifier[update_user] ( identifier[self] , identifier[user_id] , identifier[roles] = keyword[None] , identifier[netmask] = keyword[None] , identifier[secret] = keyword[None] , identifier[pubkey] = keyword[None] ): literal[string] identifier[arguments] ={ literal[string] : identifie...
def update_user(self, user_id, roles=None, netmask=None, secret=None, pubkey=None): """Update user. Returns the raw response object. Arguments: user_id: User id of user to update roles: Role netmask: Limit user connections ...
def drop_primary_key(self, table): """Drop a Primary Key constraint for a specific table.""" if self.get_primary_key(table): self.execute('ALTER TABLE {0} DROP PRIMARY KEY'.format(wrap(table)))
def function[drop_primary_key, parameter[self, table]]: constant[Drop a Primary Key constraint for a specific table.] if call[name[self].get_primary_key, parameter[name[table]]] begin[:] call[name[self].execute, parameter[call[constant[ALTER TABLE {0} DROP PRIMARY KEY].format, parameter[...
keyword[def] identifier[drop_primary_key] ( identifier[self] , identifier[table] ): literal[string] keyword[if] identifier[self] . identifier[get_primary_key] ( identifier[table] ): identifier[self] . identifier[execute] ( literal[string] . identifier[format] ( identifier[wrap] ( iden...
def drop_primary_key(self, table): """Drop a Primary Key constraint for a specific table.""" if self.get_primary_key(table): self.execute('ALTER TABLE {0} DROP PRIMARY KEY'.format(wrap(table))) # depends on [control=['if'], data=[]]
def _permute_aux_specs(self): """Generate all permutations of the non-core specifications.""" # Convert to attr names that Calc is expecting. calc_aux_mapping = self._NAMES_SUITE_TO_CALC.copy() # Special case: manually add 'library' to mapping calc_aux_mapping[_OBJ_LIB_STR] = Non...
def function[_permute_aux_specs, parameter[self]]: constant[Generate all permutations of the non-core specifications.] variable[calc_aux_mapping] assign[=] call[name[self]._NAMES_SUITE_TO_CALC.copy, parameter[]] call[name[calc_aux_mapping]][name[_OBJ_LIB_STR]] assign[=] constant[None] <a...
keyword[def] identifier[_permute_aux_specs] ( identifier[self] ): literal[string] identifier[calc_aux_mapping] = identifier[self] . identifier[_NAMES_SUITE_TO_CALC] . identifier[copy] () identifier[calc_aux_mapping] [ identifier[_OBJ_LIB_STR] ]= keyword[None] [ i...
def _permute_aux_specs(self): """Generate all permutations of the non-core specifications.""" # Convert to attr names that Calc is expecting. calc_aux_mapping = self._NAMES_SUITE_TO_CALC.copy() # Special case: manually add 'library' to mapping calc_aux_mapping[_OBJ_LIB_STR] = None [calc_aux_mapp...
def ServerLoggingStartupInit(): """Initialize the server logging configuration.""" global LOGGER if local_log: logging.debug("Using local LogInit from %s", local_log) local_log.LogInit() logging.debug("Using local AppLogInit from %s", local_log) LOGGER = local_log.AppLogInit() else: LogInit(...
def function[ServerLoggingStartupInit, parameter[]]: constant[Initialize the server logging configuration.] <ast.Global object at 0x7da18dc078e0> if name[local_log] begin[:] call[name[logging].debug, parameter[constant[Using local LogInit from %s], name[local_log]]] c...
keyword[def] identifier[ServerLoggingStartupInit] (): literal[string] keyword[global] identifier[LOGGER] keyword[if] identifier[local_log] : identifier[logging] . identifier[debug] ( literal[string] , identifier[local_log] ) identifier[local_log] . identifier[LogInit] () identifier[logging...
def ServerLoggingStartupInit(): """Initialize the server logging configuration.""" global LOGGER if local_log: logging.debug('Using local LogInit from %s', local_log) local_log.LogInit() logging.debug('Using local AppLogInit from %s', local_log) LOGGER = local_log.AppLogInit(...