def METHOD_NAME(record_id,
                       filename,
                       download_url,
                       size=None,
                       auth_headers=None):
    """Download a single file from a git repo under record files."""
    response = requests.get(download_url, stream=True,
                            headers=auth_headers).raw
    response.decode_content = True
    size = size or int(response.headers.get('Content-Length'))
    from cap.modules.deposit.api import CAPDeposit
    record = CAPDeposit.get_record(record_id)
    # temporary workaround, we save empty file, when downloading failed
    # so we can show it in UI (with tag FAILED)
    failed = True if response.status != 200 else False
    if failed:
        print(f'Downloading content from {download_url}'
              f'failed ({response.status}).')
    record.save_file(response, filename, size, failed)