def get_file(self, url, path_or_file=None, headers=None, filename=None):
path_or_file = path_or_file or filename<EOL>if self.debug:<EOL><INDENT>print("<STR_LIT>" % (url, headers))<EOL><DEDENT>self.headers = self._get_default_headers()<EOL>if headers is not None:<EOL><INDENT>self.headers.update(headers)<EOL><DEDENT>response = requests.get(url, headers=self.headers, auth=self.auth, verify=self.verify_ssl)<EOL>self.http_status_code = response.status_code<EOL>try:<EOL><INDENT>self._check_error(response)<EOL>try:<EOL><INDENT>path_or_file.write(response.content)<EOL><DEDENT>except AttributeError:<EOL><INDENT>fd = os.open(path_or_file, os.O_CREAT | os.O_RDWR)<EOL>with os.fdopen(fd, "<STR_LIT>") as f:<EOL><INDENT>f.write(response.content)<EOL><DEDENT><DEDENT><DEDENT>except:<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>
Get a file from a url and save it as `filename`

        Args:
            url (str): URL to send the request to

            path_or_file (str or file): A writable File-like object or a path to save the file to.

            filename (str): [DEPRECATED] File name to save the file as, this can be either
                a full path or a relative path

            headers (str, optional): custom headers

        Returns:
            True if file is downloaded and written successfully, False
            otherwise.