def _create_naming_rules(self):
    regexps = {}
    hints = {}
    for name_type in KNOWN_NAME_TYPES:
        naming_style_option_name = f'{name_type}_naming_style'
        naming_style_name = getattr(self.config, naming_style_option_name)
        regexps[name_type] = NAMING_STYLES[naming_style_name].get_regex(name_type)
        custom_regex_setting_name = f'{name_type}_rgx'
        custom_regex = getattr(self.config, custom_regex_setting_name, None)
        if (custom_regex is not None):
            regexps[name_type] = custom_regex
        if (custom_regex is not None):
            hints[name_type] = ('%r pattern' % custom_regex.pattern)
        else:
            hints[name_type] = ('%s naming style' % naming_style_name)
    return (regexps, hints)
def _create_naming_rules(self):
    regexps = {}
    hints = {}
    for name_type in KNOWN_NAME_TYPES:
        naming_style_option_name = f'{name_type}_naming_style'
        naming_style_name = getattr(self.config, naming_style_option_name)
        regexps[name_type] = NAMING_STYLES[naming_style_name].get_regex(name_type)
        custom_regex_setting_name = f'{name_type}_rgx'
        custom_regex = getattr(self.config, custom_regex_setting_name, None)
        if (custom_regex is not None):
            regexps[name_type] = custom_regex
        if (custom_regex is not None):
            hints[name_type] = ('%r pattern' % custom_regex.pattern)
        else:
            hints[name_type] = ('%s naming style' % naming_style_name)
    return (regexps, hints)