code: def test_cors(client: TestClient) -> None:
      origin = "http://localhost:3000"
      method = "GET"
      header = "X-Requested-With"
      response = client.options(
          "/rows?dataset=dataset1&config=config1&split=train",
          headers={
              "Origin": origin,
              "Access-Control-Request-Method": method,
              "Access-Control-Request-Headers": header,
          },
      )
      assert response.status_code == 200
      assert (
          origin
          in [
              o.strip()
              for o in response.headers[
                  "Access-Control-Allow-Origin"
              ].split(",")
          ]
          or response.headers["Access-Control-Allow-Origin"] == "*"
      )
      assert (
          header
          in [
              o.strip()
              for o in response.headers[
                  "Access-Control-Allow-Headers"
              ].split(",")
          ]
          or response.headers["Access-Control-Expose-Headers"] == "*"
      )
      assert (
          method
          in [
              o.strip()
              for o in response.headers[
                  "Access-Control-Allow-Methods"
              ].split(",")
          ]
          or response.headers["Access-Control-Expose-Headers"] == "*"
      )
      assert (
          response.headers["Access-Control-Allow-Credentials"] == "true"
      )
  
file_path: datasets-server/services/rows/tests/test_app.py
imports: from typing import Optional
  import pytest
  from starlette.testclient import TestClient
  from rows.app import create_app_with_config
  from rows.config import AppConfig
label_desc: Use image node_id 2 for calling a global function with example usage: test_cors(client) without return types