prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  BigQuery: Document the use of the timeout parameter in samples
  After adding the new `timeout` parameter to various public methods (#9987), we should demonstrate its usage in the code samples.
  
  Users should be aware of this new feature, and should probably use it by default to avoid sporadic weird issues related to a method "getting stuck" at the transport layer.
  
  </issue>
  <code>
  [start of samples/create_dataset.py]
  1 # Copyright 2019 Google LLC
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #     https://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 
  15 
  16 def create_dataset(dataset_id):
  17 
  18     # [START bigquery_create_dataset]
  19     from google.cloud import bigquery
  20 
  21     # Construct a BigQuery client object.
  22     client = bigquery.Client()
  23 
  24     # TODO(developer): Set dataset_id to the ID of the dataset to create.
  25     # dataset_id = "{}.your_dataset".format(client.project)
  26 
  27     # Construct a full Dataset object to send to the API.
  28     dataset = bigquery.Dataset(dataset_id)
  29 
  30     # TODO(developer): Specify the geographic location where the dataset should reside.
  31     dataset.location = "US"
  32 
  33     # Send the dataset to the API for creation.
  34     # Raises google.api_core.exceptions.Conflict if the Dataset already
  35     # exists within the project.
  36     dataset = client.create_dataset(dataset)  # Make an API request.
  37     print("Created dataset {}.{}".format(client.project, dataset.dataset_id))
  38     # [END bigquery_create_dataset]
  39
  [end of samples/create_dataset.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/samples/create_dataset.py b/samples/create_dataset.py
  --- a/samples/create_dataset.py
  +++ b/samples/create_dataset.py
  @@ -30,9 +30,9 @@
       # TODO(developer): Specify the geographic location where the dataset should reside.
       dataset.location = "US"
   
  -    # Send the dataset to the API for creation.
  +    # Send the dataset to the API for creation, with an explicit timeout.
       # Raises google.api_core.exceptions.Conflict if the Dataset already
       # exists within the project.
  -    dataset = client.create_dataset(dataset)  # Make an API request.
  +    dataset = client.create_dataset(dataset, timeout=30)  # Make an API request.
       print("Created dataset {}.{}".format(client.project, dataset.dataset_id))
       # [END bigquery_create_dataset]
  
verification_info: {"golden_diff": "diff --git a/samples/create_dataset.py b/samples/create_dataset.py\n--- a/samples/create_dataset.py\n+++ b/samples/create_dataset.py\n@@ -30,9 +30,9 @@\n     # TODO(developer): Specify the geographic location where the dataset should reside.\n     dataset.location = \"US\"\n \n-    # Send the dataset to the API for creation.\n+    # Send the dataset to the API for creation, with an explicit timeout.\n     # Raises google.api_core.exceptions.Conflict if the Dataset already\n     # exists within the project.\n-    dataset = client.create_dataset(dataset)  # Make an API request.\n+    dataset = client.create_dataset(dataset, timeout=30)  # Make an API request.\n     print(\"Created dataset {}.{}\".format(client.project, dataset.dataset_id))\n     # [END bigquery_create_dataset]\n", "issue": "BigQuery: Document the use of the timeout parameter in samples\nAfter adding the new `timeout` parameter to various public methods (#9987), we should demonstrate its usage in the code samples.\r\n\r\nUsers should be aware of this new feature, and should probably use it by default to avoid sporadic weird issues related to a method \"getting stuck\" at the transport layer.\n", "before_files": [{"content": "# Copyright 2019 Google LLC\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#     https://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\n\ndef create_dataset(dataset_id):\n\n    # [START bigquery_create_dataset]\n    from google.cloud import bigquery\n\n    # Construct a BigQuery client object.\n    client = bigquery.Client()\n\n    # TODO(developer): Set dataset_id to the ID of the dataset to create.\n    # dataset_id = \"{}.your_dataset\".format(client.project)\n\n    # Construct a full Dataset object to send to the API.\n    dataset = bigquery.Dataset(dataset_id)\n\n    # TODO(developer): Specify the geographic location where the dataset should reside.\n    dataset.location = \"US\"\n\n    # Send the dataset to the API for creation.\n    # Raises google.api_core.exceptions.Conflict if the Dataset already\n    # exists within the project.\n    dataset = client.create_dataset(dataset)  # Make an API request.\n    print(\"Created dataset {}.{}\".format(client.project, dataset.dataset_id))\n    # [END bigquery_create_dataset]\n", "path": "samples/create_dataset.py"}]}