<commit_before>import copy
import yaml

class StyleOption(object):
	def __init__(self, name, options):
		self.name = name
		self.options = options

class Style(object):
    def __init__(self, base=None, style=None, hidden_base_style=None):
        if style is None:
            if base is not None:
                style = {'BasedOnStyle': base}
            elif style is None:
                style = {}
        elif base is None:
            base = style['BasedOnStyle']

        self.base = base
        self.style_dict = style
        self.hidden_base_style = hidden_base_style

    def __repr__(self):
        return 'Style(base=%r, style=%r)' % (self.base, self.style_dict)

    def dump(self, output_stream):
        yaml.safe_dump(self.style_dict, stream=output_stream, default_flow_style=False)
        if self.hidden_base_style:
            hidden_keys = [key for key in self.hidden_base_style.style_dict if key not in self.style_dict]
            if hidden_keys:
                hidden_yaml = yaml.safe_dump({k:self.hidden_base_style.style_dict[k] for k in hidden_keys}, default_flow_style=False)
                hidden_yaml = hidden_yaml.splitlines()
                output_stream.write('## Other available options and their default values:\n' % line)
                for line in hidden_yaml:
                    output_stream.write('# %s\n' % line)

    def style_with_overrides(self, overrides):
        # Find the base config to override.
        new_base = overrides.get('BasedOnStyle', self.base)
        new_style_dict = copy.deepcopy(self.style_dict)
        new_style_dict.update(overrides)

        return Style(base=new_base, style=new_style_dict)

    def style_with_defaults_hidden(self, base_style):<commit_msg>BUG: fix a issue with extra arg on formatting line<commit_after>import copy
import yaml

class StyleOption(object):
	def __init__(self, name, options):
		self.name = name
		self.options = options

class Style(object):
    def __init__(self, base=None, style=None, hidden_base_style=None):
        if style is None:
            if base is not None:
                style = {'BasedOnStyle': base}
            elif style is None:
                style = {}
        elif base is None:
            base = style['BasedOnStyle']

        self.base = base
        self.style_dict = style
        self.hidden_base_style = hidden_base_style

    def __repr__(self):
        return 'Style(base=%r, style=%r)' % (self.base, self.style_dict)

    def dump(self, output_stream):
        yaml.safe_dump(self.style_dict, stream=output_stream, default_flow_style=False)
        if self.hidden_base_style:
            hidden_keys = [key for key in self.hidden_base_style.style_dict if key not in self.style_dict]
            if hidden_keys:
                hidden_yaml = yaml.safe_dump({k:self.hidden_base_style.style_dict[k] for k in hidden_keys}, default_flow_style=False)
                hidden_yaml = hidden_yaml.splitlines()
                output_stream.write('## Other available options and their default values:\n')
                for line in hidden_yaml:
                    output_stream.write('# %s\n' % line)

    def style_with_overrides(self, overrides):
        # Find the base config to override.
        new_base = overrides.get('BasedOnStyle', self.base)
        new_style_dict = copy.deepcopy(self.style_dict)
        new_style_dict.update(overrides)

        return Style(base=new_base, style=new_style_dict)

    def style_with_defaults_hidden(self, base_style):
{'fraction_non_alphanumeric': 0.09023415191319246, 'fraction_numerical': 0.0, 'mean_word_length': 2.611340206185567, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '1582866', 'n_tokens_mistral': 1051, 'n_tokens_neox': 1017, 'n_words': 255}