Get a user's all playlists.

        warning: login is required for private playlist.
        :params user_id: user id.
        :params limit: playlist count returned by weapi.
        :return: a Playlist Object.
420186
def get_user_playlists(self, user_id, limit=1000):
        

        url = 'http://music.163.com/weapi/user/playlist?csrf_token='
        csrf = ''
        params = {'offset': 0, 'uid': user_id, 'limit': limit,
                  'csrf_token': csrf}
        result = self.post_request(url, params)
        playlists = result['playlist']
        return self.display.select_one_playlist(playlists)
450020
def get_users_by_ids(self, user_ids):
        
        urls = [urljoin(self.user_url, F"{i}.json") for i in user_ids]
        result = self._run_async(urls=urls)
        return [User(r) for r in result if r]
537136
def get_playlist(id)
      result = playlists.select { |p| p.id == id }
      result.nil? ? nil : result.first
    end
21403
def get_artists(self, limit=50, cacheable=True):
        

        seq = []
        for node in _collect_nodes(
            limit, self, self.ws_prefix + ".getArtists", cacheable
        ):
            name = _extract(node, "name")

            playcount = _number(_extract(node, "playcount"))
            tagcount = _number(_extract(node, "tagcount"))

            seq.append(LibraryItem(Artist(name, self.network), playcount, tagcount))

        return seq
372440
def user_dj(uid, offset=0, limit=30):
    
    if uid is None:
        raise ParamsError()
    r = NCloudBot()
    r.method = 'USER_DJ'
    r.data = {'offset': offset, 'limit': limit, "csrf_token": ""}
    r.params = {'uid': uid}
    r.send()

    return r.response
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()
399522
def find_for_player_id(player_id, connection=None, page_size=100,
        page_number=0, sort_by=DEFAULT_SORT_BY, sort_order=DEFAULT_SORT_ORDER):
        
        return pybrightcove.connection.ItemResultSet(
            "find_playlists_for_player_id", Playlist, connection, page_size,
            page_number, sort_by, sort_order, player_id=player_id)
592788
def create_user_playlist(user_id, name, is_public = true)
      run(:post, "/v1/users/#{user_id}/playlists", [201], JSON.dump(name: name, public: is_public), false)
    end
33745
def user_activities(self, user_id, extra_query_params={}):
        
        return self.do("GET", "users/{user_id}/activities",
                       url_params={"user_id": user_id},
                       query_params=extra_query_params)
200276
def download_playlist_by_id(self, playlist_id, playlist_name):
        

        try:
            songs = self.crawler.get_playlist_songs(
                playlist_id)
        except RequestException as exception:
            click.echo(exception)
        else:
            folder = os.path.join(self.folder, playlist_name)
            for song in songs:
                self.download_song_by_id(song.song_id, song.song_name, folder)
1263546
def get_artists(self, search, start=0, max_items=100):
        
        return self.get_music_service_information('artists', search, start,
                                                  max_items)
701745
def createPlaylist(self, title, items=None, section=None, limit=None, smart=None, **kwargs):
        
        return Playlist.create(self, title, items=items, limit=limit, section=section, smart=smart, **kwargs)
933470
def user_list(profile=None, **connection_args):
    '''
    
    '''
    kstone = auth(profile, **connection_args)
    ret = {}
    for user in kstone.users.list():
        ret[user.name] = dict((value, getattr(user, value, None)) for value in dir(user)
                              if not value.startswith('_') and
                              isinstance(getattr(user, value, None), (six.string_types, dict, bool)))
        tenant_id = getattr(user, 'tenantId', None)
        if tenant_id:
            ret[user.name]['tenant_id'] = tenant_id
    return ret
477871
def playlist_subscribe(self, playlist):
		

		mutation = mc_calls.PlaylistBatch.create(
			playlist['name'],
			playlist['description'],
			'SHARED',
			owner_name=playlist.get('ownerName', ''),
			share_token=playlist['shareToken']
		)

		response_body = self._call(
			mc_calls.PlaylistBatch,
			mutation
		).body

		playlist_id = response_body['mutate_response'][0]['id']

		return self.playlist(playlist_id)
1054632
def get_all(cls, account_id=None, location=None):
        
        qry = db.Enforcements.filter()

        if account_id:
            qry = qry.filter(account_id == Enforcements.account_id)

        if location:
            qry = qry.join(Resource, Resource.location == location)

        return qry
1030006
def get_user_id(username)
      pglimit = 100
      res = @conn.get('/api/v1/users&limit=' + pglimit.to_s)
      usercount = res['count'].to_i
      id = user_data_from_results(res, username, 'uid')
      return id if id

      pages = (usercount / pglimit) + 1
      2.upto(pages) do |i|
        res = @conn.get('/api/v1/users&limit=' + pglimit.to_s + '?page=' + i.to_s)
        id = user_data_from_results(res, username, 'uid')
        return id if id
      end
      nil
    end
1183713
def download_user_playlists_by_search(self, user_name):
        

        try:
            user = self.crawler.search_user(user_name, self.quiet)
        except RequestException as exception:
            click.echo(exception)
        else:
            self.download_user_playlists_by_id(user.user_id)