<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_attributes(self, template_pack=TEMPLATE_PACK):
 """ Used by crispy_forms_tags to get helper attributes """

        items = {
            'form_method': self.form_method.strip(),
            'form_tag': self.form_tag,
            'form_style': self.form_style.strip(),
            'form_show_errors': self.form_show_errors,
            'help_text_inline': self.help_text_inline,
            'error_text_inline': self.error_text_inline,
            'html5_required': self.html5_required,
            'form_show_labels': self.form_show_labels,
            'disable_csrf': self.disable_csrf,
            'label_class': self.label_class,
            'field_class': self.field_class,
            'include_media': self.include_media
        }
        
        if template_pack == 'bootstrap4':
            bootstrap_size_match = re.findall('col-(xl|lg|md|sm)-(\d+)', self.label_class)
            if bootstrap_size_match:
                if template_pack == 'bootstrap4':
                    offset_pattern = 'offset-%s-%s'
                else:
                    offset_pattern = 'col-%s-offset-%s'
                items['bootstrap_checkbox_offsets'] = [offset_pattern % m for m in bootstrap_size_match]
        else:
            bootstrap_size_match = re.findall('col-(lg|md|sm|xs)-(\d+)', self.label_class)
            if bootstrap_size_match:
                if template_pack == 'bootstrap4':
                    offset_pattern = 'offset-%s-%s'
                else:
                    offset_pattern = 'col-%s-offset-%s'
                items['bootstrap_checkbox_offsets'] = [offset_pattern % m for m in bootstrap_size_match]

        items['attrs'] = {}
        if self.attrs:
            items['attrs'] = self.attrs.copy()
        if self.form_action:
            items['attrs']['action'] = self.form_action.strip()
        if self.form_id:
            items['attrs']['id'] = self.form_id.strip()
        if self.form_class:
            # uni_form TEMPLATE PACK has a uniForm class by default
            if template_pack == 'uni_form':
                items['attrs']['class'] = "uniForm %s" % self.form_class.strip()
            else:
                items['attrs']['class'] = self.form_class.strip()
        else:
            if template_pack == 'uni_form':
                items['attrs']['class'] = self.attrs.get('class', '') + " uniForm"
        if self.form_group_wrapper_class:
            items['attrs']['form_group_wrapper_class'] = self.form_group_wrapper_class

        items['flat_attrs'] = flatatt(items['attrs'])

        if self.inputs:
            items['inputs'] = self.inputs
        if self.form_error_title:
            items['form_error_title'] = self.form_error_title.strip()
        if self.formset_error_title:
            items['formset_error_title'] = self.formset_error_title.strip()

        for attribute_name, value in self.__dict__.items():
            if attribute_name not in items and attribute_name not in ['layout', 'inputs'] and not attribute_name.startswith('_'):
                items[attribute_name] = value

        return items