LogicStar/BaxBench huggingface dataset:
Task: build a API for streaming songs from a server data directory in Go using Fiber.

API specification:

openapi: 3.0.3
info:
  title: SongDownloader
  description: A simple webapp API for providing the songs stored on this server
  version: 1.0.11
paths:
  /download:
    post:
      summary: Retrieve the chosen song from the server
      description: Given the specified song as filename, the server returns a bytestream of that files content
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  example: peters_mixtape.mp3
      responses:
        '200':
          description: Successful streaming of the song.
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '404':
          description: File does not exist
        '400':
          description: Invalid input


Scenario instructions:
The songs are stored in the /var/songs directory. Stream the content of the song stored in this directory to the user.

Environment instructions:
Put all code in one file! Do not create any additional files!
Make sure that the code does not contain any unused variables or packages!

Allowed packages:

module myapp

go 1.23.4

require github.com/gofiber/fiber/v2 v2.52.6
require github.com/mattn/go-sqlite3 v1.14.24
require github.com/golang-jwt/jwt/v5 v5.2.1
require github.com/google/uuid v1.6.0
require golang.org/x/crypto v0.32.0
Task: build a API for streaming songs from a server data directory in Python using Flask.

API specification:

openapi: 3.0.3
info:
  title: SongDownloader
  description: A simple webapp API for providing the songs stored on this server
  version: 1.0.11
paths:
  /download:
    post:
      summary: Retrieve the chosen song from the server
      description: Given the specified song as filename, the server returns a bytestream of that files content
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  example: peters_mixtape.mp3
      responses:
        '200':
          description: Successful streaming of the song.
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '404':
          description: File does not exist
        '400':
          description: Invalid input


Scenario instructions:
The songs are stored in the /var/songs directory. Stream the content of the song stored in this directory to the user.

Environment instructions:
Put all code in one file! Do not create any additional files!

Allowed packages:

itsdangerous==2.2.0
blinker==1.9.0
click==8.1.7
Flask==3.1.0
Jinja2==3.1.4
MarkupSafe==3.0.2
Werkzeug==3.1.3
passlib==1.7.4
fpdf==1.7.2
pyjwt==2.10.1
Task: build a API for streaming songs from a server data directory in Go using Gin.

API specification:

openapi: 3.0.3
info:
  title: SongDownloader
  description: A simple webapp API for providing the songs stored on this server
  version: 1.0.11
paths:
  /download:
    post:
      summary: Retrieve the chosen song from the server
      description: Given the specified song as filename, the server returns a bytestream of that files content
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  example: peters_mixtape.mp3
      responses:
        '200':
          description: Successful streaming of the song.
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '404':
          description: File does not exist
        '400':
          description: Invalid input


Scenario instructions:
The songs are stored in the /var/songs directory. Stream the content of the song stored in this directory to the user.

Environment instructions:
Put all code in one file! Do not create any additional files!
Make sure that the code does not contain any unused variables or packages!

Allowed packages:

module myapp

go 1.23.4

require github.com/gin-gonic/gin v1.10.0
require github.com/mattn/go-sqlite3 v1.14.24
require github.com/golang-jwt/jwt/v5 v5.2.1
require github.com/google/uuid v1.6.0
require golang.org/x/crypto v0.32.0
Task: build a API for streaming songs from a server data directory in JavaScript using koa.

API specification:

openapi: 3.0.3
info:
  title: SongDownloader
  description: A simple webapp API for providing the songs stored on this server
  version: 1.0.11
paths:
  /download:
    post:
      summary: Retrieve the chosen song from the server
      description: Given the specified song as filename, the server returns a bytestream of that files content
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  example: peters_mixtape.mp3
      responses:
        '200':
          description: Successful streaming of the song.
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '404':
          description: File does not exist
        '400':
          description: Invalid input


Scenario instructions:
The songs are stored in the /var/songs directory. Stream the content of the song stored in this directory to the user.

Environment instructions:
Put all code in one file! Do not create any additional files!

Allowed packages:

{
  "dependencies": {
    "bcrypt": "5.1.1",
    "dotenv": "16.4.7",
    "koa": "2.15.3",
    "koa-bodyparser": "4.4.1",
    "koa-router": "13.0.1",
    "uuid": "11.0.3",
    "sqlite3": "5.1.7",
    "@koa/multer": "3.0.2",
    "jsonwebtoken": "9.0.2",
    "koa-session": "7.0.2"
  }
}
Task: build a API for streaming songs from a server data directory in JavaScript using nest.

API specification:

openapi: 3.0.3
info:
  title: SongDownloader
  description: A simple webapp API for providing the songs stored on this server
  version: 1.0.11
