prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Fix Danny's S3 sharing issue
  It looks like `[s3] keyPrefix=...` isn't making it into the URLs being fetched from S3.
  
  This is the address of a manifest protobuf we want to fetch:
  `https://yelp-people-dev.s3-us-west-2.amazonaws.com/~dqn/st/0.49.0-A8NT/reports/NJphBiGR4twz88mU9wTegn/manifest.pb`
  
  And this is the address that's being generated:
  `https://yelp-people-dev.s3.amazonaws.com/~dqn/reports/NJphBiGR4twz88mU9wTegn/manifest.pb`
  
  The generated address is missing the `st/<streamlit version>` bits. Looks like we're splitting on a forward slash on the pathname in `ConnectionManager.fetchManifest`, which is giving us the wrong result because the keyPrefix itself has a forward slash.
  
  </issue>
  <code>
  [start of examples/bart_vs_bikes.py]
  1 # -*- coding: utf-8 -*-
  2 # Copyright 2018-2019 Streamlit Inc.
  3 #
  4 # Licensed under the Apache License, Version 2.0 (the "License");
  5 # you may not use this file except in compliance with the License.
  6 # You may obtain a copy of the License at
  7 #
  8 #    http://www.apache.org/licenses/LICENSE-2.0
  9 #
  10 # Unless required by applicable law or agreed to in writing, software
  11 # distributed under the License is distributed on an "AS IS" BASIS,
  12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 # See the License for the specific language governing permissions and
  14 # limitations under the License.
  15 
  16 import copy
  17 from urllib.parse import urljoin
  18 import pandas as pd
  19 import streamlit as st
  20 
  21 
  22 st.title("BART stops vs. bike rentals")
  23 
  24 st.write(
  25     """
  26     This plot shows two things:
  27     * Bay Area Rapit Transit (BART) train lines plotted as arcs connecting the
  28     stations.
  29     * A 3D hexagonal histogram plot of bike-sharing rentals (origin locations).
  30 """
  31 )
  32 
  33 
  34 @st.cache
  35 def from_data_file(filename):
  36     dirname = "https://raw.githubusercontent.com/streamlit/streamlit/develop/examples/data/"    
  37     url = urljoin(dirname, filename)
  38     return pd.read_json(url)
  39 
  40 
  41 # Grab some data
  42 bart_stop_stats = copy.deepcopy(from_data_file("bart_stop_stats.json"))
  43 bart_path_stats = from_data_file("bart_path_stats.json")
  44 bike_rental_stats = from_data_file("bike_rental_stats.json")
  45 
  46 # Move bart stop name to the 1st column, so it looks nicer when printed as a
  47 # table.
  48 bart_stop_names = bart_stop_stats["name"]
  49 bart_stop_stats.drop(labels=["name"], axis=1, inplace=True)
  50 bart_stop_stats.insert(0, "name", bart_stop_names)
  51 
  52 st.deck_gl_chart(
  53     viewport={"latitude": 37.76, "longitude": -122.4, "zoom": 11, "pitch": 50},
  54     layers=[
  55         {
  56             # Plot number of bike rentals throughtout the city
  57             "type": "HexagonLayer",
  58             "data": bike_rental_stats,
  59             "radius": 200,
  60             "elevationScale": 4,
  61             "elevationRange": [0, 1000],
  62             "pickable": True,
  63             "extruded": True,
  64         },
  65         {
  66             # Now plot locations of Bart stops
  67             # ...and let's size the stops according to traffic
  68             "type": "ScatterplotLayer",
  69             "data": bart_stop_stats,
  70             "radiusScale": 10,
  71             "getRadius": 50,
  72         },
  73         {
  74             # Now Add names of Bart stops
  75             "type": "TextLayer",
  76             "data": bart_stop_stats,
  77             "getText": "name",
  78             "getColor": [0, 0, 0, 200],
  79             "getSize": 15,
  80         },
  81         {
  82             # And draw some arcs connecting the stops
  83             "type": "ArcLayer",
  84             "data": bart_path_stats,
  85             "pickable": True,
  86             "autoHighlight": True,
  87             "getStrokeWidth": 10,
  88         },
  89     ],
  90 )
  91
  [end of examples/bart_vs_bikes.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/examples/bart_vs_bikes.py b/examples/bart_vs_bikes.py
  --- a/examples/bart_vs_bikes.py
  +++ b/examples/bart_vs_bikes.py
  @@ -33,7 +33,9 @@
   
   @st.cache
   def from_data_file(filename):
  -    dirname = "https://raw.githubusercontent.com/streamlit/streamlit/develop/examples/data/"    
  +    dirname = (
  +        "https://raw.githubusercontent.com/streamlit/streamlit/develop/examples/data/"
  +    )
       url = urljoin(dirname, filename)
       return pd.read_json(url)
  
verification_info: {"golden_diff": "diff --git a/examples/bart_vs_bikes.py b/examples/bart_vs_bikes.py\n--- a/examples/bart_vs_bikes.py\n+++ b/examples/bart_vs_bikes.py\n@@ -33,7 +33,9 @@\n \n @st.cache\n def from_data_file(filename):\n-    dirname = \"https://raw.githubusercontent.com/streamlit/streamlit/develop/examples/data/\"    \n+    dirname = (\n+        \"https://raw.githubusercontent.com/streamlit/streamlit/develop/examples/data/\"\n+    )\n     url = urljoin(dirname, filename)\n     return pd.read_json(url)\n", "issue": "Fix Danny's S3 sharing issue\nIt looks like `[s3] keyPrefix=...` isn't making it into the URLs being fetched from S3.\r\n\r\nThis is the address of a manifest protobuf we want to fetch:\r\n`https://yelp-people-dev.s3-us-west-2.amazonaws.com/~dqn/st/0.49.0-A8NT/reports/NJphBiGR4twz88mU9wTegn/manifest.pb`\r\n\r\nAnd this is the address that's being generated:\r\n`https://yelp-people-dev.s3.amazonaws.com/~dqn/reports/NJphBiGR4twz88mU9wTegn/manifest.pb`\r\n\r\nThe generated address is missing the `st/<streamlit version>` bits. Looks like we're splitting on a forward slash on the pathname in `ConnectionManager.fetchManifest`, which is giving us the wrong result because the keyPrefix itself has a forward slash.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# Copyright 2018-2019 Streamlit Inc.\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, software\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\nimport copy\nfrom urllib.parse import urljoin\nimport pandas as pd\nimport streamlit as st\n\n\nst.title(\"BART stops vs. bike rentals\")\n\nst.write(\n    \"\"\"\n    This plot shows two things:\n    * Bay Area Rapit Transit (BART) train lines plotted as arcs connecting the\n    stations.\n    * A 3D hexagonal histogram plot of bike-sharing rentals (origin locations).\n\"\"\"\n)\n\n\n@st.cache\ndef from_data_file(filename):\n    dirname = \"https://raw.githubusercontent.com/streamlit/streamlit/develop/examples/data/\"    \n    url = urljoin(dirname, filename)\n    return pd.read_json(url)\n\n\n# Grab some data\nbart_stop_stats = copy.deepcopy(from_data_file(\"bart_stop_stats.json\"))\nbart_path_stats = from_data_file(\"bart_path_stats.json\")\nbike_rental_stats = from_data_file(\"bike_rental_stats.json\")\n\n# Move bart stop name to the 1st column, so it looks nicer when printed as a\n# table.\nbart_stop_names = bart_stop_stats[\"name\"]\nbart_stop_stats.drop(labels=[\"name\"], axis=1, inplace=True)\nbart_stop_stats.insert(0, \"name\", bart_stop_names)\n\nst.deck_gl_chart(\n    viewport={\"latitude\": 37.76, \"longitude\": -122.4, \"zoom\": 11, \"pitch\": 50},\n    layers=[\n        {\n            # Plot number of bike rentals throughtout the city\n            \"type\": \"HexagonLayer\",\n            \"data\": bike_rental_stats,\n            \"radius\": 200,\n            \"elevationScale\": 4,\n            \"elevationRange\": [0, 1000],\n            \"pickable\": True,\n            \"extruded\": True,\n        },\n        {\n            # Now plot locations of Bart stops\n            # ...and let's size the stops according to traffic\n            \"type\": \"ScatterplotLayer\",\n            \"data\": bart_stop_stats,\n            \"radiusScale\": 10,\n            \"getRadius\": 50,\n        },\n        {\n            # Now Add names of Bart stops\n            \"type\": \"TextLayer\",\n            \"data\": bart_stop_stats,\n            \"getText\": \"name\",\n            \"getColor\": [0, 0, 0, 200],\n            \"getSize\": 15,\n        },\n        {\n            # And draw some arcs connecting the stops\n            \"type\": \"ArcLayer\",\n            \"data\": bart_path_stats,\n            \"pickable\": True,\n            \"autoHighlight\": True,\n            \"getStrokeWidth\": 10,\n        },\n    ],\n)\n", "path": "examples/bart_vs_bikes.py"}]}