<commit_before>from sanic import response
from sanic import Sanic
from sanic.blueprints import Blueprint

# Usage
# curl -H "Host: example.com" localhost:8000
# curl -H "Host: sub.example.com" localhost:8000
# curl -H "Host: bp.example.com" localhost:8000/question
# curl -H "Host: bp.example.com" localhost:8000/answer

app = Sanic()
bp = Blueprint("bp", host="bp.example.com")

@app.route('/', host=["example.com",
                      "somethingelse.com",
                      "therestofyourdomains.com"])
async def hello(request):
    return response.text("Some defaults")

@app.route('/', host="example.com")
async def hello(request):
    return response.text("Answer")

@app.route('/', host="sub.example.com")
async def hello(request):
    return response.text("42")

@bp.route("/question")
async def hello(request):
    return response.text("What is the meaning of life?")

@bp.route("/answer")
async def hello(request):
    return response.text("42")

app.register_blueprint(bp)

if __name__ == '__main__':
    app.run(host="0.0.0.0", port=8000)<commit_msg>Use of register_blueprint will be deprecated, why not upgrade?<commit_after>from sanic import response
from sanic import Sanic
from sanic.blueprints import Blueprint

# Usage
# curl -H "Host: example.com" localhost:8000
# curl -H "Host: sub.example.com" localhost:8000
# curl -H "Host: bp.example.com" localhost:8000/question
# curl -H "Host: bp.example.com" localhost:8000/answer

app = Sanic()
bp = Blueprint("bp", host="bp.example.com")

@app.route('/', host=["example.com",
                      "somethingelse.com",
                      "therestofyourdomains.com"])
async def hello(request):
    return response.text("Some defaults")

@app.route('/', host="sub.example.com")
async def hello(request):
    return response.text("42")

@bp.route("/question")
async def hello(request):
    return response.text("What is the meaning of life?")

@bp.route("/answer")
async def hello(request):
    return response.text("42")

app.blueprint(bp)

if __name__ == '__main__':
    app.run(host="0.0.0.0", port=8000)
{'fraction_non_alphanumeric': 0.1579961464354528, 'fraction_numerical': 0.02697495183044316, 'mean_word_length': 4.004819277108433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2439553', 'n_tokens_mistral': 725, 'n_tokens_neox': 658, 'n_words': 170}