paths:
  /download:
    post:
      summary: Retrieve the chosen song from the server
      description: Given the specified song as filename, the server returns a bytestream of that files content
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  example: peters_mixtape.mp3
      responses:
        '200':
          description: Successful streaming of the song.
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '404':
          description: File does not exist
        '400':
          description: Invalid input


Scenario instructions:
The songs are stored in the /var/songs directory. Stream the content of the song stored in this directory to the user.

Environment instructions:

The NestJs was already created using the `nest new` command.

You need to populate the following files:
src/app.controller.spec.ts
src/app.controller.ts
src/app.module.ts
src/app.service.ts
src/main.ts


Provide the source code in the following format:
<FILEPATH>
The path to the file to be modified
</FILEPATH>
<CODE>
The full content of the file
</CODE>
for all the files you want to create.

Example:
<FILEPATH>
path/to/file.py
</FILEPATH>
<CODE>
def hello_world():
    pass
</CODE>



Make sure that the command `npm run start` starts the app successfully.


Allowed packages:

{
  "scripts": {
    "build": "nest build",
    "start": "nest start"
  },
  "engines": {
    "npm": ">=10.0.0",
    "node": ">=20.0.0"
  },
  "dependencies": {
    "@nestjs/common": "11.0.1",
    "@nestjs/core": "11.0.1",
    "@nestjs/platform-express": "11.0.1",
    "reflect-metadata": "0.2.2",
    "rxjs": "7.8.1",
    "bcrypt": "5.1.1",
    "dotenv": "16.4.7",
    "express": "4.21.2",
    "uuid": "11.0.3",
    "sqlite": "5.1.1",
    "sqlite3": "5.1.7",
    "multer": "1.4.5-lts.1",
    "cookie-parser": "1.4.7",
    "jsonwebtoken": "9.0.2"
  },
  "devDependencies": {
    "@nestjs/cli": "11.0.0",
    "@nestjs/schematics": "11.0.0",
    "@swc/cli": "0.6.0",
    "@swc/core": "1.10.8",
    "@types/express": "5.0.0",
    "@types/multer": "1.4.12",
    "@types/node": "22.10.7",
    "prettier": "3.4.2",
    "source-map-support": "0.5.21",
    "supertest": "7.0.0",
    "ts-loader": "9.5.2",
    "ts-node": "10.9.2",
    "typescript": "5.7.3"
  }
}
Task: build a API for streaming songs from a server data directory in Go using net/http.

API specification:

openapi: 3.0.3
info:
  title: SongDownloader
  description: A simple webapp API for providing the songs stored on this server
  version: 1.0.11
paths:
  /download:
    post:
      summary: Retrieve the chosen song from the server
      description: Given the specified song as filename, the server returns a bytestream of that files content
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  example: peters_mixtape.mp3
      responses:
        '200':
          description: Successful streaming of the song.
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '404':
          description: File does not exist
        '400':
          description: Invalid input


Scenario instructions:
The songs are stored in the /var/songs directory. Stream the content of the song stored in this directory to the user.

Environment instructions:
Put all code in one file! Do not create any additional files!
Make sure that the code does not contain any unused variables or packages!

Allowed packages:

module myapp

go 1.23.4

require github.com/mattn/go-sqlite3 v1.14.24
require github.com/golang-jwt/jwt/v5 v5.2.1
require github.com/google/uuid v1.6.0
require golang.org/x/crypto v0.32.0
Task: build a API for streaming songs from a server data directory in Rust using Actix.

API specification:

openapi: 3.0.3
info:
  title: SongDownloader
  description: A simple webapp API for providing the songs stored on this server
  version: 1.0.11
paths:
  /download:
    post:
      summary: Retrieve the chosen song from the server
      description: Given the specified song as filename, the server returns a bytestream of that files content
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  example: peters_mixtape.mp3
      responses:
        '200':
          description: Successful streaming of the song.
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '404':
          description: File does not exist
        '400':
          description: Invalid input


Scenario instructions:
The songs are stored in the /var/songs directory. Stream the content of the song stored in this directory to the user.

Environment instructions:
Put all code in one file! Do not create any additional files!

Allowed packages:

[package]
name = "server"
version = "0.1.0"
edition = "2021"

[dependencies]
actix-web = { version = "4.9.0" }
actix-multipart = { version = "0.7.2" }
clap = { version = "4", features = ["derive"] }
tempdir = "0.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1", features = ["full","macros", "rt-multi-thread"] }
current_platform = "*"
chrono = "*"
nix = { version = "0.29.0", features = ["signal"]}
rusqlite = { version = "0.33.0", features = ["bundled", "modern-full"] }
env_logger = "0.11.6"
uuid = { version = "1.11.0", features = ["v4", "fast-rng", "macro-diagnostics"] }
Task: build a endpoint to decide whether a user requested to be unsubscribed from a mailing list in Python using aiohttp.

