code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def parse(readDataInstance): """ Returns a new L{ImageBoundForwarderRefEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with the corresponding data to generate a new L{ImageBoundForwarderRefEntry} object. @rtype: L...
def function[parse, parameter[readDataInstance]]: constant[ Returns a new L{ImageBoundForwarderRefEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with the corresponding data to generate a new L{ImageBoundForwarderRefEntry} object....
keyword[def] identifier[parse] ( identifier[readDataInstance] ): literal[string] identifier[boundForwarderEntry] = identifier[ImageBoundForwarderRefEntry] () identifier[boundForwarderEntry] . identifier[timeDateStamp] . identifier[value] = identifier[readDataInstance] . identifier[readDwor...
def parse(readDataInstance): """ Returns a new L{ImageBoundForwarderRefEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with the corresponding data to generate a new L{ImageBoundForwarderRefEntry} object. @rtype: L{Ima...
def transition(self, data, year, linked_tables=None): """ Add or remove rows from a table based on population targets. Parameters ---------- data : pandas.DataFrame Rows will be removed from or added to this table. year : int Year number that will...
def function[transition, parameter[self, data, year, linked_tables]]: constant[ Add or remove rows from a table based on population targets. Parameters ---------- data : pandas.DataFrame Rows will be removed from or added to this table. year : int ...
keyword[def] identifier[transition] ( identifier[self] , identifier[data] , identifier[year] , identifier[linked_tables] = keyword[None] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] ) identifier[linked_tables] = identifier[linked_tables] keyword[or] {} ...
def transition(self, data, year, linked_tables=None): """ Add or remove rows from a table based on population targets. Parameters ---------- data : pandas.DataFrame Rows will be removed from or added to this table. year : int Year number that will be ...
def _cb_dcnm_msg(self, method, body): """Callback function to process DCNM network creation/update/deletion message received by AMQP. It also communicates with DCNM to extract info for CPNR record insertion/deletion. :param pika.channel.Channel ch: The channel instance. ...
def function[_cb_dcnm_msg, parameter[self, method, body]]: constant[Callback function to process DCNM network creation/update/deletion message received by AMQP. It also communicates with DCNM to extract info for CPNR record insertion/deletion. :param pika.channel.Channel ch: Th...
keyword[def] identifier[_cb_dcnm_msg] ( identifier[self] , identifier[method] , identifier[body] ): literal[string] identifier[LOG] . identifier[debug] ( literal[string] , { literal[string] : identifier[method] . identifier[routing_key] , literal[string] : identifier[body] }) ident...
def _cb_dcnm_msg(self, method, body): """Callback function to process DCNM network creation/update/deletion message received by AMQP. It also communicates with DCNM to extract info for CPNR record insertion/deletion. :param pika.channel.Channel ch: The channel instance. :pa...
def connect(self): """Opens a HTTP connection to the RPC server.""" logger.debug("Opening connection to %s:%s", self.url.hostname, self.url.port) try: self.connection = httplib.HTTPConnection(self.url.hostname, self.url.port) self.connection.connect() except (http...
def function[connect, parameter[self]]: constant[Opens a HTTP connection to the RPC server.] call[name[logger].debug, parameter[constant[Opening connection to %s:%s], name[self].url.hostname, name[self].url.port]] <ast.Try object at 0x7da1b1131e70>
keyword[def] identifier[connect] ( identifier[self] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] , identifier[self] . identifier[url] . identifier[hostname] , identifier[self] . identifier[url] . identifier[port] ) keyword[try] : identifier[self]...
def connect(self): """Opens a HTTP connection to the RPC server.""" logger.debug('Opening connection to %s:%s', self.url.hostname, self.url.port) try: self.connection = httplib.HTTPConnection(self.url.hostname, self.url.port) self.connection.connect() # depends on [control=['try'], data=[]]...
def delete_ssh_template(auth, url, template_name= None, template_id= None): """ Takes template_name as input to issue RESTUL call to HP IMC which will delete the specific ssh template from the IMC system :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url...
def function[delete_ssh_template, parameter[auth, url, template_name, template_id]]: constant[ Takes template_name as input to issue RESTUL call to HP IMC which will delete the specific ssh template from the IMC system :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.cl...
keyword[def] identifier[delete_ssh_template] ( identifier[auth] , identifier[url] , identifier[template_name] = keyword[None] , identifier[template_id] = keyword[None] ): literal[string] keyword[try] : keyword[if] identifier[template_id] keyword[is] keyword[None] : identifier[ssh_t...
def delete_ssh_template(auth, url, template_name=None, template_id=None): """ Takes template_name as input to issue RESTUL call to HP IMC which will delete the specific ssh template from the IMC system :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: ...
def destroy(self): ''' Tear down the syndic minion ''' # We borrowed the local clients poller so give it back before # it's destroyed. Reset the local poller reference. super(Syndic, self).destroy() if hasattr(self, 'local'): del self.local if...
def function[destroy, parameter[self]]: constant[ Tear down the syndic minion ] call[call[name[super], parameter[name[Syndic], name[self]]].destroy, parameter[]] if call[name[hasattr], parameter[name[self], constant[local]]] begin[:] <ast.Delete object at 0x7da1b21e8d30> ...
keyword[def] identifier[destroy] ( identifier[self] ): literal[string] identifier[super] ( identifier[Syndic] , identifier[self] ). identifier[destroy] () keyword[if] identifier[hasattr] ( identifier[self] , literal[string] ): keyword[del] identifier[self] ...
def destroy(self): """ Tear down the syndic minion """ # We borrowed the local clients poller so give it back before # it's destroyed. Reset the local poller reference. super(Syndic, self).destroy() if hasattr(self, 'local'): del self.local # depends on [control=['if'], data...
def _unpack(formatstring, packed): """Unpack a bytestring into a value. Uses the built-in :mod:`struct` Python module. Args: * formatstring (str): String for the packing. See the :mod:`struct` module for details. * packed (str): The bytestring to be unpacked. Returns: A value....
def function[_unpack, parameter[formatstring, packed]]: constant[Unpack a bytestring into a value. Uses the built-in :mod:`struct` Python module. Args: * formatstring (str): String for the packing. See the :mod:`struct` module for details. * packed (str): The bytestring to be unpacked....
keyword[def] identifier[_unpack] ( identifier[formatstring] , identifier[packed] ): literal[string] identifier[_checkString] ( identifier[formatstring] , identifier[description] = literal[string] , identifier[minlength] = literal[int] ) identifier[_checkString] ( identifier[packed] , identifier[descri...
def _unpack(formatstring, packed): """Unpack a bytestring into a value. Uses the built-in :mod:`struct` Python module. Args: * formatstring (str): String for the packing. See the :mod:`struct` module for details. * packed (str): The bytestring to be unpacked. Returns: A value....
def findall(self, expr): """list of all matching (sub-)expressions in `expr` See also: :meth:`finditer` yields the matches (:class:`MatchDict` instances) for the matched expressions. """ result = [] try: for arg in expr.args: r...
def function[findall, parameter[self, expr]]: constant[list of all matching (sub-)expressions in `expr` See also: :meth:`finditer` yields the matches (:class:`MatchDict` instances) for the matched expressions. ] variable[result] assign[=] list[[]] <ast.Try ob...
keyword[def] identifier[findall] ( identifier[self] , identifier[expr] ): literal[string] identifier[result] =[] keyword[try] : keyword[for] identifier[arg] keyword[in] identifier[expr] . identifier[args] : identifier[result] . identifier[extend] ( identifi...
def findall(self, expr): """list of all matching (sub-)expressions in `expr` See also: :meth:`finditer` yields the matches (:class:`MatchDict` instances) for the matched expressions. """ result = [] try: for arg in expr.args: result.extend(self.fi...
def _pick_or_create_inserted_op_moment_index( self, splitter_index: int, op: ops.Operation, strategy: InsertStrategy) -> int: """Determines and prepares where an insertion will occur. Args: splitter_index: The index to insert at. op: The operation that wi...
def function[_pick_or_create_inserted_op_moment_index, parameter[self, splitter_index, op, strategy]]: constant[Determines and prepares where an insertion will occur. Args: splitter_index: The index to insert at. op: The operation that will be inserted. strategy: The...
keyword[def] identifier[_pick_or_create_inserted_op_moment_index] ( identifier[self] , identifier[splitter_index] : identifier[int] , identifier[op] : identifier[ops] . identifier[Operation] , identifier[strategy] : identifier[InsertStrategy] )-> identifier[int] : literal[string] keyword[if] ( i...
def _pick_or_create_inserted_op_moment_index(self, splitter_index: int, op: ops.Operation, strategy: InsertStrategy) -> int: """Determines and prepares where an insertion will occur. Args: splitter_index: The index to insert at. op: The operation that will be inserted. s...
def set_lacp_fallback(self, name, mode=None): """Configures the Port-Channel lacp_fallback Args: name(str): The Port-Channel interface name mode(str): The Port-Channel LACP fallback setting Valid values are 'disabled', 'static', 'individual': * ...
def function[set_lacp_fallback, parameter[self, name, mode]]: constant[Configures the Port-Channel lacp_fallback Args: name(str): The Port-Channel interface name mode(str): The Port-Channel LACP fallback setting Valid values are 'disabled', 'static', 'individual...
keyword[def] identifier[set_lacp_fallback] ( identifier[self] , identifier[name] , identifier[mode] = keyword[None] ): literal[string] keyword[if] identifier[mode] keyword[not] keyword[in] [ literal[string] , literal[string] , literal[string] ]: keyword[return] keyword[False] ...
def set_lacp_fallback(self, name, mode=None): """Configures the Port-Channel lacp_fallback Args: name(str): The Port-Channel interface name mode(str): The Port-Channel LACP fallback setting Valid values are 'disabled', 'static', 'individual': * stat...
def get_metadata_count_mat(self): ''' Returns ------- np.array with columns as categories and rows as terms ''' freq_mat = np.zeros(shape=(self.get_num_metadata(), self.get_num_categories()), dtype=int) for cat_i in range(self.get_num_categories()): mX...
def function[get_metadata_count_mat, parameter[self]]: constant[ Returns ------- np.array with columns as categories and rows as terms ] variable[freq_mat] assign[=] call[name[np].zeros, parameter[]] for taget[name[cat_i]] in starred[call[name[range], parameter[ca...
keyword[def] identifier[get_metadata_count_mat] ( identifier[self] ): literal[string] identifier[freq_mat] = identifier[np] . identifier[zeros] ( identifier[shape] =( identifier[self] . identifier[get_num_metadata] (), identifier[self] . identifier[get_num_categories] ()), identifier[dtype] = ident...
def get_metadata_count_mat(self): """ Returns ------- np.array with columns as categories and rows as terms """ freq_mat = np.zeros(shape=(self.get_num_metadata(), self.get_num_categories()), dtype=int) for cat_i in range(self.get_num_categories()): mX = (self._mX[sel...
def getdir(self, section, option, raw=False, vars=None, fallback="", validate=False): """ A convenience method which coerces the option in the specified section to a directory. """ v = self.get(section, option, raw=raw, vars=vars, fallback=fallback) v = self._convert_to_path(v) ...
def function[getdir, parameter[self, section, option, raw, vars, fallback, validate]]: constant[ A convenience method which coerces the option in the specified section to a directory. ] variable[v] assign[=] call[name[self].get, parameter[name[section], name[option]]] variable[v]...
keyword[def] identifier[getdir] ( identifier[self] , identifier[section] , identifier[option] , identifier[raw] = keyword[False] , identifier[vars] = keyword[None] , identifier[fallback] = literal[string] , identifier[validate] = keyword[False] ): literal[string] identifier[v] = identifier[self] . ...
def getdir(self, section, option, raw=False, vars=None, fallback='', validate=False): """ A convenience method which coerces the option in the specified section to a directory. """ v = self.get(section, option, raw=raw, vars=vars, fallback=fallback) v = self._convert_to_path(v) return v ...
def facets(mesh, engine=None): """ Find the list of parallel adjacent faces. Parameters --------- mesh : trimesh.Trimesh engine : str Which graph engine to use: ('scipy', 'networkx', 'graphtool') Returns --------- facets : sequence of (n,) int Groups of face ...
def function[facets, parameter[mesh, engine]]: constant[ Find the list of parallel adjacent faces. Parameters --------- mesh : trimesh.Trimesh engine : str Which graph engine to use: ('scipy', 'networkx', 'graphtool') Returns --------- facets : sequence of (n,) i...
keyword[def] identifier[facets] ( identifier[mesh] , identifier[engine] = keyword[None] ): literal[string] identifier[radii] = identifier[mesh] . identifier[face_adjacency_radius] identifier[span] = identifier[mesh] . identifier[face_adjacency_span] ...
def facets(mesh, engine=None): """ Find the list of parallel adjacent faces. Parameters --------- mesh : trimesh.Trimesh engine : str Which graph engine to use: ('scipy', 'networkx', 'graphtool') Returns --------- facets : sequence of (n,) int Groups of face ...
def check_program(self, name): """ Checks whether a program is available on the shell PATH. """ if not check_program(name): raise management.CommandError( "The program \"{name:s}\" is not available in the shell. " "Please ensure that \...
def function[check_program, parameter[self, name]]: constant[ Checks whether a program is available on the shell PATH. ] if <ast.UnaryOp object at 0x7da1b143c340> begin[:] <ast.Raise object at 0x7da1b14d8400>
keyword[def] identifier[check_program] ( identifier[self] , identifier[name] ): literal[string] keyword[if] keyword[not] identifier[check_program] ( identifier[name] ): keyword[raise] identifier[management] . identifier[CommandError] ( literal[string] lite...
def check_program(self, name): """ Checks whether a program is available on the shell PATH. """ if not check_program(name): raise management.CommandError('The program "{name:s}" is not available in the shell. Please ensure that "{name:s}" is installed and reachable through your ...
def gpu_a_trous(): """ Simple convenience function so that the a trous kernels can be easily accessed by any function. """ ker1 = SourceModule(""" __global__ void gpu_a_trous_row_kernel(float *in1, float *in2, float *wfil, int *scale) { ...
def function[gpu_a_trous, parameter[]]: constant[ Simple convenience function so that the a trous kernels can be easily accessed by any function. ] variable[ker1] assign[=] call[name[SourceModule], parameter[constant[ __global__ void gpu_a_trous_row_kernel(float *in1, flo...
keyword[def] identifier[gpu_a_trous] (): literal[string] identifier[ker1] = identifier[SourceModule] ( literal[string] , identifier[keep] = keyword[True] ) identifier[ker2] = identifier[SourceModule] ( literal[string] , identifier[keep] = keyword[True] ) keyword[return] identifier[ker1] . ide...
def gpu_a_trous(): """ Simple convenience function so that the a trous kernels can be easily accessed by any function. """ ker1 = SourceModule('\n __global__ void gpu_a_trous_row_kernel(float *in1, float *in2, float *wfil, int *scale)\n {\n ...
def urlretrieve(uri, saveas=None, retries=3, cache_dir=None): '''urllib.urlretrieve wrapper''' retries = int(retries) if retries else 3 # FIXME: make random filename (saveas) in cache_dir... # cache_dir = cache_dir or CACHE_DIR while retries: try: _path, headers = urllib.urlretri...
def function[urlretrieve, parameter[uri, saveas, retries, cache_dir]]: constant[urllib.urlretrieve wrapper] variable[retries] assign[=] <ast.IfExp object at 0x7da1b0b72bc0> while name[retries] begin[:] <ast.Try object at 0x7da1b0b736a0> return[name[_path]]
keyword[def] identifier[urlretrieve] ( identifier[uri] , identifier[saveas] = keyword[None] , identifier[retries] = literal[int] , identifier[cache_dir] = keyword[None] ): literal[string] identifier[retries] = identifier[int] ( identifier[retries] ) keyword[if] identifier[retries] keyword[else] literal[...
def urlretrieve(uri, saveas=None, retries=3, cache_dir=None): """urllib.urlretrieve wrapper""" retries = int(retries) if retries else 3 # FIXME: make random filename (saveas) in cache_dir... # cache_dir = cache_dir or CACHE_DIR while retries: try: (_path, headers) = urllib.urlret...
def diff_speed(sw_dens=1.028, dens_gcm3=1.053, seal_length=300, seal_girth=200, Cd=0.09): '''Calculate terminal velocity of animal with a body size Args ---- sw_dens: float Density of seawater (g/cm^3) dens_gcm3: float Density of animal (g/cm^3) seal_length: float ...
def function[diff_speed, parameter[sw_dens, dens_gcm3, seal_length, seal_girth, Cd]]: constant[Calculate terminal velocity of animal with a body size Args ---- sw_dens: float Density of seawater (g/cm^3) dens_gcm3: float Density of animal (g/cm^3) seal_length: float ...
keyword[def] identifier[diff_speed] ( identifier[sw_dens] = literal[int] , identifier[dens_gcm3] = literal[int] , identifier[seal_length] = literal[int] , identifier[seal_girth] = literal[int] , identifier[Cd] = literal[int] ): literal[string] keyword[import] identifier[numpy] identifier[surf] , i...
def diff_speed(sw_dens=1.028, dens_gcm3=1.053, seal_length=300, seal_girth=200, Cd=0.09): """Calculate terminal velocity of animal with a body size Args ---- sw_dens: float Density of seawater (g/cm^3) dens_gcm3: float Density of animal (g/cm^3) seal_length: float Length...
def Read(self, meta_only=False, allowed=None, cast=False): """Read the ESPA XML metadata file""" if allowed is not None and not isinstance(allowed, (list, tuple)): raise RuntimeError('`allowed` must be a list of str names.') meta = xmltodict.parse( open(self.filename...
def function[Read, parameter[self, meta_only, allowed, cast]]: constant[Read the ESPA XML metadata file] if <ast.BoolOp object at 0x7da1b09254e0> begin[:] <ast.Raise object at 0x7da1b0925210> variable[meta] assign[=] call[call[name[xmltodict].parse, parameter[call[call[name[open], parame...
keyword[def] identifier[Read] ( identifier[self] , identifier[meta_only] = keyword[False] , identifier[allowed] = keyword[None] , identifier[cast] = keyword[False] ): literal[string] keyword[if] identifier[allowed] keyword[is] keyword[not] keyword[None] keyword[and] keyword[not] identifier[i...
def Read(self, meta_only=False, allowed=None, cast=False): """Read the ESPA XML metadata file""" if allowed is not None and (not isinstance(allowed, (list, tuple))): raise RuntimeError('`allowed` must be a list of str names.') # depends on [control=['if'], data=[]] meta = xmltodict.parse(open(self....
def edit_by_id( self, id_equip_acesso, id_tipo_acesso, fqdn, user, password, enable_pass): """Edit access type, fqdn, user, password and enable_pass of the relationship of equipment and access type. :param id_ti...
def function[edit_by_id, parameter[self, id_equip_acesso, id_tipo_acesso, fqdn, user, password, enable_pass]]: constant[Edit access type, fqdn, user, password and enable_pass of the relationship of equipment and access type. :param id_tipo_acesso: Access type identifier. :param id_equip...
keyword[def] identifier[edit_by_id] ( identifier[self] , identifier[id_equip_acesso] , identifier[id_tipo_acesso] , identifier[fqdn] , identifier[user] , identifier[password] , identifier[enable_pass] ): literal[string] keyword[if] keyword[not] identifier[is_valid_int_param] ( identifier[...
def edit_by_id(self, id_equip_acesso, id_tipo_acesso, fqdn, user, password, enable_pass): """Edit access type, fqdn, user, password and enable_pass of the relationship of equipment and access type. :param id_tipo_acesso: Access type identifier. :param id_equip_acesso: Equipment identifier. ...
def _serialize_into_store(profile, filter=None): """ Takes data from app layer and serializes the models into the store. """ # ensure that we write and retrieve the counter in one go for consistency current_id = InstanceIDModel.get_current_instance_and_increment_counter() with transaction.atomi...
def function[_serialize_into_store, parameter[profile, filter]]: constant[ Takes data from app layer and serializes the models into the store. ] variable[current_id] assign[=] call[name[InstanceIDModel].get_current_instance_and_increment_counter, parameter[]] with call[name[transaction]....
keyword[def] identifier[_serialize_into_store] ( identifier[profile] , identifier[filter] = keyword[None] ): literal[string] identifier[current_id] = identifier[InstanceIDModel] . identifier[get_current_instance_and_increment_counter] () keyword[with] identifier[transaction] . identifier[atomic...
def _serialize_into_store(profile, filter=None): """ Takes data from app layer and serializes the models into the store. """ # ensure that we write and retrieve the counter in one go for consistency current_id = InstanceIDModel.get_current_instance_and_increment_counter() with transaction.atomic...
def read_settings(self): """Set the IF state from QSettings.""" extent = setting('user_extent', None, str) if extent: extent = QgsGeometry.fromWkt(extent) if not extent.isGeosValid(): extent = None crs = setting('user_extent_crs', None, str) ...
def function[read_settings, parameter[self]]: constant[Set the IF state from QSettings.] variable[extent] assign[=] call[name[setting], parameter[constant[user_extent], constant[None], name[str]]] if name[extent] begin[:] variable[extent] assign[=] call[name[QgsGeometry].fromWkt,...
keyword[def] identifier[read_settings] ( identifier[self] ): literal[string] identifier[extent] = identifier[setting] ( literal[string] , keyword[None] , identifier[str] ) keyword[if] identifier[extent] : identifier[extent] = identifier[QgsGeometry] . identifier[fromWkt] ( id...
def read_settings(self): """Set the IF state from QSettings.""" extent = setting('user_extent', None, str) if extent: extent = QgsGeometry.fromWkt(extent) if not extent.isGeosValid(): extent = None # depends on [control=['if'], data=[]] # depends on [control=['if'], data=[]] ...
def update_user_trackers(sender, topic, user, request, response, **kwargs): """ Receiver to mark a topic being viewed as read. This can result in marking the related forum tracker as read. """ TrackingHandler = get_class('forum_tracking.handler', 'TrackingHandler') # noqa track_handler = Tracking...
def function[update_user_trackers, parameter[sender, topic, user, request, response]]: constant[ Receiver to mark a topic being viewed as read. This can result in marking the related forum tracker as read. ] variable[TrackingHandler] assign[=] call[name[get_class], parameter[constant[forum_tra...
keyword[def] identifier[update_user_trackers] ( identifier[sender] , identifier[topic] , identifier[user] , identifier[request] , identifier[response] ,** identifier[kwargs] ): literal[string] identifier[TrackingHandler] = identifier[get_class] ( literal[string] , literal[string] ) identifier[track_ha...
def update_user_trackers(sender, topic, user, request, response, **kwargs): """ Receiver to mark a topic being viewed as read. This can result in marking the related forum tracker as read. """ TrackingHandler = get_class('forum_tracking.handler', 'TrackingHandler') # noqa track_handler = Tracking...
def parse(raw_email): # type: (six.string_types) -> Tuple[six.string_types, six.string_types] """Extract email from a full address. Example: 'John Doe <jdoe+github@foo.com>' -> jdoe@foo.com >>> parse("John Doe <me+github.com@someorg.com") ('me', 'someorg.com') >>> parse(42) # doctest: +IGNOR...
def function[parse, parameter[raw_email]]: constant[Extract email from a full address. Example: 'John Doe <jdoe+github@foo.com>' -> jdoe@foo.com >>> parse("John Doe <me+github.com@someorg.com") ('me', 'someorg.com') >>> parse(42) # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent...
keyword[def] identifier[parse] ( identifier[raw_email] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[raw_email] , identifier[six] . identifier[string_types] ): keyword[raise] identifier[InvalidEmail] ( literal[string] % identifier[raw_email] ) keyword[if]...
def parse(raw_email): # type: (six.string_types) -> Tuple[six.string_types, six.string_types] 'Extract email from a full address. Example:\n \'John Doe <jdoe+github@foo.com>\' -> jdoe@foo.com\n\n >>> parse("John Doe <me+github.com@someorg.com")\n (\'me\', \'someorg.com\')\n >>> parse(42) # doctes...
def system_image_type(self, system_image_type): """ Sets the system_image_type of this BuildEnvironmentRest. :param system_image_type: The system_image_type of this BuildEnvironmentRest. :type: str """ allowed_values = ["DOCKER_IMAGE", "VIRTUAL_MACHINE_RAW", "VIRTUAL_MAC...
def function[system_image_type, parameter[self, system_image_type]]: constant[ Sets the system_image_type of this BuildEnvironmentRest. :param system_image_type: The system_image_type of this BuildEnvironmentRest. :type: str ] variable[allowed_values] assign[=] list[[<as...
keyword[def] identifier[system_image_type] ( identifier[self] , identifier[system_image_type] ): literal[string] identifier[allowed_values] =[ literal[string] , literal[string] , literal[string] , literal[string] ] keyword[if] identifier[system_image_type] keyword[not] keyword[in] iden...
def system_image_type(self, system_image_type): """ Sets the system_image_type of this BuildEnvironmentRest. :param system_image_type: The system_image_type of this BuildEnvironmentRest. :type: str """ allowed_values = ['DOCKER_IMAGE', 'VIRTUAL_MACHINE_RAW', 'VIRTUAL_MACHINE_QCO...
def handle(self, *test_labels, **options): """ Set the default Gherkin test runner. """ if not options.get('testrunner', None): options['testrunner'] = test_runner_class return super(Command, self).handle(*test_labels, **options)
def function[handle, parameter[self]]: constant[ Set the default Gherkin test runner. ] if <ast.UnaryOp object at 0x7da1b1a11180> begin[:] call[name[options]][constant[testrunner]] assign[=] name[test_runner_class] return[call[call[name[super], parameter[name[Command]...
keyword[def] identifier[handle] ( identifier[self] ,* identifier[test_labels] ,** identifier[options] ): literal[string] keyword[if] keyword[not] identifier[options] . identifier[get] ( literal[string] , keyword[None] ): identifier[options] [ literal[string] ]= identifier[test_runner...
def handle(self, *test_labels, **options): """ Set the default Gherkin test runner. """ if not options.get('testrunner', None): options['testrunner'] = test_runner_class # depends on [control=['if'], data=[]] return super(Command, self).handle(*test_labels, **options)
def preload(python_data: LdapObject, database: Optional[Database] = None) -> LdapObject: """ Preload all NotLoaded fields in LdapObject. """ changes = {} # Load objects within lists. def preload_item(value: Any) -> Any: if isinstance(value, NotLoaded): return value.load(database) ...
def function[preload, parameter[python_data, database]]: constant[ Preload all NotLoaded fields in LdapObject. ] variable[changes] assign[=] dictionary[[], []] def function[preload_item, parameter[value]]: if call[name[isinstance], parameter[name[value], name[NotLoaded]]] begin[:...
keyword[def] identifier[preload] ( identifier[python_data] : identifier[LdapObject] , identifier[database] : identifier[Optional] [ identifier[Database] ]= keyword[None] )-> identifier[LdapObject] : literal[string] identifier[changes] ={} keyword[def] identifier[preload_item] ( identifier[valu...
def preload(python_data: LdapObject, database: Optional[Database]=None) -> LdapObject: """ Preload all NotLoaded fields in LdapObject. """ changes = {} # Load objects within lists. def preload_item(value: Any) -> Any: if isinstance(value, NotLoaded): return value.load(database) # d...
def make_permalink(img_id): """ Removes tmp prefix from filename and rename main and variant files. Returns img_id without tmp prefix. """ profile, filename = img_id.split(':', 1) new_img_id = profile + ':' + remove_tmp_prefix_from_filename(filename) urls = get_files_by_img_id(img_id) if...
def function[make_permalink, parameter[img_id]]: constant[ Removes tmp prefix from filename and rename main and variant files. Returns img_id without tmp prefix. ] <ast.Tuple object at 0x7da1b28bf8e0> assign[=] call[name[img_id].split, parameter[constant[:], constant[1]]] variable[ne...
keyword[def] identifier[make_permalink] ( identifier[img_id] ): literal[string] identifier[profile] , identifier[filename] = identifier[img_id] . identifier[split] ( literal[string] , literal[int] ) identifier[new_img_id] = identifier[profile] + literal[string] + identifier[remove_tmp_prefix_from_file...
def make_permalink(img_id): """ Removes tmp prefix from filename and rename main and variant files. Returns img_id without tmp prefix. """ (profile, filename) = img_id.split(':', 1) new_img_id = profile + ':' + remove_tmp_prefix_from_filename(filename) urls = get_files_by_img_id(img_id) ...
def detectSonyMylo(self): """Return detection of a Sony Mylo device Detects if the current browser is a Sony Mylo device. """ return UAgentInfo.manuSony in self.__userAgent \ and (UAgentInfo.qtembedded in self.__userAgent or UAgentInfo.mylocom2 in self.__user...
def function[detectSonyMylo, parameter[self]]: constant[Return detection of a Sony Mylo device Detects if the current browser is a Sony Mylo device. ] return[<ast.BoolOp object at 0x7da1b0aa6f20>]
keyword[def] identifier[detectSonyMylo] ( identifier[self] ): literal[string] keyword[return] identifier[UAgentInfo] . identifier[manuSony] keyword[in] identifier[self] . identifier[__userAgent] keyword[and] ( identifier[UAgentInfo] . identifier[qtembedded] keyword[in] identifier[self] . iden...
def detectSonyMylo(self): """Return detection of a Sony Mylo device Detects if the current browser is a Sony Mylo device. """ return UAgentInfo.manuSony in self.__userAgent and (UAgentInfo.qtembedded in self.__userAgent or UAgentInfo.mylocom2 in self.__userAgent)
def get_content(self): """Open content as a stream for reading. See DAVResource.get_content() """ filestream = compat.StringIO() tableName, primKey = self.provider._split_path(self.path) if primKey is not None: conn = self.provider._init_connection() ...
def function[get_content, parameter[self]]: constant[Open content as a stream for reading. See DAVResource.get_content() ] variable[filestream] assign[=] call[name[compat].StringIO, parameter[]] <ast.Tuple object at 0x7da1b01fb940> assign[=] call[name[self].provider._split_path,...
keyword[def] identifier[get_content] ( identifier[self] ): literal[string] identifier[filestream] = identifier[compat] . identifier[StringIO] () identifier[tableName] , identifier[primKey] = identifier[self] . identifier[provider] . identifier[_split_path] ( identifier[self] . identifier[...
def get_content(self): """Open content as a stream for reading. See DAVResource.get_content() """ filestream = compat.StringIO() (tableName, primKey) = self.provider._split_path(self.path) if primKey is not None: conn = self.provider._init_connection() listFields = self....
def notify3_d_event(self, type_p, data): """Notifies framebuffer about 3D backend event. in type_p of type int event type. Currently only VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA is supported. in data of type str event-specific data, depends on the supplied event type ...
def function[notify3_d_event, parameter[self, type_p, data]]: constant[Notifies framebuffer about 3D backend event. in type_p of type int event type. Currently only VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA is supported. in data of type str event-specific data, depends on...
keyword[def] identifier[notify3_d_event] ( identifier[self] , identifier[type_p] , identifier[data] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[type_p] , identifier[baseinteger] ): keyword[raise] identifier[TypeError] ( literal[string] ) ...
def notify3_d_event(self, type_p, data): """Notifies framebuffer about 3D backend event. in type_p of type int event type. Currently only VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA is supported. in data of type str event-specific data, depends on the supplied event type ...
def server(self): """ UDP server to listen for responses. """ server = getattr(self, "_server", None) if server is None: log.debug("Binding datagram server to %s", self.bind) server = DatagramServer(self.bind, self._response_received) self._ser...
def function[server, parameter[self]]: constant[ UDP server to listen for responses. ] variable[server] assign[=] call[name[getattr], parameter[name[self], constant[_server], constant[None]]] if compare[name[server] is constant[None]] begin[:] call[name[log].debug...
keyword[def] identifier[server] ( identifier[self] ): literal[string] identifier[server] = identifier[getattr] ( identifier[self] , literal[string] , keyword[None] ) keyword[if] identifier[server] keyword[is] keyword[None] : identifier[log] . identifier[debug] ( literal[str...
def server(self): """ UDP server to listen for responses. """ server = getattr(self, '_server', None) if server is None: log.debug('Binding datagram server to %s', self.bind) server = DatagramServer(self.bind, self._response_received) self._server = server # depends ...
def inherit_doc(cls): """ A decorator that makes a class inherit documentation from its parents. """ for name, func in vars(cls).items(): # only inherit docstring for public functions if name.startswith("_"): continue if not func.__doc__: for parent in cls...
def function[inherit_doc, parameter[cls]]: constant[ A decorator that makes a class inherit documentation from its parents. ] for taget[tuple[[<ast.Name object at 0x7da204961390>, <ast.Name object at 0x7da204961c30>]]] in starred[call[call[name[vars], parameter[name[cls]]].items, parameter[]]] b...
keyword[def] identifier[inherit_doc] ( identifier[cls] ): literal[string] keyword[for] identifier[name] , identifier[func] keyword[in] identifier[vars] ( identifier[cls] ). identifier[items] (): keyword[if] identifier[name] . identifier[startswith] ( literal[string] ): keywor...
def inherit_doc(cls): """ A decorator that makes a class inherit documentation from its parents. """ for (name, func) in vars(cls).items(): # only inherit docstring for public functions if name.startswith('_'): continue # depends on [control=['if'], data=[]] if not f...
def kron_dot(A, B, C, out=None): r""" Kronecker product followed by dot product. Let :math:`\mathrm A`, :math:`\mathrm B`, and :math:`\mathrm C` be matrices of dimensions :math:`p\times p`, :math:`n\times d`, and :math:`d\times p`. It computes .. math:: \text{unvec}((\mathrm A\otimes\mat...
def function[kron_dot, parameter[A, B, C, out]]: constant[ Kronecker product followed by dot product. Let :math:`\mathrm A`, :math:`\mathrm B`, and :math:`\mathrm C` be matrices of dimensions :math:`p\times p`, :math:`n\times d`, and :math:`d\times p`. It computes .. math:: \text{unv...
keyword[def] identifier[kron_dot] ( identifier[A] , identifier[B] , identifier[C] , identifier[out] = keyword[None] ): literal[string] keyword[from] identifier[numpy] keyword[import] identifier[dot] , identifier[zeros] , identifier[asarray] identifier[A] = identifier[asarray] ( identifier[A] ) ...
def kron_dot(A, B, C, out=None): """ Kronecker product followed by dot product. Let :math:`\\mathrm A`, :math:`\\mathrm B`, and :math:`\\mathrm C` be matrices of dimensions :math:`p\\times p`, :math:`n\\times d`, and :math:`d\\times p`. It computes .. math:: \\text{unvec}((\\mathrm A\\ot...
def nic_v1(msg, NICs): """Calculate NIC, navigation integrity category, for ADS-B version 1 Args: msg (string): 28 bytes hexadecimal message string NICs (int or string): NIC supplement Returns: int or string: Horizontal Radius of Containment int or string: Vertical Protecti...
def function[nic_v1, parameter[msg, NICs]]: constant[Calculate NIC, navigation integrity category, for ADS-B version 1 Args: msg (string): 28 bytes hexadecimal message string NICs (int or string): NIC supplement Returns: int or string: Horizontal Radius of Containment i...
keyword[def] identifier[nic_v1] ( identifier[msg] , identifier[NICs] ): literal[string] keyword[if] identifier[typecode] ( identifier[msg] )< literal[int] keyword[or] identifier[typecode] ( identifier[msg] )> literal[int] : keyword[raise] identifier[RuntimeError] ( literal[string] % i...
def nic_v1(msg, NICs): """Calculate NIC, navigation integrity category, for ADS-B version 1 Args: msg (string): 28 bytes hexadecimal message string NICs (int or string): NIC supplement Returns: int or string: Horizontal Radius of Containment int or string: Vertical Protecti...
def set_property_value(self, name, value, dry_run=False): """Set or remove property value. See DAVResource.set_property_value() """ raise DAVError( HTTP_FORBIDDEN, err_condition=PRECONDITION_CODE_ProtectedProperty )
def function[set_property_value, parameter[self, name, value, dry_run]]: constant[Set or remove property value. See DAVResource.set_property_value() ] <ast.Raise object at 0x7da1b01f80d0>
keyword[def] identifier[set_property_value] ( identifier[self] , identifier[name] , identifier[value] , identifier[dry_run] = keyword[False] ): literal[string] keyword[raise] identifier[DAVError] ( identifier[HTTP_FORBIDDEN] , identifier[err_condition] = identifier[PRECONDITION_CODE_Prote...
def set_property_value(self, name, value, dry_run=False): """Set or remove property value. See DAVResource.set_property_value() """ raise DAVError(HTTP_FORBIDDEN, err_condition=PRECONDITION_CODE_ProtectedProperty)
def _member_defs(self): """ A single string containing the aggregated member definitions section of the documentation page """ members = self._clsdict['__members__'] member_defs = [ self._member_def(member) for member in members if member.name is n...
def function[_member_defs, parameter[self]]: constant[ A single string containing the aggregated member definitions section of the documentation page ] variable[members] assign[=] call[name[self]._clsdict][constant[__members__]] variable[member_defs] assign[=] <ast.ListCo...
keyword[def] identifier[_member_defs] ( identifier[self] ): literal[string] identifier[members] = identifier[self] . identifier[_clsdict] [ literal[string] ] identifier[member_defs] =[ identifier[self] . identifier[_member_def] ( identifier[member] ) keyword[for] identifier[membe...
def _member_defs(self): """ A single string containing the aggregated member definitions section of the documentation page """ members = self._clsdict['__members__'] member_defs = [self._member_def(member) for member in members if member.name is not None] return '\n'.join(member_...
def NoExclusions(self): """Determine that there are no exclusion criterion in play :return: True if there is no real boundary specification of any kind. Simple method allowing parsers to short circuit the determination of missingness, which can be moderately compute intensive. ...
def function[NoExclusions, parameter[self]]: constant[Determine that there are no exclusion criterion in play :return: True if there is no real boundary specification of any kind. Simple method allowing parsers to short circuit the determination of missingness, which can be moderately ...
keyword[def] identifier[NoExclusions] ( identifier[self] ): literal[string] keyword[if] identifier[len] ( identifier[self] . identifier[start_bounds] )+ identifier[len] ( identifier[self] . identifier[target_rs] )+ identifier[len] ( identifier[self] . identifier[ignored_rs] )== literal[int] : ...
def NoExclusions(self): """Determine that there are no exclusion criterion in play :return: True if there is no real boundary specification of any kind. Simple method allowing parsers to short circuit the determination of missingness, which can be moderately compute intensive. """ ...
def to_json_basic(self): """ Create JSON structure with generic attributes :return: dict """ return {'name': self.__class__.__name__, 'priority': self.priority, 'address': self.address, 'rtr': self.rtr}
def function[to_json_basic, parameter[self]]: constant[ Create JSON structure with generic attributes :return: dict ] return[dictionary[[<ast.Constant object at 0x7da207f03e80>, <ast.Constant object at 0x7da207f02ad0>, <ast.Constant object at 0x7da207f03f10>, <ast.Constant object at...
keyword[def] identifier[to_json_basic] ( identifier[self] ): literal[string] keyword[return] { literal[string] : identifier[self] . identifier[__class__] . identifier[__name__] , literal[string] : identifier[self] . identifier[priority] , literal[string] : identifier[self] . identifier[...
def to_json_basic(self): """ Create JSON structure with generic attributes :return: dict """ return {'name': self.__class__.__name__, 'priority': self.priority, 'address': self.address, 'rtr': self.rtr}
def experiments_list(self, api_url=None, offset=0, limit=-1, properties=None): """Get list of experiment resources from a SCO-API. Parameters ---------- api_url : string, optional Base Url of the SCO-API. Uses default API if argument not present. offset : int, option...
def function[experiments_list, parameter[self, api_url, offset, limit, properties]]: constant[Get list of experiment resources from a SCO-API. Parameters ---------- api_url : string, optional Base Url of the SCO-API. Uses default API if argument not present. offset :...
keyword[def] identifier[experiments_list] ( identifier[self] , identifier[api_url] = keyword[None] , identifier[offset] = literal[int] , identifier[limit] =- literal[int] , identifier[properties] = keyword[None] ): literal[string] keyword[return] identifier[sco] . identifier[get_...
def experiments_list(self, api_url=None, offset=0, limit=-1, properties=None): """Get list of experiment resources from a SCO-API. Parameters ---------- api_url : string, optional Base Url of the SCO-API. Uses default API if argument not present. offset : int, optional ...
def set_substitution(self, what, rep): """Set a substitution. Equivalent to ``! sub`` in RiveScript code. :param str what: The original text to replace. :param str rep: The text to replace it with. Set this to ``None`` to delete the substitution. """ if rep ...
def function[set_substitution, parameter[self, what, rep]]: constant[Set a substitution. Equivalent to ``! sub`` in RiveScript code. :param str what: The original text to replace. :param str rep: The text to replace it with. Set this to ``None`` to delete the substitution. ...
keyword[def] identifier[set_substitution] ( identifier[self] , identifier[what] , identifier[rep] ): literal[string] keyword[if] identifier[rep] keyword[is] keyword[None] : keyword[if] identifier[what] keyword[in] identifier[self] . identifier[_subs] : k...
def set_substitution(self, what, rep): """Set a substitution. Equivalent to ``! sub`` in RiveScript code. :param str what: The original text to replace. :param str rep: The text to replace it with. Set this to ``None`` to delete the substitution. """ if rep is None:...
def insert_ordered(value, array): """ This will insert the value into the array, keeping it sorted, and returning the index where it was inserted """ index = 0 # search for the last array item that value is larger than for n in range(0,len(array)): if value >= array[n]: index = n+1...
def function[insert_ordered, parameter[value, array]]: constant[ This will insert the value into the array, keeping it sorted, and returning the index where it was inserted ] variable[index] assign[=] constant[0] for taget[name[n]] in starred[call[name[range], parameter[constant[0], ...
keyword[def] identifier[insert_ordered] ( identifier[value] , identifier[array] ): literal[string] identifier[index] = literal[int] keyword[for] identifier[n] keyword[in] identifier[range] ( literal[int] , identifier[len] ( identifier[array] )): keyword[if] identifier[value] >= id...
def insert_ordered(value, array): """ This will insert the value into the array, keeping it sorted, and returning the index where it was inserted """ index = 0 # search for the last array item that value is larger than for n in range(0, len(array)): if value >= array[n]: ...
def select(self, criterion, keepboth=False): """Filter current file collections, create another file collections contains all winfile with criterion=True. How to construct your own criterion function, see :meth:`FileCollection.from_path_by_criterion`. :param criterion...
def function[select, parameter[self, criterion, keepboth]]: constant[Filter current file collections, create another file collections contains all winfile with criterion=True. How to construct your own criterion function, see :meth:`FileCollection.from_path_by_criterion`. ...
keyword[def] identifier[select] ( identifier[self] , identifier[criterion] , identifier[keepboth] = keyword[False] ): literal[string] keyword[if] identifier[keepboth] : identifier[fcs_yes] , identifier[fcs_no] = identifier[FileCollection] (), identifier[FileCollection] () ...
def select(self, criterion, keepboth=False): """Filter current file collections, create another file collections contains all winfile with criterion=True. How to construct your own criterion function, see :meth:`FileCollection.from_path_by_criterion`. :param criterion: cu...
def run_to_abs_pos(self, **kwargs): """ Run to an absolute position specified by `position_sp` and then stop using the action specified in `stop_action`. """ for key in kwargs: setattr(self, key, kwargs[key]) self.command = self.COMMAND_RUN_TO_ABS_POS
def function[run_to_abs_pos, parameter[self]]: constant[ Run to an absolute position specified by `position_sp` and then stop using the action specified in `stop_action`. ] for taget[name[key]] in starred[name[kwargs]] begin[:] call[name[setattr], parameter[name[s...
keyword[def] identifier[run_to_abs_pos] ( identifier[self] ,** identifier[kwargs] ): literal[string] keyword[for] identifier[key] keyword[in] identifier[kwargs] : identifier[setattr] ( identifier[self] , identifier[key] , identifier[kwargs] [ identifier[key] ]) identifier[s...
def run_to_abs_pos(self, **kwargs): """ Run to an absolute position specified by `position_sp` and then stop using the action specified in `stop_action`. """ for key in kwargs: setattr(self, key, kwargs[key]) # depends on [control=['for'], data=['key']] self.command = self.C...
def delete(self): """Deletes matching objects from the Repository Does not throw error if no objects are matched. Returns the number of objects matched (which may not be equal to the number of objects deleted if objects rows already have the new value). """ # Fetch ...
def function[delete, parameter[self]]: constant[Deletes matching objects from the Repository Does not throw error if no objects are matched. Returns the number of objects matched (which may not be equal to the number of objects deleted if objects rows already have the new value). ...
keyword[def] identifier[delete] ( identifier[self] ): literal[string] identifier[deleted_item_count] = literal[int] keyword[try] : identifier[items] = identifier[self] . identifier[all] () keyword[for] identifier[item] keyword[in] identifier[items] :...
def delete(self): """Deletes matching objects from the Repository Does not throw error if no objects are matched. Returns the number of objects matched (which may not be equal to the number of objects deleted if objects rows already have the new value). """ # Fetch Model cl...
def build_srcdict(gta, prop): """Build a dictionary that maps from source name to the value of a source property Parameters ---------- gta : `fermipy.GTAnalysis` The analysis object prop : str The name of the property we are mapping Returns ------- odict : dict ...
def function[build_srcdict, parameter[gta, prop]]: constant[Build a dictionary that maps from source name to the value of a source property Parameters ---------- gta : `fermipy.GTAnalysis` The analysis object prop : str The name of the property we are mapping Returns ...
keyword[def] identifier[build_srcdict] ( identifier[gta] , identifier[prop] ): literal[string] identifier[o] ={} keyword[for] identifier[s] keyword[in] identifier[gta] . identifier[roi] . identifier[sources] : identifier[o] [ identifier[s] . identifier[name] ]= identifier[s] [ identifier[p...
def build_srcdict(gta, prop): """Build a dictionary that maps from source name to the value of a source property Parameters ---------- gta : `fermipy.GTAnalysis` The analysis object prop : str The name of the property we are mapping Returns ------- odict : dict ...
def send_dynamic_message(sender, message): """Send a dynamic message to the listeners. Dynamic messages represents a progress. Usually it will be appended to the previous messages. .. versionadded:: 3.3 :param sender: The sender. :type sender: object :param message: An instance of our ri...
def function[send_dynamic_message, parameter[sender, message]]: constant[Send a dynamic message to the listeners. Dynamic messages represents a progress. Usually it will be appended to the previous messages. .. versionadded:: 3.3 :param sender: The sender. :type sender: object :param...
keyword[def] identifier[send_dynamic_message] ( identifier[sender] , identifier[message] ): literal[string] identifier[dispatcher] . identifier[send] ( identifier[signal] = identifier[DYNAMIC_MESSAGE_SIGNAL] , identifier[sender] = identifier[sender] , identifier[message] = identifier[message...
def send_dynamic_message(sender, message): """Send a dynamic message to the listeners. Dynamic messages represents a progress. Usually it will be appended to the previous messages. .. versionadded:: 3.3 :param sender: The sender. :type sender: object :param message: An instance of our ri...
def _constant_probability_density(self, X): """Probability density for the degenerate case of constant distribution. Note that the output of this method will be an array whose unique values are 0 and 1. More information can be found here: https://en.wikipedia.org/wiki/Degenerate_distribution ...
def function[_constant_probability_density, parameter[self, X]]: constant[Probability density for the degenerate case of constant distribution. Note that the output of this method will be an array whose unique values are 0 and 1. More information can be found here: https://en.wikipedia.org/wiki...
keyword[def] identifier[_constant_probability_density] ( identifier[self] , identifier[X] ): literal[string] identifier[result] = identifier[np] . identifier[zeros] ( identifier[X] . identifier[shape] ) identifier[result] [ identifier[np] . identifier[nonzero] ( identifier[X] == identifier...
def _constant_probability_density(self, X): """Probability density for the degenerate case of constant distribution. Note that the output of this method will be an array whose unique values are 0 and 1. More information can be found here: https://en.wikipedia.org/wiki/Degenerate_distribution ...
def setup_package(): """ Setup the package. """ with open('requirements.txt', 'r') as req_file: install_reqs = req_file.read().split('\n') cmdclass_ = {'antlr': AntlrBuildCommand} cmdclass_.update(versioneer.get_cmdclass()) setup( version=versioneer.get_version(), n...
def function[setup_package, parameter[]]: constant[ Setup the package. ] with call[name[open], parameter[constant[requirements.txt], constant[r]]] begin[:] variable[install_reqs] assign[=] call[call[name[req_file].read, parameter[]].split, parameter[constant[ ]]] variable...
keyword[def] identifier[setup_package] (): literal[string] keyword[with] identifier[open] ( literal[string] , literal[string] ) keyword[as] identifier[req_file] : identifier[install_reqs] = identifier[req_file] . identifier[read] (). identifier[split] ( literal[string] ) identifier[cmdclas...
def setup_package(): """ Setup the package. """ with open('requirements.txt', 'r') as req_file: install_reqs = req_file.read().split('\n') # depends on [control=['with'], data=['req_file']] cmdclass_ = {'antlr': AntlrBuildCommand} cmdclass_.update(versioneer.get_cmdclass()) setup(ve...
def calc_anchors(preregistration_map, model, model_hemi, scale=1, sigma=Ellipsis, radius_weight=0, field_sign_weight=0, invert_rh_field_sign=False): ''' calc_anchors is a calculator that creates a set of anchor instructions for a registration. Required afferent parameters:...
def function[calc_anchors, parameter[preregistration_map, model, model_hemi, scale, sigma, radius_weight, field_sign_weight, invert_rh_field_sign]]: constant[ calc_anchors is a calculator that creates a set of anchor instructions for a registration. Required afferent parameters: @ invert_rh_field...
keyword[def] identifier[calc_anchors] ( identifier[preregistration_map] , identifier[model] , identifier[model_hemi] , identifier[scale] = literal[int] , identifier[sigma] = identifier[Ellipsis] , identifier[radius_weight] = literal[int] , identifier[field_sign_weight] = literal[int] , identifier[invert_rh_field_si...
def calc_anchors(preregistration_map, model, model_hemi, scale=1, sigma=Ellipsis, radius_weight=0, field_sign_weight=0, invert_rh_field_sign=False): """ calc_anchors is a calculator that creates a set of anchor instructions for a registration. Required afferent parameters: @ invert_rh_field_sign May ...
def check(self, *args): """ Checks the validity of the run parameters. Returns flag (True = OK), and a message which indicates the nature of the problem if the flag is False. """ ok = True msg = '' g = get_root(self).globals dtype = g.observe.rtyp...
def function[check, parameter[self]]: constant[ Checks the validity of the run parameters. Returns flag (True = OK), and a message which indicates the nature of the problem if the flag is False. ] variable[ok] assign[=] constant[True] variable[msg] assign[=] const...
keyword[def] identifier[check] ( identifier[self] ,* identifier[args] ): literal[string] identifier[ok] = keyword[True] identifier[msg] = literal[string] identifier[g] = identifier[get_root] ( identifier[self] ). identifier[globals] identifier[dtype] = identifier[g] ....
def check(self, *args): """ Checks the validity of the run parameters. Returns flag (True = OK), and a message which indicates the nature of the problem if the flag is False. """ ok = True msg = '' g = get_root(self).globals dtype = g.observe.rtype() expert = g.cp...
def convert_to_bool(x: Any, default: bool = None) -> bool: """ Transforms its input to a ``bool`` (or returns ``default`` if ``x`` is falsy but not itself a boolean). Accepts various common string versions. """ if isinstance(x, bool): return x if not x: # None, zero, blank string... ...
def function[convert_to_bool, parameter[x, default]]: constant[ Transforms its input to a ``bool`` (or returns ``default`` if ``x`` is falsy but not itself a boolean). Accepts various common string versions. ] if call[name[isinstance], parameter[name[x], name[bool]]] begin[:] return[...
keyword[def] identifier[convert_to_bool] ( identifier[x] : identifier[Any] , identifier[default] : identifier[bool] = keyword[None] )-> identifier[bool] : literal[string] keyword[if] identifier[isinstance] ( identifier[x] , identifier[bool] ): keyword[return] identifier[x] keyword[if] ke...
def convert_to_bool(x: Any, default: bool=None) -> bool: """ Transforms its input to a ``bool`` (or returns ``default`` if ``x`` is falsy but not itself a boolean). Accepts various common string versions. """ if isinstance(x, bool): return x # depends on [control=['if'], data=[]] if not...
def _fmt(self, tag, msg): """Format a string for inclusion in the exception's string representation. If msg is None, format to empty string. If msg has a single line, format to: tag: msg If msg has multiple lines, format to: tag: line 1 line 2 Msg is truncated to 1024 chars. ...
def function[_fmt, parameter[self, tag, msg]]: constant[Format a string for inclusion in the exception's string representation. If msg is None, format to empty string. If msg has a single line, format to: tag: msg If msg has multiple lines, format to: tag: line 1 line 2 Msg is trunc...
keyword[def] identifier[_fmt] ( identifier[self] , identifier[tag] , identifier[msg] ): literal[string] identifier[msg] = identifier[msg] keyword[or] literal[string] identifier[msg] = identifier[str] ( identifier[msg] ) identifier[msg] = identifier[msg] . identifier[strip] () ...
def _fmt(self, tag, msg): """Format a string for inclusion in the exception's string representation. If msg is None, format to empty string. If msg has a single line, format to: tag: msg If msg has multiple lines, format to: tag: line 1 line 2 Msg is truncated to 1024 chars. ""...
def authorize(self, email, permission_type='read', cloud=None, api_key=None, version=None, **kwargs): """ This API endpoint allows you to authorize another user to access your model in a read or write capacity. Before calling authorize, you must first make sure your model has been registered. ...
def function[authorize, parameter[self, email, permission_type, cloud, api_key, version]]: constant[ This API endpoint allows you to authorize another user to access your model in a read or write capacity. Before calling authorize, you must first make sure your model has been registered. ...
keyword[def] identifier[authorize] ( identifier[self] , identifier[email] , identifier[permission_type] = literal[string] , identifier[cloud] = keyword[None] , identifier[api_key] = keyword[None] , identifier[version] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ li...
def authorize(self, email, permission_type='read', cloud=None, api_key=None, version=None, **kwargs): """ This API endpoint allows you to authorize another user to access your model in a read or write capacity. Before calling authorize, you must first make sure your model has been registered. ...
def _handle_double_click(self, event): """ Double click with left mouse button focuses the element""" if event.get_button()[1] == 1: # Left mouse button path_info = self.tree_view.get_path_at_pos(int(event.x), int(event.y)) if path_info: # Valid entry was clicked on ...
def function[_handle_double_click, parameter[self, event]]: constant[ Double click with left mouse button focuses the element] if compare[call[call[name[event].get_button, parameter[]]][constant[1]] equal[==] constant[1]] begin[:] variable[path_info] assign[=] call[name[self].tree_view.g...
keyword[def] identifier[_handle_double_click] ( identifier[self] , identifier[event] ): literal[string] keyword[if] identifier[event] . identifier[get_button] ()[ literal[int] ]== literal[int] : identifier[path_info] = identifier[self] . identifier[tree_view] . identifier[get_path_at_...
def _handle_double_click(self, event): """ Double click with left mouse button focuses the element""" if event.get_button()[1] == 1: # Left mouse button path_info = self.tree_view.get_path_at_pos(int(event.x), int(event.y)) if path_info: # Valid entry was clicked on path = path_inf...
def sign_tx(network, tx, wifs=[], **kwargs): """ :param tx: a transaction :param wifs: the list of WIFs required to sign this transaction. :return: :class:`Tx <Tx>` object, modified in place This is a convenience function used to sign a transaction. The transaction must have "unspents" set by, ...
def function[sign_tx, parameter[network, tx, wifs]]: constant[ :param tx: a transaction :param wifs: the list of WIFs required to sign this transaction. :return: :class:`Tx <Tx>` object, modified in place This is a convenience function used to sign a transaction. The transaction must have "...
keyword[def] identifier[sign_tx] ( identifier[network] , identifier[tx] , identifier[wifs] =[],** identifier[kwargs] ): literal[string] identifier[keychain] = identifier[network] . identifier[keychain] () identifier[keychain] . identifier[add_secrets] (( identifier[network] . identifier[parse] . ident...
def sign_tx(network, tx, wifs=[], **kwargs): """ :param tx: a transaction :param wifs: the list of WIFs required to sign this transaction. :return: :class:`Tx <Tx>` object, modified in place This is a convenience function used to sign a transaction. The transaction must have "unspents" set by, ...
def add_plugin(self, plugin): """Add the given plugin.""" # allow plugins loaded via entry points to override builtin plugins new_name = self.plugin_name(plugin) self._plugins[:] = [p for p in self._plugins if self.plugin_name(p) != new_name] self._plu...
def function[add_plugin, parameter[self, plugin]]: constant[Add the given plugin.] variable[new_name] assign[=] call[name[self].plugin_name, parameter[name[plugin]]] call[name[self]._plugins][<ast.Slice object at 0x7da1b1b6baf0>] assign[=] <ast.ListComp object at 0x7da1b1b6b760> call[nam...
keyword[def] identifier[add_plugin] ( identifier[self] , identifier[plugin] ): literal[string] identifier[new_name] = identifier[self] . identifier[plugin_name] ( identifier[plugin] ) identifier[self] . identifier[_plugins] [:]=[ identifier[p] keyword[for] identifier[p] keyword...
def add_plugin(self, plugin): """Add the given plugin.""" # allow plugins loaded via entry points to override builtin plugins new_name = self.plugin_name(plugin) self._plugins[:] = [p for p in self._plugins if self.plugin_name(p) != new_name] self._plugins.append(plugin)
def apply_transformation(self, structure): """ Returns most primitive cell for structure. Args: structure: A structure Returns: The same structure in a conventional standard setting """ sga = SpacegroupAnalyzer(structure, symprec=self.symprec, ...
def function[apply_transformation, parameter[self, structure]]: constant[ Returns most primitive cell for structure. Args: structure: A structure Returns: The same structure in a conventional standard setting ] variable[sga] assign[=] call[name[S...
keyword[def] identifier[apply_transformation] ( identifier[self] , identifier[structure] ): literal[string] identifier[sga] = identifier[SpacegroupAnalyzer] ( identifier[structure] , identifier[symprec] = identifier[self] . identifier[symprec] , identifier[angle_tolerance] = identifier[sel...
def apply_transformation(self, structure): """ Returns most primitive cell for structure. Args: structure: A structure Returns: The same structure in a conventional standard setting """ sga = SpacegroupAnalyzer(structure, symprec=self.symprec, angle_tole...
def _grid_widgets(self): """Put the widgets in the correct position based on self.__compound.""" orient = str(self._scale.cget('orient')) self._scale.grid(row=2, column=2, sticky='ew' if orient == tk.HORIZONTAL else 'ns', padx=(0, self.__entryscalepad) if self.__compound...
def function[_grid_widgets, parameter[self]]: constant[Put the widgets in the correct position based on self.__compound.] variable[orient] assign[=] call[name[str], parameter[call[name[self]._scale.cget, parameter[constant[orient]]]]] call[name[self]._scale.grid, parameter[]] call[name[s...
keyword[def] identifier[_grid_widgets] ( identifier[self] ): literal[string] identifier[orient] = identifier[str] ( identifier[self] . identifier[_scale] . identifier[cget] ( literal[string] )) identifier[self] . identifier[_scale] . identifier[grid] ( identifier[row] = literal[int] , iden...
def _grid_widgets(self): """Put the widgets in the correct position based on self.__compound.""" orient = str(self._scale.cget('orient')) self._scale.grid(row=2, column=2, sticky='ew' if orient == tk.HORIZONTAL else 'ns', padx=(0, self.__entryscalepad) if self.__compound is tk.RIGHT else (self.__entryscalep...
def gpio_properties(self): """Returns the properties of the user-controllable GPIOs. Provided the device supports user-controllable GPIOs, they will be returned by this method. Args: self (JLink): the ``JLink`` instance Returns: A list of ``JLinkGPIODescrip...
def function[gpio_properties, parameter[self]]: constant[Returns the properties of the user-controllable GPIOs. Provided the device supports user-controllable GPIOs, they will be returned by this method. Args: self (JLink): the ``JLink`` instance Returns: A...
keyword[def] identifier[gpio_properties] ( identifier[self] ): literal[string] identifier[res] = identifier[self] . identifier[_dll] . identifier[JLINK_EMU_GPIO_GetProps] ( literal[int] , literal[int] ) keyword[if] identifier[res] < literal[int] : keyword[raise] identifier[e...
def gpio_properties(self): """Returns the properties of the user-controllable GPIOs. Provided the device supports user-controllable GPIOs, they will be returned by this method. Args: self (JLink): the ``JLink`` instance Returns: A list of ``JLinkGPIODescriptor`...
def _expect_token(self, expected): """ Compares the next token in the stream to the specified token. `expected` Expected token string to match. * Raises a ``ParseError`` exception if token doesn't match `expected`. """ item = self._lex...
def function[_expect_token, parameter[self, expected]]: constant[ Compares the next token in the stream to the specified token. `expected` Expected token string to match. * Raises a ``ParseError`` exception if token doesn't match `expected`. ] ...
keyword[def] identifier[_expect_token] ( identifier[self] , identifier[expected] ): literal[string] identifier[item] = identifier[self] . identifier[_lexer] . identifier[get_token] () keyword[if] keyword[not] identifier[item] : keyword[raise] identifier[ParseError] ( lite...
def _expect_token(self, expected): """ Compares the next token in the stream to the specified token. `expected` Expected token string to match. * Raises a ``ParseError`` exception if token doesn't match `expected`. """ item = self._lexer.get_to...
def getPcn(dsz, Nv, dimN=2, dimC=1, crp=False, zm=False): """Construct the constraint set projection function for convolutional dictionary update problem. Parameters ---------- dsz : tuple Filter support size(s), specified using the same format as the `dsz` parameter of :func:`bcrop` ...
def function[getPcn, parameter[dsz, Nv, dimN, dimC, crp, zm]]: constant[Construct the constraint set projection function for convolutional dictionary update problem. Parameters ---------- dsz : tuple Filter support size(s), specified using the same format as the `dsz` parameter of :...
keyword[def] identifier[getPcn] ( identifier[dsz] , identifier[Nv] , identifier[dimN] = literal[int] , identifier[dimC] = literal[int] , identifier[crp] = keyword[False] , identifier[zm] = keyword[False] ): literal[string] identifier[fncdict] ={( keyword[False] , keyword[False] ): identifier[_Pcn] , (...
def getPcn(dsz, Nv, dimN=2, dimC=1, crp=False, zm=False): """Construct the constraint set projection function for convolutional dictionary update problem. Parameters ---------- dsz : tuple Filter support size(s), specified using the same format as the `dsz` parameter of :func:`bcrop` ...
def save(self, *args, **kwargs): """ We want to do dimension checks and/or resizing BEFORE the original image is saved. Note that if we can't get image dimensions, it's considered an invalid image and we return without saving. If the image has changed, sets self.thumb to None, tr...
def function[save, parameter[self]]: constant[ We want to do dimension checks and/or resizing BEFORE the original image is saved. Note that if we can't get image dimensions, it's considered an invalid image and we return without saving. If the image has changed, sets self.thumb t...
keyword[def] identifier[save] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[img] = identifier[self] . identifier[image] keyword[try] : identifier[old_self] = identifier[self] . identifier[__class__] . identifier[objects] ...
def save(self, *args, **kwargs): """ We want to do dimension checks and/or resizing BEFORE the original image is saved. Note that if we can't get image dimensions, it's considered an invalid image and we return without saving. If the image has changed, sets self.thumb to None, trigge...
def simple_db_engine(reader=None, srnos=None): """engine that gets values from the simple excel 'db'""" if reader is None: reader = dbreader.Reader() logger.debug("No reader provided. Creating one myself.") info_dict = dict() info_dict["filenames"] = [reader.get_cell_name(srno) for srn...
def function[simple_db_engine, parameter[reader, srnos]]: constant[engine that gets values from the simple excel 'db'] if compare[name[reader] is constant[None]] begin[:] variable[reader] assign[=] call[name[dbreader].Reader, parameter[]] call[name[logger].debug, paramete...
keyword[def] identifier[simple_db_engine] ( identifier[reader] = keyword[None] , identifier[srnos] = keyword[None] ): literal[string] keyword[if] identifier[reader] keyword[is] keyword[None] : identifier[reader] = identifier[dbreader] . identifier[Reader] () identifier[logger] . ident...
def simple_db_engine(reader=None, srnos=None): """engine that gets values from the simple excel 'db'""" if reader is None: reader = dbreader.Reader() logger.debug('No reader provided. Creating one myself.') # depends on [control=['if'], data=['reader']] info_dict = dict() info_dict['fil...
def is_parsable(url): """Check if the given URL is parsable (make sure it's a valid URL). If it is parsable, also cache it. Args: url (str): The URL to check. Returns: bool: True if parsable, False otherwise. """ try: parsed = urlparse(url)...
def function[is_parsable, parameter[url]]: constant[Check if the given URL is parsable (make sure it's a valid URL). If it is parsable, also cache it. Args: url (str): The URL to check. Returns: bool: True if parsable, False otherwise. ] <ast.Try object at ...
keyword[def] identifier[is_parsable] ( identifier[url] ): literal[string] keyword[try] : identifier[parsed] = identifier[urlparse] ( identifier[url] ) identifier[URLHelper] . identifier[__cache] [ identifier[url] ]= identifier[parsed] keyword[return] keywor...
def is_parsable(url): """Check if the given URL is parsable (make sure it's a valid URL). If it is parsable, also cache it. Args: url (str): The URL to check. Returns: bool: True if parsable, False otherwise. """ try: parsed = urlparse(url) URLH...
def prune_directory(self): """Delete any objects that can be loaded and are expired according to the current lifetime setting. A file will be deleted if the following conditions are met: - The file extension matches :py:meth:`bucketcache.backends.Backend.file_extension` - The o...
def function[prune_directory, parameter[self]]: constant[Delete any objects that can be loaded and are expired according to the current lifetime setting. A file will be deleted if the following conditions are met: - The file extension matches :py:meth:`bucketcache.backends.Backend.file...
keyword[def] identifier[prune_directory] ( identifier[self] ): literal[string] identifier[glob] = literal[string] . identifier[format] ( identifier[ext] = identifier[self] . identifier[backend] . identifier[file_extension] ) identifier[totalsize] = literal[int] identifier[totalnu...
def prune_directory(self): """Delete any objects that can be loaded and are expired according to the current lifetime setting. A file will be deleted if the following conditions are met: - The file extension matches :py:meth:`bucketcache.backends.Backend.file_extension` - The objec...
def list_vpnservices(self, retrieve_all=True, **_params): """Fetches a list of all configured VPN services for a project.""" return self.list('vpnservices', self.vpnservices_path, retrieve_all, **_params)
def function[list_vpnservices, parameter[self, retrieve_all]]: constant[Fetches a list of all configured VPN services for a project.] return[call[name[self].list, parameter[constant[vpnservices], name[self].vpnservices_path, name[retrieve_all]]]]
keyword[def] identifier[list_vpnservices] ( identifier[self] , identifier[retrieve_all] = keyword[True] ,** identifier[_params] ): literal[string] keyword[return] identifier[self] . identifier[list] ( literal[string] , identifier[self] . identifier[vpnservices_path] , identifier[retrieve_all] , ...
def list_vpnservices(self, retrieve_all=True, **_params): """Fetches a list of all configured VPN services for a project.""" return self.list('vpnservices', self.vpnservices_path, retrieve_all, **_params)
def reboot(vm_name, call=None): ''' Call GCE 'reset' on the instance. CLI Example: .. code-block:: bash salt-cloud -a reboot myinstance ''' if call != 'action': raise SaltCloudSystemExit( 'The reboot action must be called with -a or --action.' ) conn =...
def function[reboot, parameter[vm_name, call]]: constant[ Call GCE 'reset' on the instance. CLI Example: .. code-block:: bash salt-cloud -a reboot myinstance ] if compare[name[call] not_equal[!=] constant[action]] begin[:] <ast.Raise object at 0x7da1b21845b0> v...
keyword[def] identifier[reboot] ( identifier[vm_name] , identifier[call] = keyword[None] ): literal[string] keyword[if] identifier[call] != literal[string] : keyword[raise] identifier[SaltCloudSystemExit] ( literal[string] ) identifier[conn] = identifier[get_conn] () ...
def reboot(vm_name, call=None): """ Call GCE 'reset' on the instance. CLI Example: .. code-block:: bash salt-cloud -a reboot myinstance """ if call != 'action': raise SaltCloudSystemExit('The reboot action must be called with -a or --action.') # depends on [control=['if'], da...
def kpath_from_seekpath(cls, seekpath, point_coords): r"""Convert seekpath-formatted kpoints path to sumo-preferred format. If 'GAMMA' is used as a label this will be replaced by '\Gamma'. Args: seekpath (list): A :obj:`list` of 2-tuples containing the labels at eac...
def function[kpath_from_seekpath, parameter[cls, seekpath, point_coords]]: constant[Convert seekpath-formatted kpoints path to sumo-preferred format. If 'GAMMA' is used as a label this will be replaced by '\Gamma'. Args: seekpath (list): A :obj:`list` of 2-tuples containing the lab...
keyword[def] identifier[kpath_from_seekpath] ( identifier[cls] , identifier[seekpath] , identifier[point_coords] ): literal[string] identifier[path] =[[ identifier[seekpath] [ literal[int] ][ literal[int] ]]] keyword[for] ( identifier[k1] , identifier[k2] ) keyword[in] i...
def kpath_from_seekpath(cls, seekpath, point_coords): """Convert seekpath-formatted kpoints path to sumo-preferred format. If 'GAMMA' is used as a label this will be replaced by '\\Gamma'. Args: seekpath (list): A :obj:`list` of 2-tuples containing the labels at each si...
def _define_array_view(data_type): """Define a new view object for a `Array` type.""" element_type = data_type.element_type element_view = _resolve_view(element_type) if element_view is None: mixins = (_DirectArrayViewMixin,) attributes = _get_mixin_attributes(mixins) elif isinstance...
def function[_define_array_view, parameter[data_type]]: constant[Define a new view object for a `Array` type.] variable[element_type] assign[=] name[data_type].element_type variable[element_view] assign[=] call[name[_resolve_view], parameter[name[element_type]]] if compare[name[element_v...
keyword[def] identifier[_define_array_view] ( identifier[data_type] ): literal[string] identifier[element_type] = identifier[data_type] . identifier[element_type] identifier[element_view] = identifier[_resolve_view] ( identifier[element_type] ) keyword[if] identifier[element_view] keyword[is] ...
def _define_array_view(data_type): """Define a new view object for a `Array` type.""" element_type = data_type.element_type element_view = _resolve_view(element_type) if element_view is None: mixins = (_DirectArrayViewMixin,) attributes = _get_mixin_attributes(mixins) # depends on [cont...
def derivatives(self, x, y, Rs, theta_Rs, r_core, center_x=0, center_y=0): """ deflection angles :param x: x coordinate :param y: y coordinate :param Rs: scale radius :param rho0: central core density :param r_core: core radius :param center_x: :pa...
def function[derivatives, parameter[self, x, y, Rs, theta_Rs, r_core, center_x, center_y]]: constant[ deflection angles :param x: x coordinate :param y: y coordinate :param Rs: scale radius :param rho0: central core density :param r_core: core radius :para...
keyword[def] identifier[derivatives] ( identifier[self] , identifier[x] , identifier[y] , identifier[Rs] , identifier[theta_Rs] , identifier[r_core] , identifier[center_x] = literal[int] , identifier[center_y] = literal[int] ): literal[string] identifier[rho0] = identifier[self] . identifier[_alph...
def derivatives(self, x, y, Rs, theta_Rs, r_core, center_x=0, center_y=0): """ deflection angles :param x: x coordinate :param y: y coordinate :param Rs: scale radius :param rho0: central core density :param r_core: core radius :param center_x: :param ...
def set_empty_region(self, region_id, type_id, generated_at, error_if_entries_present=True): """ Prepares for the given region+item combo by instantiating a :py:class:`HistoryItemsInRegionList` instance, which will track region ID, type ID, and generated time. Th...
def function[set_empty_region, parameter[self, region_id, type_id, generated_at, error_if_entries_present]]: constant[ Prepares for the given region+item combo by instantiating a :py:class:`HistoryItemsInRegionList` instance, which will track region ID, type ID, and generated time. This ...
keyword[def] identifier[set_empty_region] ( identifier[self] , identifier[region_id] , identifier[type_id] , identifier[generated_at] , identifier[error_if_entries_present] = keyword[True] ): literal[string] identifier[key] = literal[string] %( identifier[region_id] , identifier[type_id] ) ...
def set_empty_region(self, region_id, type_id, generated_at, error_if_entries_present=True): """ Prepares for the given region+item combo by instantiating a :py:class:`HistoryItemsInRegionList` instance, which will track region ID, type ID, and generated time. This is mostly used for ...
def exhaustive_ontology_ilx_diff_row_only( self, ontology_row: dict ) -> dict: ''' WARNING RUNTIME IS AWEFUL ''' results = [] header = ['Index'] + list(self.existing_ids.columns) for row in self.existing_ids.itertuples(): row = {header[i]:val for i, val in enumerate(row)} ...
def function[exhaustive_ontology_ilx_diff_row_only, parameter[self, ontology_row]]: constant[ WARNING RUNTIME IS AWEFUL ] variable[results] assign[=] list[[]] variable[header] assign[=] binary_operation[list[[<ast.Constant object at 0x7da1b1ad4790>]] + call[name[list], parameter[name[self].exist...
keyword[def] identifier[exhaustive_ontology_ilx_diff_row_only] ( identifier[self] , identifier[ontology_row] : identifier[dict] )-> identifier[dict] : literal[string] identifier[results] =[] identifier[header] =[ literal[string] ]+ identifier[list] ( identifier[self] . identifier[existing_...
def exhaustive_ontology_ilx_diff_row_only(self, ontology_row: dict) -> dict: """ WARNING RUNTIME IS AWEFUL """ results = [] header = ['Index'] + list(self.existing_ids.columns) for row in self.existing_ids.itertuples(): row = {header[i]: val for (i, val) in enumerate(row)} check_list = [...
def checksum(data): """ :return: int """ assert isinstance(data, bytes) assert len(data) >= MINIMUM_MESSAGE_SIZE - 2 assert len(data) <= MAXIMUM_MESSAGE_SIZE - 2 __checksum = 0 for data_byte in data: __checksum += data_byte __checksum = -(__checksum % 256) + 256 try: ...
def function[checksum, parameter[data]]: constant[ :return: int ] assert[call[name[isinstance], parameter[name[data], name[bytes]]]] assert[compare[call[name[len], parameter[name[data]]] greater_or_equal[>=] binary_operation[name[MINIMUM_MESSAGE_SIZE] - constant[2]]]] assert[compare[call[nam...
keyword[def] identifier[checksum] ( identifier[data] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[data] , identifier[bytes] ) keyword[assert] identifier[len] ( identifier[data] )>= identifier[MINIMUM_MESSAGE_SIZE] - literal[int] keyword[assert] identifier[len] ( iden...
def checksum(data): """ :return: int """ assert isinstance(data, bytes) assert len(data) >= MINIMUM_MESSAGE_SIZE - 2 assert len(data) <= MAXIMUM_MESSAGE_SIZE - 2 __checksum = 0 for data_byte in data: __checksum += data_byte # depends on [control=['for'], data=['data_byte']] ...
def _find_adapter(registry, ob): """Return an adapter factory for `ob` from `registry`""" types = _always_object(inspect.getmro(getattr(ob, '__class__', type(ob)))) for t in types: if t in registry: return registry[t]
def function[_find_adapter, parameter[registry, ob]]: constant[Return an adapter factory for `ob` from `registry`] variable[types] assign[=] call[name[_always_object], parameter[call[name[inspect].getmro, parameter[call[name[getattr], parameter[name[ob], constant[__class__], call[name[type], parameter[n...
keyword[def] identifier[_find_adapter] ( identifier[registry] , identifier[ob] ): literal[string] identifier[types] = identifier[_always_object] ( identifier[inspect] . identifier[getmro] ( identifier[getattr] ( identifier[ob] , literal[string] , identifier[type] ( identifier[ob] )))) keyword[for] id...
def _find_adapter(registry, ob): """Return an adapter factory for `ob` from `registry`""" types = _always_object(inspect.getmro(getattr(ob, '__class__', type(ob)))) for t in types: if t in registry: return registry[t] # depends on [control=['if'], data=['t', 'registry']] # depends on [...
def delete_tag(self, tags): """Delete tags for a Point in the language you specify. Case will be ignored and any tags matching lower-cased will be deleted. Raises [IOTException](./Exceptions.m.html#IoticAgent.IOT.Exceptions.IOTException) containing the error if the infrastructure detect...
def function[delete_tag, parameter[self, tags]]: constant[Delete tags for a Point in the language you specify. Case will be ignored and any tags matching lower-cased will be deleted. Raises [IOTException](./Exceptions.m.html#IoticAgent.IOT.Exceptions.IOTException) containing the error i...
keyword[def] identifier[delete_tag] ( identifier[self] , identifier[tags] ): literal[string] keyword[if] identifier[isinstance] ( identifier[tags] , identifier[str] ): identifier[tags] =[ identifier[tags] ] identifier[evt] = identifier[self] . identifier[_client] . identifie...
def delete_tag(self, tags): """Delete tags for a Point in the language you specify. Case will be ignored and any tags matching lower-cased will be deleted. Raises [IOTException](./Exceptions.m.html#IoticAgent.IOT.Exceptions.IOTException) containing the error if the infrastructure detects a ...
def symmetric_elliot_function( signal, derivative=False ): """ A fast approximation of tanh """ s = 1.0 # steepness abs_signal = (1 + np.abs(signal * s)) if derivative: return s / abs_signal**2 else: # Return the activation signal return (signal * s) / abs_signal
def function[symmetric_elliot_function, parameter[signal, derivative]]: constant[ A fast approximation of tanh ] variable[s] assign[=] constant[1.0] variable[abs_signal] assign[=] binary_operation[constant[1] + call[name[np].abs, parameter[binary_operation[name[signal] * name[s]]]]] if n...
keyword[def] identifier[symmetric_elliot_function] ( identifier[signal] , identifier[derivative] = keyword[False] ): literal[string] identifier[s] = literal[int] identifier[abs_signal] =( literal[int] + identifier[np] . identifier[abs] ( identifier[signal] * identifier[s] )) keyword[if] identi...
def symmetric_elliot_function(signal, derivative=False): """ A fast approximation of tanh """ s = 1.0 # steepness abs_signal = 1 + np.abs(signal * s) if derivative: return s / abs_signal ** 2 # depends on [control=['if'], data=[]] else: # Return the activation signal return...
def from_object(cls, obj): # type: (Any) -> UrlPath """ Attempt to convert any object into a UrlPath. Raise a value error if this is not possible. """ if isinstance(obj, UrlPath): return obj if isinstance(obj, _compat.string_types): return...
def function[from_object, parameter[cls, obj]]: constant[ Attempt to convert any object into a UrlPath. Raise a value error if this is not possible. ] if call[name[isinstance], parameter[name[obj], name[UrlPath]]] begin[:] return[name[obj]] if call[name[isinstanc...
keyword[def] identifier[from_object] ( identifier[cls] , identifier[obj] ): literal[string] keyword[if] identifier[isinstance] ( identifier[obj] , identifier[UrlPath] ): keyword[return] identifier[obj] keyword[if] identifier[isinstance] ( identifier[obj] , identifier[_com...
def from_object(cls, obj): # type: (Any) -> UrlPath '\n Attempt to convert any object into a UrlPath.\n\n Raise a value error if this is not possible.\n ' if isinstance(obj, UrlPath): return obj # depends on [control=['if'], data=[]] if isinstance(obj, _compat.string_types)...
def _indexMib(self): """Rebuild a tree from MIB objects found at currently loaded modules. If currently existing tree is out of date, walk over all Managed Objects and Instances to structure Management Instrumentation objects into a tree of the following layout: MibTree ...
def function[_indexMib, parameter[self]]: constant[Rebuild a tree from MIB objects found at currently loaded modules. If currently existing tree is out of date, walk over all Managed Objects and Instances to structure Management Instrumentation objects into a tree of the following layou...
keyword[def] identifier[_indexMib] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[lastBuildId] == identifier[self] . identifier[mibBuilder] . identifier[lastBuildId] : keyword[return] ( identifier[MibScalarInstance] , identifier[MibScalar] , ...
def _indexMib(self): """Rebuild a tree from MIB objects found at currently loaded modules. If currently existing tree is out of date, walk over all Managed Objects and Instances to structure Management Instrumentation objects into a tree of the following layout: MibTree |...
def resource(self, uri, methods=frozenset({'GET'}), host=None, strict_slashes=None, stream=False, version=None, name=None, **kwargs): """ Create a blueprint resource route from a decorated function. :param uri: endpoint at which the route will be accessible. ...
def function[resource, parameter[self, uri, methods, host, strict_slashes, stream, version, name]]: constant[ Create a blueprint resource route from a decorated function. :param uri: endpoint at which the route will be accessible. :param methods: list of acceptable HTTP methods. ...
keyword[def] identifier[resource] ( identifier[self] , identifier[uri] , identifier[methods] = identifier[frozenset] ({ literal[string] }), identifier[host] = keyword[None] , identifier[strict_slashes] = keyword[None] , identifier[stream] = keyword[False] , identifier[version] = keyword[None] , identifier[name] = ke...
def resource(self, uri, methods=frozenset({'GET'}), host=None, strict_slashes=None, stream=False, version=None, name=None, **kwargs): """ Create a blueprint resource route from a decorated function. :param uri: endpoint at which the route will be accessible. :param methods: list of acceptab...
def open_fastq(in_file): """ open a fastq file, using gzip if it is gzipped from bcbio package """ _, ext = os.path.splitext(in_file) if ext == ".gz": return gzip.open(in_file, 'rb') if ext in [".fastq", ".fq", ".fasta", ".fa"]: return open(in_file, 'r') return ValueError("Fi...
def function[open_fastq, parameter[in_file]]: constant[ open a fastq file, using gzip if it is gzipped from bcbio package ] <ast.Tuple object at 0x7da1b0274eb0> assign[=] call[name[os].path.splitext, parameter[name[in_file]]] if compare[name[ext] equal[==] constant[.gz]] begin[:] ...
keyword[def] identifier[open_fastq] ( identifier[in_file] ): literal[string] identifier[_] , identifier[ext] = identifier[os] . identifier[path] . identifier[splitext] ( identifier[in_file] ) keyword[if] identifier[ext] == literal[string] : keyword[return] identifier[gzip] . identifier[open...
def open_fastq(in_file): """ open a fastq file, using gzip if it is gzipped from bcbio package """ (_, ext) = os.path.splitext(in_file) if ext == '.gz': return gzip.open(in_file, 'rb') # depends on [control=['if'], data=[]] if ext in ['.fastq', '.fq', '.fasta', '.fa']: return op...
def freeze(name=None, force=False, **kwargs): ''' Save the list of package and repos in a freeze file. As this module is build on top of the pkg module, the user can send extra attributes to the underlying pkg module via kwargs. This function will call ``pkg.list_pkgs`` and ``pkg.list_repos``, ...
def function[freeze, parameter[name, force]]: constant[ Save the list of package and repos in a freeze file. As this module is build on top of the pkg module, the user can send extra attributes to the underlying pkg module via kwargs. This function will call ``pkg.list_pkgs`` and ``pkg.list_rep...
keyword[def] identifier[freeze] ( identifier[name] = keyword[None] , identifier[force] = keyword[False] ,** identifier[kwargs] ): literal[string] identifier[states_path] = identifier[_states_path] () keyword[try] : identifier[os] . identifier[makedirs] ( identifier[states_path] ) keywor...
def freeze(name=None, force=False, **kwargs): """ Save the list of package and repos in a freeze file. As this module is build on top of the pkg module, the user can send extra attributes to the underlying pkg module via kwargs. This function will call ``pkg.list_pkgs`` and ``pkg.list_repos``, ...
def divide_url(self, url): """ divide url into host and path two parts """ if 'https://' in url: host = url[8:].split('/')[0] path = url[8 + len(host):] elif 'http://' in url: host = url[7:].split('/')[0] path = url[7 + len(host):] ...
def function[divide_url, parameter[self, url]]: constant[ divide url into host and path two parts ] if compare[constant[https://] in name[url]] begin[:] variable[host] assign[=] call[call[call[name[url]][<ast.Slice object at 0x7da1b282b280>].split, parameter[constant[/]]]...
keyword[def] identifier[divide_url] ( identifier[self] , identifier[url] ): literal[string] keyword[if] literal[string] keyword[in] identifier[url] : identifier[host] = identifier[url] [ literal[int] :]. identifier[split] ( literal[string] )[ literal[int] ] identifier[p...
def divide_url(self, url): """ divide url into host and path two parts """ if 'https://' in url: host = url[8:].split('/')[0] path = url[8 + len(host):] # depends on [control=['if'], data=['url']] elif 'http://' in url: host = url[7:].split('/')[0] path = url...
def _connected(self, link_uri): """ This callback is called form the Crazyflie API when a Crazyflie has been connected and the TOCs have been downloaded.""" print('Connected to %s' % link_uri) # The definition of the logconfig can be made before connecting self._lg_stab = LogCon...
def function[_connected, parameter[self, link_uri]]: constant[ This callback is called form the Crazyflie API when a Crazyflie has been connected and the TOCs have been downloaded.] call[name[print], parameter[binary_operation[constant[Connected to %s] <ast.Mod object at 0x7da2590d6920> name[lin...
keyword[def] identifier[_connected] ( identifier[self] , identifier[link_uri] ): literal[string] identifier[print] ( literal[string] % identifier[link_uri] ) identifier[self] . identifier[_lg_stab] = identifier[LogConfig] ( identifier[name] = literal[string] , identifier[period_i...
def _connected(self, link_uri): """ This callback is called form the Crazyflie API when a Crazyflie has been connected and the TOCs have been downloaded.""" print('Connected to %s' % link_uri) # The definition of the logconfig can be made before connecting self._lg_stab = LogConfig(name='Stabili...
def parse_cuda_device(cuda_device: Union[str, int, List[int]]) -> Union[int, List[int]]: """ Disambiguates single GPU and multiple GPU settings for cuda_device param. """ def from_list(strings): if len(strings) > 1: return [int(d) for d in strings] elif len(strings) == 1: ...
def function[parse_cuda_device, parameter[cuda_device]]: constant[ Disambiguates single GPU and multiple GPU settings for cuda_device param. ] def function[from_list, parameter[strings]]: if compare[call[name[len], parameter[name[strings]]] greater[>] constant[1]] begin[:] ...
keyword[def] identifier[parse_cuda_device] ( identifier[cuda_device] : identifier[Union] [ identifier[str] , identifier[int] , identifier[List] [ identifier[int] ]])-> identifier[Union] [ identifier[int] , identifier[List] [ identifier[int] ]]: literal[string] keyword[def] identifier[from_list] ( identifi...
def parse_cuda_device(cuda_device: Union[str, int, List[int]]) -> Union[int, List[int]]: """ Disambiguates single GPU and multiple GPU settings for cuda_device param. """ def from_list(strings): if len(strings) > 1: return [int(d) for d in strings] # depends on [control=['if'], dat...
def _init_nxapi(opts): ''' Open a connection to the NX-OS switch over NX-API. As the communication is HTTP(S) based, there is no connection to maintain, however, in order to test the connectivity and make sure we are able to bring up this Minion, we are executing a very simple command (``show clock...
def function[_init_nxapi, parameter[opts]]: constant[ Open a connection to the NX-OS switch over NX-API. As the communication is HTTP(S) based, there is no connection to maintain, however, in order to test the connectivity and make sure we are able to bring up this Minion, we are executing a ve...
keyword[def] identifier[_init_nxapi] ( identifier[opts] ): literal[string] identifier[proxy_dict] = identifier[opts] . identifier[get] ( literal[string] ,{}) identifier[conn_args] = identifier[copy] . identifier[deepcopy] ( identifier[proxy_dict] ) identifier[conn_args] . identifier[pop] ( litera...
def _init_nxapi(opts): """ Open a connection to the NX-OS switch over NX-API. As the communication is HTTP(S) based, there is no connection to maintain, however, in order to test the connectivity and make sure we are able to bring up this Minion, we are executing a very simple command (``show clock...
def get_genus_type(self): """Gets the genus type of this object. return: (osid.type.Type) - the genus type of this object compliance: mandatory - This method must be implemented. """ if self._my_genus_type_map is None: url_path = '/handcar/services/learning/types/' ...
def function[get_genus_type, parameter[self]]: constant[Gets the genus type of this object. return: (osid.type.Type) - the genus type of this object compliance: mandatory - This method must be implemented. ] if compare[name[self]._my_genus_type_map is constant[None]] begin[:] ...
keyword[def] identifier[get_genus_type] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_my_genus_type_map] keyword[is] keyword[None] : identifier[url_path] = literal[string] + identifier[self] . identifier[_my_map] [ literal[string] ] ...
def get_genus_type(self): """Gets the genus type of this object. return: (osid.type.Type) - the genus type of this object compliance: mandatory - This method must be implemented. """ if self._my_genus_type_map is None: url_path = '/handcar/services/learning/types/' + self._my_m...
def outputs_of(self, partition_index): """The outputs of the partition at ``partition_index``. Note that this returns a tuple of element indices, since coarse- grained blackboxes may have multiple outputs. """ partition = self.partition[partition_index] outputs = set(par...
def function[outputs_of, parameter[self, partition_index]]: constant[The outputs of the partition at ``partition_index``. Note that this returns a tuple of element indices, since coarse- grained blackboxes may have multiple outputs. ] variable[partition] assign[=] call[name[self...
keyword[def] identifier[outputs_of] ( identifier[self] , identifier[partition_index] ): literal[string] identifier[partition] = identifier[self] . identifier[partition] [ identifier[partition_index] ] identifier[outputs] = identifier[set] ( identifier[partition] ). identifier[intersection]...
def outputs_of(self, partition_index): """The outputs of the partition at ``partition_index``. Note that this returns a tuple of element indices, since coarse- grained blackboxes may have multiple outputs. """ partition = self.partition[partition_index] outputs = set(partition).inte...
def makeHttpRequest(method, url, payload, headers, retries=MAX_RETRIES, session=None): """ Make an HTTP request and retry it until success, return request """ retry = -1 response = None while retry < retries: retry += 1 # if this isn't the first retry then we sleep if retry > 0: ...
def function[makeHttpRequest, parameter[method, url, payload, headers, retries, session]]: constant[ Make an HTTP request and retry it until success, return request ] variable[retry] assign[=] <ast.UnaryOp object at 0x7da1b0471090> variable[response] assign[=] constant[None] while compar...
keyword[def] identifier[makeHttpRequest] ( identifier[method] , identifier[url] , identifier[payload] , identifier[headers] , identifier[retries] = identifier[MAX_RETRIES] , identifier[session] = keyword[None] ): literal[string] identifier[retry] =- literal[int] identifier[response] = keyword[None] ...
def makeHttpRequest(method, url, payload, headers, retries=MAX_RETRIES, session=None): """ Make an HTTP request and retry it until success, return request """ retry = -1 response = None while retry < retries: retry += 1 # if this isn't the first retry then we sleep if retry > 0: ...
def copy(self): """Return a shallow copy of a RangeSet.""" cpy = self.__class__() cpy._autostep = self._autostep cpy.padding = self.padding cpy.update(self) return cpy
def function[copy, parameter[self]]: constant[Return a shallow copy of a RangeSet.] variable[cpy] assign[=] call[name[self].__class__, parameter[]] name[cpy]._autostep assign[=] name[self]._autostep name[cpy].padding assign[=] name[self].padding call[name[cpy].update, parameter[n...
keyword[def] identifier[copy] ( identifier[self] ): literal[string] identifier[cpy] = identifier[self] . identifier[__class__] () identifier[cpy] . identifier[_autostep] = identifier[self] . identifier[_autostep] identifier[cpy] . identifier[padding] = identifier[self] . identifi...
def copy(self): """Return a shallow copy of a RangeSet.""" cpy = self.__class__() cpy._autostep = self._autostep cpy.padding = self.padding cpy.update(self) return cpy
def get_acronyms(fulltext): """Find acronyms and expansions from the fulltext. If needed, acronyms can already contain a dictionary of previously found acronyms that will be merged with the current results. """ acronyms = {} for m in ACRONYM_BRACKETS_REGEX.finditer(fulltext): acronym ...
def function[get_acronyms, parameter[fulltext]]: constant[Find acronyms and expansions from the fulltext. If needed, acronyms can already contain a dictionary of previously found acronyms that will be merged with the current results. ] variable[acronyms] assign[=] dictionary[[], []] ...
keyword[def] identifier[get_acronyms] ( identifier[fulltext] ): literal[string] identifier[acronyms] ={} keyword[for] identifier[m] keyword[in] identifier[ACRONYM_BRACKETS_REGEX] . identifier[finditer] ( identifier[fulltext] ): identifier[acronym] = identifier[DOTS_REGEX] . identifier[sub...
def get_acronyms(fulltext): """Find acronyms and expansions from the fulltext. If needed, acronyms can already contain a dictionary of previously found acronyms that will be merged with the current results. """ acronyms = {} for m in ACRONYM_BRACKETS_REGEX.finditer(fulltext): acronym =...
def add_to_starred(self, starred): """ :calls: `PUT /user/starred/:owner/:repo <http://developer.github.com/v3/activity/starring>`_ :param starred: :class:`github.Repository.Repository` :rtype: None """ assert isinstance(starred, github.Repository.Repository), starred ...
def function[add_to_starred, parameter[self, starred]]: constant[ :calls: `PUT /user/starred/:owner/:repo <http://developer.github.com/v3/activity/starring>`_ :param starred: :class:`github.Repository.Repository` :rtype: None ] assert[call[name[isinstance], parameter[name[sta...
keyword[def] identifier[add_to_starred] ( identifier[self] , identifier[starred] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[starred] , identifier[github] . identifier[Repository] . identifier[Repository] ), identifier[starred] identifier[headers] , identifier[...
def add_to_starred(self, starred): """ :calls: `PUT /user/starred/:owner/:repo <http://developer.github.com/v3/activity/starring>`_ :param starred: :class:`github.Repository.Repository` :rtype: None """ assert isinstance(starred, github.Repository.Repository), starred (header...
def main(): '''Main routine.''' # validate command line arguments arg_parser = argparse.ArgumentParser() arg_parser.add_argument('--vmssname', '-n', required=True, action='store', help='Scale set name') arg_parser.add_argument('--rgname', '-g', required=True, action='sto...
def function[main, parameter[]]: constant[Main routine.] variable[arg_parser] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[arg_parser].add_argument, parameter[constant[--vmssname], constant[-n]]] call[name[arg_parser].add_argument, parameter[constant[--rgname], co...
keyword[def] identifier[main] (): literal[string] identifier[arg_parser] = identifier[argparse] . identifier[ArgumentParser] () identifier[arg_parser] . identifier[add_argument] ( literal[string] , literal[string] , identifier[required] = keyword[True] , identifier[action] = literal[string] , ...
def main(): """Main routine.""" # validate command line arguments arg_parser = argparse.ArgumentParser() arg_parser.add_argument('--vmssname', '-n', required=True, action='store', help='Scale set name') arg_parser.add_argument('--rgname', '-g', required=True, action='store', help='Resource Group Nam...
def trace_symlink_target(link): """ Given a file that is known to be a symlink, trace it to its ultimate target. Raises TargetNotPresent when the target cannot be determined. Raises ValueError when the specified link is not a symlink. """ if not is_symlink(link): raise ValueError("link must point to a symlin...
def function[trace_symlink_target, parameter[link]]: constant[ Given a file that is known to be a symlink, trace it to its ultimate target. Raises TargetNotPresent when the target cannot be determined. Raises ValueError when the specified link is not a symlink. ] if <ast.UnaryOp object at 0x7da1b2...
keyword[def] identifier[trace_symlink_target] ( identifier[link] ): literal[string] keyword[if] keyword[not] identifier[is_symlink] ( identifier[link] ): keyword[raise] identifier[ValueError] ( literal[string] ) keyword[while] identifier[is_symlink] ( identifier[link] ): identifier[orig] = identifie...
def trace_symlink_target(link): """ Given a file that is known to be a symlink, trace it to its ultimate target. Raises TargetNotPresent when the target cannot be determined. Raises ValueError when the specified link is not a symlink. """ if not is_symlink(link): raise ValueError('link must point ...
def iter_links_element_text(cls, element): '''Get the element text as a link.''' if element.text: link_type = identify_link_type(element.text) yield LinkInfo( element=element, tag=element.tag, attrib=None, link=element.text, inline=...
def function[iter_links_element_text, parameter[cls, element]]: constant[Get the element text as a link.] if name[element].text begin[:] variable[link_type] assign[=] call[name[identify_link_type], parameter[name[element].text]] <ast.Yield object at 0x7da1b26af760>
keyword[def] identifier[iter_links_element_text] ( identifier[cls] , identifier[element] ): literal[string] keyword[if] identifier[element] . identifier[text] : identifier[link_type] = identifier[identify_link_type] ( identifier[element] . identifier[text] ) keyword[yield...
def iter_links_element_text(cls, element): """Get the element text as a link.""" if element.text: link_type = identify_link_type(element.text) yield LinkInfo(element=element, tag=element.tag, attrib=None, link=element.text, inline=False, linked=True, base_link=None, value_type='plain', link_type...
def resize_avatar(self, img, base_width): """Resize an avatar. :param img: The image that needs to be resize. :param base_width: The width of output image. """ w_percent = (base_width / float(img.size[0])) h_size = int((float(img.size[1]) * float(w_percent))) img...
def function[resize_avatar, parameter[self, img, base_width]]: constant[Resize an avatar. :param img: The image that needs to be resize. :param base_width: The width of output image. ] variable[w_percent] assign[=] binary_operation[name[base_width] / call[name[float], parameter[...
keyword[def] identifier[resize_avatar] ( identifier[self] , identifier[img] , identifier[base_width] ): literal[string] identifier[w_percent] =( identifier[base_width] / identifier[float] ( identifier[img] . identifier[size] [ literal[int] ])) identifier[h_size] = identifier[int] (( identi...
def resize_avatar(self, img, base_width): """Resize an avatar. :param img: The image that needs to be resize. :param base_width: The width of output image. """ w_percent = base_width / float(img.size[0]) h_size = int(float(img.size[1]) * float(w_percent)) img = img.resize((base_...
def extracted_array_2d_from_array_2d_and_coordinates(array_2d, y0, y1, x0, x1): """Resize an array to a new size by extracting a sub-set of the array. The extracted input coordinates use NumPy convention, such that the upper values should be specified as +1 the \ dimensions of the extracted array. In ...
def function[extracted_array_2d_from_array_2d_and_coordinates, parameter[array_2d, y0, y1, x0, x1]]: constant[Resize an array to a new size by extracting a sub-set of the array. The extracted input coordinates use NumPy convention, such that the upper values should be specified as +1 the dimensions of ...
keyword[def] identifier[extracted_array_2d_from_array_2d_and_coordinates] ( identifier[array_2d] , identifier[y0] , identifier[y1] , identifier[x0] , identifier[x1] ): literal[string] identifier[new_shape] =( identifier[y1] - identifier[y0] , identifier[x1] - identifier[x0] ) identifier[resized_arra...
def extracted_array_2d_from_array_2d_and_coordinates(array_2d, y0, y1, x0, x1): """Resize an array to a new size by extracting a sub-set of the array. The extracted input coordinates use NumPy convention, such that the upper values should be specified as +1 the dimensions of the extracted array. In th...
def json(self): """ Return a JSON-serializable representation of this result. The output of this function can be converted to a serialized string with :any:`json.dumps`. """ return { "observed_length": _json_safe_float(self.observed_length), "predicted_le...
def function[json, parameter[self]]: constant[ Return a JSON-serializable representation of this result. The output of this function can be converted to a serialized string with :any:`json.dumps`. ] return[dictionary[[<ast.Constant object at 0x7da20cabc550>, <ast.Constant object at ...
keyword[def] identifier[json] ( identifier[self] ): literal[string] keyword[return] { literal[string] : identifier[_json_safe_float] ( identifier[self] . identifier[observed_length] ), literal[string] : identifier[_json_safe_float] ( identifier[self] . identifier[predicted_length]...
def json(self): """ Return a JSON-serializable representation of this result. The output of this function can be converted to a serialized string with :any:`json.dumps`. """ return {'observed_length': _json_safe_float(self.observed_length), 'predicted_length': _json_safe_float(self.pred...
def api_exception(e): """ Returns the proper Exception class for the given kubernetes.client.rest.ApiException object https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#success-codes """ _, _, exc_traceback = sys.exc_info() tb = '\n'.join(traceback.format_t...
def function[api_exception, parameter[e]]: constant[ Returns the proper Exception class for the given kubernetes.client.rest.ApiException object https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#success-codes ] <ast.Tuple object at 0x7da18dc98f40> assi...
keyword[def] identifier[api_exception] ( identifier[e] ): literal[string] identifier[_] , identifier[_] , identifier[exc_traceback] = identifier[sys] . identifier[exc_info] () identifier[tb] = literal[string] . identifier[join] ( identifier[traceback] . identifier[format_tb] ( identifier[exc_traceback...
def api_exception(e): """ Returns the proper Exception class for the given kubernetes.client.rest.ApiException object https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#success-codes """ (_, _, exc_traceback) = sys.exc_info() tb = '\n'.join(traceback.format...
def solveAgents(self): ''' Solves the microeconomic problem for all AgentTypes in this market. Parameters ---------- None Returns ------- None ''' #for this_type in self.agents: # this_type.solve() try: mult...
def function[solveAgents, parameter[self]]: constant[ Solves the microeconomic problem for all AgentTypes in this market. Parameters ---------- None Returns ------- None ] <ast.Try object at 0x7da204566620>
keyword[def] identifier[solveAgents] ( identifier[self] ): literal[string] keyword[try] : identifier[multiThreadCommands] ( identifier[self] . identifier[agents] ,[ literal[string] ]) keyword[except] identifier[Exception] keyword[as] identifier[err] : ...
def solveAgents(self): """ Solves the microeconomic problem for all AgentTypes in this market. Parameters ---------- None Returns ------- None """ #for this_type in self.agents: # this_type.solve() try: multiThreadCommands(self...
def add_nodes(self, node_name_list, dataframe=False): """ Add new nodes to the network :param node_name_list: list of node names, e.g. ['a', 'b', 'c'] :param dataframe: If True, return a pandas dataframe instead of a dict. :return: A dict mapping names to SUIDs for the newly-cre...
def function[add_nodes, parameter[self, node_name_list, dataframe]]: constant[ Add new nodes to the network :param node_name_list: list of node names, e.g. ['a', 'b', 'c'] :param dataframe: If True, return a pandas dataframe instead of a dict. :return: A dict mapping names to SU...
keyword[def] identifier[add_nodes] ( identifier[self] , identifier[node_name_list] , identifier[dataframe] = keyword[False] ): literal[string] identifier[res] = identifier[self] . identifier[session] . identifier[post] ( identifier[self] . identifier[__url] + literal[string] , identifier[data] = id...
def add_nodes(self, node_name_list, dataframe=False): """ Add new nodes to the network :param node_name_list: list of node names, e.g. ['a', 'b', 'c'] :param dataframe: If True, return a pandas dataframe instead of a dict. :return: A dict mapping names to SUIDs for the newly-created...