Also, if you're going to share a snippet with the public, make sure to twice over your code and make sure that it's flexible enough to work for everyone not just yourself.
def Op(to_op):
irc.send( 'MODE #berend +o: ' + to_op + '\r\n')
def DeOp(to_deop):
irc.send( 'MODE #berend -o: ' + to_deop + '\r\n')
def Voice(to_v):
irc.send( 'MODE #berend +v: ' + to_v + '\r\n')
def DeVoice(to_dv):
irc.send( 'MODE #berend -v: ' + to_dv + '\r\n')