Update lb.rb

fixing code for python2.7