parameters: (user_id)
return_statement: return (
          set([user_id]) 
          |set(row.from_user for row in rows)
          | set(row.to_user for row in rows)
      )
docstring: return a list of ids of friends (included user_id self)
docstring_summary: return a list of ids of friends (included user_id self)
docstring_tokens: return a list of ids of friends ( included user_id self )
function: def friend_ids(user_id):
      """return a list of ids of friends (included user_id self)"""
      query = db.friend_request.status == "accepted"
      query &= (db.friend_request.to_user == user_id) | (
          db.friend_request.from_user == user_id
      )
      rows = db(query).select()
      return (
          set([user_id]) 
          |set(row.from_user for row in rows)
          | set(row.to_user for row in rows)
      )
function_tokens: def friend_ids ( user_id ) : query = db . friend_request . status == "accepted" query &= ( db . friend_request . to_user == user_id ) | ( db . friend_request . from_user == user_id ) rows = db ( query ) . select ( ) return ( set ( [ user_id ] ) | set ( row . from_user for row in rows ) | set ( row . to_user for row in rows ) )