internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: deeppavlov/DeepPavlov

Issue:
What is "'Chainer' object has no attribute 'infer'
2018-03-04 14:09:23,638 (util.py:64 WorkerThread2) ERROR - TeleBot: "AttributeError occurred, args=("'Chainer' object has no attribute 'infer'",)
Traceback (most recent call last):
  File "/Users/developer/DeepPavlov/lib/python3.6/site-packages/telebot/util.py", line 58, in run
    task(*args, **kwargs)
  File "/Users/developer/Project/DeepPavlov/telegram_utils/telegram_ui.py", line 48, in handle_inference
    pred = model.infer(context)
AttributeError: 'Chainer' object has no attribute 'infer'
"
2018-03-04 14:09:23.638 ERROR in 'TeleBot'['util'] at line 64: AttributeError occurred, args=("'Chainer' object has no attribute 'infer'",)
Traceback (most recent call last):
  File "/Users/developer/DeepPavlov/lib/python3.6/site-packages/telebot/util.py", line 58, in run
    task(*args, **kwargs)
  File "/Users/developer/Project/DeepPavlov/telegram_utils/telegram_ui.py", line 48, in handle_inference
    pred = model.infer(context)
AttributeError: 'Chainer' object has no attribute 'infer'

Traceback (most recent call last):
  File "deep.py", line 60, in <module>
    main()
  File "deep.py", line 56, in main
    interact_model_by_telegram(pipeline_config_path, token)
  File "/Users/developer/Project/DeepPavlov/telegram_utils/telegram_ui.py", line 58, in interact_model_by_telegram
    init_bot_for_model(token, model)
  File "/Users/developer/Project/DeepPavlov/telegram_utils/telegram_ui.py", line 52, in init_bot_for_model
    bot.polling()
  File "/Users/developer/DeepPavlov/lib/python3.6/site-packages/telebot/__init__.py", line 264, in polling
    self.__threaded_polling(none_stop, interval, timeout)
  File "/Users/developer/DeepPavlov/lib/python3.6/site-packages/telebot/__init__.py", line 288, in __threaded_polling
    self.worker_pool.raise_exceptions()
  File "/Users/developer/DeepPavlov/lib/python3.6/site-packages/telebot/util.py", line 107, in raise_exceptions
    six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
  File "/Users/developer/DeepPavlov/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
  File "/Users/developer/DeepPavlov/lib/python3.6/site-packages/telebot/util.py", line 58, in run
    task(*args, **kwargs)
  File "/Users/developer/Project/DeepPavlov/telegram_utils/telegram_ui.py", line 48, in handle_inference
    pred = model.infer(context)
AttributeError: 'Chainer' object has no attribute 'infer'



Discussion:

Resolving patch:
diff --git a/telegram_utils/telegram_ui.py b/telegram_utils/telegram_ui.py
--- a/telegram_utils/telegram_ui.py
+++ b/telegram_utils/telegram_ui.py
@@ -45,7 +45,7 @@ def handle_inference(message):
         chat_id = message.chat.id
         context = message.text
 
-        pred = model.infer(context)
+        pred = model(context)
         reply_message = str(pred)
         bot.send_message(chat_id, reply_message)
 


Test patch:
Repository: deeppavlov/DeepPavlov

Issue:
Files not found while running telegram bot 
I run telegram bot interface (copy-paste from readme)
```
python -m deeppavlov.deep interactbot deeppavlov/configs/go_bot/gobot_dstc2.json -t TELEGRAM_TOKEN
```

But the error is given:

```  
File "/home/ubuntu/work/ipavlov/DeepPavlov/deeppavlov/core/common/file.py", line 22, in read_json
    with open(fpath) as fin:
FileNotFoundError: [Errno 2] No such file or directory: '../telegram_utils/models_info.json' 
```

All files have been downloaded and successfully used in training.


Discussion:
It's a bug. We will fix it soon. Workaround: try to `cd deeppavlov` (there is a folder inside root directory) and run from this directory (not from the root directory of the project).
That worked, thanks

