Get the ID of the test album
971447
function before_photo_post(test, callback){
	hello(test.network)
	.api("me/albums")
	.then(function(r){
		for(var i=0;i<r.data.length;i++){
			if(r.data[i].name === "TestAlbum"){
				var id = r.data[i].id;
				test.data.id = id;
				return callback();
			}
		}
		callback("Failed to setup: Could not find the album 'TestAlbum'");
	}, function(){
		callback("Failed to setup: could not access me/albums");
	});
}
784657
function() {
		var api_url,
			self = this;

		// Create Dom element
		this._el.content_item	= TL.Dom.create("div", "tl-media-item tl-media-iframe tl-media-spotify", this._el.content);

		// Get Media ID
		if (this.data.url.match(/^spotify:track/) || this.data.url.match(/^spotify:album/) || this.data.url.match(/^spotify:user:.+:playlist:/)) {
			this.media_id = this.data.url;
		}

		if (this.data.url.match(/spotify\.com\/track\/(.+)/)) {
			this.media_id = "spotify:track:" + this.data.url.match(/spotify\.com\/track\/(.+)/)[1];
		} else if (this.data.url.match(/spotify\.com\/album\/(.+)/)) {
			this.media_id = "spotify:album:" + this.data.url.match(/spotify\.com\/album\/(.+)/)[1];
		} else if (this.data.url.match(/spotify\.com\/user\/(.+?)\/playlist\/(.+)/)) {
			var user = this.data.url.match(/spotify\.com\/user\/(.+?)\/playlist\/(.+)/)[1];
			var playlist = this.data.url.match(/spotify\.com\/user\/(.+?)\/playlist\/(.+)/)[2];
			this.media_id = "spotify:user:" + user + ":playlist:" + playlist;
		} else if (this.data.url.match(/spotify\.com\/artist\/(.+)/)) {
			var artist = this.data.url.match(/spotify\.com\/artist\/(.+)/)[1];
			this.media_id = "spotify:artist:" + artist;
		}


		if (this.media_id) {
			// API URL
			api_url = "https://embed.spotify.com/?uri=" + this.media_id + "&theme=white&view=coverart";

			this.player = TL.Dom.create("iframe", "tl-media-shadow", this._el.content_item);
			this.player.width 		= "100%";
			this.player.height 		= "100%";
			this.player.frameBorder = "0";
			this.player.src 		= api_url;

			// After Loaded
			this.onLoaded();

		} else {
				this.loadErrorDisplay(this._('spotify_invalid_url'));
		}
	}
1209928
def _get_id(self):
        """"""
        return ''.join(map(str,
                           filter(is_not_None,
                                  [self.Prefix, self.Name])))
1375058
def get_id(self):
        
        if self._id is None:
            self._id = graceful_get(self.inspect(refresh=True), "ID")
        return self._id
210140
def get_album(self):
        """"""

        doc = self._request(self.ws_prefix + ".getInfo", True)

        albums = doc.getElementsByTagName("album")

        if len(albums) == 0:
            return

        node = doc.getElementsByTagName("album")[0]
        return Album(_extract(node, "artist"), _extract(node, "title"), self.network)
632005
def download_album_by_id(self, album_id, album_name):
        

        try:
            # use old api
            songs = self.crawler.get_album_songs(album_id)
        except RequestException as exception:
            click.echo(exception)
        else:
            folder = os.path.join(self.folder, album_name)
            for song in songs:
                self.download_song_by_id(song.song_id, song.song_name, folder)
666675
def _get_id(self):
        """"""
        id = self._options.get('id')
        if id:
            return id

        id = uuid.uuid4().hex
        self.update_options(id=id)
        return id
1099796
def getSearchUrl(self, album, artist):
    
    # build request url
    params = collections.OrderedDict()
    params["gbv"] = "2"
    params["q"] = "\"%s\" \"%s\" front cover" % (artist, album)
    if abs(self.target_size - 500) < 300:
      params["tbs"] = "isz:m"
    elif self.target_size > 800:
      params["tbs"] = "isz:l"

    return __class__.assembleUrl(__class__.BASE_URL, params)
