prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Unable to create a key with a trailing slash using OrdinaryCallingFormat
  When using OrdinaryCallingFormat, it's not possible to create a key ending with a slash (e.g. when mimicking directory creation), since this is stripped off when parsing the key name. I can't comment on S3, but this is at least different behaviour from Ceph.
  
  For example, the below fails as is, but works if the connection uses SubdomainCallingFormat instead.
  
  ```
  import boto
  import moto
  import unittest
  
  
  class TestCreatingKeyEndingWithSlash(unittest.TestCase):
  
      @moto.mock_s3
      def test_ordinary_calling_format(self):
          bucket_name = 'testbucket'
          key_name = 'key_ending_with_slash/'
  
          conn = boto.connect_s3('access_key', 'secret_key',
                                 calling_format=boto.s3.connection.OrdinaryCallingFormat())
          bucket = conn.create_bucket(bucket_name)
  
          key = boto.s3.key.Key(bucket)
          key.key = key_name
          key.set_contents_from_string('')
  
          self.assertIn(key_name, [k.name for k in bucket.get_all_keys()])
  ```
  
  
  </issue>
  <code>
  [start of moto/s3bucket_path/utils.py]
  1 from __future__ import unicode_literals
  2 from six.moves.urllib.parse import urlparse
  3 
  4 
  5 def bucket_name_from_url(url):
  6     pth = urlparse(url).path.lstrip("/")
  7 
  8     l = pth.lstrip("/").split("/")
  9     if len(l) == 0 or l[0] == "":
  10         return None
  11     return l[0]
  12 
  13 
  14 def parse_key_name(path):
  15     return "/".join(path.rstrip("/").split("/")[2:])
  16 
  17 
  18 def is_delete_keys(request, path, bucket_name):
  19     return (
  20         path == u'/' + bucket_name + u'/?delete' or
  21         path == u'/' + bucket_name + u'?delete' or
  22         (path == u'/' + bucket_name and
  23          getattr(request, "query_string", "") == "delete")
  24     )
  25
  [end of moto/s3bucket_path/utils.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/moto/s3bucket_path/utils.py b/moto/s3bucket_path/utils.py
  --- a/moto/s3bucket_path/utils.py
  +++ b/moto/s3bucket_path/utils.py
  @@ -12,7 +12,7 @@
   
   
   def parse_key_name(path):
  -    return "/".join(path.rstrip("/").split("/")[2:])
  +    return "/".join(path.split("/")[2:])
   
   
   def is_delete_keys(request, path, bucket_name):
  
verification_info: {"golden_diff": "diff --git a/moto/s3bucket_path/utils.py b/moto/s3bucket_path/utils.py\n--- a/moto/s3bucket_path/utils.py\n+++ b/moto/s3bucket_path/utils.py\n@@ -12,7 +12,7 @@\n \n \n def parse_key_name(path):\n-    return \"/\".join(path.rstrip(\"/\").split(\"/\")[2:])\n+    return \"/\".join(path.split(\"/\")[2:])\n \n \n def is_delete_keys(request, path, bucket_name):\n", "issue": "Unable to create a key with a trailing slash using OrdinaryCallingFormat\nWhen using OrdinaryCallingFormat, it's not possible to create a key ending with a slash (e.g. when mimicking directory creation), since this is stripped off when parsing the key name. I can't comment on S3, but this is at least different behaviour from Ceph.\n\nFor example, the below fails as is, but works if the connection uses SubdomainCallingFormat instead.\n\n```\nimport boto\nimport moto\nimport unittest\n\n\nclass TestCreatingKeyEndingWithSlash(unittest.TestCase):\n\n    @moto.mock_s3\n    def test_ordinary_calling_format(self):\n        bucket_name = 'testbucket'\n        key_name = 'key_ending_with_slash/'\n\n        conn = boto.connect_s3('access_key', 'secret_key',\n                               calling_format=boto.s3.connection.OrdinaryCallingFormat())\n        bucket = conn.create_bucket(bucket_name)\n\n        key = boto.s3.key.Key(bucket)\n        key.key = key_name\n        key.set_contents_from_string('')\n\n        self.assertIn(key_name, [k.name for k in bucket.get_all_keys()])\n```\n\n", "before_files": [{"content": "from __future__ import unicode_literals\nfrom six.moves.urllib.parse import urlparse\n\n\ndef bucket_name_from_url(url):\n    pth = urlparse(url).path.lstrip(\"/\")\n\n    l = pth.lstrip(\"/\").split(\"/\")\n    if len(l) == 0 or l[0] == \"\":\n        return None\n    return l[0]\n\n\ndef parse_key_name(path):\n    return \"/\".join(path.rstrip(\"/\").split(\"/\")[2:])\n\n\ndef is_delete_keys(request, path, bucket_name):\n    return (\n        path == u'/' + bucket_name + u'/?delete' or\n        path == u'/' + bucket_name + u'?delete' or\n        (path == u'/' + bucket_name and\n         getattr(request, \"query_string\", \"\") == \"delete\")\n    )\n", "path": "moto/s3bucket_path/utils.py"}]}