[VARIABLE my_album_id]
516131
public String readOnlyTransaction(long singerId, long albumId) {
    // [START readOnlyTransaction]
    String singerColumn = "FirstName";
    String albumColumn = "AlbumTitle";
    String albumTitle = null;
    // ReadOnlyTransaction should be closed to prevent resource leak.
    try (ReadOnlyTransaction txn = dbClient.readOnlyTransaction()) {
      Struct singerRow =
          txn.readRow("Singers", Key.of(singerId), Collections.singleton(singerColumn));
      Struct albumRow =
          txn.readRow("Albums", Key.of(singerId, albumId), Collections.singleton(albumColumn));
      singerRow.getString(singerColumn);
      albumTitle = albumRow.getString(albumColumn);
    }
    // [END readOnlyTransaction]
    return albumTitle;
  }
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'));
		}
	}
241650
def run(self):
        
        # Get Imgur ID.
        imgur_id = self.arguments[0]
        if not RE_IMGUR_ID.match(imgur_id):
            raise ImgurError('Invalid Imgur ID specified. Must be 5-10 letters and numbers. Albums prefixed with "a/".')

        # Read from conf.py.
        config = self.state.document.settings.env.config
        hide_post_details = self.options.get('hide_post_details', config.imgur_hide_post_details)

        return [ImgurEmbedNode(imgur_id, hide_post_details), ImgurJavaScriptNode()]
962641
def view(self, album, **kwds):
        
        result = self._client.get("/album/%s/view.json" %
                                  self._extract_id(album),
                                  **kwds)["result"]
        return Album(self._client, result)
76457
function(el) {
                var id = el.id;

                if (!id) {
                    id = "yuievtautoid-" + counter;
                    ++counter;
                    el.id = id;
                }

                return id;
            }
761682
public void setAlbum(String album, int type)
	{
		if (allow(type&ID3V1))
		{
			id3v1.setAlbum(album);
		}
		if (allow(type&ID3V2))
		{
			id3v2.setTextFrame(ID3v2Frames.ALBUM, album);
		}
	}
146660
function getId(record) {
    Validate.isObject(record);
    Validate.notNull(record);

    for (var property in record) {
        if (property.toLowerCase() === idPropertyName.toLowerCase()) {
            return record[property];
        }
    }
}
21444
def delete(self, album, **kwds):
        
        return self._client.post("/album/%s/delete.json" %
                                 self._extract_id(album),
                                 **kwds)["result"]
554077
def _get_album(self,directory):
        
        if not self._connectToFB():
            print("%s - Couldn't connect to fb"%(directory))
            return None,None


        # Load sets from SET_FILE
        _sets=self._load_sets(directory)

        # Only grab the first set, FB supports only one set per photo
        myset=_sets[0]

        logger.debug("Getting album id for %s"%(myset))

        # Connect to fb and get dicionary of photosets
        psets=self._getphotosets()

        # create if it doesn't exist
        if myset not in psets:
            logger.info('set [%s] not in fb sets, will create set'%(myset))
            self._createphotoset(myset)
            # Now reaload photosets from fb
            psets=self._getphotosets()

        # Return the album id, album name
        return psets[myset]['id'],myset
721778
function get_id(val) {
  if ( typeof val === 'string' || typeof val === 'number' )
    return val;

  if ( typeof val === 'object' && val.id )
    return val.id;

  return false;
}
963493
def set_metadata(track, filename, album=None):
    
    logger.info('Setting tags...')
    global arguments
    artwork_url = track['artwork_url']
    user = track['user']
    if not artwork_url:
        artwork_url = user['avatar_url']
    artwork_url = artwork_url.replace('large', 't500x500')
    response = requests.get(artwork_url, stream=True)
    with tempfile.NamedTemporaryFile() as out_file:
        shutil.copyfileobj(response.raw, out_file)
        out_file.seek(0)

        track_created = track['created_at']
        track_date = datetime.strptime(track_created, "%Y/%m/%d %H:%M:%S %z")
        debug_extract_dates = '{0} {1}'.format(track_created, track_date)
        logger.debug('Extracting date: {0}'.format(debug_extract_dates))
        track['date'] = track_date.strftime("%Y-%m-%d %H::%M::%S")

        track['artist'] = user['username']
        if arguments['--extract-artist']:
            for dash in [' - ', ' − ', ' – ', ' — ', ' ― ']:
                if dash in track['title']:
                    artist_title = track['title'].split(dash)
                    track['artist'] = artist_title[0].strip()
                    track['title'] = artist_title[1].strip()
                    break

        audio = mutagen.File(filename, easy=True)
        audio['title'] = track['title']
        audio['artist'] = track['artist']
        if album: audio['album'] = album
        if track['genre']: audio['genre'] = track['genre']
        if track['permalink_url']: audio['website'] = track['permalink_url']
        if track['date']: audio['date'] = track['date']
        audio.save()

        a = mutagen.File(filename)
        if track['description']:
            if a.__class__ == mutagen.flac.FLAC:
                a['description'] = track['description']
            elif a.__class__ == mutagen.mp3.MP3:
                a['COMM'] = mutagen.id3.COMM(
                    encoding=3, lang=u'ENG', text=track['description']
                )
        if artwork_url:
            if a.__class__ == mutagen.flac.FLAC:
                p = mutagen.flac.Picture()
                p.data = out_file.read()
                p.width = 500
                p.height = 500
                p.type = mutagen.id3.PictureType.COVER_FRONT
                a.add_picture(p)
            elif a.__class__ == mutagen.mp3.MP3:
                a['APIC'] = mutagen.id3.APIC(
                    encoding=3, mime='image/jpeg', type=3,
                    desc='Cover', data=out_file.read()
                )
        a.save()
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
474733
function see(label, record) {
    return record.url == null || record.url === '' ?
           '' :
           '\nSee ' + record.url +
           ' for information about the ' + record.name + ' ' + label + '.\n';
  }
475236
def album_primary_image_url(self):
    ''''''
    path = '/Items/{}/Images/Primary'.format(self.album_id)
    return self.connector.get_url(path, attach_api_key=False)
1274383
def _parse(self, data):
        
        super(Album, self)._parse(data)
        self.cover_id = data['cover']
        images = [Image(i['id'], i) for i in data['images']]
        self.image_ids[:] = [i.imgur_id for i in images]
        return images
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");
	});
}
597153
public function delete($id = null)
    {
        $this->request->allowMethod(['post', 'delete']);

        $album = $this->PhotosAlbums->get($id);

        //Before deleting, it checks if the album has some photos
        if (!$album->photo_count) {
            $this->PhotosAlbums->deleteOrFail($album);
            $this->Flash->success(I18N_OPERATION_OK);
        } else {
            $this->Flash->alert(I18N_BEFORE_DELETE);
        }

        return $this->redirect(['action' => 'index']);
    }