def _get_social_page_image_url(file_attachments):
 for file_attachment in file_attachments:
  if file_attachment.mimetype.startswith(u'image/'):
   return file_attachment.get_absolute_url()
 return None

def _get_social_page_image_url ( file_attachments ) : for file_attachment in file_attachments : if file_attachment . mimetype . startswith ( u'image/' ) : return file_attachment . get_absolute_url ( ) return None
return the url to an image used for social media sharing .