375747
def get_my_item_id_from_section(self, section):
        """"""
        for question_map in section._my_map['questions']:
            if question_map['assessmentPartId'] == str(self.get_id()):
                return section.get_question(question_map=question_map).get_id()
        raise IllegalState('This Part currently has no Item in the Section')
10039
def get(self, id, param):
        
        assert isinstance(id, basestring)
        assert isinstance(param, basestring)
        return self.params_.get(param, {}).get(id)
525422
public Lyrics getLyrics(int trackID) throws MusixMatchException {
		Lyrics lyrics = null;
		LyricsGetMessage message = null;
		Map<String, Object> params = new HashMap<String, Object>();

		params.put(Constants.API_KEY, apiKey);
		params.put(Constants.TRACK_ID, new String("" + trackID));

		String response = null;

		response = MusixMatchRequest.sendRequest(Helper.getURLString(
				Methods.TRACK_LYRICS_GET, params));

		Gson gson = new Gson();

		try {
			message = gson.fromJson(response, LyricsGetMessage.class);
		} catch (JsonParseException jpe) {
			handleErrorResponse(response);
		}

		lyrics = message.getContainer().getBody().getLyrics();

		return lyrics;
	}
609733
function getIdStringFromIdParts(source, idParts) {
        if (idParts.length === 1) {
            return null;
        }
        var i, l, idPart, idPartType, check = 0, nextIdNameCode;
        for (i = 0, l = idParts.length; i < l; i++) {
            if (idParts[i].type) {
                check = 1;
                break;
            }
        }
        if (check) {
            var ret = [];
            for (i = 0, l = idParts.length; i < l; i++) {
                idPart = idParts[i];
                idPartType = idPart.type;
                if (idPartType) {
                    nextIdNameCode = xtplAstToJs[idPartType](idPart);
                    pushToArray(source, nextIdNameCode.source);
                    ret.push(nextIdNameCode.exp);
                } else {
                    // literal a.x
                    ret.push(wrapByDoubleQuote(idPart));
                }
            }
            return ret;
        } else {
            return null;
        }
    }
1147937
def get_id(self):
        """"""

        # Check first to make sure no one else has claimed authority on my object.
        # This will likely occur when an AssessmentSection returns a Question
        # During an AssessmentSession
        if self.my_osid_object._authority != MAGIC_AUTHORITY:
            return self.my_osid_object._item_id
            # raise AttributeError

        # If not, go ahead and build magic Id:
        choices = self.my_osid_object._my_map['choices']
        choice_ids = [c['id'] for c in choices]
        magic_identifier = quote('{0}?{1}'.format(self.my_osid_object._my_map['_id'],
                                                  json.dumps(choice_ids)))
        return Id(namespace='assessment.Item',
                  identifier=magic_identifier,
                  authority=MAGIC_AUTHORITY)
977491
def get_tracks_from_album(album_name):
    '''
    
    '''

    spotify = spotipy.Spotify()

    album = spotify.search(q='album:' + album_name, limit=1)
    album_id = album['tracks']['items'][0]['album']['id']
    results = spotify.album_tracks(album_id=str(album_id))
    songs = []
    for items in results['items']:
        songs.append(items['name'])

    return songs
318277
def get_artist(self):
        
        # pylint: disable=E1101
        assert isinstance(self, (Album, Track))
        return self.client.get_artist(self.artist.id)
627845
def trackSeek(path, artist, album, track, trackNum, fmt):
    """"""
    hiddenName = "(Hidden Track).{}".format(fmt)
    trackName = track + ".{}".format(fmt)
    songIn = instantiateSong(path)
    times = findGap(songIn)
    saveFiles(trackName, hiddenName, splitSong(songIn, times[0], times[1]), artist, album, trackNum)
    # return [path, track.rsplit('/',1)[0] +'/{}'.format(hiddenName)]
    return [trackName, hiddenName]
866519
def album_cover_url(self):
        """"""
        large_image = self._assets.get('large_image', '')
        if large_image[:8] != 'spotify:':
            return ''
        album_image_id = large_image[8:]
        return 'https://i.scdn.co/image/' + album_image_id