parameters: (self, topup)
return_statement: return max(10, min((ORG_CREDITS_CACHE_TTL, int((topup.expires_on - timezone.now()).total_seconds()))))
docstring: Gets how long metrics based on the given topup should live. Returns the shorter ttl of
          either ORG_CREDITS_CACHE_TTL or time remaining on the expiration
docstring_summary: Gets how long metrics based on the given topup should live. Returns the shorter ttl of
          either ORG_CREDITS_CACHE_TTL or time remaining on the expiration
docstring_tokens: Gets how long metrics based on the given topup should live . Returns the shorter ttl of either ORG_CREDITS_CACHE_TTL or time remaining on the expiration
function: def get_topup_ttl(self, topup):
          """
          Gets how long metrics based on the given topup should live. Returns the shorter ttl of
          either ORG_CREDITS_CACHE_TTL or time remaining on the expiration
          """
          if not topup:
              return 10
  
          return max(10, min((ORG_CREDITS_CACHE_TTL, int((topup.expires_on - timezone.now()).total_seconds()))))
function_tokens: def get_topup_ttl ( self , topup ) : if not topup : return 10 return max ( 10 , min ( ( ORG_CREDITS_CACHE_TTL , int ( ( topup . expires_on - timezone . now ( ) ) . total_seconds ( ) ) ) ) )