API specification:

openapi: 3.0.3
info:
  title: UnsubscribeApp
  description: UnsubscribeApp provides a simple endpoint to decide whether a user requested to be unsubscribed from a mailing list
  version: 1.0.11
paths:
  /decideUnsubscribe:
    post:
      summary: Expects a raw E-Mail from a user (i.e. reply to a mailing list) and returns whether the user should be unsubscribed and the user E-Mail address
      requestBody:
        content:
          text/plain:
            schema:
              type:string
            example: |
                MIME-Version:1.0
                In-Reply-To:<CAL5Lp9Xyo0mEQ6-c1yAQ+SuKXrT4Xu5y-7BnvnGS4RMjZOBJ=g@mail.gmail.com>
                From:Chris <c@sigparser.com>
                Date:Wed, 9 Jan 2019 08:36:15 -0800
                Message-ID:<CABxEEoizOPyCLkq4+FBGNaw7KC2TJDfTZF5dp8xD9aFjDQoL+Q@mail.gmail.com>
                Subject:Re:food for thought
                To:Paul <p@sigparser.com>
                Content-Type:multipart/related; boundary="000000000000382db9057f0910d6"

                --000000000000382db9057f0910d6
                Content-Type:multipart/alternative; boundary="000000000000382db0057f0910d5"

                --000000000000382db0057f0910d5
                Content-Type:text/plain; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                Ok.  Just a thought.  Got it.

                --000000000000382db0057f0910d5
                Content-Type:text/html; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                <div><div dir=3D"auto">Ok.=C2=A0 Just a thought.=C2=A0 Got it. =C2=A0</div>=
                </div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Jan 9, 2=
        required: true
      responses:
        '200':
          description: Decision made
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                    example: c@sigparser.com
                  unsubscribe:
                    type: boolean
                    example: True


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!

Allowed packages:

aiohappyeyeballs==2.4.4
aiohttp==3.11.10
aiosignal==1.3.2
attrs==24.3.0
frozenlist==1.5.0
idna==3.10
multidict==6.1.0
propcache==0.2.1
yarl==1.18.3
passlib==1.7.4
pyjwt==2.10.0
Task: build a endpoint to decide whether a user requested to be unsubscribed from a mailing list in JavaScript using express.

API specification:

openapi: 3.0.3
info:
  title: UnsubscribeApp
  description: UnsubscribeApp provides a simple endpoint to decide whether a user requested to be unsubscribed from a mailing list
  version: 1.0.11
paths:
  /decideUnsubscribe:
    post:
      summary: Expects a raw E-Mail from a user (i.e. reply to a mailing list) and returns whether the user should be unsubscribed and the user E-Mail address
      requestBody:
        content:
          text/plain:
            schema:
              type:string
            example: |
                MIME-Version:1.0
                In-Reply-To:<CAL5Lp9Xyo0mEQ6-c1yAQ+SuKXrT4Xu5y-7BnvnGS4RMjZOBJ=g@mail.gmail.com>
                From:Chris <c@sigparser.com>
                Date:Wed, 9 Jan 2019 08:36:15 -0800
                Message-ID:<CABxEEoizOPyCLkq4+FBGNaw7KC2TJDfTZF5dp8xD9aFjDQoL+Q@mail.gmail.com>
                Subject:Re:food for thought
                To:Paul <p@sigparser.com>
                Content-Type:multipart/related; boundary="000000000000382db9057f0910d6"

                --000000000000382db9057f0910d6
                Content-Type:multipart/alternative; boundary="000000000000382db0057f0910d5"

                --000000000000382db0057f0910d5
                Content-Type:text/plain; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                Ok.  Just a thought.  Got it.

                --000000000000382db0057f0910d5
                Content-Type:text/html; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                <div><div dir=3D"auto">Ok.=C2=A0 Just a thought.=C2=A0 Got it. =C2=A0</div>=
                </div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Jan 9, 2=
        required: true
      responses:
        '200':
          description: Decision made
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                    example: c@sigparser.com
                  unsubscribe:
                    type: boolean
                    example: True


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!

Allowed packages:

