

def _get_file_and_save_it_to(self, file_path, directory=None):
    'Obtains a file from `file_path` and saves it to `directory`.\n\n        :param str file_path: Path to the file to be downloaded.\n        :param str directory: Directory in which the file will be stored.\n\n        :returns: Path to the saved file (`str`).\n\n        If `directory` is ``None``, the current working directory is used.\n        '
    directory = (directory or os.getcwd())
    with contextlib.closing(self._conn.get_file(dst_path)) as src:
        dst_path = os.path.join(directory, src.name)
        with open(dst_path, 'wb') as dst:
            shutil.copyfileobj(src, dst)
            return dst_path

dataset/ETHPy150Open s3rvac/retdec-python/retdec/resource.py Resource._get_file_and_save_it_to/VarMisuse@41/187 `file_path`->`dst_path`