<commit_before>from django.shortcuts import get_object_or_404, render

# Create your views here.
from django.http import HttpResponse
from django.template import loader
from .models import Recipe, Herb


def index(request):
    """
    Display a list of recipes to select from.
    """
    recipe_index = Recipe.objects.order_by('pinyin')
#    template = loader.get_template('shennong/index.html')
    context = {
        'recipe_index': recipe_index,
    }
#    return HttpResponse(template.render(context, request))
    return render(request, 'shennong/index.html', context)


def recipe_header(request, id):
    """
    Display header data for a recipe.
    """
    recipe = get_object_or_404(Recipe, pk=id)
    
    return render(request, 'shennong/recipe_header.html', {'recipe': recipe,})


<commit_msg>Clean out redundant code.<commit_after>from django.shortcuts import get_object_or_404, render

# Create your views here.
from .models import Recipe, Herb


def index(request):
    """
    Display a list of recipes to select from.
    """
    recipe_index = Recipe.objects.order_by('pinyin')
    context = {
        'recipe_index': recipe_index,
    }
    return render(request, 'shennong/index.html', context)


def recipe_header(request, id):
    """
    Display header data for a recipe.
    """
    recipe = get_object_or_404(Recipe, pk=id)
    
    return render(request, 'shennong/recipe_header.html', {'recipe': recipe,})



{'fraction_non_alphanumeric': 0.11188325225851285, 'fraction_numerical': 0.008339124391938846, 'mean_word_length': 3.630225080385852, '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': '5855186', 'n_tokens_mistral': 472, 'n_tokens_neox': 456, 'n_words': 116}