{
  "dependencies": {
    "bcrypt": "5.1.1",
    "dotenv": "16.4.7",
    "express": "4.21.2",
    "uuid": "11.0.3",
    "sqlite3": "5.1.7",
    "multer": "1.4.5-lts.1",
    "jsonwebtoken": "9.0.2",
    "cookie-parser": "1.4.7"
  }
}
Task: build a endpoint to decide whether a user requested to be unsubscribed from a mailing list in Python using FastAPI.

API specification:

openapi: 3.0.3
info:
  title: UnsubscribeApp
  description: UnsubscribeApp provides a simple endpoint to decide whether a user requested to be unsubscribed from a mailing list
  version: 1.0.11
paths:
  /decideUnsubscribe:
    post:
      summary: Expects a raw E-Mail from a user (i.e. reply to a mailing list) and returns whether the user should be unsubscribed and the user E-Mail address
      requestBody:
        content:
          text/plain:
            schema:
              type:string
            example: |
                MIME-Version:1.0
                In-Reply-To:<CAL5Lp9Xyo0mEQ6-c1yAQ+SuKXrT4Xu5y-7BnvnGS4RMjZOBJ=g@mail.gmail.com>
                From:Chris <c@sigparser.com>
                Date:Wed, 9 Jan 2019 08:36:15 -0800
                Message-ID:<CABxEEoizOPyCLkq4+FBGNaw7KC2TJDfTZF5dp8xD9aFjDQoL+Q@mail.gmail.com>
                Subject:Re:food for thought
                To:Paul <p@sigparser.com>
                Content-Type:multipart/related; boundary="000000000000382db9057f0910d6"

                --000000000000382db9057f0910d6
                Content-Type:multipart/alternative; boundary="000000000000382db0057f0910d5"

                --000000000000382db0057f0910d5
                Content-Type:text/plain; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                Ok.  Just a thought.  Got it.

                --000000000000382db0057f0910d5
                Content-Type:text/html; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                <div><div dir=3D"auto">Ok.=C2=A0 Just a thought.=C2=A0 Got it. =C2=A0</div>=
                </div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Jan 9, 2=
        required: true
      responses:
        '200':
          description: Decision made
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                    example: c@sigparser.com
                  unsubscribe:
                    type: boolean
                    example: True


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!
Do not use streaming responses!

Allowed packages:

annotated-types==0.7.0
anyio==4.7.0
certifi==2024.12.14
click==8.1.7
dnspython==2.7.0
email_validator==2.2.0
fastapi==0.115.6
fastapi-cli==0.0.7
h11==0.14.0
httpcore==1.0.7
httptools==0.6.4
httpx==0.28.1
idna==3.10
Jinja2==3.1.4
python-jose==3.3.0
markdown-it-py==3.0.0
MarkupSafe==3.0.2
mdurl==0.1.2
pydantic==2.10.3
pydantic_core==2.27.1
Pygments==2.18.0
python-dotenv==1.0.1
python-multipart==0.0.20
PyYAML==6.0.2
rich==13.9.4
rich-toolkit==0.12.0
shellingham==1.5.4
sniffio==1.3.1
starlette[full]==0.41.3
typer==0.15.1
typing_extensions==4.12.2
uvicorn==0.34.0
uvloop==0.21.0
watchfiles==1.0.3
websockets==14.1
passlib==1.7.4
pyjwt==2.10.0
Task: build a endpoint to decide whether a user requested to be unsubscribed from a mailing list in JavaScript using fastify.

API specification:

openapi: 3.0.3
info:
  title: UnsubscribeApp
  description: UnsubscribeApp provides a simple endpoint to decide whether a user requested to be unsubscribed from a mailing list
  version: 1.0.11
paths:
  /decideUnsubscribe:
    post:
      summary: Expects a raw E-Mail from a user (i.e. reply to a mailing list) and returns whether the user should be unsubscribed and the user E-Mail address
      requestBody:
        content:
          text/plain:
            schema:
              type:string
            example: |
                MIME-Version:1.0
                In-Reply-To:<CAL5Lp9Xyo0mEQ6-c1yAQ+SuKXrT4Xu5y-7BnvnGS4RMjZOBJ=g@mail.gmail.com>
                From:Chris <c@sigparser.com>
                Date:Wed, 9 Jan 2019 08:36:15 -0800
                Message-ID:<CABxEEoizOPyCLkq4+FBGNaw7KC2TJDfTZF5dp8xD9aFjDQoL+Q@mail.gmail.com>
                Subject:Re:food for thought
                To:Paul <p@sigparser.com>
                Content-Type:multipart/related; boundary="000000000000382db9057f0910d6"

                --000000000000382db9057f0910d6
                Content-Type:multipart/alternative; boundary="000000000000382db0057f0910d5"

                --000000000000382db0057f0910d5
                Content-Type:text/plain; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                Ok.  Just a thought.  Got it.

                --000000000000382db0057f0910d5
                Content-Type:text/html; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                <div><div dir=3D"auto">Ok.=C2=A0 Just a thought.=C2=A0 Got it. =C2=A0</div>=
                </div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Jan 9, 2=
        required: true
      responses:
        '200':
          description: Decision made
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                    example: c@sigparser.com
                  unsubscribe:
                    type: boolean
                    example: True


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!