Resolving patch:
diff --git a/telegram_utils/telegram_ui.py b/telegram_utils/telegram_ui.py
--- a/telegram_utils/telegram_ui.py
+++ b/telegram_utils/telegram_ui.py
@@ -13,6 +13,8 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 """
+from pathlib import Path
+
 import telebot
 
 from deeppavlov.core.common.file import read_json
@@ -23,7 +25,8 @@ def init_bot_for_model(token, model):
     bot = telebot.TeleBot(token)
 
     model_name = type(model).__name__
-    models_info = read_json('../telegram_utils/models_info.json')
+    config_path = Path(__file__).parent / 'models_info.json'
+    models_info = read_json(str(config_path))
     model_info = models_info[model_name] if model_name in models_info else models_info['@default']
 
     @bot.message_handler(commands=['start'])


Test patch:
Repository: deeppavlov/DeepPavlov

Issue:
Why Levenshtein Corrector make strange inserts inplace of punctuation marks?
```
from deeppavlov.deep import find_config, deep_download
from deeppavlov.core.commands.infer import build_model_from_config
config = find_config('levenshtein_corrector_ru')
deep_download(config)
model = build_model_from_config(config)
print(model(['Сегодня.']))
print(model(['в 3 . Сегодня.']))
```
Gives me
> ['сегодня в']
> ['в 3 и сегодня и']

There are strange "." --> "в" and "." --> "и" inserts.


Discussion:

Resolving patch:
diff --git a/deeppavlov/models/spelling_correction/levenshtein/searcher_component.py b/deeppavlov/models/spelling_correction/levenshtein/searcher_component.py
--- a/deeppavlov/models/spelling_correction/levenshtein/searcher_component.py
+++ b/deeppavlov/models/spelling_correction/levenshtein/searcher_component.py
@@ -11,7 +11,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
+import string
 from math import log10
 from typing import Iterable, List, Tuple
 
@@ -41,6 +41,8 @@ class LevenshteinSearcherComponent(Component):
          changes
     """
 
+    _punctuation = frozenset(string.punctuation)
+
     def __init__(self, words: Iterable[str], max_distance: int=1, error_probability: float=1e-4, *args, **kwargs):
         words = list({word.strip().lower().replace('ё', 'е') for word in words})
         alphabet = sorted({letter for word in words for letter in word})
