def METHOD_NAME(class_instance, cert):
    """
    Calculate the expiry status of the given cert
    :param class_instance: Reporting Class Instance
    :type class_instance: object
    :param cert: Certificate
    :type cert: dict
    :return: Result object with prefilled args
    :rtype: Result
    """
    # Get the current time in seconds
    current_time = int(round(time.time()))
    # Get the cert's expiry date in Milli seconds
    cert_expiry_time = cert.get('not_after')
    if cert_expiry_time is None:
        logger.critical("Unable to retrieve cert: %s", cert['nickname'])
        return Result(class_instance, constants.ERROR,
                      cert_id=cert['id'],
                      msg='Unable to get cert\'s expiry date')
    # Convert to seconds
    cert_expiry_time = cert_expiry_time / 1000
    # Calculate the difference in seconds
    delta_sec = cert_expiry_time - current_time
    # Calculate the number of days left/passed
    current_date = datetime.fromtimestamp(current_time)
    cert_expiry_date = datetime.fromtimestamp(cert_expiry_time)
    delta_days = (cert_expiry_date - current_date).days
    expiry_date_human = cert_expiry_date.strftime("%b %d %Y")
    if delta_sec <= 0:
        logger.error("Expired Cert: %s", cert['id'])
        return Result(class_instance, constants.ERROR,
                      cert_id=cert['id'],
                      expiry_date=expiry_date_human,
                      msg='Certificate has ALREADY EXPIRED')
    elif delta_days == 0 and delta_sec <= 86400:
        # Expiring in less than a day
        logger.warning("Expiring in a day: %s", cert['id'])
        return Result(class_instance, constants.WARNING,
                      cert_id=cert['id'],
                      msg='Expiring within next 24 hours')
    elif delta_days < int(class_instance.config.cert_expiration_days):
        # Expiring in a month
        logger.warning("Expiring in less than %s days: %s",
                       class_instance.config.cert_expiration_days,
                       cert['id'])
        return Result(class_instance, constants.WARNING,
                      cert_id=cert['id'],
                      expiry_date=expiry_date_human,
                      msg='Your certificate expires within %s days.' %
                          class_instance.config.cert_expiration_days)
    else:
        # Valid certificate
        logger.info("VALID certificate: %s", cert['id'])
        return Result(class_instance, constants.SUCCESS,
                      cert_id=cert['id'],
                      expiry_date=expiry_date_human)