def get_conn(self):
conn = self.get_connection(self.mysql_conn_id)<EOL>conn_config = {<EOL>"<STR_LIT:user>": conn.login,<EOL>"<STR_LIT>": conn.password or '<STR_LIT>',<EOL>"<STR_LIT:host>": conn.host or '<STR_LIT:localhost>',<EOL>"<STR_LIT>": self.schema or conn.schema or '<STR_LIT>'<EOL>}<EOL>if not conn.port:<EOL><INDENT>conn_config["<STR_LIT:port>"] = <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>conn_config["<STR_LIT:port>"] = int(conn.port)<EOL><DEDENT>if conn.extra_dejson.get('<STR_LIT>', False):<EOL><INDENT>conn_config["<STR_LIT>"] = conn.extra_dejson["<STR_LIT>"]<EOL>if (conn_config["<STR_LIT>"]).lower() == '<STR_LIT:utf8>' or(conn_config["<STR_LIT>"]).lower() == '<STR_LIT:utf-8>':<EOL><INDENT>conn_config["<STR_LIT>"] = True<EOL><DEDENT><DEDENT>if conn.extra_dejson.get('<STR_LIT>', False):<EOL><INDENT>if (conn.extra_dejson["<STR_LIT>"]).lower() == '<STR_LIT>':<EOL><INDENT>conn_config["<STR_LIT>"] = MySQLdb.cursors.SSCursor<EOL><DEDENT>elif (conn.extra_dejson["<STR_LIT>"]).lower() == '<STR_LIT>':<EOL><INDENT>conn_config["<STR_LIT>"] = MySQLdb.cursors.DictCursor<EOL><DEDENT>elif (conn.extra_dejson["<STR_LIT>"]).lower() == '<STR_LIT>':<EOL><INDENT>conn_config["<STR_LIT>"] = MySQLdb.cursors.SSDictCursor<EOL><DEDENT><DEDENT>local_infile = conn.extra_dejson.get('<STR_LIT>', False)<EOL>if conn.extra_dejson.get('<STR_LIT>', False):<EOL><INDENT>dejson_ssl = conn.extra_dejson['<STR_LIT>']<EOL>if isinstance(dejson_ssl, six.string_types):<EOL><INDENT>dejson_ssl = json.loads(dejson_ssl)<EOL><DEDENT>conn_config['<STR_LIT>'] = dejson_ssl<EOL><DEDENT>if conn.extra_dejson.get('<STR_LIT>'):<EOL><INDENT>conn_config['<STR_LIT>'] = conn.extra_dejson['<STR_LIT>']<EOL><DEDENT>if local_infile:<EOL><INDENT>conn_config["<STR_LIT>"] = <NUM_LIT:1><EOL><DEDENT>conn = MySQLdb.connect(**conn_config)<EOL>return conn<EOL>
Returns a mysql connection object