docs: def check_routes(
      feed: "Feed", *, as_df: bool = False, include_warnings: bool = False
  ) -> List:
      """
      Analog of :func:`check_agency` for ``feed.routes``.
      """
      table = "routes"
      problems = []
  
      # Preliminary checks
      if feed.routes is None:
          problems.append(["error", "Missing table", table, []])
      else:
          f = feed.routes.copy()
          problems = check_for_required_columns(problems, table, f)
      if problems:
          return format_problems(problems, as_df=as_df)
  
      if include_warnings:
          problems = check_for_invalid_columns(problems, table, f)
  
      # Check route_id
      problems = check_column_id(problems, table, f, "route_id")
  
      # Check agency_id
      if "agency_id" in f:
          if "agency_id" not in feed.agency.columns:
              problems.append(
                  [
                      "error",
                      "agency_id column present in routes but not in agency",
                      table,
                      [],
                  ]
              )
          else:
              g = f.dropna(subset=["agency_id"])
              cond = ~g["agency_id"].isin(feed.agency["agency_id"])
              problems = check_table(
                  problems, table, g, cond, "Undefined agency_id"
              )
  
      # Check route_short_name and route_long_name
      for column in ["route_short_name", "route_long_name"]:
          problems = check_column(
              problems, table, f, column, valid_str, column_required=False
          )
  
      cond = ~(f["route_short_name"].notnull() | f["route_long_name"].notnull())
      problems = check_table(
          problems,
          table,
          f,
          cond,
          "route_short_name and route_long_name both empty",
      )
  
      # Check route_type
      v = lambda x: x in range(8)
      problems = check_column(problems, table, f, "route_type", v)
  
      # Check route_url
      problems = check_column(
          problems, table, f, "route_url", valid_url, column_required=False
      )
  
      # Check route_color and route_text_color
      for col in ["route_color", "route_text_color"]:
          problems = check_column(
              problems, table, f, col, valid_color, column_required=False
          )
  
      if include_warnings:
          # Check for duplicated (route_short_name, route_long_name) pairs
          cond = f[["route_short_name", "route_long_name"]].duplicated()
          problems = check_table(
              problems,
              table,
              f,
              cond,
              "Repeated pair (route_short_name, route_long_name)",
              "warning",
          )
  
          # Check for routes without trips
          s = feed.trips["route_id"]
          cond = ~f["route_id"].isin(s)
          problems = check_table(
              problems, table, f, cond, "Route has no trips", "warning"
          )
  
      return format_problems(problems, as_df=as_df)