original_string: private function calculateLanguagesPercentage($referers)
      {
          $total = $referers->sum('count');
  
          return $referers->transform(function ($item) use ($total) {
              return $item + [
                  'percentage' => round(($item['count'] / $total) * 100, 2)
              ];
          });
      }
code: private function calculateLanguagesPercentage($referers)
      {
          $total = $referers->sum('count');
  
          return $referers->transform(function ($item) use ($total) {
              return $item + [
                  'percentage' => round(($item['count'] / $total) * 100, 2)
              ];
          });
      }
code_tokens: private function calculateLanguagesPercentage ( $ referers ) { $ total = $ referers -> sum ( 'count' ) ; return $ referers -> transform ( function ( $ item ) use ( $ total ) { return $ item + [ 'percentage' => round ( ( $ item [ 'count' ] / $ total ) * 100 , 2 ) ] ; } ) ; }
docstring: Calculate the referers percentage.
  
  @param  \Illuminate\Support\Collection  $referers
  
  @return \Illuminate\Support\Collection
docstring_tokens: Calculate the referers percentage .