We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Verbose flag is not passed to remote jobs
The `-v` flag works with the inprocess runner, but doesn't seem to get forwarded to remote jobs when using the batch runner.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `rastervision_aws_batch/rastervision/aws_batch/aws_batch_runner.py`
Content:
```
1 import copy
2 import logging
3 import os
4 import uuid
5 from inspect import signature
6 from typing import List, Optional
7 
8 from rastervision.pipeline import rv_config
9 from rastervision.pipeline.runner import Runner
10 
11 log = logging.getLogger(__name__)
12 AWS_BATCH = 'batch'
13 
14 
15 def submit_job(cmd: List[str],
16                job_name: str,
17                debug: bool = False,
18                profile: str = False,
19                attempts: int = 5,
20                parent_job_ids: List[str] = None,
21                num_array_jobs: Optional[int] = None,
22                use_gpu: bool = False,
23                job_queue: Optional[str] = None,
24                job_def: Optional[str] = None) -> str:
25     """Submit a job to run on AWS Batch.
26 
27     Args:
28         cmd: a command to run in the Docker container for the remote job
29         debug: if True, run the command using a ptvsd wrapper which sets up a remote
30             VS Code Python debugger server
31         profile: if True, run the command using kernprof, a line profiler
32         attempts: the number of times to try running the command which is useful
33             in case of failure.
34         parent_job_ids: optional list of parent Batch job ids. The job created by this
35             will only run after the parent jobs complete successfully.
36         num_array_jobs: if set, make this a Batch array job with size equal to
37             num_array_jobs
38         use_gpu: if True, run the job in a GPU-enabled queue
39         job_queue: if set, use this job queue
40         job_def: if set, use this job definition
41     """
42     batch_config = rv_config.get_namespace_config(AWS_BATCH)
43 
44     if job_queue is None:
45         if use_gpu:
46             job_queue = batch_config('gpu_job_queue')
47         else:
48             job_queue = batch_config('cpu_job_queue')
49 
50     if job_def is None:
51         if use_gpu:
52             job_def = batch_config('gpu_job_def')
53         else:
54             job_def = batch_config('cpu_job_def')
55 
56     import boto3
57     client = boto3.client('batch')
58 
59     cmd_list = cmd.split(' ')
60     if debug:
61         cmd_list = [
62             'python', '-m', 'ptvsd', '--host', '0.0.0.0', '--port', '6006',
63             '--wait', '-m'
64         ] + cmd_list
65 
66     if profile:
67         cmd_list = ['kernprof', '-v', '-l'] + cmd_list
68 
69     kwargs = {
70         'jobName': job_name,
71         'jobQueue': job_queue,
72         'jobDefinition': job_def,
73         'containerOverrides': {
74             'command': cmd_list
75         },
76         'retryStrategy': {
77             'attempts': attempts
78         },
79     }
80     if parent_job_ids:
81         kwargs['dependsOn'] = [{'jobId': id} for id in parent_job_ids]
82     if num_array_jobs:
83         kwargs['arrayProperties'] = {'size': num_array_jobs}
84 
85     job_id = client.submit_job(**kwargs)['jobId']
86     msg = 'submitted job with jobName={} and jobId={} w/ parent(s)={}'.format(
87         job_name, job_id, parent_job_ids)
88     log.info(msg)
89     log.info(cmd_list)
90 
91     return job_id
92 
93 
94 class AWSBatchRunner(Runner):
95     """Runs pipelines remotely using AWS Batch.
96 
97     Requires Everett configuration of form:
98 
99     ```
100     [AWS_BATCH]
101     cpu_job_queue=
102     cpu_job_def=
103     gpu_job_queue=
104     gpu_job_def=
105     attempts=
106     ```
107     """
108 
109     def run(self,
110             cfg_json_uri,
111             pipeline,
112             commands,
113             num_splits=1,
114             pipeline_run_name: str = 'raster-vision'):
115         parent_job_ids = []
116 
117         # pipeline-specific job queue
118         if hasattr(pipeline, 'job_queue'):
119             pipeline_job_queue = pipeline.job_queue
120         else:
121             pipeline_job_queue = None
122 
123         # pipeline-specific job definition
124         if hasattr(pipeline, 'job_def'):
125             pipeline_job_def = pipeline.job_def
126         else:
127             pipeline_job_def = None
128 
129         for command in commands:
130 
131             # detect external command
132             if hasattr(pipeline, command):
133                 fn = getattr(pipeline, command)
134                 params = signature(fn).parameters
135                 external = hasattr(fn, 'external') and len(params) in {0, 1}
136                 array_job_capable = hasattr(fn, 'array_job_capable') \
137                     and fn.array_job_capable
138             else:
139                 external = False
140                 array_job_capable = False
141 
142             # command-specific job queue, job definition
143             job_def = pipeline_job_def
144             job_queue = pipeline_job_queue
145             if hasattr(pipeline, command):
146                 fn = getattr(pipeline, command)
147                 if hasattr(fn, 'job_def'):
148                     job_def = fn.job_def
149                 if hasattr(fn, 'job_queue'):
150                     job_queue = fn.job_queue
151 
152             num_array_jobs = None
153             use_gpu = command in pipeline.gpu_commands
154 
155             job_name = f'{pipeline_run_name}-{command}-{uuid.uuid4()}'
156 
157             if not external:
158                 cmd = [
159                     'python', '-m', 'rastervision.pipeline.cli run_command',
160                     cfg_json_uri, command, '--runner', AWS_BATCH
161                 ]
162                 if command in pipeline.split_commands and num_splits > 1:
163                     num_array_jobs = num_splits
164                     cmd += ['--num-splits', str(num_splits)]
165                 job_id = submit_job(
166                     cmd=' '.join(cmd),
167                     job_name=job_name,
168                     parent_job_ids=parent_job_ids,
169                     num_array_jobs=num_array_jobs,
170                     use_gpu=use_gpu,
171                     job_queue=job_queue,
172                     job_def=job_def)
173                 parent_job_ids = [job_id]
174             else:
175                 if command in pipeline.split_commands and num_splits > 1:
176                     if len(params) == 1 and array_job_capable:
177                         cmd = fn(-num_splits)
178                         num_array_jobs = num_splits
179                         job_id = submit_job(
180                             cmd=' '.join(cmd),
181                             job_name=job_name,
182                             parent_job_ids=parent_job_ids,
183                             num_array_jobs=num_array_jobs,
184                             use_gpu=use_gpu,
185                             job_queue=job_queue,
186                             job_def=job_def)
187                         parent_job_ids = [job_id]
188                     elif len(params) == 1 and not array_job_capable:
189                         num_array_jobs = None
190                         new_parent_job_ids = []
191                         for cmd in fn(num_splits):
192                             job_id = submit_job(
193                                 cmd=' '.join(cmd),
194                                 job_name=job_name,
195                                 parent_job_ids=parent_job_ids,
196                                 num_array_jobs=num_array_jobs,
197                                 use_gpu=use_gpu,
198                                 job_queue=job_queue,
199                                 job_def=job_def)
200                             new_parent_job_ids.append(job_id)
201                         parent_job_ids = copy.copy(new_parent_job_ids)
202                     elif len(params) == 0:
203                         cmd = fn()
204                         num_array_jobs = None
205                         job_id = submit_job(
206                             cmd=' '.join(cmd),
207                             job_name=job_name,
208                             parent_job_ids=parent_job_ids,
209                             num_array_jobs=num_array_jobs,
210                             use_gpu=use_gpu,
211                             job_queue=job_queue,
212                             job_def=job_def)
213                         parent_job_ids = [job_id]
214                 else:
215                     if len(params) == 0:
216                         cmd = fn()
217                     elif len(params) == 1:
218                         cmd = fn(1)[0]
219                     num_array_jobs = 1
220                     job_id = submit_job(
221                         cmd=' '.join(cmd),
222                         job_name=job_name,
223                         parent_job_ids=parent_job_ids,
224                         num_array_jobs=num_array_jobs,
225                         use_gpu=use_gpu,
226                         job_queue=job_queue,
227                         job_def=job_def)
228                     parent_job_ids = [job_id]
229 
230             job_queue = None
231             job_def = None
232 
233     def get_split_ind(self):
234         return int(os.environ.get('AWS_BATCH_JOB_ARRAY_INDEX', 0))
235
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/rastervision_aws_batch/rastervision/aws_batch/aws_batch_runner.py b/rastervision_aws_batch/rastervision/aws_batch/aws_batch_runner.py
--- a/rastervision_aws_batch/rastervision/aws_batch/aws_batch_runner.py
+++ b/rastervision_aws_batch/rastervision/aws_batch/aws_batch_runner.py
@@ -155,10 +155,13 @@
             job_name = f'{pipeline_run_name}-{command}-{uuid.uuid4()}'
 
             if not external:
-                cmd = [
-                    'python', '-m', 'rastervision.pipeline.cli run_command',
-                    cfg_json_uri, command, '--runner', AWS_BATCH
-                ]
+                cmd = ['python', '-m', 'rastervision.pipeline.cli']
+                if rv_config.get_verbosity() > 1:
+                    cmd.append('-' + 'v' * (rv_config.get_verbosity() - 1))
+                cmd.extend([
+                    'run_command', cfg_json_uri, command, '--runner', AWS_BATCH
+                ])
+
                 if command in pipeline.split_commands and num_splits > 1:
                     num_array_jobs = num_splits
                     cmd += ['--num-splits', str(num_splits)]

{"golden_diff": "diff --git a/rastervision_aws_batch/rastervision/aws_batch/aws_batch_runner.py b/rastervision_aws_batch/rastervision/aws_batch/aws_batch_runner.py\n--- a/rastervision_aws_batch/rastervision/aws_batch/aws_batch_runner.py\n+++ b/rastervision_aws_batch/rastervision/aws_batch/aws_batch_runner.py\n@@ -155,10 +155,13 @@\n             job_name = f'{pipeline_run_name}-{command}-{uuid.uuid4()}'\n \n             if not external:\n-                cmd = [\n-                    'python', '-m', 'rastervision.pipeline.cli run_command',\n-                    cfg_json_uri, command, '--runner', AWS_BATCH\n-                ]\n+                cmd = ['python', '-m', 'rastervision.pipeline.cli']\n+                if rv_config.get_verbosity() > 1:\n+                    cmd.append('-' + 'v' * (rv_config.get_verbosity() - 1))\n+                cmd.extend([\n+                    'run_command', cfg_json_uri, command, '--runner', AWS_BATCH\n+                ])\n+\n                 if command in pipeline.split_commands and num_splits > 1:\n                     num_array_jobs = num_splits\n                     cmd += ['--num-splits', str(num_splits)]\n", "issue": "Verbose flag is not passed to remote jobs\nThe `-v` flag works with the inprocess runner, but doesn't seem to get forwarded to remote jobs when using the batch runner.\n", "before_files": [{"content": "import copy\nimport logging\nimport os\nimport uuid\nfrom inspect import signature\nfrom typing import List, Optional\n\nfrom rastervision.pipeline import rv_config\nfrom rastervision.pipeline.runner import Runner\n\nlog = logging.getLogger(__name__)\nAWS_BATCH = 'batch'\n\n\ndef submit_job(cmd: List[str],\n               job_name: str,\n               debug: bool = False,\n               profile: str = False,\n               attempts: int = 5,\n               parent_job_ids: List[str] = None,\n               num_array_jobs: Optional[int] = None,\n               use_gpu: bool = False,\n               job_queue: Optional[str] = None,\n               job_def: Optional[str] = None) -> str:\n    \"\"\"Submit a job to run on AWS Batch.\n\n    Args:\n        cmd: a command to run in the Docker container for the remote job\n        debug: if True, run the command using a ptvsd wrapper which sets up a remote\n            VS Code Python debugger server\n        profile: if True, run the command using kernprof, a line profiler\n        attempts: the number of times to try running the command which is useful\n            in case of failure.\n        parent_job_ids: optional list of parent Batch job ids. The job created by this\n            will only run after the parent jobs complete successfully.\n        num_array_jobs: if set, make this a Batch array job with size equal to\n            num_array_jobs\n        use_gpu: if True, run the job in a GPU-enabled queue\n        job_queue: if set, use this job queue\n        job_def: if set, use this job definition\n    \"\"\"\n    batch_config = rv_config.get_namespace_config(AWS_BATCH)\n\n    if job_queue is None:\n        if use_gpu:\n            job_queue = batch_config('gpu_job_queue')\n        else:\n            job_queue = batch_config('cpu_job_queue')\n\n    if job_def is None:\n        if use_gpu:\n            job_def = batch_config('gpu_job_def')\n        else:\n            job_def = batch_config('cpu_job_def')\n\n    import boto3\n    client = boto3.client('batch')\n\n    cmd_list = cmd.split(' ')\n    if debug:\n        cmd_list = [\n            'python', '-m', 'ptvsd', '--host', '0.0.0.0', '--port', '6006',\n            '--wait', '-m'\n        ] + cmd_list\n\n    if profile:\n        cmd_list = ['kernprof', '-v', '-l'] + cmd_list\n\n    kwargs = {\n        'jobName': job_name,\n        'jobQueue': job_queue,\n        'jobDefinition': job_def,\n        'containerOverrides': {\n            'command': cmd_list\n        },\n        'retryStrategy': {\n            'attempts': attempts\n        },\n    }\n    if parent_job_ids:\n        kwargs['dependsOn'] = [{'jobId': id} for id in parent_job_ids]\n    if num_array_jobs:\n        kwargs['arrayProperties'] = {'size': num_array_jobs}\n\n    job_id = client.submit_job(**kwargs)['jobId']\n    msg = 'submitted job with jobName={} and jobId={} w/ parent(s)={}'.format(\n        job_name, job_id, parent_job_ids)\n    log.info(msg)\n    log.info(cmd_list)\n\n    return job_id\n\n\nclass AWSBatchRunner(Runner):\n    \"\"\"Runs pipelines remotely using AWS Batch.\n\n    Requires Everett configuration of form:\n\n    ```\n    [AWS_BATCH]\n    cpu_job_queue=\n    cpu_job_def=\n    gpu_job_queue=\n    gpu_job_def=\n    attempts=\n    ```\n    \"\"\"\n\n    def run(self,\n            cfg_json_uri,\n            pipeline,\n            commands,\n            num_splits=1,\n            pipeline_run_name: str = 'raster-vision'):\n        parent_job_ids = []\n\n        # pipeline-specific job queue\n        if hasattr(pipeline, 'job_queue'):\n            pipeline_job_queue = pipeline.job_queue\n        else:\n            pipeline_job_queue = None\n\n        # pipeline-specific job definition\n        if hasattr(pipeline, 'job_def'):\n            pipeline_job_def = pipeline.job_def\n        else:\n            pipeline_job_def = None\n\n        for command in commands:\n\n            # detect external command\n            if hasattr(pipeline, command):\n                fn = getattr(pipeline, command)\n                params = signature(fn).parameters\n                external = hasattr(fn, 'external') and len(params) in {0, 1}\n                array_job_capable = hasattr(fn, 'array_job_capable') \\\n                    and fn.array_job_capable\n            else:\n                external = False\n                array_job_capable = False\n\n            # command-specific job queue, job definition\n            job_def = pipeline_job_def\n            job_queue = pipeline_job_queue\n            if hasattr(pipeline, command):\n                fn = getattr(pipeline, command)\n                if hasattr(fn, 'job_def'):\n                    job_def = fn.job_def\n                if hasattr(fn, 'job_queue'):\n                    job_queue = fn.job_queue\n\n            num_array_jobs = None\n            use_gpu = command in pipeline.gpu_commands\n\n            job_name = f'{pipeline_run_name}-{command}-{uuid.uuid4()}'\n\n            if not external:\n                cmd = [\n                    'python', '-m', 'rastervision.pipeline.cli run_command',\n                    cfg_json_uri, command, '--runner', AWS_BATCH\n                ]\n                if command in pipeline.split_commands and num_splits > 1:\n                    num_array_jobs = num_splits\n                    cmd += ['--num-splits', str(num_splits)]\n                job_id = submit_job(\n                    cmd=' '.join(cmd),\n                    job_name=job_name,\n                    parent_job_ids=parent_job_ids,\n                    num_array_jobs=num_array_jobs,\n                    use_gpu=use_gpu,\n                    job_queue=job_queue,\n                    job_def=job_def)\n                parent_job_ids = [job_id]\n            else:\n                if command in pipeline.split_commands and num_splits > 1:\n                    if len(params) == 1 and array_job_capable:\n                        cmd = fn(-num_splits)\n                        num_array_jobs = num_splits\n                        job_id = submit_job(\n                            cmd=' '.join(cmd),\n                            job_name=job_name,\n                            parent_job_ids=parent_job_ids,\n                            num_array_jobs=num_array_jobs,\n                            use_gpu=use_gpu,\n                            job_queue=job_queue,\n                            job_def=job_def)\n                        parent_job_ids = [job_id]\n                    elif len(params) == 1 and not array_job_capable:\n                        num_array_jobs = None\n                        new_parent_job_ids = []\n                        for cmd in fn(num_splits):\n                            job_id = submit_job(\n                                cmd=' '.join(cmd),\n                                job_name=job_name,\n                                parent_job_ids=parent_job_ids,\n                                num_array_jobs=num_array_jobs,\n                                use_gpu=use_gpu,\n                                job_queue=job_queue,\n                                job_def=job_def)\n                            new_parent_job_ids.append(job_id)\n                        parent_job_ids = copy.copy(new_parent_job_ids)\n                    elif len(params) == 0:\n                        cmd = fn()\n                        num_array_jobs = None\n                        job_id = submit_job(\n                            cmd=' '.join(cmd),\n                            job_name=job_name,\n                            parent_job_ids=parent_job_ids,\n                            num_array_jobs=num_array_jobs,\n                            use_gpu=use_gpu,\n                            job_queue=job_queue,\n                            job_def=job_def)\n                        parent_job_ids = [job_id]\n                else:\n                    if len(params) == 0:\n                        cmd = fn()\n                    elif len(params) == 1:\n                        cmd = fn(1)[0]\n                    num_array_jobs = 1\n                    job_id = submit_job(\n                        cmd=' '.join(cmd),\n                        job_name=job_name,\n                        parent_job_ids=parent_job_ids,\n                        num_array_jobs=num_array_jobs,\n                        use_gpu=use_gpu,\n                        job_queue=job_queue,\n                        job_def=job_def)\n                    parent_job_ids = [job_id]\n\n            job_queue = None\n            job_def = None\n\n    def get_split_ind(self):\n        return int(os.environ.get('AWS_BATCH_JOB_ARRAY_INDEX', 0))\n", "path": "rastervision_aws_batch/rastervision/aws_batch/aws_batch_runner.py"}], "after_files": [{"content": "import copy\nimport logging\nimport os\nimport uuid\nfrom inspect import signature\nfrom typing import List, Optional\n\nfrom rastervision.pipeline import rv_config\nfrom rastervision.pipeline.runner import Runner\n\nlog = logging.getLogger(__name__)\nAWS_BATCH = 'batch'\n\n\ndef submit_job(cmd: List[str],\n               job_name: str,\n               debug: bool = False,\n               profile: str = False,\n               attempts: int = 5,\n               parent_job_ids: List[str] = None,\n               num_array_jobs: Optional[int] = None,\n               use_gpu: bool = False,\n               job_queue: Optional[str] = None,\n               job_def: Optional[str] = None) -> str:\n    \"\"\"Submit a job to run on AWS Batch.\n\n    Args:\n        cmd: a command to run in the Docker container for the remote job\n        debug: if True, run the command using a ptvsd wrapper which sets up a remote\n            VS Code Python debugger server\n        profile: if True, run the command using kernprof, a line profiler\n        attempts: the number of times to try running the command which is useful\n            in case of failure.\n        parent_job_ids: optional list of parent Batch job ids. The job created by this\n            will only run after the parent jobs complete successfully.\n        num_array_jobs: if set, make this a Batch array job with size equal to\n            num_array_jobs\n        use_gpu: if True, run the job in a GPU-enabled queue\n        job_queue: if set, use this job queue\n        job_def: if set, use this job definition\n    \"\"\"\n    batch_config = rv_config.get_namespace_config(AWS_BATCH)\n\n    if job_queue is None:\n        if use_gpu:\n            job_queue = batch_config('gpu_job_queue')\n        else:\n            job_queue = batch_config('cpu_job_queue')\n\n    if job_def is None:\n        if use_gpu:\n            job_def = batch_config('gpu_job_def')\n        else:\n            job_def = batch_config('cpu_job_def')\n\n    import boto3\n    client = boto3.client('batch')\n\n    cmd_list = cmd.split(' ')\n    if debug:\n        cmd_list = [\n            'python', '-m', 'ptvsd', '--host', '0.0.0.0', '--port', '6006',\n            '--wait', '-m'\n        ] + cmd_list\n\n    if profile:\n        cmd_list = ['kernprof', '-v', '-l'] + cmd_list\n\n    kwargs = {\n        'jobName': job_name,\n        'jobQueue': job_queue,\n        'jobDefinition': job_def,\n        'containerOverrides': {\n            'command': cmd_list\n        },\n        'retryStrategy': {\n            'attempts': attempts\n        },\n    }\n    if parent_job_ids:\n        kwargs['dependsOn'] = [{'jobId': id} for id in parent_job_ids]\n    if num_array_jobs:\n        kwargs['arrayProperties'] = {'size': num_array_jobs}\n\n    job_id = client.submit_job(**kwargs)['jobId']\n    msg = 'submitted job with jobName={} and jobId={} w/ parent(s)={}'.format(\n        job_name, job_id, parent_job_ids)\n    log.info(msg)\n    log.info(cmd_list)\n\n    return job_id\n\n\nclass AWSBatchRunner(Runner):\n    \"\"\"Runs pipelines remotely using AWS Batch.\n\n    Requires Everett configuration of form:\n\n    ```\n    [AWS_BATCH]\n    cpu_job_queue=\n    cpu_job_def=\n    gpu_job_queue=\n    gpu_job_def=\n    attempts=\n    ```\n    \"\"\"\n\n    def run(self,\n            cfg_json_uri,\n            pipeline,\n            commands,\n            num_splits=1,\n            pipeline_run_name: str = 'raster-vision'):\n        parent_job_ids = []\n\n        # pipeline-specific job queue\n        if hasattr(pipeline, 'job_queue'):\n            pipeline_job_queue = pipeline.job_queue\n        else:\n            pipeline_job_queue = None\n\n        # pipeline-specific job definition\n        if hasattr(pipeline, 'job_def'):\n            pipeline_job_def = pipeline.job_def\n        else:\n            pipeline_job_def = None\n\n        for command in commands:\n\n            # detect external command\n            if hasattr(pipeline, command):\n                fn = getattr(pipeline, command)\n                params = signature(fn).parameters\n                external = hasattr(fn, 'external') and len(params) in {0, 1}\n                array_job_capable = hasattr(fn, 'array_job_capable') \\\n                    and fn.array_job_capable\n            else:\n                external = False\n                array_job_capable = False\n\n            # command-specific job queue, job definition\n            job_def = pipeline_job_def\n            job_queue = pipeline_job_queue\n            if hasattr(pipeline, command):\n                fn = getattr(pipeline, command)\n                if hasattr(fn, 'job_def'):\n                    job_def = fn.job_def\n                if hasattr(fn, 'job_queue'):\n                    job_queue = fn.job_queue\n\n            num_array_jobs = None\n            use_gpu = command in pipeline.gpu_commands\n\n            job_name = f'{pipeline_run_name}-{command}-{uuid.uuid4()}'\n\n            if not external:\n                cmd = ['python', '-m', 'rastervision.pipeline.cli']\n                if rv_config.get_verbosity() > 1:\n                    cmd.append('-' + 'v' * (rv_config.get_verbosity() - 1))\n                cmd.extend([\n                    'run_command', cfg_json_uri, command, '--runner', AWS_BATCH\n                ])\n\n                if command in pipeline.split_commands and num_splits > 1:\n                    num_array_jobs = num_splits\n                    cmd += ['--num-splits', str(num_splits)]\n                job_id = submit_job(\n                    cmd=' '.join(cmd),\n                    job_name=job_name,\n                    parent_job_ids=parent_job_ids,\n                    num_array_jobs=num_array_jobs,\n                    use_gpu=use_gpu,\n                    job_queue=job_queue,\n                    job_def=job_def)\n                parent_job_ids = [job_id]\n            else:\n                if command in pipeline.split_commands and num_splits > 1:\n                    if len(params) == 1 and array_job_capable:\n                        cmd = fn(-num_splits)\n                        num_array_jobs = num_splits\n                        job_id = submit_job(\n                            cmd=' '.join(cmd),\n                            job_name=job_name,\n                            parent_job_ids=parent_job_ids,\n                            num_array_jobs=num_array_jobs,\n                            use_gpu=use_gpu,\n                            job_queue=job_queue,\n                            job_def=job_def)\n                        parent_job_ids = [job_id]\n                    elif len(params) == 1 and not array_job_capable:\n                        num_array_jobs = None\n                        new_parent_job_ids = []\n                        for cmd in fn(num_splits):\n                            job_id = submit_job(\n                                cmd=' '.join(cmd),\n                                job_name=job_name,\n                                parent_job_ids=parent_job_ids,\n                                num_array_jobs=num_array_jobs,\n                                use_gpu=use_gpu,\n                                job_queue=job_queue,\n                                job_def=job_def)\n                            new_parent_job_ids.append(job_id)\n                        parent_job_ids = copy.copy(new_parent_job_ids)\n                    elif len(params) == 0:\n                        cmd = fn()\n                        num_array_jobs = None\n                        job_id = submit_job(\n                            cmd=' '.join(cmd),\n                            job_name=job_name,\n                            parent_job_ids=parent_job_ids,\n                            num_array_jobs=num_array_jobs,\n                            use_gpu=use_gpu,\n                            job_queue=job_queue,\n                            job_def=job_def)\n                        parent_job_ids = [job_id]\n                else:\n                    if len(params) == 0:\n                        cmd = fn()\n                    elif len(params) == 1:\n                        cmd = fn(1)[0]\n                    num_array_jobs = 1\n                    job_id = submit_job(\n                        cmd=' '.join(cmd),\n                        job_name=job_name,\n                        parent_job_ids=parent_job_ids,\n                        num_array_jobs=num_array_jobs,\n                        use_gpu=use_gpu,\n                        job_queue=job_queue,\n                        job_def=job_def)\n                    parent_job_ids = [job_id]\n\n            job_queue = None\n            job_def = None\n\n    def get_split_ind(self):\n        return int(os.environ.get('AWS_BATCH_JOB_ARRAY_INDEX', 0))\n", "path": "rastervision_aws_batch/rastervision/aws_batch/aws_batch_runner.py"}]}