def is_content_authored_by(content, user):
 try:
  return (int(content.get('user_id')) == user.id)
 except (ValueError, TypeError):
  return False

def is_content_authored_by ( content , user ) : try : return ( int ( content . get ( 'user_id' ) ) == user . id ) except ( ValueError , TypeError ) : return False
return true if the author is this content is the passed user .