We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Remove dependence on AWS
This PR makes it so that AWS isn't needed to run RV locally. Previously, if `AWS_PROFILE` was blank, it would cause an error when hitting a line that created an S3 client object. If you want to forward AWS credentials (the original behavior), you'll now need to run `./scripts/run --aws`.

Closes #279 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/rastervision/utils/files.py`
Content:
```
1 import io
2 import os
3 from pathlib import Path
4 import rasterio
5 import shutil
6 import subprocess
7 import tempfile
8 from threading import Timer
9 from urllib.parse import urlparse
10 
11 import boto3
12 import botocore
13 from google.protobuf import json_format
14 
15 s3 = boto3.client('s3')
16 
17 class NotFoundException(Exception):
18     pass
19 
20 
21 def make_dir(path, check_empty=False, force_empty=False, use_dirname=False):
22     directory = path
23     if use_dirname:
24         directory = os.path.dirname(path)
25 
26     if force_empty and os.path.isdir(directory):
27         shutil.rmtree(directory)
28 
29     os.makedirs(directory, exist_ok=True)
30 
31     is_empty = len(os.listdir(directory)) == 0
32     if check_empty and not is_empty:
33         raise ValueError(
34             '{} needs to be an empty directory!'.format(directory))
35 
36 
37 def get_local_path(uri, temp_dir):
38     """Convert a URI into a corresponding local path."""
39     if uri is None:
40         return None
41 
42     parsed_uri = urlparse(uri)
43     if parsed_uri.scheme == '':
44         path = uri
45     elif parsed_uri.scheme == 's3':
46         path = os.path.join(
47             temp_dir, 's3', parsed_uri.netloc, parsed_uri.path[1:])
48 
49     return path
50 
51 
52 def sync_dir(src_dir, dest_uri, delete=False):
53     command = ['aws', 's3', 'sync', src_dir, dest_uri]
54     if delete:
55         command.append('--delete')
56     subprocess.run(command)
57 
58 
59 def _is_raster(uri, s3_test=False):
60     if s3_test:
61         uri = uri.replace('s3://', '/vsis3/')
62     try:
63         rasterio.open(uri)
64     except:
65         return False
66     return uri
67 
68 
69 def download_if_needed(uri, download_dir, must_exist=True):
70     """Download a file into a directory if it's remote."""
71     if uri is None:
72         return None
73 
74     path = get_local_path(uri, download_dir)
75     make_dir(path, use_dirname=True)
76 
77     parsed_uri = urlparse(uri)
78     if parsed_uri.scheme == 's3':
79 
80         # is it a raster?
81         vsis3_path = _is_raster(uri, s3_test=True)
82         if vsis3_path:
83             return vsis3_path
84 
85         try:
86             print('Downloading {} to {}'.format(uri, path))
87             s3.download_file(parsed_uri.netloc, parsed_uri.path[1:], path)
88         except botocore.exceptions.ClientError:
89             if must_exist:
90                 raise NotFoundException('Could not find {}'.format(uri))
91     else:
92         not_found = not os.path.isfile(path)
93         if not_found and must_exist:
94             raise NotFoundException('Could not find {}'.format(uri))
95 
96     return path
97 
98 
99 def file_to_str(file_uri):
100     parsed_uri = urlparse(file_uri)
101     if parsed_uri.scheme == 's3':
102         with io.BytesIO() as file_buffer:
103             s3.download_fileobj(
104                 parsed_uri.netloc, parsed_uri.path[1:], file_buffer)
105             return file_buffer.getvalue().decode('utf-8')
106     else:
107         with open(file_uri, 'r') as file_buffer:
108             return file_buffer.read()
109 
110 
111 def str_to_file(content_str, file_uri):
112     parsed_uri = urlparse(file_uri)
113     if parsed_uri.scheme == 's3':
114         bucket = parsed_uri.netloc
115         key = parsed_uri.path[1:]
116         with io.BytesIO(bytes(content_str, encoding='utf-8')) as str_buffer:
117             s3.upload_fileobj(str_buffer, bucket, key)
118     else:
119         make_dir(file_uri, use_dirname=True)
120         with open(file_uri, 'w') as content_file:
121             content_file.write(content_str)
122 
123 
124 def load_json_config(uri, message):
125     return json_format.Parse(file_to_str(uri), message)
126 
127 
128 def save_json_config(message, uri):
129     json_str = json_format.MessageToJson(message)
130     str_to_file(json_str, uri)
131 
132 
133 def upload_if_needed(src_path, dst_uri):
134     """Upload file or dir if the destination is remote."""
135     if dst_uri is None:
136         return
137 
138     if not (os.path.isfile(src_path) or os.path.isdir(src_path)):
139         raise Exception('{} does not exist.'.format(src_path))
140 
141     parsed_uri = urlparse(dst_uri)
142     if parsed_uri.scheme == 's3':
143         # Strip the leading slash off of the path since S3 does not expect it.
144         print('Uploading {} to {}'.format(src_path, dst_uri))
145         if os.path.isfile(src_path):
146             s3.upload_file(
147                 src_path, parsed_uri.netloc, parsed_uri.path[1:])
148         else:
149             sync_dir(src_path, dst_uri, delete=True)
150 
151 
152 def start_sync(output_dir, output_uri, sync_interval=600):
153     """Start periodically syncing a directory."""
154     def _sync_dir(delete=True):
155         sync_dir(output_dir, output_uri, delete=delete)
156         thread = Timer(sync_interval, _sync_dir)
157         thread.daemon = True
158         thread.start()
159 
160     if urlparse(output_uri).scheme == 's3':
161         # On first sync, we don't want to delete files on S3 to match
162         # th contents of output_dir since there's nothing there yet.
163         _sync_dir(delete=False)
164 
165 # Ensure that RV temp directory exists. We need to use a custom location for
166 # the temporary directory so it will be mirrored on the host file system which
167 # is needed for running in a Docker container with limited space on EC2.
168 RV_TEMP_DIR = '/opt/data/tmp/'
169 
170 # find explicitly set tempdir
171 explicit_temp_dir = next(iter([
172     os.environ.get(k) for k in ['TMPDIR', 'TEMP', 'TMP'] if k in os.environ] +
173     [tempfile.tempdir]))
174 
175 try:
176     # try to create directory
177     if not os.path.exists(explicit_temp_dir):
178         os.makedirs(explicit_temp_dir, exist_ok=True)
179     # can we interact with directory?
180     explicit_temp_dir_valid = (os.path.isdir(explicit_temp_dir) and
181         Path.touch(Path(os.path.join(explicit_temp_dir, '.can_touch'))))
182 except:
183     print('Root temporary directory cannot be used: {}. Using root: {}'.format(
184         explicit_temp_dir, RV_TEMP_DIR))
185     tempfile.tempdir = RV_TEMP_DIR # no guarantee this will work
186     make_dir(RV_TEMP_DIR)
187 finally:
188     # now, ensure uniqueness for this process
189     # the host may be running more than one rastervision process
190     RV_TEMP_DIR = tempfile.mkdtemp()
191     tempfile.tempdir = RV_TEMP_DIR
192     print('Temporary directory is: {}'.format(
193         tempfile.tempdir))
194
```
--- 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/src/rastervision/utils/files.py b/src/rastervision/utils/files.py
--- a/src/rastervision/utils/files.py
+++ b/src/rastervision/utils/files.py
@@ -12,7 +12,6 @@
 import botocore
 from google.protobuf import json_format
 
