def _user_activity_query(user_id, limit):
 q1 = _activities_limit(_activities_from_user_query(user_id), limit)
 q2 = _activities_limit(_activities_about_user_query(user_id), limit)
 return _activities_union_all(q1, q2)

def _user_activity_query ( user_id , limit ) : q1 = _activities_limit ( _activities_from_user_query ( user_id ) , limit ) q2 = _activities_limit ( _activities_about_user_query ( user_id ) , limit ) return _activities_union_all ( q1 , q2 )
return an sqlalchemy query for all activities from or about user_id .