def is_page_active(page, user):
  path = request.path

  if page == 'dashboard' and (not path or path == '/'):
    return True
  elif page == 'repositories' and (path.startswith('/repositories') or path.startswith('/repo') or path.startswith('/edit/repo') or path.startswith('/build') or path.startswith('/overrides')):
    return True
  elif page == 'users' and (path.startswith('/users') or (path.startswith('/user') and path != ('/user/' + str(user.id)))):
    return True
  elif page == 'profile' and path == ('/user/' + str(user.id)):
    return True
  elif page == 'integration' and path == '/integration':
    return True
  return False