parameters: (session, time_range, strategy)
return_statement: return wrapped
docstring: Gets scorable data, scores and sorts, then returns full unpopulated playlists.
      Returns a function, because this is used in a Redis cache hook
docstring_summary: Gets scorable data, scores and sorts, then returns full unpopulated playlists.
      Returns a function, because this is used in a Redis cache hook
docstring_tokens: Gets scorable data scores and sorts then returns full unpopulated playlists . Returns a function because this is used in a Redis cache hook
function: def make_get_unpopulated_playlists(session, time_range, strategy):
      """Gets scorable data, scores and sorts, then returns full unpopulated playlists.
      Returns a function, because this is used in a Redis cache hook"""
  
      def wrapped():
          playlist_scoring_data = get_scorable_playlist_data(
              session, time_range, strategy
          )
  
          # score the playlists
          scored_playlists = [
              strategy.get_track_score(time_range, playlist)
              for playlist in playlist_scoring_data
          ]
          sorted_playlists = sorted(
              scored_playlists, key=lambda k: k["score"], reverse=True
          )
  
          # Get the unpopulated playlist metadata
          playlist_ids = [playlist["playlist_id"] for playlist in sorted_playlists]
          playlists = get_unpopulated_playlists(session, playlist_ids)
  
          playlist_tracks_map = get_playlist_tracks(session, {"playlists": playlists})
  
          for playlist in playlists:
              playlist["tracks"] = playlist_tracks_map.get(playlist["playlist_id"], [])
  
          return (playlists, playlist_ids)
  
      return wrapped
function_tokens: def make_get_unpopulated_playlists ( session , time_range , strategy ) : def wrapped ( ) : playlist_scoring_data = get_scorable_playlist_data ( session , time_range , strategy ) # score the playlists scored_playlists = [ strategy . get_track_score ( time_range , playlist ) for playlist in playlist_scoring_data ] sorted_playlists = sorted ( scored_playlists , key = lambda k : k [ "score" ] , reverse = True ) # Get the unpopulated playlist metadata playlist_ids = [ playlist [ "playlist_id" ] for playlist in sorted_playlists ] playlists = get_unpopulated_playlists ( session , playlist_ids ) playlist_tracks_map = get_playlist_tracks ( session , { "playlists" : playlists } ) for playlist in playlists : playlist [ "tracks" ] = playlist_tracks_map . get ( playlist [ "playlist_id" ] , [ ] ) return ( playlists , playlist_ids ) return wrapped