def _sum_first_n(n):
  """
  A helper function that sums the first n values in a series.

  Args:
      n (int): The number of values to sum
  Returns:
      function: The function
  """

  def _sum(x):
    return x.iloc[:n].sum()

  return _sum

  A helper function that sums the first n values in a series.

  Args:
      n (int): The number of values to sum
  Returns:
      function: The function
  
sourcecode/scoring/contributor_state.py