@@ -52,10 +54,13 @@ def __init__(self, words: Iterable[str], max_distance: int=1, error_probability:
     def _infer_instance(self, tokens: Iterable[str]) -> List[List[Tuple[float, str]]]:
         candidates = []
         for word in tokens:
-            c = {candidate: self.error_probability * distance
-                 for candidate, distance in self.searcher.search(word, d=self.max_distance)}
-            c[word] = c.get(word, self.vocab_penalty)
-            candidates.append([(score, candidate) for candidate, score in c.items()])
+            if word in self._punctuation:
+                candidates.append([(0, word)])
+            else:
+                c = {candidate: self.error_probability * distance
+                     for candidate, distance in self.searcher.search(word, d=self.max_distance)}
+                c[word] = c.get(word, self.vocab_penalty)
+                candidates.append([(score, candidate) for candidate, score in c.items()])
         return candidates
 
     def __call__(self, batch: Iterable[Iterable[str]], *args, **kwargs) -> List[List[List[Tuple[float, str]]]]:


Test patch:
Repository: deeppavlov/DeepPavlov

Issue:
`-m deeppavlov evaluate` loads model from `save_path`
- load model from load_path if there was no training


Discussion:

Resolving patch:
diff --git a/deeppavlov/core/commands/train.py b/deeppavlov/core/commands/train.py
--- a/deeppavlov/core/commands/train.py
+++ b/deeppavlov/core/commands/train.py
@@ -204,11 +204,7 @@ def train_evaluate_model_from_config(config: [str, Path, dict], iterator=None,
     res = {}
 
     if train_config['validate_best'] or train_config['test_best']:
-        # try:
-        #     model_config['load_path'] = model_config['save_path']
-        # except KeyError:
-        #     log.warning('No "save_path" parameter for the model, so "load_path" will not be renewed')
-        model = build_model(config, load_trained=True)
+        model = build_model(config, load_trained=to_train)
         log.info('Testing the best saved model')
 
         if train_config['validate_best']:
diff --git a/deeppavlov/models/go_bot/network.py b/deeppavlov/models/go_bot/network.py
--- a/deeppavlov/models/go_bot/network.py
+++ b/deeppavlov/models/go_bot/network.py
@@ -116,7 +116,7 @@ def __init__(self,
         self.sess.run(tf.global_variables_initializer())
 
         super().__init__(**kwargs)
-        if tf.train.checkpoint_exists(str(self.save_path.resolve())):
+        if tf.train.checkpoint_exists(str(self.load_path.resolve())):
             log.info("[initializing `{}` from saved]".format(self.__class__.__name__))
             self.load()
         else:


Test patch:
Repository: deeppavlov/DeepPavlov

Issue:
Add an environment variable to skip nltk.download()

Add an environment variable to skip nltk.download()



Discussion:

Resolving patch:
diff --git a/deeppavlov/models/__init__.py b/deeppavlov/models/__init__.py
--- a/deeppavlov/models/__init__.py
+++ b/deeppavlov/models/__init__.py
@@ -12,13 +12,14 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import os
 import nltk
 
 from deeppavlov.core.common.prints import RedirectedPrints
 
-
-with RedirectedPrints():
-    nltk.download('punkt')
-    nltk.download('stopwords')
-    nltk.download('perluniprops')
-    nltk.download('nonbreaking_prefixes')
+if not os.environ.get('DP_SKIP_NLTK_DOWNLOAD'):
+    with RedirectedPrints():
+        nltk.download('punkt')
+        nltk.download('stopwords')
+        nltk.download('perluniprops')
+        nltk.download('nonbreaking_prefixes')


Test patch:
Repository: deeppavlov/DeepPavlov

Issue:
Python 3.7.0 support
DeepPavlov has scikit-learn version fixed to v0.19.1, but its c-extensions build fails on python 3.7.0 (at least on macOS), please see [scikit-learn issue](https://github.com/scikit-learn/scikit-learn/issues/11320).

This issue has been fixed in scikit-learn v0.19.2 release, so you have to up at least minor version to enable python 3.7.0 support.

I can try python 3.7.0 compatibility of other packages and prepare a pull-request, if you want.


Discussion:
Hi, Alexey!
Thanks, It will be great!
Here it is https://github.com/deepmipt/DeepPavlov/pull/521

Waiting on https://github.com/tensorflow/tensorflow/issues/20517
The issue you are waiting on is now closed. Tensorflow 1.13.1 now supports Python 3.7. Could you update your dependencies?

I would like to use Spacy with your package but I can't currently because of dependencies.

Resolving patch:
diff --git a/deeppavlov/__init__.py b/deeppavlov/__init__.py
--- a/deeppavlov/__init__.py
+++ b/deeppavlov/__init__.py
@@ -37,7 +37,7 @@ def evaluate_model(config: [str, Path, dict], download: bool = False, recursive:
 except ImportError:
     'Assuming that requirements are not yet installed'
 
-__version__ = '0.4.0'
+__version__ = '0.5.0'
 __author__ = 'Neural Networks and Deep Learning lab, MIPT'
 __description__ = 'An open source library for building end-to-end dialog systems and training chatbots.'
 __keywords__ = ['NLP', 'NER', 'SQUAD', 'Intents', 'Chatbot']


Test patch:
Repository: strawberry-graphql/strawberry

Issue:
Allow to specify host and port in dev server



Discussion:

Resolving patch:
diff --git a/strawberry/cli/__init__.py b/strawberry/cli/__init__.py
--- a/strawberry/cli/__init__.py
+++ b/strawberry/cli/__init__.py
@@ -20,10 +20,12 @@ def run():
 
 @run.command("server")
 @click.argument("module", type=str)
-def server(module):
+@click.option("-h", "--host", default="0.0.0.0", type=str)
+@click.option("-p", "--port", default=8000, type=int)
+def server(module, host, port):
     sys.path.append(os.getcwd())
 
-    reloader = hupper.start_reloader("strawberry.cli.run")
+    reloader = hupper.start_reloader("strawberry.cli.run", verbose=False)
 
     schema_module = importlib.import_module(module)
 
@@ -31,4 +33,7 @@ def server(module):
 
     app = Starlette(debug=True)
     app.add_route("/graphql", GraphQLApp(schema_module.schema))
-    uvicorn.run(app, host="0.0.0.0", port=8000, log_level="error")
+
+    print(f"Running strawberry on http://{host}:{port}/graphql 🍓")
+
+    uvicorn.run(app, host=host, port=port, log_level="error")


Test patch:
Repository: strawberry-graphql/strawberry

Issue:
ASGI app broken with asyncio
Our ASGI app is currently broken with async io stuff. The implementation I made needs a bit of love :) We might have a look at how Ariadne is doing this :)

Here's a test that fails:

```python
import typing

import pytest

import strawberry
from starlette.testclient import TestClient
from strawberry.asgi import GraphQL


@pytest.fixture
def async_schema():
    @strawberry.type
    class Query:
        @strawberry.field
        async def hello(self, info, name: typing.Optional[str] = None) -> str:
            return f"Hello {name or 'world'}"

    return strawberry.Schema(Query)


@pytest.fixture
def test_client(async_schema):
    app = GraphQL(async_schema)

    return TestClient(app)


def test_simple_query(schema, test_client):
    response = test_client.post("/", json={"query": "{ hello }"})

    assert response.json() == {"data": {"hello": "Hello world"}}
```


Discussion:

Resolving patch:
diff --git a/strawberry/graphql.py b/strawberry/graphql.py
--- a/strawberry/graphql.py
+++ b/strawberry/graphql.py
@@ -1,4 +1,5 @@
 import typing
+from inspect import isawaitable
 
 from graphql import (
     ExecutionResult,
@@ -38,7 +39,7 @@ async def execute(
     if validation_errors:
         return ExecutionResult(data=None, errors=validation_errors)
 
-    return graphql_excute(
+    result = graphql_excute(
         schema,
         parse(query),
         middleware=[DirectivesMiddleware()],
@@ -46,6 +47,9 @@ async def execute(
         operation_name=operation_name,
         context_value=context_value,
     )
+    if isawaitable(result):
+        result = await typing.cast(typing.Awaitable[ExecutionResult], result)
+    return result
 
 
 async def subscribe(


Test patch:
diff --git a/tests/test_execute.py b/tests/test_execute.py
--- a/tests/test_execute.py
+++ b/tests/test_execute.py
@@ -5,6 +5,22 @@
 from strawberry.graphql import execute
 
 
+@pytest.mark.asyncio
+async def test_handles_async_resolvers():
+    @strawberry.type
+    class Query:
+        @strawberry.field
+        async def async_field(self, info) -> str:
+            return "async result"
+
+    schema = strawberry.Schema(Query)
+
+    result = await execute(schema, "{ asyncField }")
+
+    assert not result.errors
+    assert result.data["asyncField"] == "async result"
+
+
 @pytest.mark.asyncio
 async def test_runs_directives():
     @strawberry.type
Repository: strawberry-graphql/strawberry

Issue:
v0.43.0 requires pydantic, but is marked optional
Attempting to start a very simple server results in:

```
$ strawberry server app
Traceback (most recent call last):
  File "/home/ossareh/.local/share/virtualenvs/vega-IIh8dIOy/bin/strawberry", line 5, in <module>
    from strawberry.cli import run
  File "/home/ossareh/.local/share/virtualenvs/vega-IIh8dIOy/lib/python3.9/site-packages/strawberry/__init__.py", line 1, in <module>
    from . import experimental, federation
  File "/home/ossareh/.local/share/virtualenvs/vega-IIh8dIOy/lib/python3.9/site-packages/strawberry/experimental/__init__.py", line 1, in <module>
    from . import pydantic
  File "/home/ossareh/.local/share/virtualenvs/vega-IIh8dIOy/lib/python3.9/site-packages/strawberry/experimental/pydantic/__init__.py", line 1, in <module>
    from .error_type import error_type
  File "/home/ossareh/.local/share/virtualenvs/vega-IIh8dIOy/lib/python3.9/site-packages/strawberry/experimental/pydantic/error_type.py", line 4, in <module>
    from pydantic import BaseModel
ModuleNotFoundError: No module named 'pydantic'
```

Even though pyproject.toml has pydantic marked as optional: https://github.com/strawberry-graphql/strawberry/blob/master/pyproject.toml#L37

app.py is:

```
import asyncio

import strawberry


async def resolve_hello(root, info, name: str) -> str:
    await asyncio.sleep(1)
    return f"Hello {name}"


@strawberry.type
class Query:
    hello: str = strawberry.field(resolver=resolve_hello)


schema = strawberry.Schema(query=Query)
```


Discussion:
can confirm the bug does not exist on v0.42.7
@ossareh thank you for report! Will make a fix soon :)

Resolving patch:
diff --git a/strawberry/experimental/__init__.py b/strawberry/experimental/__init__.py
--- a/strawberry/experimental/__init__.py
+++ b/strawberry/experimental/__init__.py
@@ -1,4 +1,6 @@
-from . import pydantic
-
-
-__all__ = ["pydantic"]
+try:
+    from . import pydantic
+except ImportError:
+    pass
+else:
+    __all__ = ["pydantic"]


Test patch:
Repository: strawberry-graphql/strawberry

Issue:
strawberry.utils.typing.get_optional_annotation fails when provided an `Optional[Union]`
`strawberry.utils.typing.get_optional_annotation` fails when provided an `Optional[Union]`

```pycon
>>> from typing import Optional, Union
>>> from strawberry.utils.typing import get_optional_annotation

>>> get_optional_annotation(Optional[Union[int, str]])
<class 'int'>
```
This should return `Union[int, str]` instead 


Discussion:

Resolving patch:
diff --git a/strawberry/utils/typing.py b/strawberry/utils/typing.py
--- a/strawberry/utils/typing.py
+++ b/strawberry/utils/typing.py
@@ -42,7 +42,14 @@ def is_optional(annotation: Type) -> bool:
 
 def get_optional_annotation(annotation: Type) -> Type:
     types = annotation.__args__
-    non_none_types = [x for x in types if x != None.__class__]  # noqa:E711
+
+    non_none_types = tuple(x for x in types if x != None.__class__)  # noqa:E711
+
+    # if we have multiple non none types we want to return a copy of this
+    # type (normally a Union type).
+
+    if len(non_none_types) > 1:
+        return annotation.copy_with(non_none_types)
 
     return non_none_types[0]
 


Test patch:
diff --git a/tests/utils/test_typing.py b/tests/utils/test_typing.py
new file mode 100644
--- /dev/null
+++ b/tests/utils/test_typing.py
@@ -0,0 +1,15 @@
+from typing import Optional, Union
+
+from strawberry.utils.typing import get_optional_annotation
+
+
+def test_get_optional_annotation():
+
+    # Pair Union
+    assert get_optional_annotation(Optional[Union[str, bool]]) == Union[str, bool]
+
+    # More than pair Union
+    assert (
+        get_optional_annotation(Optional[Union[str, int, bool]])
+        == Union[str, int, bool]
+    )
Repository: strawberry-graphql/strawberry

Issue:
Strawberry mypy plugin not working with new 0.800 mypy version
Due to the new `info: TypeInfo` arg in `DataclassAttribute` (see [here](https://github.com/python/mypy/pull/9380/files#diff-1fdad80f805993800524fbb9b684cc3d09879f54a0e51c71f2a447c7d46c1eb4R38)), `DataclassAttribute` instantiation fails [here](https://github.com/strawberry-graphql/strawberry/blob/master/strawberry/ext/mypy_plugin.py#L476).

I do not have any solution to offer yet, but I guess it will have to be addressed before bumping mypy.

Cheers


Discussion:
@AGASS007 thanks for the report! Will take a look at it now, hopefully it is something simple 😊

Resolving patch:
diff --git a/strawberry/ext/mypy_plugin.py b/strawberry/ext/mypy_plugin.py
--- a/strawberry/ext/mypy_plugin.py
+++ b/strawberry/ext/mypy_plugin.py
@@ -472,18 +472,28 @@ def collect_attributes(self) -> Optional[List[DataclassAttribute]]:
                 sym.implicit = True
 
             known_attrs.add(lhs.name)
-            attrs.append(
-                DataclassAttribute(
-                    name=lhs.name,
-                    is_in_init=is_in_init,
-                    is_init_var=is_init_var,
-                    has_default=has_default,
-                    line=stmt.line,
-                    column=stmt.column,
-                    type=sym.type,
-                )
+            params = dict(
+                name=lhs.name,
+                is_in_init=is_in_init,
+                is_init_var=is_init_var,
+                has_default=has_default,
+                line=stmt.line,
+                column=stmt.column,
+                type=sym.type,
             )
 
+            # add support for mypy >= 0.800 without breaking backwards compatibility
+            # https://github.com/python/mypy/pull/9380/file
+            # https://github.com/strawberry-graphql/strawberry/issues/678
+
+            try:
+                attribute = DataclassAttribute(**params)  # type: ignore
+            except TypeError:
+                params["info"] = cls.info
+                attribute = DataclassAttribute(**params)  # type: ignore
+
+            attrs.append(attribute)
+
         # Next, collect attributes belonging to any class in the MRO
         # as long as those attributes weren't already collected.  This
         # makes it possible to overwrite attributes in subclasses.


Test patch:
Repository: strawberry-graphql/strawberry

Issue:
UploadFile causes ASGI application's exception when it is in debug mode
Apparently when we use the ASGI application in debug mode, it cannot print the value of variables if they are not JSON serializable.

In my use case, when I tried to use the [file upload](https://strawberry.rocks/docs/features/file-upload) example in debug mode this issue ended up happening.

I believe it is because of this:

https://github.com/strawberry-graphql/strawberry/blob/de215370b247a417af8a8dd5fc382d71e305bcd7/strawberry/utils/debug.py#L26-L29

Perhaps converting variables to string might help.


Discussion:
Thanks for the report @pablohenriq, will try to fix this during the weekend :)

Resolving patch:
diff --git a/strawberry/utils/debug.py b/strawberry/utils/debug.py
--- a/strawberry/utils/debug.py
+++ b/strawberry/utils/debug.py
@@ -1,6 +1,7 @@
 import datetime
 import json
-import typing
+from json import JSONEncoder
+from typing import Any, Dict
 
 from pygments import highlight, lexers
 from pygments.formatters import Terminal256Formatter
@@ -8,9 +9,14 @@
 from .graphql_lexer import GraphQLLexer
 
 
+class StrawberryJSONEncoder(JSONEncoder):
+    def default(self, o: Any) -> Any:
+        return repr(o)
+
+
 def pretty_print_graphql_operation(
-    operation_name: str, query: str, variables: typing.Dict["str", typing.Any]
-):  # pragma: no cover
+    operation_name: str, query: str, variables: Dict["str", Any]
+):
     """Pretty print a GraphQL operation using pygments.
 
     Won't print introspection operation to prevent noise in the output."""
@@ -24,6 +30,6 @@ def pretty_print_graphql_operation(
     print(highlight(query, GraphQLLexer(), Terminal256Formatter()))
 
     if variables:
-        variables_json = json.dumps(variables, indent=4)
+        variables_json = json.dumps(variables, indent=4, cls=StrawberryJSONEncoder)
 
         print(highlight(variables_json, lexers.JsonLexer(), Terminal256Formatter()))


Test patch:
diff --git a/tests/utils/test_pretty_print.py b/tests/utils/test_pretty_print.py
new file mode 100644
--- /dev/null
+++ b/tests/utils/test_pretty_print.py
@@ -0,0 +1,34 @@
+from decimal import Decimal
+
+from strawberry.utils.debug import pretty_print_graphql_operation
+
+
+def test_pretty_print(mocker):
+    mock = mocker.patch("builtins.print")
+
+    pretty_print_graphql_operation("Example", "{ query }", variables={})
+
+    mock.assert_called_with("{ \x1b[38;5;125mquery\x1b[39m }\n")
+
+
+def test_pretty_print_variables(mocker):
+    mock = mocker.patch("builtins.print")
+
+    pretty_print_graphql_operation("Example", "{ query }", variables={"example": 1})
+
+    mock.assert_called_with(
+        '{\n    \x1b[38;5;28;01m"example"\x1b[39;00m: \x1b[38;5;241m1\x1b[39m\n}\n'
+    )
+
+
+def test_pretty_print_variables_object(mocker):
+    mock = mocker.patch("builtins.print")
+
+    pretty_print_graphql_operation(
+        "Example", "{ query }", variables={"example": Decimal(1)}
+    )
+
+    mock.assert_called_with(
+        '{\n    \x1b[38;5;28;01m"example"\x1b[39;00m: '
+        "\x1b[38;5;124m\"Decimal('1')\"\x1b[39m\n}\n"
+    )