internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: microsoft/botbuilder-python

Issue:
[PORT] Slack adapter updates for dialog interactions
> Port this change from botbuilder-dotnet/master branch:
https://github.com/microsoft/botbuilder-dotnet/pull/3744

Fixes #3733 #3726 #3725 #3724 

* Adds missing values to SlackPayload model 
* Expose SlackClientWrapper via public property


# Changed projects
* Adapters






Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_payload.py b/libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_payload.py
--- a/libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_payload.py
+++ b/libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_payload.py
@@ -15,6 +15,12 @@ def __init__(self, **kwargs):
         self.team: str = kwargs.get("team")
         self.user: str = kwargs.get("user")
         self.actions: Optional[List[Action]] = None
+        self.trigger_id: str = kwargs.get("trigger_id")
+        self.action_ts: str = kwargs.get("action_ts")
+        self.submission: str = kwargs.get("submission")
+        self.callback_id: str = kwargs.get("callback_id")
+        self.state: str = kwargs.get("state")
+        self.response_url: str = kwargs.get("response_url")
 
         if "message" in kwargs:
             message = kwargs.get("message")


Test patch:
Repository: microsoft/botbuilder-python

Issue:
[PORT] Remove Slack from the list of channels that support Suggested Actions
> Port this change from botbuilder-dotnet/master branch:
https://github.com/microsoft/botbuilder-dotnet/pull/4177

Fixes #2291 

Removing Slack from the list of channels that do not support suggested actions.


# Changed projects
* Microsoft.Bot.Builder.Dialogs






Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py b/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py
--- a/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py
+++ b/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py
@@ -32,7 +32,6 @@ def supports_suggested_actions(channel_id: str, button_cnt: int = 100) -> bool:
             # https://dev.kik.com/#/docs/messaging#text-response-object
             Channels.kik: 20,
             Channels.telegram: 100,
-            Channels.slack: 100,
             Channels.emulator: 100,
             Channels.direct_line: 100,
             Channels.webchat: 100,


Test patch:
Repository: microsoft/botbuilder-python

Issue:
Complete the aiohttp ApplicationInsights implementation
See also #673 


Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-applicationinsights/botbuilder/applicationinsights/application_insights_telemetry_client.py b/libraries/botbuilder-applicationinsights/botbuilder/applicationinsights/application_insights_telemetry_client.py
--- a/libraries/botbuilder-applicationinsights/botbuilder/applicationinsights/application_insights_telemetry_client.py
+++ b/libraries/botbuilder-applicationinsights/botbuilder/applicationinsights/application_insights_telemetry_client.py
@@ -38,13 +38,18 @@ def __init__(
         instrumentation_key: str,
         telemetry_client: TelemetryClient = None,
         telemetry_processor: Callable[[object, object], bool] = None,
+        client_queue_size: int = None,
     ):
         self._instrumentation_key = instrumentation_key
+
         self._client = (
             telemetry_client
             if telemetry_client is not None
             else TelemetryClient(self._instrumentation_key)
         )