-s3 = boto3.client('s3')
 
 class NotFoundException(Exception):
     pass
@@ -84,6 +83,7 @@
 
         try:
             print('Downloading {} to {}'.format(uri, path))
+            s3 = boto3.client('s3')
             s3.download_file(parsed_uri.netloc, parsed_uri.path[1:], path)
         except botocore.exceptions.ClientError:
             if must_exist:
@@ -100,6 +100,7 @@
     parsed_uri = urlparse(file_uri)
     if parsed_uri.scheme == 's3':
         with io.BytesIO() as file_buffer:
+            s3 = boto3.client('s3')
             s3.download_fileobj(
                 parsed_uri.netloc, parsed_uri.path[1:], file_buffer)
             return file_buffer.getvalue().decode('utf-8')
@@ -114,6 +115,7 @@
         bucket = parsed_uri.netloc
         key = parsed_uri.path[1:]
         with io.BytesIO(bytes(content_str, encoding='utf-8')) as str_buffer:
+            s3 = boto3.client('s3')
             s3.upload_fileobj(str_buffer, bucket, key)
     else:
         make_dir(file_uri, use_dirname=True)
@@ -143,6 +145,7 @@
         # Strip the leading slash off of the path since S3 does not expect it.
         print('Uploading {} to {}'.format(src_path, dst_uri))
         if os.path.isfile(src_path):
