You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
category: Optional[Snowflake] = ...,
sync_permissions: bool = ...,
reason: Optional[str] = ...,
- ) -> None:- ...+ ) -> None: ...
# only passing `sync_permissions` may or may not return a channel,
# depending on whether the channel is in a category
category: Optional[Snowflake] = ...,
sync_permissions: bool = ...,
reason: Optional[str] = ...,
- ) -> None:- ...+ ) -> None: ...
# only passing `sync_permissions` may or may not return a channel,
# depending on whether the channel is in a category
category: Optional[Snowflake] = ...,
sync_permissions: bool = ...,
reason: Optional[str] = ...,
- ) -> None:- ...+ ) -> None: ...
# only passing `sync_permissions` may or may not return a channel,
# depending on whether the channel is in a category
category: Optional[Snowflake] = ...,
sync_permissions: bool = ...,
reason: Optional[str] = ...,
- ) -> None:- ...+ ) -> None: ...
# only passing `sync_permissions` may or may not return a channel,
# depending on whether the channel is in a category
category: Optional[Snowflake] = ...,
sync_permissions: bool = ...,
reason: Optional[str] = ...,
- ) -> None:- ...+ ) -> None: ...
# only passing `sync_permissions` may or may not return a channel,
# depending on whether the channel is in a category
)
self._prepare_encoding_layers(name)
- self._tf_layers[- f"transformer.{DIALOGUE}"- ] = rasa_layers.prepare_transformer_layer(- attribute_name=DIALOGUE,- config=self.config,- num_layers=self.config[NUM_TRANSFORMER_LAYERS][DIALOGUE],- units=self.config[TRANSFORMER_SIZE][DIALOGUE],- drop_rate=self.config[DROP_RATE_DIALOGUE],- # use bidirectional transformer, because- # we will invert dialogue sequence so that the last turn is located- # at the first position and would always have- # exactly the same positional encoding- unidirectional=not self.max_history_featurizer_is_used,+ self._tf_layers[f"transformer.{DIALOGUE}"] = (+ rasa_layers.prepare_transformer_layer(+ attribute_name=DIALOGUE,+ config=self.config,+ num_layers=self.config[NUM_TRANSFORMER_LAYERS][DIALOGUE],+ units=self.config[TRANSFORMER_SIZE][DIALOGUE],+ drop_rate=self.config[DROP_RATE_DIALOGUE],+ # use bidirectional transformer, because+ # we will invert dialogue sequence so that the last turn is located+ # at the first position and would always have+ # exactly the same positional encoding+ unidirectional=not self.max_history_featurizer_is_used,+ )
)
self._prepare_label_classification_layers(DIALOGUE)
# Attributes with sequence-level features also have sentence-level features,
# all these need to be combined and further processed.
if attribute_name in SEQUENCE_FEATURES_TO_ENCODE:
- self._tf_layers[- f"sequence_layer.{attribute_name}"- ] = rasa_layers.RasaSequenceLayer(- attribute_name, attribute_signature, config_to_use+ self._tf_layers[f"sequence_layer.{attribute_name}"] = (+ rasa_layers.RasaSequenceLayer(+ attribute_name, attribute_signature, config_to_use+ )
)
# Attributes without sequence-level features require some actual feature
# processing only if they have sentence-level features. Attributes with no
# sequence- and sentence-level features (dialogue, entity_tags, label) are
# skipped here.
elif SENTENCE in attribute_signature:
- self._tf_layers[- f"sparse_dense_concat_layer.{attribute_name}"- ] = rasa_layers.ConcatenateSparseDenseFeatures(- attribute=attribute_name,- feature_type=SENTENCE,- feature_type_signature=attribute_signature[SENTENCE],- config=config_to_use,+ self._tf_layers[f"sparse_dense_concat_layer.{attribute_name}"] = (+ rasa_layers.ConcatenateSparseDenseFeatures(+ attribute=attribute_name,+ feature_type=SENTENCE,+ feature_type_signature=attribute_signature[SENTENCE],+ config=config_to_use,+ )
)
def _prepare_encoding_layers(self, name: Text) -> None:
Both of these look for the same entities based on the same training data
leading to ambiguity in the results.
"""
- extractors_in_configuration: Set[- Type[GraphComponent]- ] = self._component_types.intersection(TRAINABLE_EXTRACTORS)+ extractors_in_configuration: Set[Type[GraphComponent]] = (+ self._component_types.intersection(TRAINABLE_EXTRACTORS)+ )
if len(extractors_in_configuration) > 1:
rasa.shared.utils.io.raise_warning(
f"You have defined multiple entity extractors that do the same job "
# everything using a transformer and optionally also do masked language
# modeling.
self.text_name = TEXT
- self._tf_layers[- f"sequence_layer.{self.text_name}"- ] = rasa_layers.RasaSequenceLayer(- self.text_name, self.data_signature[self.text_name], self.config+ self._tf_layers[f"sequence_layer.{self.text_name}"] = (+ rasa_layers.RasaSequenceLayer(+ self.text_name, self.data_signature[self.text_name], self.config+ )
)
if self.config[MASKED_LM]:
self._prepare_mask_lm_loss(self.text_name)
if not response_text or "\n" not in response_text:
continue
# Has new lines, use `LiteralScalarString`
- final_responses[utter_action][i][- KEY_RESPONSES_TEXT- ] = LiteralScalarString(response_text)+ final_responses[utter_action][i][KEY_RESPONSES_TEXT] = (+ LiteralScalarString(response_text)+ )
return final_responses
-"""Evaluate release tag for whether docs should be built or not.+"""Evaluate release tag for whether docs should be built or not."""-"""
import argparse
from subprocess import check_output
from typing import List
value_type: Type[T] = T, # type: ignore
is_flag: bool = False,
reload_config: bool = False,
- ) -> Optional[T]:- ...+ ) -> Optional[T]: ...
# Overload for case where type is not specified and default to object
@overload
def hook_name_processer_wrapper(f):
configuration_setup_params = ()
configuration_setup_attrs = {}
- configuration_setup_attrs[- "help"- ] = "This is a hidden click option whose callback function to run the provided hook package."+ configuration_setup_attrs["help"] = (+ "This is a hidden click option whose callback function to run the provided hook package."+ )
configuration_setup_attrs["is_eager"] = True
configuration_setup_attrs["expose_value"] = False
configuration_setup_attrs["hidden"] = True
cfn_resource_update_call_back_function: Callable[[Dict, List[ReferenceType]], None]
linking_exceptions: ResourcePairExceptions
# function to extract the terraform destination value from the linking field value
- tf_destination_value_extractor_from_link_field_value_function: Callable[- [str], str- ] = _default_tf_destination_value_id_extractor+ tf_destination_value_extractor_from_link_field_value_function: Callable[[str], str] = (+ _default_tf_destination_value_id_extractor+ )
class ResourceLinker:
# Type definition of following boto providers, which is equal to Callable[[str], Any]
class BotoProviderType(Protocol):
- def __call__(self, service_name: str) -> Any:- ... # pragma: no cover+ def __call__(self, service_name: str) -> Any: ... # pragma: no cover
def get_boto_client_provider_from_session_with_config(session: Session, **kwargs) -> BotoProviderType:
"""Example implementation of two double ended sliders as extension widgets"""
+
from bokeh.core.properties import Bool, Float, Tuple
from bokeh.io import show
from bokeh.layouts import column
-""" A demonstration of configuring different arrow types.+"""A demonstration of configuring different arrow types.
.. bokeh-example-metadata::
:apis: bokeh.plotting.figure.circle, bokeh.plotting.figure.add_layout
:keywords: arrows
"""
+
from bokeh.models import Arrow, NormalHead, OpenHead, VeeHead
from bokeh.palettes import Muted3 as color
from bokeh.plotting import figure, show
-""" A display of available arrow head styles.+"""A display of available arrow head styles.
.. bokeh-example-metadata::
:apis: bokeh.models.Plot, bokeh.models.Arrow, bokeh.models.Label
-""" An interactive numerical band plot based on simple Python array of data.+"""An interactive numerical band plot based on simple Python array of data.
It is a combination of scatter plots and line plots added with a band of covered area.
The line passes through the mean of the area covered by the band.
-""" A timeseries plot of glucose data readings. This example demonstrates+"""A timeseries plot of glucose data readings. This example demonstrates
adding box annotations as well as a multi-line title.
.. bokeh-example-metadata::
:keywords: box annotation, time series
"""
+
from bokeh.models import BoxAnnotation
from bokeh.plotting import figure, show
from bokeh.sampledata.glucose import data
-""" A demonstration of a ColorBar with a log color scale.+"""A demonstration of a ColorBar with a log color scale.
.. bokeh-example-metadata::
:apis: bokeh.models.ColorBar, bokeh.models.LogColorMapper
-""" A scatter plot that demonstrates different ways of adding labels.+"""A scatter plot that demonstrates different ways of adding labels.
.. bokeh-example-metadata::
:apis: bokeh.models.ColumnDataSource, bokeh.models.Label, bokeh.models.LabelSet bokeh.plotting.figure.scatter
-""" Line and marker plots that demonstrate automatic legends.+"""Line and marker plots that demonstrate automatic legends.
.. bokeh-example-metadata::
:apis: bokeh.layouts.gridplot, bokeh.plotting.figure.circle, bokeh.plotting.figure.line, bokeh.plotting.figure.square
-""" Marker and line plots that demonstrate manual control of legend visibility of individual items+"""Marker and line plots that demonstrate manual control of legend visibility of individual items
.. bokeh-example-metadata::
:apis: bokeh.models.LegendItem, bokeh.plotting.figure.circle, bokeh.plotting.figure.line
-""" A marker plot that demonstrates a slope.+"""A marker plot that demonstrates a slope.
.. bokeh-example-metadata::
:apis: bokeh.models.slope, bokeh.plotting.figure.circle
-""" A marker plot that shows the relationship between car type and highway MPG from the autompg+"""A marker plot that shows the relationship between car type and highway MPG from the autompg
sample data. This example demonstrates the use of whiskers to display quantile ranges in the plot.
.. bokeh-example-metadata::
-""" A stacked area plot using data from a pandas DataFrame.+"""A stacked area plot using data from a pandas DataFrame.
.. bokeh-example-metadata::
:apis: bokeh.plotting.figure.varea_stack
-""" A log plot using functions with different growth rates. This example+"""A log plot using functions with different growth rates. This example
demonstrates using a log axis on a Bokeh plot. Various line styles and glyph
combinations are automatically added to a legend.
-""" A simple bar chart using plain Python lists.+"""A simple bar chart using plain Python lists.
.. bokeh-example-metadata::
:apis: bokeh.plotting.figure.vbar
-""" A bar chart based on simple Python lists of data. This example demonstrates+"""A bar chart based on simple Python lists of data. This example demonstrates
automatic colormapping.
.. bokeh-example-metadata::
:keywords: bar, colormap, legend, palette, vbar
"""
+
from bokeh.models import ColumnDataSource
from bokeh.palettes import Bright6
from bokeh.plotting import figure, show
-""" A simple bar chart using plain Python lists. This example demonstrates+"""A simple bar chart using plain Python lists. This example demonstrates
setting bar colors from a ``ColumnDataSource``.
.. bokeh-example-metadata::
:keywords: bars, categorical
"""
+
from bokeh.models import ColumnDataSource
from bokeh.palettes import Bright6
from bokeh.plotting import figure, show
formatterRelated to the formatterinternalAn internal refactor or improvement
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update the black tests and the corresponding snapshots
Test Plan
No logic change