prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN 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.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `libraries/botbuilder-dialogs/botbuilder/dialogs/memory/scopes/turn_memory_scope.py`
  Content:
  ```
  1 # Copyright (c) Microsoft Corporation. All rights reserved.
  2 # Licensed under the MIT License.
  3 
  4 from botbuilder.dialogs.memory import scope_path
  5 
  6 from .memory_scope import MemoryScope
  7 
  8 
  9 class CaseInsensitiveDict(dict):
  10     # pylint: disable=protected-access
  11 
  12     @classmethod
  13     def _k(cls, key):
  14         return key.lower() if isinstance(key, str) else key
  15 
  16     def __init__(self, *args, **kwargs):
  17         super(CaseInsensitiveDict, self).__init__(*args, **kwargs)
  18         self._convert_keys()
  19 
  20     def __getitem__(self, key):
  21         return super(CaseInsensitiveDict, self).__getitem__(self.__class__._k(key))
  22 
  23     def __setitem__(self, key, value):
  24         super(CaseInsensitiveDict, self).__setitem__(self.__class__._k(key), value)
  25 
  26     def __delitem__(self, key):
  27         return super(CaseInsensitiveDict, self).__delitem__(self.__class__._k(key))
  28 
  29     def __contains__(self, key):
  30         return super(CaseInsensitiveDict, self).__contains__(self.__class__._k(key))
  31 
  32     def pop(self, key, *args, **kwargs):
  33         return super(CaseInsensitiveDict, self).pop(
  34             self.__class__._k(key), *args, **kwargs
  35         )
  36 
  37     def get(self, key, *args, **kwargs):
  38         return super(CaseInsensitiveDict, self).get(
  39             self.__class__._k(key), *args, **kwargs
  40         )
  41 
  42     def setdefault(self, key, *args, **kwargs):
  43         return super(CaseInsensitiveDict, self).setdefault(
  44             self.__class__._k(key), *args, **kwargs
  45         )
  46 
  47     def update(self, e=None, **f):
  48         if e is None:
  49             e = {}
  50         super(CaseInsensitiveDict, self).update(self.__class__(e))
  51         super(CaseInsensitiveDict, self).update(self.__class__(**f))
  52 
  53     def _convert_keys(self):
  54         for k in list(self.keys()):
  55             val = super(CaseInsensitiveDict, self).pop(k)
  56             self.__setitem__(k, val)
  57 
  58 
  59 class TurnMemoryScope(MemoryScope):
  60     def __init__(self):
  61         super().__init__(scope_path.TURN)
  62 
  63     def get_memory(self, dialog_context: "DialogContext") -> object:
  64         if not dialog_context:
  65             raise TypeError(f"Expecting: DialogContext, but received None")
  66 
  67         turn_value = dialog_context.context.turn_state.get(scope_path.TURN, None)
  68 
  69         if not turn_value:
  70             turn_value = CaseInsensitiveDict()
  71             dialog_context.context.turn_state[scope_path.TURN] = turn_value
  72 
  73         return turn_value
  74 
  75     def set_memory(self, dialog_context: "DialogContext", memory: object):
  76         if not dialog_context:
  77             raise TypeError(f"Expecting: DialogContext, but received None")
  78 
  79         dialog_context.context.turn_state[scope_path.TURN] = memory
  80
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: 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 @@
   
   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:
  
verification_info: {"golden_diff": "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\n--- a/libraries/botbuilder-dialogs/botbuilder/dialogs/memory/scopes/turn_memory_scope.py\n+++ b/libraries/botbuilder-dialogs/botbuilder/dialogs/memory/scopes/turn_memory_scope.py\n@@ -58,7 +58,7 @@\n \n class TurnMemoryScope(MemoryScope):\n     def __init__(self):\n-        super().__init__(scope_path.TURN)\n+        super().__init__(scope_path.TURN, False)\n \n     def get_memory(self, dialog_context: \"DialogContext\") -> object:\n         if not dialog_context:\n", "issue": "port: turn memory scope includesnapshot to false (#5441)\nThe 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`.\n\n<blockquote>\nFixes #5432\n</blockquote>\n\nPlease review and, if necessary, port the changes.\n", "before_files": [{"content": "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nfrom botbuilder.dialogs.memory import scope_path\n\nfrom .memory_scope import MemoryScope\n\n\nclass CaseInsensitiveDict(dict):\n    # pylint: disable=protected-access\n\n    @classmethod\n    def _k(cls, key):\n        return key.lower() if isinstance(key, str) else key\n\n    def __init__(self, *args, **kwargs):\n        super(CaseInsensitiveDict, self).__init__(*args, **kwargs)\n        self._convert_keys()\n\n    def __getitem__(self, key):\n        return super(CaseInsensitiveDict, self).__getitem__(self.__class__._k(key))\n\n    def __setitem__(self, key, value):\n        super(CaseInsensitiveDict, self).__setitem__(self.__class__._k(key), value)\n\n    def __delitem__(self, key):\n        return super(CaseInsensitiveDict, self).__delitem__(self.__class__._k(key))\n\n    def __contains__(self, key):\n        return super(CaseInsensitiveDict, self).__contains__(self.__class__._k(key))\n\n    def pop(self, key, *args, **kwargs):\n        return super(CaseInsensitiveDict, self).pop(\n            self.__class__._k(key), *args, **kwargs\n        )\n\n    def get(self, key, *args, **kwargs):\n        return super(CaseInsensitiveDict, self).get(\n            self.__class__._k(key), *args, **kwargs\n        )\n\n    def setdefault(self, key, *args, **kwargs):\n        return super(CaseInsensitiveDict, self).setdefault(\n            self.__class__._k(key), *args, **kwargs\n        )\n\n    def update(self, e=None, **f):\n        if e is None:\n            e = {}\n        super(CaseInsensitiveDict, self).update(self.__class__(e))\n        super(CaseInsensitiveDict, self).update(self.__class__(**f))\n\n    def _convert_keys(self):\n        for k in list(self.keys()):\n            val = super(CaseInsensitiveDict, self).pop(k)\n            self.__setitem__(k, val)\n\n\nclass TurnMemoryScope(MemoryScope):\n    def __init__(self):\n        super().__init__(scope_path.TURN)\n\n    def get_memory(self, dialog_context: \"DialogContext\") -> object:\n        if not dialog_context:\n            raise TypeError(f\"Expecting: DialogContext, but received None\")\n\n        turn_value = dialog_context.context.turn_state.get(scope_path.TURN, None)\n\n        if not turn_value:\n            turn_value = CaseInsensitiveDict()\n            dialog_context.context.turn_state[scope_path.TURN] = turn_value\n\n        return turn_value\n\n    def set_memory(self, dialog_context: \"DialogContext\", memory: object):\n        if not dialog_context:\n            raise TypeError(f\"Expecting: DialogContext, but received None\")\n\n        dialog_context.context.turn_state[scope_path.TURN] = memory\n", "path": "libraries/botbuilder-dialogs/botbuilder/dialogs/memory/scopes/turn_memory_scope.py"}], "after_files": [{"content": "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nfrom botbuilder.dialogs.memory import scope_path\n\nfrom .memory_scope import MemoryScope\n\n\nclass CaseInsensitiveDict(dict):\n    # pylint: disable=protected-access\n\n    @classmethod\n    def _k(cls, key):\n        return key.lower() if isinstance(key, str) else key\n\n    def __init__(self, *args, **kwargs):\n        super(CaseInsensitiveDict, self).__init__(*args, **kwargs)\n        self._convert_keys()\n\n    def __getitem__(self, key):\n        return super(CaseInsensitiveDict, self).__getitem__(self.__class__._k(key))\n\n    def __setitem__(self, key, value):\n        super(CaseInsensitiveDict, self).__setitem__(self.__class__._k(key), value)\n\n    def __delitem__(self, key):\n        return super(CaseInsensitiveDict, self).__delitem__(self.__class__._k(key))\n\n    def __contains__(self, key):\n        return super(CaseInsensitiveDict, self).__contains__(self.__class__._k(key))\n\n    def pop(self, key, *args, **kwargs):\n        return super(CaseInsensitiveDict, self).pop(\n            self.__class__._k(key), *args, **kwargs\n        )\n\n    def get(self, key, *args, **kwargs):\n        return super(CaseInsensitiveDict, self).get(\n            self.__class__._k(key), *args, **kwargs\n        )\n\n    def setdefault(self, key, *args, **kwargs):\n        return super(CaseInsensitiveDict, self).setdefault(\n            self.__class__._k(key), *args, **kwargs\n        )\n\n    def update(self, e=None, **f):\n        if e is None:\n            e = {}\n        super(CaseInsensitiveDict, self).update(self.__class__(e))\n        super(CaseInsensitiveDict, self).update(self.__class__(**f))\n\n    def _convert_keys(self):\n        for k in list(self.keys()):\n            val = super(CaseInsensitiveDict, self).pop(k)\n            self.__setitem__(k, val)\n\n\nclass TurnMemoryScope(MemoryScope):\n    def __init__(self):\n        super().__init__(scope_path.TURN, False)\n\n    def get_memory(self, dialog_context: \"DialogContext\") -> object:\n        if not dialog_context:\n            raise TypeError(f\"Expecting: DialogContext, but received None\")\n\n        turn_value = dialog_context.context.turn_state.get(scope_path.TURN, None)\n\n        if not turn_value:\n            turn_value = CaseInsensitiveDict()\n            dialog_context.context.turn_state[scope_path.TURN] = turn_value\n\n        return turn_value\n\n    def set_memory(self, dialog_context: \"DialogContext\", memory: object):\n        if not dialog_context:\n            raise TypeError(f\"Expecting: DialogContext, but received None\")\n\n        dialog_context.context.turn_state[scope_path.TURN] = memory\n", "path": "libraries/botbuilder-dialogs/botbuilder/dialogs/memory/scopes/turn_memory_scope.py"}]}