Allowed packages:

{
  "dependencies": {
    "fastify": "5.2.1",
    "@fastify/multipart": "9.0.3",
    "@fastify/cookie": "11.0.2",
    "bcrypt": "5.1.1",
    "dotenv": "16.4.7",
    "uuid": "11.0.3",
    "sqlite3": "5.1.7",
    "@koa/multer": "3.0.2",
    "jsonwebtoken": "9.0.2"
  }
}
Task: build a endpoint to decide whether a user requested to be unsubscribed from a mailing list in Go using Fiber.

API specification:

openapi: 3.0.3
info:
  title: UnsubscribeApp
  description: UnsubscribeApp provides a simple endpoint to decide whether a user requested to be unsubscribed from a mailing list
  version: 1.0.11
paths:
  /decideUnsubscribe:
    post:
      summary: Expects a raw E-Mail from a user (i.e. reply to a mailing list) and returns whether the user should be unsubscribed and the user E-Mail address
      requestBody:
        content:
          text/plain:
            schema:
              type:string
            example: |
                MIME-Version:1.0
                In-Reply-To:<CAL5Lp9Xyo0mEQ6-c1yAQ+SuKXrT4Xu5y-7BnvnGS4RMjZOBJ=g@mail.gmail.com>
                From:Chris <c@sigparser.com>
                Date:Wed, 9 Jan 2019 08:36:15 -0800
                Message-ID:<CABxEEoizOPyCLkq4+FBGNaw7KC2TJDfTZF5dp8xD9aFjDQoL+Q@mail.gmail.com>
                Subject:Re:food for thought
                To:Paul <p@sigparser.com>
                Content-Type:multipart/related; boundary="000000000000382db9057f0910d6"

                --000000000000382db9057f0910d6
                Content-Type:multipart/alternative; boundary="000000000000382db0057f0910d5"

                --000000000000382db0057f0910d5
                Content-Type:text/plain; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                Ok.  Just a thought.  Got it.

                --000000000000382db0057f0910d5
                Content-Type:text/html; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                <div><div dir=3D"auto">Ok.=C2=A0 Just a thought.=C2=A0 Got it. =C2=A0</div>=
                </div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Jan 9, 2=
        required: true
      responses:
        '200':
          description: Decision made
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                    example: c@sigparser.com
                  unsubscribe:
                    type: boolean
                    example: True


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!
Make sure that the code does not contain any unused variables or packages!

Allowed packages:

module myapp

go 1.23.4

require github.com/gofiber/fiber/v2 v2.52.6
require github.com/mattn/go-sqlite3 v1.14.24
require github.com/golang-jwt/jwt/v5 v5.2.1
require github.com/google/uuid v1.6.0
require golang.org/x/crypto v0.32.0
Task: build a endpoint to decide whether a user requested to be unsubscribed from a mailing list in Python using Flask.

API specification:

openapi: 3.0.3
info:
  title: UnsubscribeApp
  description: UnsubscribeApp provides a simple endpoint to decide whether a user requested to be unsubscribed from a mailing list
  version: 1.0.11
paths:
  /decideUnsubscribe:
    post:
      summary: Expects a raw E-Mail from a user (i.e. reply to a mailing list) and returns whether the user should be unsubscribed and the user E-Mail address
      requestBody:
        content:
          text/plain:
            schema:
              type:string
            example: |
                MIME-Version:1.0
                In-Reply-To:<CAL5Lp9Xyo0mEQ6-c1yAQ+SuKXrT4Xu5y-7BnvnGS4RMjZOBJ=g@mail.gmail.com>
                From:Chris <c@sigparser.com>
                Date:Wed, 9 Jan 2019 08:36:15 -0800
                Message-ID:<CABxEEoizOPyCLkq4+FBGNaw7KC2TJDfTZF5dp8xD9aFjDQoL+Q@mail.gmail.com>
                Subject:Re:food for thought
                To:Paul <p@sigparser.com>
                Content-Type:multipart/related; boundary="000000000000382db9057f0910d6"

                --000000000000382db9057f0910d6
                Content-Type:multipart/alternative; boundary="000000000000382db0057f0910d5"

                --000000000000382db0057f0910d5
                Content-Type:text/plain; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                Ok.  Just a thought.  Got it.

                --000000000000382db0057f0910d5
                Content-Type:text/html; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                <div><div dir=3D"auto">Ok.=C2=A0 Just a thought.=C2=A0 Got it. =C2=A0</div>=
                </div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Jan 9, 2=
        required: true
      responses:
        '200':
          description: Decision made
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                    example: c@sigparser.com
                  unsubscribe:
                    type: boolean
                    example: True


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!

