anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: microsoft/demikernel
Issue: [tools] Bad Check on Number of Executed Jobs in `demikernel-ci`

## Description

The `demikernel-ci` is performing a bad check on the number of executed jobs. The `len(jobs)` test is wrong because after calling `wait_jobs()` we consume that list. Instead, we should check for `len(status)`, which gets populated after calling `wait_jobs()`

## Code Snippet

https://github.com/demikernel/demikernel/blob/89a4eeaf0189b731974a3881a2aa03b7a833de32/tools/demikernel-ci.py#L48-L61

Changed files:
tools/demikernel-ci.py

diff --git a/tools/demikernel-ci.py b/tools/demikernel-ci.py
index 8cc52856..3c04610b 100644
--- a/tools/demikernel-ci.py
+++ b/tools/demikernel-ci.py
@@ -47,9 +47,10 @@ def wait_jobs(name: string, jobs: List):
 
 def wait_and_report(name: string, jobs: List, all_pass=True):
     ret = wait_jobs(name, jobs)
+    passed: bool = False
     status: List = ret[0]
     duration: float = ret[1]
-    if len(jobs) > 1:
+    if len(status) > 1:
         if all_pass:
             passed: bool = True if status[0][1] == 0 and status[1][1] == 0 else False
         else:
Repository: microsoft/demikernel
Issue: [test] Concurrent Unit Tests in Catloop and Catmem

## Description

Our `demikernel_ci` utility launches unit tests on server and client machines.

For Catmem and Catloop LibOses, this means that we run two instances of unit-tests in the same machine, thus causing them to conflict and interfere in one another.

## Code Snippet

https://github.com/demikernel/demikernel/blob/adcae5ed3fe87879fda324bc4dc3a46794391914/tools/demikernel_ci.py#L142-L150

## Expected Behavior

For Catmem and Catloop LibOSes we should run unit tests in either the server or client endpoint.



Changed files:
tools/demikernel_ci.py

diff --git a/tools/demikernel_ci.py b/tools/demikernel_ci.py
index be70ff30..b0af1bd0 100644
--- a/tools/demikernel_ci.py
+++ b/tools/demikernel_ci.py
@@ -146,7 +146,7 @@ def job_test_unit_rust(repo: str, libos: str, is_debug: bool, server: str, clien
     test_name = "unit-test"
     jobs: dict[str, subprocess.Popen[str]] = {}
     jobs[test_name + "-server-" + server] = remote_run(server, repo, is_debug, server_cmd, is_sudo, config_path)
-    jobs[test_name + "-client-" + client] = remote_run(client, repo, is_debug, client_cmd, is_sudo, config_path)
+    # Unit tests require a single endpoint, so do not run them on client.
     return wait_and_report(test_name, log_directory, jobs, True)
Repository: python-geeks/automation-scripts
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.

Changed files:
yaml_to_json/yaml_to_json.py

diff --git a/yaml_to_json/yaml_to_json.py b/yaml_to_json/yaml_to_json.py
index 23203ad..7cdd0c6 100644
--- 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 @@ def get_yaml_data():
         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()
Repository: demikernel/demikernel
Issue: [test] Concurrent Unit Tests in Catloop and Catmem

## Description

Our `demikernel_ci` utility launches unit tests on server and client machines.

For Catmem and Catloop LibOses, this means that we run two instances of unit-tests in the same machine, thus causing them to conflict and interfere in one another.

## Code Snippet

https://github.com/demikernel/demikernel/blob/adcae5ed3fe87879fda324bc4dc3a46794391914/tools/demikernel_ci.py#L142-L150

## Expected Behavior

For Catmem and Catloop LibOSes we should run unit tests in either the server or client endpoint.



Changed files:
tools/demikernel_ci.py

diff --git a/tools/demikernel_ci.py b/tools/demikernel_ci.py
index be70ff30..b0af1bd0 100644
--- a/tools/demikernel_ci.py
+++ b/tools/demikernel_ci.py
@@ -146,7 +146,7 @@ def job_test_unit_rust(repo: str, libos: str, is_debug: bool, server: str, clien
     test_name = "unit-test"
     jobs: dict[str, subprocess.Popen[str]] = {}
     jobs[test_name + "-server-" + server] = remote_run(server, repo, is_debug, server_cmd, is_sudo, config_path)
-    jobs[test_name + "-client-" + client] = remote_run(client, repo, is_debug, client_cmd, is_sudo, config_path)
+    # Unit tests require a single endpoint, so do not run them on client.
     return wait_and_report(test_name, log_directory, jobs, True)
Repository: spaam/svtplay-dl
Issue: Fails with exit value 0

On failure, it is important that the exit value is not 0
If the program fails because of `ERROR: Can't read HDS playlist. permission denied`
(and possible at other times to), the exit value is 0.


Changed files:
lib/svtplay_dl/__init__.py

diff --git a/lib/svtplay_dl/__init__.py b/lib/svtplay_dl/__init__.py
index 798050b..4157b8f 100644
--- a/lib/svtplay_dl/__init__.py
+++ b/lib/svtplay_dl/__init__.py
@@ -215,9 +215,11 @@ def get_one_media(stream, options):
         if options.force_subtitle:
             return
 
-    if len(videos) == 0:
-        if len(error) > 0:
-            log.error(error[0].args[0])
+    for exc in error:
+        log.error(str(exc))
+    if (len(videos) == 0):
+        sys.exit(2)
+
     else:
         if options.list_quality:
             list_quality(videos)