<s> """<STR_LIT>""" <EOL> import os <EOL> from . mysqldb import MySQLDialect_mysqldb <EOL> from ... pool import NullPool <EOL> import re <EOL> from sqlalchemy . util import warn_deprecated <EOL> def _is_dev_environment ( ) : <EOL> return os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) . startswith ( '<STR_LIT>' ) <EOL> class MySQLDialect_gaerdbms ( MySQLDialect_mysqldb ) : <EOL> @ classmethod <EOL> def dbapi ( cls ) : <EOL> warn_deprecated ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) <EOL> from google . appengine . api import apiproxy_stub_map <EOL> if _is_dev_environment ( ) : <EOL> from google . appengine . api import rdbms_mysqldb <EOL> return rdbms_mysqldb <EOL> elif apiproxy_stub_map . apiproxy . GetStub ( '<STR_LIT>' ) : <EOL> from google . storage . speckle . python . api import rdbms_apiproxy <EOL> return rdbms_apiproxy <EOL> else : <EOL> from google . storage . speckle . python . api import rdbms_googleapi <EOL> return rdbms_googleapi <EOL> @ classmethod <EOL> def get_pool_class ( cls , url ) : <EOL> return NullPool <EOL> def create_connect_args ( self , url ) : <EOL> opts = url . translate_connect_args ( ) <EOL> if not _is_dev_environment ( ) : <EOL> opts [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> opts [ '<STR_LIT>' ] = url . query [ '<STR_LIT>' ] <EOL> return [ ] , opts <EOL> def _extract_error_code ( self , exception ) : <EOL> match = re . compile ( r"<STR_LIT>" ) . match ( str ( exception ) ) <EOL> code = match . group ( <NUM_LIT:1> ) or match . group ( <NUM_LIT:2> ) if match else None <EOL> if code : <EOL> return int ( code ) <EOL> dialect = MySQLDialect_gaerdbms </s>
