def CreateSitelinkFeedItem(feed_items, feed_item_id):
 site_link_from_feed = feed_items[feed_item_id]
 site_link_feed_item = {'sitelinkText': site_link_from_feed['text'], 'sitelinkLine2': site_link_from_feed['line2'], 'sitelinkLine3': site_link_from_feed['line3'], 'scheduling': site_link_from_feed['scheduling']}
 if (('finalUrls' in site_link_from_feed) and site_link_from_feed['finalUrls']):
  site_link_feed_item['sitelinkFinalUrls'] = {'urls': site_link_from_feed['finalUrls']}
  if ('finalMobileUrls' in site_link_from_feed):
   site_link_feed_item['sitelinkFinalMobileUrls'] = {'urls': site_link_from_feed['finalMobileUrls']}
  site_link_feed_item['sitelinkTrackingUrlTemplate'] = site_link_from_feed['trackingUrlTemplate']
 else:
  site_link_feed_item['sitelinkUrl'] = site_link_from_feed['url']
 return site_link_feed_item

def CreateSitelinkFeedItem ( feed_items , feed_item_id ) : site_link_from_feed = feed_items [ feed_item_id ] site_link_feed_item = { 'sitelinkText' : site_link_from_feed [ 'text' ] , 'sitelinkLine2' : site_link_from_feed [ 'line2' ] , 'sitelinkLine3' : site_link_from_feed [ 'line3' ] , 'scheduling' : site_link_from_feed [ 'scheduling' ] } if ( ( 'finalUrls' in site_link_from_feed ) and site_link_from_feed [ 'finalUrls' ] ) : site_link_feed_item [ 'sitelinkFinalUrls' ] = { 'urls' : site_link_from_feed [ 'finalUrls' ] } if ( 'finalMobileUrls' in site_link_from_feed ) : site_link_feed_item [ 'sitelinkFinalMobileUrls' ] = { 'urls' : site_link_from_feed [ 'finalMobileUrls' ] } site_link_feed_item [ 'sitelinkTrackingUrlTemplate' ] = site_link_from_feed [ 'trackingUrlTemplate' ] else : site_link_feed_item [ 'sitelinkUrl' ] = site_link_from_feed [ 'url' ] return site_link_feed_item
creates a sitelink feed item .