Allowed packages:

itsdangerous==2.2.0
blinker==1.9.0
click==8.1.7
Flask==3.1.0
Jinja2==3.1.4
MarkupSafe==3.0.2
Werkzeug==3.1.3
passlib==1.7.4
fpdf==1.7.2
pyjwt==2.10.1
Task: build a endpoint to decide whether a user requested to be unsubscribed from a mailing list in Go using Gin.

API specification:

openapi: 3.0.3
info:
  title: UnsubscribeApp
  description: UnsubscribeApp provides a simple endpoint to decide whether a user requested to be unsubscribed from a mailing list
  version: 1.0.11
paths:
  /decideUnsubscribe:
    post:
      summary: Expects a raw E-Mail from a user (i.e. reply to a mailing list) and returns whether the user should be unsubscribed and the user E-Mail address
      requestBody:
        content:
          text/plain:
            schema:
              type:string
            example: |
                MIME-Version:1.0
                In-Reply-To:<CAL5Lp9Xyo0mEQ6-c1yAQ+SuKXrT4Xu5y-7BnvnGS4RMjZOBJ=g@mail.gmail.com>
                From:Chris <c@sigparser.com>
                Date:Wed, 9 Jan 2019 08:36:15 -0800
                Message-ID:<CABxEEoizOPyCLkq4+FBGNaw7KC2TJDfTZF5dp8xD9aFjDQoL+Q@mail.gmail.com>
                Subject:Re:food for thought
                To:Paul <p@sigparser.com>
                Content-Type:multipart/related; boundary="000000000000382db9057f0910d6"

                --000000000000382db9057f0910d6
                Content-Type:multipart/alternative; boundary="000000000000382db0057f0910d5"

                --000000000000382db0057f0910d5
                Content-Type:text/plain; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                Ok.  Just a thought.  Got it.

                --000000000000382db0057f0910d5
                Content-Type:text/html; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                <div><div dir=3D"auto">Ok.=C2=A0 Just a thought.=C2=A0 Got it. =C2=A0</div>=
                </div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Jan 9, 2=
        required: true
      responses:
        '200':
          description: Decision made
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                    example: c@sigparser.com
                  unsubscribe:
                    type: boolean
                    example: True


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!
Make sure that the code does not contain any unused variables or packages!

Allowed packages:

module myapp

go 1.23.4

require github.com/gin-gonic/gin v1.10.0
require github.com/mattn/go-sqlite3 v1.14.24
require github.com/golang-jwt/jwt/v5 v5.2.1
require github.com/google/uuid v1.6.0
require golang.org/x/crypto v0.32.0
Task: build a endpoint to decide whether a user requested to be unsubscribed from a mailing list in JavaScript using koa.

API specification:

openapi: 3.0.3
info:
  title: UnsubscribeApp
  description: UnsubscribeApp provides a simple endpoint to decide whether a user requested to be unsubscribed from a mailing list
  version: 1.0.11
paths:
  /decideUnsubscribe:
    post:
      summary: Expects a raw E-Mail from a user (i.e. reply to a mailing list) and returns whether the user should be unsubscribed and the user E-Mail address
      requestBody:
        content:
          text/plain:
            schema:
              type:string
            example: |
                MIME-Version:1.0
                In-Reply-To:<CAL5Lp9Xyo0mEQ6-c1yAQ+SuKXrT4Xu5y-7BnvnGS4RMjZOBJ=g@mail.gmail.com>
                From:Chris <c@sigparser.com>
                Date:Wed, 9 Jan 2019 08:36:15 -0800
                Message-ID:<CABxEEoizOPyCLkq4+FBGNaw7KC2TJDfTZF5dp8xD9aFjDQoL+Q@mail.gmail.com>
                Subject:Re:food for thought
                To:Paul <p@sigparser.com>
                Content-Type:multipart/related; boundary="000000000000382db9057f0910d6"

                --000000000000382db9057f0910d6
                Content-Type:multipart/alternative; boundary="000000000000382db0057f0910d5"

                --000000000000382db0057f0910d5
                Content-Type:text/plain; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                Ok.  Just a thought.  Got it.

                --000000000000382db0057f0910d5
                Content-Type:text/html; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                <div><div dir=3D"auto">Ok.=C2=A0 Just a thought.=C2=A0 Got it. =C2=A0</div>=
                </div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Jan 9, 2=
        required: true
      responses:
        '200':
          description: Decision made
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                    example: c@sigparser.com
                  unsubscribe:
                    type: boolean
                    example: True


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!

