<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def eval_rs(gains, losses):
 """ Evaluates the RS variable in RSI algorithm Args: gains: List of price gains. losses: List of prices losses. Returns: Float of average gains over average losses. """

        # Number of days that the data was collected through
        count = len(gains) + len(losses)

        avg_gains = stats.avg(gains, count=count) if gains else 1
        avg_losses = stats.avg(losses,count=count) if losses else 1
        if avg_losses == 0:
            return avg_gains
        else:
            return avg_gains / avg_losses