def generate_html(attrs, api_key):
 flickr_data = get_info(attrs['photo_id'], api_key)
 if ('size' not in attrs.keys()):
  attrs['size'] = 'large'
 if ('alt' not in attrs.keys()):
  attrs['alt'] = flickr_data['photo']['title']['_content']
 return '<a href="{}"><img src="{}" alt="{}"></a>'.format(flickr_data['photo']['urls']['url'][0]['_content'], source_url(flickr_data['photo']['farm'], flickr_data['photo']['server'], attrs['photo_id'], flickr_data['photo']['secret'], attrs['size']), attrs['alt'])

def generate_html ( attrs , api_key ) : flickr_data = get_info ( attrs [ 'photo_id' ] , api_key ) if ( 'size' not in attrs . keys ( ) ) : attrs [ 'size' ] = 'large' if ( 'alt' not in attrs . keys ( ) ) : attrs [ 'alt' ] = flickr_data [ 'photo' ] [ 'title' ] [ '_content' ] return '<a href="{}"><img src="{}" alt="{}"></a>' . format ( flickr_data [ 'photo' ] [ 'urls' ] [ 'url' ] [ 0 ] [ '_content' ] , source_url ( flickr_data [ 'photo' ] [ 'farm' ] , flickr_data [ 'photo' ] [ 'server' ] , attrs [ 'photo_id' ] , flickr_data [ 'photo' ] [ 'secret' ] , attrs [ 'size' ] ) , attrs [ 'alt' ] )
returns html code .