prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [Bug] Melody_rnn Create Dataset get_pipeline missing arg
  `melody_rnn_create_dataset --config=basic_rnn --input=notesequences.tfrecord --output_dir=sequence_examples` fails with this error:
  ```
  File "/Users/ericcacciavillani/anaconda3/envs/Magenta_Testing/lib/python3.6/site-packages/magenta/pipelines/note_sequence_pipelines.py", line 184, in transform
      for amount in self._transposition_range:
  TypeError: 'float' object is not iterable
  ```
  We're trying to train our own melody rnn and we get this error, also we don't see a mention of transposition range in the melody rnn readme?
  
  Looks like in `melody_rnn_create_dataset.py` at line 52 its calling `melody_rnn_pipeline.get_pipeline(config, FLAGS.eval_ratio)`
  but `get_pipeline` in `melody_rnn_pipeline.py` takes 3 args `config`, `transposition_range`, and `eval ratio` so it looks like transposition_range is being set as eval_ratio.
  
  Working with @robindiddams on this.
  
  </issue>
  <code>
  [start of magenta/models/melody_rnn/melody_rnn_create_dataset.py]
  1 # Copyright 2016 Google Inc. All Rights Reserved.
  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 #    http://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 """Create a dataset of SequenceExamples from NoteSequence protos.
  15 
  16 This script will extract melodies from NoteSequence protos and save them to
  17 TensorFlow's SequenceExample protos for input to the melody RNN models.
  18 """
  19 
  20 import os
  21 
  22 import tensorflow as tf
  23 
  24 from magenta.models.melody_rnn import melody_rnn_config_flags
  25 from magenta.models.melody_rnn import melody_rnn_pipeline
  26 from magenta.pipelines import pipeline
  27 
  28 flags = tf.app.flags
  29 FLAGS = tf.app.flags.FLAGS
  30 flags.DEFINE_string(
  31     'input', None,
  32     'TFRecord to read NoteSequence protos from.')
  33 flags.DEFINE_string(
  34     'output_dir', None,
  35     'Directory to write training and eval TFRecord files. The TFRecord files '
  36     'are populated with  SequenceExample protos.')
  37 flags.DEFINE_float(
  38     'eval_ratio', 0.1,
  39     'Fraction of input to set aside for eval set. Partition is randomly '
  40     'selected.')
  41 flags.DEFINE_string(
  42     'log', 'INFO',
  43     'The threshold for what messages will be logged DEBUG, INFO, WARN, ERROR, '
  44     'or FATAL.')
  45 
  46 
  47 def main(unused_argv):
  48   tf.logging.set_verbosity(FLAGS.log)
  49 
  50   config = melody_rnn_config_flags.config_from_flags()
  51   pipeline_instance = melody_rnn_pipeline.get_pipeline(
  52       config, FLAGS.eval_ratio)
  53 
  54   FLAGS.input = os.path.expanduser(FLAGS.input)
  55   FLAGS.output_dir = os.path.expanduser(FLAGS.output_dir)
  56   pipeline.run_pipeline_serial(
  57       pipeline_instance,
  58       pipeline.tf_record_iterator(FLAGS.input, pipeline_instance.input_type),
  59       FLAGS.output_dir)
  60 
  61 
  62 def console_entry_point():
  63   tf.app.run(main)
  64 
  65 
  66 if __name__ == '__main__':
  67   console_entry_point()
  68
  [end of magenta/models/melody_rnn/melody_rnn_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/magenta/models/melody_rnn/melody_rnn_create_dataset.py b/magenta/models/melody_rnn/melody_rnn_create_dataset.py
  --- a/magenta/models/melody_rnn/melody_rnn_create_dataset.py
  +++ b/magenta/models/melody_rnn/melody_rnn_create_dataset.py
  @@ -49,7 +49,7 @@
   
     config = melody_rnn_config_flags.config_from_flags()
     pipeline_instance = melody_rnn_pipeline.get_pipeline(
  -      config, FLAGS.eval_ratio)
  +      config, eval_ratio=FLAGS.eval_ratio)
   
     FLAGS.input = os.path.expanduser(FLAGS.input)
     FLAGS.output_dir = os.path.expanduser(FLAGS.output_dir)
  
verification_info: {"golden_diff": "diff --git a/magenta/models/melody_rnn/melody_rnn_create_dataset.py b/magenta/models/melody_rnn/melody_rnn_create_dataset.py\n--- a/magenta/models/melody_rnn/melody_rnn_create_dataset.py\n+++ b/magenta/models/melody_rnn/melody_rnn_create_dataset.py\n@@ -49,7 +49,7 @@\n \n   config = melody_rnn_config_flags.config_from_flags()\n   pipeline_instance = melody_rnn_pipeline.get_pipeline(\n-      config, FLAGS.eval_ratio)\n+      config, eval_ratio=FLAGS.eval_ratio)\n \n   FLAGS.input = os.path.expanduser(FLAGS.input)\n   FLAGS.output_dir = os.path.expanduser(FLAGS.output_dir)\n", "issue": "[Bug] Melody_rnn Create Dataset get_pipeline missing arg\n`melody_rnn_create_dataset --config=basic_rnn --input=notesequences.tfrecord --output_dir=sequence_examples` fails with this error:\r\n```\r\nFile \"/Users/ericcacciavillani/anaconda3/envs/Magenta_Testing/lib/python3.6/site-packages/magenta/pipelines/note_sequence_pipelines.py\", line 184, in transform\r\n    for amount in self._transposition_range:\r\nTypeError: 'float' object is not iterable\r\n```\r\nWe're trying to train our own melody rnn and we get this error, also we don't see a mention of transposition range in the melody rnn readme?\r\n\r\nLooks like in `melody_rnn_create_dataset.py` at line 52 its calling `melody_rnn_pipeline.get_pipeline(config, FLAGS.eval_ratio)`\r\nbut `get_pipeline` in `melody_rnn_pipeline.py` takes 3 args `config`, `transposition_range`, and `eval ratio` so it looks like transposition_range is being set as eval_ratio.\r\n\r\nWorking with @robindiddams on this.\n", "before_files": [{"content": "# Copyright 2016 Google Inc. All Rights Reserved.\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\"\"\"Create a dataset of SequenceExamples from NoteSequence protos.\n\nThis script will extract melodies from NoteSequence protos and save them to\nTensorFlow's SequenceExample protos for input to the melody RNN models.\n\"\"\"\n\nimport os\n\nimport tensorflow as tf\n\nfrom magenta.models.melody_rnn import melody_rnn_config_flags\nfrom magenta.models.melody_rnn import melody_rnn_pipeline\nfrom magenta.pipelines import pipeline\n\nflags = tf.app.flags\nFLAGS = tf.app.flags.FLAGS\nflags.DEFINE_string(\n    'input', None,\n    'TFRecord to read NoteSequence protos from.')\nflags.DEFINE_string(\n    'output_dir', None,\n    'Directory to write training and eval TFRecord files. The TFRecord files '\n    'are populated with  SequenceExample protos.')\nflags.DEFINE_float(\n    'eval_ratio', 0.1,\n    'Fraction of input to set aside for eval set. Partition is randomly '\n    'selected.')\nflags.DEFINE_string(\n    'log', 'INFO',\n    'The threshold for what messages will be logged DEBUG, INFO, WARN, ERROR, '\n    'or FATAL.')\n\n\ndef main(unused_argv):\n  tf.logging.set_verbosity(FLAGS.log)\n\n  config = melody_rnn_config_flags.config_from_flags()\n  pipeline_instance = melody_rnn_pipeline.get_pipeline(\n      config, FLAGS.eval_ratio)\n\n  FLAGS.input = os.path.expanduser(FLAGS.input)\n  FLAGS.output_dir = os.path.expanduser(FLAGS.output_dir)\n  pipeline.run_pipeline_serial(\n      pipeline_instance,\n      pipeline.tf_record_iterator(FLAGS.input, pipeline_instance.input_type),\n      FLAGS.output_dir)\n\n\ndef console_entry_point():\n  tf.app.run(main)\n\n\nif __name__ == '__main__':\n  console_entry_point()\n", "path": "magenta/models/melody_rnn/melody_rnn_create_dataset.py"}]}