@staticmethod
    def _parse_rtv_file(config):

        rtv = {}
        if config.has_section('rtv'):
            rtv = dict(config.items('rtv'))

        params = {
            'ascii': partial(config.getboolean, 'rtv'),
            'monochrome': partial(config.getboolean, 'rtv'),
            'clear_auth': partial(config.getboolean, 'rtv'),
            'persistent': partial(config.getboolean, 'rtv'),
            'history_size': partial(config.getint, 'rtv'),
            'oauth_redirect_port': partial(config.getint, 'rtv'),
            'oauth_scope': lambda x: rtv[x].split(',')
        }
        for key, func in params.items():
            if key in rtv:
                rtv[key] = func(key)

        bindings = {}
        if config.has_section('bindings'):
            bindings = dict(config.items('bindings'))

        for name, keys in bindings.items():
            bindings[name] = [key.strip() for key in keys.split(',')]

        return rtv, bindings
dataset/ETHPy150Open michael-lazar/rtv/rtv/config.py/Config._parse_rtv_file/original