code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def update_extent_from_map_canvas(self): """Update extent value in GUI based from value in map. .. note:: Delegates to update_extent() """ self.bounding_box_group.setTitle( self.tr('Bounding box from the map canvas')) # Get the extent as [xmin, ymin, xmax, ymax] ...
def function[update_extent_from_map_canvas, parameter[self]]: constant[Update extent value in GUI based from value in map. .. note:: Delegates to update_extent() ] call[name[self].bounding_box_group.setTitle, parameter[call[name[self].tr, parameter[constant[Bounding box from the map can...
keyword[def] identifier[update_extent_from_map_canvas] ( identifier[self] ): literal[string] identifier[self] . identifier[bounding_box_group] . identifier[setTitle] ( identifier[self] . identifier[tr] ( literal[string] )) identifier[extent] = identifier[viewport_geo_arr...
def update_extent_from_map_canvas(self): """Update extent value in GUI based from value in map. .. note:: Delegates to update_extent() """ self.bounding_box_group.setTitle(self.tr('Bounding box from the map canvas')) # Get the extent as [xmin, ymin, xmax, ymax] extent = viewport_geo_arr...
def get_intersections(self): """ Return a list of unordered intersection points. """ if Real is float: return list(self.intersections.keys()) else: return [(float(p[0]), float(p[1])) for p in self.intersections.keys()]
def function[get_intersections, parameter[self]]: constant[ Return a list of unordered intersection points. ] if compare[name[Real] is name[float]] begin[:] return[call[name[list], parameter[call[name[self].intersections.keys, parameter[]]]]]
keyword[def] identifier[get_intersections] ( identifier[self] ): literal[string] keyword[if] identifier[Real] keyword[is] identifier[float] : keyword[return] identifier[list] ( identifier[self] . identifier[intersections] . identifier[keys] ()) keyword[else] : ...
def get_intersections(self): """ Return a list of unordered intersection points. """ if Real is float: return list(self.intersections.keys()) # depends on [control=['if'], data=[]] else: return [(float(p[0]), float(p[1])) for p in self.intersections.keys()]
def email_embed_image(email, img_content_id, img_data): """ email is a django.core.mail.EmailMessage object """ img = MIMEImage(img_data) img.add_header('Content-ID', '<%s>' % img_content_id) img.add_header('Content-Disposition', 'inline') email.attach(img)
def function[email_embed_image, parameter[email, img_content_id, img_data]]: constant[ email is a django.core.mail.EmailMessage object ] variable[img] assign[=] call[name[MIMEImage], parameter[name[img_data]]] call[name[img].add_header, parameter[constant[Content-ID], binary_operation[co...
keyword[def] identifier[email_embed_image] ( identifier[email] , identifier[img_content_id] , identifier[img_data] ): literal[string] identifier[img] = identifier[MIMEImage] ( identifier[img_data] ) identifier[img] . identifier[add_header] ( literal[string] , literal[string] % identifier[img_content_i...
def email_embed_image(email, img_content_id, img_data): """ email is a django.core.mail.EmailMessage object """ img = MIMEImage(img_data) img.add_header('Content-ID', '<%s>' % img_content_id) img.add_header('Content-Disposition', 'inline') email.attach(img)
def get_lang_class(lang): """Import and load a Language class. lang (unicode): Two-letter language code, e.g. 'en'. RETURNS (Language): Language class. """ global LANGUAGES # Check if an entry point is exposed for the language code entry_point = get_entry_point("spacy_languages", lang) ...
def function[get_lang_class, parameter[lang]]: constant[Import and load a Language class. lang (unicode): Two-letter language code, e.g. 'en'. RETURNS (Language): Language class. ] <ast.Global object at 0x7da1b1ef8820> variable[entry_point] assign[=] call[name[get_entry_point], paramete...
keyword[def] identifier[get_lang_class] ( identifier[lang] ): literal[string] keyword[global] identifier[LANGUAGES] identifier[entry_point] = identifier[get_entry_point] ( literal[string] , identifier[lang] ) keyword[if] identifier[entry_point] keyword[is] keyword[not] keyword[None] : ...
def get_lang_class(lang): """Import and load a Language class. lang (unicode): Two-letter language code, e.g. 'en'. RETURNS (Language): Language class. """ global LANGUAGES # Check if an entry point is exposed for the language code entry_point = get_entry_point('spacy_languages', lang) ...
def get_attention(config: AttentionConfig, max_seq_len: int, prefix: str = C.ATTENTION_PREFIX) -> 'Attention': """ Returns an Attention instance based on attention_type. :param config: Attention configuration. :param max_seq_len: Maximum length of source sequences. :param prefix: Name prefix. :...
def function[get_attention, parameter[config, max_seq_len, prefix]]: constant[ Returns an Attention instance based on attention_type. :param config: Attention configuration. :param max_seq_len: Maximum length of source sequences. :param prefix: Name prefix. :return: Instance of Attention. ...
keyword[def] identifier[get_attention] ( identifier[config] : identifier[AttentionConfig] , identifier[max_seq_len] : identifier[int] , identifier[prefix] : identifier[str] = identifier[C] . identifier[ATTENTION_PREFIX] )-> literal[string] : literal[string] identifier[att_cls] = identifier[Attention] . id...
def get_attention(config: AttentionConfig, max_seq_len: int, prefix: str=C.ATTENTION_PREFIX) -> 'Attention': """ Returns an Attention instance based on attention_type. :param config: Attention configuration. :param max_seq_len: Maximum length of source sequences. :param prefix: Name prefix. :re...
def conversions(self): """ Returns a string showing the available conversions. Useful tool in interactive mode. """ return "\n".join(str(self.to(unit)) for unit in self.supported_units)
def function[conversions, parameter[self]]: constant[ Returns a string showing the available conversions. Useful tool in interactive mode. ] return[call[constant[ ].join, parameter[<ast.GeneratorExp object at 0x7da1b21a1600>]]]
keyword[def] identifier[conversions] ( identifier[self] ): literal[string] keyword[return] literal[string] . identifier[join] ( identifier[str] ( identifier[self] . identifier[to] ( identifier[unit] )) keyword[for] identifier[unit] keyword[in] identifier[self] . identifier[supported_units] )
def conversions(self): """ Returns a string showing the available conversions. Useful tool in interactive mode. """ return '\n'.join((str(self.to(unit)) for unit in self.supported_units))
def _config_chooser_dialog(self, title_text, description): """Dialog to select which config shall be exported :param title_text: Title text :param description: Description """ dialog = Gtk.Dialog(title_text, self.view["preferences_window"], flags=0, b...
def function[_config_chooser_dialog, parameter[self, title_text, description]]: constant[Dialog to select which config shall be exported :param title_text: Title text :param description: Description ] variable[dialog] assign[=] call[name[Gtk].Dialog, parameter[name[title_text], ...
keyword[def] identifier[_config_chooser_dialog] ( identifier[self] , identifier[title_text] , identifier[description] ): literal[string] identifier[dialog] = identifier[Gtk] . identifier[Dialog] ( identifier[title_text] , identifier[self] . identifier[view] [ literal[string] ], identifier[...
def _config_chooser_dialog(self, title_text, description): """Dialog to select which config shall be exported :param title_text: Title text :param description: Description """ dialog = Gtk.Dialog(title_text, self.view['preferences_window'], flags=0, buttons=(Gtk.STOCK_CANCEL, Gtk.Respon...
def close_remote(self): """Cleans up and closes connection to remote server if defined. """ if self._remote: try: # first see if remote dir is still there self._remote.execute('ls %s' % (self._remote_id,)) if self.status != 'Completed'...
def function[close_remote, parameter[self]]: constant[Cleans up and closes connection to remote server if defined. ] if name[self]._remote begin[:] <ast.Try object at 0x7da1b1f9ef80> call[name[self]._remote.close, parameter[]] <ast.Delete object at 0x7da1b1f9ed70...
keyword[def] identifier[close_remote] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_remote] : keyword[try] : identifier[self] . identifier[_remote] . identifier[execute] ( literal[string] %( identifier[self] . identifier...
def close_remote(self): """Cleans up and closes connection to remote server if defined. """ if self._remote: try: # first see if remote dir is still there self._remote.execute('ls %s' % (self._remote_id,)) if self.status != 'Completed': self.r...
def from_location(cls, location, north_angle=0, daylight_saving_period=None): """Create a sun path from a LBlocation.""" location = Location.from_location(location) return cls(location.latitude, location.longitude, location.time_zone, north_angle, daylight_saving_period)
def function[from_location, parameter[cls, location, north_angle, daylight_saving_period]]: constant[Create a sun path from a LBlocation.] variable[location] assign[=] call[name[Location].from_location, parameter[name[location]]] return[call[name[cls], parameter[name[location].latitude, name[locatio...
keyword[def] identifier[from_location] ( identifier[cls] , identifier[location] , identifier[north_angle] = literal[int] , identifier[daylight_saving_period] = keyword[None] ): literal[string] identifier[location] = identifier[Location] . identifier[from_location] ( identifier[location] ) ...
def from_location(cls, location, north_angle=0, daylight_saving_period=None): """Create a sun path from a LBlocation.""" location = Location.from_location(location) return cls(location.latitude, location.longitude, location.time_zone, north_angle, daylight_saving_period)
def delete_saved_search(self, id, **kwargs): # noqa: E501 """Delete a specific saved search # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_saved_searc...
def function[delete_saved_search, parameter[self, id]]: constant[Delete a specific saved search # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_saved_se...
keyword[def] identifier[delete_saved_search] ( identifier[self] , identifier[id] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[return] identifier[...
def delete_saved_search(self, id, **kwargs): # noqa: E501 'Delete a specific saved search # noqa: E501\n\n # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.delete_saved_search...
def list(self, filter_args=None): """ List the faked resources of this manager. Parameters: filter_args (dict): Filter arguments. `None` causes no filtering to happen. See :meth:`~zhmcclient.BaseManager.list()` for details. Returns: list of ...
def function[list, parameter[self, filter_args]]: constant[ List the faked resources of this manager. Parameters: filter_args (dict): Filter arguments. `None` causes no filtering to happen. See :meth:`~zhmcclient.BaseManager.list()` for details. Retur...
keyword[def] identifier[list] ( identifier[self] , identifier[filter_args] = keyword[None] ): literal[string] identifier[res] = identifier[list] () keyword[for] identifier[oid] keyword[in] identifier[self] . identifier[_resources] : identifier[resource] = identifier[self] ....
def list(self, filter_args=None): """ List the faked resources of this manager. Parameters: filter_args (dict): Filter arguments. `None` causes no filtering to happen. See :meth:`~zhmcclient.BaseManager.list()` for details. Returns: list of Fake...
def drawForeground(self, painter, rect, showGrid, showColumns, showRows): """ Draws the grid on the inputed painter :param painter | <QPainter> rect | <QRect> showGrid | <bool> showColumns | <bool> ...
def function[drawForeground, parameter[self, painter, rect, showGrid, showColumns, showRows]]: constant[ Draws the grid on the inputed painter :param painter | <QPainter> rect | <QRect> showGrid | <bool> show...
keyword[def] identifier[drawForeground] ( identifier[self] , identifier[painter] , identifier[rect] , identifier[showGrid] , identifier[showColumns] , identifier[showRows] ): literal[string] identifier[painter] . identifier[save] () identifier[center] = identifier[self] . identifier[bui...
def drawForeground(self, painter, rect, showGrid, showColumns, showRows): """ Draws the grid on the inputed painter :param painter | <QPainter> rect | <QRect> showGrid | <bool> showColumns | <bool> ...
def get_proxy_manager(self, osid=None, implementation=None, version=None): """Finds, loads and instantiates providers of OSID managers. Providers must conform to an ``OsidManager`` interface. The interfaces are defined in the OSID enumeration. For all OSID requests, an instance of ``Osi...
def function[get_proxy_manager, parameter[self, osid, implementation, version]]: constant[Finds, loads and instantiates providers of OSID managers. Providers must conform to an ``OsidManager`` interface. The interfaces are defined in the OSID enumeration. For all OSID requests, an insta...
keyword[def] identifier[get_proxy_manager] ( identifier[self] , identifier[osid] = keyword[None] , identifier[implementation] = keyword[None] , identifier[version] = keyword[None] ): literal[string] keyword[try] : identifier[manager_module] ...
def get_proxy_manager(self, osid=None, implementation=None, version=None): """Finds, loads and instantiates providers of OSID managers. Providers must conform to an ``OsidManager`` interface. The interfaces are defined in the OSID enumeration. For all OSID requests, an instance of ``OsidMan...
def delete_types(self, base_key, out_key, *types): """ Method to delete a parameter from a parameter documentation. This method deletes the given `param` from the `base_key` item in the :attr:`params` dictionary and creates a new item with the original documentation without the ...
def function[delete_types, parameter[self, base_key, out_key]]: constant[ Method to delete a parameter from a parameter documentation. This method deletes the given `param` from the `base_key` item in the :attr:`params` dictionary and creates a new item with the original documen...
keyword[def] identifier[delete_types] ( identifier[self] , identifier[base_key] , identifier[out_key] ,* identifier[types] ): literal[string] identifier[self] . identifier[params] [ literal[string] %( identifier[base_key] , identifier[out_key] )]= identifier[self] . identifier[delete_types_s] ( ...
def delete_types(self, base_key, out_key, *types): """ Method to delete a parameter from a parameter documentation. This method deletes the given `param` from the `base_key` item in the :attr:`params` dictionary and creates a new item with the original documentation without the desc...
def _find_unpurge_targets(desired, **kwargs): ''' Find packages which are marked to be purged but can't yet be removed because they are dependencies for other installed packages. These are the packages which will need to be 'unpurged' because they are part of pkg.installed states. This really just a...
def function[_find_unpurge_targets, parameter[desired]]: constant[ Find packages which are marked to be purged but can't yet be removed because they are dependencies for other installed packages. These are the packages which will need to be 'unpurged' because they are part of pkg.installed state...
keyword[def] identifier[_find_unpurge_targets] ( identifier[desired] ,** identifier[kwargs] ): literal[string] keyword[return] [ identifier[x] keyword[for] identifier[x] keyword[in] identifier[desired] keyword[if] identifier[x] keyword[in] identifier[__salt__] [ literal[string] ]( identif...
def _find_unpurge_targets(desired, **kwargs): """ Find packages which are marked to be purged but can't yet be removed because they are dependencies for other installed packages. These are the packages which will need to be 'unpurged' because they are part of pkg.installed states. This really just a...
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Con...
def function[fix_config, parameter[self, options]]: constant[ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict ] ...
keyword[def] identifier[fix_config] ( identifier[self] , identifier[options] ): literal[string] identifier[options] = identifier[super] ( identifier[Console] , identifier[self] ). identifier[fix_config] ( identifier[options] ) identifier[opt] = literal[string] keyword[if] ident...
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Console, se...
def row_major(self, value): """Validate and set row-major format for multidimensional arrays.""" if value is not None: if not isinstance(value, bool): raise TypeError( 'f90nml: error: row_major must be a logical value.') else: s...
def function[row_major, parameter[self, value]]: constant[Validate and set row-major format for multidimensional arrays.] if compare[name[value] is_not constant[None]] begin[:] if <ast.UnaryOp object at 0x7da1b06ca3b0> begin[:] <ast.Raise object at 0x7da1b06c9510>
keyword[def] identifier[row_major] ( identifier[self] , identifier[value] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[not] keyword[None] : keyword[if] keyword[not] identifier[isinstance] ( identifier[value] , identifier[bool] ): keyword[r...
def row_major(self, value): """Validate and set row-major format for multidimensional arrays.""" if value is not None: if not isinstance(value, bool): raise TypeError('f90nml: error: row_major must be a logical value.') # depends on [control=['if'], data=[]] else: self._...
def stop(self, task_is_resetting=False): """ Stop a task. This stops all processes for the task. The approach is to mark the task as "stopping" , send a SIGTERM to each process, and schedule a SIGKILL for some time later. If the legion or task is resetting and a "restart" even...
def function[stop, parameter[self, task_is_resetting]]: constant[ Stop a task. This stops all processes for the task. The approach is to mark the task as "stopping" , send a SIGTERM to each process, and schedule a SIGKILL for some time later. If the legion or task is resetting...
keyword[def] identifier[stop] ( identifier[self] , identifier[task_is_resetting] = keyword[False] ): literal[string] identifier[log] = identifier[self] . identifier[_params] . identifier[get] ( literal[string] , identifier[self] . identifier[_discard] ) keyword[if] identifier[self] . ide...
def stop(self, task_is_resetting=False): """ Stop a task. This stops all processes for the task. The approach is to mark the task as "stopping" , send a SIGTERM to each process, and schedule a SIGKILL for some time later. If the legion or task is resetting and a "restart" event is...
def start(self): """ Starts the worker threads if they are not already started. This method is thread-safe and will be called automatically when executing an operation. """ # Check whether we are already started, skip if we are. if not self._started.is_set(): ...
def function[start, parameter[self]]: constant[ Starts the worker threads if they are not already started. This method is thread-safe and will be called automatically when executing an operation. ] if <ast.UnaryOp object at 0x7da20c7c9c60> begin[:] if call...
keyword[def] identifier[start] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_started] . identifier[is_set] (): keyword[if] identifier[self] . identifier[_lock] . identifier[acquire] ( keyword[False] ): ...
def start(self): """ Starts the worker threads if they are not already started. This method is thread-safe and will be called automatically when executing an operation. """ # Check whether we are already started, skip if we are. if not self._started.is_set(): # If we ...
def _text_checker(job, interval, _interval_set=False, quiet=False, output=sys.stdout): """A text-based job status checker Args: job (BaseJob): The job to check. interval (int): The interval at which to check. _interval_set (bool): Was interval time set by user? quiet (bool): If ...
def function[_text_checker, parameter[job, interval, _interval_set, quiet, output]]: constant[A text-based job status checker Args: job (BaseJob): The job to check. interval (int): The interval at which to check. _interval_set (bool): Was interval time set by user? quiet (bo...
keyword[def] identifier[_text_checker] ( identifier[job] , identifier[interval] , identifier[_interval_set] = keyword[False] , identifier[quiet] = keyword[False] , identifier[output] = identifier[sys] . identifier[stdout] ): literal[string] identifier[status] = identifier[job] . identifier[status] () ...
def _text_checker(job, interval, _interval_set=False, quiet=False, output=sys.stdout): """A text-based job status checker Args: job (BaseJob): The job to check. interval (int): The interval at which to check. _interval_set (bool): Was interval time set by user? quiet (bool): If ...
def _create_tree(self, endpoint=None, index=0): """ This will return a string of the endpoint tree structure :param endpoint: Endpoint's Current path of the source :param index: int number of tabs to space over :return: str """ tab = '' # '\t' * index ret...
def function[_create_tree, parameter[self, endpoint, index]]: constant[ This will return a string of the endpoint tree structure :param endpoint: Endpoint's Current path of the source :param index: int number of tabs to space over :return: str ] variable[tab] assi...
keyword[def] identifier[_create_tree] ( identifier[self] , identifier[endpoint] = keyword[None] , identifier[index] = literal[int] ): literal[string] identifier[tab] = literal[string] identifier[ret] = literal[string] keyword[if] identifier[endpoint] : identifier[n...
def _create_tree(self, endpoint=None, index=0): """ This will return a string of the endpoint tree structure :param endpoint: Endpoint's Current path of the source :param index: int number of tabs to space over :return: str """ tab = '' # '\t' * index ret = '' if...
def blockSignals(self, state): """ Sets whether or not updates will be enabled. :param state | <bool> """ super(XGanttWidget, self).blockSignals(state) self.treeWidget().blockSignals(state) self.viewWidget().blockSignals(state)
def function[blockSignals, parameter[self, state]]: constant[ Sets whether or not updates will be enabled. :param state | <bool> ] call[call[name[super], parameter[name[XGanttWidget], name[self]]].blockSignals, parameter[name[state]]] call[call[name[self].tr...
keyword[def] identifier[blockSignals] ( identifier[self] , identifier[state] ): literal[string] identifier[super] ( identifier[XGanttWidget] , identifier[self] ). identifier[blockSignals] ( identifier[state] ) identifier[self] . identifier[treeWidget] (). identifier[blockSignals] ( iden...
def blockSignals(self, state): """ Sets whether or not updates will be enabled. :param state | <bool> """ super(XGanttWidget, self).blockSignals(state) self.treeWidget().blockSignals(state) self.viewWidget().blockSignals(state)
def _sample_action_fluent(self, name: str, dtype: tf.DType, size: Sequence[int], constraints: Dict[str, Constraints], default_value: tf.Tensor, prob: float) -> tf.Tensor: '''Samples the action fluent with given `name`, `dtype`, and `size`. ...
def function[_sample_action_fluent, parameter[self, name, dtype, size, constraints, default_value, prob]]: constant[Samples the action fluent with given `name`, `dtype`, and `size`. With probability `prob` it chooses the action fluent `default_value`, with probability 1-`prob` it samples the fl...
keyword[def] identifier[_sample_action_fluent] ( identifier[self] , identifier[name] : identifier[str] , identifier[dtype] : identifier[tf] . identifier[DType] , identifier[size] : identifier[Sequence] [ identifier[int] ], identifier[constraints] : identifier[Dict] [ identifier[str] , identifier[Constraints] ], ...
def _sample_action_fluent(self, name: str, dtype: tf.DType, size: Sequence[int], constraints: Dict[str, Constraints], default_value: tf.Tensor, prob: float) -> tf.Tensor: """Samples the action fluent with given `name`, `dtype`, and `size`. With probability `prob` it chooses the action fluent `default_value...
def _create_producer(self, settings): """Tries to establish a Kafka consumer connection""" try: brokers = settings['KAFKA_HOSTS'] self.logger.debug("Creating new kafka producer using brokers: " + str(brokers)) return KafkaProducer(boots...
def function[_create_producer, parameter[self, settings]]: constant[Tries to establish a Kafka consumer connection] <ast.Try object at 0x7da1b18dd1b0>
keyword[def] identifier[_create_producer] ( identifier[self] , identifier[settings] ): literal[string] keyword[try] : identifier[brokers] = identifier[settings] [ literal[string] ] identifier[self] . identifier[logger] . identifier[debug] ( literal[string] + i...
def _create_producer(self, settings): """Tries to establish a Kafka consumer connection""" try: brokers = settings['KAFKA_HOSTS'] self.logger.debug('Creating new kafka producer using brokers: ' + str(brokers)) return KafkaProducer(bootstrap_servers=brokers, value_serializer=lambda m: jso...
def update(self, buffer, length): """ Add buffer into digest calculation """ return lib.zdigest_update(self._as_parameter_, buffer, length)
def function[update, parameter[self, buffer, length]]: constant[ Add buffer into digest calculation ] return[call[name[lib].zdigest_update, parameter[name[self]._as_parameter_, name[buffer], name[length]]]]
keyword[def] identifier[update] ( identifier[self] , identifier[buffer] , identifier[length] ): literal[string] keyword[return] identifier[lib] . identifier[zdigest_update] ( identifier[self] . identifier[_as_parameter_] , identifier[buffer] , identifier[length] )
def update(self, buffer, length): """ Add buffer into digest calculation """ return lib.zdigest_update(self._as_parameter_, buffer, length)
def get_upcoming_events(self, days_to_look_ahead): '''Returns the events from the calendar for the next days_to_look_ahead days.''' now = datetime.now(tz=self.timezone) # timezone? start_time = datetime(year=now.year, month=now.month, day=now.day, hour=now.hour, minute=now.minute, second=now.sec...
def function[get_upcoming_events, parameter[self, days_to_look_ahead]]: constant[Returns the events from the calendar for the next days_to_look_ahead days.] variable[now] assign[=] call[name[datetime].now, parameter[]] variable[start_time] assign[=] call[name[datetime], parameter[]] vari...
keyword[def] identifier[get_upcoming_events] ( identifier[self] , identifier[days_to_look_ahead] ): literal[string] identifier[now] = identifier[datetime] . identifier[now] ( identifier[tz] = identifier[self] . identifier[timezone] ) identifier[start_time] = identifier[datetime] ( identifi...
def get_upcoming_events(self, days_to_look_ahead): """Returns the events from the calendar for the next days_to_look_ahead days.""" now = datetime.now(tz=self.timezone) # timezone? start_time = datetime(year=now.year, month=now.month, day=now.day, hour=now.hour, minute=now.minute, second=now.second, tzinfo...
def crl_distribution_points(self): """ Returns complete CRL URLs - does not include delta CRLs :return: A list of zero or more DistributionPoint objects """ if self._crl_distribution_points is None: self._crl_distribution_points = self._get_http_crl_dist...
def function[crl_distribution_points, parameter[self]]: constant[ Returns complete CRL URLs - does not include delta CRLs :return: A list of zero or more DistributionPoint objects ] if compare[name[self]._crl_distribution_points is constant[None]] begin[:] ...
keyword[def] identifier[crl_distribution_points] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_crl_distribution_points] keyword[is] keyword[None] : identifier[self] . identifier[_crl_distribution_points] = identifier[self] . identifier[_get_http_c...
def crl_distribution_points(self): """ Returns complete CRL URLs - does not include delta CRLs :return: A list of zero or more DistributionPoint objects """ if self._crl_distribution_points is None: self._crl_distribution_points = self._get_http_crl_distribution_poin...
def _clean_lazymodule(module): """Removes all lazy behavior from a module's class, for loading. Also removes all module attributes listed under the module's class deletion dictionaries. Deletion dictionaries are class attributes with names specified in `_DELETION_DICT`. Parameters ---------- ...
def function[_clean_lazymodule, parameter[module]]: constant[Removes all lazy behavior from a module's class, for loading. Also removes all module attributes listed under the module's class deletion dictionaries. Deletion dictionaries are class attributes with names specified in `_DELETION_DICT`. ...
keyword[def] identifier[_clean_lazymodule] ( identifier[module] ): literal[string] identifier[modclass] = identifier[type] ( identifier[module] ) identifier[_clean_lazy_submod_refs] ( identifier[module] ) identifier[modclass] . identifier[__getattribute__] = identifier[ModuleType] . identifier[_...
def _clean_lazymodule(module): """Removes all lazy behavior from a module's class, for loading. Also removes all module attributes listed under the module's class deletion dictionaries. Deletion dictionaries are class attributes with names specified in `_DELETION_DICT`. Parameters ---------- ...
def density_sampling(data, local_densities = None, metric = 'manhattan', kernel_mult = 2.0, outlier_percentile = 0.01, target_percentile = 0.05, desired_samples = None): """The i-th sample point of the data-set 'data' is selected by density sampling with a probabi...
def function[density_sampling, parameter[data, local_densities, metric, kernel_mult, outlier_percentile, target_percentile, desired_samples]]: constant[The i-th sample point of the data-set 'data' is selected by density sampling with a probability given by: ...
keyword[def] identifier[density_sampling] ( identifier[data] , identifier[local_densities] = keyword[None] , identifier[metric] = literal[string] , identifier[kernel_mult] = literal[int] , identifier[outlier_percentile] = literal[int] , identifier[target_percentile] = literal[int] , identifier[desired_samples] = ke...
def density_sampling(data, local_densities=None, metric='manhattan', kernel_mult=2.0, outlier_percentile=0.01, target_percentile=0.05, desired_samples=None): """The i-th sample point of the data-set 'data' is selected by density sampling with a probability given by: ...
def _import_submodules( __all__, __path__, __name__, include=None, exclude=None, include_private_modules=False, require__all__=True, recursive=True): """ Import all available submodules, all objects defined in the `__all__` lists of those submodules, and extend `__all__` with the imported ob...
def function[_import_submodules, parameter[__all__, __path__, __name__, include, exclude, include_private_modules, require__all__, recursive]]: constant[ Import all available submodules, all objects defined in the `__all__` lists of those submodules, and extend `__all__` with the imported objects. ...
keyword[def] identifier[_import_submodules] ( identifier[__all__] , identifier[__path__] , identifier[__name__] , identifier[include] = keyword[None] , identifier[exclude] = keyword[None] , identifier[include_private_modules] = keyword[False] , identifier[require__all__] = keyword[True] , identifier[recursive] = ke...
def _import_submodules(__all__, __path__, __name__, include=None, exclude=None, include_private_modules=False, require__all__=True, recursive=True): """ Import all available submodules, all objects defined in the `__all__` lists of those submodules, and extend `__all__` with the imported objects. Args:...
def add_boundary_regions(regions=None, faces=['front', 'back', 'left', 'right', 'top', 'bottom']): r""" Given an image partitioned into regions, pads specified faces with new regions Parameters ---------- regions : ND-array An image of the p...
def function[add_boundary_regions, parameter[regions, faces]]: constant[ Given an image partitioned into regions, pads specified faces with new regions Parameters ---------- regions : ND-array An image of the pore space partitioned into regions and labeled faces : list of string...
keyword[def] identifier[add_boundary_regions] ( identifier[regions] = keyword[None] , identifier[faces] =[ literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] ]): literal[string] keyword[if] identifier[faces] keyword[is] keyword[not] keyw...
def add_boundary_regions(regions=None, faces=['front', 'back', 'left', 'right', 'top', 'bottom']): """ Given an image partitioned into regions, pads specified faces with new regions Parameters ---------- regions : ND-array An image of the pore space partitioned into regions and labeled ...
def message_stanza_handler(stanza_type = None, payload_class = None, payload_key = None, usage_restriction = "post-auth"): """Method decorator generator for decorating <message/> stanza handler methods in `XMPPFeatureHandler` subclasses. :Parameters: - `payload_class`: paylo...
def function[message_stanza_handler, parameter[stanza_type, payload_class, payload_key, usage_restriction]]: constant[Method decorator generator for decorating <message/> stanza handler methods in `XMPPFeatureHandler` subclasses. :Parameters: - `payload_class`: payload class expected - ...
keyword[def] identifier[message_stanza_handler] ( identifier[stanza_type] = keyword[None] , identifier[payload_class] = keyword[None] , identifier[payload_key] = keyword[None] , identifier[usage_restriction] = literal[string] ): literal[string] keyword[if] identifier[stanza_type] keyword[is] keyword[No...
def message_stanza_handler(stanza_type=None, payload_class=None, payload_key=None, usage_restriction='post-auth'): """Method decorator generator for decorating <message/> stanza handler methods in `XMPPFeatureHandler` subclasses. :Parameters: - `payload_class`: payload class expected - `sta...
def get_ticker(self, symbol=None): """Get symbol tick https://docs.kucoin.com/#get-ticker :param symbol: (optional) Name of symbol e.g. KCS-BTC :type symbol: string .. code:: python all_ticks = client.get_ticker() ticker = client.get_ticker('ETH-BTC')...
def function[get_ticker, parameter[self, symbol]]: constant[Get symbol tick https://docs.kucoin.com/#get-ticker :param symbol: (optional) Name of symbol e.g. KCS-BTC :type symbol: string .. code:: python all_ticks = client.get_ticker() ticker = client...
keyword[def] identifier[get_ticker] ( identifier[self] , identifier[symbol] = keyword[None] ): literal[string] identifier[data] ={} identifier[tick_path] = literal[string] keyword[if] identifier[symbol] keyword[is] keyword[not] keyword[None] : identifier[tick_pat...
def get_ticker(self, symbol=None): """Get symbol tick https://docs.kucoin.com/#get-ticker :param symbol: (optional) Name of symbol e.g. KCS-BTC :type symbol: string .. code:: python all_ticks = client.get_ticker() ticker = client.get_ticker('ETH-BTC') ...
def process_message(message): """ Process a message dict and return a Message Object :param message: Message dict returned by `parse_xml` function :return: Message Object """ message["type"] = message.pop("MsgType").lower() if message["type"] == 'event': message["type"] = str(message...
def function[process_message, parameter[message]]: constant[ Process a message dict and return a Message Object :param message: Message dict returned by `parse_xml` function :return: Message Object ] call[name[message]][constant[type]] assign[=] call[call[name[message].pop, parameter[con...
keyword[def] identifier[process_message] ( identifier[message] ): literal[string] identifier[message] [ literal[string] ]= identifier[message] . identifier[pop] ( literal[string] ). identifier[lower] () keyword[if] identifier[message] [ literal[string] ]== literal[string] : identifier[messag...
def process_message(message): """ Process a message dict and return a Message Object :param message: Message dict returned by `parse_xml` function :return: Message Object """ message['type'] = message.pop('MsgType').lower() if message['type'] == 'event': message['type'] = str(message...
def getTextualNode( self, textId: str, subreference: Union[str, BaseReference]=None, prevnext: bool=False, metadata: bool=False ) -> DtsResolverDocument: """ Retrieve a text node from the API :param textId: CtsTextMetadata Identifier ...
def function[getTextualNode, parameter[self, textId, subreference, prevnext, metadata]]: constant[ Retrieve a text node from the API :param textId: CtsTextMetadata Identifier :type textId: str :param subreference: CapitainsCtsPassage Reference :type subreference: str :pa...
keyword[def] identifier[getTextualNode] ( identifier[self] , identifier[textId] : identifier[str] , identifier[subreference] : identifier[Union] [ identifier[str] , identifier[BaseReference] ]= keyword[None] , identifier[prevnext] : identifier[bool] = keyword[False] , identifier[metadata] : identifier[bool] = ke...
def getTextualNode(self, textId: str, subreference: Union[str, BaseReference]=None, prevnext: bool=False, metadata: bool=False) -> DtsResolverDocument: """ Retrieve a text node from the API :param textId: CtsTextMetadata Identifier :type textId: str :param subreference: CapitainsCtsPassage ...
def _expval(self, f, nopdf): """ Return integrand using the tan mapping. """ def ff(theta, nopdf=nopdf): tan_theta = numpy.tan(theta) x = self.scale * tan_theta jac = self.scale * (tan_theta ** 2 + 1.) if nopdf: pdf = jac * self.pdf.pjac[No...
def function[_expval, parameter[self, f, nopdf]]: constant[ Return integrand using the tan mapping. ] def function[ff, parameter[theta, nopdf]]: variable[tan_theta] assign[=] call[name[numpy].tan, parameter[name[theta]]] variable[x] assign[=] binary_operation[name[self].s...
keyword[def] identifier[_expval] ( identifier[self] , identifier[f] , identifier[nopdf] ): literal[string] keyword[def] identifier[ff] ( identifier[theta] , identifier[nopdf] = identifier[nopdf] ): identifier[tan_theta] = identifier[numpy] . identifier[tan] ( identifier[theta] ) ...
def _expval(self, f, nopdf): """ Return integrand using the tan mapping. """ def ff(theta, nopdf=nopdf): tan_theta = numpy.tan(theta) x = self.scale * tan_theta jac = self.scale * (tan_theta ** 2 + 1.0) if nopdf: pdf = jac * self.pdf.pjac[None, :] # depends on [cont...
def mouseReleaseEvent(self, event): """ Overloads the mouse release event to apply the current changes. :param event | <QEvent> """ super(XGanttViewItem, self).mouseReleaseEvent(event) if not self.flags() & self.ItemIsMovable: r...
def function[mouseReleaseEvent, parameter[self, event]]: constant[ Overloads the mouse release event to apply the current changes. :param event | <QEvent> ] call[call[name[super], parameter[name[XGanttViewItem], name[self]]].mouseReleaseEvent, parameter[name[event]]...
keyword[def] identifier[mouseReleaseEvent] ( identifier[self] , identifier[event] ): literal[string] identifier[super] ( identifier[XGanttViewItem] , identifier[self] ). identifier[mouseReleaseEvent] ( identifier[event] ) keyword[if] keyword[not] identifier[self] . identifier[flags]...
def mouseReleaseEvent(self, event): """ Overloads the mouse release event to apply the current changes. :param event | <QEvent> """ super(XGanttViewItem, self).mouseReleaseEvent(event) if not self.flags() & self.ItemIsMovable: return # depends on [control=['if'...
def write(self, start_position: int, size: int, value: bytes) -> None: """ Write `value` into memory. """ if size: validate_uint256(start_position) validate_uint256(size) validate_is_bytes(value) validate_length(value, length=size) ...
def function[write, parameter[self, start_position, size, value]]: constant[ Write `value` into memory. ] if name[size] begin[:] call[name[validate_uint256], parameter[name[start_position]]] call[name[validate_uint256], parameter[name[size]]] ...
keyword[def] identifier[write] ( identifier[self] , identifier[start_position] : identifier[int] , identifier[size] : identifier[int] , identifier[value] : identifier[bytes] )-> keyword[None] : literal[string] keyword[if] identifier[size] : identifier[validate_uint256] ( identifier[st...
def write(self, start_position: int, size: int, value: bytes) -> None: """ Write `value` into memory. """ if size: validate_uint256(start_position) validate_uint256(size) validate_is_bytes(value) validate_length(value, length=size) validate_lte(start_posit...
def save_form(self, form): """ Save a valid form. If there is a parent attribute, this will make sure that the parent object is added to the saved object. Either as a relationship before saving or in the case of many to many relations after saving. Any forced instance val...
def function[save_form, parameter[self, form]]: constant[ Save a valid form. If there is a parent attribute, this will make sure that the parent object is added to the saved object. Either as a relationship before saving or in the case of many to many relations after savi...
keyword[def] identifier[save_form] ( identifier[self] , identifier[form] ): literal[string] identifier[force] = identifier[self] . identifier[get_force_instance_values] () keyword[if] identifier[force] : keyword[for] identifier[k] , identifier[v] keyword[in] iden...
def save_form(self, form): """ Save a valid form. If there is a parent attribute, this will make sure that the parent object is added to the saved object. Either as a relationship before saving or in the case of many to many relations after saving. Any forced instance values ...
def segments(self): """A dictionary of lists of contours keyed by z-index""" segments = dict() for i in xrange(len(self)): image = self[i] for z, contour in image.as_segments.iteritems(): for byte_value, contour_set in contour.iteritems(): ...
def function[segments, parameter[self]]: constant[A dictionary of lists of contours keyed by z-index] variable[segments] assign[=] call[name[dict], parameter[]] for taget[name[i]] in starred[call[name[xrange], parameter[call[name[len], parameter[name[self]]]]]] begin[:] variable[...
keyword[def] identifier[segments] ( identifier[self] ): literal[string] identifier[segments] = identifier[dict] () keyword[for] identifier[i] keyword[in] identifier[xrange] ( identifier[len] ( identifier[self] )): identifier[image] = identifier[self] [ identifier[i] ] ...
def segments(self): """A dictionary of lists of contours keyed by z-index""" segments = dict() for i in xrange(len(self)): image = self[i] for (z, contour) in image.as_segments.iteritems(): for (byte_value, contour_set) in contour.iteritems(): if byte_value not in...
def click(self): """Click the element :returns: page element instance """ try: self.wait_until_clickable().web_element.click() except StaleElementReferenceException: # Retry if element has changed self.web_element.click() return self
def function[click, parameter[self]]: constant[Click the element :returns: page element instance ] <ast.Try object at 0x7da1b23ecb50> return[name[self]]
keyword[def] identifier[click] ( identifier[self] ): literal[string] keyword[try] : identifier[self] . identifier[wait_until_clickable] (). identifier[web_element] . identifier[click] () keyword[except] identifier[StaleElementReferenceException] : identi...
def click(self): """Click the element :returns: page element instance """ try: self.wait_until_clickable().web_element.click() # depends on [control=['try'], data=[]] except StaleElementReferenceException: # Retry if element has changed self.web_element.click() # d...
def get_kernel_spec(self, kernel_name): """Returns a :class:`KernelSpec` instance for the given kernel_name. Raises :exc:`NoSuchKernel` if the given kernel name is not found. """ if kernel_name == CURRENT_ENV_KERNEL_NAME: return self.kernel_spec_class( resour...
def function[get_kernel_spec, parameter[self, kernel_name]]: constant[Returns a :class:`KernelSpec` instance for the given kernel_name. Raises :exc:`NoSuchKernel` if the given kernel name is not found. ] if compare[name[kernel_name] equal[==] name[CURRENT_ENV_KERNEL_NAME]] begin[:] ...
keyword[def] identifier[get_kernel_spec] ( identifier[self] , identifier[kernel_name] ): literal[string] keyword[if] identifier[kernel_name] == identifier[CURRENT_ENV_KERNEL_NAME] : keyword[return] identifier[self] . identifier[kernel_spec_class] ( identifier[resource_di...
def get_kernel_spec(self, kernel_name): """Returns a :class:`KernelSpec` instance for the given kernel_name. Raises :exc:`NoSuchKernel` if the given kernel name is not found. """ if kernel_name == CURRENT_ENV_KERNEL_NAME: return self.kernel_spec_class(resource_dir=ipykernel.kernelspec.R...
def expect_exitstatus(self, exit_status): """Wait for the running program to finish and expect some exit status. Args: exit_status (int): The expected exit status. Raises: WrongExitStatusException: The produced exit status is not the expected one. """ s...
def function[expect_exitstatus, parameter[self, exit_status]]: constant[Wait for the running program to finish and expect some exit status. Args: exit_status (int): The expected exit status. Raises: WrongExitStatusException: The produced exit status is not the expected...
keyword[def] identifier[expect_exitstatus] ( identifier[self] , identifier[exit_status] ): literal[string] identifier[self] . identifier[expect_end] () identifier[logger] . identifier[debug] ( literal[string] . identifier[format] ( identifier[self] . identifier[name] , identifier[...
def expect_exitstatus(self, exit_status): """Wait for the running program to finish and expect some exit status. Args: exit_status (int): The expected exit status. Raises: WrongExitStatusException: The produced exit status is not the expected one. """ self.expe...
def initialize(): """ Function to initialize settings from command line and/or custom settings file :return: Returns str with operation type """ if len(sys.argv) == 1: usage() sys.exit() command = _get_command(sys.argv[1]) try: opts, args = getopt.getopt(sys.argv[2:...
def function[initialize, parameter[]]: constant[ Function to initialize settings from command line and/or custom settings file :return: Returns str with operation type ] if compare[call[name[len], parameter[name[sys].argv]] equal[==] constant[1]] begin[:] call[name[usage], pa...
keyword[def] identifier[initialize] (): literal[string] keyword[if] identifier[len] ( identifier[sys] . identifier[argv] )== literal[int] : identifier[usage] () identifier[sys] . identifier[exit] () identifier[command] = identifier[_get_command] ( identifier[sys] . identifier[argv]...
def initialize(): """ Function to initialize settings from command line and/or custom settings file :return: Returns str with operation type """ if len(sys.argv) == 1: usage() sys.exit() # depends on [control=['if'], data=[]] command = _get_command(sys.argv[1]) try: ...
def service_search(auth=None, **kwargs): ''' Search services CLI Example: .. code-block:: bash salt '*' keystoneng.service_search salt '*' keystoneng.service_search name=glance salt '*' keystoneng.service_search name=135f0403f8e544dc9008c6739ecda860 ''' cloud = get_ope...
def function[service_search, parameter[auth]]: constant[ Search services CLI Example: .. code-block:: bash salt '*' keystoneng.service_search salt '*' keystoneng.service_search name=glance salt '*' keystoneng.service_search name=135f0403f8e544dc9008c6739ecda860 ] ...
keyword[def] identifier[service_search] ( identifier[auth] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[cloud] = identifier[get_operator_cloud] ( identifier[auth] ) identifier[kwargs] = identifier[_clean_kwargs] (** identifier[kwargs] ) keyword[return] identifier[cloud] ....
def service_search(auth=None, **kwargs): """ Search services CLI Example: .. code-block:: bash salt '*' keystoneng.service_search salt '*' keystoneng.service_search name=glance salt '*' keystoneng.service_search name=135f0403f8e544dc9008c6739ecda860 """ cloud = get_ope...
def get_external_tools_in_course(self, course_id, params={}): """ Return external tools for the passed canvas course id. https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.index """ url = COURSES_API.format(course_id) + "/external_tools" ex...
def function[get_external_tools_in_course, parameter[self, course_id, params]]: constant[ Return external tools for the passed canvas course id. https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.index ] variable[url] assign[=] binary_operation[call...
keyword[def] identifier[get_external_tools_in_course] ( identifier[self] , identifier[course_id] , identifier[params] ={}): literal[string] identifier[url] = identifier[COURSES_API] . identifier[format] ( identifier[course_id] )+ literal[string] identifier[external_tools] =[] ke...
def get_external_tools_in_course(self, course_id, params={}): """ Return external tools for the passed canvas course id. https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.index """ url = COURSES_API.format(course_id) + '/external_tools' external_tools ...
def visit_starred(self, node): """Check that a Starred expression is used in an assignment target.""" if isinstance(node.parent, astroid.Call): # f(*args) is converted to Call(args=[Starred]), so ignore # them for this check. return if PY35 and isinstance( ...
def function[visit_starred, parameter[self, node]]: constant[Check that a Starred expression is used in an assignment target.] if call[name[isinstance], parameter[name[node].parent, name[astroid].Call]] begin[:] return[None] if <ast.BoolOp object at 0x7da1b03155d0> begin[:] retur...
keyword[def] identifier[visit_starred] ( identifier[self] , identifier[node] ): literal[string] keyword[if] identifier[isinstance] ( identifier[node] . identifier[parent] , identifier[astroid] . identifier[Call] ): keyword[return] keyword[if] identifier[PY...
def visit_starred(self, node): """Check that a Starred expression is used in an assignment target.""" if isinstance(node.parent, astroid.Call): # f(*args) is converted to Call(args=[Starred]), so ignore # them for this check. return # depends on [control=['if'], data=[]] if PY35 and...
def get_header(self, header_name): """ Returns a header with that name, creates it if it does not exist. """ if header_name in self.headers: return self.headers[header_name] return self.add_header_name(header_name)
def function[get_header, parameter[self, header_name]]: constant[ Returns a header with that name, creates it if it does not exist. ] if compare[name[header_name] in name[self].headers] begin[:] return[call[name[self].headers][name[header_name]]] return[call[name[self].add_he...
keyword[def] identifier[get_header] ( identifier[self] , identifier[header_name] ): literal[string] keyword[if] identifier[header_name] keyword[in] identifier[self] . identifier[headers] : keyword[return] identifier[self] . identifier[headers] [ identifier[header_name] ] k...
def get_header(self, header_name): """ Returns a header with that name, creates it if it does not exist. """ if header_name in self.headers: return self.headers[header_name] # depends on [control=['if'], data=['header_name']] return self.add_header_name(header_name)
def _validate_dependencies(self, dependencies, field, value): """ {'type': ('dict', 'hashable', 'list'), 'check_with': 'dependencies'} """ if isinstance(dependencies, _str_type) or not isinstance( dependencies, (Iterable, Mapping) ): dependencies = (dependenc...
def function[_validate_dependencies, parameter[self, dependencies, field, value]]: constant[ {'type': ('dict', 'hashable', 'list'), 'check_with': 'dependencies'} ] if <ast.BoolOp object at 0x7da2054a4430> begin[:] variable[dependencies] assign[=] tuple[[<ast.Name object at 0...
keyword[def] identifier[_validate_dependencies] ( identifier[self] , identifier[dependencies] , identifier[field] , identifier[value] ): literal[string] keyword[if] identifier[isinstance] ( identifier[dependencies] , identifier[_str_type] ) keyword[or] keyword[not] identifier[isinstance] ( ...
def _validate_dependencies(self, dependencies, field, value): """ {'type': ('dict', 'hashable', 'list'), 'check_with': 'dependencies'} """ if isinstance(dependencies, _str_type) or not isinstance(dependencies, (Iterable, Mapping)): dependencies = (dependencies,) # depends on [control=['if'...
def _content_function(self): """ This returns a set containing the actively shown module. This is so we only get update events triggered for these modules. """ # ensure that active is valid self.active = self.active % len(self.items) return set([self.items[self.a...
def function[_content_function, parameter[self]]: constant[ This returns a set containing the actively shown module. This is so we only get update events triggered for these modules. ] name[self].active assign[=] binary_operation[name[self].active <ast.Mod object at 0x7da2590d692...
keyword[def] identifier[_content_function] ( identifier[self] ): literal[string] identifier[self] . identifier[active] = identifier[self] . identifier[active] % identifier[len] ( identifier[self] . identifier[items] ) keyword[return] identifier[set] ([ identifier[self] . identif...
def _content_function(self): """ This returns a set containing the actively shown module. This is so we only get update events triggered for these modules. """ # ensure that active is valid self.active = self.active % len(self.items) return set([self.items[self.active]])
def simulate_feeddata(self, feedid, data, mime=None, time=None): """Simulate the last feeddata received for given feedid Calls the registered callback for the feed with the last recieved feed data. Allows you to test your code without having to wait for the remote thing to share again. ...
def function[simulate_feeddata, parameter[self, feedid, data, mime, time]]: constant[Simulate the last feeddata received for given feedid Calls the registered callback for the feed with the last recieved feed data. Allows you to test your code without having to wait for the remote thing to share...
keyword[def] identifier[simulate_feeddata] ( identifier[self] , identifier[feedid] , identifier[data] , identifier[mime] = keyword[None] , identifier[time] = keyword[None] ): literal[string] identifier[self] . identifier[__client] . identifier[simulate_feeddata] ( identifier[feedid] , identifier[da...
def simulate_feeddata(self, feedid, data, mime=None, time=None): """Simulate the last feeddata received for given feedid Calls the registered callback for the feed with the last recieved feed data. Allows you to test your code without having to wait for the remote thing to share again. `fee...
def resolve_out(self, ins): """ Determine which stream the output is synchronised with. If the incoming streams have different sync values, then it is unknown what synchronisation the outgoing stream should have. :param ins: dictionary of the incoming streams' sync values :ret...
def function[resolve_out, parameter[self, ins]]: constant[ Determine which stream the output is synchronised with. If the incoming streams have different sync values, then it is unknown what synchronisation the outgoing stream should have. :param ins: dictionary of the incoming stream...
keyword[def] identifier[resolve_out] ( identifier[self] , identifier[ins] ): literal[string] identifier[values] = identifier[set] () keyword[for] identifier[value] keyword[in] identifier[ins] . identifier[values] (): identifier[values] . identifier[update] ( identifier[valu...
def resolve_out(self, ins): """ Determine which stream the output is synchronised with. If the incoming streams have different sync values, then it is unknown what synchronisation the outgoing stream should have. :param ins: dictionary of the incoming streams' sync values :return:...
def do_daemon_init_and_start(self, set_proc_title=True): """Main daemon function. Clean, allocates, initializes and starts all necessary resources to go in daemon mode. The set_proc_title parameter is mainly useful for the Alignak unit tests. This to avoid changing the test process name...
def function[do_daemon_init_and_start, parameter[self, set_proc_title]]: constant[Main daemon function. Clean, allocates, initializes and starts all necessary resources to go in daemon mode. The set_proc_title parameter is mainly useful for the Alignak unit tests. This to avoid changing...
keyword[def] identifier[do_daemon_init_and_start] ( identifier[self] , identifier[set_proc_title] = keyword[True] ): literal[string] keyword[if] identifier[set_proc_title] : identifier[self] . identifier[set_proctitle] ( identifier[self] . identifier[name] ) ide...
def do_daemon_init_and_start(self, set_proc_title=True): """Main daemon function. Clean, allocates, initializes and starts all necessary resources to go in daemon mode. The set_proc_title parameter is mainly useful for the Alignak unit tests. This to avoid changing the test process name! ...
def registerParentFlag(self, optionName, value): '''Register a flag of a parent command :Parameters: - `optionName`: String. Name of option - `value`: Mixed. Value of parsed flag` ''' self.parentFlags.update({optionName: value}) return self
def function[registerParentFlag, parameter[self, optionName, value]]: constant[Register a flag of a parent command :Parameters: - `optionName`: String. Name of option - `value`: Mixed. Value of parsed flag` ] call[name[self].parentFlags.update, parameter[dictiona...
keyword[def] identifier[registerParentFlag] ( identifier[self] , identifier[optionName] , identifier[value] ): literal[string] identifier[self] . identifier[parentFlags] . identifier[update] ({ identifier[optionName] : identifier[value] }) keyword[return] identifier[self]
def registerParentFlag(self, optionName, value): """Register a flag of a parent command :Parameters: - `optionName`: String. Name of option - `value`: Mixed. Value of parsed flag` """ self.parentFlags.update({optionName: value}) return self
def get_type(obj, **kwargs): """Return the type of an object. Do some regex to remove the "<class..." bit.""" t = type(obj) s = extract_type(str(t)) return 'Type: {}'.format(s)
def function[get_type, parameter[obj]]: constant[Return the type of an object. Do some regex to remove the "<class..." bit.] variable[t] assign[=] call[name[type], parameter[name[obj]]] variable[s] assign[=] call[name[extract_type], parameter[call[name[str], parameter[name[t]]]]] return[call...
keyword[def] identifier[get_type] ( identifier[obj] ,** identifier[kwargs] ): literal[string] identifier[t] = identifier[type] ( identifier[obj] ) identifier[s] = identifier[extract_type] ( identifier[str] ( identifier[t] )) keyword[return] literal[string] . identifier[format] ( identifier[s] ...
def get_type(obj, **kwargs): """Return the type of an object. Do some regex to remove the "<class..." bit.""" t = type(obj) s = extract_type(str(t)) return 'Type: {}'.format(s)
def set_tts(self, level): """ Set the values for :data:`~aeneas.runtimeconfiguration.RuntimeConfiguration.TTS` and :data:`~aeneas.runtimeconfiguration.RuntimeConfiguration.TTS_PATH` matching the given granularity level. Currently supported levels: * ``1`...
def function[set_tts, parameter[self, level]]: constant[ Set the values for :data:`~aeneas.runtimeconfiguration.RuntimeConfiguration.TTS` and :data:`~aeneas.runtimeconfiguration.RuntimeConfiguration.TTS_PATH` matching the given granularity level. Currently suppor...
keyword[def] identifier[set_tts] ( identifier[self] , identifier[level] ): literal[string] keyword[if] identifier[level] keyword[in] identifier[self] . identifier[TTS_GRANULARITY_MAP] . identifier[keys] (): identifier[tts_key] , identifier[tts_path_key] = identifier[self] . identifi...
def set_tts(self, level): """ Set the values for :data:`~aeneas.runtimeconfiguration.RuntimeConfiguration.TTS` and :data:`~aeneas.runtimeconfiguration.RuntimeConfiguration.TTS_PATH` matching the given granularity level. Currently supported levels: * ``1`` (p...
def xy_reading_order(e1, e2): """ A comparator to sort bboxes from left to right, top to bottom """ b1 = e1.bbox b2 = e2.bbox if round(b1[x0]) == round(b2[x0]): return float_cmp(b1[y0], b2[y0]) return float_cmp(b1[x0], b2[x0])
def function[xy_reading_order, parameter[e1, e2]]: constant[ A comparator to sort bboxes from left to right, top to bottom ] variable[b1] assign[=] name[e1].bbox variable[b2] assign[=] name[e2].bbox if compare[call[name[round], parameter[call[name[b1]][name[x0]]]] equal[==] call[...
keyword[def] identifier[xy_reading_order] ( identifier[e1] , identifier[e2] ): literal[string] identifier[b1] = identifier[e1] . identifier[bbox] identifier[b2] = identifier[e2] . identifier[bbox] keyword[if] identifier[round] ( identifier[b1] [ identifier[x0] ])== identifier[round] ( identifi...
def xy_reading_order(e1, e2): """ A comparator to sort bboxes from left to right, top to bottom """ b1 = e1.bbox b2 = e2.bbox if round(b1[x0]) == round(b2[x0]): return float_cmp(b1[y0], b2[y0]) # depends on [control=['if'], data=[]] return float_cmp(b1[x0], b2[x0])
def sample(records, k, random_seed=None): """Choose a length-``k`` subset of ``records``, retaining the input order. If k > len(records), all are returned. If an integer ``random_seed`` is provided, sets ``random.seed()`` """ if random_seed is not None: random.seed(random_seed) resul...
def function[sample, parameter[records, k, random_seed]]: constant[Choose a length-``k`` subset of ``records``, retaining the input order. If k > len(records), all are returned. If an integer ``random_seed`` is provided, sets ``random.seed()`` ] if compare[name[random_seed] is_not constant...
keyword[def] identifier[sample] ( identifier[records] , identifier[k] , identifier[random_seed] = keyword[None] ): literal[string] keyword[if] identifier[random_seed] keyword[is] keyword[not] keyword[None] : identifier[random] . identifier[seed] ( identifier[random_seed] ) identifier[re...
def sample(records, k, random_seed=None): """Choose a length-``k`` subset of ``records``, retaining the input order. If k > len(records), all are returned. If an integer ``random_seed`` is provided, sets ``random.seed()`` """ if random_seed is not None: random.seed(random_seed) # depends ...
def _send_mbus(self, frame): """Send modbus frame :param frame: modbus frame to send (with MBAP for TCP/CRC for RTU) :type frame: str (Python2) or class bytes (Python3) :returns: number of bytes send or None if error :rtype: int or None """ # for auto_open mode, ...
def function[_send_mbus, parameter[self, frame]]: constant[Send modbus frame :param frame: modbus frame to send (with MBAP for TCP/CRC for RTU) :type frame: str (Python2) or class bytes (Python3) :returns: number of bytes send or None if error :rtype: int or None ] ...
keyword[def] identifier[_send_mbus] ( identifier[self] , identifier[frame] ): literal[string] keyword[if] identifier[self] . identifier[__auto_open] keyword[and] keyword[not] identifier[self] . identifier[is_open] (): identifier[self] . identifier[open] () ...
def _send_mbus(self, frame): """Send modbus frame :param frame: modbus frame to send (with MBAP for TCP/CRC for RTU) :type frame: str (Python2) or class bytes (Python3) :returns: number of bytes send or None if error :rtype: int or None """ # for auto_open mode, check TC...
def list_datastores(kwargs=None, call=None): ''' List all the datastores for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datastores my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_datastores function...
def function[list_datastores, parameter[kwargs, call]]: constant[ List all the datastores for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datastores my-vmware-config ] if compare[name[call] not_equal[!=] constant[function]] begin[:] <as...
keyword[def] identifier[list_datastores] ( identifier[kwargs] = keyword[None] , identifier[call] = keyword[None] ): literal[string] keyword[if] identifier[call] != literal[string] : keyword[raise] identifier[SaltCloudSystemExit] ( literal[string] literal[string] ) ...
def list_datastores(kwargs=None, call=None): """ List all the datastores for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datastores my-vmware-config """ if call != 'function': raise SaltCloudSystemExit('The list_datastores function must be call...
def find_entries(self, users, start, *args, **kwargs): """ Find all entries for all users, from a given starting point. If no starting point is provided, all entries are returned. """ forever = kwargs.get('all', False) for user in users: if forever: ...
def function[find_entries, parameter[self, users, start]]: constant[ Find all entries for all users, from a given starting point. If no starting point is provided, all entries are returned. ] variable[forever] assign[=] call[name[kwargs].get, parameter[constant[all], constant[Fal...
keyword[def] identifier[find_entries] ( identifier[self] , identifier[users] , identifier[start] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[forever] = identifier[kwargs] . identifier[get] ( literal[string] , keyword[False] ) keyword[for] identifier[user] key...
def find_entries(self, users, start, *args, **kwargs): """ Find all entries for all users, from a given starting point. If no starting point is provided, all entries are returned. """ forever = kwargs.get('all', False) for user in users: if forever: entries = Entr...
def stop(self): """Closes the websocket connection and ensures it won't reconnect.""" self._logger.debug("The Slack RTMClient is shutting down.") self._stopped = True self._close_websocket()
def function[stop, parameter[self]]: constant[Closes the websocket connection and ensures it won't reconnect.] call[name[self]._logger.debug, parameter[constant[The Slack RTMClient is shutting down.]]] name[self]._stopped assign[=] constant[True] call[name[self]._close_websocket, paramet...
keyword[def] identifier[stop] ( identifier[self] ): literal[string] identifier[self] . identifier[_logger] . identifier[debug] ( literal[string] ) identifier[self] . identifier[_stopped] = keyword[True] identifier[self] . identifier[_close_websocket] ()
def stop(self): """Closes the websocket connection and ensures it won't reconnect.""" self._logger.debug('The Slack RTMClient is shutting down.') self._stopped = True self._close_websocket()
def getPublicBundle(self): """ Fill a PublicBundle object with the public bundle data of this State. :returns: An instance of PublicBundle, filled with the public data of this State. """ self.__checkSPKTimestamp() ik_pub = self.__ik.pub spk_pub = self.__sp...
def function[getPublicBundle, parameter[self]]: constant[ Fill a PublicBundle object with the public bundle data of this State. :returns: An instance of PublicBundle, filled with the public data of this State. ] call[name[self].__checkSPKTimestamp, parameter[]] variable[...
keyword[def] identifier[getPublicBundle] ( identifier[self] ): literal[string] identifier[self] . identifier[__checkSPKTimestamp] () identifier[ik_pub] = identifier[self] . identifier[__ik] . identifier[pub] identifier[spk_pub] = identifier[self] . identifier[__spk] [ literal[s...
def getPublicBundle(self): """ Fill a PublicBundle object with the public bundle data of this State. :returns: An instance of PublicBundle, filled with the public data of this State. """ self.__checkSPKTimestamp() ik_pub = self.__ik.pub spk_pub = self.__spk['key'].pub spk_si...
def validate_request_row_key(self, request): ''' Validates that all requests have the different RowKey and adds RowKey to existing RowKey list. request: the request to insert, update or delete entity ''' if self.batch_row_keys: if self.get_request...
def function[validate_request_row_key, parameter[self, request]]: constant[ Validates that all requests have the different RowKey and adds RowKey to existing RowKey list. request: the request to insert, update or delete entity ] if name[self].batch_row_keys b...
keyword[def] identifier[validate_request_row_key] ( identifier[self] , identifier[request] ): literal[string] keyword[if] identifier[self] . identifier[batch_row_keys] : keyword[if] identifier[self] . identifier[get_request_row_key] ( identifier[request] ) keyword[in] identifier[sel...
def validate_request_row_key(self, request): """ Validates that all requests have the different RowKey and adds RowKey to existing RowKey list. request: the request to insert, update or delete entity """ if self.batch_row_keys: if self.get_request_row_key(req...
def bilinear_interpolation_weights(self, lon, lat): """ Get the four neighbours for each (lon, lat) position and the weight associated with each one for bilinear interpolation. Parameters ---------- lon, lat : :class:`~astropy.units.Quantity` The longitude an...
def function[bilinear_interpolation_weights, parameter[self, lon, lat]]: constant[ Get the four neighbours for each (lon, lat) position and the weight associated with each one for bilinear interpolation. Parameters ---------- lon, lat : :class:`~astropy.units.Quantity` ...
keyword[def] identifier[bilinear_interpolation_weights] ( identifier[self] , identifier[lon] , identifier[lat] ): literal[string] keyword[return] identifier[bilinear_interpolation_weights] ( identifier[lon] , identifier[lat] , identifier[self] . identifier[nside] , identifier[order] = identifier[s...
def bilinear_interpolation_weights(self, lon, lat): """ Get the four neighbours for each (lon, lat) position and the weight associated with each one for bilinear interpolation. Parameters ---------- lon, lat : :class:`~astropy.units.Quantity` The longitude and la...
def delete_status(app, user, status_id): """ Deletes a status with given ID. https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#deleting-a-status """ return http.delete(app, user, '/api/v1/statuses/{}'.format(status_id))
def function[delete_status, parameter[app, user, status_id]]: constant[ Deletes a status with given ID. https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#deleting-a-status ] return[call[name[http].delete, parameter[name[app], name[user], call[constant[/api/v1/statuses/{...
keyword[def] identifier[delete_status] ( identifier[app] , identifier[user] , identifier[status_id] ): literal[string] keyword[return] identifier[http] . identifier[delete] ( identifier[app] , identifier[user] , literal[string] . identifier[format] ( identifier[status_id] ))
def delete_status(app, user, status_id): """ Deletes a status with given ID. https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#deleting-a-status """ return http.delete(app, user, '/api/v1/statuses/{}'.format(status_id))
def _consume_python_token(self, token): """Consume the buffer up to the given token (from _peek_python_tokens). Returns a single string that was consumed. """ ret = [] line, col = token[3] if line > 1: ret = self._buffer[:line-1] self._buffer[:li...
def function[_consume_python_token, parameter[self, token]]: constant[Consume the buffer up to the given token (from _peek_python_tokens). Returns a single string that was consumed. ] variable[ret] assign[=] list[[]] <ast.Tuple object at 0x7da1b2533d90> assign[=] call[name[toke...
keyword[def] identifier[_consume_python_token] ( identifier[self] , identifier[token] ): literal[string] identifier[ret] =[] identifier[line] , identifier[col] = identifier[token] [ literal[int] ] keyword[if] identifier[line] > literal[int] : identifier[ret] = identi...
def _consume_python_token(self, token): """Consume the buffer up to the given token (from _peek_python_tokens). Returns a single string that was consumed. """ ret = [] (line, col) = token[3] if line > 1: ret = self._buffer[:line - 1] self._buffer[:line - 1] = [] # depe...
def Execute(cmd, args, time_limit=-1, bypass_whitelist=False, daemon=False, use_client_context=False, cwd=None): """Executes commands on the client. This function is the only place where commands will be executed by the GRR client. This make...
def function[Execute, parameter[cmd, args, time_limit, bypass_whitelist, daemon, use_client_context, cwd]]: constant[Executes commands on the client. This function is the only place where commands will be executed by the GRR client. This makes sure that all issued commands are compared to a white list an...
keyword[def] identifier[Execute] ( identifier[cmd] , identifier[args] , identifier[time_limit] =- literal[int] , identifier[bypass_whitelist] = keyword[False] , identifier[daemon] = keyword[False] , identifier[use_client_context] = keyword[False] , identifier[cwd] = keyword[None] ): literal[string] keywo...
def Execute(cmd, args, time_limit=-1, bypass_whitelist=False, daemon=False, use_client_context=False, cwd=None): """Executes commands on the client. This function is the only place where commands will be executed by the GRR client. This makes sure that all issued commands are compared to a white list and no ...
def vsan_add_disks(host, username, password, protocol=None, port=None, host_names=None): ''' Add any VSAN-eligible disks to the VSAN System for the given host or list of host_names. host The location of the host. username The username used to login to the host, such as ``root``. p...
def function[vsan_add_disks, parameter[host, username, password, protocol, port, host_names]]: constant[ Add any VSAN-eligible disks to the VSAN System for the given host or list of host_names. host The location of the host. username The username used to login to the host, such as ...
keyword[def] identifier[vsan_add_disks] ( identifier[host] , identifier[username] , identifier[password] , identifier[protocol] = keyword[None] , identifier[port] = keyword[None] , identifier[host_names] = keyword[None] ): literal[string] identifier[service_instance] = identifier[salt] . identifier[utils] ...
def vsan_add_disks(host, username, password, protocol=None, port=None, host_names=None): """ Add any VSAN-eligible disks to the VSAN System for the given host or list of host_names. host The location of the host. username The username used to login to the host, such as ``root``. p...
def get_merge_command(self, revision): """Get the command to merge a revision into the current branch (without committing the result).""" return [ 'git', '-c', 'user.name=%s' % self.author.name, '-c', 'user.email=%s' % self.author.email, 'merge', '--no-com...
def function[get_merge_command, parameter[self, revision]]: constant[Get the command to merge a revision into the current branch (without committing the result).] return[list[[<ast.Constant object at 0x7da1b0a37d30>, <ast.Constant object at 0x7da1b0a37d60>, <ast.BinOp object at 0x7da1b0a36710>, <ast.Constan...
keyword[def] identifier[get_merge_command] ( identifier[self] , identifier[revision] ): literal[string] keyword[return] [ literal[string] , literal[string] , literal[string] % identifier[self] . identifier[author] . identifier[name] , literal[string] , literal[string] % i...
def get_merge_command(self, revision): """Get the command to merge a revision into the current branch (without committing the result).""" return ['git', '-c', 'user.name=%s' % self.author.name, '-c', 'user.email=%s' % self.author.email, 'merge', '--no-commit', '--no-ff', revision]
def add_field(self, field_instance_or_string): """ Appends a field, can be a :class:`~es_fluent.fields.Field` or string. """ if isinstance(field_instance_or_string, basestring): field_instance = Field(field_instance_or_string) elif isinstance(field_instance_or_string,...
def function[add_field, parameter[self, field_instance_or_string]]: constant[ Appends a field, can be a :class:`~es_fluent.fields.Field` or string. ] if call[name[isinstance], parameter[name[field_instance_or_string], name[basestring]]] begin[:] variable[field_instance] a...
keyword[def] identifier[add_field] ( identifier[self] , identifier[field_instance_or_string] ): literal[string] keyword[if] identifier[isinstance] ( identifier[field_instance_or_string] , identifier[basestring] ): identifier[field_instance] = identifier[Field] ( identifier[field_insta...
def add_field(self, field_instance_or_string): """ Appends a field, can be a :class:`~es_fluent.fields.Field` or string. """ if isinstance(field_instance_or_string, basestring): field_instance = Field(field_instance_or_string) # depends on [control=['if'], data=[]] elif isinstance(f...
def start_worker(self, row): '''为task新建一个后台下载线程, 并开始下载.''' def on_worker_started(worker, fs_id): pass def on_worker_received(worker, fs_id, received, received_total): GLib.idle_add(do_worker_received, fs_id, received, received_total) def do_worker_received(fs_id...
def function[start_worker, parameter[self, row]]: constant[为task新建一个后台下载线程, 并开始下载.] def function[on_worker_started, parameter[worker, fs_id]]: pass def function[on_worker_received, parameter[worker, fs_id, received, received_total]]: call[name[GLib].idle_add, parameter[na...
keyword[def] identifier[start_worker] ( identifier[self] , identifier[row] ): literal[string] keyword[def] identifier[on_worker_started] ( identifier[worker] , identifier[fs_id] ): keyword[pass] keyword[def] identifier[on_worker_received] ( identifier[worker] , identifier[...
def start_worker(self, row): """为task新建一个后台下载线程, 并开始下载.""" def on_worker_started(worker, fs_id): pass def on_worker_received(worker, fs_id, received, received_total): GLib.idle_add(do_worker_received, fs_id, received, received_total) def do_worker_received(fs_id, received, received_to...
def add_websocket_route( self, handler, uri, host=None, version=None, name=None ): """Create a blueprint websocket route from a function. :param handler: function for handling uri requests. Accepts function, or class instance with a view_class method. :param ...
def function[add_websocket_route, parameter[self, handler, uri, host, version, name]]: constant[Create a blueprint websocket route from a function. :param handler: function for handling uri requests. Accepts function, or class instance with a view_class method. :param ur...
keyword[def] identifier[add_websocket_route] ( identifier[self] , identifier[handler] , identifier[uri] , identifier[host] = keyword[None] , identifier[version] = keyword[None] , identifier[name] = keyword[None] ): literal[string] identifier[self] . identifier[websocket] ( identifier[uri] = ident...
def add_websocket_route(self, handler, uri, host=None, version=None, name=None): """Create a blueprint websocket route from a function. :param handler: function for handling uri requests. Accepts function, or class instance with a view_class method. :param uri: endpoint at w...
def read_var_uint32(self): """Reads a varint from the stream, interprets this varint as an unsigned, 32-bit integer, and returns the integer. """ i = self.read_var_uint64() if i > wire_format.UINT32_MAX: raise errors.DecodeError('Value out of range for uint32: %d' % i...
def function[read_var_uint32, parameter[self]]: constant[Reads a varint from the stream, interprets this varint as an unsigned, 32-bit integer, and returns the integer. ] variable[i] assign[=] call[name[self].read_var_uint64, parameter[]] if compare[name[i] greater[>] name[wire_f...
keyword[def] identifier[read_var_uint32] ( identifier[self] ): literal[string] identifier[i] = identifier[self] . identifier[read_var_uint64] () keyword[if] identifier[i] > identifier[wire_format] . identifier[UINT32_MAX] : keyword[raise] identifier[errors] . identifier[Deco...
def read_var_uint32(self): """Reads a varint from the stream, interprets this varint as an unsigned, 32-bit integer, and returns the integer. """ i = self.read_var_uint64() if i > wire_format.UINT32_MAX: raise errors.DecodeError('Value out of range for uint32: %d' % i) # depends on ...
async def pin_message(self, message_id: int, disable_notification: bool = False): """ Use this method to pin a message in a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Source: https://core.telegram.org/bots/api#pi...
<ast.AsyncFunctionDef object at 0x7da1b1844be0>
keyword[async] keyword[def] identifier[pin_message] ( identifier[self] , identifier[message_id] : identifier[int] , identifier[disable_notification] : identifier[bool] = keyword[False] ): literal[string] keyword[return] keyword[await] identifier[self] . identifier[bot] . identifier[pin_chat_mess...
async def pin_message(self, message_id: int, disable_notification: bool=False): """ Use this method to pin a message in a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Source: https://core.telegram.org/bots/api#pinchatm...
def setPhysicalMinimum(self, edfsignal, physical_minimum): """ Sets the physical_minimum of signal edfsignal. Parameters ---------- edfsignal: int signal number physical_minimum: float Sets the physical minimum Notes ----- ...
def function[setPhysicalMinimum, parameter[self, edfsignal, physical_minimum]]: constant[ Sets the physical_minimum of signal edfsignal. Parameters ---------- edfsignal: int signal number physical_minimum: float Sets the physical minimum ...
keyword[def] identifier[setPhysicalMinimum] ( identifier[self] , identifier[edfsignal] , identifier[physical_minimum] ): literal[string] keyword[if] ( identifier[edfsignal] < literal[int] keyword[or] identifier[edfsignal] > identifier[self] . identifier[n_channels] ): keyword[raise] ...
def setPhysicalMinimum(self, edfsignal, physical_minimum): """ Sets the physical_minimum of signal edfsignal. Parameters ---------- edfsignal: int signal number physical_minimum: float Sets the physical minimum Notes ----- Thi...
def export_gltf(scene, extras=None, include_normals=False): """ Export a scene object as a GLTF directory. This puts each mesh into a separate file (i.e. a `buffer`) as opposed to one larger file. Parameters ----------- scene : trimesh.Scene Scene to b...
def function[export_gltf, parameter[scene, extras, include_normals]]: constant[ Export a scene object as a GLTF directory. This puts each mesh into a separate file (i.e. a `buffer`) as opposed to one larger file. Parameters ----------- scene : trimesh.Scene Scene to be exported ...
keyword[def] identifier[export_gltf] ( identifier[scene] , identifier[extras] = keyword[None] , identifier[include_normals] = keyword[False] ): literal[string] keyword[if] ( keyword[not] identifier[util] . identifier[is_instance_named] ( identifier[scene] , literal[string] ) keyword[and] iden...
def export_gltf(scene, extras=None, include_normals=False): """ Export a scene object as a GLTF directory. This puts each mesh into a separate file (i.e. a `buffer`) as opposed to one larger file. Parameters ----------- scene : trimesh.Scene Scene to be exported Returns ----...
def _process_msg(self, client, state, reward, isOver): """ Process a message sent from some client. """ # in the first message, only state is valid, # reward&isOver should be discarded if len(client.memory) > 0: client.memory[-1].reward = reward if...
def function[_process_msg, parameter[self, client, state, reward, isOver]]: constant[ Process a message sent from some client. ] if compare[call[name[len], parameter[name[client].memory]] greater[>] constant[0]] begin[:] call[name[client].memory][<ast.UnaryOp object at 0x...
keyword[def] identifier[_process_msg] ( identifier[self] , identifier[client] , identifier[state] , identifier[reward] , identifier[isOver] ): literal[string] keyword[if] identifier[len] ( identifier[client] . identifier[memory] )> literal[int] : identifier[client] ....
def _process_msg(self, client, state, reward, isOver): """ Process a message sent from some client. """ # in the first message, only state is valid, # reward&isOver should be discarded if len(client.memory) > 0: client.memory[-1].reward = reward if isOver: # s...
def simxSetObjectOrientation(clientID, objectHandle, relativeToObjectHandle, eulerAngles, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' angles = (ct.c_float*3)(*eulerAngles) return c_SetObjectOrientation(clientID, objectHandle, relativ...
def function[simxSetObjectOrientation, parameter[clientID, objectHandle, relativeToObjectHandle, eulerAngles, operationMode]]: constant[ Please have a look at the function description/documentation in the V-REP user manual ] variable[angles] assign[=] call[binary_operation[name[ct].c_float * con...
keyword[def] identifier[simxSetObjectOrientation] ( identifier[clientID] , identifier[objectHandle] , identifier[relativeToObjectHandle] , identifier[eulerAngles] , identifier[operationMode] ): literal[string] identifier[angles] =( identifier[ct] . identifier[c_float] * literal[int] )(* identifier[eulerAn...
def simxSetObjectOrientation(clientID, objectHandle, relativeToObjectHandle, eulerAngles, operationMode): """ Please have a look at the function description/documentation in the V-REP user manual """ angles = (ct.c_float * 3)(*eulerAngles) return c_SetObjectOrientation(clientID, objectHandle, relati...
def delete(self, ids): """ Method to delete equipments by their id's :param ids: Identifiers of equipments :return: None """ url = build_uri_with_ids('api/v4/equipment/%s/', ids) return super(ApiV4Equipment, self).delete(url)
def function[delete, parameter[self, ids]]: constant[ Method to delete equipments by their id's :param ids: Identifiers of equipments :return: None ] variable[url] assign[=] call[name[build_uri_with_ids], parameter[constant[api/v4/equipment/%s/], name[ids]]] return[c...
keyword[def] identifier[delete] ( identifier[self] , identifier[ids] ): literal[string] identifier[url] = identifier[build_uri_with_ids] ( literal[string] , identifier[ids] ) keyword[return] identifier[super] ( identifier[ApiV4Equipment] , identifier[self] ). identifier[delete] ( identifi...
def delete(self, ids): """ Method to delete equipments by their id's :param ids: Identifiers of equipments :return: None """ url = build_uri_with_ids('api/v4/equipment/%s/', ids) return super(ApiV4Equipment, self).delete(url)
def to_method(func): """ Lift :func:`func` to a method; it will be called with the first argument 'self' ignored. :param func: Any callable object """ @functools.wraps(func) def wrapper(*args, **kwargs): """Wrapper function. """ return func(*args[1:], **kwargs) ...
def function[to_method, parameter[func]]: constant[ Lift :func:`func` to a method; it will be called with the first argument 'self' ignored. :param func: Any callable object ] def function[wrapper, parameter[]]: constant[Wrapper function. ] return[call[na...
keyword[def] identifier[to_method] ( identifier[func] ): literal[string] @ identifier[functools] . identifier[wraps] ( identifier[func] ) keyword[def] identifier[wrapper] (* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[func] (* identifier[ar...
def to_method(func): """ Lift :func:`func` to a method; it will be called with the first argument 'self' ignored. :param func: Any callable object """ @functools.wraps(func) def wrapper(*args, **kwargs): """Wrapper function. """ return func(*args[1:], **kwargs) ...
def get_users(self): """Return the configuration of the users.""" users = {} _JUNOS_CLASS_CISCO_PRIVILEGE_LEVEL_MAP = { "super-user": 15, "superuser": 15, "operator": 5, "read-only": 1, "unauthorized": 0, } _DEFAULT_US...
def function[get_users, parameter[self]]: constant[Return the configuration of the users.] variable[users] assign[=] dictionary[[], []] variable[_JUNOS_CLASS_CISCO_PRIVILEGE_LEVEL_MAP] assign[=] dictionary[[<ast.Constant object at 0x7da1b1d93b80>, <ast.Constant object at 0x7da1b1d91c60>, <ast.Co...
keyword[def] identifier[get_users] ( identifier[self] ): literal[string] identifier[users] ={} identifier[_JUNOS_CLASS_CISCO_PRIVILEGE_LEVEL_MAP] ={ literal[string] : literal[int] , literal[string] : literal[int] , literal[string] : literal[int] , liter...
def get_users(self): """Return the configuration of the users.""" users = {} _JUNOS_CLASS_CISCO_PRIVILEGE_LEVEL_MAP = {'super-user': 15, 'superuser': 15, 'operator': 5, 'read-only': 1, 'unauthorized': 0} _DEFAULT_USER_DETAILS = {'level': 0, 'password': '', 'sshkeys': []} users_table = junos_views.ju...
def needs_to_be_resolved(parent_obj, attr_name): """ This function determines, if a reference (CrossReference) needs to be resolved or not (while creating the model, while resolving references). Args: parent_obj: the object containing the attribute to be resolved. attr_name: the attribu...
def function[needs_to_be_resolved, parameter[parent_obj, attr_name]]: constant[ This function determines, if a reference (CrossReference) needs to be resolved or not (while creating the model, while resolving references). Args: parent_obj: the object containing the attribute to be resolved....
keyword[def] identifier[needs_to_be_resolved] ( identifier[parent_obj] , identifier[attr_name] ): literal[string] keyword[if] identifier[hasattr] ( identifier[get_model] ( identifier[parent_obj] ), literal[string] ): keyword[return] identifier[get_model] ( identifier[parent_obj] ). identifier[_t...
def needs_to_be_resolved(parent_obj, attr_name): """ This function determines, if a reference (CrossReference) needs to be resolved or not (while creating the model, while resolving references). Args: parent_obj: the object containing the attribute to be resolved. attr_name: the attribu...
def GetProperties(cls, path_spec): """Retrieves a dictionary containing the path specification properties. Args: path_spec (PathSpec): path specification. Returns: dict[str, str]: path specification properties. Raises: dict: path specification properties. """ properties = {}...
def function[GetProperties, parameter[cls, path_spec]]: constant[Retrieves a dictionary containing the path specification properties. Args: path_spec (PathSpec): path specification. Returns: dict[str, str]: path specification properties. Raises: dict: path specification properti...
keyword[def] identifier[GetProperties] ( identifier[cls] , identifier[path_spec] ): literal[string] identifier[properties] ={} keyword[for] identifier[property_name] keyword[in] identifier[cls] . identifier[PROPERTY_NAMES] : keyword[if] identifier[hasattr] ( identifier[path_spec] , id...
def GetProperties(cls, path_spec): """Retrieves a dictionary containing the path specification properties. Args: path_spec (PathSpec): path specification. Returns: dict[str, str]: path specification properties. Raises: dict: path specification properties. """ properties = {}...
def get_graderoster(section, instructor, requestor): """ Returns a restclients.GradeRoster for the passed Section model and instructor Person. """ label = GradeRoster(section=section, instructor=instructor).graderoster_label() url = "{}/{}".format(graderoster_url, encode_...
def function[get_graderoster, parameter[section, instructor, requestor]]: constant[ Returns a restclients.GradeRoster for the passed Section model and instructor Person. ] variable[label] assign[=] call[call[name[GradeRoster], parameter[]].graderoster_label, parameter[]] variable[url...
keyword[def] identifier[get_graderoster] ( identifier[section] , identifier[instructor] , identifier[requestor] ): literal[string] identifier[label] = identifier[GradeRoster] ( identifier[section] = identifier[section] , identifier[instructor] = identifier[instructor] ). identifier[graderoster_label] ...
def get_graderoster(section, instructor, requestor): """ Returns a restclients.GradeRoster for the passed Section model and instructor Person. """ label = GradeRoster(section=section, instructor=instructor).graderoster_label() url = '{}/{}'.format(graderoster_url, encode_section_label(label)) ...
def _submit_metrics(self, metrics, metric_name_and_type_by_property): """ Resolve metric names and types and submit it. """ for metric in metrics: if ( metric.name not in metric_name_and_type_by_property and metric.name.lower() not in metric_na...
def function[_submit_metrics, parameter[self, metrics, metric_name_and_type_by_property]]: constant[ Resolve metric names and types and submit it. ] for taget[name[metric]] in starred[name[metrics]] begin[:] if <ast.BoolOp object at 0x7da20c6e79d0> begin[:] co...
keyword[def] identifier[_submit_metrics] ( identifier[self] , identifier[metrics] , identifier[metric_name_and_type_by_property] ): literal[string] keyword[for] identifier[metric] keyword[in] identifier[metrics] : keyword[if] ( identifier[metric] . identifier[name] key...
def _submit_metrics(self, metrics, metric_name_and_type_by_property): """ Resolve metric names and types and submit it. """ for metric in metrics: if metric.name not in metric_name_and_type_by_property and metric.name.lower() not in metric_name_and_type_by_property: # Only re...
def __strip_extra_attributes(self, node: yaml.Node, known_attrs: List[str]) -> None: """Strips tags from extra attributes. This prevents nodes under attributes that are not part of our \ data model from being converted to objects. They'll be plain \ Comm...
def function[__strip_extra_attributes, parameter[self, node, known_attrs]]: constant[Strips tags from extra attributes. This prevents nodes under attributes that are not part of our data model from being converted to objects. They'll be plain CommentedMaps instead, which then get conver...
keyword[def] identifier[__strip_extra_attributes] ( identifier[self] , identifier[node] : identifier[yaml] . identifier[Node] , identifier[known_attrs] : identifier[List] [ identifier[str] ])-> keyword[None] : literal[string] identifier[known_keys] = identifier[list] ( identifier[known_attrs] ) ...
def __strip_extra_attributes(self, node: yaml.Node, known_attrs: List[str]) -> None: """Strips tags from extra attributes. This prevents nodes under attributes that are not part of our data model from being converted to objects. They'll be plain CommentedMaps instead, which then get convert...
def update_user_group(self, id, **kwargs): # noqa: E501 """Update a specific user group # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_user_group(id, ...
def function[update_user_group, parameter[self, id]]: constant[Update a specific user group # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_user_group(i...
keyword[def] identifier[update_user_group] ( identifier[self] , identifier[id] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[return] identifier[se...
def update_user_group(self, id, **kwargs): # noqa: E501 'Update a specific user group # noqa: E501\n\n # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.update_user_group(id, a...
def list_algorithms(self, page_size=None): """ Lists the algorithms visible to this client. Algorithms are returned in lexicographical order. :rtype: :class:`.Algorithm` iterator """ params = {} if page_size is not None: params['limit'] = page_size ...
def function[list_algorithms, parameter[self, page_size]]: constant[ Lists the algorithms visible to this client. Algorithms are returned in lexicographical order. :rtype: :class:`.Algorithm` iterator ] variable[params] assign[=] dictionary[[], []] if compare[na...
keyword[def] identifier[list_algorithms] ( identifier[self] , identifier[page_size] = keyword[None] ): literal[string] identifier[params] ={} keyword[if] identifier[page_size] keyword[is] keyword[not] keyword[None] : identifier[params] [ literal[string] ]= identifier[page...
def list_algorithms(self, page_size=None): """ Lists the algorithms visible to this client. Algorithms are returned in lexicographical order. :rtype: :class:`.Algorithm` iterator """ params = {} if page_size is not None: params['limit'] = page_size # depends on [co...
def scale_up(self, n, pods=None, **kwargs): """ Make sure we have n dask-workers available for this cluster Examples -------- >>> cluster.scale_up(20) # ask for twenty workers """ maximum = dask.config.get('kubernetes.count.max') if maximum is not None a...
def function[scale_up, parameter[self, n, pods]]: constant[ Make sure we have n dask-workers available for this cluster Examples -------- >>> cluster.scale_up(20) # ask for twenty workers ] variable[maximum] assign[=] call[name[dask].config.get, parameter[consta...
keyword[def] identifier[scale_up] ( identifier[self] , identifier[n] , identifier[pods] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[maximum] = identifier[dask] . identifier[config] . identifier[get] ( literal[string] ) keyword[if] identifier[maximum] keyword[is] ...
def scale_up(self, n, pods=None, **kwargs): """ Make sure we have n dask-workers available for this cluster Examples -------- >>> cluster.scale_up(20) # ask for twenty workers """ maximum = dask.config.get('kubernetes.count.max') if maximum is not None and maximum <...
def annihilate(predicate: tuple, stack: tuple) -> tuple: '''Squash and reduce the input stack. Removes the elements of input that match predicate and only keeps the last match at the end of the stack. ''' extra = tuple(filter(lambda x: x not in predicate, stack)) head = reduce(lambda x, y: y if ...
def function[annihilate, parameter[predicate, stack]]: constant[Squash and reduce the input stack. Removes the elements of input that match predicate and only keeps the last match at the end of the stack. ] variable[extra] assign[=] call[name[tuple], parameter[call[name[filter], parameter[<a...
keyword[def] identifier[annihilate] ( identifier[predicate] : identifier[tuple] , identifier[stack] : identifier[tuple] )-> identifier[tuple] : literal[string] identifier[extra] = identifier[tuple] ( identifier[filter] ( keyword[lambda] identifier[x] : identifier[x] keyword[not] keyword[in] identifier[...
def annihilate(predicate: tuple, stack: tuple) -> tuple: """Squash and reduce the input stack. Removes the elements of input that match predicate and only keeps the last match at the end of the stack. """ extra = tuple(filter(lambda x: x not in predicate, stack)) head = reduce(lambda x, y: y if ...
def get_stock(self, symbol: str) -> Commodity: """Returns the stock/commodity object for the given symbol""" # Check if we have the exchange name (namespace). if ":" in symbol: # We have a namespace symbol_parts = symbol.split(":") exchange = symbol_parts[0] ...
def function[get_stock, parameter[self, symbol]]: constant[Returns the stock/commodity object for the given symbol] if compare[constant[:] in name[symbol]] begin[:] variable[symbol_parts] assign[=] call[name[symbol].split, parameter[constant[:]]] variable[exchange] assign...
keyword[def] identifier[get_stock] ( identifier[self] , identifier[symbol] : identifier[str] )-> identifier[Commodity] : literal[string] keyword[if] literal[string] keyword[in] identifier[symbol] : identifier[symbol_parts] = identifier[symbol] . identifier[split] ...
def get_stock(self, symbol: str) -> Commodity: """Returns the stock/commodity object for the given symbol""" # Check if we have the exchange name (namespace). if ':' in symbol: # We have a namespace symbol_parts = symbol.split(':') exchange = symbol_parts[0] symbol = symbol_p...
def get_artist_location(self, cache=True): """Get the location of a song's artist. Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: An artist location object. ...
def function[get_artist_location, parameter[self, cache]]: constant[Get the location of a song's artist. Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: An artist location...
keyword[def] identifier[get_artist_location] ( identifier[self] , identifier[cache] = keyword[True] ): literal[string] keyword[if] keyword[not] ( identifier[cache] keyword[and] ( literal[string] keyword[in] identifier[self] . identifier[cache] )): identifier[response] = identifier[...
def get_artist_location(self, cache=True): """Get the location of a song's artist. Args: cache (bool): A boolean indicating whether or not the cached value should be used (if available). Defaults to True. Returns: An artist location object. ...
def _check_convergence(self, F): """ Checks if the solution has converged to within the specified tolerance. """ normF = linalg.norm(F, Inf) if normF < self.tolerance: converged = True else: converged = False if self.verbose: ...
def function[_check_convergence, parameter[self, F]]: constant[ Checks if the solution has converged to within the specified tolerance. ] variable[normF] assign[=] call[name[linalg].norm, parameter[name[F], name[Inf]]] if compare[name[normF] less[<] name[self].tolerance] begi...
keyword[def] identifier[_check_convergence] ( identifier[self] , identifier[F] ): literal[string] identifier[normF] = identifier[linalg] . identifier[norm] ( identifier[F] , identifier[Inf] ) keyword[if] identifier[normF] < identifier[self] . identifier[tolerance] : identifi...
def _check_convergence(self, F): """ Checks if the solution has converged to within the specified tolerance. """ normF = linalg.norm(F, Inf) if normF < self.tolerance: converged = True # depends on [control=['if'], data=[]] else: converged = False if self.ver...
def gates_in_isa(isa): """ Generate the full gateset associated with an ISA. :param ISA isa: The instruction set architecture for a QPU. :return: A sequence of Gate objects encapsulating all gates compatible with the ISA. :rtype: Sequence[Gate] """ gates = [] for q in isa.qubits: ...
def function[gates_in_isa, parameter[isa]]: constant[ Generate the full gateset associated with an ISA. :param ISA isa: The instruction set architecture for a QPU. :return: A sequence of Gate objects encapsulating all gates compatible with the ISA. :rtype: Sequence[Gate] ] variable[...
keyword[def] identifier[gates_in_isa] ( identifier[isa] ): literal[string] identifier[gates] =[] keyword[for] identifier[q] keyword[in] identifier[isa] . identifier[qubits] : keyword[if] identifier[q] . identifier[dead] : keyword[continue] keyword[if] iden...
def gates_in_isa(isa): """ Generate the full gateset associated with an ISA. :param ISA isa: The instruction set architecture for a QPU. :return: A sequence of Gate objects encapsulating all gates compatible with the ISA. :rtype: Sequence[Gate] """ gates = [] for q in isa.qubits: ...
def new_edge(self, node_a, node_b, cost=1): """Adds a new, undirected edge between node_a and node_b with a cost. Returns the edge id of the new edge.""" edge_id = super(UndirectedGraph, self).new_edge(node_a, node_b, cost) self.nodes[node_b]['edges'].append(edge_id) return edge_...
def function[new_edge, parameter[self, node_a, node_b, cost]]: constant[Adds a new, undirected edge between node_a and node_b with a cost. Returns the edge id of the new edge.] variable[edge_id] assign[=] call[call[name[super], parameter[name[UndirectedGraph], name[self]]].new_edge, parameter[na...
keyword[def] identifier[new_edge] ( identifier[self] , identifier[node_a] , identifier[node_b] , identifier[cost] = literal[int] ): literal[string] identifier[edge_id] = identifier[super] ( identifier[UndirectedGraph] , identifier[self] ). identifier[new_edge] ( identifier[node_a] , identifier[node...
def new_edge(self, node_a, node_b, cost=1): """Adds a new, undirected edge between node_a and node_b with a cost. Returns the edge id of the new edge.""" edge_id = super(UndirectedGraph, self).new_edge(node_a, node_b, cost) self.nodes[node_b]['edges'].append(edge_id) return edge_id
def chk_statement(ctx, stmt, grammar, canonical=False): """Validate `stmt` according to `grammar`. Marks each statement in the hierearchy with stmt.is_grammatically_valid, which is a boolean. Return True if stmt is valid, False otherwise. """ n = len(ctx.errors) if canonical == True: ...
def function[chk_statement, parameter[ctx, stmt, grammar, canonical]]: constant[Validate `stmt` according to `grammar`. Marks each statement in the hierearchy with stmt.is_grammatically_valid, which is a boolean. Return True if stmt is valid, False otherwise. ] variable[n] assign[=] ca...
keyword[def] identifier[chk_statement] ( identifier[ctx] , identifier[stmt] , identifier[grammar] , identifier[canonical] = keyword[False] ): literal[string] identifier[n] = identifier[len] ( identifier[ctx] . identifier[errors] ) keyword[if] identifier[canonical] == keyword[True] : identifi...
def chk_statement(ctx, stmt, grammar, canonical=False): """Validate `stmt` according to `grammar`. Marks each statement in the hierearchy with stmt.is_grammatically_valid, which is a boolean. Return True if stmt is valid, False otherwise. """ n = len(ctx.errors) if canonical == True: ...
def accept(self): """Do PetaBencana download and display it in QGIS. .. versionadded: 3.3 """ self.save_state() try: self.require_directory() except CanceledImportDialogError: return QgsApplication.instance().setOverrideCursor( ...
def function[accept, parameter[self]]: constant[Do PetaBencana download and display it in QGIS. .. versionadded: 3.3 ] call[name[self].save_state, parameter[]] <ast.Try object at 0x7da1b0b0a350> call[call[name[QgsApplication].instance, parameter[]].setOverrideCursor, paramet...
keyword[def] identifier[accept] ( identifier[self] ): literal[string] identifier[self] . identifier[save_state] () keyword[try] : identifier[self] . identifier[require_directory] () keyword[except] identifier[CanceledImportDialogError] : keyword[return]...
def accept(self): """Do PetaBencana download and display it in QGIS. .. versionadded: 3.3 """ self.save_state() try: self.require_directory() # depends on [control=['try'], data=[]] except CanceledImportDialogError: return # depends on [control=['except'], data=[]] ...
def authenticated(function): """Re-authenticate if session expired.""" def wrapped(*args): """Wrap function.""" try: return function(*args) except FedexError: _login(*args) return function(*args) return wrapped
def function[authenticated, parameter[function]]: constant[Re-authenticate if session expired.] def function[wrapped, parameter[]]: constant[Wrap function.] <ast.Try object at 0x7da18f58ee90> return[name[wrapped]]
keyword[def] identifier[authenticated] ( identifier[function] ): literal[string] keyword[def] identifier[wrapped] (* identifier[args] ): literal[string] keyword[try] : keyword[return] identifier[function] (* identifier[args] ) keyword[except] identifier[FedexErro...
def authenticated(function): """Re-authenticate if session expired.""" def wrapped(*args): """Wrap function.""" try: return function(*args) # depends on [control=['try'], data=[]] except FedexError: _login(*args) return function(*args) # depends on ...
def naive( year, month, day, hour=0, minute=0, second=0, microsecond=0 ): # type: (int, int, int, int, int, int, int) -> DateTime """ Return a naive DateTime. """ return DateTime(year, month, day, hour, minute, second, microsecond)
def function[naive, parameter[year, month, day, hour, minute, second, microsecond]]: constant[ Return a naive DateTime. ] return[call[name[DateTime], parameter[name[year], name[month], name[day], name[hour], name[minute], name[second], name[microsecond]]]]
keyword[def] identifier[naive] ( identifier[year] , identifier[month] , identifier[day] , identifier[hour] = literal[int] , identifier[minute] = literal[int] , identifier[second] = literal[int] , identifier[microsecond] = literal[int] ): literal[string] keyword[return] identifier[DateTime] ( identifier[...
def naive(year, month, day, hour=0, minute=0, second=0, microsecond=0): # type: (int, int, int, int, int, int, int) -> DateTime '\n Return a naive DateTime.\n ' return DateTime(year, month, day, hour, minute, second, microsecond)