+            s3 = boto3.client('s3')
             s3.upload_file(
                 src_path, parsed_uri.netloc, parsed_uri.path[1:])
         else:

{"golden_diff": "diff --git a/src/rastervision/utils/files.py b/src/rastervision/utils/files.py\n--- a/src/rastervision/utils/files.py\n+++ b/src/rastervision/utils/files.py\n@@ -12,7 +12,6 @@\n import botocore\n from google.protobuf import json_format\n \n-s3 = boto3.client('s3')\n \n class NotFoundException(Exception):\n     pass\n@@ -84,6 +83,7 @@\n \n         try:\n             print('Downloading {} to {}'.format(uri, path))\n+            s3 = boto3.client('s3')\n             s3.download_file(parsed_uri.netloc, parsed_uri.path[1:], path)\n         except botocore.exceptions.ClientError:\n             if must_exist:\n@@ -100,6 +100,7 @@\n     parsed_uri = urlparse(file_uri)\n     if parsed_uri.scheme == 's3':\n         with io.BytesIO() as file_buffer:\n+            s3 = boto3.client('s3')\n             s3.download_fileobj(\n                 parsed_uri.netloc, parsed_uri.path[1:], file_buffer)\n             return file_buffer.getvalue().decode('utf-8')\n@@ -114,6 +115,7 @@\n         bucket = parsed_uri.netloc\n         key = parsed_uri.path[1:]\n         with io.BytesIO(bytes(content_str, encoding='utf-8')) as str_buffer:\n+            s3 = boto3.client('s3')\n             s3.upload_fileobj(str_buffer, bucket, key)\n     else:\n         make_dir(file_uri, use_dirname=True)\n@@ -143,6 +145,7 @@\n         # Strip the leading slash off of the path since S3 does not expect it.\n         print('Uploading {} to {}'.format(src_path, dst_uri))\n         if os.path.isfile(src_path):\n+            s3 = boto3.client('s3')\n             s3.upload_file(\n                 src_path, parsed_uri.netloc, parsed_uri.path[1:])\n         else:\n", "issue": "Remove dependence on AWS\nThis PR makes it so that AWS isn't needed to run RV locally. Previously, if `AWS_PROFILE` was blank, it would cause an error when hitting a line that created an S3 client object. If you want to forward AWS credentials (the original behavior), you'll now need to run `./scripts/run --aws`.\r\n\r\nCloses #279 \n", "before_files": [{"content": "import io\nimport os\nfrom pathlib import Path\nimport rasterio\nimport shutil\nimport subprocess\nimport tempfile\nfrom threading import Timer\nfrom urllib.parse import urlparse\n\nimport boto3\nimport botocore\nfrom google.protobuf import json_format\n\ns3 = boto3.client('s3')\n\nclass NotFoundException(Exception):\n    pass\n\n\ndef make_dir(path, check_empty=False, force_empty=False, use_dirname=False):\n    directory = path\n    if use_dirname:\n        directory = os.path.dirname(path)\n\n    if force_empty and os.path.isdir(directory):\n        shutil.rmtree(directory)\n\n    os.makedirs(directory, exist_ok=True)\n\n    is_empty = len(os.listdir(directory)) == 0\n    if check_empty and not is_empty:\n        raise ValueError(\n            '{} needs to be an empty directory!'.format(directory))\n\n\ndef get_local_path(uri, temp_dir):\n    \"\"\"Convert a URI into a corresponding local path.\"\"\"\n    if uri is None:\n        return None\n\n    parsed_uri = urlparse(uri)\n    if parsed_uri.scheme == '':\n        path = uri\n    elif parsed_uri.scheme == 's3':\n        path = os.path.join(\n            temp_dir, 's3', parsed_uri.netloc, parsed_uri.path[1:])\n\n    return path\n\n\ndef sync_dir(src_dir, dest_uri, delete=False):\n    command = ['aws', 's3', 'sync', src_dir, dest_uri]\n    if delete:\n        command.append('--delete')\n    subprocess.run(command)\n\n\ndef _is_raster(uri, s3_test=False):\n    if s3_test:\n        uri = uri.replace('s3://', '/vsis3/')\n    try:\n        rasterio.open(uri)\n    except:\n        return False\n    return uri\n\n\ndef download_if_needed(uri, download_dir, must_exist=True):\n    \"\"\"Download a file into a directory if it's remote.\"\"\"\n    if uri is None:\n        return None\n\n    path = get_local_path(uri, download_dir)\n    make_dir(path, use_dirname=True)\n\n    parsed_uri = urlparse(uri)\n    if parsed_uri.scheme == 's3':\n\n        # is it a raster?\n        vsis3_path = _is_raster(uri, s3_test=True)\n        if vsis3_path:\n            return vsis3_path\n\n        try:\n            print('Downloading {} to {}'.format(uri, path))\n            s3.download_file(parsed_uri.netloc, parsed_uri.path[1:], path)\n        except botocore.exceptions.ClientError:\n            if must_exist:\n                raise NotFoundException('Could not find {}'.format(uri))\n    else:\n        not_found = not os.path.isfile(path)\n        if not_found and must_exist:\n            raise NotFoundException('Could not find {}'.format(uri))\n\n    return path\n\n\ndef file_to_str(file_uri):\n    parsed_uri = urlparse(file_uri)\n    if parsed_uri.scheme == 's3':\n        with io.BytesIO() as file_buffer:\n            s3.download_fileobj(\n                parsed_uri.netloc, parsed_uri.path[1:], file_buffer)\n            return file_buffer.getvalue().decode('utf-8')\n    else:\n        with open(file_uri, 'r') as file_buffer:\n            return file_buffer.read()\n\n\ndef str_to_file(content_str, file_uri):\n    parsed_uri = urlparse(file_uri)\n    if parsed_uri.scheme == 's3':\n        bucket = parsed_uri.netloc\n        key = parsed_uri.path[1:]\n        with io.BytesIO(bytes(content_str, encoding='utf-8')) as str_buffer:\n            s3.upload_fileobj(str_buffer, bucket, key)\n    else:\n        make_dir(file_uri, use_dirname=True)\n        with open(file_uri, 'w') as content_file:\n            content_file.write(content_str)\n\n\ndef load_json_config(uri, message):\n    return json_format.Parse(file_to_str(uri), message)\n\n\ndef save_json_config(message, uri):\n    json_str = json_format.MessageToJson(message)\n    str_to_file(json_str, uri)\n\n\ndef upload_if_needed(src_path, dst_uri):\n    \"\"\"Upload file or dir if the destination is remote.\"\"\"\n    if dst_uri is None:\n        return\n\n    if not (os.path.isfile(src_path) or os.path.isdir(src_path)):\n        raise Exception('{} does not exist.'.format(src_path))\n\n    parsed_uri = urlparse(dst_uri)\n    if parsed_uri.scheme == 's3':\n        # Strip the leading slash off of the path since S3 does not expect it.\n        print('Uploading {} to {}'.format(src_path, dst_uri))\n        if os.path.isfile(src_path):\n            s3.upload_file(\n                src_path, parsed_uri.netloc, parsed_uri.path[1:])\n        else:\n            sync_dir(src_path, dst_uri, delete=True)\n\n\ndef start_sync(output_dir, output_uri, sync_interval=600):\n    \"\"\"Start periodically syncing a directory.\"\"\"\n    def _sync_dir(delete=True):\n        sync_dir(output_dir, output_uri, delete=delete)\n        thread = Timer(sync_interval, _sync_dir)\n        thread.daemon = True\n        thread.start()\n\n    if urlparse(output_uri).scheme == 's3':\n        # On first sync, we don't want to delete files on S3 to match\n        # th contents of output_dir since there's nothing there yet.\n        _sync_dir(delete=False)\n\n# Ensure that RV temp directory exists. We need to use a custom location for\n# the temporary directory so it will be mirrored on the host file system which\n# is needed for running in a Docker container with limited space on EC2.\nRV_TEMP_DIR = '/opt/data/tmp/'\n\n# find explicitly set tempdir\nexplicit_temp_dir = next(iter([\n    os.environ.get(k) for k in ['TMPDIR', 'TEMP', 'TMP'] if k in os.environ] +\n    [tempfile.tempdir]))\n\ntry:\n    # try to create directory\n    if not os.path.exists(explicit_temp_dir):\n        os.makedirs(explicit_temp_dir, exist_ok=True)\n    # can we interact with directory?\n    explicit_temp_dir_valid = (os.path.isdir(explicit_temp_dir) and\n        Path.touch(Path(os.path.join(explicit_temp_dir, '.can_touch'))))\nexcept:\n    print('Root temporary directory cannot be used: {}. Using root: {}'.format(\n        explicit_temp_dir, RV_TEMP_DIR))\n    tempfile.tempdir = RV_TEMP_DIR # no guarantee this will work\n    make_dir(RV_TEMP_DIR)\nfinally:\n    # now, ensure uniqueness for this process\n    # the host may be running more than one rastervision process\n    RV_TEMP_DIR = tempfile.mkdtemp()\n    tempfile.tempdir = RV_TEMP_DIR\n    print('Temporary directory is: {}'.format(\n        tempfile.tempdir))\n", "path": "src/rastervision/utils/files.py"}], "after_files": [{"content": "import io\nimport os\nfrom pathlib import Path\nimport rasterio\nimport shutil\nimport subprocess\nimport tempfile\nfrom threading import Timer\nfrom urllib.parse import urlparse\n\nimport boto3\nimport botocore\nfrom google.protobuf import json_format\n\n\nclass NotFoundException(Exception):\n    pass\n\n\ndef make_dir(path, check_empty=False, force_empty=False, use_dirname=False):\n    directory = path\n    if use_dirname:\n        directory = os.path.dirname(path)\n\n    if force_empty and os.path.isdir(directory):\n        shutil.rmtree(directory)\n\n    os.makedirs(directory, exist_ok=True)\n\n    is_empty = len(os.listdir(directory)) == 0\n    if check_empty and not is_empty:\n        raise ValueError(\n            '{} needs to be an empty directory!'.format(directory))\n\n\ndef get_local_path(uri, temp_dir):\n    \"\"\"Convert a URI into a corresponding local path.\"\"\"\n    if uri is None:\n        return None\n\n    parsed_uri = urlparse(uri)\n    if parsed_uri.scheme == '':\n        path = uri\n    elif parsed_uri.scheme == 's3':\n        path = os.path.join(\n            temp_dir, 's3', parsed_uri.netloc, parsed_uri.path[1:])\n\n    return path\n\n\ndef sync_dir(src_dir, dest_uri, delete=False):\n    command = ['aws', 's3', 'sync', src_dir, dest_uri]\n    if delete:\n        command.append('--delete')\n    subprocess.run(command)\n\n\ndef _is_raster(uri, s3_test=False):\n    if s3_test:\n        uri = uri.replace('s3://', '/vsis3/')\n    try:\n        rasterio.open(uri)\n    except:\n        return False\n    return uri\n\n\ndef download_if_needed(uri, download_dir, must_exist=True):\n    \"\"\"Download a file into a directory if it's remote.\"\"\"\n    if uri is None:\n        return None\n\n    path = get_local_path(uri, download_dir)\n    make_dir(path, use_dirname=True)\n\n    parsed_uri = urlparse(uri)\n    if parsed_uri.scheme == 's3':\n\n        # is it a raster?\n        vsis3_path = _is_raster(uri, s3_test=True)\n        if vsis3_path:\n            return vsis3_path\n\n        try:\n            print('Downloading {} to {}'.format(uri, path))\n            s3 = boto3.client('s3')\n            s3.download_file(parsed_uri.netloc, parsed_uri.path[1:], path)\n        except botocore.exceptions.ClientError:\n            if must_exist:\n                raise NotFoundException('Could not find {}'.format(uri))\n    else:\n        not_found = not os.path.isfile(path)\n        if not_found and must_exist:\n            raise NotFoundException('Could not find {}'.format(uri))\n\n    return path\n\n\ndef file_to_str(file_uri):\n    parsed_uri = urlparse(file_uri)\n    if parsed_uri.scheme == 's3':\n        with io.BytesIO() as file_buffer:\n            s3 = boto3.client('s3')\n            s3.download_fileobj(\n                parsed_uri.netloc, parsed_uri.path[1:], file_buffer)\n            return file_buffer.getvalue().decode('utf-8')\n    else:\n        with open(file_uri, 'r') as file_buffer:\n            return file_buffer.read()\n\n\ndef str_to_file(content_str, file_uri):\n    parsed_uri = urlparse(file_uri)\n    if parsed_uri.scheme == 's3':\n        bucket = parsed_uri.netloc\n        key = parsed_uri.path[1:]\n        with io.BytesIO(bytes(content_str, encoding='utf-8')) as str_buffer:\n            s3 = boto3.client('s3')\n            s3.upload_fileobj(str_buffer, bucket, key)\n    else:\n        make_dir(file_uri, use_dirname=True)\n        with open(file_uri, 'w') as content_file:\n            content_file.write(content_str)\n\n\ndef load_json_config(uri, message):\n    return json_format.Parse(file_to_str(uri), message)\n\n\ndef save_json_config(message, uri):\n    json_str = json_format.MessageToJson(message)\n    str_to_file(json_str, uri)\n\n\ndef upload_if_needed(src_path, dst_uri):\n    \"\"\"Upload file or dir if the destination is remote.\"\"\"\n    if dst_uri is None:\n        return\n\n    if not (os.path.isfile(src_path) or os.path.isdir(src_path)):\n        raise Exception('{} does not exist.'.format(src_path))\n\n    parsed_uri = urlparse(dst_uri)\n    if parsed_uri.scheme == 's3':\n        # Strip the leading slash off of the path since S3 does not expect it.\n        print('Uploading {} to {}'.format(src_path, dst_uri))\n        if os.path.isfile(src_path):\n            s3 = boto3.client('s3')\n            s3.upload_file(\n                src_path, parsed_uri.netloc, parsed_uri.path[1:])\n        else:\n            sync_dir(src_path, dst_uri, delete=True)\n\n\ndef start_sync(output_dir, output_uri, sync_interval=600):\n    \"\"\"Start periodically syncing a directory.\"\"\"\n    def _sync_dir(delete=True):\n        sync_dir(output_dir, output_uri, delete=delete)\n        thread = Timer(sync_interval, _sync_dir)\n        thread.daemon = True\n        thread.start()\n\n    if urlparse(output_uri).scheme == 's3':\n        # On first sync, we don't want to delete files on S3 to match\n        # th contents of output_dir since there's nothing there yet.\n        _sync_dir(delete=False)\n\n# Ensure that RV temp directory exists. We need to use a custom location for\n# the temporary directory so it will be mirrored on the host file system which\n# is needed for running in a Docker container with limited space on EC2.\nRV_TEMP_DIR = '/opt/data/tmp/'\n\n# find explicitly set tempdir\nexplicit_temp_dir = next(iter([\n    os.environ.get(k) for k in ['TMPDIR', 'TEMP', 'TMP'] if k in os.environ] +\n    [tempfile.tempdir]))\n\ntry:\n    # try to create directory\n    if not os.path.exists(explicit_temp_dir):\n        os.makedirs(explicit_temp_dir, exist_ok=True)\n    # can we interact with directory?\n    explicit_temp_dir_valid = (os.path.isdir(explicit_temp_dir) and\n        Path.touch(Path(os.path.join(explicit_temp_dir, '.can_touch'))))\nexcept:\n    print('Root temporary directory cannot be used: {}. Using root: {}'.format(\n        explicit_temp_dir, RV_TEMP_DIR))\n    tempfile.tempdir = RV_TEMP_DIR # no guarantee this will work\n    make_dir(RV_TEMP_DIR)\nfinally:\n    # now, ensure uniqueness for this process\n    # the host may be running more than one rastervision process\n    RV_TEMP_DIR = tempfile.mkdtemp()\n    tempfile.tempdir = RV_TEMP_DIR\n    print('Temporary directory is: {}'.format(\n        tempfile.tempdir))\n", "path": "src/rastervision/utils/files.py"}]}