prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  guard_transform prevents translation of unprojected files
  Where by translation I mean the pattern
  
  ``` python
  with rasterio.open(file1.tif) as src:
      with rasterio.open(file2.tif, 'w', **src.meta) as dst:
          ...
  ```
  
  Traceback snippet:
  
  ```
  Traceback (most recent call last):
    ...
    File "copier.py", line 15, in to_png
      with rio.open(dst_path, "w", **meta) as dst:
    File "xxx/anaconda/lib/python2.7/site-packages/rasterio/__init__.py", line 91, in open
      transform = guard_transform(transform)
    File "xxx/anaconda/lib/python2.7/site-packages/rasterio/transform.py", line 27, in guard_transform
      transform.a, transform.e))
  ValueError: Transform has invalid coefficients a, e: (0.000000, 0.000000)
  ```
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `rasterio/transform.py`
  Content:
  ```
  1 
  2 import warnings
  3 
  4 from affine import Affine
  5 
  6 IDENTITY = Affine.identity()
  7 
  8 def tastes_like_gdal(t):
  9     return t[2] == t[4] == 0.0 and t[1] > 0 and t[5] < 0
  10 
  11 def guard_transform(transform):
  12     """Return an Affine transformation instance"""
  13     if not isinstance(transform, Affine):
  14         if tastes_like_gdal(transform):
  15             warnings.warn(
  16                 "GDAL-style transforms are deprecated and will not "
  17                 "be supported in Rasterio 1.0.",
  18                 FutureWarning,
  19                 stacklevel=2)
  20             transform = Affine.from_gdal(*transform)
  21         else:
  22             transform = Affine(*transform)
  23     a, e = transform.a, transform.e
  24     if a == 0.0 or e == 0.0:
  25         raise ValueError(
  26             "Transform has invalid coefficients a, e: (%f, %f)" % (
  27                 transform.a, transform.e))
  28     return transform
  29 
  30
  ```
  --- 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/rasterio/transform.py b/rasterio/transform.py
  --- a/rasterio/transform.py
  +++ b/rasterio/transform.py
  @@ -1,12 +1,14 @@
  -
   import warnings
   
   from affine import Affine
   
   IDENTITY = Affine.identity()
   
  -def tastes_like_gdal(t):
  -    return t[2] == t[4] == 0.0 and t[1] > 0 and t[5] < 0
  +
  +def tastes_like_gdal(seq):
  +    """Return True if `seq` matches the GDAL geotransform pattern."""
  +    return seq[2] == seq[4] == 0.0 and seq[1] > 0 and seq[5] < 0
  +
   
   def guard_transform(transform):
       """Return an Affine transformation instance"""
  @@ -20,10 +22,4 @@
               transform = Affine.from_gdal(*transform)
           else:
               transform = Affine(*transform)
  -    a, e = transform.a, transform.e
  -    if a == 0.0 or e == 0.0:
  -        raise ValueError(
  -            "Transform has invalid coefficients a, e: (%f, %f)" % (
  -                transform.a, transform.e))
       return transform
  -
  
verification_info: {"golden_diff": "diff --git a/rasterio/transform.py b/rasterio/transform.py\n--- a/rasterio/transform.py\n+++ b/rasterio/transform.py\n@@ -1,12 +1,14 @@\n-\n import warnings\n \n from affine import Affine\n \n IDENTITY = Affine.identity()\n \n-def tastes_like_gdal(t):\n-    return t[2] == t[4] == 0.0 and t[1] > 0 and t[5] < 0\n+\n+def tastes_like_gdal(seq):\n+    \"\"\"Return True if `seq` matches the GDAL geotransform pattern.\"\"\"\n+    return seq[2] == seq[4] == 0.0 and seq[1] > 0 and seq[5] < 0\n+\n \n def guard_transform(transform):\n     \"\"\"Return an Affine transformation instance\"\"\"\n@@ -20,10 +22,4 @@\n             transform = Affine.from_gdal(*transform)\n         else:\n             transform = Affine(*transform)\n-    a, e = transform.a, transform.e\n-    if a == 0.0 or e == 0.0:\n-        raise ValueError(\n-            \"Transform has invalid coefficients a, e: (%f, %f)\" % (\n-                transform.a, transform.e))\n     return transform\n-\n", "issue": "guard_transform prevents translation of unprojected files\nWhere by translation I mean the pattern\n\n``` python\nwith rasterio.open(file1.tif) as src:\n    with rasterio.open(file2.tif, 'w', **src.meta) as dst:\n        ...\n```\n\nTraceback snippet:\n\n```\nTraceback (most recent call last):\n  ...\n  File \"copier.py\", line 15, in to_png\n    with rio.open(dst_path, \"w\", **meta) as dst:\n  File \"xxx/anaconda/lib/python2.7/site-packages/rasterio/__init__.py\", line 91, in open\n    transform = guard_transform(transform)\n  File \"xxx/anaconda/lib/python2.7/site-packages/rasterio/transform.py\", line 27, in guard_transform\n    transform.a, transform.e))\nValueError: Transform has invalid coefficients a, e: (0.000000, 0.000000)\n```\n\n", "before_files": [{"content": "\nimport warnings\n\nfrom affine import Affine\n\nIDENTITY = Affine.identity()\n\ndef tastes_like_gdal(t):\n    return t[2] == t[4] == 0.0 and t[1] > 0 and t[5] < 0\n\ndef guard_transform(transform):\n    \"\"\"Return an Affine transformation instance\"\"\"\n    if not isinstance(transform, Affine):\n        if tastes_like_gdal(transform):\n            warnings.warn(\n                \"GDAL-style transforms are deprecated and will not \"\n                \"be supported in Rasterio 1.0.\",\n                FutureWarning,\n                stacklevel=2)\n            transform = Affine.from_gdal(*transform)\n        else:\n            transform = Affine(*transform)\n    a, e = transform.a, transform.e\n    if a == 0.0 or e == 0.0:\n        raise ValueError(\n            \"Transform has invalid coefficients a, e: (%f, %f)\" % (\n                transform.a, transform.e))\n    return transform\n\n", "path": "rasterio/transform.py"}], "after_files": [{"content": "import warnings\n\nfrom affine import Affine\n\nIDENTITY = Affine.identity()\n\n\ndef tastes_like_gdal(seq):\n    \"\"\"Return True if `seq` matches the GDAL geotransform pattern.\"\"\"\n    return seq[2] == seq[4] == 0.0 and seq[1] > 0 and seq[5] < 0\n\n\ndef guard_transform(transform):\n    \"\"\"Return an Affine transformation instance\"\"\"\n    if not isinstance(transform, Affine):\n        if tastes_like_gdal(transform):\n            warnings.warn(\n                \"GDAL-style transforms are deprecated and will not \"\n                \"be supported in Rasterio 1.0.\",\n                FutureWarning,\n                stacklevel=2)\n            transform = Affine.from_gdal(*transform)\n        else:\n            transform = Affine(*transform)\n    return transform\n", "path": "rasterio/transform.py"}]}