code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def _unkown_type(self, uridecodebin, decodebin, caps): """The callback for decodebin's "unknown-type" signal. """ # This is called *before* the stream becomes ready when the # file can't be read. streaminfo = caps.to_string() if not streaminfo.startswith('audio/'): ...
def function[_unkown_type, parameter[self, uridecodebin, decodebin, caps]]: constant[The callback for decodebin's "unknown-type" signal. ] variable[streaminfo] assign[=] call[name[caps].to_string, parameter[]] if <ast.UnaryOp object at 0x7da20c6a9840> begin[:] return[None] ...
keyword[def] identifier[_unkown_type] ( identifier[self] , identifier[uridecodebin] , identifier[decodebin] , identifier[caps] ): literal[string] identifier[streaminfo] = identifier[caps] . identifier[to_string] () keyword[if] keyword[not] identifier[streaminfo] . ident...
def _unkown_type(self, uridecodebin, decodebin, caps): """The callback for decodebin's "unknown-type" signal. """ # This is called *before* the stream becomes ready when the # file can't be read. streaminfo = caps.to_string() if not streaminfo.startswith('audio/'): # Ignore non-audio...
def _table_line(args): """Implements the BigQuery table magic used to display tables. The supported syntax is: %bigquery table -t|--table <name> <other args> Args: args: the arguments following '%bigquery table'. Returns: The HTML rendering for the table. """ # TODO(gram): It would be good to ...
def function[_table_line, parameter[args]]: constant[Implements the BigQuery table magic used to display tables. The supported syntax is: %bigquery table -t|--table <name> <other args> Args: args: the arguments following '%bigquery table'. Returns: The HTML rendering for the table. ] ...
keyword[def] identifier[_table_line] ( identifier[args] ): literal[string] identifier[name] = identifier[args] [ literal[string] ] identifier[table] = identifier[_get_table] ( identifier[name] ) keyword[if] identifier[table] keyword[and] identifier[table] . identifier[exists] (): identifier...
def _table_line(args): """Implements the BigQuery table magic used to display tables. The supported syntax is: %bigquery table -t|--table <name> <other args> Args: args: the arguments following '%bigquery table'. Returns: The HTML rendering for the table. """ # TODO(gram): It would be good...
def refreshCatalogs(self): """ It reindexes the modified catalogs but, while cleanAndRebuildCatalogs recatalogs all objects in the database, this method only reindexes over the already cataloged objects. If a metacolumn is added it refreshes the catalog, if only a new index ...
def function[refreshCatalogs, parameter[self]]: constant[ It reindexes the modified catalogs but, while cleanAndRebuildCatalogs recatalogs all objects in the database, this method only reindexes over the already cataloged objects. If a metacolumn is added it refreshes the catalo...
keyword[def] identifier[refreshCatalogs] ( identifier[self] ): literal[string] identifier[to_refresh] = identifier[self] . identifier[refreshcatalog] [:] identifier[to_reindex] = identifier[self] . identifier[reindexcatalog] . identifier[keys] () identifier[to_reindex] = identifie...
def refreshCatalogs(self): """ It reindexes the modified catalogs but, while cleanAndRebuildCatalogs recatalogs all objects in the database, this method only reindexes over the already cataloged objects. If a metacolumn is added it refreshes the catalog, if only a new index ...
def load_fasttext_format(cls, path, ctx=cpu(), **kwargs): """Create an instance of the class and load weights. Load the weights from the fastText binary format created by https://github.com/facebookresearch/fastText Parameters ---------- path : str Path to t...
def function[load_fasttext_format, parameter[cls, path, ctx]]: constant[Create an instance of the class and load weights. Load the weights from the fastText binary format created by https://github.com/facebookresearch/fastText Parameters ---------- path : str ...
keyword[def] identifier[load_fasttext_format] ( identifier[cls] , identifier[path] , identifier[ctx] = identifier[cpu] (),** identifier[kwargs] ): literal[string] keyword[with] identifier[open] ( identifier[path] , literal[string] ) keyword[as] identifier[f] : identifier[new_format] ...
def load_fasttext_format(cls, path, ctx=cpu(), **kwargs): """Create an instance of the class and load weights. Load the weights from the fastText binary format created by https://github.com/facebookresearch/fastText Parameters ---------- path : str Path to the ....
def _get_param(self, param, allowed_values=None, optional=False): """Get parameter in GET request.""" request_params = self._request_params() if param in request_params: value = request_params[param].lower() if allowed_values is not None: if value in allow...
def function[_get_param, parameter[self, param, allowed_values, optional]]: constant[Get parameter in GET request.] variable[request_params] assign[=] call[name[self]._request_params, parameter[]] if compare[name[param] in name[request_params]] begin[:] variable[value] assign[=] ...
keyword[def] identifier[_get_param] ( identifier[self] , identifier[param] , identifier[allowed_values] = keyword[None] , identifier[optional] = keyword[False] ): literal[string] identifier[request_params] = identifier[self] . identifier[_request_params] () keyword[if] identifier[param] ...
def _get_param(self, param, allowed_values=None, optional=False): """Get parameter in GET request.""" request_params = self._request_params() if param in request_params: value = request_params[param].lower() if allowed_values is not None: if value in allowed_values: ...
def validate_collections(self, model, context=None): """ Validate collection properties Performs validation on collection properties to return a result object. :param model: object or dict :param context: object, dict or None :return: shiftschema.result.Result ""...
def function[validate_collections, parameter[self, model, context]]: constant[ Validate collection properties Performs validation on collection properties to return a result object. :param model: object or dict :param context: object, dict or None :return: shiftschema.re...
keyword[def] identifier[validate_collections] ( identifier[self] , identifier[model] , identifier[context] = keyword[None] ): literal[string] identifier[result] = identifier[Result] () keyword[for] identifier[property_name] keyword[in] identifier[self] . identifier[collections] : ...
def validate_collections(self, model, context=None): """ Validate collection properties Performs validation on collection properties to return a result object. :param model: object or dict :param context: object, dict or None :return: shiftschema.result.Result """ ...
def DeleteOldRuns(self, job, cutoff_timestamp=None, token=None): """Deletes flows initiated by the job that are older than specified.""" if cutoff_timestamp is None: raise ValueError("cutoff_timestamp can't be None") child_flows = list(job.ListChildren(age=cutoff_timestamp)) with queue_manager.Qu...
def function[DeleteOldRuns, parameter[self, job, cutoff_timestamp, token]]: constant[Deletes flows initiated by the job that are older than specified.] if compare[name[cutoff_timestamp] is constant[None]] begin[:] <ast.Raise object at 0x7da1b1c3d480> variable[child_flows] assign[=] call[...
keyword[def] identifier[DeleteOldRuns] ( identifier[self] , identifier[job] , identifier[cutoff_timestamp] = keyword[None] , identifier[token] = keyword[None] ): literal[string] keyword[if] identifier[cutoff_timestamp] keyword[is] keyword[None] : keyword[raise] identifier[ValueError] ( literal[s...
def DeleteOldRuns(self, job, cutoff_timestamp=None, token=None): """Deletes flows initiated by the job that are older than specified.""" if cutoff_timestamp is None: raise ValueError("cutoff_timestamp can't be None") # depends on [control=['if'], data=[]] child_flows = list(job.ListChildren(age=cut...
def commit(self): """Commit mutations to the database. :rtype: datetime :returns: timestamp of the committed changes. :raises ValueError: if there are no mutations to commit. """ self._check_state() database = self._session._database api = database.spann...
def function[commit, parameter[self]]: constant[Commit mutations to the database. :rtype: datetime :returns: timestamp of the committed changes. :raises ValueError: if there are no mutations to commit. ] call[name[self]._check_state, parameter[]] variable[databas...
keyword[def] identifier[commit] ( identifier[self] ): literal[string] identifier[self] . identifier[_check_state] () identifier[database] = identifier[self] . identifier[_session] . identifier[_database] identifier[api] = identifier[database] . identifier[spanner_api] ...
def commit(self): """Commit mutations to the database. :rtype: datetime :returns: timestamp of the committed changes. :raises ValueError: if there are no mutations to commit. """ self._check_state() database = self._session._database api = database.spanner_api metada...
def get_descriptor_for_layer(self, layer): """ Returns the standard JSON descriptor for the layer. There is a lot of usefule information in there. """ if not layer in self._layer_descriptor_cache: params = {'f': 'pjson'} if self.token: para...
def function[get_descriptor_for_layer, parameter[self, layer]]: constant[ Returns the standard JSON descriptor for the layer. There is a lot of usefule information in there. ] if <ast.UnaryOp object at 0x7da18eb56260> begin[:] variable[params] assign[=] dictionary...
keyword[def] identifier[get_descriptor_for_layer] ( identifier[self] , identifier[layer] ): literal[string] keyword[if] keyword[not] identifier[layer] keyword[in] identifier[self] . identifier[_layer_descriptor_cache] : identifier[params] ={ literal[string] : literal[string] } ...
def get_descriptor_for_layer(self, layer): """ Returns the standard JSON descriptor for the layer. There is a lot of usefule information in there. """ if not layer in self._layer_descriptor_cache: params = {'f': 'pjson'} if self.token: params['token'] = self.t...
def gid(self): """Return the group id that the daemon will run with :rtype: int """ if not self._gid: if self.controller.config.daemon.group: self._gid = grp.getgrnam(self.config.daemon.group).gr_gid else: self._gid = os.getgid() ...
def function[gid, parameter[self]]: constant[Return the group id that the daemon will run with :rtype: int ] if <ast.UnaryOp object at 0x7da18fe938b0> begin[:] if name[self].controller.config.daemon.group begin[:] name[self]._gid assign[=] call[n...
keyword[def] identifier[gid] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_gid] : keyword[if] identifier[self] . identifier[controller] . identifier[config] . identifier[daemon] . identifier[group] : identifier[self] ....
def gid(self): """Return the group id that the daemon will run with :rtype: int """ if not self._gid: if self.controller.config.daemon.group: self._gid = grp.getgrnam(self.config.daemon.group).gr_gid # depends on [control=['if'], data=[]] else: self._gi...
def create(self, alpha_sender): """ Create a new AlphaSenderInstance :param unicode alpha_sender: An Alphanumeric Sender ID string, up to 11 characters. :returns: Newly created AlphaSenderInstance :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance ...
def function[create, parameter[self, alpha_sender]]: constant[ Create a new AlphaSenderInstance :param unicode alpha_sender: An Alphanumeric Sender ID string, up to 11 characters. :returns: Newly created AlphaSenderInstance :rtype: twilio.rest.messaging.v1.service.alpha_sender....
keyword[def] identifier[create] ( identifier[self] , identifier[alpha_sender] ): literal[string] identifier[data] = identifier[values] . identifier[of] ({ literal[string] : identifier[alpha_sender] ,}) identifier[payload] = identifier[self] . identifier[_version] . identifier[create] ( ...
def create(self, alpha_sender): """ Create a new AlphaSenderInstance :param unicode alpha_sender: An Alphanumeric Sender ID string, up to 11 characters. :returns: Newly created AlphaSenderInstance :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance """...
def _filter_matrix_rows(cls, matrix): '''matrix = output from _to_matrix''' indexes_to_keep = [] for i in range(len(matrix)): keep_row = False for element in matrix[i]: if element not in {'NA', 'no'}: keep_row = True ...
def function[_filter_matrix_rows, parameter[cls, matrix]]: constant[matrix = output from _to_matrix] variable[indexes_to_keep] assign[=] list[[]] for taget[name[i]] in starred[call[name[range], parameter[call[name[len], parameter[name[matrix]]]]]] begin[:] variable[keep_row] assi...
keyword[def] identifier[_filter_matrix_rows] ( identifier[cls] , identifier[matrix] ): literal[string] identifier[indexes_to_keep] =[] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[len] ( identifier[matrix] )): identifier[keep_row] = keyword[False] ...
def _filter_matrix_rows(cls, matrix): """matrix = output from _to_matrix""" indexes_to_keep = [] for i in range(len(matrix)): keep_row = False for element in matrix[i]: if element not in {'NA', 'no'}: keep_row = True break # depends on [control=['...
def add_object_to_scope(self, obj): """Add an object to the appropriate scope block. Args: obj: JSSObject to add to scope. Accepted subclasses are: Computer ComputerGroup Building Department Raises: TypeErr...
def function[add_object_to_scope, parameter[self, obj]]: constant[Add an object to the appropriate scope block. Args: obj: JSSObject to add to scope. Accepted subclasses are: Computer ComputerGroup Building Department ...
keyword[def] identifier[add_object_to_scope] ( identifier[self] , identifier[obj] ): literal[string] keyword[if] identifier[isinstance] ( identifier[obj] , identifier[Computer] ): identifier[self] . identifier[add_object_to_path] ( identifier[obj] , literal[string] ) keyword[...
def add_object_to_scope(self, obj): """Add an object to the appropriate scope block. Args: obj: JSSObject to add to scope. Accepted subclasses are: Computer ComputerGroup Building Department Raises: TypeError i...
def urandom(*args: Any, **kwargs: Any) -> bytes: """Return a bytes object containing random bytes. :return: Bytes. """ return os.urandom(*args, **kwargs)
def function[urandom, parameter[]]: constant[Return a bytes object containing random bytes. :return: Bytes. ] return[call[name[os].urandom, parameter[<ast.Starred object at 0x7da18f58ec50>]]]
keyword[def] identifier[urandom] (* identifier[args] : identifier[Any] ,** identifier[kwargs] : identifier[Any] )-> identifier[bytes] : literal[string] keyword[return] identifier[os] . identifier[urandom] (* identifier[args] ,** identifier[kwargs] )
def urandom(*args: Any, **kwargs: Any) -> bytes: """Return a bytes object containing random bytes. :return: Bytes. """ return os.urandom(*args, **kwargs)
def are_connected(self, body_a, body_b): '''Determine whether the given bodies are currently connected. Parameters ---------- body_a : str or :class:`Body` One body to test for connectedness. If this is a string, it is treated as the name of a body to look up. ...
def function[are_connected, parameter[self, body_a, body_b]]: constant[Determine whether the given bodies are currently connected. Parameters ---------- body_a : str or :class:`Body` One body to test for connectedness. If this is a string, it is treated as the na...
keyword[def] identifier[are_connected] ( identifier[self] , identifier[body_a] , identifier[body_b] ): literal[string] keyword[return] identifier[bool] ( identifier[ode] . identifier[areConnected] ( identifier[self] . identifier[get_body] ( identifier[body_a] ). identifier[ode_body] , ...
def are_connected(self, body_a, body_b): """Determine whether the given bodies are currently connected. Parameters ---------- body_a : str or :class:`Body` One body to test for connectedness. If this is a string, it is treated as the name of a body to look up. ...
def MAFFT(sequences, gap_open=1.53, gap_extension=0.0, retree=2): '''A Coral wrapper for the MAFFT command line multiple sequence aligner. :param sequences: A list of sequences to align. :type sequences: List of homogeneous sequences (all DNA, or all RNA, etc.) :param gap_open: --o...
def function[MAFFT, parameter[sequences, gap_open, gap_extension, retree]]: constant[A Coral wrapper for the MAFFT command line multiple sequence aligner. :param sequences: A list of sequences to align. :type sequences: List of homogeneous sequences (all DNA, or all RNA, etc.) ...
keyword[def] identifier[MAFFT] ( identifier[sequences] , identifier[gap_open] = literal[int] , identifier[gap_extension] = literal[int] , identifier[retree] = literal[int] ): literal[string] identifier[arguments] =[ literal[string] ] identifier[arguments] +=[ literal[string] , identifier[str] ( identi...
def MAFFT(sequences, gap_open=1.53, gap_extension=0.0, retree=2): """A Coral wrapper for the MAFFT command line multiple sequence aligner. :param sequences: A list of sequences to align. :type sequences: List of homogeneous sequences (all DNA, or all RNA, etc.) :param gap_open: --o...
def build(self, obj=None, queryset=None, push=True): """Build indexes.""" if obj is not None and queryset is not None: raise ValueError( "Only one of 'obj' and 'queryset' parameters can be passed to the build method." ) if obj is not None: if ...
def function[build, parameter[self, obj, queryset, push]]: constant[Build indexes.] if <ast.BoolOp object at 0x7da20e9b38e0> begin[:] <ast.Raise object at 0x7da20e9b2830> if compare[name[obj] is_not constant[None]] begin[:] if compare[name[self].queryset.model not_equal[!...
keyword[def] identifier[build] ( identifier[self] , identifier[obj] = keyword[None] , identifier[queryset] = keyword[None] , identifier[push] = keyword[True] ): literal[string] keyword[if] identifier[obj] keyword[is] keyword[not] keyword[None] keyword[and] identifier[queryset] keyword[is] k...
def build(self, obj=None, queryset=None, push=True): """Build indexes.""" if obj is not None and queryset is not None: raise ValueError("Only one of 'obj' and 'queryset' parameters can be passed to the build method.") # depends on [control=['if'], data=[]] if obj is not None: if self.querys...
def disable_precompute(panel): """Cancel precomputation for `panel`""" task_id = panel['data_source']['precompute']['task_id'] result = scheduler_client.cancel(task_id) if result['status'] != 'success': raise RuntimeError(result.get('reason'))
def function[disable_precompute, parameter[panel]]: constant[Cancel precomputation for `panel`] variable[task_id] assign[=] call[call[call[name[panel]][constant[data_source]]][constant[precompute]]][constant[task_id]] variable[result] assign[=] call[name[scheduler_client].cancel, parameter[name[...
keyword[def] identifier[disable_precompute] ( identifier[panel] ): literal[string] identifier[task_id] = identifier[panel] [ literal[string] ][ literal[string] ][ literal[string] ] identifier[result] = identifier[scheduler_client] . identifier[cancel] ( identifier[task_id] ) keyword[if] identifier[resul...
def disable_precompute(panel): """Cancel precomputation for `panel`""" task_id = panel['data_source']['precompute']['task_id'] result = scheduler_client.cancel(task_id) if result['status'] != 'success': raise RuntimeError(result.get('reason')) # depends on [control=['if'], data=[]]
def generate_simple_call(opcode: int, index: int): """ Generates a simple call, with an index for something. :param opcode: The opcode to generate. :param index: The index to use as an argument. :return: """ bs = b"" # add the opcode bs += opcode.to_bytes(1, byteorder="little") ...
def function[generate_simple_call, parameter[opcode, index]]: constant[ Generates a simple call, with an index for something. :param opcode: The opcode to generate. :param index: The index to use as an argument. :return: ] variable[bs] assign[=] constant[b''] <ast.AugAssign obje...
keyword[def] identifier[generate_simple_call] ( identifier[opcode] : identifier[int] , identifier[index] : identifier[int] ): literal[string] identifier[bs] = literal[string] identifier[bs] += identifier[opcode] . identifier[to_bytes] ( literal[int] , identifier[byteorder] = literal[string] ) ...
def generate_simple_call(opcode: int, index: int): """ Generates a simple call, with an index for something. :param opcode: The opcode to generate. :param index: The index to use as an argument. :return: """ bs = b'' # add the opcode bs += opcode.to_bytes(1, byteorder='little') ...
def Reset(self): ' Reset Axis and set default parameters for H-bridge ' spi.SPI_write(self.CS, [0xC0, 0x60]) # reset # spi.SPI_write(self.CS, [0x14, 0x14]) # Stall Treshold setup # spi.SPI_write(self.CS, [0xFF, 0xFF]) # spi.SPI_write(self.CS, [0x13, 0x13]) # Over Cu...
def function[Reset, parameter[self]]: constant[ Reset Axis and set default parameters for H-bridge ] call[name[spi].SPI_write, parameter[name[self].CS, list[[<ast.Constant object at 0x7da204567e80>, <ast.Constant object at 0x7da204566020>]]]] call[name[spi].SPI_write, parameter[name[self].CS, li...
keyword[def] identifier[Reset] ( identifier[self] ): literal[string] identifier[spi] . identifier[SPI_write] ( identifier[self] . identifier[CS] ,[ literal[int] , literal[int] ]) identifier[spi] . identifier[SPI_write] ( identifier[self] . identifier[CS]...
def Reset(self): """ Reset Axis and set default parameters for H-bridge """ spi.SPI_write(self.CS, [192, 96]) # reset # spi.SPI_write(self.CS, [0x14, 0x14]) # Stall Treshold setup # spi.SPI_write(self.CS, [0xFF, 0xFF]) # spi.SPI_write(self.CS, [0x13, 0x13]) # Over C...
def draw_hsv(mag, ang, dtype=uint8, fn=None): """ mag must be uint8, uint16, uint32 and 2-D ang is in radians (float) """ assert mag.shape == ang.shape assert mag.ndim == 2 maxval = iinfo(dtype).max hsv = dstack(((degrees(ang)/2).astype(dtype), # /2 to keep less than 255 ...
def function[draw_hsv, parameter[mag, ang, dtype, fn]]: constant[ mag must be uint8, uint16, uint32 and 2-D ang is in radians (float) ] assert[compare[name[mag].shape equal[==] name[ang].shape]] assert[compare[name[mag].ndim equal[==] constant[2]]] variable[maxval] assign[=] call[nam...
keyword[def] identifier[draw_hsv] ( identifier[mag] , identifier[ang] , identifier[dtype] = identifier[uint8] , identifier[fn] = keyword[None] ): literal[string] keyword[assert] identifier[mag] . identifier[shape] == identifier[ang] . identifier[shape] keyword[assert] identifier[mag] . identifier[n...
def draw_hsv(mag, ang, dtype=uint8, fn=None): """ mag must be uint8, uint16, uint32 and 2-D ang is in radians (float) """ assert mag.shape == ang.shape assert mag.ndim == 2 maxval = iinfo(dtype).max # /2 to keep less than 255 # maxval must be after in 1-D case hsv = dstack(((degrees...
def compute_triangle_circumcenters(X, ei_dot_ei, ei_dot_ej): """Computes the circumcenters of all given triangles. """ # The input argument are the dot products # # <e1, e2> # <e2, e0> # <e0, e1> # # of the edges # # e0: x1->x2, # e1: x2->x0, # e2: x0->x1....
def function[compute_triangle_circumcenters, parameter[X, ei_dot_ei, ei_dot_ej]]: constant[Computes the circumcenters of all given triangles. ] variable[alpha] assign[=] binary_operation[name[ei_dot_ei] * name[ei_dot_ej]] variable[alpha_sum] assign[=] binary_operation[binary_operation[call[n...
keyword[def] identifier[compute_triangle_circumcenters] ( identifier[X] , identifier[ei_dot_ei] , identifier[ei_dot_ej] ): literal[string] ...
def compute_triangle_circumcenters(X, ei_dot_ei, ei_dot_ej): """Computes the circumcenters of all given triangles. """ # The input argument are the dot products # # <e1, e2> # <e2, e0> # <e0, e1> # # of the edges # # e0: x1->x2, # e1: x2->x0, # e2: x0->x1....
def draw_group_labels(self): """ Renders group labels to the figure. """ for i, label in enumerate(self.groups): label_x = self.group_label_coords["x"][i] label_y = self.group_label_coords["y"][i] label_ha = self.group_label_aligns["has"][i] ...
def function[draw_group_labels, parameter[self]]: constant[ Renders group labels to the figure. ] for taget[tuple[[<ast.Name object at 0x7da1b1d9ab30>, <ast.Name object at 0x7da1b1d9a620>]]] in starred[call[name[enumerate], parameter[name[self].groups]]] begin[:] variable...
keyword[def] identifier[draw_group_labels] ( identifier[self] ): literal[string] keyword[for] identifier[i] , identifier[label] keyword[in] identifier[enumerate] ( identifier[self] . identifier[groups] ): identifier[label_x] = identifier[self] . identifier[group_label_coords] [ lite...
def draw_group_labels(self): """ Renders group labels to the figure. """ for (i, label) in enumerate(self.groups): label_x = self.group_label_coords['x'][i] label_y = self.group_label_coords['y'][i] label_ha = self.group_label_aligns['has'][i] label_va = self.grou...
def inasafe_place_value_coefficient(number, feature, parent): """Given a number, it will return the coefficient of the place value name. For instance: * inasafe_place_value_coefficient(10) -> 1 * inasafe_place_value_coefficient(1700) -> 1.7 It needs to be used with inasafe_number_denomination_un...
def function[inasafe_place_value_coefficient, parameter[number, feature, parent]]: constant[Given a number, it will return the coefficient of the place value name. For instance: * inasafe_place_value_coefficient(10) -> 1 * inasafe_place_value_coefficient(1700) -> 1.7 It needs to be used with...
keyword[def] identifier[inasafe_place_value_coefficient] ( identifier[number] , identifier[feature] , identifier[parent] ): literal[string] identifier[_] = identifier[feature] , identifier[parent] keyword[if] identifier[number] >= literal[int] : identifier[rounded_number] = identifier[roun...
def inasafe_place_value_coefficient(number, feature, parent): """Given a number, it will return the coefficient of the place value name. For instance: * inasafe_place_value_coefficient(10) -> 1 * inasafe_place_value_coefficient(1700) -> 1.7 It needs to be used with inasafe_number_denomination_un...
def _get_public_key_count(self): """Return the count of public keys in the list and embedded.""" index = len(self._public_keys) for authentication in self._authentications: if authentication.is_public_key(): index += 1 return index
def function[_get_public_key_count, parameter[self]]: constant[Return the count of public keys in the list and embedded.] variable[index] assign[=] call[name[len], parameter[name[self]._public_keys]] for taget[name[authentication]] in starred[name[self]._authentications] begin[:] ...
keyword[def] identifier[_get_public_key_count] ( identifier[self] ): literal[string] identifier[index] = identifier[len] ( identifier[self] . identifier[_public_keys] ) keyword[for] identifier[authentication] keyword[in] identifier[self] . identifier[_authentications] : key...
def _get_public_key_count(self): """Return the count of public keys in the list and embedded.""" index = len(self._public_keys) for authentication in self._authentications: if authentication.is_public_key(): index += 1 # depends on [control=['if'], data=[]] # depends on [control=['for'...
async def copy_from_query(self, query, *args, output, timeout=None, format=None, oids=None, delimiter=None, null=None, header=None, quote=None, escape=None, force_quote=None, encoding=None): "...
<ast.AsyncFunctionDef object at 0x7da1b1956ef0>
keyword[async] keyword[def] identifier[copy_from_query] ( identifier[self] , identifier[query] ,* identifier[args] , identifier[output] , identifier[timeout] = keyword[None] , identifier[format] = keyword[None] , identifier[oids] = keyword[None] , identifier[delimiter] = keyword[None] , identifier[null] = keyword[...
async def copy_from_query(self, query, *args, output, timeout=None, format=None, oids=None, delimiter=None, null=None, header=None, quote=None, escape=None, force_quote=None, encoding=None): """Copy the results of a query to a file or file-like object. :param str query: The query to copy the re...
def get_user_id(remote, email): """Get the Globus identity for a users given email. A Globus ID is a UUID that can uniquely identify a Globus user. See the docs here for v2/api/identities https://docs.globus.org/api/auth/reference/ """ try: url = '{}?usernames={}'.format(GLOBUS_USER_ID_...
def function[get_user_id, parameter[remote, email]]: constant[Get the Globus identity for a users given email. A Globus ID is a UUID that can uniquely identify a Globus user. See the docs here for v2/api/identities https://docs.globus.org/api/auth/reference/ ] <ast.Try object at 0x7da18dc98...
keyword[def] identifier[get_user_id] ( identifier[remote] , identifier[email] ): literal[string] keyword[try] : identifier[url] = literal[string] . identifier[format] ( identifier[GLOBUS_USER_ID_URL] , identifier[email] ) identifier[user_id] = identifier[get_dict_from_response] ( identifi...
def get_user_id(remote, email): """Get the Globus identity for a users given email. A Globus ID is a UUID that can uniquely identify a Globus user. See the docs here for v2/api/identities https://docs.globus.org/api/auth/reference/ """ try: url = '{}?usernames={}'.format(GLOBUS_USER_ID_...
def server_poweroff(host=None, admin_username=None, admin_password=None, module=None): ''' Powers down the managed server. host The chassis host. admin_username The username used to access the chassis. admin_password ...
def function[server_poweroff, parameter[host, admin_username, admin_password, module]]: constant[ Powers down the managed server. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. ...
keyword[def] identifier[server_poweroff] ( identifier[host] = keyword[None] , identifier[admin_username] = keyword[None] , identifier[admin_password] = keyword[None] , identifier[module] = keyword[None] ): literal[string] keyword[return] identifier[__execute_cmd] ( literal[string] , identifier[hos...
def server_poweroff(host=None, admin_username=None, admin_password=None, module=None): """ Powers down the managed server. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. module ...
def hmac_md5(s, salt): """ 获取一个字符串的 使用 salt 加密的 hmac MD5 值 :param: * s: (string) 需要进行 hash 的字符串 * salt: (string) 随机字符串 :return: * result: (string) 32位小写 MD5 值 """ hmac_md5 = hmac.new(salt.encode('utf-8'), s.encode('utf-8'), ...
def function[hmac_md5, parameter[s, salt]]: constant[ 获取一个字符串的 使用 salt 加密的 hmac MD5 值 :param: * s: (string) 需要进行 hash 的字符串 * salt: (string) 随机字符串 :return: * result: (string) 32位小写 MD5 值 ] variable[hmac_md5] assign[=] call[call[name[hma...
keyword[def] identifier[hmac_md5] ( identifier[s] , identifier[salt] ): literal[string] identifier[hmac_md5] = identifier[hmac] . identifier[new] ( identifier[salt] . identifier[encode] ( literal[string] ), identifier[s] . identifier[encode] ( literal[string] ), identifier[digestmod] = ide...
def hmac_md5(s, salt): """ 获取一个字符串的 使用 salt 加密的 hmac MD5 值 :param: * s: (string) 需要进行 hash 的字符串 * salt: (string) 随机字符串 :return: * result: (string) 32位小写 MD5 值 """ hmac_md5 = hmac.new(salt.encode('utf-8'), s.encode('utf-8'), digestmod=hashlib.m...
def RestoreTaskStoreFactory(store_class, chunk_size, restore_file, save_file): """ Restores a task store from file. """ intm_results = np.load(restore_file) intm = intm_results[intm_results.files[0]] idx = np.isnan(intm).flatten().nonzero()[0] partitions = math.ceil(len(idx) / float(chunk_si...
def function[RestoreTaskStoreFactory, parameter[store_class, chunk_size, restore_file, save_file]]: constant[ Restores a task store from file. ] variable[intm_results] assign[=] call[name[np].load, parameter[name[restore_file]]] variable[intm] assign[=] call[name[intm_results]][call[name...
keyword[def] identifier[RestoreTaskStoreFactory] ( identifier[store_class] , identifier[chunk_size] , identifier[restore_file] , identifier[save_file] ): literal[string] identifier[intm_results] = identifier[np] . identifier[load] ( identifier[restore_file] ) identifier[intm] = identifier[intm_results...
def RestoreTaskStoreFactory(store_class, chunk_size, restore_file, save_file): """ Restores a task store from file. """ intm_results = np.load(restore_file) intm = intm_results[intm_results.files[0]] idx = np.isnan(intm).flatten().nonzero()[0] partitions = math.ceil(len(idx) / float(chunk_si...
def create_dev_cert(name, dest): """ A command to generate a self signed certificate for dev purposes. :param name: name ro be given to the cert and key :param dest: location on local filesystem to store the generated files :return: """ if not os.path.exists(dest): os.makedirs(dest) ...
def function[create_dev_cert, parameter[name, dest]]: constant[ A command to generate a self signed certificate for dev purposes. :param name: name ro be given to the cert and key :param dest: location on local filesystem to store the generated files :return: ] if <ast.UnaryOp object...
keyword[def] identifier[create_dev_cert] ( identifier[name] , identifier[dest] ): literal[string] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[dest] ): identifier[os] . identifier[makedirs] ( identifier[dest] ) identifier[keygen] . identifier[...
def create_dev_cert(name, dest): """ A command to generate a self signed certificate for dev purposes. :param name: name ro be given to the cert and key :param dest: location on local filesystem to store the generated files :return: """ if not os.path.exists(dest): os.makedirs(dest) ...
def analyze_script(self, index=None): """Analyze current script with todos""" if self.is_analysis_done: return if index is None: index = self.get_stack_index() if self.data: finfo = self.data[index] if self.todolist_enabled: ...
def function[analyze_script, parameter[self, index]]: constant[Analyze current script with todos] if name[self].is_analysis_done begin[:] return[None] if compare[name[index] is constant[None]] begin[:] variable[index] assign[=] call[name[self].get_stack_index, parameter[]...
keyword[def] identifier[analyze_script] ( identifier[self] , identifier[index] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[is_analysis_done] : keyword[return] keyword[if] identifier[index] keyword[is] keyword[None] : iden...
def analyze_script(self, index=None): """Analyze current script with todos""" if self.is_analysis_done: return # depends on [control=['if'], data=[]] if index is None: index = self.get_stack_index() # depends on [control=['if'], data=['index']] if self.data: finfo = self.data[i...
def add_new_observations(self, y, exogenous=None, **kwargs): """Update the endog/exog samples after a model fit. After fitting your model and creating forecasts, you're going to need to attach new samples to the data you fit on. These are used to compute new forecasts (but using the sam...
def function[add_new_observations, parameter[self, y, exogenous]]: constant[Update the endog/exog samples after a model fit. After fitting your model and creating forecasts, you're going to need to attach new samples to the data you fit on. These are used to compute new forecasts (but u...
keyword[def] identifier[add_new_observations] ( identifier[self] , identifier[y] , identifier[exogenous] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[self] . identifier[update] ( identifier[y] , identifier[exogenous] ,** identifier[kwargs] )
def add_new_observations(self, y, exogenous=None, **kwargs): """Update the endog/exog samples after a model fit. After fitting your model and creating forecasts, you're going to need to attach new samples to the data you fit on. These are used to compute new forecasts (but using the same es...
def add_minrmsd_to_ref(self, ref, ref_frame=0, atom_indices=None, precentered=False): r""" Adds the minimum root-mean-square-deviation (minrmsd) with respect to a reference structure to the feature list. Parameters ---------- ref: Reference structure for computing th...
def function[add_minrmsd_to_ref, parameter[self, ref, ref_frame, atom_indices, precentered]]: constant[ Adds the minimum root-mean-square-deviation (minrmsd) with respect to a reference structure to the feature list. Parameters ---------- ref: Reference structure for...
keyword[def] identifier[add_minrmsd_to_ref] ( identifier[self] , identifier[ref] , identifier[ref_frame] = literal[int] , identifier[atom_indices] = keyword[None] , identifier[precentered] = keyword[False] ): literal[string] keyword[from] . identifier[misc] keyword[import] identifier[MinRmsdFeatu...
def add_minrmsd_to_ref(self, ref, ref_frame=0, atom_indices=None, precentered=False): """ Adds the minimum root-mean-square-deviation (minrmsd) with respect to a reference structure to the feature list. Parameters ---------- ref: Reference structure for computing the min...
def chain(*args): """Runs a series of parsers in sequence passing the result of each parser to the next. The result of the last parser is returned. """ def chain_block(*args, **kwargs): v = args[0](*args, **kwargs) for p in args[1:]: v = p(v) return v return chain...
def function[chain, parameter[]]: constant[Runs a series of parsers in sequence passing the result of each parser to the next. The result of the last parser is returned. ] def function[chain_block, parameter[]]: variable[v] assign[=] call[call[name[args]][constant[0]], parameter[...
keyword[def] identifier[chain] (* identifier[args] ): literal[string] keyword[def] identifier[chain_block] (* identifier[args] ,** identifier[kwargs] ): identifier[v] = identifier[args] [ literal[int] ](* identifier[args] ,** identifier[kwargs] ) keyword[for] identifier[p] keyword[in] ...
def chain(*args): """Runs a series of parsers in sequence passing the result of each parser to the next. The result of the last parser is returned. """ def chain_block(*args, **kwargs): v = args[0](*args, **kwargs) for p in args[1:]: v = p(v) # depends on [control=['for'], ...
def set_file_chksum(self, doc, chksum): """ Raises OrderError if no package or file defined. Raises CardinalityError if more than one chksum set. """ if self.has_package(doc) and self.has_file(doc): if not self.file_chksum_set: self.file_chksum_set = T...
def function[set_file_chksum, parameter[self, doc, chksum]]: constant[ Raises OrderError if no package or file defined. Raises CardinalityError if more than one chksum set. ] if <ast.BoolOp object at 0x7da1b016ae90> begin[:] if <ast.UnaryOp object at 0x7da1b016b94...
keyword[def] identifier[set_file_chksum] ( identifier[self] , identifier[doc] , identifier[chksum] ): literal[string] keyword[if] identifier[self] . identifier[has_package] ( identifier[doc] ) keyword[and] identifier[self] . identifier[has_file] ( identifier[doc] ): keyword[if] keyw...
def set_file_chksum(self, doc, chksum): """ Raises OrderError if no package or file defined. Raises CardinalityError if more than one chksum set. """ if self.has_package(doc) and self.has_file(doc): if not self.file_chksum_set: self.file_chksum_set = True ...
def get_bank_hierarchy_design_session(self, proxy): """Gets the session designing bank hierarchies. arg: proxy (osid.proxy.Proxy): a proxy return: (osid.assessment.BankHierarchyDesignSession) - a ``BankHierarchySession`` raise: NullArgument - ``proxy`` is ``null`` ...
def function[get_bank_hierarchy_design_session, parameter[self, proxy]]: constant[Gets the session designing bank hierarchies. arg: proxy (osid.proxy.Proxy): a proxy return: (osid.assessment.BankHierarchyDesignSession) - a ``BankHierarchySession`` raise: NullArgument...
keyword[def] identifier[get_bank_hierarchy_design_session] ( identifier[self] , identifier[proxy] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[supports_bank_hierarchy_design] (): keyword[raise] identifier[errors] . identifier[Unimplemented] () ...
def get_bank_hierarchy_design_session(self, proxy): """Gets the session designing bank hierarchies. arg: proxy (osid.proxy.Proxy): a proxy return: (osid.assessment.BankHierarchyDesignSession) - a ``BankHierarchySession`` raise: NullArgument - ``proxy`` is ``null`` ...
def prepare_data(data_dir, fileroot, block_pct_tokens_thresh=0.1): """ Prepare data for a single HTML + gold standard blocks example, uniquely identified by ``fileroot``. Args: data_dir (str) fileroot (str) block_pct_tokens_thresh (float): must be in [0.0, 1.0] Returns: ...
def function[prepare_data, parameter[data_dir, fileroot, block_pct_tokens_thresh]]: constant[ Prepare data for a single HTML + gold standard blocks example, uniquely identified by ``fileroot``. Args: data_dir (str) fileroot (str) block_pct_tokens_thresh (float): must be in [...
keyword[def] identifier[prepare_data] ( identifier[data_dir] , identifier[fileroot] , identifier[block_pct_tokens_thresh] = literal[int] ): literal[string] keyword[if] keyword[not] literal[int] <= identifier[block_pct_tokens_thresh] <= literal[int] : keyword[raise] identifier[ValueError] ( lite...
def prepare_data(data_dir, fileroot, block_pct_tokens_thresh=0.1): """ Prepare data for a single HTML + gold standard blocks example, uniquely identified by ``fileroot``. Args: data_dir (str) fileroot (str) block_pct_tokens_thresh (float): must be in [0.0, 1.0] Returns: ...
def _fetch_items(self, store_load, iterable, args, kwargs): """ Method used by f_store/load/remove_items to find corresponding items in the tree. :param store_load: String constant specifying if we want to store, load or remove. The corresponding constants are defined at the t...
def function[_fetch_items, parameter[self, store_load, iterable, args, kwargs]]: constant[ Method used by f_store/load/remove_items to find corresponding items in the tree. :param store_load: String constant specifying if we want to store, load or remove. The corresponding con...
keyword[def] identifier[_fetch_items] ( identifier[self] , identifier[store_load] , identifier[iterable] , identifier[args] , identifier[kwargs] ): literal[string] identifier[only_empties] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[False] ) identifier[non_empties] ...
def _fetch_items(self, store_load, iterable, args, kwargs): """ Method used by f_store/load/remove_items to find corresponding items in the tree. :param store_load: String constant specifying if we want to store, load or remove. The corresponding constants are defined at the top o...
def matches(self, other): ''' A disjunctive list matches a phoneme if any of its members matches the phoneme. If other is also a disjunctive list, any match between this list and the other returns true. ''' if other is None: return False if isinstance(other, PhonemeDisjunction): return any([ph...
def function[matches, parameter[self, other]]: constant[ A disjunctive list matches a phoneme if any of its members matches the phoneme. If other is also a disjunctive list, any match between this list and the other returns true. ] if compare[name[other] is constant[None]] begin[:] return[...
keyword[def] identifier[matches] ( identifier[self] , identifier[other] ): literal[string] keyword[if] identifier[other] keyword[is] keyword[None] : keyword[return] keyword[False] keyword[if] identifier[isinstance] ( identifier[other] , identifier[PhonemeDisjunction] ): keyword[return] i...
def matches(self, other): """ A disjunctive list matches a phoneme if any of its members matches the phoneme. If other is also a disjunctive list, any match between this list and the other returns true. """ if other is None: return False # depends on [control=['if'], data=[]] if isinstance(ot...
def prefix_shared_name_attributes(meta_graph, absolute_import_scope): """In-place prefixes shared_name attributes of nodes.""" shared_name_attr = "shared_name" for node in meta_graph.graph_def.node: shared_name_value = node.attr.get(shared_name_attr, None) if shared_name_value and shared_name_value.HasFie...
def function[prefix_shared_name_attributes, parameter[meta_graph, absolute_import_scope]]: constant[In-place prefixes shared_name attributes of nodes.] variable[shared_name_attr] assign[=] constant[shared_name] for taget[name[node]] in starred[name[meta_graph].graph_def.node] begin[:] ...
keyword[def] identifier[prefix_shared_name_attributes] ( identifier[meta_graph] , identifier[absolute_import_scope] ): literal[string] identifier[shared_name_attr] = literal[string] keyword[for] identifier[node] keyword[in] identifier[meta_graph] . identifier[graph_def] . identifier[node] : identif...
def prefix_shared_name_attributes(meta_graph, absolute_import_scope): """In-place prefixes shared_name attributes of nodes.""" shared_name_attr = 'shared_name' for node in meta_graph.graph_def.node: shared_name_value = node.attr.get(shared_name_attr, None) if shared_name_value and shared_nam...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the QueryRequestPayload object to a stream. Args: output_buffer (Stream): A data stream in which to encode object data, supporting a write method; usually a Bytearray...
def function[write, parameter[self, output_buffer, kmip_version]]: constant[ Write the data encoding the QueryRequestPayload object to a stream. Args: output_buffer (Stream): A data stream in which to encode object data, supporting a write method; usually a Bytearray...
keyword[def] identifier[write] ( identifier[self] , identifier[output_buffer] , identifier[kmip_version] = identifier[enums] . identifier[KMIPVersion] . identifier[KMIP_1_0] ): literal[string] identifier[local_buffer] = identifier[utils] . identifier[BytearrayStream] () keyword[if] ident...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the QueryRequestPayload object to a stream. Args: output_buffer (Stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStre...
def get_is_group_member(self, grp_name, user): """ Check if the given user is a member of the named group. Note that a group maintainer is not considered a member unless the user is also explicitly added as a member. Args: name (string): Name of group. u...
def function[get_is_group_member, parameter[self, grp_name, user]]: constant[ Check if the given user is a member of the named group. Note that a group maintainer is not considered a member unless the user is also explicitly added as a member. Args: name (string): N...
keyword[def] identifier[get_is_group_member] ( identifier[self] , identifier[grp_name] , identifier[user] ): literal[string] identifier[self] . identifier[project_service] . identifier[set_auth] ( identifier[self] . identifier[_token_project] ) keyword[return] identifier[self] . identifie...
def get_is_group_member(self, grp_name, user): """ Check if the given user is a member of the named group. Note that a group maintainer is not considered a member unless the user is also explicitly added as a member. Args: name (string): Name of group. user_...
def bpp(s,B): """bpp: Martello and Toth's model to solve the bin packing problem. Parameters: - s: list with item widths - B: bin capacity Returns a model, ready to be solved. """ n = len(s) U = len(FFD(s,B)) # upper bound of the number of bins model = Model("bpp") # setP...
def function[bpp, parameter[s, B]]: constant[bpp: Martello and Toth's model to solve the bin packing problem. Parameters: - s: list with item widths - B: bin capacity Returns a model, ready to be solved. ] variable[n] assign[=] call[name[len], parameter[name[s]]] vari...
keyword[def] identifier[bpp] ( identifier[s] , identifier[B] ): literal[string] identifier[n] = identifier[len] ( identifier[s] ) identifier[U] = identifier[len] ( identifier[FFD] ( identifier[s] , identifier[B] )) identifier[model] = identifier[Model] ( literal[string] ) identifier[x] ...
def bpp(s, B): """bpp: Martello and Toth's model to solve the bin packing problem. Parameters: - s: list with item widths - B: bin capacity Returns a model, ready to be solved. """ n = len(s) U = len(FFD(s, B)) # upper bound of the number of bins model = Model('bpp') # s...
def build(_resource, _cache=True, **kwargs): """Build a schema from input _resource. :param _resource: object from where get the right schema. :param bool _cache: use cache system. :rtype: Schema. """ return _SCHEMAFACTORY.build(_resource=_resource, _cache=True, **kwargs)
def function[build, parameter[_resource, _cache]]: constant[Build a schema from input _resource. :param _resource: object from where get the right schema. :param bool _cache: use cache system. :rtype: Schema. ] return[call[name[_SCHEMAFACTORY].build, parameter[]]]
keyword[def] identifier[build] ( identifier[_resource] , identifier[_cache] = keyword[True] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[_SCHEMAFACTORY] . identifier[build] ( identifier[_resource] = identifier[_resource] , identifier[_cache] = keyword[True] ,** identifier[kwargs] )
def build(_resource, _cache=True, **kwargs): """Build a schema from input _resource. :param _resource: object from where get the right schema. :param bool _cache: use cache system. :rtype: Schema. """ return _SCHEMAFACTORY.build(_resource=_resource, _cache=True, **kwargs)
def reversible_deroot(self): """ Stores info required to restore rootedness to derooted Tree. Returns the edge that was originally rooted, the length of e1, and the length of e2. Dendropy Derooting Process: In a rooted tree the root node is bifurcating. Derooting makes it ...
def function[reversible_deroot, parameter[self]]: constant[ Stores info required to restore rootedness to derooted Tree. Returns the edge that was originally rooted, the length of e1, and the length of e2. Dendropy Derooting Process: In a rooted tree the root node is bifurcating...
keyword[def] identifier[reversible_deroot] ( identifier[self] ): literal[string] identifier[root_edge] = identifier[self] . identifier[_tree] . identifier[seed_node] . identifier[edge] identifier[lengths] = identifier[dict] ([( identifier[edge] , identifier[edge] . identifier[length] ) ke...
def reversible_deroot(self): """ Stores info required to restore rootedness to derooted Tree. Returns the edge that was originally rooted, the length of e1, and the length of e2. Dendropy Derooting Process: In a rooted tree the root node is bifurcating. Derooting makes it tr...
def prox_unity_plus(X, step, axis=0): """Non-negative projection onto sum=1 along an axis """ return prox_unity(prox_plus(X, step), step, axis=axis)
def function[prox_unity_plus, parameter[X, step, axis]]: constant[Non-negative projection onto sum=1 along an axis ] return[call[name[prox_unity], parameter[call[name[prox_plus], parameter[name[X], name[step]]], name[step]]]]
keyword[def] identifier[prox_unity_plus] ( identifier[X] , identifier[step] , identifier[axis] = literal[int] ): literal[string] keyword[return] identifier[prox_unity] ( identifier[prox_plus] ( identifier[X] , identifier[step] ), identifier[step] , identifier[axis] = identifier[axis] )
def prox_unity_plus(X, step, axis=0): """Non-negative projection onto sum=1 along an axis """ return prox_unity(prox_plus(X, step), step, axis=axis)
def shape(self) -> Tuple[int, int]: """Required shape of |NetCDFVariableAgg.array|. For the default configuration, the first axis corresponds to the number of devices, and the second one to the number of timesteps. We show this for the 1-dimensional input sequence |lland_fluxes.NKor|: ...
def function[shape, parameter[self]]: constant[Required shape of |NetCDFVariableAgg.array|. For the default configuration, the first axis corresponds to the number of devices, and the second one to the number of timesteps. We show this for the 1-dimensional input sequence |lland_fluxes....
keyword[def] identifier[shape] ( identifier[self] )-> identifier[Tuple] [ identifier[int] , identifier[int] ]: literal[string] keyword[return] identifier[self] . identifier[sort_timeplaceentries] ( identifier[len] ( identifier[hydpy] . identifier[pub] . identifier[timegrids] . identifier[...
def shape(self) -> Tuple[int, int]: """Required shape of |NetCDFVariableAgg.array|. For the default configuration, the first axis corresponds to the number of devices, and the second one to the number of timesteps. We show this for the 1-dimensional input sequence |lland_fluxes.NKor|: ...
def get_class_hierarchy(self, base_class): """ Walks up the class hierarchy and returns a list of all classes between base class (inclusive) and java.lang.Object (exclusive). """ classes = [base_class] while classes[-1] is not None and classes[-1] != "java.lang.Object": ...
def function[get_class_hierarchy, parameter[self, base_class]]: constant[ Walks up the class hierarchy and returns a list of all classes between base class (inclusive) and java.lang.Object (exclusive). ] variable[classes] assign[=] list[[<ast.Name object at 0x7da18f00fa60>]] ...
keyword[def] identifier[get_class_hierarchy] ( identifier[self] , identifier[base_class] ): literal[string] identifier[classes] =[ identifier[base_class] ] keyword[while] identifier[classes] [- literal[int] ] keyword[is] keyword[not] keyword[None] keyword[and] identifier[classes] [- l...
def get_class_hierarchy(self, base_class): """ Walks up the class hierarchy and returns a list of all classes between base class (inclusive) and java.lang.Object (exclusive). """ classes = [base_class] while classes[-1] is not None and classes[-1] != 'java.lang.Object': class...
def _verify_jws(self, payload, key): """Verify the given JWS payload with the given key and return the payload""" jws = JWS.from_compact(payload) try: alg = jws.signature.combined.alg.name except KeyError: msg = 'No alg value found in header' raise Su...
def function[_verify_jws, parameter[self, payload, key]]: constant[Verify the given JWS payload with the given key and return the payload] variable[jws] assign[=] call[name[JWS].from_compact, parameter[name[payload]]] <ast.Try object at 0x7da18bc72fe0> if compare[name[alg] not_equal[!=] name...
keyword[def] identifier[_verify_jws] ( identifier[self] , identifier[payload] , identifier[key] ): literal[string] identifier[jws] = identifier[JWS] . identifier[from_compact] ( identifier[payload] ) keyword[try] : identifier[alg] = identifier[jws] . identifier[signature] . i...
def _verify_jws(self, payload, key): """Verify the given JWS payload with the given key and return the payload""" jws = JWS.from_compact(payload) try: alg = jws.signature.combined.alg.name # depends on [control=['try'], data=[]] except KeyError: msg = 'No alg value found in header' ...
def add_external_reference_to_entity(self,entity_id,ext_ref): """ Adds an external reference to a entity specified by the entity identifier @param entity_id: the entity identifier @type entity_id: string @param ext_ref: the external reference @type ext_ref: L{CexternalRef...
def function[add_external_reference_to_entity, parameter[self, entity_id, ext_ref]]: constant[ Adds an external reference to a entity specified by the entity identifier @param entity_id: the entity identifier @type entity_id: string @param ext_ref: the external reference ...
keyword[def] identifier[add_external_reference_to_entity] ( identifier[self] , identifier[entity_id] , identifier[ext_ref] ): literal[string] identifier[node_entity] = identifier[self] . identifier[map_entity_id_to_node] . identifier[get] ( identifier[entity_id] ) keyword[if] identifier[n...
def add_external_reference_to_entity(self, entity_id, ext_ref): """ Adds an external reference to a entity specified by the entity identifier @param entity_id: the entity identifier @type entity_id: string @param ext_ref: the external reference @type ext_ref: L{CexternalRefer...
def encoded(self): """ Returns an encoded form of the query """ if not self._encoded: self._encoded = self._encode() if self._base_str: return '&'.join((self._base_str, self._encoded)) else: return self._encoded
def function[encoded, parameter[self]]: constant[ Returns an encoded form of the query ] if <ast.UnaryOp object at 0x7da2054a6a70> begin[:] name[self]._encoded assign[=] call[name[self]._encode, parameter[]] if name[self]._base_str begin[:] return[call[con...
keyword[def] identifier[encoded] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_encoded] : identifier[self] . identifier[_encoded] = identifier[self] . identifier[_encode] () keyword[if] identifier[self] . identifier[_base_str...
def encoded(self): """ Returns an encoded form of the query """ if not self._encoded: self._encoded = self._encode() # depends on [control=['if'], data=[]] if self._base_str: return '&'.join((self._base_str, self._encoded)) # depends on [control=['if'], data=[]] else: ...
def user_organisations_resource(doc): """Get user.organisations subresouces""" if doc.get('type') == 'user': for org_id, resource in doc.get('organisations', {}).items(): resource['id'] = org_id resource['user_id'] = doc['_id'] yield [doc['_id'], org_id], resource
def function[user_organisations_resource, parameter[doc]]: constant[Get user.organisations subresouces] if compare[call[name[doc].get, parameter[constant[type]]] equal[==] constant[user]] begin[:] for taget[tuple[[<ast.Name object at 0x7da2041d9b10>, <ast.Name object at 0x7da2041d8550>]]...
keyword[def] identifier[user_organisations_resource] ( identifier[doc] ): literal[string] keyword[if] identifier[doc] . identifier[get] ( literal[string] )== literal[string] : keyword[for] identifier[org_id] , identifier[resource] keyword[in] identifier[doc] . identifier[get] ( literal[string]...
def user_organisations_resource(doc): """Get user.organisations subresouces""" if doc.get('type') == 'user': for (org_id, resource) in doc.get('organisations', {}).items(): resource['id'] = org_id resource['user_id'] = doc['_id'] yield ([doc['_id'], org_id], resource)...
def command(func): ''' A decorator to create a function with docopt arguments. It also generates a help function @command def do_myfunc(self, args): """ docopts text """ pass will create def do_myfunc(self, args, arguments): """ docopts text """ ...
def function[command, parameter[func]]: constant[ A decorator to create a function with docopt arguments. It also generates a help function @command def do_myfunc(self, args): """ docopts text """ pass will create def do_myfunc(self, args, arguments): ...
keyword[def] identifier[command] ( identifier[func] ): literal[string] identifier[classname] = identifier[inspect] . identifier[getouterframes] ( identifier[inspect] . identifier[currentframe] ())[ literal[int] ][ literal[int] ] identifier[name] = identifier[func] . identifier[__name__] identifi...
def command(func): ''' A decorator to create a function with docopt arguments. It also generates a help function @command def do_myfunc(self, args): """ docopts text """ pass will create def do_myfunc(self, args, arguments): """ docopts text """ ...
def prep(config=None, path=None): """Prepare to read the configuration information.""" if config is None: config = parse() if path is None: path = os.getcwd() root = config.get('root', 'path') root = os.path.join(path, root) root = os.path.realpath(root) os.environ['SCIDASH_H...
def function[prep, parameter[config, path]]: constant[Prepare to read the configuration information.] if compare[name[config] is constant[None]] begin[:] variable[config] assign[=] call[name[parse], parameter[]] if compare[name[path] is constant[None]] begin[:] va...
keyword[def] identifier[prep] ( identifier[config] = keyword[None] , identifier[path] = keyword[None] ): literal[string] keyword[if] identifier[config] keyword[is] keyword[None] : identifier[config] = identifier[parse] () keyword[if] identifier[path] keyword[is] keyword[None] : ...
def prep(config=None, path=None): """Prepare to read the configuration information.""" if config is None: config = parse() # depends on [control=['if'], data=['config']] if path is None: path = os.getcwd() # depends on [control=['if'], data=['path']] root = config.get('root', 'path') ...
def safe_serialize_type(l): '''serialize only with letters, numbers and _''' if isinstance(l, str): return l elif isinstance(l, list): return '%s_%s_' % (l[0], ''.join(map(safe_serialize_type, l[1:]))) else: return str(l)
def function[safe_serialize_type, parameter[l]]: constant[serialize only with letters, numbers and _] if call[name[isinstance], parameter[name[l], name[str]]] begin[:] return[name[l]]
keyword[def] identifier[safe_serialize_type] ( identifier[l] ): literal[string] keyword[if] identifier[isinstance] ( identifier[l] , identifier[str] ): keyword[return] identifier[l] keyword[elif] identifier[isinstance] ( identifier[l] , identifier[list] ): keyword[return] liter...
def safe_serialize_type(l): """serialize only with letters, numbers and _""" if isinstance(l, str): return l # depends on [control=['if'], data=[]] elif isinstance(l, list): return '%s_%s_' % (l[0], ''.join(map(safe_serialize_type, l[1:]))) # depends on [control=['if'], data=[]] else: ...
def keys(self, key=None, reverse=False): """sort the keys before returning them""" ks = sorted(list(dict.keys(self)), key=key, reverse=reverse) return ks
def function[keys, parameter[self, key, reverse]]: constant[sort the keys before returning them] variable[ks] assign[=] call[name[sorted], parameter[call[name[list], parameter[call[name[dict].keys, parameter[name[self]]]]]]] return[name[ks]]
keyword[def] identifier[keys] ( identifier[self] , identifier[key] = keyword[None] , identifier[reverse] = keyword[False] ): literal[string] identifier[ks] = identifier[sorted] ( identifier[list] ( identifier[dict] . identifier[keys] ( identifier[self] )), identifier[key] = identifier[key] , iden...
def keys(self, key=None, reverse=False): """sort the keys before returning them""" ks = sorted(list(dict.keys(self)), key=key, reverse=reverse) return ks
def list(self, **params): """ Retrieve visit outcomes Returns Visit Outcomes, according to the parameters provided :calls: ``get /visit_outcomes`` :param dict params: (optional) Search options. :return: List of dictionaries that support attriubte-style access, which rep...
def function[list, parameter[self]]: constant[ Retrieve visit outcomes Returns Visit Outcomes, according to the parameters provided :calls: ``get /visit_outcomes`` :param dict params: (optional) Search options. :return: List of dictionaries that support attriubte-style ...
keyword[def] identifier[list] ( identifier[self] ,** identifier[params] ): literal[string] identifier[_] , identifier[_] , identifier[visit_outcomes] = identifier[self] . identifier[http_client] . identifier[get] ( literal[string] , identifier[params] = identifier[params] ) keyword[return...
def list(self, **params): """ Retrieve visit outcomes Returns Visit Outcomes, according to the parameters provided :calls: ``get /visit_outcomes`` :param dict params: (optional) Search options. :return: List of dictionaries that support attriubte-style access, which represe...
def _match_one(self, rec, tests): """Check if a specific record matches tests.""" for key,test in tests.iteritems(): if not test(rec.get(key, None)): return False return True
def function[_match_one, parameter[self, rec, tests]]: constant[Check if a specific record matches tests.] for taget[tuple[[<ast.Name object at 0x7da18ede70a0>, <ast.Name object at 0x7da18ede74f0>]]] in starred[call[name[tests].iteritems, parameter[]]] begin[:] if <ast.UnaryOp object at ...
keyword[def] identifier[_match_one] ( identifier[self] , identifier[rec] , identifier[tests] ): literal[string] keyword[for] identifier[key] , identifier[test] keyword[in] identifier[tests] . identifier[iteritems] (): keyword[if] keyword[not] identifier[test] ( identifier[rec] . i...
def _match_one(self, rec, tests): """Check if a specific record matches tests.""" for (key, test) in tests.iteritems(): if not test(rec.get(key, None)): return False # depends on [control=['if'], data=[]] # depends on [control=['for'], data=[]] return True
def solar_position_loop(unixtime, loc_args, out): """Loop through the time array and calculate the solar position""" lat = loc_args[0] lon = loc_args[1] elev = loc_args[2] pressure = loc_args[3] temp = loc_args[4] delta_t = loc_args[5] atmos_refract = loc_args[6] sst = loc_args[7] ...
def function[solar_position_loop, parameter[unixtime, loc_args, out]]: constant[Loop through the time array and calculate the solar position] variable[lat] assign[=] call[name[loc_args]][constant[0]] variable[lon] assign[=] call[name[loc_args]][constant[1]] variable[elev] assign[=] call[...
keyword[def] identifier[solar_position_loop] ( identifier[unixtime] , identifier[loc_args] , identifier[out] ): literal[string] identifier[lat] = identifier[loc_args] [ literal[int] ] identifier[lon] = identifier[loc_args] [ literal[int] ] identifier[elev] = identifier[loc_args] [ literal[int] ] ...
def solar_position_loop(unixtime, loc_args, out): """Loop through the time array and calculate the solar position""" lat = loc_args[0] lon = loc_args[1] elev = loc_args[2] pressure = loc_args[3] temp = loc_args[4] delta_t = loc_args[5] atmos_refract = loc_args[6] sst = loc_args[7] ...
def _agent_is_gene(agent, specific_only): """Returns whether an agent is for a gene. Parameters ---------- agent: Agent The agent to evaluate specific_only : Optional[bool] If True, only elementary genes/proteins evaluate as genes and families will be filtered out. If False,...
def function[_agent_is_gene, parameter[agent, specific_only]]: constant[Returns whether an agent is for a gene. Parameters ---------- agent: Agent The agent to evaluate specific_only : Optional[bool] If True, only elementary genes/proteins evaluate as genes and families ...
keyword[def] identifier[_agent_is_gene] ( identifier[agent] , identifier[specific_only] ): literal[string] keyword[if] keyword[not] identifier[specific_only] : keyword[if] keyword[not] ( identifier[agent] . identifier[db_refs] . identifier[get] ( literal[string] ) keyword[or] identifier[agent]...
def _agent_is_gene(agent, specific_only): """Returns whether an agent is for a gene. Parameters ---------- agent: Agent The agent to evaluate specific_only : Optional[bool] If True, only elementary genes/proteins evaluate as genes and families will be filtered out. If False,...
def features_of_type(self, featuretype, limit=None, strand=None, order_by=None, reverse=False, completely_within=False): """ Returns an iterator of :class:`gffutils.Feature` objects. Parameters ---------- {_method_doc} ""...
def function[features_of_type, parameter[self, featuretype, limit, strand, order_by, reverse, completely_within]]: constant[ Returns an iterator of :class:`gffutils.Feature` objects. Parameters ---------- {_method_doc} ] <ast.Tuple object at 0x7da18fe91690> assig...
keyword[def] identifier[features_of_type] ( identifier[self] , identifier[featuretype] , identifier[limit] = keyword[None] , identifier[strand] = keyword[None] , identifier[order_by] = keyword[None] , identifier[reverse] = keyword[False] , identifier[completely_within] = keyword[False] ): literal[string] ...
def features_of_type(self, featuretype, limit=None, strand=None, order_by=None, reverse=False, completely_within=False): """ Returns an iterator of :class:`gffutils.Feature` objects. Parameters ---------- {_method_doc} """ (query, args) = helpers.make_query(args=[], limi...
def position_target_global_int_send(self, time_boot_ms, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate, force_mavlink1=False): ''' Reports the current commanded vehicle position, velocity, and acceleration as specified by the ...
def function[position_target_global_int_send, parameter[self, time_boot_ms, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate, force_mavlink1]]: constant[ Reports the current commanded vehicle position, velocity, and acceleration as spec...
keyword[def] identifier[position_target_global_int_send] ( identifier[self] , identifier[time_boot_ms] , identifier[coordinate_frame] , identifier[type_mask] , identifier[lat_int] , identifier[lon_int] , identifier[alt] , identifier[vx] , identifier[vy] , identifier[vz] , identifier[afx] , identifier[afy] , identifie...
def position_target_global_int_send(self, time_boot_ms, coordinate_frame, type_mask, lat_int, lon_int, alt, vx, vy, vz, afx, afy, afz, yaw, yaw_rate, force_mavlink1=False): """ Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. T...
def _GetVisitSource(self, visit_identifier, cache, database): """Retrieves a visit source type based on the identifier. Args: visit_identifier (str): identifier from the visits table for the particular record. cache (SQLiteCache): cache which contains cached results from querying ...
def function[_GetVisitSource, parameter[self, visit_identifier, cache, database]]: constant[Retrieves a visit source type based on the identifier. Args: visit_identifier (str): identifier from the visits table for the particular record. cache (SQLiteCache): cache which contains cached...
keyword[def] identifier[_GetVisitSource] ( identifier[self] , identifier[visit_identifier] , identifier[cache] , identifier[database] ): literal[string] identifier[sync_cache_results] = identifier[cache] . identifier[GetResults] ( literal[string] ) keyword[if] keyword[not] identifier[sync_cache_resu...
def _GetVisitSource(self, visit_identifier, cache, database): """Retrieves a visit source type based on the identifier. Args: visit_identifier (str): identifier from the visits table for the particular record. cache (SQLiteCache): cache which contains cached results from querying ...
def request_vms_info(self, payload): """Get the VMs from the database and send the info to the agent.""" # This request is received from an agent when it runs for the first # time and uplink is detected. agent = payload.get('agent') LOG.debug('request_vms_info: Getting VMs info ...
def function[request_vms_info, parameter[self, payload]]: constant[Get the VMs from the database and send the info to the agent.] variable[agent] assign[=] call[name[payload].get, parameter[constant[agent]]] call[name[LOG].debug, parameter[constant[request_vms_info: Getting VMs info for %s], nam...
keyword[def] identifier[request_vms_info] ( identifier[self] , identifier[payload] ): literal[string] identifier[agent] = identifier[payload] . identifier[get] ( literal[string] ) identifier[LOG] . identifier[debug] ( literal[string] , identifier[agent] ) identi...
def request_vms_info(self, payload): """Get the VMs from the database and send the info to the agent.""" # This request is received from an agent when it runs for the first # time and uplink is detected. agent = payload.get('agent') LOG.debug('request_vms_info: Getting VMs info for %s', agent) r...
def update_metadata(self, **kwargs): """ :: POST /:login/machines/:id/metadata :Returns: current metadata :rtype: :py:class:`dict` Send an metadata dict update for the machine (following dict.update() semantics) using the keys and v...
def function[update_metadata, parameter[self]]: constant[ :: POST /:login/machines/:id/metadata :Returns: current metadata :rtype: :py:class:`dict` Send an metadata dict update for the machine (following dict.update() semantics) usi...
keyword[def] identifier[update_metadata] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[j] , identifier[_] = identifier[self] . identifier[datacenter] . identifier[request] ( literal[string] , identifier[self] . identifier[path] + literal[string] , identifier[data]...
def update_metadata(self, **kwargs): """ :: POST /:login/machines/:id/metadata :Returns: current metadata :rtype: :py:class:`dict` Send an metadata dict update for the machine (following dict.update() semantics) using the keys and value...
def visual_accelerators(self, value): """ Setter for **self.__visual_accelerators** attribute. :param value: Attribute value. :type value: tuple or list """ if value is not None: assert type(value) in (tuple, list), "'{0}' attribute: '{1}' type is not 'tuple...
def function[visual_accelerators, parameter[self, value]]: constant[ Setter for **self.__visual_accelerators** attribute. :param value: Attribute value. :type value: tuple or list ] if compare[name[value] is_not constant[None]] begin[:] assert[compare[call[name[t...
keyword[def] identifier[visual_accelerators] ( identifier[self] , identifier[value] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[not] keyword[None] : keyword[assert] identifier[type] ( identifier[value] ) keyword[in] ( identifier[tuple] , identifier[list] ...
def visual_accelerators(self, value): """ Setter for **self.__visual_accelerators** attribute. :param value: Attribute value. :type value: tuple or list """ if value is not None: assert type(value) in (tuple, list), "'{0}' attribute: '{1}' type is not 'tuple' or 'list'!"...
def deploy(verbose, app): """Deploy app using Heroku to MTurk.""" # Load psiTurk configuration. config = PsiturkConfig() config.load_config() # Set the mode. config.set("Experiment Configuration", "mode", "deploy") config.set("Server Parameters", "logfile", "-") # Ensure that psiTurk i...
def function[deploy, parameter[verbose, app]]: constant[Deploy app using Heroku to MTurk.] variable[config] assign[=] call[name[PsiturkConfig], parameter[]] call[name[config].load_config, parameter[]] call[name[config].set, parameter[constant[Experiment Configuration], constant[mode], co...
keyword[def] identifier[deploy] ( identifier[verbose] , identifier[app] ): literal[string] identifier[config] = identifier[PsiturkConfig] () identifier[config] . identifier[load_config] () identifier[config] . identifier[set] ( literal[string] , literal[string] , literal[string] ) ...
def deploy(verbose, app): """Deploy app using Heroku to MTurk.""" # Load psiTurk configuration. config = PsiturkConfig() config.load_config() # Set the mode. config.set('Experiment Configuration', 'mode', 'deploy') config.set('Server Parameters', 'logfile', '-') # Ensure that psiTurk is ...
def remove(backend, variable): '''remove a variable from the config, if found. ''' print('[remove]') settings = read_client_secrets() # If the variable begins with the SREGISTRY_<CLIENT> don't add it prefixed = variable prefix = 'SREGISTRY_%s_' %backend.upper() if not variable.startswit...
def function[remove, parameter[backend, variable]]: constant[remove a variable from the config, if found. ] call[name[print], parameter[constant[[remove]]]] variable[settings] assign[=] call[name[read_client_secrets], parameter[]] variable[prefixed] assign[=] name[variable] v...
keyword[def] identifier[remove] ( identifier[backend] , identifier[variable] ): literal[string] identifier[print] ( literal[string] ) identifier[settings] = identifier[read_client_secrets] () identifier[prefixed] = identifier[variable] identifier[prefix] = literal[string] % identifier...
def remove(backend, variable): """remove a variable from the config, if found. """ print('[remove]') settings = read_client_secrets() # If the variable begins with the SREGISTRY_<CLIENT> don't add it prefixed = variable prefix = 'SREGISTRY_%s_' % backend.upper() if not variable.startswit...
def is_stationarity(self, tolerance=0.2, sample=None): """ Checks if the given markov chain is stationary and checks the steady state probablity values for the state are consistent. Parameters: ----------- tolerance: float represents the diff between actual s...
def function[is_stationarity, parameter[self, tolerance, sample]]: constant[ Checks if the given markov chain is stationary and checks the steady state probablity values for the state are consistent. Parameters: ----------- tolerance: float represents the dif...
keyword[def] identifier[is_stationarity] ( identifier[self] , identifier[tolerance] = literal[int] , identifier[sample] = keyword[None] ): literal[string] identifier[keys] = identifier[self] . identifier[transition_models] . identifier[keys] () identifier[return_val] = keyword[True] ...
def is_stationarity(self, tolerance=0.2, sample=None): """ Checks if the given markov chain is stationary and checks the steady state probablity values for the state are consistent. Parameters: ----------- tolerance: float represents the diff between actual stead...
async def async_open(self) -> None: """Opens connection to the LifeSOS ethernet interface.""" await self._loop.create_connection( lambda: self, self._host, self._port)
<ast.AsyncFunctionDef object at 0x7da2044c0250>
keyword[async] keyword[def] identifier[async_open] ( identifier[self] )-> keyword[None] : literal[string] keyword[await] identifier[self] . identifier[_loop] . identifier[create_connection] ( keyword[lambda] : identifier[self] , identifier[self] . identifier[_host] , i...
async def async_open(self) -> None: """Opens connection to the LifeSOS ethernet interface.""" await self._loop.create_connection(lambda : self, self._host, self._port)
def attributs(self): """ The user attributes, defined as the fields on the :attr:`user` object. :return: a :class:`dict` with the :attr:`user` object fields. Attributes may be If the user do not exists, the returned :class:`dict` is empty. :rtype: dict ...
def function[attributs, parameter[self]]: constant[ The user attributes, defined as the fields on the :attr:`user` object. :return: a :class:`dict` with the :attr:`user` object fields. Attributes may be If the user do not exists, the returned :class:`dict` is empty. ...
keyword[def] identifier[attributs] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[user] : identifier[attr] ={} keyword[try] : identifier[field_names] =[ identifier[field] . identifier[attname]...
def attributs(self): """ The user attributes, defined as the fields on the :attr:`user` object. :return: a :class:`dict` with the :attr:`user` object fields. Attributes may be If the user do not exists, the returned :class:`dict` is empty. :rtype: dict ""...
def readline(self): """Read a chunk of the output""" _LOGGER.info("reading line") line = self.read(self.line_length) if len(line) < self.line_length: _LOGGER.info("all lines read") return line
def function[readline, parameter[self]]: constant[Read a chunk of the output] call[name[_LOGGER].info, parameter[constant[reading line]]] variable[line] assign[=] call[name[self].read, parameter[name[self].line_length]] if compare[call[name[len], parameter[name[line]]] less[<] name[self]...
keyword[def] identifier[readline] ( identifier[self] ): literal[string] identifier[_LOGGER] . identifier[info] ( literal[string] ) identifier[line] = identifier[self] . identifier[read] ( identifier[self] . identifier[line_length] ) keyword[if] identifier[len] ( identifier[line] ...
def readline(self): """Read a chunk of the output""" _LOGGER.info('reading line') line = self.read(self.line_length) if len(line) < self.line_length: _LOGGER.info('all lines read') # depends on [control=['if'], data=[]] return line
def fix_display(self): """If this is being run on a headless system the Matplotlib backend must be changed to one that doesn't need a display. """ try: tkinter.Tk() except (tkinter.TclError, NameError): # If there is no display. try: impor...
def function[fix_display, parameter[self]]: constant[If this is being run on a headless system the Matplotlib backend must be changed to one that doesn't need a display. ] <ast.Try object at 0x7da1b0e65870>
keyword[def] identifier[fix_display] ( identifier[self] ): literal[string] keyword[try] : identifier[tkinter] . identifier[Tk] () keyword[except] ( identifier[tkinter] . identifier[TclError] , identifier[NameError] ): keyword[try] : keyword[impor...
def fix_display(self): """If this is being run on a headless system the Matplotlib backend must be changed to one that doesn't need a display. """ try: tkinter.Tk() # depends on [control=['try'], data=[]] except (tkinter.TclError, NameError): # If there is no display. try: ...
def _get_array_controller_resource(self): """Gets the ArrayController resource if exists. :raises: IloCommandNotSupportedError if the resource ArrayController doesn't exist. :returns the tuple of SmartStorage URI, Headers and settings. """ headers, storage_uri, stora...
def function[_get_array_controller_resource, parameter[self]]: constant[Gets the ArrayController resource if exists. :raises: IloCommandNotSupportedError if the resource ArrayController doesn't exist. :returns the tuple of SmartStorage URI, Headers and settings. ] <a...
keyword[def] identifier[_get_array_controller_resource] ( identifier[self] ): literal[string] identifier[headers] , identifier[storage_uri] , identifier[storage_settings] = identifier[self] . identifier[_get_storage_resource] () keyword[if] ( literal[string] keyword[in] identifier[storag...
def _get_array_controller_resource(self): """Gets the ArrayController resource if exists. :raises: IloCommandNotSupportedError if the resource ArrayController doesn't exist. :returns the tuple of SmartStorage URI, Headers and settings. """ (headers, storage_uri, storage_sett...
def _parse_hits(self, hits, resource): """Parse hits response into documents.""" datasource = self.get_datasource(resource) schema = {} schema.update(config.DOMAIN[datasource[0]].get('schema', {})) schema.update(config.DOMAIN[resource].get('schema', {})) dates = get_dates...
def function[_parse_hits, parameter[self, hits, resource]]: constant[Parse hits response into documents.] variable[datasource] assign[=] call[name[self].get_datasource, parameter[name[resource]]] variable[schema] assign[=] dictionary[[], []] call[name[schema].update, parameter[call[call[...
keyword[def] identifier[_parse_hits] ( identifier[self] , identifier[hits] , identifier[resource] ): literal[string] identifier[datasource] = identifier[self] . identifier[get_datasource] ( identifier[resource] ) identifier[schema] ={} identifier[schema] . identifier[update] ( ide...
def _parse_hits(self, hits, resource): """Parse hits response into documents.""" datasource = self.get_datasource(resource) schema = {} schema.update(config.DOMAIN[datasource[0]].get('schema', {})) schema.update(config.DOMAIN[resource].get('schema', {})) dates = get_dates(schema) docs = [] ...
def signature_type(self): """Return the signature type used in this MAR. Returns: One of None, 'unknown', 'sha1', or 'sha384' """ if not self.mardata.signatures: return None for sig in self.mardata.signatures.sigs: if sig.algorithm_id == 1: ...
def function[signature_type, parameter[self]]: constant[Return the signature type used in this MAR. Returns: One of None, 'unknown', 'sha1', or 'sha384' ] if <ast.UnaryOp object at 0x7da1b04c9720> begin[:] return[constant[None]] for taget[name[sig]] in starr...
keyword[def] identifier[signature_type] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[mardata] . identifier[signatures] : keyword[return] keyword[None] keyword[for] identifier[sig] keyword[in] identifier[self] . identifier...
def signature_type(self): """Return the signature type used in this MAR. Returns: One of None, 'unknown', 'sha1', or 'sha384' """ if not self.mardata.signatures: return None # depends on [control=['if'], data=[]] for sig in self.mardata.signatures.sigs: if sig....
def client_start(request, socket, context): """ Adds the client triple to CLIENTS. """ CLIENTS[socket.session.session_id] = (request, socket, context)
def function[client_start, parameter[request, socket, context]]: constant[ Adds the client triple to CLIENTS. ] call[name[CLIENTS]][name[socket].session.session_id] assign[=] tuple[[<ast.Name object at 0x7da18c4cf700>, <ast.Name object at 0x7da18c4cfd60>, <ast.Name object at 0x7da18c4cd3f0>]]
keyword[def] identifier[client_start] ( identifier[request] , identifier[socket] , identifier[context] ): literal[string] identifier[CLIENTS] [ identifier[socket] . identifier[session] . identifier[session_id] ]=( identifier[request] , identifier[socket] , identifier[context] )
def client_start(request, socket, context): """ Adds the client triple to CLIENTS. """ CLIENTS[socket.session.session_id] = (request, socket, context)
def on_btn_delete_fit(self, event): """ removes the current interpretation Parameters ---------- event : the wx.ButtonEvent that triggered this function """ self.delete_fit(self.current_fit, specimen=self.s)
def function[on_btn_delete_fit, parameter[self, event]]: constant[ removes the current interpretation Parameters ---------- event : the wx.ButtonEvent that triggered this function ] call[name[self].delete_fit, parameter[name[self].current_fit]]
keyword[def] identifier[on_btn_delete_fit] ( identifier[self] , identifier[event] ): literal[string] identifier[self] . identifier[delete_fit] ( identifier[self] . identifier[current_fit] , identifier[specimen] = identifier[self] . identifier[s] )
def on_btn_delete_fit(self, event): """ removes the current interpretation Parameters ---------- event : the wx.ButtonEvent that triggered this function """ self.delete_fit(self.current_fit, specimen=self.s)
def _export(dataset_input, dataset_output, random_index_column, path, column_names=None, byteorder="=", shuffle=False, selection=False, progress=None, virtual=True, sort=None, ascending=True): """ :param DatasetLocal dataset: dataset to export :param str path: path for file :param lis[str] column_names:...
def function[_export, parameter[dataset_input, dataset_output, random_index_column, path, column_names, byteorder, shuffle, selection, progress, virtual, sort, ascending]]: constant[ :param DatasetLocal dataset: dataset to export :param str path: path for file :param lis[str] column_names: list of c...
keyword[def] identifier[_export] ( identifier[dataset_input] , identifier[dataset_output] , identifier[random_index_column] , identifier[path] , identifier[column_names] = keyword[None] , identifier[byteorder] = literal[string] , identifier[shuffle] = keyword[False] , identifier[selection] = keyword[False] , identifi...
def _export(dataset_input, dataset_output, random_index_column, path, column_names=None, byteorder='=', shuffle=False, selection=False, progress=None, virtual=True, sort=None, ascending=True): """ :param DatasetLocal dataset: dataset to export :param str path: path for file :param lis[str] column_names:...
def reverse(self): """ Returns a reversed copy of the list. """ colors = ColorList.copy(self) _list.reverse(colors) return colors
def function[reverse, parameter[self]]: constant[ Returns a reversed copy of the list. ] variable[colors] assign[=] call[name[ColorList].copy, parameter[name[self]]] call[name[_list].reverse, parameter[name[colors]]] return[name[colors]]
keyword[def] identifier[reverse] ( identifier[self] ): literal[string] identifier[colors] = identifier[ColorList] . identifier[copy] ( identifier[self] ) identifier[_list] . identifier[reverse] ( identifier[colors] ) keyword[return] identifier[colors]
def reverse(self): """ Returns a reversed copy of the list. """ colors = ColorList.copy(self) _list.reverse(colors) return colors
def _calculate_file_hashes(full_path, f_hashers): """ Returns a dictionary of (algorithm, hexdigest) values for the provided filename """ if not os.path.exists(full_path): raise BagValidationError("%s does not exist" % full_path) try: with open(full_path, 'rb') as f: ...
def function[_calculate_file_hashes, parameter[full_path, f_hashers]]: constant[ Returns a dictionary of (algorithm, hexdigest) values for the provided filename ] if <ast.UnaryOp object at 0x7da18f7225f0> begin[:] <ast.Raise object at 0x7da18f7215a0> <ast.Try object at 0x7da18f72...
keyword[def] identifier[_calculate_file_hashes] ( identifier[full_path] , identifier[f_hashers] ): literal[string] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[full_path] ): keyword[raise] identifier[BagValidationError] ( literal[string] % identif...
def _calculate_file_hashes(full_path, f_hashers): """ Returns a dictionary of (algorithm, hexdigest) values for the provided filename """ if not os.path.exists(full_path): raise BagValidationError('%s does not exist' % full_path) # depends on [control=['if'], data=[]] try: with ...
def count_below_mean(x): """ Returns the number of values in x that are lower than the mean of x :param x: the time series to calculate the feature of :type x: numpy.ndarray :return: the value of this feature :return type: float """ m = np.mean(x) return np.where(x < m)[0].size
def function[count_below_mean, parameter[x]]: constant[ Returns the number of values in x that are lower than the mean of x :param x: the time series to calculate the feature of :type x: numpy.ndarray :return: the value of this feature :return type: float ] variable[m] assign[=]...
keyword[def] identifier[count_below_mean] ( identifier[x] ): literal[string] identifier[m] = identifier[np] . identifier[mean] ( identifier[x] ) keyword[return] identifier[np] . identifier[where] ( identifier[x] < identifier[m] )[ literal[int] ]. identifier[size]
def count_below_mean(x): """ Returns the number of values in x that are lower than the mean of x :param x: the time series to calculate the feature of :type x: numpy.ndarray :return: the value of this feature :return type: float """ m = np.mean(x) return np.where(x < m)[0].size
def surface_subdivide2(surface, sub_surface_b): """Image for :meth`.Surface.subdivide` docstring.""" if NO_IMAGES: return # Plot set-up. figure = plt.figure() ax = figure.gca() colors = seaborn.husl_palette(6) N = 128 s_vals = np.linspace(0.0, 1.0, N + 1) # Add edges from su...
def function[surface_subdivide2, parameter[surface, sub_surface_b]]: constant[Image for :meth`.Surface.subdivide` docstring.] if name[NO_IMAGES] begin[:] return[None] variable[figure] assign[=] call[name[plt].figure, parameter[]] variable[ax] assign[=] call[name[figure].gca, para...
keyword[def] identifier[surface_subdivide2] ( identifier[surface] , identifier[sub_surface_b] ): literal[string] keyword[if] identifier[NO_IMAGES] : keyword[return] identifier[figure] = identifier[plt] . identifier[figure] () identifier[ax] = identifier[figure] . identifier[g...
def surface_subdivide2(surface, sub_surface_b): """Image for :meth`.Surface.subdivide` docstring.""" if NO_IMAGES: return # depends on [control=['if'], data=[]] # Plot set-up. figure = plt.figure() ax = figure.gca() colors = seaborn.husl_palette(6) N = 128 s_vals = np.linspace(0...
def _write_data_csv(csv_data): """ CSV data has been parsed by this point, so take it and write it file by file. :return: """ logger_excel.info("enter write_data_csv") # Loop for each file and data that is stored for file in csv_data: for filename, data in file.items(): #...
def function[_write_data_csv, parameter[csv_data]]: constant[ CSV data has been parsed by this point, so take it and write it file by file. :return: ] call[name[logger_excel].info, parameter[constant[enter write_data_csv]]] for taget[name[file]] in starred[name[csv_data]] begin[:] ...
keyword[def] identifier[_write_data_csv] ( identifier[csv_data] ): literal[string] identifier[logger_excel] . identifier[info] ( literal[string] ) keyword[for] identifier[file] keyword[in] identifier[csv_data] : keyword[for] identifier[filename] , identifier[data] keyword[in] ident...
def _write_data_csv(csv_data): """ CSV data has been parsed by this point, so take it and write it file by file. :return: """ logger_excel.info('enter write_data_csv') # Loop for each file and data that is stored for file in csv_data: for (filename, data) in file.items(): ...
def create_model(self, role=None, image=None, predictor_cls=None, serializer=None, deserializer=None, content_type=None, accept=None, vpc_config_override=vpc_utils.VPC_CONFIG_DEFAULT, **kwargs): """ Create a model to deploy. Args: role (str): The ``ExecutionRole...
def function[create_model, parameter[self, role, image, predictor_cls, serializer, deserializer, content_type, accept, vpc_config_override]]: constant[ Create a model to deploy. Args: role (str): The ``ExecutionRoleArn`` IAM Role ARN for the ``Model``, which is also used during ...
keyword[def] identifier[create_model] ( identifier[self] , identifier[role] = keyword[None] , identifier[image] = keyword[None] , identifier[predictor_cls] = keyword[None] , identifier[serializer] = keyword[None] , identifier[deserializer] = keyword[None] , identifier[content_type] = keyword[None] , identifier[accep...
def create_model(self, role=None, image=None, predictor_cls=None, serializer=None, deserializer=None, content_type=None, accept=None, vpc_config_override=vpc_utils.VPC_CONFIG_DEFAULT, **kwargs): """ Create a model to deploy. Args: role (str): The ``ExecutionRoleArn`` IAM Role ARN for th...
def _create_header(self): """ Function to create the GroupHeader (GrpHdr) in the CstmrCdtTrfInitn Node """ # Retrieve the node to which we will append the group header. CstmrCdtTrfInitn_node = self._xml.find('CstmrCdtTrfInitn') # Create the header nodes. ...
def function[_create_header, parameter[self]]: constant[ Function to create the GroupHeader (GrpHdr) in the CstmrCdtTrfInitn Node ] variable[CstmrCdtTrfInitn_node] assign[=] call[name[self]._xml.find, parameter[constant[CstmrCdtTrfInitn]]] variable[GrpHdr_node] assign[=] ...
keyword[def] identifier[_create_header] ( identifier[self] ): literal[string] identifier[CstmrCdtTrfInitn_node] = identifier[self] . identifier[_xml] . identifier[find] ( literal[string] ) identifier[GrpHdr_node] = identifier[ET] . identifier[Element] ( literal[string] )...
def _create_header(self): """ Function to create the GroupHeader (GrpHdr) in the CstmrCdtTrfInitn Node """ # Retrieve the node to which we will append the group header. CstmrCdtTrfInitn_node = self._xml.find('CstmrCdtTrfInitn') # Create the header nodes. GrpHdr_node = ET.Elem...
def _filter_list(input_list, search_key, search_value): ''' Filters a list of dictionary by a set of key-value pair. :param input_list: is a list of dictionaries :param search_key: is the key we are looking for :param search_value: is the value we are looking for the key specified in search_ke...
def function[_filter_list, parameter[input_list, search_key, search_value]]: constant[ Filters a list of dictionary by a set of key-value pair. :param input_list: is a list of dictionaries :param search_key: is the key we are looking for :param search_value: is the value we are looking for ...
keyword[def] identifier[_filter_list] ( identifier[input_list] , identifier[search_key] , identifier[search_value] ): literal[string] identifier[output_list] = identifier[list] () keyword[for] identifier[dictionary] keyword[in] identifier[input_list] : keyword[if] identifier[dictionary...
def _filter_list(input_list, search_key, search_value): """ Filters a list of dictionary by a set of key-value pair. :param input_list: is a list of dictionaries :param search_key: is the key we are looking for :param search_value: is the value we are looking for the key specified in search_key...
def stop(ctx, yes): """Stop experiment. Uses [Caching](/references/polyaxon-cli/#caching) Examples: \b ```bash $ polyaxon experiment stop ``` \b ```bash $ polyaxon experiment -xp 2 stop ``` """ user, project_name, _experiment = get_project_experiment_or_local(ctx....
def function[stop, parameter[ctx, yes]]: constant[Stop experiment. Uses [Caching](/references/polyaxon-cli/#caching) Examples:  ```bash $ polyaxon experiment stop ```  ```bash $ polyaxon experiment -xp 2 stop ``` ] <ast.Tuple object at 0x7da1affc0670> as...
keyword[def] identifier[stop] ( identifier[ctx] , identifier[yes] ): literal[string] identifier[user] , identifier[project_name] , identifier[_experiment] = identifier[get_project_experiment_or_local] ( identifier[ctx] . identifier[obj] . identifier[get] ( literal[string] ), identifier[ctx] . identifi...
def stop(ctx, yes): """Stop experiment. Uses [Caching](/references/polyaxon-cli/#caching) Examples: \x08 ```bash $ polyaxon experiment stop ``` \x08 ```bash $ polyaxon experiment -xp 2 stop ``` """ (user, project_name, _experiment) = get_project_experiment_or_loca...
def _handle_raw_book(self, dtype, data, ts): """Updates the raw order books stored in self.raw_books[chan_id]. :param dtype: :param data: :param ts: :return: """ self.log.debug("_handle_raw_book: %s - %s - %s", dtype, data, ts) channel_id, *data = data ...
def function[_handle_raw_book, parameter[self, dtype, data, ts]]: constant[Updates the raw order books stored in self.raw_books[chan_id]. :param dtype: :param data: :param ts: :return: ] call[name[self].log.debug, parameter[constant[_handle_raw_book: %s - %s - %s...
keyword[def] identifier[_handle_raw_book] ( identifier[self] , identifier[dtype] , identifier[data] , identifier[ts] ): literal[string] identifier[self] . identifier[log] . identifier[debug] ( literal[string] , identifier[dtype] , identifier[data] , identifier[ts] ) identifier[channel_id] ...
def _handle_raw_book(self, dtype, data, ts): """Updates the raw order books stored in self.raw_books[chan_id]. :param dtype: :param data: :param ts: :return: """ self.log.debug('_handle_raw_book: %s - %s - %s', dtype, data, ts) (channel_id, *data) = data channel_...
def _setup_piddir(self): """Create the directory for the PID file if necessary.""" if self.pidfile is None: return piddir = os.path.dirname(self.pidfile) if not os.path.isdir(piddir): # Create the directory with sensible mode and ownership os.makedirs(...
def function[_setup_piddir, parameter[self]]: constant[Create the directory for the PID file if necessary.] if compare[name[self].pidfile is constant[None]] begin[:] return[None] variable[piddir] assign[=] call[name[os].path.dirname, parameter[name[self].pidfile]] if <ast.UnaryOp...
keyword[def] identifier[_setup_piddir] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[pidfile] keyword[is] keyword[None] : keyword[return] identifier[piddir] = identifier[os] . identifier[path] . identifier[dirname] ( identifier[self] . ide...
def _setup_piddir(self): """Create the directory for the PID file if necessary.""" if self.pidfile is None: return # depends on [control=['if'], data=[]] piddir = os.path.dirname(self.pidfile) if not os.path.isdir(piddir): # Create the directory with sensible mode and ownership ...
def validate_gaslimit(self, header: BlockHeader) -> None: """ Validate the gas limit on the given header. """ parent_header = self.get_block_header_by_hash(header.parent_hash) low_bound, high_bound = compute_gas_limit_bounds(parent_header) if header.gas_limit < low_bound:...
def function[validate_gaslimit, parameter[self, header]]: constant[ Validate the gas limit on the given header. ] variable[parent_header] assign[=] call[name[self].get_block_header_by_hash, parameter[name[header].parent_hash]] <ast.Tuple object at 0x7da1b175d4e0> assign[=] call[n...
keyword[def] identifier[validate_gaslimit] ( identifier[self] , identifier[header] : identifier[BlockHeader] )-> keyword[None] : literal[string] identifier[parent_header] = identifier[self] . identifier[get_block_header_by_hash] ( identifier[header] . identifier[parent_hash] ) identifier[l...
def validate_gaslimit(self, header: BlockHeader) -> None: """ Validate the gas limit on the given header. """ parent_header = self.get_block_header_by_hash(header.parent_hash) (low_bound, high_bound) = compute_gas_limit_bounds(parent_header) if header.gas_limit < low_bound: raise...
def find(self, func: Callable[[K, T], bool]) -> TOption[T]: """ Usage: >>> TDict(k1=1, k2=2, k3=3).find(lambda k, v: v == 2) Option --> 2 >>> TDict(k1=1, k2=2, k3=3).find(lambda k, v: v == 4) Option --> None """ for k, v in self.items(): ...
def function[find, parameter[self, func]]: constant[ Usage: >>> TDict(k1=1, k2=2, k3=3).find(lambda k, v: v == 2) Option --> 2 >>> TDict(k1=1, k2=2, k3=3).find(lambda k, v: v == 4) Option --> None ] for taget[tuple[[<ast.Name object at 0x7...
keyword[def] identifier[find] ( identifier[self] , identifier[func] : identifier[Callable] [[ identifier[K] , identifier[T] ], identifier[bool] ])-> identifier[TOption] [ identifier[T] ]: literal[string] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[self] . identifier[items] ...
def find(self, func: Callable[[K, T], bool]) -> TOption[T]: """ Usage: >>> TDict(k1=1, k2=2, k3=3).find(lambda k, v: v == 2) Option --> 2 >>> TDict(k1=1, k2=2, k3=3).find(lambda k, v: v == 4) Option --> None """ for (k, v) in self.items(): ...
def _print(stats, limit, label): """ 控制输出量 """ print("TraceMalloc for {}".format(label)) for index, stat in enumerate(stats): if index < limit: print(stat) else: break
def function[_print, parameter[stats, limit, label]]: constant[ 控制输出量 ] call[name[print], parameter[call[constant[TraceMalloc for {}].format, parameter[name[label]]]]] for taget[tuple[[<ast.Name object at 0x7da1b0049bd0>, <ast.Name object at 0x7da1b00497e0>]]] in starred[call[name[enumer...
keyword[def] identifier[_print] ( identifier[stats] , identifier[limit] , identifier[label] ): literal[string] identifier[print] ( literal[string] . identifier[format] ( identifier[label] )) keyword[for] identifier[index] , identifier[stat] keyword[in] identifier[enumerate] ( identifier[stats] ): ...
def _print(stats, limit, label): """ 控制输出量 """ print('TraceMalloc for {}'.format(label)) for (index, stat) in enumerate(stats): if index < limit: print(stat) # depends on [control=['if'], data=[]] else: break # depends on [control=['for'], data=[]]
def pick_free_port(hostname=REDIRECT_HOST, port=0): """ Try to bind a port. Default=0 selects a free port. """ import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.bind((hostname, port)) # port=0 finds an open port except OSError as e: log.warning("Could not bi...
def function[pick_free_port, parameter[hostname, port]]: constant[ Try to bind a port. Default=0 selects a free port. ] import module[socket] variable[s] assign[=] call[name[socket].socket, parameter[name[socket].AF_INET, name[socket].SOCK_STREAM]] <ast.Try object at 0x7da1b0781ff0> <ast...
keyword[def] identifier[pick_free_port] ( identifier[hostname] = identifier[REDIRECT_HOST] , identifier[port] = literal[int] ): literal[string] keyword[import] identifier[socket] identifier[s] = identifier[socket] . identifier[socket] ( identifier[socket] . identifier[AF_INET] , identifier[socket] ....
def pick_free_port(hostname=REDIRECT_HOST, port=0): """ Try to bind a port. Default=0 selects a free port. """ import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.bind((hostname, port)) # port=0 finds an open port # depends on [control=['try'], data=[]] except OSErro...
def lbmethods(self): ''' List all the load balancer methods ''' methods = self.bigIP.LocalLB.Pool.typefactory.create( 'LocalLB.LBMethod' ) return [method[0].split('_', 2)[-1] for method in methods]
def function[lbmethods, parameter[self]]: constant[ List all the load balancer methods ] variable[methods] assign[=] call[name[self].bigIP.LocalLB.Pool.typefactory.create, parameter[constant[LocalLB.LBMethod]]] return[<ast.ListComp object at 0x7da1b1c22b00>]
keyword[def] identifier[lbmethods] ( identifier[self] ): literal[string] identifier[methods] = identifier[self] . identifier[bigIP] . identifier[LocalLB] . identifier[Pool] . identifier[typefactory] . identifier[create] ( literal[string] ) keyword[return] [ identifier[met...
def lbmethods(self): """ List all the load balancer methods """ methods = self.bigIP.LocalLB.Pool.typefactory.create('LocalLB.LBMethod') return [method[0].split('_', 2)[-1] for method in methods]
def _transform_field(field): """transform field for displaying""" if isinstance(field, bool): return TRUE if field else FALSE elif isinstance(field, (list, dict)): return json.dumps(field, sort_keys=True, ensure_ascii=False) else: return field
def function[_transform_field, parameter[field]]: constant[transform field for displaying] if call[name[isinstance], parameter[name[field], name[bool]]] begin[:] return[<ast.IfExp object at 0x7da204621930>]
keyword[def] identifier[_transform_field] ( identifier[field] ): literal[string] keyword[if] identifier[isinstance] ( identifier[field] , identifier[bool] ): keyword[return] identifier[TRUE] keyword[if] identifier[field] keyword[else] identifier[FALSE] keyword[elif] identifier[isinsta...
def _transform_field(field): """transform field for displaying""" if isinstance(field, bool): return TRUE if field else FALSE # depends on [control=['if'], data=[]] elif isinstance(field, (list, dict)): return json.dumps(field, sort_keys=True, ensure_ascii=False) # depends on [control=['if...
def show_instance(name, call=None): ''' Show the details from the provider concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) nodes = list_nodes_full() # Find under which cloud s...
def function[show_instance, parameter[name, call]]: constant[ Show the details from the provider concerning an instance ] if compare[name[call] not_equal[!=] constant[action]] begin[:] <ast.Raise object at 0x7da1b2089d50> variable[nodes] assign[=] call[name[list_nodes_full], para...
keyword[def] identifier[show_instance] ( identifier[name] , identifier[call] = keyword[None] ): literal[string] keyword[if] identifier[call] != literal[string] : keyword[raise] identifier[SaltCloudSystemExit] ( literal[string] ) identifier[nodes] = identifier[list_nodes_f...
def show_instance(name, call=None): """ Show the details from the provider concerning an instance """ if call != 'action': raise SaltCloudSystemExit('The show_instance action must be called with -a or --action.') # depends on [control=['if'], data=[]] nodes = list_nodes_full() # Find un...
def execution_cls(self): """Get execution layer class """ name = self.campaign.process.type for clazz in [ExecutionDriver, SrunExecutionDriver]: if name == clazz.name: return clazz raise NameError("Unknown execution layer: '%s'" % name)
def function[execution_cls, parameter[self]]: constant[Get execution layer class ] variable[name] assign[=] name[self].campaign.process.type for taget[name[clazz]] in starred[list[[<ast.Name object at 0x7da20c7cb5e0>, <ast.Name object at 0x7da20c7cb2e0>]]] begin[:] if com...
keyword[def] identifier[execution_cls] ( identifier[self] ): literal[string] identifier[name] = identifier[self] . identifier[campaign] . identifier[process] . identifier[type] keyword[for] identifier[clazz] keyword[in] [ identifier[ExecutionDriver] , identifier[SrunExecutionDriver] ]: ...
def execution_cls(self): """Get execution layer class """ name = self.campaign.process.type for clazz in [ExecutionDriver, SrunExecutionDriver]: if name == clazz.name: return clazz # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['clazz']] raise N...
def cublasDgemv(handle, trans, m, n, alpha, A, lda, x, incx, beta, y, incy): """ Matrix-vector product for real general matrix. """ status = _libcublas.cublasDgemv_v2(handle, _CUBLAS_OP[trans], m, n, ctypes.byref(ctypes.c_do...
def function[cublasDgemv, parameter[handle, trans, m, n, alpha, A, lda, x, incx, beta, y, incy]]: constant[ Matrix-vector product for real general matrix. ] variable[status] assign[=] call[name[_libcublas].cublasDgemv_v2, parameter[name[handle], call[name[_CUBLAS_OP]][name[trans]], name[m], nam...
keyword[def] identifier[cublasDgemv] ( identifier[handle] , identifier[trans] , identifier[m] , identifier[n] , identifier[alpha] , identifier[A] , identifier[lda] , identifier[x] , identifier[incx] , identifier[beta] , identifier[y] , identifier[incy] ): literal[string] identifier[status] = identifier[_l...
def cublasDgemv(handle, trans, m, n, alpha, A, lda, x, incx, beta, y, incy): """ Matrix-vector product for real general matrix. """ status = _libcublas.cublasDgemv_v2(handle, _CUBLAS_OP[trans], m, n, ctypes.byref(ctypes.c_double(alpha)), int(A), lda, int(x), incx, ctypes.byref(ctypes.c_double(beta)), i...