(photo_id)
Returns available sizes for the photo with the given ID

    Returns a list of dicts containing the following keys
    * source
    * url
    * media
    * height
    * width
    * label
Returns available sizes for the photo with the given ID
Returns available sizes for the photo with the given ID
def get_photo_sizes(photo_id):
    """Returns available sizes for the photo with the given ID

    Returns a list of dicts containing the following keys
    * source
    * url
    * media
    * height
    * width
    * label
    """

    api_key = settings.FLICKR_API_KEY
    url = GET_SIZES_TEMPLATE.format(api_key=api_key, photo_id=photo_id)

    try:
        resp = requests.get(url)
    except requests.exceptions.RequestException as e:
        logger.warning("Retrieving Flickr photo sizes failed: %s", str(e))
        return []

    try:
        resp_obj = resp.json()
    except json.JSONDecodeError as jde:
        return []

    try:
        return resp_obj["sizes"]["size"]
    except KeyError:
        return []
def get_photo_sizes ( photo_id ) : api_key = settings . FLICKR_API_KEY url = GET_SIZES_TEMPLATE . format ( api_key = api_key , photo_id = photo_id ) try : resp = requests . get ( url ) except requests . exceptions . RequestException as e : logger . warning ( "Retrieving Flickr photo sizes failed: %s" , str ( e ) ) return [ ] try : resp_obj = resp . json ( ) except json . JSONDecodeError as jde : return [ ] try : return resp_obj [ "sizes" ] [ "size" ] except KeyError : return [ ]