<commit_before>from core import forms
from core.models import Item
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AuthenticationForm
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from pinterest_example.core.models import Pin
from pinterest_example.core.pin_feedly import feedly
from pinterest_example.core.utils.loading import import_by_path
import json


def homepage(request):
    '''
    Homepage where you can register
    '''
    form_class = AuthenticationForm
    if request.method == 'POST':
        form = form_class(data=request.POST)
    else:
        form = form_class()
    context = RequestContext(request)
    context['form'] = form
        
    if request.user.is_authenticated():
        response = trending(request)
    else:
        response = render_to_response('core/homepage.html', context)
    return response


@login_required
def feed(request):
    '''
    Items pinned by the people you follow
    '''
    context = RequestContext(request)
    feed = feedly.get_feeds(request.user.id)['normal']
    if request.REQUEST.get('delete'):
        feed.delete()<commit_msg>remove unused code<commit_after>from core import forms
from core.models import Item
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AuthenticationForm
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from pinterest_example.core.models import Pin
from pinterest_example.core.pin_feedly import feedly
import json


def homepage(request):
    '''
    Homepage where you can register
    '''
    form_class = AuthenticationForm
    if request.method == 'POST':
        form = form_class(data=request.POST)
    else:
        form = form_class()
    context = RequestContext(request)
    context['form'] = form
        
    if request.user.is_authenticated():
        response = trending(request)
    else:
        response = render_to_response('core/homepage.html', context)
    return response


@login_required
def feed(request):
    '''
    Items pinned by the people you follow
    '''
    context = RequestContext(request)
    feed = feedly.get_feeds(request.user.id)['normal']
    if request.REQUEST.get('delete'):
        feed.delete()
{'fraction_non_alphanumeric': 0.08170310701956271, 'fraction_numerical': 0.0, 'mean_word_length': 3.9393939393939394, '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': '7636269', 'n_tokens_mistral': 711, 'n_tokens_neox': 696, 'n_words': 195}