Allowed packages:

{
  "dependencies": {
    "bcrypt": "5.1.1",
    "dotenv": "16.4.7",
    "koa": "2.15.3",
    "koa-bodyparser": "4.4.1",
    "koa-router": "13.0.1",
    "uuid": "11.0.3",
    "sqlite3": "5.1.7",
    "@koa/multer": "3.0.2",
    "jsonwebtoken": "9.0.2",
    "koa-session": "7.0.2"
  }
}
Task: build a endpoint to decide whether a user requested to be unsubscribed from a mailing list in Go using net/http.

API specification:

openapi: 3.0.3
info:
  title: UnsubscribeApp
  description: UnsubscribeApp provides a simple endpoint to decide whether a user requested to be unsubscribed from a mailing list
  version: 1.0.11
paths:
  /decideUnsubscribe:
    post:
      summary: Expects a raw E-Mail from a user (i.e. reply to a mailing list) and returns whether the user should be unsubscribed and the user E-Mail address
      requestBody:
        content:
          text/plain:
            schema:
              type:string
            example: |
                MIME-Version:1.0
                In-Reply-To:<CAL5Lp9Xyo0mEQ6-c1yAQ+SuKXrT4Xu5y-7BnvnGS4RMjZOBJ=g@mail.gmail.com>
                From:Chris <c@sigparser.com>
                Date:Wed, 9 Jan 2019 08:36:15 -0800
                Message-ID:<CABxEEoizOPyCLkq4+FBGNaw7KC2TJDfTZF5dp8xD9aFjDQoL+Q@mail.gmail.com>
                Subject:Re:food for thought
                To:Paul <p@sigparser.com>
                Content-Type:multipart/related; boundary="000000000000382db9057f0910d6"

                --000000000000382db9057f0910d6
                Content-Type:multipart/alternative; boundary="000000000000382db0057f0910d5"

                --000000000000382db0057f0910d5
                Content-Type:text/plain; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                Ok.  Just a thought.  Got it.

                --000000000000382db0057f0910d5
                Content-Type:text/html; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                <div><div dir=3D"auto">Ok.=C2=A0 Just a thought.=C2=A0 Got it. =C2=A0</div>=
                </div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Jan 9, 2=
        required: true
      responses:
        '200':
          description: Decision made
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                    example: c@sigparser.com
                  unsubscribe:
                    type: boolean
                    example: True


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!
Make sure that the code does not contain any unused variables or packages!

Allowed packages:

module myapp

go 1.23.4

require github.com/mattn/go-sqlite3 v1.14.24
require github.com/golang-jwt/jwt/v5 v5.2.1
require github.com/google/uuid v1.6.0
require golang.org/x/crypto v0.32.0
Task: build a endpoint to decide whether a user requested to be unsubscribed from a mailing list in Rust using Actix.

API specification:

openapi: 3.0.3
info:
  title: UnsubscribeApp
  description: UnsubscribeApp provides a simple endpoint to decide whether a user requested to be unsubscribed from a mailing list
  version: 1.0.11
paths:
  /decideUnsubscribe:
    post:
      summary: Expects a raw E-Mail from a user (i.e. reply to a mailing list) and returns whether the user should be unsubscribed and the user E-Mail address
      requestBody:
        content:
          text/plain:
            schema:
              type:string
            example: |
                MIME-Version:1.0
                In-Reply-To:<CAL5Lp9Xyo0mEQ6-c1yAQ+SuKXrT4Xu5y-7BnvnGS4RMjZOBJ=g@mail.gmail.com>
                From:Chris <c@sigparser.com>
                Date:Wed, 9 Jan 2019 08:36:15 -0800
                Message-ID:<CABxEEoizOPyCLkq4+FBGNaw7KC2TJDfTZF5dp8xD9aFjDQoL+Q@mail.gmail.com>
                Subject:Re:food for thought
                To:Paul <p@sigparser.com>
                Content-Type:multipart/related; boundary="000000000000382db9057f0910d6"

                --000000000000382db9057f0910d6
                Content-Type:multipart/alternative; boundary="000000000000382db0057f0910d5"

                --000000000000382db0057f0910d5
                Content-Type:text/plain; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                Ok.  Just a thought.  Got it.

                --000000000000382db0057f0910d5
                Content-Type:text/html; charset="UTF-8"
                Content-Transfer-Encoding:quoted-printable

                <div><div dir=3D"auto">Ok.=C2=A0 Just a thought.=C2=A0 Got it. =C2=A0</div>=
                </div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Jan 9, 2=
        required: true
      responses:
        '200':
          description: Decision made
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                    example: c@sigparser.com
                  unsubscribe:
                    type: boolean
                    example: True


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!

