Search for albums.

@return An {@link AlbumSimplified} paging.
@throws IOException            In case of networking issues.
@throws SpotifyWebApiException The Web API returned an error further specified in this exception's root cause.
184340
@SuppressWarnings("unchecked")
  public Paging<AlbumSimplified> execute() throws
          IOException,
          SpotifyWebApiException {
    return new AlbumSimplified.JsonUtil().createModelObjectPaging(getJson(), "albums");
  }
731001
def albums_in_collection(start=nil,count=nil,sort=nil,query=nil)
      api.getAlbumsInCollection self,start,count,sort,query
    end
128925
public static <T> Page<T> fromJson(String recordKey, String json, Class<T> recordType, ObjectMapper mapper) {
        try {
            List<T> results = new ArrayList<>();
            JsonNode root = mapper.readTree(json);
            JsonNode records = root.get(recordKey);
            for (final JsonNode record : records) {
                results.add(mapper.readValue(record.toString(), recordType));
            }

            JsonNode uriNode = root.get("uri");
            if (uriNode != null) {
                return buildPage(root, results);
            } else {
                return buildNextGenPage(root, results);
            }

        } catch (final IOException e) {
            throw new ApiConnectionException(
                "Unable to deserialize response: " + e.getMessage() + "\nJSON: " + json, e
            );
        }
    }
1000466
public PhotoList<Photo> search(SearchParameters params, int perPage, int page) throws FlickrException {
        PhotoList<Photo> photos = new PhotoList<Photo>();

        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("method", METHOD_SEARCH);

        parameters.putAll(params.getAsParameters());

        if (perPage > 0) {
            parameters.put("per_page", "" + perPage);
        }
        if (page > 0) {
            parameters.put("page", "" + page);
        }

        Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret);
        if (response.isError()) {
            throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
        }
        Element photosElement = response.getPayload();
        photos.setPage(photosElement.getAttribute("page"));
        photos.setPages(photosElement.getAttribute("pages"));
        photos.setPerPage(photosElement.getAttribute("perpage"));
        photos.setTotal(photosElement.getAttribute("total"));

        NodeList photoNodes = photosElement.getElementsByTagName("photo");
        for (int i = 0; i < photoNodes.getLength(); i++) {
            Element photoElement = (Element) photoNodes.item(i);
            photos.add(PhotoUtils.createPhoto(photoElement));
        }
        return photos;
    }
1098862
public Photo getListPhoto(String photoId) throws FlickrException {

        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("method", METHOD_GET_LIST_PHOTO);

        parameters.put("photo_id", photoId);

        Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret);
        if (response.isError()) {
            throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
        }

        Element photoElement = response.getPayload();
        Photo photo = new Photo();
        photo.setId(photoElement.getAttribute("id"));

        List<Tag> tags = new ArrayList<Tag>();
        Element tagsElement = (Element) photoElement.getElementsByTagName("tags").item(0);
        NodeList tagElements = tagsElement.getElementsByTagName("tag");
        for (int i = 0; i < tagElements.getLength(); i++) {
            Element tagElement = (Element) tagElements.item(i);
            Tag tag = new Tag();
            tag.setId(tagElement.getAttribute("id"));
            tag.setAuthor(tagElement.getAttribute("author"));
            tag.setAuthorName(tagElement.getAttribute("authorname"));
            tag.setRaw(tagElement.getAttribute("raw"));
            tag.setValue(((Text) tagElement.getFirstChild()).getData());
            tags.add(tag);
        }
        photo.setTags(tags);
        return photo;
    }
842643
public T photos_createAlbum(String albumName)
    throws FacebookException, IOException {
    return this.photos_createAlbum(albumName, null, /*description*/null) /*location*/;
  }
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
532406
public long numRecords() {
        if (numRecords == null) {
            try {
                numRecords = indexToKey.getNumRecords();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return numRecords;
    }
688120
final public int getPageIndexInParent(WebSiteRequest req) throws IOException, SQLException {
		WebPage[] myPages=getParent().getCachedPages(req);
		int len=myPages.length;
		for(int c=0;c<len;c++) if(myPages[c].equals(this)) return c;
		throw new RuntimeException("Unable to find page index in parent.");
	}
1248958
public static Iterable<VcfRecord> records(final URL url) throws IOException {
        checkNotNull(url);
        try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
            return records(reader);
        }
    }
262437
def get_top_albums(self, limit=None, cacheable=True):
        """"""
        params = self._get_params()
        if limit:
            params["limit"] = limit

        return self._get_things("getTopAlbums", "album", Album, params, cacheable)
410113
public function getAlbumPhotos($albumId, $page = 1)
    {
        if (is_null($albumId) || $albumId == '') {
            throw new Exception('The albumId is required to get the list of photos in the album.');
        }

        $params = array(
            'method' => 'sp.album.get_photos',
            'album_id' => $albumId,
            'page' => $page
        );

        return $this->_makeApiRequest($params);
    }
206155
public T photos_upload(File photo)
    throws FacebookException, IOException {
    return photos_upload(photo, /*caption*/ null, /*albumId*/ null) ;
  }
1353849
public Gallery lookupGallery(String galleryId) throws FlickrException {

        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("method", METHOD_LOOKUP_GALLERY);
        parameters.put("url", galleryId);

        Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret);
        if (response.isError()) {
            throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
        }

        Element galleryElement = response.getPayload();
        Gallery gallery = new Gallery();
        gallery.setId(galleryElement.getAttribute("id"));
        gallery.setUrl(galleryElement.getAttribute("url"));

        User owner = new User();
        owner.setId(galleryElement.getAttribute("owner"));
        gallery.setOwner(owner);
        gallery.setCreateDate(galleryElement.getAttribute("date_create"));
        gallery.setUpdateDate(galleryElement.getAttribute("date_update"));
        gallery.setPrimaryPhotoId(galleryElement.getAttribute("primary_photo_id"));
        gallery.setPrimaryPhotoServer(galleryElement.getAttribute("primary_photo_server"));
        gallery.setVideoCount(galleryElement.getAttribute("count_videos"));
        gallery.setPhotoCount(galleryElement.getAttribute("count_photos"));
        gallery.setPrimaryPhotoFarm(galleryElement.getAttribute("farm"));
        gallery.setPrimaryPhotoSecret(galleryElement.getAttribute("secret"));

        gallery.setTitle(XMLUtilities.getChildValue(galleryElement, "title"));
        gallery.setDesc(XMLUtilities.getChildValue(galleryElement, "description"));
        return gallery;
    }
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)
833566
public boolean next() throws IOException {
		boolean hasNext = true;
		try {
			pageId = stream.readInt();
			pageNamespace = stream.readInt();
			pageTitle = stream.readUTFAsArray();
			pageIsRedirect = stream.readBoolean();
		} catch (EOFException e) {
			hasNext = false;
		}
		return hasNext;
	}
343832
private void fetchMissingRecords() throws IOException {
        logger.debug("Records includes:");
        records.forEach(r -> logger.debug("{}", r));
        for (PtrRecord ptr : records.stream().filter(r -> r instanceof PtrRecord).map(r -> (PtrRecord) r).collect(Collectors.toList())) {
            fetchMissingSrvRecordsFor(ptr);
            fetchMissingTxtRecordsFor(ptr);
        }
        for (SrvRecord srv : records.stream().filter(r -> r instanceof SrvRecord).map(r -> (SrvRecord) r).collect(Collectors.toList())) {
            fetchMissingAddressRecordsFor(srv);
        }
    }