def mulrowscaler(row, scaler, K):
 return [(scaler * element) for element in row]

def mulrowscaler ( row , scaler , K ) : return [ ( scaler * element ) for element in row ]
performs the scaler-row multiplication element-wise .