prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Fix linter error on missing target_platform
  Invoking `conda smithy recipe-lint` on the [conda-forge/go1.4-feedstock/meta.yaml](
  https://github.com/conda-forge/go1.4-bootstrap-feedstock/blob/master/recipe/meta.yaml) file yields the following exception:
  
  ```
  ± conda smithy recipe-lint
  Traceback (most recent call last):
    File "/opt/conda/bin/conda-smithy", line 10, in <module>
      sys.exit(main())
    File "/opt/conda/lib/python3.6/site-packages/conda_smithy/cli.py", line 279, in main
      args.subcommand_func(args)
    File "/opt/conda/lib/python3.6/site-packages/conda_smithy/cli.py", line 203, in __call__
      return_hints=True)
    File "/opt/conda/lib/python3.6/site-packages/conda_smithy/lint_recipe.py", line 428, in main
      content = render_meta_yaml(''.join(fh))
    File "/opt/conda/lib/python3.6/site-packages/conda_smithy/utils.py", line 49, in render_meta_yaml
      content = env.from_string(text).render(os=mockos, environ=mockos.environ)
    File "/opt/conda/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
      return original_render(self, *args, **kwargs)
    File "/opt/conda/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
      return self.environment.handle_exception(exc_info, True)
    File "/opt/conda/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
      reraise(exc_type, exc_value, tb)
    File "/opt/conda/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
      raise value.with_traceback(tb)
    File "<template>", line 29, in top-level template code
  jinja2.exceptions.UndefinedError: 'target_platform' is undefined
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `conda_smithy/utils.py`
  Content:
  ```
  1 import shutil
  2 import tempfile
  3 import jinja2
  4 import six
  5 import datetime
  6 import time
  7 from collections import defaultdict
  8 from contextlib import contextmanager
  9 
  10 @contextmanager
  11 def tmp_directory():
  12     tmp_dir = tempfile.mkdtemp('_recipe')
  13     yield tmp_dir
  14     shutil.rmtree(tmp_dir)
  15 
  16 
  17 class NullUndefined(jinja2.Undefined):
  18     def __unicode__(self):
  19         return self._undefined_name
  20 
  21     def __getattr__(self, name):
  22         return '{}.{}'.format(self, name)
  23 
  24     def __getitem__(self, name):
  25         return '{}["{}"]'.format(self, name)
  26 
  27 
  28 class MockOS(dict):
  29     def __init__(self):
  30         self.environ = defaultdict(lambda: '')
  31 
  32 
  33 def render_meta_yaml(text):
  34     env = jinja2.Environment(undefined=NullUndefined)
  35 
  36     # stub out cb3 jinja2 functions - they are not important for linting
  37     #    if we don't stub them out, the ruamel.yaml load fails to interpret them
  38     #    we can't just use conda-build's api.render functionality, because it would apply selectors
  39     env.globals.update(dict(compiler=lambda x: x + '_compiler_stub',
  40                             pin_subpackage=lambda *args, **kwargs: 'subpackage_stub',
  41                             pin_compatible=lambda *args, **kwargs: 'compatible_pin_stub',
  42                             cdt=lambda *args, **kwargs: 'cdt_stub',
  43                             load_file_regex=lambda *args, **kwargs: \
  44                                     defaultdict(lambda : ''),
  45                             datetime=datetime,
  46                             time=time,
  47                             ))
  48     mockos = MockOS()
  49     content = env.from_string(text).render(os=mockos, environ=mockos.environ)
  50     return content
  51
  ```
  --- 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/conda_smithy/utils.py b/conda_smithy/utils.py
  --- a/conda_smithy/utils.py
  +++ b/conda_smithy/utils.py
  @@ -44,6 +44,7 @@
                                       defaultdict(lambda : ''),
                               datetime=datetime,
                               time=time,
  +                            target_platform="linux-64",
                               ))
       mockos = MockOS()
       content = env.from_string(text).render(os=mockos, environ=mockos.environ)
  
verification_info: {"golden_diff": "diff --git a/conda_smithy/utils.py b/conda_smithy/utils.py\n--- a/conda_smithy/utils.py\n+++ b/conda_smithy/utils.py\n@@ -44,6 +44,7 @@\n                                     defaultdict(lambda : ''),\n                             datetime=datetime,\n                             time=time,\n+                            target_platform=\"linux-64\",\n                             ))\n     mockos = MockOS()\n     content = env.from_string(text).render(os=mockos, environ=mockos.environ)\n", "issue": "Fix linter error on missing target_platform\nInvoking `conda smithy recipe-lint` on the [conda-forge/go1.4-feedstock/meta.yaml](\r\nhttps://github.com/conda-forge/go1.4-bootstrap-feedstock/blob/master/recipe/meta.yaml) file yields the following exception:\r\n\r\n```\r\n\u00b1 conda smithy recipe-lint\r\nTraceback (most recent call last):\r\n  File \"/opt/conda/bin/conda-smithy\", line 10, in <module>\r\n    sys.exit(main())\r\n  File \"/opt/conda/lib/python3.6/site-packages/conda_smithy/cli.py\", line 279, in main\r\n    args.subcommand_func(args)\r\n  File \"/opt/conda/lib/python3.6/site-packages/conda_smithy/cli.py\", line 203, in __call__\r\n    return_hints=True)\r\n  File \"/opt/conda/lib/python3.6/site-packages/conda_smithy/lint_recipe.py\", line 428, in main\r\n    content = render_meta_yaml(''.join(fh))\r\n  File \"/opt/conda/lib/python3.6/site-packages/conda_smithy/utils.py\", line 49, in render_meta_yaml\r\n    content = env.from_string(text).render(os=mockos, environ=mockos.environ)\r\n  File \"/opt/conda/lib/python3.6/site-packages/jinja2/asyncsupport.py\", line 76, in render\r\n    return original_render(self, *args, **kwargs)\r\n  File \"/opt/conda/lib/python3.6/site-packages/jinja2/environment.py\", line 1008, in render\r\n    return self.environment.handle_exception(exc_info, True)\r\n  File \"/opt/conda/lib/python3.6/site-packages/jinja2/environment.py\", line 780, in handle_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/opt/conda/lib/python3.6/site-packages/jinja2/_compat.py\", line 37, in reraise\r\n    raise value.with_traceback(tb)\r\n  File \"<template>\", line 29, in top-level template code\r\njinja2.exceptions.UndefinedError: 'target_platform' is undefined\r\n```\n", "before_files": [{"content": "import shutil\nimport tempfile\nimport jinja2\nimport six\nimport datetime\nimport time\nfrom collections import defaultdict\nfrom contextlib import contextmanager\n\n@contextmanager\ndef tmp_directory():\n    tmp_dir = tempfile.mkdtemp('_recipe')\n    yield tmp_dir\n    shutil.rmtree(tmp_dir)\n\n\nclass NullUndefined(jinja2.Undefined):\n    def __unicode__(self):\n        return self._undefined_name\n\n    def __getattr__(self, name):\n        return '{}.{}'.format(self, name)\n\n    def __getitem__(self, name):\n        return '{}[\"{}\"]'.format(self, name)\n\n\nclass MockOS(dict):\n    def __init__(self):\n        self.environ = defaultdict(lambda: '')\n\n\ndef render_meta_yaml(text):\n    env = jinja2.Environment(undefined=NullUndefined)\n\n    # stub out cb3 jinja2 functions - they are not important for linting\n    #    if we don't stub them out, the ruamel.yaml load fails to interpret them\n    #    we can't just use conda-build's api.render functionality, because it would apply selectors\n    env.globals.update(dict(compiler=lambda x: x + '_compiler_stub',\n                            pin_subpackage=lambda *args, **kwargs: 'subpackage_stub',\n                            pin_compatible=lambda *args, **kwargs: 'compatible_pin_stub',\n                            cdt=lambda *args, **kwargs: 'cdt_stub',\n                            load_file_regex=lambda *args, **kwargs: \\\n                                    defaultdict(lambda : ''),\n                            datetime=datetime,\n                            time=time,\n                            ))\n    mockos = MockOS()\n    content = env.from_string(text).render(os=mockos, environ=mockos.environ)\n    return content\n", "path": "conda_smithy/utils.py"}], "after_files": [{"content": "import shutil\nimport tempfile\nimport jinja2\nimport six\nimport datetime\nimport time\nfrom collections import defaultdict\nfrom contextlib import contextmanager\n\n@contextmanager\ndef tmp_directory():\n    tmp_dir = tempfile.mkdtemp('_recipe')\n    yield tmp_dir\n    shutil.rmtree(tmp_dir)\n\n\nclass NullUndefined(jinja2.Undefined):\n    def __unicode__(self):\n        return self._undefined_name\n\n    def __getattr__(self, name):\n        return '{}.{}'.format(self, name)\n\n    def __getitem__(self, name):\n        return '{}[\"{}\"]'.format(self, name)\n\n\nclass MockOS(dict):\n    def __init__(self):\n        self.environ = defaultdict(lambda: '')\n\n\ndef render_meta_yaml(text):\n    env = jinja2.Environment(undefined=NullUndefined)\n\n    # stub out cb3 jinja2 functions - they are not important for linting\n    #    if we don't stub them out, the ruamel.yaml load fails to interpret them\n    #    we can't just use conda-build's api.render functionality, because it would apply selectors\n    env.globals.update(dict(compiler=lambda x: x + '_compiler_stub',\n                            pin_subpackage=lambda *args, **kwargs: 'subpackage_stub',\n                            pin_compatible=lambda *args, **kwargs: 'compatible_pin_stub',\n                            cdt=lambda *args, **kwargs: 'cdt_stub',\n                            load_file_regex=lambda *args, **kwargs: \\\n                                    defaultdict(lambda : ''),\n                            datetime=datetime,\n                            time=time,\n                            target_platform=\"linux-64\",\n                            ))\n    mockos = MockOS()\n    content = env.from_string(text).render(os=mockos, environ=mockos.environ)\n    return content\n", "path": "conda_smithy/utils.py"}]}