def get_pickle_protocol():
 try:
  protocol_str = os.environ['PYLEARN2_PICKLE_PROTOCOL']
 except KeyError:
  protocol_str = '0'
 if (protocol_str == 'pickle.HIGHEST_PROTOCOL'):
  return pickle.HIGHEST_PROTOCOL
 return int(protocol_str)

def get_pickle_protocol ( ) : try : protocol_str = os . environ [ 'PYLEARN2_PICKLE_PROTOCOL' ] except KeyError : protocol_str = '0' if ( protocol_str == 'pickle.HIGHEST_PROTOCOL' ) : return pickle . HIGHEST_PROTOCOL return int ( protocol_str )
allow configuration of the pickle protocol on a per-machine basis .