def search(request): 
    if not 'q' in request.GET:
        initial = {}
        if request.session.get('nickname', None):
            initial['q'] = 'friends:%s' % request.session['nickname']
        extra_context = {
            'form': SearchForm(initial=initial),
        }
        return render_to_response('search_form.html', extra_context, context_instance=RequestContext(request))
    else:
        form = SearchForm(request.GET)
        if not form.is_valid():
            extra_context = {
                'form': form,
            }
            return render_to_response('search_form.html', extra_context, context_instance=RequestContext(request))
    if request.session.get('nickname', None):
        f = friendfeed.FriendFeed(request.session['nickname'],
            request.session['key'])
    else:
        f = friendfeed.FriendFeed()
    start = max(get_integer_argument(request, 'start', 0), 0)
    num = get_integer_argument(request, 'num', NUM)
    q = form.data['q']
    data = f.search(q, **request_to_feed_args_dict(request))
    if 'errorCode' in data:
        return error(request, data)
    entries = [entry for entry in data['entries'] if not entry['hidden']]
    hidden = [entry for entry in data['entries'] if entry['hidden']]
    extra_context = {
        'entries': entries,
        'hidden': hidden,
        'next': start + num,
        'title': q,
        'form': form,
    }
    if start > 0:
        extra_context['has_previous'] = True
        extra_context['previous'] = max(start - num, 0)
    if request.GET.get('output', 'html') == 'atom':
        return atom(entries)
    return render_to_response('search.html', extra_context, context_instance=RequestContext(request))
Apply security groups to ELB.
dataset/ETHPy150Open bgolub/fftogo/fftogo/views.py/search--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/boto_elb.py/apply_security_groups