<commit_before># Python implementation of the MySQL client-server protocol
#   https://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOCOL.html

import hashlib
sha_new = lambda *args, **kwargs: hashlib.new("sha1", *args, **kwargs)

import socket
import ssl
import struct
import sys
import os
import stat

try:
    from ConfigParser import RawConfigParser
except ImportError:
    from configparser import RawConfigParser

import getpass
DEFAULT_USER = getpass.getuser()

from cymysql.charset import charset_by_name, charset_by_id
from cymysql.cursors import Cursor
from cymysql.constants import CLIENT, COMMAND
from cymysql.converters import decoders, encoders, escape_item
from cymysql.err import Warning, Error, \
     InterfaceError, DataError, DatabaseError, OperationalError, \
     IntegrityError, InternalError, NotSupportedError, ProgrammingError
from cymysql.packet import MysqlPacket, MySQLResult

PYTHON3 = sys.version_info[0] > 2

DEFAULT_CHARSET = 'utf8'

def byte2int(b):
    if isinstance(b, int):
        return b
    else:
        return ord(b)


def int2byte(i):
    if PYTHON3:
        return bytes([i])
    else:
        return chr(i)


def pack_int24(n):
    if PYTHON3:
        return bytes([n&0xFF, (n>>8)&0xFF,(n>>16)&0xFF])
    else:
        return chr(n&0xFF) + chr((n>>8)&0xFF) + chr((n>>16)&0xFF)


def _mysql_native_password_scramble(password, message):
    if password == None or len(password) == 0:
        return b''
    message2 = sha_new(password).digest()
    stage2 = sha_new(message2).digest()
    s = sha_new()
    s.update(message)
    s.update(stage2)
    message1 = s.digest()

    length = len(message1)
    result = struct.pack('B', length)
    for i in range(length):
        x = (struct.unpack('B', message1[i:i+1])[0] ^ \<commit_msg>fix connect with password issue #22<commit_after># Python implementation of the MySQL client-server protocol
#   https://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOCOL.html

import hashlib
sha_new = lambda *args, **kwargs: hashlib.new("sha1", *args, **kwargs)

import socket
import ssl
import struct
import sys
import os
import stat

try:
    from ConfigParser import RawConfigParser
except ImportError:
    from configparser import RawConfigParser

import getpass
DEFAULT_USER = getpass.getuser()

from cymysql.charset import charset_by_name, charset_by_id
from cymysql.cursors import Cursor
from cymysql.constants import CLIENT, COMMAND
from cymysql.converters import decoders, encoders, escape_item
from cymysql.err import Warning, Error, \
     InterfaceError, DataError, DatabaseError, OperationalError, \
     IntegrityError, InternalError, NotSupportedError, ProgrammingError
from cymysql.packet import MysqlPacket, MySQLResult

PYTHON3 = sys.version_info[0] > 2

DEFAULT_CHARSET = 'utf8'

def byte2int(b):
    if isinstance(b, int):
        return b
    else:
        return ord(b)


def int2byte(i):
    if PYTHON3:
        return bytes([i])
    else:
        return chr(i)


def pack_int24(n):
    if PYTHON3:
        return bytes([n&0xFF, (n>>8)&0xFF,(n>>16)&0xFF])
    else:
        return chr(n&0xFF) + chr((n>>8)&0xFF) + chr((n>>16)&0xFF)


def _mysql_native_password_scramble(password, message):
    SCRAMBLE_LENGTH = 20

    if password == None or len(password) == 0:
        return b''
    message2 = sha_new(password).digest()
    stage2 = sha_new(message2).digest()
    s = sha_new()
    s.update(message[:SCRAMBLE_LENGTH])
    s.update(stage2)
    message1 = s.digest()

    length = len(message1)
    result = b''
    for i in range(length):
        x = (struct.unpack('B', message1[i:i+1])[0] ^ \
{'fraction_non_alphanumeric': 0.11055694098088113, 'fraction_numerical': 0.019395954558049322, 'mean_word_length': 3.8521505376344085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 2, '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': '1166519', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1208, 'n_words': 310}