<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _CalculateYLines(self, dists):
 """Builds a list with y-coordinates for the horizontal lines in the graph. Args: # One integer for each pair of stations # indicating the approximate distance Returns: # One integer y-coordinate for each station normalized between # 0 and X, where X is the height of the graph in pixels """

    tot_dist = sum(dists)
    if tot_dist > 0:
      pixel_dist = [float(d * (self._gheight-20))/tot_dist for d in dists]
      pixel_grid = [0]+[int(pd + sum(pixel_dist[0:i])) for i,pd in
                        enumerate(pixel_dist)]
    else:
      pixel_grid = []

    return pixel_grid