def get_from_sample(sample, key):
    """
    Get the value of the key in a Sample instance. If fail to access, print out the message.

    Parameters
    ----------
    sample
        A Sample object.

    key : basestring
        The name of the key.

    Returns
    -------
    value
        The result of sample.get(key).
    """
    value = sample.get(key)
    if not value:
        print(
            "INFO: The sample '{}' does not have key '{}'.".format(sample.get('sample_name'), key)
        )
    return value