Create a new playlist in the current user's collection.  The new
 playlist will be returned if the creation is successful, otherwise
 null will be returned.
169160
def createPlaylist(name,description,tracks,extras=nil)
      method = 'createPlaylist'
      type = Playlist
      args = {:name=>name,:description=>description,
        :tracks=>Rdio::keys(tracks)}
      args[:extras] = extras if extras
      return_object type,method,args,true
    end
301660
def setPlaylistCollaborationMode(playlist,mode)
      method = 'setPlaylistCollaborationMode'
      type = Boolean
      args = {:playlist=>playlist,:mode=>mode}
      return_object type,method,args,true
    end
836031
def create(cls, name, database=SYSTEM_DATABASE, type=2):
        

        client = Client.instance()
        api = client.api

        if client.database != database:
            database = client.database

        collection_data = {
            'name': name,
            'type': type,
        }

        data = api.collection.post(data=collection_data)

        collection = Collection(
            name=name,
            database=database,
            api_resource=api.collection,
            api=api,
            kwargs=data
        )

        return collection
405113
def playlists
      return @playlists if @playlists
      results = @client.request('userGetPlaylists', userID: @id)
      @playlists = results['playlists'].map do |list|
        Playlist.new(@client, list, @id)
      end
    end
614163
function getPlaylist(options) {
    return new Promise(function (resolve, reject) {

        if (!options.oauth_token) {
            reject(new Error('Error oauth_token is required, but is null'));
        } else {
            var uri = 'https://api.soundcloud.com/me/playlists?format=json&oauth_token=' + options.oauth_token;
            request.getAsync(uri, {timeout: 10000}).spread(function (response, body) {
                try {
                    var tracks = _.map(JSON.parse(body.toString('utf8')), function (track) {
                        return track;
                    });
                    if (DEBUG_MODE_ON) {
                        console.log('getPlaylist successful');
                    }
                    resolve(tracks);
                } catch (e) {
                    if (DEBUG_MODE_ON) {
                        console.log('Error while getPlaylist track: ', e);
                    }
                    reject(e);
                }
            }).catch(function (e) {
                if (DEBUG_MODE_ON) {
                    console.log('Error while getPlaylist track: ' + e);
                }
                reject(e);
            })
        }
    });
}
437602
public DArray newDArray()
    {
        if ((getCurrentDatabase() == null))
        {
            throw new DatabaseClosedException("Database is NULL, cannot create a DArray with a null database.");
        }
        return (DArray) DArrayFactory.singleton.createCollectionOrMap(getCurrentPBKey());
    }
451645
function(_params, _scope) {
        _params = this.$params ? angular.extend({}, this.$params, _params) : _params;
        return newCollection(_params, _scope || this.$scope);
      }
474127
def create(self, collection, **kw):
		
		
		options = dict(
				name = self.__name__,
				unique = self.unique,
				background = self.background,
				sparse = self.sparse,
				expireAfterSeconds = self.expire,
				partialFilterExpression = self.partial,
				bucketSize = self.bucket,
				min = self.min,
				max = self.max,
			)
		options.update(kw)
		
		# Clear null options.
		for key in list(options):
			if options[key] is None:
				del options[key]
		
		return collection.create_index(self.fields, **options)
189107
function createUser({ username, group="public" }, done) {
  return getGroup(group, function(getGroupErr, theGroup) {
    if (getGroupErr) {
      return done(getGroupErr);
    }

    if (!theGroup) {
      return done(new Error(`group '${group}' not found`));
    }

    theGroup.members.add({ username });
    return theGroup.save(done);
  });
}
75120
def get_playlists(self, offset=0, limit=50):
        
        response = self.client.get(
            self.client.USER_PLAYLISTS % (self.name, offset, limit))
        return self._parse_response(response, splaylist)

        return playlists
453110
def create(self, request, *args, **kwargs):
        """"""
        collections = request.data.get('collections', [])

        # check that user has permissions on all collections that Data
        # object will be added to
        for collection_id in collections:
            try:
                collection = Collection.objects.get(pk=collection_id)
            except Collection.DoesNotExist:
                return Response({'collections': ['Invalid pk "{}" - object does not exist.'.format(collection_id)]},
                                status=status.HTTP_400_BAD_REQUEST)

            if not request.user.has_perm('add_collection', obj=collection):
                if request.user.has_perm('view_collection', obj=collection):
                    raise exceptions.PermissionDenied(
                        "You don't have `ADD` permission on collection (id: {}).".format(collection_id)
                    )
                else:
                    raise exceptions.NotFound(
                        "Collection not found (id: {}).".format(collection_id)
                    )

        self.define_contributor(request)

        if kwargs.pop('get_or_create', False):
            response = self.perform_get_or_create(request, *args, **kwargs)
            if response:
                return response

        return super().create(request, *args, **kwargs)
720352
def configure_createcollection(self, ns, definition):
        
        paginated_list_schema = self.page_cls.make_paginated_list_schema_class(
            ns,
            definition.response_schema,
        )()

        @self.add_route(ns.collection_path, Operation.CreateCollection, ns)
        @request(definition.request_schema)
        @response(paginated_list_schema)
        @wraps(definition.func)
        def create_collection(**path_data):
            request_data = load_request_data(definition.request_schema)
            # NB: if we don't filter the request body through an explicit page schema,
            # we will leak other request arguments into the pagination query strings
            page = self.page_cls.from_query_string(self.page_schema(), request_data)

            result = definition.func(**merge_data(
                path_data,
                merge_data(
                    request_data,
                    page.to_dict(func=identity),
                ),
            ))

            response_data, headers = page.to_paginated_list(result, ns, Operation.CreateCollection)
            definition.header_func(headers, response_data)
            response_format = self.negotiate_response_content(definition.response_formats)
            return dump_response_data(
                paginated_list_schema,
                response_data,
                headers=headers,
                response_format=response_format,
            )

        create_collection.__doc__ = "Create the collection of {}".format(pluralize(ns.subject_name))
284615
public GetUsersCurrentlyPlayingTrackRequest.Builder getUsersCurrentlyPlayingTrack() {
    return new GetUsersCurrentlyPlayingTrackRequest.Builder(accessToken)
            .setDefaults(httpManager, scheme, host, port);
  }
51091
def load_playlist(self, loc, title):
        '''
        
        '''
        lines = [l.strip() for l in open(loc).readlines()]
        self.playlists.setdefault(title, [])
        self.playlists[title].append(Playlist(lines, True))
131899
def collection(self, user_id):
        
        # TODO further evaluation of the page param, I don't know where the
        # limit is.
        dct = {'userID': user_id, 'page': 0}
        r = 'userGetSongsInLibrary'
        result = self.connection.request(r, dct, self.connection.header(r))
        songs = result[1]['Songs']
        return [Song.from_response(song, self.connection) for song in songs]
896371
def download_user_playlists_by_id(self, user_id):
        

        try:
            playlist = self.crawler.get_user_playlists(user_id)
        except RequestException as exception:
            click.echo(exception)
        else:
            self.download_playlist_by_id(
                playlist.playlist_id, playlist.playlist_name)
873372
def getPlaylists(extras=nil)
      method = 'getPlaylists'
      type = Playlist
      args = {}
      args[:extras] = extras if extras
      return_object type,method,args,true
    end