<commit_before>use std::borrow::Borrow;
use std::default::Default;
use std::fs;
use std::fmt;
use std::io;
use std::io::Read;
use std::io::Write as NewWrite;
use std::net;
use std::net::SocketAddr;
use std::path;
use std::str::FromStr;

use super::consts;
use super::consts::Command;
use super::consts::ColumnType;
use super::io::Read as MyRead;
use super::io::Write;
use super::io::Stream;
use super::io::Stream::UnixStream;
use super::io::Stream::TcpStream;
use super::io::TcpStream::Insecure;
use super::error::MyError::{
    MyIoError,
    MySqlError,
    MyDriverError
};
use super::error::DriverError::{
    CouldNotConnect,
    UnsupportedProtocol,
    Protocol41NotSet,
    UnexpectedPacket,
    MismatchedStmtParams,
    SetupError,
    ReadOnlyTransNotSupported,
};
use super::error::MyResult;
#[cfg(feature = "ssl")]
use super::error::DriverError::SslNotSupported;
use super::scramble::scramble;
use super::packet::{OkPacket, EOFPacket, ErrPacket, HandshakePacket, ServerVersion};
use super::value::Value;
use super::value::{ToValue, from_value, from_value_opt};
use super::value::Value::{NULL, Int, UInt, Float, Bytes, Date, Time};

use byteorder::LittleEndian as LE;
use byteorder::{ByteOrder, ReadBytesExt, WriteBytesExt};
use unix_socket as us;

pub mod pool;

#[derive(PartialEq, Eq, Clone, Copy)]
pub enum IsolationLevel {
    ReadUncommied,
    ReadCommited,
    RepeaableRead,
    Serializable,
}

impl fmt::Display for IsolationLevel {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            IsolationLevel::ReadUncommied => write!(f, "READ UNCOMMITTED"),
            IsolationLevel::ReadCommited => write!(f, "READ COMMITTED"),
            IsolationLevel::RepeaableRead => write!(f, "REPEATABLE READ"),
            IsolationLevel::Serializable => write!(f, "SERIALIZABLE"),
        }
    }
}

pub struct Transaction<'a> {
    conn: Option<&'a mut MyConn>,
    pooled_conn: Option<pool::MyPooledConn>,
    committed: bool,
    rolled_back: bool,
}

impl<'a> Transaction<'a> {
    fn new(conn: &'a mut MyConn) -> Transaction<'a> {
        Transaction {
            conn: Some(conn),
            pooled_conn: None,
            committed: false,
            rolled_back: false,
        }<commit_msg>Fix typo in `IsolationLevel` variant (fix #17)<commit_after>use std::borrow::Borrow;
use std::default::Default;
use std::fs;
use std::fmt;
use std::io;
use std::io::Read;
use std::io::Write as NewWrite;
use std::net;
use std::net::SocketAddr;
use std::path;
use std::str::FromStr;

use super::consts;
use super::consts::Command;
use super::consts::ColumnType;
use super::io::Read as MyRead;
use super::io::Write;
use super::io::Stream;
use super::io::Stream::UnixStream;
use super::io::Stream::TcpStream;
use super::io::TcpStream::Insecure;
use super::error::MyError::{
    MyIoError,
    MySqlError,
    MyDriverError
};
use super::error::DriverError::{
    CouldNotConnect,
    UnsupportedProtocol,
    Protocol41NotSet,
    UnexpectedPacket,
    MismatchedStmtParams,
    SetupError,
    ReadOnlyTransNotSupported,
};
use super::error::MyResult;
#[cfg(feature = "ssl")]
use super::error::DriverError::SslNotSupported;
use super::scramble::scramble;
use super::packet::{OkPacket, EOFPacket, ErrPacket, HandshakePacket, ServerVersion};
use super::value::Value;
use super::value::{ToValue, from_value, from_value_opt};
use super::value::Value::{NULL, Int, UInt, Float, Bytes, Date, Time};

use byteorder::LittleEndian as LE;
use byteorder::{ByteOrder, ReadBytesExt, WriteBytesExt};
use unix_socket as us;

pub mod pool;

#[derive(PartialEq, Eq, Clone, Copy)]
pub enum IsolationLevel {
    ReadUncommied,
    ReadCommited,
    RepeatableRead,
    Serializable,
}

impl fmt::Display for IsolationLevel {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            IsolationLevel::ReadUncommied => write!(f, "READ UNCOMMITTED"),
            IsolationLevel::ReadCommited => write!(f, "READ COMMITTED"),
            IsolationLevel::RepeatableRead => write!(f, "REPEATABLE READ"),
            IsolationLevel::Serializable => write!(f, "SERIALIZABLE"),
        }
    }
}

pub struct Transaction<'a> {
    conn: Option<&'a mut MyConn>,
    pooled_conn: Option<pool::MyPooledConn>,
    committed: bool,
    rolled_back: bool,
}

impl<'a> Transaction<'a> {
    fn new(conn: &'a mut MyConn) -> Transaction<'a> {
        Transaction {
            conn: Some(conn),
            pooled_conn: None,
            committed: false,
            rolled_back: false,
        }
{'fraction_non_alphanumeric': 0.146883946267342, 'fraction_numerical': 0.0013212948689715921, 'mean_word_length': 4.465703971119134, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5726288', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1502, 'n_words': 344}