prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  yaml_to_json add command line interface
  **Describe the bug**
  yaml_to_json currently only allow to enter filename. It is not convenient and cannot be used with bash autocomplete 
  
  **To Reproduce**
  
  **Expected behavior**
  Application should accept command line arguments with filenames
  
  **Screenshots**
  If applicable, add screenshots to help explain your problem.
  
  **Additional context**
  Add any other context about the problem here.
  
  </issue>
  <code>
  [start of yaml_to_json/yaml_to_json.py]
  1 from ruyaml import YAML
  2 import json
  3 
  4 
  5 def get_yaml_data():
  6     yaml_name = input("Enter the yaml file name: ")
  7 
  8     try:
  9         with open(yaml_name, "r+") as f:
  10             yaml_data = YAML().load(f)
  11             return yaml_data
  12     except:  # noqa
  13         print("Invalid input enter a valid yaml file name e.g. example.yaml")
  14         yaml_data = get_yaml_data()
  15 
  16 
  17 def convert_to_json(yaml_data):
  18     json_name = input("Enter the name of output json file: ")
  19 
  20     try:
  21         with open(json_name, "w+") as o:
  22             o.write(json.dumps(yaml_data))
  23     except:  # noqa
  24         print("Invalid input enter a valid json file name e.g. example.json")
  25         convert_to_json(yaml_data)
  26 
  27 
  28 yaml_data = get_yaml_data()
  29 convert_to_json(yaml_data)
  30 
  31 print("Your yaml file has been converted and saved as json")
  32
  [end of yaml_to_json/yaml_to_json.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/yaml_to_json/yaml_to_json.py b/yaml_to_json/yaml_to_json.py
  --- a/yaml_to_json/yaml_to_json.py
  +++ b/yaml_to_json/yaml_to_json.py
  @@ -1,9 +1,11 @@
   from ruyaml import YAML
  +import argparse
   import json
   
   
  -def get_yaml_data():
  -    yaml_name = input("Enter the yaml file name: ")
  +def get_yaml_data(yaml_name=None):
  +    if not yaml_name:
  +        yaml_name = input("Enter the yaml file name: ")
   
       try:
           with open(yaml_name, "r+") as f:
  @@ -14,18 +16,34 @@
           yaml_data = get_yaml_data()
   
   
  -def convert_to_json(yaml_data):
  -    json_name = input("Enter the name of output json file: ")
  +def convert_to_json(yaml_data, json_name=None, intent=None):
  +    if not json_name:
  +        json_name = input("Enter the name of output json file: ")
   
       try:
           with open(json_name, "w+") as o:
  -            o.write(json.dumps(yaml_data))
  +            o.write(json.dumps(yaml_data, indent=intent))
       except:  # noqa
           print("Invalid input enter a valid json file name e.g. example.json")
           convert_to_json(yaml_data)
   
   
  -yaml_data = get_yaml_data()
  -convert_to_json(yaml_data)
  +def main():
  +    parser = argparse.ArgumentParser(description='Convert YAML file to JSON')
  +    parser.add_argument('--yaml', type=str, help='YAML filename')
  +    parser.add_argument('--json', type=str, help='JSON filename')
  +    parser.add_argument('--intent', type=int, help="intent value for JSON")
  +    args = parser.parse_args()
   
  -print("Your yaml file has been converted and saved as json")
  +    yaml_name = args.yaml
  +    json_name = args.json
  +    intent = args.intent
  +
  +    yaml_data = get_yaml_data(yaml_name)
  +    convert_to_json(yaml_data, json_name, intent=intent)
  +
  +    print("Your yaml file has been converted and saved as json")
  +
  +
  +if __name__ == "__main__":
  +    main()
  
verification_info: {"golden_diff": "diff --git a/yaml_to_json/yaml_to_json.py b/yaml_to_json/yaml_to_json.py\n--- a/yaml_to_json/yaml_to_json.py\n+++ b/yaml_to_json/yaml_to_json.py\n@@ -1,9 +1,11 @@\n from ruyaml import YAML\n+import argparse\n import json\n \n \n-def get_yaml_data():\n-    yaml_name = input(\"Enter the yaml file name: \")\n+def get_yaml_data(yaml_name=None):\n+    if not yaml_name:\n+        yaml_name = input(\"Enter the yaml file name: \")\n \n     try:\n         with open(yaml_name, \"r+\") as f:\n@@ -14,18 +16,34 @@\n         yaml_data = get_yaml_data()\n \n \n-def convert_to_json(yaml_data):\n-    json_name = input(\"Enter the name of output json file: \")\n+def convert_to_json(yaml_data, json_name=None, intent=None):\n+    if not json_name:\n+        json_name = input(\"Enter the name of output json file: \")\n \n     try:\n         with open(json_name, \"w+\") as o:\n-            o.write(json.dumps(yaml_data))\n+            o.write(json.dumps(yaml_data, indent=intent))\n     except:  # noqa\n         print(\"Invalid input enter a valid json file name e.g. example.json\")\n         convert_to_json(yaml_data)\n \n \n-yaml_data = get_yaml_data()\n-convert_to_json(yaml_data)\n+def main():\n+    parser = argparse.ArgumentParser(description='Convert YAML file to JSON')\n+    parser.add_argument('--yaml', type=str, help='YAML filename')\n+    parser.add_argument('--json', type=str, help='JSON filename')\n+    parser.add_argument('--intent', type=int, help=\"intent value for JSON\")\n+    args = parser.parse_args()\n \n-print(\"Your yaml file has been converted and saved as json\")\n+    yaml_name = args.yaml\n+    json_name = args.json\n+    intent = args.intent\n+\n+    yaml_data = get_yaml_data(yaml_name)\n+    convert_to_json(yaml_data, json_name, intent=intent)\n+\n+    print(\"Your yaml file has been converted and saved as json\")\n+\n+\n+if __name__ == \"__main__\":\n+    main()\n", "issue": "yaml_to_json add command line interface\n**Describe the bug**\r\nyaml_to_json currently only allow to enter filename. It is not convenient and cannot be used with bash autocomplete \r\n\r\n**To Reproduce**\r\n\r\n**Expected behavior**\r\nApplication should accept command line arguments with filenames\r\n\r\n**Screenshots**\r\nIf applicable, add screenshots to help explain your problem.\r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\n", "before_files": [{"content": "from ruyaml import YAML\nimport json\n\n\ndef get_yaml_data():\n    yaml_name = input(\"Enter the yaml file name: \")\n\n    try:\n        with open(yaml_name, \"r+\") as f:\n            yaml_data = YAML().load(f)\n            return yaml_data\n    except:  # noqa\n        print(\"Invalid input enter a valid yaml file name e.g. example.yaml\")\n        yaml_data = get_yaml_data()\n\n\ndef convert_to_json(yaml_data):\n    json_name = input(\"Enter the name of output json file: \")\n\n    try:\n        with open(json_name, \"w+\") as o:\n            o.write(json.dumps(yaml_data))\n    except:  # noqa\n        print(\"Invalid input enter a valid json file name e.g. example.json\")\n        convert_to_json(yaml_data)\n\n\nyaml_data = get_yaml_data()\nconvert_to_json(yaml_data)\n\nprint(\"Your yaml file has been converted and saved as json\")\n", "path": "yaml_to_json/yaml_to_json.py"}]}