def get_artifact(suppress_status=False, nexus_url=sample_nexus_url, timeout_sec=600, overwrite=True,
                 username=None, password=None, **kwargs):
    """Retrieves an artifact from Nexus

    :param suppress_status: (bool) Set to True to suppress printing download status
    :param nexus_url: (str) URL of the Nexus Server
    :param timeout_sec: (int) Number of seconds to wait before
        timing out the artifact retrieval.
    :param overwrite: (bool) True overwrites the file on the local system if it exists,
        False does will log an INFO message and exist if the file already exists
    :param username: (str) username for basic auth
    :param password: (str) password for basic auth
    :param kwargs:
        group_id: (str) The artifact's Group ID in Nexus
        artifact_id: (str) The artifact's Artifact ID in Nexus
        packaging: (str) The artifact's packaging (e.g. war, zip)
        version: (str) Version of the artifact to retrieve (e.g.
            LATEST, 4.8.4, 4.9.0-SNAPSHOT)
        destination_dir: (str) Full path to the destination directory
        classifier: (str) The artifact's classifier (e.g. bin)
    :return: None
    :raises: TypeError, ValueError, OSError, RuntimeError
    """
    log = logging.getLogger(mod_logger + '.get_artifact')

    required_args = ['group_id', 'artifact_id', 'packaging', 'version', 'destination_dir']

    if not isinstance(overwrite, bool):
        msg = 'overwrite arg must be a string, found: {t}'.format(t=overwrite.__class__.__name__)
        log.error(msg)
        raise TypeError(msg)

    if not isinstance(nexus_url, basestring):
        msg = 'nexus_url arg must be a string, found: {t}'.format(t=nexus_url.__class__.__name__)
        log.error(msg)
        raise TypeError(msg)

    log.debug('Using Nexus Server URL: {u}'.format(u=nexus_url))

    # Ensure the required args are supplied, and that they are all strings
    for required_arg in required_args:
        try:
            assert required_arg in kwargs
        except AssertionError:
            _, ex, trace = sys.exc_info()
            msg = 'A required arg was not supplied. Required args are: group_id, artifact_id, classifier, version, ' \
                  'packaging and destination_dir\n{e}'.format(e=str(ex))
            log.error(msg)
            raise ValueError(msg)
        if not isinstance(kwargs[required_arg], basestring):
            msg = 'Arg {a} should be a string'.format(a=required_arg)
            log.error(msg)
            raise TypeError(msg)

    # Set variables to be used in the REST call
    group_id = kwargs['group_id']
    artifact_id = kwargs['artifact_id']
    version = kwargs['version']
    packaging = kwargs['packaging']
    destination_dir = kwargs['destination_dir']

    # Ensure the destination directory exists
    if not os.path.isdir(destination_dir):
        log.debug('Specified destination_dir not found on file system, creating: {d}'.format(d=destination_dir))
        try:
            mkdir_p(destination_dir)
        except CommandError:
            _, ex, trace = sys.exc_info()
            msg = 'Unable to create destination directory: {d}\n{e}'.format(d=destination_dir, e=str(ex))
            raise OSError(msg)

    # Set the classifier if it was provided
    classifier = None
    if 'classifier' in kwargs:
        if isinstance(kwargs['classifier'], basestring):
            classifier = kwargs['classifier']
            log.debug('Using classifier: {c}'.format(c=classifier))
        else:
            log.warn('Arg classifier provided but it was not an instance of basestring')

    # Set the repo if it was provided
    repo = None
    if 'repo' in kwargs:
        if isinstance(kwargs['repo'], basestring):
            repo = kwargs['repo']
            log.debug('Using repo: {r}'.format(r=repo))

    # Determine the repo based on the version
    if repo is None:
        repo_test = version.lower().strip()
        log.debug('Checking if the version {v} is a release or snapshot...'.format(v=repo_test))
        # Determine the repo based on the version
        if ('snapshot' in repo_test) or (repo_test == 'latest'):
            repo = 'snapshots'
        else:
            repo = 'releases'
        log.info('Based on the version {v}, determined repo: {r}'.format(v=version, r=repo))

    # Construct the parameter string
    params = 'g=' + group_id + '&a=' + artifact_id + '&v=' + version + '&r=' + repo + '&p=' + packaging

    # Add the classifier if it was provided
    if classifier is not None:
        params = params + '&c=' + classifier

    # Determine the auth based on username and password
    basic_auth = None
    if (username is not None) and (password is not None):
        log.info('Using the provided username/password for basic authentication...')
        basic_auth = HTTPBasicAuth(username, password)

    # Build the query URL
    query_url = nexus_url + '?' + params

    # Set up for download attempts
    retry_sec = 5
    max_retries = 6
    try_num = 1
    download_success = False
    dl_err = None
    failed_attempt = False

    # Start the retry loop
    while try_num <= max_retries:

        # Break the loop if the download was successful
        if download_success:
            break

        log.info('Attempting to query Nexus for the Artifact using URL:  {u}'.format(u=query_url))
        try:
            nexus_response = query_nexus(query_url=query_url, timeout_sec=timeout_sec, basic_auth=basic_auth)
        except RuntimeError:
            _, ex, trace = sys.exc_info()
            msg = '{n}: There was a problem querying Nexus URL: {u}\n{e}'.format(
                n=ex.__class__.__name__, u=query_url, e=str(ex))
            log.error(msg)
            raise RuntimeError, msg, trace

        # Attempt to get the content-length
        file_size = 0
        try:
            file_size = int(nexus_response.headers['Content-Length'])
        except(KeyError, ValueError):
            log.debug('Could not get Content-Length, suppressing download status...')
            suppress_status = True
        else:
            log.info('Artifact file size: {s}'.format(s=file_size))

        # Determine the full download file path
        file_name = nexus_response.url.split('/')[-1]
        download_file = os.path.join(destination_dir, file_name)

        # Attempt to download the content from the response
        log.info('Attempting to download content of size {s} from Nexus to file: {d}'.format(
            s=file_size, d=download_file))

        # Remove the existing file if it exists, or exit if the file exists, overwrite is set,
        # and there was not a previous failed attempted download
        if os.path.isfile(download_file) and overwrite:
            log.debug('File already exists, removing: {d}'.format(d=download_file))
            os.remove(download_file)
        elif os.path.isfile(download_file) and not overwrite and not failed_attempt:
            log.info('File already downloaded, and overwrite is set to False.  The Artifact will '
                     'not be retrieved from Nexus: {f}.  To overwrite the existing downloaded file, '
                     'set overwrite=True'.format(f=download_file))
            return

        # Attempt to download content
        log.debug('Attempt # {n} of {m} to download content from the Nexus response'.format(n=try_num, m=max_retries))
        chunk_size = 1024
        file_size_dl = 0
        try:
            with open(download_file, 'wb') as f:
                for chunk in nexus_response.iter_content(chunk_size=chunk_size):
                    if chunk:
                        f.write(chunk)
                        file_size_dl += len(chunk)
                        status = r"%10d  [%3.2f%%]" % (file_size_dl, file_size_dl * 100. / file_size)
                        status += chr(8)*(len(status)+1)
                        if not suppress_status:
                            print(status),
        except(requests.exceptions.ConnectionError, requests.exceptions.RequestException, OSError):
            _, ex, trace = sys.exc_info()
            dl_err = '{n}: There was an error reading content from the Nexus response. Downloaded ' \
                     'size: {s}.\n{e}'.format(n=ex.__class__.__name__, s=file_size_dl, t=retry_sec, e=str(ex))
            failed_attempt = True
            log.warn(dl_err)
            if try_num < max_retries:
                log.info('Retrying download in {t} sec...'.format(t=retry_sec))
                time.sleep(retry_sec)
        else:
            log.info('File download of size {s} completed without error: {f}'.format(s=file_size_dl, f=download_file))
            failed_attempt = False
            download_success = True
        try_num += 1

    # Raise an exception if the download did not complete successfully
    if not download_success:
        msg = 'Unable to download file content from Nexus after {n} attempts'.format(n=max_retries)
        if dl_err:
            msg += '\n{m}'.format(m=dl_err)
        log.error(msg)
        raise RuntimeError(msg)
Retrieves an artifact from Nexus

    :param suppress_status: (bool) Set to True to suppress printing download status
    :param nexus_url: (str) URL of the Nexus Server
    :param timeout_sec: (int) Number of seconds to wait before
        timing out the artifact retrieval.
    :param overwrite: (bool) True overwrites the file on the local system if it exists,
        False does will log an INFO message and exist if the file already exists
    :param username: (str) username for basic auth
    :param password: (str) password for basic auth
    :param kwargs:
        group_id: (str) The artifact's Group ID in Nexus
        artifact_id: (str) The artifact's Artifact ID in Nexus
        packaging: (str) The artifact's packaging (e.g. war, zip)
        version: (str) Version of the artifact to retrieve (e.g.
            LATEST, 4.8.4, 4.9.0-SNAPSHOT)
        destination_dir: (str) Full path to the destination directory
        classifier: (str) The artifact's classifier (e.g. bin)
    :return: None
    :raises: TypeError, ValueError, OSError, RuntimeError