+        if client_queue_size:
+            self._client.channel.queue.max_queue_length = client_queue_size
+
         # Telemetry Processor
         processor = (
             telemetry_processor


Test patch:
Repository: microsoft/botbuilder-python

Issue:
[PORT] Update telemetry logger to include attachments
> Port this change from botbuilder-dotnet/master branch:
https://github.com/microsoft/botbuilder-dotnet/pull/3737

Addresses #1574 in JS repo (https://github.com/microsoft/botbuilder-js/issues/1574)

Telemetry logger will now include the collection of any attachments sent with the activity, if the LogPersonalInformation flag is set to true.


# Changed projects
* Microsoft.Bot.Builder






Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-core/botbuilder/core/telemetry_constants.py b/libraries/botbuilder-core/botbuilder/core/telemetry_constants.py
--- a/libraries/botbuilder-core/botbuilder/core/telemetry_constants.py
+++ b/libraries/botbuilder-core/botbuilder/core/telemetry_constants.py
@@ -5,6 +5,7 @@
 class TelemetryConstants:
     """Telemetry logger property names."""
 
+    ATTACHMENTS_PROPERTY: str = "attachments"
     CHANNEL_ID_PROPERTY: str = "channelId"
     CONVERSATION_ID_PROPERTY: str = "conversationId"
     CONVERSATION_NAME_PROPERTY: str = "conversationName"
diff --git a/libraries/botbuilder-core/botbuilder/core/telemetry_logger_middleware.py b/libraries/botbuilder-core/botbuilder/core/telemetry_logger_middleware.py
--- a/libraries/botbuilder-core/botbuilder/core/telemetry_logger_middleware.py
+++ b/libraries/botbuilder-core/botbuilder/core/telemetry_logger_middleware.py
@@ -211,6 +211,10 @@ async def fill_send_event_properties(
 
         # Use the LogPersonalInformation flag to toggle logging PII data, text and user name are common examples
         if self.log_personal_information:
+            if activity.attachments and activity.attachments.strip():
+                properties[
+                    TelemetryConstants.ATTACHMENTS_PROPERTY
+                ] = activity.attachments
             if activity.from_property.name and activity.from_property.name.strip():
                 properties[
                     TelemetryConstants.FROM_NAME_PROPERTY


Test patch:
Repository: microsoft/botbuilder-python

Issue:
[PORT] [Authentication] updates to support Arlington
> Port this change from botbuilder-dotnet/master branch:
https://github.com/microsoft/botbuilder-dotnet/pull/3734




# Changed projects
* Microsoft.Bot.Connector
* Microsoft.Bot.Connector.Tests

[R9]





Discussion:

Resolving patch:
diff --git a/libraries/botframework-connector/botframework/connector/auth/government_constants.py b/libraries/botframework-connector/botframework/connector/auth/government_constants.py
--- a/libraries/botframework-connector/botframework/connector/auth/government_constants.py
+++ b/libraries/botframework-connector/botframework/connector/auth/government_constants.py
@@ -15,9 +15,7 @@ class GovernmentConstants(ABC):
     TO CHANNEL FROM BOT: Login URL
     """
     TO_CHANNEL_FROM_BOT_LOGIN_URL = (
-        "https://login.microsoftonline.us/"
-        "cab8a31a-1906-4287-a0d8-4eef66b95f6e/"
-        "oauth2/v2.0/token"
+        "https://login.microsoftonline.us/MicrosoftServices.onmicrosoft.us"
     )
 
     """


Test patch:
Repository: microsoft/botbuilder-python

Issue:
Add a constant for "empty speak tag"
We have agreed on a xml tag structure to indicate an empty speak tag. The format of that tag is:

```xml
<speak version="1.0" xmlns="https://www.w3.org/2001/10/synthesis" xml:lang="en-US" />
```

Let's expose this string as a constant in the speech namespace.

For internal user, you can get additional data here:
microsoft/botframework-obi#85

Relates to:
https://github.com/microsoft/botbuilder-dotnet/issues/4311

[enhancement]


Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-schema/botbuilder/schema/__init__.py b/libraries/botbuilder-schema/botbuilder/schema/__init__.py
--- a/libraries/botbuilder-schema/botbuilder/schema/__init__.py
+++ b/libraries/botbuilder-schema/botbuilder/schema/__init__.py
@@ -70,6 +70,7 @@
 from .callerid_constants import CallerIdConstants
 from .health_results import HealthResults
 from .healthcheck_response import HealthCheckResponse
+from .speech_constants import SpeechConstants
 
 __all__ = [
     "Activity",
@@ -139,4 +140,5 @@
     "CallerIdConstants",
     "HealthResults",
     "HealthCheckResponse",
+    "SpeechConstants",
 ]
diff --git a/libraries/botbuilder-schema/botbuilder/schema/speech_constants.py b/libraries/botbuilder-schema/botbuilder/schema/speech_constants.py
new file mode 100644
--- /dev/null
+++ b/libraries/botbuilder-schema/botbuilder/schema/speech_constants.py
@@ -0,0 +1,14 @@
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License.
+
+
+class SpeechConstants:
+    """
+    Defines constants that can be used in the processing of speech interactions.
+    """
+
+    EMPTY_SPEAK_TAG = '<speak version="1.0" xmlns="https://www.w3.org/2001/10/synthesis" xml:lang="en-US" />'
+    """
+    The xml tag structure to indicate an empty speak tag, to be used in the 'speak' property of an Activity.
+    When set this indicates to the channel that speech should not be generated.
+    """


Test patch:
Repository: microsoft/botbuilder-python

Issue:
Bump azure-cosmos to v3.2.0
**Is your feature request related to a problem? Please describe.**

We're currently on `azure-cosmos` v3.1.2. Not a ton of changes in 3.2.0, but it looks like it will be their last stable version, now that they're working on v4:

![image](https://user-images.githubusercontent.com/40401643/89065922-64fe7280-d321-11ea-8e3d-553ec1efbec4.png)

**Additional context**

Need to ensure all Cosmos tests are run live before merging (they're skipped by default).

[enhancement]



Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-azure/setup.py b/libraries/botbuilder-azure/setup.py
--- a/libraries/botbuilder-azure/setup.py
+++ b/libraries/botbuilder-azure/setup.py
@@ -5,7 +5,7 @@
 from setuptools import setup
 
 REQUIRES = [
-    "azure-cosmos==3.1.2",
+    "azure-cosmos==3.2.0",
     "azure-storage-blob==2.1.0",
     "botbuilder-schema==4.10.0",
     "botframework-connector==4.10.0",


Test patch:
Repository: microsoft/botbuilder-python

Issue:
[PORT] Fix LuisRecognizer to not return intents if there is no utterance
> Port this change from botbuilder-dotnet/master branch:
https://github.com/microsoft/botbuilder-dotnet/pull/4129

Fixes #4117 

## Description
Luis Recognizer returns an intent of string.empty with a perfect score of 1.0.  This messes up logic downstream in RecognizerSet because it thinks it has a perfect intent.

## Specific Changes
* Changed LuisRecognizer to return empy RecognizerResult (no intents or entities) when there is no utterance.

## Testing
Changed RegexRecognizer to behave just like LuisRecognizer so that ValueRecognizer tests are valid check.


# Changed projects
* Microsoft.Bot.Builder.AI.LUIS
* Microsoft.Bot.Builder.Dialogs.Adaptive
* Microsoft.Bot.Builder.AI.LUIS.Tests






Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py b/libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py
--- a/libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py
+++ b/libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py
@@ -272,7 +272,7 @@ async def _recognize_internal(
 
         if not utterance or utterance.isspace():
             recognizer_result = RecognizerResult(
-                text=utterance, intents={"": IntentScore(score=1.0)}, entities={}
+                text=utterance
             )
         else:
 


Test patch:
Repository: microsoft/botbuilder-python

Issue:
Meeting notification alert bubble (Python)
See [parent](https://github.com/microsoft/botframework-sdk/issues/6026)


Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py b/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py
--- a/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py
+++ b/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py
@@ -27,7 +27,9 @@ def teams_get_team_info(activity: Activity) -> TeamInfo:
     return None
 
 
-def teams_notify_user(activity: Activity):
+def teams_notify_user(
+    activity: Activity, alert_in_meeting: bool = None, external_resource_url: str = None
+):
     if not activity:
         return
 
@@ -36,4 +38,6 @@ def teams_notify_user(activity: Activity):
 
     channel_data = TeamsChannelData().deserialize(activity.channel_data)
     channel_data.notification = NotificationInfo(alert=True)
+    channel_data.notification.alert_in_meeting = alert_in_meeting
+    channel_data.notification.external_resource_url = external_resource_url
     activity.channel_data = channel_data
diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py b/libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py
--- a/libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py
+++ b/libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py
@@ -940,11 +940,22 @@ class NotificationInfo(Model):
 
     _attribute_map = {
         "alert": {"key": "alert", "type": "bool"},
+        "alert_in_meeting": {"key": "alertInMeeting", "type": "bool"},
+        "external_resource_url": {"key": "externalResourceUrl", "type": "str"},
     }
 
-    def __init__(self, *, alert: bool = None, **kwargs) -> None:
+    def __init__(
+        self,
+        *,
+        alert: bool = None,
+        alert_in_meeting: bool = None,
+        external_resource_url: str = None,
+        **kwargs
+    ) -> None:
         super(NotificationInfo, self).__init__(**kwargs)
         self.alert = alert
+        self.alert_in_meeting = alert_in_meeting
+        self.external_resource_url = external_resource_url
 
 
 class O365ConnectorCard(Model):


Test patch:
Repository: microsoft/botbuilder-python

Issue:
OpenIdMetadata signing keys should refresh every 24 hours, and once per hour if a key is missing
## Describe the bug
Every 24 hours, and when a cert is cycled (a key is not found in the cache), the OpenIdMetadata cache within the sdk should gracefully refresh.  

javascript implementation reference:
https://github.com/microsoft/botbuilder-js/pull/2466

python code to change:
https://github.com/microsoft/botbuilder-python/blob/master/libraries/botframework-connector/botframework/connector/auth/jwt_token_extractor.py#L129

[bug]



Discussion:

Resolving patch:
diff --git a/libraries/botframework-connector/botframework/connector/auth/jwt_token_extractor.py b/libraries/botframework-connector/botframework/connector/auth/jwt_token_extractor.py
--- a/libraries/botframework-connector/botframework/connector/auth/jwt_token_extractor.py
+++ b/libraries/botframework-connector/botframework/connector/auth/jwt_token_extractor.py
@@ -125,10 +125,16 @@ def __init__(self, url):
         self.last_updated = datetime.min
 
     async def get(self, key_id: str):
-        # If keys are more than 5 days old, refresh them
-        if self.last_updated < (datetime.now() - timedelta(days=5)):
+        # If keys are more than 1 day old, refresh them
+        if self.last_updated < (datetime.now() - timedelta(days=1)):
             await self._refresh()
-        return self._find(key_id)
+
+        key = self._find(key_id)
+        if not key and self.last_updated < (datetime.now() - timedelta(hours=1)):
+            # Refresh the cache if a key is not found (max once per hour)
+            await self._refresh()
+            key = self._find(key_id)
+        return key
 
     async def _refresh(self):
         response = requests.get(self.url)


Test patch:
Repository: microsoft/botbuilder-python

Issue:
DialogManager does not return EoC code when a dialog ends (python)
See [parent issue](https://github.com/microsoft/botframework-sdk/issues/6186)


Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_manager.py b/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_manager.py
--- a/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_manager.py
+++ b/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_manager.py
@@ -16,7 +16,7 @@
     DialogStateManager,
     DialogStateManagerConfiguration,
 )
-from botbuilder.schema import Activity, ActivityTypes
+from botbuilder.schema import Activity, ActivityTypes, EndOfConversationCodes
 from botframework.connector.auth import (
     AuthenticationConstants,
     ClaimsIdentity,
@@ -355,6 +355,9 @@ async def handle_skill_on_turn(
                 type=ActivityTypes.end_of_conversation,
                 value=turn_result.result,
                 locale=turn_context.activity.locale,
+                code=EndOfConversationCodes.completed_successfully
+                if turn_result.status == DialogTurnStatus.Complete
+                else EndOfConversationCodes.user_cancelled,
             )
             await turn_context.send_activity(activity)
 


Test patch:
diff --git a/libraries/botbuilder-dialogs/tests/test_dialog_manager.py b/libraries/botbuilder-dialogs/tests/test_dialog_manager.py
--- a/libraries/botbuilder-dialogs/tests/test_dialog_manager.py
+++ b/libraries/botbuilder-dialogs/tests/test_dialog_manager.py
@@ -38,6 +38,7 @@
     ActivityTypes,
     ChannelAccount,
     ConversationAccount,
+    EndOfConversationCodes,
     InputHints,
 )
 from botframework.connector.auth import AuthenticationConstants, ClaimsIdentity
@@ -237,6 +238,10 @@ async def test_handles_bot_and_skills(self):
                         SimpleComponentDialog.eoc_sent.type,
                         ActivityTypes.end_of_conversation,
                     )
+                    self.assertEqual(
+                        SimpleComponentDialog.eoc_sent.code,
+                        EndOfConversationCodes.completed_successfully,
+                    )
                     self.assertEqual(SimpleComponentDialog.eoc_sent.value, "SomeName")
                 else:
                     self.assertIsNone(
Repository: microsoft/botbuilder-python

Issue:
botbuilder-testing is missing install requirements
## Version

botbuilder-testing 4.12.0

## Describe the bug
While installing botbuilder-testing for CI I got errors about missing dependencies. 

## To Reproduce

1. `python3 -m venv .venv`
2. `. .venv/bin/activate`
3. `pip install -U pip wheel`
4. `pip install botbuilder-testing`
5. `python -c "from botbuilder.testing import DialogTestClient"`

First error is missing `pytest`:
```python
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/calum/sureswift/jell/jell-bot-teams-v2/.venv-test/lib/python3.8/site-packages/botbuilder/testing/__init__.py", line 6, in <module>
    from .storage_base_tests import StorageBaseTests
  File "/home/calum/sureswift/jell/jell-bot-teams-v2/.venv-test/lib/python3.8/site-packages/botbuilder/testing/storage_base_tests.py", line 26, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'
```

6. `pip install pytest`
7. `python -c 'from botbuilder.testing import DialogTestClient'`

Next error is missing `botbuilder-azure`:
```python
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/calum/sureswift/jell/jell-bot-teams-v2/.venv-test/lib/python3.8/site-packages/botbuilder/testing/__init__.py", line 6, in <module>
    from .storage_base_tests import StorageBaseTests
  File "/home/calum/sureswift/jell/jell-bot-teams-v2/.venv-test/lib/python3.8/site-packages/botbuilder/testing/storage_base_tests.py", line 27, in <module>
    from botbuilder.azure import CosmosDbStorage
ModuleNotFoundError: No module named 'botbuilder.azure'
```

8. `pip install botbuilder-azure`
9. `python -c 'from botbuilder.testing import DialogTestClient'`

Command works!

## Expected behavior
No errors after installing botbuilder-testing and importing module

I do wonder if the requirement for pytest is not necessary, leaving the lib test-suite agnostic and could be refactored out?



Discussion:
@axelsrz can you take a pass at this?

Resolving patch:
diff --git a/libraries/botbuilder-testing/setup.py b/libraries/botbuilder-testing/setup.py
--- a/libraries/botbuilder-testing/setup.py
+++ b/libraries/botbuilder-testing/setup.py
@@ -8,6 +8,8 @@
     "botbuilder-schema==4.13.0",
     "botbuilder-core==4.13.0",
     "botbuilder-dialogs==4.13.0",
+    "botbuilder-azure==4.13.0",
+    "pytest~=6.2.3",
 ]
 
 TESTS_REQUIRES = ["aiounittest==1.3.0"]


Test patch:
Repository: microsoft/botbuilder-python

Issue:
Difficult overriding behavior for members added/removed in TeamsActivityHandler
## Version
4.13

## Describe the bug
Behavior of methods [on_teams_members_added](https://github.com/microsoft/botbuilder-python/blob/4.12/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_handler.py#L759) and [on_teams_member_removed](https://github.com/microsoft/botbuilder-python/blob/4.12/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_handler.py#L815) of TeamsActivityHandler are difficult to override due to calling `super()` definition instead of `self`.

## To Reproduce
Implement a TeamsActivityHandler class which custom behavior in any of those methods

## Expected behavior
These methods call the implementation on `self`.

## Additional context
This bug was suggested in the discussion of #1662 



Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_handler.py b/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_handler.py
--- a/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_handler.py
+++ b/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_handler.py
@@ -777,9 +777,7 @@ async def on_teams_members_added(  # pylint: disable=unused-argument
             ChannelAccount().deserialize(member.serialize())
             for member in teams_members_added
         ]
-        return await super().on_members_added_activity(
-            teams_members_added, turn_context
-        )
+        return await self.on_members_added_activity(teams_members_added, turn_context)
 
     async def on_teams_members_removed_dispatch(  # pylint: disable=unused-argument
         self,
@@ -833,7 +831,7 @@ async def on_teams_members_removed(  # pylint: disable=unused-argument
             ChannelAccount().deserialize(member.serialize())
             for member in teams_members_removed
         ]
-        return await super().on_members_removed_activity(members_removed, turn_context)
+        return await self.on_members_removed_activity(members_removed, turn_context)
 
     async def on_teams_channel_deleted(  # pylint: disable=unused-argument
         self, channel_info: ChannelInfo, team_info: TeamInfo, turn_context: TurnContext


Test patch:
Repository: microsoft/botbuilder-python

Issue:
port: turn memory scope includesnapshot to false (#5441)
The changes in [turn memory scope includesnapshot to false (#5441)](https://github.com/microsoft/botbuilder-dotnet/pull/5441) may need to be ported to maintain parity with `microsoft/botbuilder-dotnet`.

<blockquote>
Fixes #5432
</blockquote>

Please review and, if necessary, port the changes.


Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-dialogs/botbuilder/dialogs/memory/scopes/turn_memory_scope.py b/libraries/botbuilder-dialogs/botbuilder/dialogs/memory/scopes/turn_memory_scope.py
--- a/libraries/botbuilder-dialogs/botbuilder/dialogs/memory/scopes/turn_memory_scope.py
+++ b/libraries/botbuilder-dialogs/botbuilder/dialogs/memory/scopes/turn_memory_scope.py
@@ -58,7 +58,7 @@ def _convert_keys(self):
 
 class TurnMemoryScope(MemoryScope):
     def __init__(self):
-        super().__init__(scope_path.TURN)
+        super().__init__(scope_path.TURN, False)
 
     def get_memory(self, dialog_context: "DialogContext") -> object:
         if not dialog_context:


Test patch: