def classify_cert(cert_meta, now, time_remaining, expire_window, cert_list):
 expiry_str = str(cert_meta['expiry'])
 if (cert_meta['expiry'] < now):
  cert_meta['health'] = 'expired'
 elif (time_remaining < expire_window):
  cert_meta['health'] = 'warning'
 else:
  cert_meta['health'] = 'ok'
 cert_meta['expiry'] = expiry_str
 cert_meta['serial_hex'] = hex(int(cert_meta['serial']))
 cert_list.append(cert_meta)
 return cert_list

def classify_cert ( cert_meta , now , time_remaining , expire_window , cert_list ) : expiry_str = str ( cert_meta [ 'expiry' ] ) if ( cert_meta [ 'expiry' ] < now ) : cert_meta [ 'health' ] = 'expired' elif ( time_remaining < expire_window ) : cert_meta [ 'health' ] = 'warning' else : cert_meta [ 'health' ] = 'ok' cert_meta [ 'expiry' ] = expiry_str cert_meta [ 'serial_hex' ] = hex ( int ( cert_meta [ 'serial' ] ) ) cert_list . append ( cert_meta ) return cert_list
given metadata about a certificate under examination .