Get a listing of top charts for a top chart genre.

		Parameters:
			genre_id (str): A top chart genre ID as found with :meth:`top_charts_genres`.
329813
def top_charts_for_genre(self, genre_id):
		

		response = self._call(mc_calls.BrowseTopChartForGenre, genre_id)
		top_chart_for_genre = response.body

		return top_chart_for_genre
126814
def playlist_category(self):
        
        url = 'https://openapi.youku.com/v2/schemas/playlist/category.json'
        r = requests.get(url)
        check_error(r)
        return r.json()
826790
def find_playlist_by_id(self, playlist_id):
        
        url = 'https://openapi.youku.com/v2/playlists/show.json'
        params = {
            'client_id': self.client_id,
            'playlist_id': playlist_id
        }
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
111856
def songs(self):
        
        if self._songs is None:
            self._songs = [Song.from_response(song, self._connection) for song in
                           self._connection.request(
                               'artistGetArtistSongs',
                               {'artistID': self.id},
                               self._connection.header('artistGetArtistSongs'))[1]]
        return iter(self._songs)
1268014
def get_chart(self, id, **kwargs):
        "
        resp = self._get_object_by_name(self._CHART_ENDPOINT_SUFFIX, id,
                                        **kwargs)
        return resp
476681
def browse_podcasts(self, podcast_genre_id='JZCpodcasttopchartall'):
		

		response = self._call(
			mc_calls.PodcastBrowse,
			podcast_genre_id=podcast_genre_id
		)
		podcast_series_list = response.body.get('series', [])

		return podcast_series_list
440058
def get_metadata(file_name, client_id, client_secret):
    

    song_name = improve_name(file_name)  # Remove useless words from title
    client_credentials_manager = SpotifyClientCredentials(client_id, client_secret)

    spotify = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
    results = spotify.search(song_name, limit=1)

    results = results['tracks']['items'][0]  # Find top result
    album = results['album']['name']  # Parse json dictionary
    artist = results['album']['artists'][0]['name']
    song_title = results['name']
    album_art = results['album']['images'][0]['url']

    return artist, album, song_title, album_art
826083
def get_artist_songs(self, id_, sort='title', per_page=20, page=1):
        """"""
        endpoint = "artists/{id}/songs".format(id=id_)
        params = {'sort': sort, 'per_page': per_page, 'page': page}
        return self._make_request(endpoint, params_=params)
811495
def popular_songs(type = 'daily')
      fail ArgumentError, 'Invalid type' unless %w(daily monthly).include?(type)
      request('popularGetSongs', type: type)['songs'].map { |s| Song.new(s) }
    end
402421
def get_album_songs(self, album_id):
        

        url = 'http://music.163.com/api/album/{}/'.format(album_id)
        result = self.get_request(url)

        songs = result['album']['songs']
        songs = [Song(song['id'], song['name']) for song in songs]
        return songs
156969
def popular_content(**kwargs):
    
    limit = kwargs.get("limit", DEFAULT_LIMIT)
    popular_ids = get_popular_ids(limit=limit)
    if not popular_ids:
        # Return most recent content
        return Content.search_objects.search().extra(size=limit)
    return Content.search_objects.search().filter(es_filter.Ids(values=popular_ids))
1093717
def get_by_id(self, style_id, style_type = None):
        

        for st in self.styles.values():
            if st:
                if st.style_id == style_id:
                    return st

        if style_type:
            return self.styles.get(self.default_styles[style_type], None)
        return None
674058
def list(self, ids, market=values.UNSET):
        
        params = values.of({
            'ids': ','.join(ids),
            'market': market
        })
        response = self.version.request('GET', '/albums', params=params)
        return AlbumPage(self.version, response.json(), 'albums')
605446
def get_series_by_id(self, series_id):
        
        series = trakt.Trakt['search'].lookup(series_id, 'trakt-show')
        if not series:
            return None, 'Not Found'
        return series, None
432954
def search_keyword_top(self, category=None, count=20, period='today'):
        
        url = 'https://openapi.youku.com/v2/searches/keyword/top.json'
        params = {
            'client_id': self.client_id,
            'count': count,
            'period': period
        }
        if category:
            params['category'] = category
        r = requests.get(url, params=params)
        check_error(r)
        return r.json()
1167347
def get_movielens_item_metadata(use_item_ids):
    

    features = {}
    genre_set = set()

    for line in _get_movie_raw_metadata():

        if not line:
            continue

        splt = line.split('|')
        item_id = int(splt[0])

        genres = [idx for idx, val in
                  zip(range(len(splt[5:])), splt[5:])
                  if int(val) > 0]

        if use_item_ids:
            # Add item-specific features too
            genres.append(item_id)

        for genre_id in genres:
            genre_set.add(genre_id)

        features[item_id] = genres

    mat = sp.lil_matrix((len(features) + 1,
                         len(genre_set)),
                        dtype=np.int32)

    for item_id, genre_ids in features.items():
        for genre_id in genre_ids:
            mat[item_id, genre_id] = 1

    return mat
511789
def find_by_reference_ids(reference_ids, connection=None, page_size=100,
        page_number=0, sort_by=DEFAULT_SORT_BY, sort_order=DEFAULT_SORT_ORDER):
        
        reference_ids = ','.join([str(i) for i in reference_ids])
        return pybrightcove.connection.ItemResultSet(
            "find_playlists_by_reference_ids", Playlist, connection, page_size,
            page_number, sort_by, sort_order, reference_ids=reference_ids)