docs: def get_segments(segment_id=None):
      """Returns list of all network segments that may be relevant on CVX"""
      session = db.get_reader_session()
      with session.begin():
          model = segment_models.NetworkSegment
          segments = session.query(model).filter_unnecessary_segments()
          if segment_id:
              segments = segments.filter(model.id == segment_id)
      return segments.all()