def get_attributes(self, template_pack=TEMPLATE_PACK):
items = {<EOL>'<STR_LIT>': self.form_method.strip(),<EOL>'<STR_LIT>': self.form_tag,<EOL>'<STR_LIT>': self.form_style.strip(),<EOL>'<STR_LIT>': self.form_show_errors,<EOL>'<STR_LIT>': self.help_text_inline,<EOL>'<STR_LIT>': self.error_text_inline,<EOL>'<STR_LIT>': self.html5_required,<EOL>'<STR_LIT>': self.form_show_labels,<EOL>'<STR_LIT>': self.disable_csrf,<EOL>'<STR_LIT>': self.label_class,<EOL>'<STR_LIT>': self.field_class,<EOL>'<STR_LIT>': self.include_media<EOL>}<EOL>if template_pack == '<STR_LIT>':<EOL><INDENT>bootstrap_size_match = re.findall('<STR_LIT>', self.label_class)<EOL>if bootstrap_size_match:<EOL><INDENT>if template_pack == '<STR_LIT>':<EOL><INDENT>offset_pattern = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>offset_pattern = '<STR_LIT>'<EOL><DEDENT>items['<STR_LIT>'] = [offset_pattern % m for m in bootstrap_size_match]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>bootstrap_size_match = re.findall('<STR_LIT>', self.label_class)<EOL>if bootstrap_size_match:<EOL><INDENT>if template_pack == '<STR_LIT>':<EOL><INDENT>offset_pattern = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>offset_pattern = '<STR_LIT>'<EOL><DEDENT>items['<STR_LIT>'] = [offset_pattern % m for m in bootstrap_size_match]<EOL><DEDENT><DEDENT>items['<STR_LIT>'] = {}<EOL>if self.attrs:<EOL><INDENT>items['<STR_LIT>'] = self.attrs.copy()<EOL><DEDENT>if self.form_action:<EOL><INDENT>items['<STR_LIT>']['<STR_LIT:action>'] = self.form_action.strip()<EOL><DEDENT>if self.form_id:<EOL><INDENT>items['<STR_LIT>']['<STR_LIT:id>'] = self.form_id.strip()<EOL><DEDENT>if self.form_class:<EOL><INDENT>if template_pack == '<STR_LIT>':<EOL><INDENT>items['<STR_LIT>']['<STR_LIT:class>'] = "<STR_LIT>" % self.form_class.strip()<EOL><DEDENT>else:<EOL><INDENT>items['<STR_LIT>']['<STR_LIT:class>'] = self.form_class.strip()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if template_pack == '<STR_LIT>':<EOL><INDENT>items['<STR_LIT>']['<STR_LIT:class>'] = self.attrs.get('<STR_LIT:class>', '<STR_LIT>') + "<STR_LIT>"<EOL><DEDENT><DEDENT>if self.form_group_wrapper_class:<EOL><INDENT>items['<STR_LIT>']['<STR_LIT>'] = self.form_group_wrapper_class<EOL><DEDENT>items['<STR_LIT>'] = flatatt(items['<STR_LIT>'])<EOL>if self.inputs:<EOL><INDENT>items['<STR_LIT>'] = self.inputs<EOL><DEDENT>if self.form_error_title:<EOL><INDENT>items['<STR_LIT>'] = self.form_error_title.strip()<EOL><DEDENT>if self.formset_error_title:<EOL><INDENT>items['<STR_LIT>'] = self.formset_error_title.strip()<EOL><DEDENT>for attribute_name, value in self.__dict__.items():<EOL><INDENT>if attribute_name not in items and attribute_name not in ['<STR_LIT>', '<STR_LIT>'] and not attribute_name.startswith('<STR_LIT:_>'):<EOL><INDENT>items[attribute_name] = value<EOL><DEDENT><DEDENT>return items<EOL>
Used by crispy_forms_tags to get helper attributes