parameters: (request)
return_statement: return render(request, 'am/diff_index.html', {'t_diffs': t_diffs,
                                                    'page_content': page_content})
docstring: AM模块Diff页面主页 /am/diff/
docstring_summary: AM模块Diff页面主页 /am/diff/
docstring_tokens: AM模块Diff页面主页 / am / diff /
function: def diff_index(request):
      """ AM模块Diff页面主页 /am/diff/ """
      limit = 8  # 每页显示Diff数量
      diffs = Diff.objects.order_by('-add_time').all()
      t_diffs = []
      for diff in diffs:
          analysis = Analysis.objects.filter(diff=diff).order_by('-add_time').first()
          analysis_result = parse_analysis_result(analysis.result)
          t_diffs.append({'diff': diff, 'analysis_result': analysis_result})
  
      paginator = Paginator(t_diffs, limit)
      page = request.GET.get('page')
      try:
          t_diffs = paginator.page(page)
      except PageNotAnInteger:
          t_diffs = paginator.page(1)
      except EmptyPage:
          t_diffs = paginator.page(paginator.num_pages)
  
      page_content = pagination(t_diffs)
  
      return render(request, 'am/diff_index.html', {'t_diffs': t_diffs,
                                                    'page_content': page_content})
function_tokens: def diff_index ( request ) : limit = 8 # 每页显示Diff数量 diffs = Diff . objects . order_by ( '-add_time' ) . all ( ) t_diffs = [ ] for diff in diffs : analysis = Analysis . objects . filter ( diff = diff ) . order_by ( '-add_time' ) . first ( ) analysis_result = parse_analysis_result ( analysis . result ) t_diffs . append ( { 'diff' : diff , 'analysis_result' : analysis_result } ) paginator = Paginator ( t_diffs , limit ) page = request . GET . get ( 'page' ) try : t_diffs = paginator . page ( page ) except PageNotAnInteger : t_diffs = paginator . page ( 1 ) except EmptyPage : t_diffs = paginator . page ( paginator . num_pages ) page_content = pagination ( t_diffs ) return render ( request , 'am/diff_index.html' , { 't_diffs' : t_diffs , 'page_content' : page_content } )