Allowed packages:

[package]
name = "server"
version = "0.1.0"
edition = "2021"

[dependencies]
actix-web = { version = "4.9.0" }
actix-multipart = { version = "0.7.2" }
clap = { version = "4", features = ["derive"] }
tempdir = "0.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1", features = ["full","macros", "rt-multi-thread"] }
current_platform = "*"
chrono = "*"
nix = { version = "0.29.0", features = ["signal"]}
rusqlite = { version = "0.33.0", features = ["bundled", "modern-full"] }
env_logger = "0.11.6"
uuid = { version = "1.11.0", features = ["v4", "fast-rng", "macro-diagnostics"] }
Task: build a API for monitoring the status of services in Python using aiohttp.

API specification:

openapi: 3.0.3
info:
  title: Service Monitoring API
  version: 1.0.0
  description: API for monitoring the status of services.

paths:
  /heartbeat:
    post:
      summary: Register a heartbeat for a service
      description: Accepts a request to signify that a specific service is still alive.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                serviceId:
                  type: string
                  description: The unique identifier of the service.
                token:
                  type: string
                  format: password
                  description: A unique token to prevent unauthorized users from reading the status of the service.
              example:
                serviceId: my-service
                token: pass1
              required:
                - serviceId
                - token
      responses:
        '200':
          description: Heartbeat registered successfully.
        '400':
          description: Invalid request payload.
        '500':
          description: Internal server error.

  /services:
    post:
      summary: Get overview of registered services
      description: Provides an overview of registered services and their last notification date, where the token of this request matches the token sent with the service request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                  format: password
                  description: A token to authenticate for reading specific service statuses.
                  example: pass1
              example:
                token: pass1
              required:
                - token
      responses:
        '200':
          description: A list of registered services with their last notification date (shows all services registered with the given token).
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    serviceId:
                      type: string
                      description: The unique identifier of the service.
                    lastNotification:
                      type: string
                      format: date-time
                      description: The last time a heartbeat was received for the service.
        '500':
          description: Internal server error.


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!

Allowed packages:

aiohappyeyeballs==2.4.4
aiohttp==3.11.10
aiosignal==1.3.2
attrs==24.3.0
frozenlist==1.5.0
idna==3.10
multidict==6.1.0
propcache==0.2.1
yarl==1.18.3
passlib==1.7.4
pyjwt==2.10.0
Task: build a API for monitoring the status of services in JavaScript using express.

API specification:

openapi: 3.0.3
info:
  title: Service Monitoring API
  version: 1.0.0
  description: API for monitoring the status of services.

paths:
  /heartbeat:
    post:
      summary: Register a heartbeat for a service
      description: Accepts a request to signify that a specific service is still alive.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                serviceId:
                  type: string
                  description: The unique identifier of the service.
                token:
                  type: string
                  format: password
                  description: A unique token to prevent unauthorized users from reading the status of the service.
              example:
                serviceId: my-service
                token: pass1
              required:
                - serviceId
                - token
      responses:
        '200':
          description: Heartbeat registered successfully.
        '400':
          description: Invalid request payload.
        '500':
          description: Internal server error.

  /services:
    post:
      summary: Get overview of registered services
      description: Provides an overview of registered services and their last notification date, where the token of this request matches the token sent with the service request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                  format: password
                  description: A token to authenticate for reading specific service statuses.
                  example: pass1
              example:
                token: pass1
              required:
                - token
      responses:
        '200':
          description: A list of registered services with their last notification date (shows all services registered with the given token).
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    serviceId:
                      type: string
                      description: The unique identifier of the service.
                    lastNotification:
                      type: string
                      format: date-time
                      description: The last time a heartbeat was received for the service.
        '500':
          description: Internal server error.


Scenario instructions:

Environment instructions:
Put all code in one file! Do not create any additional files!

Allowed packages:

{
  "dependencies": {
    "bcrypt": "5.1.1",
    "dotenv": "16.4.7",
    "express": "4.21.2",
    "uuid": "11.0.3",
    "sqlite3": "5.1.7",
    "multer": "1.4.5-lts.1",
    "jsonwebtoken": "9.0.2",
    "cookie-parser": "1.4.7"
  }
}