def get_download_url(self, duration=None, preauthenticated=False, filename=None, project=None, **kwargs):
        # Test hook to write 'project' argument passed to API call to a
        # local file
        if '_DX_DUMP_BILLED_PROJECT' in os.environ:
            with open(os.environ['_DX_DUMP_BILLED_PROJECT'], "w") as fd:
                if project is not None:
                    fd.write(project)

        args = {"preauthenticated": preauthenticated}

        if duration is not None:
            args["duration"] = duration
        if filename is not None:
            args["filename"] = filename

        using_dxfile_project = False
        if project is not None:
            args["project"] = project
        elif self.get_proj_id() is not None:
            args["project"] = self.get_proj_id()
            using_dxfile_project = True

        with self._url_download_mutex:
            if self._download_url is None or self._download_url_expires < time.time():
                # The idea here is to cache a download URL for the entire file, that will
                # be good for a few minutes. This avoids each thread having to ask the
                # server for a URL, increasing server load.
                #
                # To avoid thread race conditions, this check/update procedure is protected
                # with a lock.

                # logging.debug("Download URL unset or expired, requesting a new one")
                if "timeout" not in kwargs:
                    kwargs["timeout"] = FILE_REQUEST_TIMEOUT

                resp = {}
                try:
                    resp = dxpy.api.file_download(self._dxid, args, **kwargs)
                except dxpy.exceptions.ResourceNotFound as e:
                    if "project" in args and using_dxfile_project:
                        warn("=== WARNING ===")
                        warn(e)
                        warn("Will try to find the file in other projects.")
                        args.pop("project")
                        resp = dxpy.api.file_download(self._dxid, args, **kwargs)
                    else:
                        raise e

                self._download_url = resp["url"]
                self._download_url_headers = _validate_headers(resp.get("headers", {}))
                if preauthenticated:
                    self._download_url_expires = resp["expires"]/1000 - 60  # Try to account for drift
                else:
                    self._download_url_expires = 32503680000  # doesn't expire (year 3000)

            # Make a copy, ensuring each thread has its own mutable
            # version of the headers.  Note: python strings are
            # immutable, so we can safely give a reference to the
            # download url.
            retval_download_url = self._download_url
            retval_download_url_headers = copy.copy(self._download_url_headers)

        return retval_download_url, retval_download_url_headers
tests False function not deleted.
dataset/ETHPy150Open dnanexus/dx-toolkit/src/python/dxpy/bindings/dxfile.py/DXFile.get_download_url--crossover with--dataset/ETHPy150Open saltstack/salt/tests/unit/modules/boto_lambda_test.py/BotoLambdaFunctionTestCase.test_that_when_deleting_a_function_fails_the_delete_function_method_returns_false