We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add an OutputContains rule to the CodeRepl interaction.
We've had a request to add an OutputContains rule to the CodeRepl interaction.

The use case is as follows: the student will type in the body of a function, and their code will be checked by calling the function on several inputs and printing the results. We don't want to stop the student from printing their own stuff from the function first, though, hence the idea of checking to see whether a substring of the student's output matches the expected output.

Note that this is a straightforward starter project. The files to modify are extensions/interactions/CodeRepl/CodeRepl.js (see codeReplRulesService) and the corresponding test suite in extensions/interactions/CodeRepl/CodeReplRulesServiceSpec.js.

/cc @anuzis 


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `extensions/rules/code_evaluation.py`
Content:
```
1 # coding: utf-8
2 #
3 # Copyright 2014 The Oppia Authors. All Rights Reserved.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, softwar
12 # distributed under the License is distributed on an "AS-IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 
17 """Rules for CodeEvaluation objects."""
18 
19 from extensions.rules import base
20 
21 
22 class CodeEquals(base.CodeEvaluationRule):
23     description = 'has code equal to {{x|CodeString}}'
24 
25 
26 class CodeContains(base.CodeEvaluationRule):
27     description = 'has code that contains {{x|CodeString}}'
28 
29 
30 class CodeDoesNotContain(base.CodeEvaluationRule):
31     description = 'has code that does not contain {{x|CodeString}}'
32 
33 
34 class OutputEquals(base.CodeEvaluationRule):
35     description = 'has output equal to {{x|CodeString}}'
36 
37 
38 class ResultsInError(base.CodeEvaluationRule):
39     description = 'results in an error when run'
40 
41 
42 class ErrorContains(base.CodeEvaluationRule):
43     description = (
44         'has error message that contains {{x|UnicodeString}}')
45
```
--- 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()

```

diff --git a/extensions/rules/code_evaluation.py b/extensions/rules/code_evaluation.py
--- a/extensions/rules/code_evaluation.py
+++ b/extensions/rules/code_evaluation.py
@@ -30,6 +30,8 @@
 class CodeDoesNotContain(base.CodeEvaluationRule):
     description = 'has code that does not contain {{x|CodeString}}'
 
+class OutputContains(base.CodeEvaluationRule):
+    description = 'has output that contains {{x|CodeString}}'
 
 class OutputEquals(base.CodeEvaluationRule):
     description = 'has output equal to {{x|CodeString}}'

{"golden_diff": "diff --git a/extensions/rules/code_evaluation.py b/extensions/rules/code_evaluation.py\n--- a/extensions/rules/code_evaluation.py\n+++ b/extensions/rules/code_evaluation.py\n@@ -30,6 +30,8 @@\n class CodeDoesNotContain(base.CodeEvaluationRule):\n     description = 'has code that does not contain {{x|CodeString}}'\n \n+class OutputContains(base.CodeEvaluationRule):\n+    description = 'has output that contains {{x|CodeString}}'\n \n class OutputEquals(base.CodeEvaluationRule):\n     description = 'has output equal to {{x|CodeString}}'\n", "issue": "Add an OutputContains rule to the CodeRepl interaction.\nWe've had a request to add an OutputContains rule to the CodeRepl interaction.\n\nThe use case is as follows: the student will type in the body of a function, and their code will be checked by calling the function on several inputs and printing the results. We don't want to stop the student from printing their own stuff from the function first, though, hence the idea of checking to see whether a substring of the student's output matches the expected output.\n\nNote that this is a straightforward starter project. The files to modify are extensions/interactions/CodeRepl/CodeRepl.js (see codeReplRulesService) and the corresponding test suite in extensions/interactions/CodeRepl/CodeReplRulesServiceSpec.js.\n\n/cc @anuzis \n\n", "before_files": [{"content": "# coding: utf-8\n#\n# Copyright 2014 The Oppia Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, softwar\n# distributed under the License is distributed on an \"AS-IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Rules for CodeEvaluation objects.\"\"\"\n\nfrom extensions.rules import base\n\n\nclass CodeEquals(base.CodeEvaluationRule):\n    description = 'has code equal to {{x|CodeString}}'\n\n\nclass CodeContains(base.CodeEvaluationRule):\n    description = 'has code that contains {{x|CodeString}}'\n\n\nclass CodeDoesNotContain(base.CodeEvaluationRule):\n    description = 'has code that does not contain {{x|CodeString}}'\n\n\nclass OutputEquals(base.CodeEvaluationRule):\n    description = 'has output equal to {{x|CodeString}}'\n\n\nclass ResultsInError(base.CodeEvaluationRule):\n    description = 'results in an error when run'\n\n\nclass ErrorContains(base.CodeEvaluationRule):\n    description = (\n        'has error message that contains {{x|UnicodeString}}')\n", "path": "extensions/rules/code_evaluation.py"}], "after_files": [{"content": "# coding: utf-8\n#\n# Copyright 2014 The Oppia Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, softwar\n# distributed under the License is distributed on an \"AS-IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Rules for CodeEvaluation objects.\"\"\"\n\nfrom extensions.rules import base\n\n\nclass CodeEquals(base.CodeEvaluationRule):\n    description = 'has code equal to {{x|CodeString}}'\n\n\nclass CodeContains(base.CodeEvaluationRule):\n    description = 'has code that contains {{x|CodeString}}'\n\n\nclass CodeDoesNotContain(base.CodeEvaluationRule):\n    description = 'has code that does not contain {{x|CodeString}}'\n\nclass OutputContains(base.CodeEvaluationRule):\n    description = 'has output that contains {{x|CodeString}}'\n\nclass OutputEquals(base.CodeEvaluationRule):\n    description = 'has output equal to {{x|CodeString}}'\n\n\nclass ResultsInError(base.CodeEvaluationRule):\n    description = 'results in an error when run'\n\n\nclass ErrorContains(base.CodeEvaluationRule):\n    description = (\n        'has error message that contains {{x|UnicodeString}}')\n", "path": "extensions/rules/code_evaluation.py"}]}