def eval_b(x):
 if (sys.version_info.major == 2):
  return x
 else:
  import codecs
  return codecs.utf_8_encode(x)[0]

def eval_b ( x ) : if ( sys . version_info . major == 2 ) : return x else : import codecs return codecs . utf_8_encode ( x ) [ 0 ]
evaluate if to encode the value is necessary .