<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def numConnects(self, layerName):
 """ Number of incoming weights, including bias. Assumes fully connected. """

        count = 0
        if self[layerName].active: 
            count += 1 # 1 = bias
            for connection in self.connections:
                if connection.active and connection.fromLayer.active and connection.toLayer.name == layerName:
                    count += connection.fromLayer.size
        return count