def _get_file_and_save_it_to(self, file_path, directory=None):
        """Obtains a file from `file_path` and saves it to `directory`.

        :param str file_path: Path to the file to be downloaded.
        :param str directory: Directory in which the file will be stored.

        :returns: Path to the saved file (`str`).

        If `directory` is ``None``, the current working directory is used.
        """
        directory = directory or os.getcwd()
        with contextlib.closing(self._conn.get_file(file_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/original