def detect_console_encoding():
    import locale
    global _initial_defencoding

    encoding = None
    try:
        encoding = sys.stdout.encoding or sys.stdin.encoding
    except AttributeError:
        pass

    # try again for something better
    if not encoding or 'ascii' in encoding.lower():
        try:
            encoding = locale.getpreferredencoding()
        except Exception:
            pass

    # when all else fails. this will usually be "ascii"
    if not encoding or 'ascii' in encoding.lower():
        encoding = sys.getdefaultencoding()

    # GH3360, save the reported defencoding at import time
    # MPL backends may change it. Make available for debugging.
    if not _initial_defencoding:
        _initial_defencoding = sys.getdefaultencoding()

    return encoding
Returns a list of tuples with the model field name and formatted
dataset/ETHPy150Open pydata/pandas/pandas/formats/format.py/detect_console_encoding--crossover with--dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/model/base.py/BaseModelView.get_column_names