def _calc_num_themes_checkout(locks):
 current_num = locks.count()
 if (current_num < rvw.THEME_INITIAL_LOCKS):
  return ((rvw.THEME_INITIAL_LOCKS - current_num), [])
 else:
  locks.update(expiry=get_updated_expiry())
  return (0, [lock.theme for lock in locks])

def _calc_num_themes_checkout ( locks ) : current_num = locks . count ( ) if ( current_num < rvw . THEME_INITIAL_LOCKS ) : return ( ( rvw . THEME_INITIAL_LOCKS - current_num ) , [ ] ) else : locks . update ( expiry = get_updated_expiry ( ) ) return ( 0 , [ lock . theme for lock in locks ] )
calculate number of themes to check out based on how many themes user currently has checked out .