<commit_before>from virtool.handlers import root, jobs, samples, viruses, history, hmm, hosts, account, groups, users

from virtool.web.dispatcher import websocket_handler


def setup_routes(app):
    app.router.add_get("/ws", websocket_handler)

    app.router.add_get("/api", root.get)

    # Jobs routes
    app.router.add_get("/api/jobs", jobs.find)
    app.router.add_get("/api/jobs/{job_id}", jobs.get)

    # Samples Routes
    app.router.add_get("/api/samples", samples.find)
    app.router.add_post("/api/samples", samples.create)

    app.router.add_get("/api/samples/{sample_id}", samples.get)
    app.router.add_put("/api/samples/{sample_id}", samples.update)
    app.router.add_delete("/api/samples/{sample_id}", samples.remove)

    app.router.add_put("/api/samples/{sample_id}/group", samples.set_owner_group)
    app.router.add_patch("/api/samples/{sample_id}/rights", samples.set_rights)<commit_msg>Change samples.update handler to PATCH<commit_after>from virtool.handlers import root, jobs, samples, viruses, history, hmm, hosts, account, groups, users

from virtool.web.dispatcher import websocket_handler


def setup_routes(app):
    app.router.add_get("/ws", websocket_handler)

    app.router.add_get("/api", root.get)

    # Jobs routes
    app.router.add_get("/api/jobs", jobs.find)
    app.router.add_get("/api/jobs/{job_id}", jobs.get)

    # Samples Routes
    app.router.add_get("/api/samples", samples.find)
    app.router.add_post("/api/samples", samples.create)

    app.router.add_get("/api/samples/{sample_id}", samples.get)
    app.router.add_patch("/api/samples/{sample_id}", samples.update)
    app.router.add_delete("/api/samples/{sample_id}", samples.remove)

    app.router.add_put("/api/samples/{sample_id}/group", samples.set_owner_group)
    app.router.add_patch("/api/samples/{sample_id}/rights", samples.set_rights)
{'fraction_non_alphanumeric': 0.15868746637977407, 'fraction_numerical': 0.0, 'mean_word_length': 4.406976744186046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1165848', 'n_tokens_mistral': 632, 'n_tokens_neox': 604, 'n_words': 93}